Multiple commands in CMD cd c: & dir

8 12 2009

Multiple commands in CMD

&
command1 & command2
Execute Command1 and then execute Command2

&&
command1 && command2
Runs the command2 only when command1 does Complete successfully

||
command1 || command2
Runs the second command if the first command had an error

()
(command1 || command2) || (command3 & command4)
Defines the order in which commands are to be executed

More Info .. Copied From “ntcmds.chm” Present In “%SystemRoot%\Help”
>
Writes the command output to a file or a device, such as a printer, instead of the Command Prompt window.
<
Reads the command input from a file, instead of reading input from the keyboard.
>>
Appends the command output to the end of a file without deleting the information that is already in the file.

>&
Writes the output from one handle to the input of another handle.
<&
Reads the input from one handle and writes it to the output of another handle.

|
Reads the output from one command and writes it to the input of another command. Also known as a pipe.

Advertisement

Actions

Information

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Connecting to %s




Follow

Get every new post delivered to your Inbox.