我的Windows批处理文件中出现“goto在这个时候是意外的”错误。就像下面。我不知道。任何人都可以帮助我?感谢转到这个时候是意外的。批处理文件
@setlocal EnableExtensions EnableDelayedExpansion
@echo off
SET TEMPERL=%TMP%\perlversion.txt
for /f "tokens=*" %%a in (%TEMPERL%) do (
set line=%%a
if not "%line:subversion%"=="%line%" goto GETVERSION
)
:GETVERSION
set mainver=%line:*perl=%
set mainver=%mainver:~1,1%
echo This is perl %mainver%
:END
endlocal
并不需要'then'? – DevZer0
你有没有试过里面使用!变!而不是%变量%FOR循环? – Dale
@ DevZer0'然后'不需要批处理 – foxidrive