MS-DOS program automatically closes.

By glowingnissan07
Sep 26, 2007
  1. I guess Windows hates DOS programs. I need to keep a file called Loader.exe open, instead of it automatically closing after clicking on it. i know i know, there was already a thread on keeping DOS programs open, but i already looked at them and tried some stuff but i suck at command line typing. Now im just confused.

    Actually, I think Loader.exe is not an MS-DOS program on account it doesnt have the MS-DOS icon. But i know its one of those dos programs, having that blank window as its icon. But it has limited options on that, unlike MS-DOS programs, which you change virtual memory and all that stuff. I have Windows XP by the way and a very fast computer.

    I'm actually looking for some clarification on this "run--> cmd \k some command sequence" where the k flag should keep the dos program from closing immediately after opening. If i can figure that out, i should be able to keep Loader.exe open like a few others on Techspot were able to do.

    The problem is, "run" isnt a valid command in cmd.exe. START is. so im assuming the above solution is used in the Run Window on the window's start menu. but with that, you cant type a "cmd", you can only type the program's location in there, and that always ends in the programs immediate termination.

    and in command prompt (cmd.exe?)typing START \k C:\Program Files\....\Loader.exe says it doesnt recognize \k as an existing directory. you cant put the \k before START because then it doesnt recognize \k as a command. Im definately no programmer, and since I suck at command typing, a little help in LAMEN's terms would be nice.

    "run-->cmd \k some command sequence" means what, exactly?

  2. Rick

    Rick TechSpot Staff Posts: 4,572   +65

    This might seem a little silly, but the solution should be:
    cmd.exe /k "C:\Program Files\...\Loader.exe"
    The above should work in the Start > Run box OR if you make a shortcut. You can forget about start, since it is not necessary here.

    Here's how it works... cmd.exe tells windows to start its command shell. We then pass off the /k switch to the command shell which tells the window that it needs to stay open. Lastly, we tell cmd to run your Loader.exe program by adding its path at the end in quotes, because path names in the command line environment cannot have spaces unless they are contained in quotes.
Topic Status:
Not open for further replies.

Similar Topics

Add your comment to this article

You need to be a member to leave a comment. Join thousands of tech enthusiasts and participate.
TechSpot Account You may also...