Batch to Continue After Program Opening
Some PC applications just work together like two peas in a pod. Think of Slack and Asana or Steam, Discord, and Twitch. When you're using one of these, launching the next one just feels natural.
Now, how do you feel about booting them all up with just one double-click? We'll show you how to launch multiple programs with one shortcut using a batch file.
1. Collect All the Program Paths You Want to Open Into Notepad
First, collect the program paths of the applications that you are trying to launch. Simply find the application's shortcut, right-click on it, and select Properties. The Target field is what we're looking for, though we'll split it up into the "Start in" and executable file portions.
Next, 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. And the third, fourth, fifth, etc. as needed.
2. Create the Batch File
To make this work, we now need to take those two (or more) 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 (x86)\Dropbox\Client\"
start Dropbox.exe
cd "C:\Program Files\Notepad++\"
start notepad++.exe
exit
Above is an example of the complete batch file script. This example opens both Dropbox and Notepad++, but you'll want to tweak these program paths with the ones you want to open.
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\Notepad++\"
This is changing our directory to the Notepad++ directory (which we got from the program path earlier).
start notepad++.exe
This is launching the executable file (that we noted down earlier) from within the directory we just navigated to. Note that some programs, like Dropbox, require a specific destination, such as the /home folder, which you'll also see in the Properties.
exit
That one should be self-explanatory. You don't need the batch file to remain open.
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 because we'll need it in the next step.
3. Create a Shortcut and Point It to the Batch File
You can now use the batch file to launch your programs, but why not spice it up a little? If you want to use a custom file icon for your batch file, we recommend using a shortcut.
Right-click the desktop and select New > Shortcut. Choose a location, ideally the same as your batch file, and click Next. Then enter a name for the shortcut and click Finish.
Now right-click your new shortcut file, select Properties, and update the Target field to point to your batch file. Click Apply and OK to save your changes and exit.
4. Customize Your Shortcut's Icon
This last step is optional, but if you choose to skip it, you'll be using the same Windows icon for every batch file shortcut you create. If you're going to create multiple shortcuts, we recommend assigning a unique icon to each.
Right-click your shortcut file, click on theShortcut tab, then click the Change Iconbutton. Windows will check for an icon for your batch file and find none, but that's fine; just click OK. Now you can select an icon from the Change Icon menu. Click OK to confirm your selection, then click OK again to close the shortcut properties.
5. 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 final line of the batch file forces), then your two applications should launch.
If all is in order, move your shortcut to a convenient location. For example, you could pin it to the Start menu or Quick access; both options show up in the shortcut's right-click menu.
Finally, don't forget to remove the shortcuts from your desktop that you no longer need.
Automation Starts With Small Shortcuts
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.
In fact, there are a few better places your icons can go than littering your desktop. For instance, Windows Libraries is a good alternative.
Source: https://www.makeuseof.com/tag/launch-multiple-programs-single-shortcut-using-batch-file/
0 Response to "Batch to Continue After Program Opening"
Post a Comment