Batch-script-echo

提供:Dev Guides
移動先:案内検索

バッチスクリプト-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