How can I run a program from a batch file without leaving the console open after the program starts?

Mister Dev picture Mister Dev · Nov 27, 2008 · Viewed 740.3k times · Source

For the moment my batch file look like this:

myprogram.exe param1

The program starts but the DOS Window remains open. How can I close it?

Answer

Marshall picture Marshall · Mar 21, 2013

Use the start command to prevent the batch file from waiting for the program. Just remember to put a empty double quote in front of the program you want to run after "Start". For example, if you want to run Visual Studio 2012 from a batch command:

Start ""  "C:\Program Files (x86)\Microsoft Visual Studio 11.0\Common7\IDE\devenv.exe"

notice the double quote after start.