有人能找出这段代码有什么问题吗:
Runtime rt = Runtime.getRuntime();
Process pr;
File myFolder = new File("C:\\Temp");
pr = rt.exec("myExec.bat", null, myFolder);
pr.waitFor();
pr.destroy();
当我运行此代码时,出现以下异常(而使用的文件和文件夹按指定存在):
java.io.IOException: Cannot run program "myExec.bat" (in directory "C:\Temp"): CreateProcess error=2, The system cannot find the file specified
at java.lang.ProcessBuilder.start(ProcessBuilder.java:460)
at java.lang.Runtime.exec(Runtime.java:593)
at java.lang.Runtime.exec(Runtime.java:431)
at com.radml.radmlp.main(Test.java:10)