Turns the command-echoing feature on or off, or displays a message.

echo [on | off] [message] 


on | off
Specifies whether to turn the command-echoing feature on or off. To display the current echo setting, use the echo command without a parameter.

Specifies text you want Windows NT to display on the screen.

Using a message with the echo command

The echo message command is useful when echo is off. To display a message that is several lines long without displaying other commands, you can include several echo message commands after the echo off command in your batch program.

Hiding the command prompt

If you use the echo off command on the command line, the command prompt does not appear on your screen. To redisplay the command prompt, type echo on.

Preventing Windows NT from echoing a line

You can insert an at sign (@) in front of a command in a batch program to prevent Windows NT from echoing that line.

Echoing a blank line

To echo a blank line on the screen, you can type echo and then a period (echo.). There must be no intervening space.

Displaying pipes and redirection characters

You cannot display a pipe (|) or redirection character (< or >) when using the echo command.


The following example shows a batch program that includes a three-line message preceded and followed by a blank line:

echo off 
echo This batch program 
echo formats and checks 
echo new disks 

If you want to turn echo off and you do not want to echo the echo command itself, include an at sign (@) before the command, as follows:

@echo off 

You can use the if and echo commands on the same command line, as follows:

if exist *.rpt echo The report has arrived. 

See Also