Home > Commands A-M > Batch E


Description | Syntax | Parameters | Switches | Related | Notes | Examples | Errorlevels | Availability

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, the operating system typically displays (echoes) the batch program's commands on the screen. You can turn this feature on or off by using the ECHO command.




Display a message:

ECHO [message]

Display a blank line:


message (v2.0 Win95 NT3.5)
Specifies up to 122 characters of text you want DOS to display on the screen (249 characters for Windows or NT).
ON | ( OFF v2.0 Win95 NT3.5)
Specifies whether to turn the command-echoing feature on or off. To display the current ECHO setting, use the ECHO command without a parameter.
. (v5.0 Win95 NT4)
Displays a single blank line; sends a CRLF to the standard output device. Can be redirected.

/? (NTXP)
Display help.


For information about suspending the execution of a batch program, see the PAUSE command.
SET - Create and display environment variables.
TYPE - Display the contents of a text file.
Equivalent Linux BASH commands:
echo - Display message on screen.

NT Command characters

Command characters will normally take precedence over the ECHO statement e.g. The redirection and pipe characters: & < > | ON OFF

To override this behaviour you can escape each command character with ^:

   ECHO Nice ^&Easy
   ECHO Salary is ^> Commision
   ECHO Name ^| Username ^| Expiry Date
   ECHO:Off On Holiday

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 the operating system from echoing a line

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

Echoing a blank line

In v5.0 (and later), to echo a blank line on the screen, you can type ECHO and then a period (ECHO.). There must be no intervening space.

Beginning with v3.30, you could place a period (.), plus (+), slash (/), comma (,), left bracket ([), right bracket (]), or colon (:) immediately after the ECHO command.

Placing a doublequote (") immediately after the ECHO (ECHO") command could echo a blank line.

Prior to v3.30, placing an ALT-255 would echo a blank line.

Echoing a environment variable

To display the %PATH% variable:

    ECHO %path%

If the variable does not exist - ECHO will simply return the text "%path%"

Displaying pipes and redirection characters

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


Shows a batch program that includes a three-line message preceded and followed by a blank line:

    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:


You can use the IF and ECHO commands on the same command-line:

    IF EXIST *.RPT ECHO The report has arrived.



v2.0 v2.01 v2.05 v2.10 v2.11 v2.11R v2.12 v2.2 v2.25 v3.0 v3.20 v3.05 v3.1 v3.21 v3.25 v3.30 v3.3A v3.3R v3.3T v3.31 v3.40 v4.0 v4.01 v4.01A v5.0 v5.0A v5.00.02 v5.001A v5.01 v5.02 v6.0 v6.10 v6.2 v6.21 v6.22 v6.23 v7.00 v7.0R1 v7.10 v8.00
Win95 Win98 WinME
Windows NT
NT3.5 NT4 NT2000 NTXP NT2003