Advertisement
Help Keep Boards Alive. Support us by going ad free today. See here: https://subscriptions.boards.ie/.
If we do not hit our goal we will be forced to close the site.

Current status: https://keepboardsalive.com/

Annual subs are best for most impact. If you are still undecided on going Ad Free - you can also donate using the Paypal Donate option. All contribution helps. Thank you.
https://www.boards.ie/group/1878-subscribers-forum

Private Group for paid up members of Boards.ie. Join the club.

Stop command prompt window from closing

  • 25-04-2005 07:02PM
    #1
    Closed Accounts Posts: 2,553 ✭✭✭


    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?


Comments

  • Closed Accounts Posts: 4,763 ✭✭✭Fenster


    Type echo on


  • Closed Accounts Posts: 2,553 ✭✭✭wolfman


    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


  • Closed Accounts Posts: 4,763 ✭✭✭Fenster


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


  • Registered Users, Registered Users 2 Posts: 19,531 ✭✭✭✭Krusty_Clown


    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:

    mycalc.bat
    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>


Advertisement