If you’re a Windows user, you can run an executable file using the command prompt. This is a great way to troubleshoot problems with your computer or to run specific commands. To run an executable file using the command prompt, open a new window and type “cmd” into the window’s title bar. Then type “netstat -an” to see the active network connections on your computer. Type “cmd” again and hit enter to run the executable file.


Most of the time our programs work just like we need them to, but every once in a while you have one that is less than cooperative and leaves you looking for a way to fix its ‘attitude’ problem. Today’s SuperUser Q&A post has some great suggestions to help a frustrated reader get the results he needs.

Today’s Question & Answer session comes to us courtesy of SuperUser—a subdivision of Stack Exchange, a community-driven grouping of Q&A web sites.

The Question

SuperUser reader user418119 wants to find a way to keep a program window open long enough to see the results:

Is there a way to make user418119’s program window stay open long enough to see the results?

  1. Run it so that the window does not close (and I can see my results)

Or

  1. Manage to do the same thing via Command Prompt

I am not super familiar with doing stuff via Command Prompt.

The Answer

SuperUser contributors mg30rg, misha256, and Ranayna have the answer for us. First up, mg30rg:

Followed by the answer from misha256:

And our final answer from Ranayna:

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 file (which you usually cannot).

Incidentally, the /K switch has been around since NT days.

Have something to add to the explanation? Sound off in the comments. Want to read more answers from other tech-savvy Stack Exchange users? Check out the full discussion thread here.