批處理指令碼 - ECHO



ECHO

此批處理命令顯示訊息,或開啟或關閉命令回顯。

語法

ECHO “string”

示例

以下示例顯示了 dir 命令的不同變體。

Rem Turns the echo on so that each command will be shown as executed 
echo on 
echo "Hello World" 

Rem Turns the echo off so that each command will not be shown when executed 
@echo off 
echo "Hello World" 

Rem Displays the contents of the PATH variable 
echo %PATH%

輸出

以下輸出將顯示在命令提示符中。

C:\>Rem Turns the echo on so that each command will be shown as executed

C:\>echo on

C:\>echo "Hello World"
"Hello World"

C:\>Rem Turns the echo off so that each command will not be shown when executed

"Hello World"
C:\Users\ADMINI~1\AppData\Local\Temp
batch_script_commands.htm
廣告
© . All rights reserved.