Skip to content

Instantly share code, notes, and snippets.

@joe-oli
Created January 30, 2020 06:04
Show Gist options
  • Save joe-oli/d13bdf10f60ae161f4142c45501c745b to your computer and use it in GitHub Desktop.
Save joe-oli/d13bdf10f60ae161f4142c45501c745b to your computer and use it in GitHub Desktop.
starts cmd prompt, runs cmd, and remains open
Put in your batch file
start cmd.exe /k "net use"
From cmd /?
Starts a new instance of the Windows XP command interpreter
CMD [/A | /U] [/Q] [/D] [/E:ON | /E:OFF] [/F:ON | /F:OFF] [/V:ON | /V:OFF] [[/S] [/C | /K] string]
/C Carries out the command specified by string and then terminates
/K Carries out the command specified by string but remains
========
FOR EXAMPLE, create a file `start-server.cmd` that you can click on from File Explorer;
-------------------------------
REM npx json-server --help or -h
REM --watch, -w
REM --port, -p
start cmd.exe /k "npx json-server -p 4000 --watch db.json"
-------------------------------
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment