java 调用CMD命令 demo
时间:2014-04-03 10:32:28
收藏:0
阅读:425
try {
Runtime run = Runtime.getRuntime();
String[] cmd = new String[] {
"cmd.exe","/C","mysqldump -uroot -p111111 test> c:/test.sql"};
Process p = run.exec(cmd);
p.waitFor();
System.out.println("end.");
} catch (Exception e) {
e.printStackTrace();
}
Runtime run = Runtime.getRuntime();
String[] cmd = new String[] {
"cmd.exe","/C","mysqldump -uroot -p111111 test> c:/test.sql"};
Process p = run.exec(cmd);
p.waitFor();
System.out.println("end.");
} catch (Exception e) {
e.printStackTrace();
}
java 调用CMD命令 demo,布布扣,bubuko.com
原文:http://www.cnblogs.com/huangzhijun/p/3641575.html
评论(0)