How To Create A Batch File That Opens Applications You Choose From A List
In a previous tip, I showed you how to create a batch file to open multiple applications at once.
That batch file works great if you want the same applications to always open at once.
But, what if you have a number of applications that you use frequently, and only want to choose from a list, a certain combination of applications to open at the same time?
For example, you have a book report due and you need to research the material on the Internet. In this case you want to open Microsoft Word and Firefox.
Or, it's time to pay the bills, and you need to open Notepad, Calculator and Microsoft Excel.
To do this we can create a batch file with a list of applications. When you run the batch file, a menu will appear that will accept user input from the command line and open the applications that you choosen (as shown in above screen shot).
To create the batch file, first, you will want to make a list of applications that you use frequently.
For this example, I will select six applications (remember they can be any amount and type of applications you want to use):
- Notepad
- Calculator
- Microsoft Word
- Microsoft Excel
- Internet Explorer
- Firefox
Next, find the executable path for each application. This can be accomplished by finding the shortcut of the application in the Start Menu and right click on the application icon (make sure the Shortcut tab is selected).

For Microsoft Office Applications, you will need to look in the folder where Office is installed. On my computer, the executable path is:
C:\Program Files\Microsoft Office\Office12 EXCEL.EXE
NOTE: Your path may be different depending on the version of Windows and Office you are using.
For any application executable that you can not find, use Windows search (in XP and Vista) to help find the location.
Create The Batch File
Just right click on your desktop and select New \ TextDocument.
Next name the file what ever you want and for now, leave the extension as .txt (I have named my file chooseapp.txt).
Open the file that you created using notepad, then copy and paste the following code. An explanation of the code is listed below:
@echo off
cls
:start
echo.
echo 1. Notepad
echo 2. Calculator
echo 3. Microsoft Word
echo 4. Microsoft Excel
echo 5. Internet Explorer
echo 6. Firefox
echo 7. I'm Done
echo.
echo.
set /p x=Pick:
IF '%x%' == '%x%' GOTO Item_%x%
:Item_1
start /MIN /DC:\Windows\System32 notepad.exe
GOTO Start
:Item_2
start /MIN /DC:\Windows\System32 calc.exe
GOTO Start
:Item_3
start /MIN /D"C:\Program Files\Microsoft Office\Office10" WINWORD.EXE
GOTO Start
:Item_4
start /MIN /D"C:\Program Files\Microsoft Office\Office10" EXCEL.EXE
GOTO Start
:Item_5
start /MIN /D"C:\Program Files\Internet Explorer\iexplore.exe" http://www.google.com
GOTO Start
:Item_6
start /MIN /D"C:\Program Files\Mozilla Firefox" firefox.exe http://www.google.com
GOTO Start
:Item_7
exit
Here's How The Batch File Works
- The @echo off prevents displaying results of the commands at the prompt.
cls – clears the screen
:start – begins the commands to display the list
echo. – creates a blank line
echo 1. Notepad
echo 2. Calculator
echo 3. Microsoft Word
echo 4. Microsoft Excel
echo 5. Internet Explorer
echo 6. Firefox
echo 7. I'm Done
The above lines are the applications that will be displayed in the list. You should edited these lines with the names of the applications you want displayed.
set /p x=Pick: – set the variable name x=Pick that is used in the next line
IF '%x%' == '%x%' GOTO Item_%x% – statement that determines what number in the list you chose and to go to the line (GOTO) that will open the application.
—>>>The above two lines should not be edited<<<—
:Item_1
start /MIN /DC:\Windows\System32 notepad.exe
GOTO Start
All lines starting with :Item_ and their number (in my example 1 to 6) is where you enter the path and executable name of the application to be opened.
The start command has two parts:
MIN will minimize the application when it is opened (NOTE: some applications will ignore this and NOT open minimized).
/DC:\Windows\System32 notepad.exe is where you enter the path and executable name. You will need to edit this parameter with the application you want opened.
GOTO Start – tells the batch file to return to the Start line in the beginning that will allow you to make another selection.
:Item_7
exit
The above lines ends the batch file when you select option 7. Depending on the number of applications in YOUR list, make sure to re-number the list including the last item that is used to exit the batch file.
When finished, save the file and don't forget to rename the file (right click on the file and select rename) and use .bat as the extension.
Time To Run The Batch File
To run it, double click on the batch file. A command window will appear allowing you to make your selections one at a time (it will loop) by entering the number next to the word Pick, then pressing the Enter key.
After making your selections, don't forget to select the last number in the list so the batch file will exit.
If you need to re-edit the batch file, just right click on it and select edit (don't double click to edit). After editing, save the file before closing.
As you can see, creating this batch file can be a handle little utility to have around. It can also be used to not only open applications, but files that you may use frequently (just create another line in the list and add the path to the file with the file name).
Filed under Windows Tips by
Leave a Comment



Comments on How To Create A Batch File That Opens Applications You Choose From A List
Interesting idea.
Hi, Thank you very much!~
it was nice stuff. thanks a lot………
its very amazing the ease with which i access applications using these files is
fantastic
OK can such a batch file be set up to actually launch a program, and then its scan button (a security app) to scan (what drives it will scan would be previously set up in its option/preference tab.
thk u dear its very nice.
hi i know its a folt i made but how can i resolv this it dont wona open.
:Item_4
start /MIN /D"C:\Program Files\Malwarebytes' Anti-Malware\mbam.exe"
GOTO Start
its jabardast………………..
Nice Article………..
@christian you need to do this:
:Item_4
start /MIN /D"C:\Program Files\Malwarebytes' Anti-Malware" mbam.exe
GOTO Start
the diferent is this: start /MIN /D"C:\Program Files\Malwarebytes' Anti-Malware" >>mbam.exe<<
Nice tips… Thanks a lot…………..
Gud work bro, keep it coming. but can you post a short post on the batch files.
Thanks for your post, it helped me much! I should only say that I found out that it's much better to create batch files with help of Dr.Batcher ( http://www.drbatcher.com ). It supports syntax highlighting, tips on parameters, and lets you convert batch file to EXE, so it's really handy.
Hey thanks a lot. It works perfect !
Now, how do you make the programs run without prompts? Like, if I want ccleaner to run in a certain way, automatically.
START /MIN /D "E:\Program Files\Malwarebytes' Anti-Malware" mbam.exe
GOTO Start
This worked for me!
will you please tell me how i can delete ntdetect.com file with the help of .bat file
Hello,
I download lots of stuff from Internet, And lots of stuff gets stored in temp folder.I want to delete all the contents of temp folder,I want help in writing a batch file, which would do this.
What a greatfull tip!!!! Thank you!!! It solved a problem that i have
on my job!!!
Hey frenz how to make a batch program which opens photoes instead of application.
Ex.
instea:menu
cls
:start
echo.
echo 1. Notepad
echo 2. Calculator
echo 3. Microsoft Word
echo 4. Windows Media Player
echo 5. Google Chrome
echo 6. Internet Explorer
echo 7. I'm Done
echo.
echo.
set /p x=Pick:
IF '%x%' == '%x%' GOTO Item_%x%
:Item_1
%SystemRoot%\system32\notepad.exe
GOTO Start
d of programs i want to open photoes. Is it possible? how?
Hey frenz how to make a batch program which opens photoes instead of application.
Ex.
instea:menu
cls
:start
echo.
echo 1. Notepad
echo 2. Calculator
echo 3. Microsoft Word
echo 4. Windows Media Player
echo 5. Google Chrome
echo 6. Internet Explorer
echo 7. I'm Done
echo.
echo.
set /p x=Pick:
IF '%x%' == '%x%' GOTO Item_%x%
:Item_1
%SystemRoot%\system32\notepad.exe
GOTO Start
instead of programs i want to open photoes. Is it possible? how?
This is amazing however i want whenever i press 4 then multple excel file should be open which i have instead of one excel file
plz give me a ans it's urget
@Akramul Jakir:
@echo off
cls
:start
echo.
echo 1. Photo 1
echo 2. I'm Done
echo.
echo.
set /p x=Pick:
IF '%x%' == '%x%' GOTO Item_%x%
:Item_1
start /MIN /Droot photoname.jpg
GOTO Start
add more obviously. that should work.
I want to open this batch with firefox
@echo off
set google"http://www.google.com/search?q="
set "site=+site:%www.mediafire.com"
set /p "string=Search Details: "
start "" %google%%string%%site%
thank u