Using ECHO for outputting
1 January 2000 by Snakefoot | Comment » | Trackback OffThe ECHO command can be used to output status messages during the execution of a batch file:
When executing commands in a batch file, then the command-line for the command is shown unless one specifies the following command at the top of the batch file (Note the "@" keeps the comand from being shown):ECHO Hello world...
To create a newline or carriage return (Notice the "."):@echo off
ECHO Hello world...
To create a beep sound in the PC-Speaker using CTRL+G (If using EDIT.EXE press CTRL+P before CTRL+G):ECHO.
To send a keystroke to a program:ECHO ^G
To create a new file(status.txt) containing a text line:ECHO Y | DEL *.*
To append a text line to an existing file(status.txt):ECHO No errors detected > status.txt
To create a batch file inside a batch-file:ECHO Batch Program Ends >> status.txt
To send a command to a modem connected to the COMx port:ECHO ECHO Hello > Hello.bat
CALL Hello.bat
REM *** AT = Attention, M1 = Turn speaker on, L3 = High speaker volume
REM *** X0 = Do not wait for dialtone, DT12345 = Dial 12345
ECHO ATM1L3X0DT12345 > COMx
REM *** AT = Attention, H0 = Hook off the modem
ECHO ATH0 > COMx
More Info MS KB Q84279
More Info MS KB Q105940
Updated: 23 February 2008