eof
是“end of file”的缩写
在批处理作用主要有二:
1、在无call的情况下,会直接退出批处理,此时等同于exit
2、在call的情况下,会中止call,继续执行其他命令
情况一:
@echo off
call :testgoto
:testgoto
echo 1
goto :eof
echo 2
pause
输出结果:
C:\Users\Gan>D:\批处理资料\test.bat
1
1
情况二:
@echo off
call :testgoto
echo 2
goto :eof
:testgoto
echo 1
goto :eof
输出结果:
C:\Users\Gan>D:\批处理资料\test.bat
1
2
情况三:
@echo off
goto :testgoto
echo 2
goto :eof
:testgoto
echo 1
goto :eof
输出结果:
C:\Users\Gan>D:\批处理资料\test.bat
1