Running .exe in command prompt

cmd.execommand line

I'm trying to run an iteration program, and whenever I click on it, it opens then terminates. When I open the input text file, using the program, the iteration completes, then the window instantly closes. How can I either run it so that the window does not close (and I can see my results), or manage to do the same thing in command prompt. I'm not super familiar with doing stuff in command prompt.

Best Answer

This will leave the console window open even after MyApp.exe terminates:

cmd /K "C:\SomeFolder\MyApp.exe"

You can create a shortcut with the above. This solution works with all console programs and does not require you to go through Command Prompt every time (or modify the original exe which you usually can't).

Incidentally the /K switch has been around since NT days :-p

Related Question