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
callcommand in front of every command in your script, then usepauseat the end. - Run the script as an administrator.
- Create another script in which you use
callto call your original script, followed bypause.
References:
How to prevent batch file (.bat) from closing terminal when running commands?

