title: capture any error in VBScript?
body: <p>I have a batch file that calls a VBScript (.vbs) program.  After calling it, my batch script checks <code>%errorlevel%</code> to see if the .vbs program failed.  I can signal failure with an exit code in the .vbs program with <code>WScript.Quit(1)</code>.</p>
  
  <p>However, I can only do that explicitly.  If some unexpected run-time error happens, the .vbs quits with an error dialog box, <em>however the exit code is zero</em> so my batch file thinks it suceeded! How can I change that behavior?</p>
  
  <p>And if you are thinking of saying, use <code>on error goto</code>, don't bother... that syntax is available in regular VB, but not in VBScript.</p>