Command Prompt Commands .com

 

echo command

             Name a star after a person

Prints its own arguments back out to the DOS equivalent of the standard output stream. Usually, this means directly to the screen, but the output of echo can be redirected like any other command. Often used in batch files to print text out to the user.
echo this is text              Outputs 'this is text'
echo.                          Outputs a blank line
    
Another important use of the echo command is to toggle echoing of commands on and off in batch files.
echo on               turns on echoing of commands
echo off              turns off echoing of commands
    
Traditionally batch files begin with the @echo off statement. This says to the interpreter that echoing of commands should be off during the whole execution of the batch file thus resulting in a "tidier" output. The @ symbol declares that this particular command (echo off) should also be executed without echo. For example the following 2 batch files are equivalent:
Batch1.bat:
@echo off
echo The files in your root directory:
dir /b /a-d c:\
    
Batch2.bat:
@echo The files in your root directory:
@dir /b /a-d c:\
    
Echo can be used to write to files directly from the console, by redirecting the output stream:
echo text > filename
    
Echo can also be used to append to files directly from the console, again by redirecting the output stream:
echo text >> filename
    
To type more than one line from the console into a file, use copy con (above).
Equivalent to the Unix command echo.

Command Prompt Commands » echo