Batching: The use of Echo
To display a command with the echo command, use the following syntax: echo [message]
Parameter on| OFF
Specifies whether to allow echo of the command. To display the current echo settings, you can use the echo with no parameters
Command.
The following code:
echo on
Echo 123
echo off
Echo 123
echo on
Echo 234
:: Echo off
Echo 333
echo on
Pause
echo off
Pause
Note: Each line of command execution will be wrapped and then executed by the next command.
1.echo on this command is displayed unless you add the @ sign at the beginning to hide the current line's command (this line). The function of this command is to set the Allow command to echo.
2.echo 123 because the Allow command echo is set, the command Echo 123 is displayed first and then the command is executed to display 123 .
3.echo off this command displays unless the @ symbol is added to hide the current line's command. The function of this command is to set not to allow the command to echo.
4.echo 123 because the command echo is not allowed, the command is executed directly (without displaying the command), which displays the 123
5.echo on because the command echo is not allowed, direct execution of the command allows the command to echo
6.echo 234 because the Allow command echo is set, the command Echo 234 is displayed first , and then the command line is executed to display 234
7. ::echo off is a function of annotations (also available in REM instead, semicolon ; no), so don't worry about it .
8.echo 333 function with 6
9.echo on because the Allow command echo is set, the command is displayed first, and then the command is executed (of course, the echo command has been turned on before, so this superfluous, hehe)
10.pause because the Allow command echo is set, pause is displayed first, and then the
11.echo off because the Allow command echo is set, the echo off is displayed first and then the setting does not allow the command to Echo
12.pause because the setting does not allow the command to echo, so the direct execution
Batching: The use of Echo