I am using the below script to abort the batch process on error in maxl log.
line1- findstr /m "ERROR" D:\PLANNING_LOAD\PLAN.log >> %Log%
line2- if %errorlevel%==0 >> %Log%
Batch process is terminating at line 2 even though there is no error in PLAN.log. I used echo to check the value of ERRORLEVEL, its is showing 0 at the start of the process and changing to 1 after line2 . Please let me know as I am confused as to how this works. Thanks!