------------------------- MS-DOS v6.22 Help: Echo --------------------------
<Notes> <Examples>                                               <Index>


Displays or hides the text in batch programs when the program is running.
Also indicates whether the command-echoing feature is on or off.

When you run a batch program, MS-DOS typically displays (echoes) the batch
program's commands on the screen. You can turn this feature on or off by
using the ECHO command.



To use the echo command to display a message, use the following syntax:

    echo [message]


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

    Specifies text you want MS-DOS to display on the screen.

Related Command

For information about suspending the execution of a batch program, see the
<PAUSE> command.


<Syntax> <Examples>


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 MS-DOS from echoing a line

You can insert an at sign (@) in front of a command in a batch program to
prevent MS-DOS 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 >) by using the
ECHO command.

<Syntax> <Notes>


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.


<Top of page>
Last update: December 07, 2002 14:45 by
Content © 1997 Microsoft Corporation
All else © 2000-2005