How do I get the return code in Java after executing a windows command line command
<p>I'm doing something like this in Java right now</p>

<pre><code>Process p = Runtime.getRuntime().exec("ping -n 1 -w 100 127.0.0.1")
</code></pre>

<p>How can I read the windows exec code? I already know how to read the command line output from the command, but what if I just want the 0 or 1 telling me whether it was successful or failed?</p>
