title: Check if process returns 0 with batch file
body: <p>I want to start a process with a batch file and if it returns nonzero, do something else. I need the correct syntax for that.</p>
  
  <p>Something like this:</p>
  
  <pre><code>::x.bat
  
  @set RetCode=My.exe
  @if %retcode% is nonzero
     handleError.exe
  </code></pre>
  
  <p>As a bonus, you may consider answering the following questions, please :)</p>
  
  <ul>
  <li>How to write a compound statement with <code>if</code>?</li>
  <li>If the application <code>My.exe</code> fails to start because some DLL is missing will my if work? If not, how can I detect that <code>My.exe</code> failed to start?</li>
  </ul>