ECHO and ECHOERR - Display a message / set echo state
Purpose: Display a message, enable or disable batch file or
command-line echoing, or display the echo status.
Format: ECHO [ON | OFF | message ]
ECHOERR message
message : Text to display.
See also: ECHOS, SCREEN, SCRPUT, SETDOS and TEXT.
Usage
CMD.EXE has a separate echo capability for batch files and for the
command line. The command-line ECHO state is independent of the batch
file ECHO state; changing ECHO in a batch file has no effect on the
display at the command prompt, and vice versa.
To see the current echo state, use the ECHO command with no arguments.
This displays either the batch file or command-line echo state,
depending on where the ECHO command is performed.
In a batch file, if you turn ECHO on, each line of the file is displayed
before it is executed. If you turn ECHO off, each line is executed
without being displayed. ECHO can also be used in a batch file to
display a message on the screen. Regardless of the ECHO state, a batch
file line that begins with the [@] character will not be displayed. To
turn off batch file echoing, without displaying the ECHO command, use
this line:
@echo off
ECHO commands in a batch file will send messages to the screen while the
batch file executes, even if ECHO is set OFF. For example, this line
will display a message in a batch file:
echo Processing your print files...
If you want to echo a blank line from within a batch file, enter:
echo.
You cannot use the command separator character [&], or the redirection
symbols [| > <] in an ECHO message, unless you enclose them in quotes
(see Argument Quoting) or precede them with the escape character.
ECHO defaults to ON in batch files. The current ECHO state is inherited
by called batch files. You can change the default setting to ECHO OFF
with the SETDOS /V0 command, the Options 1 page of the OPTION dialogs, or
the BatchEcho directive in the .INI file.
If you turn the command-line ECHO on, each command will be displayed
before it is executed. This will let you see the command line after
expansion of all aliases and variables. The command-line ECHO is most
useful when you are learning how to use advanced features. This example
will turn command-line echoing on:
[c:\] echo on
ECHO defaults to OFF at the command line.
ECHOERR acts like ECHO but sends its output to the standard error device
(usually the screen) instead of the standard output device. If the
standard output of a batch file is redirected to a file or another device
with >, ECHOERR will still generate a screen message. See Redirection
and Piping for more information about the standard output and standard
error devices and redirection.
Created using Inf-PHP v.2 (c) 2003 Yuri Prokushev
Created using Inf-HTML v.0.9b (c) 1995 Peter Childs