How to Use the START Command in Batch Script
-
Use the
START
Command in Batch Script -
Use the
START
Command With the Windows Title and Location -
Use the
START
Command With the Location and Filename
In this tutorial, we will see how we can use the Batch START
command and some of the options used with this command.
Use the START
Command in Batch Script
Through this command, you can run another program from your Batch Script. The general format to use this command is given below.
START "Windows_title" [/D Your_Path_Here] [OPTIONS] "COMMANDS"
Windows_title
is optional here, and the location you provide in this command should be the exact path of the program file. COMMANDS
are the action that needs to be done.
Most Used OPTIONS for the START
Command
Below we shared some most used options for this command. Using them is optional, and if you don’t use them, the command will run in default mode.
Let’s have a look at them and discuss them briefly.
OPTIONS | Description |
---|---|
/MIN |
The Window will open in minimized mode through this option. |
/MAX |
The Window will open in maximized mode through this option. |
/W |
Through this option, the program will open in a new window and wait until it terminates. |
/B |
The program will open in a new window by including this option. |
/I |
By including this option, if any changes in the environment occur, it will ignore them. |
/LOW , /NORMAL , /ABOVENORMAL , /BELOWNORMAL , /HIGH , /REALTIME |
These are provided to specify priority to the program. |
There are two formats available for this command. Either you can use the Windows title
and Location
of the program or only use the Location
. We will open Windows default Notepad.exe
using these two formats of the command so you can understand them easily.
Use the START
Command With the Windows Title and Location
If you know the Window’s title of the file and have the exact location, you can use the command in the following format:
start "Windows Title" c:\Location\file.exe
The below example will open notepad.exe
from the location c:\windows\system32\notepad.exe
.
start "Notepad" c:\windows\system32\notepad.exe
You can notice that we used the Window’s title of the Notepad application and included the exact location of the Notepad application. You can use some options if necessary.
Use the START
Command With the Location and Filename
You can also use the below command to open the .exe
file. To use this command, you need the location and the file name.
The general format to use this command with location and file name is shown below.
start "c:\location\" file.exe
We are going to open notepad.exe
using this command.
start "c:\windows\system32" notepad.exe
You can notice that we used only the exact location of the Notepad application, c:\windows\system32
, and the name of the program, notepad.exe
. You can include necessary options here too.
Remember, all methods discussed here are written using Batch Script and will only work in a Windows CMD environment.
Aminul Is an Expert Technical Writer and Full-Stack Developer. He has hands-on working experience on numerous Developer Platforms and SAAS startups. He is highly skilled in numerous Programming languages and Frameworks. He can write professional technical articles like Reviews, Programming, Documentation, SOP, User manual, Whitepaper, etc.
LinkedIn