“Start” is the Batch File version of “bg”

1 minute read

If you want a batch file to spawn another program and then go on with its life (or end, if there’s no other commands) you need to specially ask it to. Normally, if a batch file spawns another program, the batch file will wait at that point until you close that program.

What you need is the batch file command called start. Like so:

start "A Pretty Title for your Program" myprogram.exe

The first argument is always a title, and the second is the name of your program if you don’t specify any switches inbetween.

As an example, here’s a batch file I made called acroread.bat which is useful for starting Adobe Acrobat from the command line without changing your path, or typing in the full path to the executable.

rem @echo off
start "Acrobat" "C:\Program Files\Adobe\Acrobat 7.0\Reader\AcroRd32.exe" %*
exit

Normally, if you were to double-click on that batch file, it would leave a cmd shell up until you closed Acrobat Reader. start prevents that. Note that if you’re actually running this from the command line you should omit the exit command. I included it because this batch file is being spawned by another program, LyX, in order to view PDFs, and I never wanted to see a shell prompt. LyX for Windows 1.33 currently doesn’t like spaces, so I couldn’t specify a location for Acrobat Reader with spaces. I made the acroread.bat file to fix that, and put it in a directory in the path that has no spaces.

Orig. reference: http://www.americatoday.com/hanar/dosb.htm

Updated: