"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.
The other answer works fine for me in XP, but you can also try the following instead:
start "" "subfolder\program to run.exe" & exit
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…)
Jun 21, 2013 at 23:46
& 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.
Jun 21, 2013 at 23:47
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.
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.