Search code examples
cmd

How can I keep using the command prompt after executing a .cmd file in Windows?


After I double clicked a .cmd file and it executed successfully, it just closed the command prompt window. Even if I add pause to the end it also closes after I hit any key. So is there a way to let me keep using the command prompt, just as if I got the window from running cmd?


Solution

  • very simple.

    Add the following line to the end of your code: start /b cmd