批处理命令 for 详解【转】
sets
The following construction can be used as a workaround:FOR %%A IN (1 2 3) DO CALL TEST2.BAT %%A
If TEST2.BAT looks like this:IF "%VAR%"=="" SET VAR=%1
thenJump using?GOTO?in?command ?FOR %%A IN (1 2 3) DO GOTO=%%A
:1
ECHO 1
GOTO End
:2
ECHO 2
GOTO End
:3
ECHO 3
:End
will display different results for different command interpreters:
ECHO 3?and following commands?
?
?
?
?