\
Skip Navigation LinksHome > Coding > Scripting > MS-DOS > View Item Info\
 
 
[]Return to List
[]UDF / UDC Library
[]Script Library



 

Showing: ECHO Commands

ECHO is really two commands: one to control the ECHO status (whether the command lines in the file will be displayed, or just the messages they generate) using the ON and OFF arguments, and one to display text on the console. Considering the case of the first usage, if a batch file is always invoked or called by another, only the first one need have the @ECHO OFF command, which will remain in force as long as COMMAND.COM remains in batch mode. Note that this does not affect secondary command processors.

ECHO, without any arguments, simply displays the echo status: either ON or OFF.

ECHO seems to have been provided as a means of issuing messages to the user, but there are other uses. The not well documented syntax ECHO. (note the '.' at the end of the command) ECHOs a blank line. This is quite useful, when piped to certain commands, for supplying the required to terminate the command.
*

ECHO [State] [Text]
[Arguments] |  [Constants] |  [Return Type] |  [Script Example]

Arguments
[State]
(Optional) Switch to control if ECHO displays the command line to the console or not, where the switches can be either ON or OFF. If anything else is on the command line, state is treated as text

[Text]
(Optional) Any text to be displayed on the console. The text can also be a '.' (period) in which case a blank line, or return character is displayed.


Constants
MS-DOS does not use any constants


Return Type
If called without any arguments, ECHO will return the current ECHO state where the state can be either ON or OFF


Script Example
Unless otherwise noted, this code is licensed according to the terms and conditions listed here.
:: Current State of the ECHO
ECHO

:: Turn Echo Off
ECHO OFF

:: Display Text
ECHO This is a line of text

:: Display a blank Line
ECHO.

:: Redirected via Pipe
ECHO. | DATE

* This text may contain reprinted material from the Microsoft .

Help Support Dx21
Buy Thru Us

 FAQs  |  Terms Of Use  |  Privacy Policy  |  Contact Us
Copyright © 1997 - 2010 Dx21, LLC. All rights reserved.
Dx21, LLC a Washington Limited Liability Company
Page Rendered at: 9/8/2010 10:32:15 PM for Unknown