START

Posted On 2007-04-25 by FortyPoundHead
Keywords: Command Reference
Tags: Windows Commandline Windows
Views: 1513


Start a specified program or command in a separate window.

Syntax
START "title" [/Dpath] [options] [command] [parameters]

Key
WHAT to run

path : Starting directory
command : The NT Command, Batch file or executable program to run
parameters : The parameters passed to the command

HOW to run it

/MIN : Minimized
/MAX : Maximized
/WAIT : Start application and wait for it to terminate
/LOW : Use IDLE priority class
/NORMAL : Use NORMAL priority class
/HIGH : Use HIGH priority class
/REALTIME : Use REALTIME priority class
"title" : Text for the CMD window title.
/B : Start application without creating a new window. In this case
^C will be ignored - leaving ^Break as the only way to
interrupt the application
/I : Ignore any changes to the current environment.

Options for 16-bit WINDOWS programs only

/SEPARATE Start in separate memory space (more robust)
/SHARED Start in shared memory space (default)Examples

START "My Login Script" /Min Login.cmd

START "" /wait MySlowProgram.exe

Notes:
Although ["title"] is supposedly an optional parameter, when it is omitted other
options may be interpreted as being the title - so to be absolutely sure put
something in like "My Script" or just a pair of empty quotes "".

Document files may be invoked through their file association just by typing the name
of the file as a command.
e.g. START WORD.DOC would launch the application associated with the .DOC file extension

Printers
A new printer can be installed very quickly (and the driver downloaded) with the command
START \\print_server\printer_name

Setting a Working Directory
To start an application and specify where files will be saved

START /Dc:\Documents\ /MAX notepad.exe

Note that START /D does not support long filenames which contain spaces, a
workaround is to use the 8.3 compatible name(s)

Forcing a Sequence of Programs
If you require your users to run a sequence of 32 bit GUI programs to complete a task,
create a batch file that uses the start command:

@echo off
start /wait /b First.exe
start /wait /b Second.exe
start /wait /b Third.exe

Create a shortcut to this batch file and place it on the Start menu or desktop. Set
it to run minimized.

When the user double-clicks the shortcut, runs.
When terminates, runs
When terminates, runs

An alternative method is to run a .BAT batch file under command.com (16 bit)

If Command Extensions are disabled, the START command will no longer recognise file
Associations, and will not automatically evaluate the COMSPEC variable when
starting a second CMD session.

Missing file extensions
When executing a command line whose first token does NOT contain an extension, then
CMD.EXE uses the value of the PATHEXT environment variable to determine which
extensions to look for and in what order. The default value for the PATHEXT variable
is:

.COM;.EXE;.BAT;.CMD

Notice the syntax is the same as the PATH variable, with semicolons separating the
different elements.

When executing a command, if there is no match on any extension, then NT will look
to see if the name, without any extension, matches a directory name and if
it does, the START command will launch Explorer on that path.


About the Author

FortyPoundHead has posted a total of 1974 articles.


Comments On This Post

No comments on this post yet!


Do you have a thought relating to this post? You can post your comment here. If you have an unrelated question, you can use the Q&A section to ask it.

Or you can drop a note to the administrators if you're not sure where you should post.


Your IP address is:23.20.165.182

Before you can post, you need to prove you are human. If you log in, this test goes away.




Code Links