Tutorial by Examples

To display "Some Text", use the command: echo Some Text This will output the string Some Text followed by a new line. To display the strings On and Off (case insensitive) or the empty string, use a ( instead of white-space: echo(ON echo( echo(off This will output: ON off ...
The echo setting determines whether command echoing is on or off. This is what a sample program looks like with command echoing on (default): C:\Windows\System32>echo Hello, World! Hello, World! C:\Windows\System32>where explorer C:\Windows\System32\explorer.exe C:\Windows\System32&gt...
Quotes will be output as-is: echo "Some Text" "Some Text" Comment tokens are ignored: echo Hello World REM this is not a comment because it is being echoed! Hello World REM this is not a comment because it is being echoed! However, echo will still output var...
Ways to create a file with the echo command: echo. > example.bat (creates an empty file called "example.bat") echo message > example.bat (creates example.bat containing "message") echo message >> example.bat (adds "message" to a new line in example.bat)...
@echo off prevents the prompt and contents of the batch file from being displayed, so that only the output is visible. The @ makes the output of the echo off command hidden as well.
In the following example echo on will take effect after the end of the brackets context is reached: @echo off ( echo on echo ## ) echo $$ In order to "activate" echo on in a brackets context (including FOR and IF commands) you can use FOR /f macro : @echo off setlocal ...

Page 1 of 1