(Contents)(Previous)(Next)

Using Command Separators for Sequential and Logical Execution of Commands (Windows NT Only)

The Windows NT command processor allows you to specify more than one command on the command prompt line by using the ampersand character as a command separator. For example, the following command will launch both Explorer and Write from the command line

Explorer&Write

You can even add a limited amount of conditional execution to your command stack using two other command separators. If you separate two command using a double ampersand (&&), then the second command will be executed only if the first command runs successfully. Running successfully means it must be a valid command, it must run to normal termination, and it must not set a nonzero errorlevel on exit. If you use a double bar (||) as command separator, then the second command will only be executed if the first command fails.


(Next)