0

我正在尝试执行以下命令以使用命令提示符扫描文件。它可以正常执行,但有时无法执行该过程,并且代码在process.waitfor()处挂起。下面是我正在尝试的代码。有什么错误的?

Long startTime = System.currentTimeMillis();
Process process = Runtime.getRuntime().exec("cmd start cmd.exe /k \"C: && cd "+ANTIVIRUS_PATH+" "+WL_HOME+"\\"+ serverImagePath+ actualFileName+" && exit");
process.waitFor();
process.destroy();
Long endTime = System.currentTimeMillis();
System.out.println("Total Time:"+(endTime-startTime));
4

0 回答 0