batch-file Echo Displaying Messages


To display "Some Text", use the command:

echo Some Text

This will output the string Some Text followed by a new line.

To display the strings On and Off (case insensitive) or the empty string, use a ( instead of white-space:


This will output:



It is also common to use echo. to output a blank line, but please see the remarks for why this is not the best idea.

To display text without including a CR/LF, use the following command:

<nul set/p=Some Text

This command will attempt to set the variable called the empty string to the user input following a prompt. The nul file is redirected to the command with <nul, so the command will give up as soon as it tries to read from it and only the prompt string will be left. Because the user never typed a new line, there is no linefeed.