阅读背景:

exec().waitFor()不等待进程完成。

来源:互联网 

I have this code:

我有这段代码:

File file = new File(path + "\RunFromCode.bat");
file.createNewFile();

PrintWriter writer = new PrintWriter(file, "UTF-8");
for (int i = 0; i <= MAX; i++) {
    writer.println("@cd " + i);
    writer.println(NATIVE SYSTEM COMMANDS);
    // more things
}

writer.close();

Process p = Runtime.getRuntime().exec("cmd /c start " + path + "\RunFromCode.bat");
p.waitFor();

file.delete();
File file = new F



你的当前访问异常,请进行认证后继续阅读剩余内容。

分享到: