我有一个批处理文件,它从文本文件中解析出一堆文件名,并将它们连接成一个强大的文件 - 之前已经讨论过here . 但是,我没有尝试过:
set FILE_LIST=
for /f %%x in (temp.txt) do (
:: perform a VCS test
accurev diff -b %%x
:: skip concatenation if error level is > 2
IF errorlevel 2 GOTO NEXT
:: perform the concatenation
set FILE_LIST=!FILE_LIST! %%x
:NEXT
:: print a message if here due to an error above
IF errorlevel 2 echo VCS problem with this file: %%x
)
问题是 - 一旦发现一个大于2的错误级别,脚本似乎停止执行整个for循环 . 如果列表中有五个文件而第三个文件有VCS问题 - 脚本只处理前两个 .
2 回答
参考this link了解如何处理"feature" .