wolfman Banned

How can I stop the command prompt window from closing when i run an exe file?

Ihave a file and when i run it, the command prompt window opens and waits for me to verify... yes OR no

Once I type in yes, the program runs but the window shuts
I need the window to remain open to read details from it

If I do it using start-->all programs-->accessories-->command prompt and change into the folder/directory where the exe file is stored and run it then, it will work ok, but surely there is a way that it can be run by double clicking the file itself without having to do this each time?

Fenster Registered User

Type echo on

wolfman Banned

how do you mean?
i dont open the window to type it
i double click the exe file and it runs thru a few lines and then prompts for yes or no

Fenster Registered User

Enter the command "echo on" and then try to run the .exe

Krusty_Clown Registered User

Probably the easiest thing to do is to create a batch file, like so:

cmd.exe /K [The path and name of your file]

So, for example, to launch calculator from the desktop in a command line window and have it persist, create a batch file like this:

cmd.exe /k c:\windows\system32\calc.exe

Alternatively, create (or edit) an icon for the application you wish to run, and change the target to: cmd.exe /k <path and name of the EXE you wish t have run in the window>

Want to share your thoughts?

Login here to discuss!