title: using errorlevel in a batch file to know if a program exited normally
body: <p>We have a program that is occasionally crashing. The customer runs the program from a scheduled task. When the program is run with a certain parameter, the program runs as an interface engine, creating a file and then ftp'ing the file to another server for import by another program. </p>
  
  <p>I was wondering if I might have the scheduled task instead run a batch file. The batch file would run the program and check <code>errorlevel</code> as the program exits. If <code>errorlevel</code> is not equal to zero, then batch file would run the program again. Does anyone see problem with my plan to use <code>errorlevel</code> in a batch file?  </p>
  
  <p>Here's an example of the batch file:</p>
  
  <pre><code>:start    
  myPgm.exe intfc    
  if errorlevel &lt;&gt; 0 then start
  </code></pre>