goto
- help goto
Output:
バッチ プログラム内の、ラベルで指定されている行へ制御を移動します。
GOTO ラベル
ラベル バッチ プログラムでラベルとして使用するテキスト文字列を指定します。
ラベルの先頭には : (コロン) を指定し、ラベルだけを単独で 1 行に入力してくだ
さい。
コマンド拡張機能を有効にすると、GOTO は次のように変更されます:
GOTO コマンドにターゲット ラベルとして :EOF を指定し、現在のバッチ
スクリプト ファイルの最後に制御を移すことができるようになります。
ラベルを定義しないでバッチ スクリプト ファイルを終了するには、この方法
が簡単です。この機能を実用化する CALL コマンドの拡張機能の説明について
は、「CALL /?」と入力してください。
Directs cmd.exe to a labeled line in a batch program.
GOTO label
label Specifies a text string used in the batch program as a label.
You type a label on a line by itself, beginning with a colon.
If Command Extensions are enabled GOTO changes as follows:
GOTO command now accepts a target label of :EOF which transfers control
to the end of the current batch script file. This is an easy way to
exit a batch script file without defining a label. Type CALL /? for a
description of extensions to the CALL command that make this feature
useful.
Return Code: 1