【发布时间】:2015-12-28 00:42:16
【问题描述】:
如何使用java程序.jar启用/禁用网络
如何使用:
Runtime.getRuntime().exec()
这样可以吗
Process result = Runtime.getRuntime().exec("ipconfig/release");
谢谢
【问题讨论】:
-
我无法在 devcon Runtime 上运行命令 rt = Runtime.getRuntime();尝试 { //rt.exec(new String[]{"cmd.exe","/c","start"}); rt.exec(new String[]{"C:/1/i386/devcon -m://test find pci/*"}); System.out.println("rt"); //处理结果 = Runtime.getRuntime().exec("ipconfig /release"); } catch (IOException e) { // TODO 自动生成的 catch 块 e.printStackTrace(); }