Note: I’m not sure how accurate any of this is - it’s just here for my future reference.
If starting the command prompt, use the /k
switch:
cmd.exe /k
If you have a batch file (AKA script) and you’d like the command prompt to stay open when it’s finished, try the pause
command at the end of the script.
... do stuff ...
pause
On Windows 7 this may not work. You could try these workarounds:
- Use the
call
command in front of every command in your script, then usepause
at the end. - Run the script as an administrator.
- Create another script in which you use
call
to call your original script, followed bypause
.
References:
How to prevent batch file (.bat) from closing terminal when running commands?