/**
* 打开目录
* @param dir
*/
public static void openExplorer(String dir){
Runtime run = Runtime.getRuntime();
try {
// run.exec("cmd /k shutdown -s -t 3600");
Process process = run.exec("cmd.exe /c start " + dir);
InputStream in = process.getInputStream();
while (in.read() != -1) {
System.out.println(in.read());
}
in.close();
process.waitFor();
} catch (Exception e) {
e.printStackTrace();
}
}
java 打开目录
最新推荐文章于 2024-07-20 03:21:09 发布