可使用如下形式判断文件中是否包含指定字符串,包含则ERRORLEVEL为0,否者为1,然后通过goto在指定条件下跳过某些流程
find /I "_str" "test.txt" >nul
if %ERRORLEVEL% EQU 1 goto WAIT1
rem 文件中不包含_str则为1,此时重命名
ren "tools\help\*.jar" tools\help\*_postfix.jar"
:WAIT1