Execute .bat file from java?
<p>i come back with my previous problem with executing .bat file from java program.</p>

<p>When i execute my java code, i don't understand why it's looking for my .bat file in the project directory of my Eclipse.</p>

<p>I declare clearly the path like : <code>"cmd.exe", "/C", "Start", "C:\\File\\batfile.bat"</code>
If someone could explain me clearly, please.
Thank you very much!</p>

<p>i use win xp and Eclipse Helios.</p>

<p>here is my code:</p>

<pre><code>String cmd;
        try {
            String[] command = { "cmd.exe", "/C", "Start", "C:\\File\\batfile.bat" };
                Runtime r = Runtime.getRuntime();
                Process p = r.exec(command);
                p.waitFor();

                } catch (Exception e) 
                {

                System.out.println("Execution error");} 
</code></pre>
