我正在尝试编写一个使用起始变量运行多个操作的脚本,但它不起作用:该变量仅在第一次解析时才正确。你知道我做错了什么吗?这是批处理文件的限制还是我做错了什么?启用的扩展技术也不起作用。
SET FILE1=zr1
SET FILE2=za1
SET FILE3=za2
FOR /L %%I IN (1,1,3) DO (
-o "%%FILE%%I%%.out"
ECHO %%FILE%%I%%
CD p:\compress\compare
XCOPY "p:\compress\compare\%%FILE%%I%%.out"
RENAME "%%FILE%%I%%.out" "TEST"
XCOPY "p:\compress\compare\%%FILE%%I%%.out" /e
RENAME "%%FILE%%I%%.out" "GOOD"
COMPARE
RENAME "OUTPUT" "%%FILE%%I%%.out"
CD p:\compress\outputFILEs
XCOPY "p:\compress\compare\%%FILE%%I%%.out" /e
)