Do not include spaces before the dot. Otherwise, the dot will be displayed instead of a blank line.
To prevent repeat commands at the command prompt, type:
echo off
Note :
When the echo command is turned off, the command prompt will not appear in the Command Prompt window. To display the command prompt again, type echo on.
To prevent all commands in a batch file (including the echo off command) displayed on the screen, on the first line of the batch file, enter:
@echo off
You can use the echo command as part of an if statement. For example, to search for the current directory for any file with the .rpt file name extension and to repeat the message if you find such a file, enter:
if exist *.rpt echo The report has arrived.
The following batch file is searched in the current directory where the file has a file name extension of .txt and displays a message indicating the search results:
@echo off if not exist *.txt ( echo This directory contains no text files. ) else ( echo This directory contains the following text files: echo. dir /b *.txt )
If the .txt file cannot be found when the batch file is run, the following message will appear:
This directory contains no text files.
If the .txt file is found when the batch file is run, the following output is displayed (this example, assuming files File.txt, File2.txt and File3.txt exist):
This directory contains the following text files: File1.txt File2.txt File3.txt