help with executing windows command in java
807606Feb 12 2007 — edited Feb 12 2007hi, i am trying to execute dos command in java. currently i am trying simply to create a folder in the current directory.
here is the code snippet:
try {
Process p = Runtime.getRuntime().exec("md myFolder");
} catch (IOException io) {
io.printStackTrace();
}
i have also tried using "mkdir" instead of "md". but my code just throws an exception that says:
java.io.IOException: CreateProcess: md myFolder error=2
what have I done wrong? thanks in advance