title: Need help to check error log and decide to continue or exit
body: <p>Hi I am writing a batch file.  The purpose is I run a commond, and catch the log file in "log.txt"  if this log.txt file contains "return code: 8" or "return code: 12" or "return code: 16"  I must stop execution for remaining.</p>
  
  <p>Sample batch file is as below (SAP Transport)</p>
  
  <pre><code>For /F "tokens=1,2" %%a in (trlist.txt) do (
    tp import %%a SYSTEMID client=%%b u01 pf=c:\trans\sap\bin\dbc.pfl 1&gt;&gt;c:\log.txt 2&gt;&amp;1
    findstr /C:"return code: 8" c:\log.txt
    if errorlevel 0 goto END
    findstr /C:"return code: 12" c:\log.txt
    if errorlevel 0 goto END
    findstr /C:"return code: 16" c:\log.txt
    if errorlevel 0 goto END
  )
  
  Echo "Processed successfully ...:"&gt;c:\result.txt
  Echo "Check the c:\log.txt file " &gt;&gt;c:\result.txt
  Exit
  
  :END
  Echo "Error occured... " &gt; c:\result.txt
  Echo "Check the c:\log.txt file." &gt;&gt;c:\result.txt
  Exit.
  </code></pre>
  
  <p>after each execution of TP, check the log.txt file.  If this contains any of the above mentioned return code, should stop further execution.</p>
  
  <p>Script is getting exited though "return code: 4" and "return code: 0" which should not exit.</p>
  
  <p>I am running the above bat file on Windows 2008 server.</p>