DOS gotoeofの役割
Role Dos Goto Eof
eof
'ファイルの終わり'の略語です
2つの主な効果のバッチ:
1、呼び出しがない場合、バッチは終了します。この場合、終了と同等です。
2、呼び出しの場合、呼び出しは中止され、他のコマンドは実行を継続します
ケース1:
@echo off call :testgoto :testgoto echo 1 goto :eof echo 2 pause
出力:
C: Users Gan> D: batch data test.bat 1 1
ケース2:
@echo off call :testgoto echo 2 goto :eof :testgoto echo 1 goto :eof
出力:
C: Users Gan> D: batch data test.bat 1 2
ケース3:
@echo off goto :testgoto echo 2 goto :eof :testgoto echo 1 goto :eof
出力:
C: Users Gan> D: batch data test.bat 1