Thursday, November 6, 2014

Launch Multiple Programs From A Single Shortcut Using A Batch File

By Craig Snyder
Some PC applications just work together like two peas in a pod. I’m talking about pairs like Winamp and Last.fm. There’s Skype and Pidgin, Steam and Raptr, and more. When you’re using one of these, launching the next one just feels natural. However, having too many paired program groups like this can really cause some serious clutter on the desktop.
That being said, is there really a need to have both shortcuts on your desktop when two applications work alongside each other? If you don’t think so and you’re running Windows, let me show you how to combine both applications into a single shortcut icon for your desktop.

Pick Your Icon

The first step to setting this up, after you’ve picked out the two (or more) applications that you want to combine into a single shortcut, is selecting your main shortcut icon. This is an optional step of the process, but bypassing it means that you’ll be using the Windows icon for every batch file as your shortcut icon.
batfile1   Launch Multiple Programs From A Single Shortcut Using A Batch File
If the desktop icon you want to use is already on the desktop, then good. Keep it there. If not, find the application whose icon you want to use (either through your Start menu or through Windows Explorer), right-click on it, and select Desktop (create shortcut) from the Send to menu.

Get Program Paths

The next step is to collect the program paths of the applications that you are trying to launch. Again, to do this you can use the Start menu or Windows Explorer. Simply find the application, right-click on it, and select Properties. The Target field is what we’re looking for.
batfile2   Launch Multiple Programs From A Single Shortcut Using A Batch File
Copy what’s in that field and paste it into an empty Notepad window so that you have it somewhere easily accessible. Do this same thing with the second program that you’re trying to launch.

Create the Batch File

To make this work, we now need to take those two application paths and work them into a batch file. We have explained how to write simple batch file previously. Open the Notepad file that contains the program paths you copied earlier and adjust it to look like the example below.
@echo off
cd "C:\Program Files\CCleaner"
start CCleaner64.exe
cd "C:\Program Files (x86)\Wunderlist2"
start Wunderlist.exe
exit
Above is an example of the complete batch file script. Below is a breakdown of what is going on in the script.
@echo off
This simply prevents commands from being displayed in the command prompt, which is used to execute your batch file.
cd "C:\Program Files\CCleaner"
This is changing our directory to the CCleaner directory (which we got from the program path earlier).
start CCleaner64.exe
This is launching the executable file (that we noted in Notepad earlier) from within the directory we just navigated to.
exit
That one’s kind of self-explanatory.
batfile3   Launch Multiple Programs From A Single Shortcut Using A Batch File
In Notepad, save this file (making sure your Save as type is set to All Files) with the .bat extension. Take note of the path where you’ve saved this file at, in Notepad, because we’ll need it in the next step.

Point Your Shortcut to the Batch File

Remember that icon we placed on the desktop earlier? Right-click it, select Properties, and look at the Target field. This should display the path to your application.
batfile4   Launch Multiple Programs From A Single Shortcut Using A Batch File
Now, change that to the path of your batch file. Click Apply and OK.

Launch Your Batch File From The Shortcut

Now, double-click the shortcut icon on your desktop. You should see a command prompt window quickly open, then close (as the first line of the batch file forces), then your two applications should launch!

Conclusion

As someone who really appreciates automation, it’s worth it to take these five minutes of your time to save yourself the unnecessary clicks and effort it would otherwise take you to launch two applications at once. It keeps your desktop nice and tidy, too.
Got any neat ideas for other ways that this batch file trick could work? Any suggestions for program pairs that you’d throw in a batch file like this? Leave me a comment below and let’s talk about it!
Are batch files really not your thing? Check out my favorite application launcher for WindowsFingertips! Feeling cluttered on your desktop but really not interesting in combining shortcut icons? Here’s how to clean up your desktop efficiently!  Source: www.makeuseof.com

No comments:

The 15 Most Influential Websites of All Time

The 15 Most Influential Websites of All Time