public class Test {
/**
* @param args
*/
public static void main(String[] args) {
try {
String[] cmd = new String[3];
cmd[0 ] = "cmd";
cmd[1] = "/C";
cmd[2] = "d:/orgdemo.xml";
Process p = Runtime.getRuntime().exec(cmd);
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
}
JAVA调用windows cmd命令
最新推荐文章于 2023-07-17 16:06:10 发布