Usually, the file name is setup.exe or installer.msi. The way you would execute it through the command line: Click Start, type: cmd. Right click CMD. Click Run as administrator. At the command prompt, type: cd d: This will change to the CD or DVD drive if that is where the installation file is located.
The Question SuperUser reader user418119 wants to find a way to keep a program window open long enough to see the results: I am trying to run an iteration program. 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: 1. Run it so that the window does not close (and I can see my results) Or 2. Manage to do the same thing via Command Prompt I am not super familiar with doing stuff via Command Prompt.
Is there a way to make user418119’s program window stay open long enough to see the results? The Answer SuperUser contributors mg30rg, misha256, and Ranayna have the answer for us. First up, mg30rg: You can create a batch file (.bat) containing two lines. The first one is your application’s command line and the second one is “PAUSE”. It will keep the Command Prompt window open until you press a key or close it using the “X” button. The advantage of this solution is that you can have a separate shortcut to the.bat file so that you can either start your program with or without pausing at the finish. Followed by the answer from misha256: This will leave the Command Prompt 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 file (which you usually cannot). Incidentally, the /K switch has been around since NT days. And our final answer from Ranayna: Another way which is quite useful if the path to the.exe file is a complicated one: Open a Command Prompt window and just drag the.exe file into the window. The full path to the.exe file will be pasted into the Command Prompt window and you just have to press Enter. There is no need to cd into any paths.
Have something to add to the explanation? Sound off in the comments. Want to read more answers from other tech-savvy Stack Exchange users?.
This answer is almost always the wrong one. At the very least it is incomplete. Specifically, this approach works fine for INSTALLING, but not good for uninstalling. Most uninstallers will WHIPE out the entire PATH variable when uninstalling the application associated with this. Therefor, if you write an install action to add the dir to PATH, you should make it a CUSTOM install action that isn't automatically uninstalled by the generic remove package. Then, match that Custom install step with an uninstall step that removes only your dir from the PATH variable.
– Mar 6 '15 at 21:33. It's a problem with the installer. But since all installers do this to variables (they don't parse and extract portions of registry entries or ENV VARIABLES), it seems prudent to explain it.
If one follows the directions exactly, they will always run into this issue, which means, the solution should probably always include that caveat. No install packages take care of installing and uninstalling sections of Registry entries or ENV variables that I know of, although please let me know if there is some I don't know of.
– Mar 6 '15 at 21:40. Add to the PATH, steps below (Windows 10):. Type in search bar 'environment.' And choose Edit the system environment variables which opens up the System Properties window. Click the Environment Variables.
![Cmd Cmd](/uploads/1/2/5/6/125629720/185281838.jpg)
Button. In the Environment Variables tab, double click the Path variable in the System variables section. Add the path to the folder containing the.exe to the Path by double clicking on the empty line and paste the path. Click ok and exit. Open a new cmd prompt and hit the command from any folder and it should work.