Batch File To Open Multiple Applications

Though an antiquated way of doing things I still use batch files occassionally. Most notably when I start work at the beginning of the day I always launch the same applications so I have a batch file to launch them. These batch files are set to launch an application then wait a specific amount of time before launching the next one. (The preference to wait between each application launches is because many of the machines I use are slow and I don’t want to overtax them by having several apps launching at the same time.) This isn’t particularly tough to do but on the occassions I need to set one up on a PC that I haven’t used before (such as a new or borrowed PC) I get a little confused about how to set them up the way I like them. So here’s how:

start /d “C:\path\to\application” executable.exe
sleep x

The start command tells windows to open a new window for the program we are about to launch. If we didn’t use this command then it would wait for the first application to close before launching the second one.

The /d switch tells the start command to use the path that follows it (“C:\path\to\application” in the above example) to launch the application (executable.exe in the example above). I know it’s a bit weird but that’s the way it works.

Next the sleep command tells windows to wait a specific number of seconds before moving on to the next line of the batch file (which in my case is another line that launches another application). If the sleep command doesn’t work on your machine you can get it by installing the Windows XP Service Pack 2 Support Tools.

Here’s a real life example:
start /d “C:\Program Files\Microsoft Office\Office12” OUTLOOK.EXE
sleep 10
start /d “C:\Program Files\AIM” aim.exe

In this case the batch file will launch Outlook, wait 10 seconds, then launch AIM.

Tags:

If you enjoyed this post, please consider to leave a comment or subscribe to the feed and get future articles delivered to your feed reader.