title: parsing command line output on Windows command line batch file
body: <p>I have this command that scan a file and returns a summary.</p>
  
  <p>For example on running this command</p>
  
  <pre><code>omsCmdLineUtil.exe process C:\test.exe Default
  </code></pre>
  
  <p>the result output is:</p>
  
  <pre><code>Ticket:[ 2214271306 ]
  
  Process Details
  ---------------
  
  
  File: [ C:\test.exe ]
     MD5: [ D41D8CD98F00B204E9800998ECF8427E ]
     SHA1: [ DA39A3EE5E6B4B0D3255BFEF95601890AFD80709 ]
     SHA256: [ E3B0C44298FC1C149AFBF4C8996FB92427AE41E4649B934CA495991B7852B855 ]
     File Size: [ 0 bytes ]
     File Type  Category: [ O ]
     File Type: [ - ]
     File Type Description: [ empty ]
  
  [ Clean ] Ahnlab scan engine [ 1 ms ]
  [ Clean ] ClamAV scan engine [ 1 ms ]
  [ Clean ] BitDefender scan engine [ 1 ms ]
  [ Clean ] Avira scan engine [ 1 ms ]
  [ Clean ] Quick Heal scan engine [ 1 ms ]
  [ Clean ] ThreatTrack scan engine [ 1 ms ]
  [ Clean ] ESET scan engine [ 1 ms ]
  [ Clean ] Total Defense scan engine [ 1 ms ]
  
  Scan Completion
  ---------------
          [ Clean ]
          Ticket: [ 2214271306 ]
          File path: C:\test.exe
          Scan time: 1 ms [12/20/2015 13:00:06:791]
  
  
  Process Completion
  ------------------
          Ticket: [ 2214271306 ]
          User agent: Default
          Profile: Default
          Result: [ Allowed ]
          File processed: C:\test.exe
  </code></pre>
  
  <p>I want to create a batch file that parses this result by searching for the output line <code>Result:</code>, check if it's <code>[ Allowed ]</code> or <code>[ Blocked ]</code> and return <code>0</code> for <code>allowed</code> and <code>1</code> for <code>blocked</code>.</p>
  
  <p>I tried something like this, but its not really working:</p>
  
  <pre><code>omsCmdLineUtil.exe process C:\test.exe Default | set ts = findstr /C:"Result: [ Allowed ]"
  
  if %ts% == "Result: [ Allowed ]" return 0
  else return 1
  </code></pre>
  
  <p>Which modification on code is necessary to get the expected result?</p>