ECHO OFF Prevents ANSI Escape Sequences Using PROMPT

This article was previously published under Q71558
This article has been archived. It is offered "as is" and will no longer be updated.
SUMMARY
If ECHO is currently OFF in a batch file, ANSI escape sequences cannot beissued using the PROMPT $E[... statement. ECHO must be temporarily turnedON, or the escape sequences must be issued using ECHO <esc>[..., where<esc> is whatever sequence of characters is used by a particular texteditor to specify an escape character (for example, ^V[ in Edlin).
MORE INFORMATION
When ECHO is OFF in a batch file, command lines in the batch file(including the command prompt) are not echoed to the screen. Thus, thecommand prompt containing the desired escape sequence is not echoed to theconsole, and the escape sequence is not issued. If the prompt contains anescape sequence when the batch file ends execution, this escape sequence isissued.

If the DOSSHELL command is executed from a batch file with the echo off andMS-DOS Shell is then used to execute a batch file that uses PROMPT $E[...,the escape sequence is not issued. Shell must first be terminated, eitherby using F3 or by explicitly setting ECHO ON, before the batch file can beused to issue escape sequences.
3.20 3.21 3.30 4.00 4.01a 5.00 5.00a 6.00 6.20 \* testwin4
Properties

Article ID: 71558 - Last Review: 12/04/2015 09:07:33 - Revision: 2.1

Microsoft MS-DOS 3.1, Microsoft MS-DOS 3.2 Standard Edition, Microsoft MS-DOS 3.21 Standard Edition, Microsoft MS-DOS 3.3 Standard Edition, Microsoft MS-DOS 3.3a, Microsoft MS-DOS 4.0 Standard Edition, Microsoft MS-DOS 4.01 Standard Edition, Microsoft MS-DOS 5.0 Standard Edition, Microsoft MS-DOS 5.0a, Microsoft MS-DOS 6.0 Standard Edition, Microsoft MS-DOS 6.2 Standard Edition, Microsoft MS-DOS 6.21 Standard Edition, Microsoft MS-DOS 6.22 Standard Edition

  • kbnosurvey kbarchive KB71558
Feedback