Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to start a GUI app from the command line in the background?

I'm using start cmd.exe /c to start new command line processes in the background. But when I execute GUI apps this way, it creates an unnecessary command line window.

like image 442
Jader Dias Avatar asked Jul 03 '11 23:07

Jader Dias


2 Answers

If the program you want to start needs to be quoted since it contains spaces or shell metacharacters in its path, then you need to supply an empty quoted argument to start:

start "" "C:\Program Files\SomeProgram\Some program.exe"

That's because start interprets the first quoted argument as the title for a new console window, running cmd.

like image 198
Joey Avatar answered Nov 07 '22 03:11

Joey


Just say start myprogram.exe. It'll return immediately and it won't start an unnecessary instance of the shell.

like image 33
Kerrek SB Avatar answered Nov 07 '22 03:11

Kerrek SB