title: Force batchfile to fail in Jenkins
body: <p>I have a windows batchfile run by Jenkins that check a file,
  in case that the responce is fail the batchfile must return an error code.</p>
  
  <p>I've tryed to do it in the following way:</p>
  
  <pre><code>findstr /m /c:"FAIL" testJenkins.log
  if not errorlevel 1 (
      EXIT /B 1
      echo main batch  FAIL &gt;&gt;testJenkins.log 
  ) else (
   findstr /m /c:"SKIP" testJenkins.log
   if not errorlevel 1 (
       EXIT /B 1
       echo main batch  SKIP &gt;&gt;testJenkins.log 
   ) else (
       EXIT /B 0 
     echo main batch  PASS &gt;&gt;testJenkins.log 
   )
  )
  </code></pre>
  
  <p>but the result of the Jenkins job is always green.</p>