cannot find file using runtime.exec dir argument
<p>It's quite possible i've misunderstood the purpose of the <code>File dir</code> argument in <a href="http://download.oracle.com/javase/1.4.2/docs/api/java/lang/Runtime.html" rel="nofollow">Runtime.exec(String command, String[] envp, File dir)</a>:
"The working directory of the new subprocess is specified by dir. If dir is null, the subprocess inherits the current working directory of the current process."</p>

<p>If I run <code>Runtime.exec("C:/mydir/myfile.bat");</code> the script is executed (albeit with the wrong working dir)</p>

<p>however if I run <code>Runtime.exec("myfile.bat", null, new File("C:/mydir"));</code> i get the following error:</p>

<pre><code>java.io.IOException: Cannot run program "myfile.bat" (in directory "C:\mydir"): CreateProcess error=2, The system cannot find the file specified
    at java.lang.ProcessBuilder.start(ProcessBuilder.java:460)
    at java.lang.Runtime.exec(Runtime.java:593)
</code></pre>

<p>I would assume that the <code>dir</code> argument sets the working directory for the new process as well as the command being executed, however maybe it just does the former. if that is the case the exception message is quite misleading.</p>
