Windows – How to disable the command prompt’s auto-close upon completion

command linewindows 7

I know there were some tricks with older versions of windows to accomplish this, but not sure on windows 7.

If I had a piece of software that executes a command with switches resulting in a cmd.exe window opening and closing quickly, how can I reconfigure the command prompt to NOT auto-close once the task is complete.

The trick here is that the command being executed is indeed a batch file, includes a pause statement at the end, but the way the software is trying to execute the command is failing. Since it closes so quickly, we don't know what error is being returned since it closes so quickly.

Best Answer

Instead of running that .bat file directly from Explorer or whatever other method you use, manually launch cmd.exe(if needed with elevated privileges) and then run your .bat file from there. Then upon completion of its execution you will still see all the output...just like in the good old DOS days. :)