不知道这样行么: process = Runtime.getRuntime().exec("cmd /c " + "copy D:/a.txt D:/aa.txt"); ir = new InputStreamReader(process.getInputStream()); input = new LineNumberReader(ir); while (input.readLine() != null) { } System.out.println("运行完毕。");
linux下面调用shell命令,然后查$?返回值变量,如果是0即表示正确完成,windows上cmd应该也有类似的
50,503
社区成员
85,598
社区内容
加载中
试试用AI创作助手写篇文章吧