Purpose:Display a message to the standard error device (stderr)


Format:ECHOERR message


messageText to display.






ECHOERR (like ECHO in message display mode) parses and expands message, and displays it on stderr (usually the screen), instead of stdout. Even if stdout of a batch file is redirected or piped, ECHOERR will still display a screen message, unless stderr is redirected or piped (see Redirection). Any display sent to stderr after message has been displayed will start on a new line.


Display rules


The first space after the command name is ignored.

Trailing spaces in message are ignored.

Functions and variables not enclosed between back quotes are expanded.

To include special characters, .e.g, < | >, in message, enclose them in double quotes or back quotes (see Parameter Quoting)  or precede them with the escape character, or use the /X option of the SETDOS command.

To display % you may alternately use two % marks for each one to be displayed, e.g., %%

To display trailing spaces, either enclose them in back quotes, or append a pair of back quotes behind them, e.g., echoerr trailers   ``

The ASCII NUL character cannot be included in message.

If stderr is the console, after displaying message on the current line, the cursor will be moved to the beginning of the next line.

If stderr is a file, the CR LF sequence will be appended to message.