Batch script error level is not getting reset [duplicate]
问题 This question already has answers here : ERRORLEVEL inside IF (1 answer) ERRORLEVEL vs %ERRORLEVEL% vs exclamation mark ERRORLEVEL exclamation mark (1 answer) Closed 5 months ago . I am writing a small BAT file where it will search for "FAIL" Keyword followed by PASS - if none is found then take it as an error: echo set "topLevel=%cd%" If [%1]==[] exit /B 1 If [%2]==[] exit /B 1 If [%3]==[] exit /B 1 If [%4]==[] exit /B 1 findstr /? >NUL 2>&1 || exit /B 1 set "arg1=%1" set "arg2=%2" set "arg3