Hi, I am trying to run a .bat from java, that has a command and must create a file with the output, the .bat works correctly, the problem I have when invoking it from the java program since it does not wait for it to finish and my file is created without content. I have also tried to execute the command directly if the .bat and the same thing happens to me. I'm trying this, but it does not work, any ideas? thank you :) Process p = Runtime.getRuntime (). Exec (cmd);
try {
p.waitFor();
} catch (InterruptedException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}