Skip to content

cmd: add documentation of the double pipe feature #8048

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions WindowsServerDocs/administration/windows-commands/cmd.md
Original file line number Diff line number Diff line change
Expand Up @@ -77,16 +77,18 @@ The following table lists valid hexadecimal digits that you can use as the value
<command1> > <file1.txt>
```

- To use multiple commands for `<string>`, separate them by the command separator `&&`. For example:
- To use multiple commands for `<string>`, you can either separate them by `&&` in which case the subsequent command will execute only if the previous command succeeded, or by `||` in which case the subsequent command will execute only if the previous command failed. In the following example `<command2> || <command3>` will execute if `<command1>` succeeds and `<command3>` will execute if `<command2>` fails:

```
<command1>&&<command2>&&<command3>
<command1> && <command2> || <command3>
```

A command is considered successful if it finishes with an `ERRORLEVEL` of 0.

- If the directory path, files, or any information you supply contains spaces, you must use double quotation marks (`"`) around the text, such as `"Computer Name"`. For example:

```
mkdir Test&&mkdir "Test 2"&&move "Test 2" Test
mkdir Test && mkdir "Test 2" && move "Test 2" Test
```

- You must use quotation marks around the following special characters: & < > [ ] | { } ^ = ; ! ' + , ` ~ [white space].
Expand Down