title: How to get the exit status of a Java program in Windows batch file
body: <p>Analogous to the <code>$?</code> in Linux, is there a way to get the exit status of a program in a Windows batch file (<code>.bat</code>)? <br/>
  Say for example the program has a <code>System.exit(0)</code> upon successful execution, and a <code>System.exit(1)</code> upon a failure, how do I trap these exit values in a <code>.bat</code> file?</p>