Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

"subfolder\program to run.exe" works but keeps the command prompt open.

I would like the command prompt to close but keep the application open, how do I do this.

share|improve this question
add comment

2 Answers

up vote 2 down vote accepted

The other answer works fine for me in XP, but you can also try the following instead:

start "" "subfolder\program to run.exe" & exit

share|improve this answer
    
This worked but the answer by benshepherd doesn't...are you able to explain why? –  Ben Apr 6 '13 at 18:24
    
Not sure. As I mentioned above, the other one worked fine too for me on XP, and I tested both methods with calc as well as a non-Microsoft program. Perhaps the problem lies with the specific program you're testing with. –  Karan Apr 6 '13 at 21:11
    
I guess I’m just pushing the question a few inches, but it seems to come down to whether you get your “Command Prompt” prompt back immediately after you type program_name, or do you have to wait until it terminates. Typically, if you type calc or notepad, you get your prompt back immediately. But I’ve seen it work the other way for some programs (e.g., Microsoft Office) on some machines. I don’t know why. (continued…) –  Scott Jun 21 '13 at 23:46
    
… And, if you have a program that locks up the prompt, any commands you put after it (e.g., & exit) will be processed only after the program finishes. And the start command, among other things, seems to “detach” the program from the command interpreter, allowing you to get the prompt back (and, hence, allowing the exit command to be processed) immediately. –  Scott Jun 21 '13 at 23:47
    
@Scott: start of course can /wait for a program to terminate as well. You're most likely correct in that the OP's program probably wasn't returning control back to the command prompt for the exit command to be executed successfully. –  Karan Jun 21 '13 at 23:50
add comment

You can append & exit to the command you run. So for instance, from the command prompt:

calc & exit

runs Calculator and closes the commmand prompt window.

share|improve this answer
    
This does not work. The command prompt is still open whilst the application is. –  Ben Mar 20 '13 at 15:15
    
What OS are you using? It works for me in Win7 and XP. –  benshepherd Mar 25 '13 at 9:53
    
I am running Windows XP –  Ben Apr 6 '13 at 18:20
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.