1 Reply Latest reply: Jun 18, 2014 9:53 AM by Celvin Kattookaran RSS

    Maxl Log Error Handling

    891075

      Hi All,

      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%

      line3- exit

       

      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!

       

      Regards,

      Simon

        • 1. Re: Maxl Log Error Handling
          Celvin Kattookaran

          No matter what errorlevel it is always going to exit. You'll have to write a goto statement and then use exit there.

           

          IF  not errorlevel 1 GOTO PlanningLoad Error

           

          ':PlanningLoadError (remove the ' it was converting colon and P to a smiley)

          echo Error in Planning load >>%Log%

          exit

           

          Regards

           

          Celvin