java 调用dos命令行
我想用java执行phantomjs,但是发现我写的不行,public static void invokeCmd() {
try {
// Execute command
String command = "cmd /c start cmd.exe";
Process child = Runtime.getRuntime().exec(command);
// Get output stream to write from it
OutputStream out = child.getOutputStream();
out.write("cd C:\\phantomjs-1.9.2-windows /r/n".getBytes());
out.flush();
out.write("phantomjs.exe nova.js http://www.amcharts.com/fiddle/?id=amcharts/tZyTN /r/n"
.getBytes());
out.close();
} catch (IOException e) {
}
}
他就弹出了一个dos窗口,求大神帮忙 java phantomjs dos --------------------编程问答-------------------- 没搞过,不知道,坐等别人回答.... --------------------编程问答-------------------- 比如我要打开D盘的qq.txe
String command = "cmd /c start d:qq.txt";--------------------编程问答-------------------- java 执行什么意思 ,
Process child = Runtime.getRuntime().exec(command);
直接打开
Runtime.getRuntime().exec("cmd.exe /c start http://www.amcharts.com/fiddle/?id=amcharts/tZyTN");--------------------编程问答-------------------- 这个是使用phantomjs截屏 --------------------编程问答--------------------
就是这样请求的,
求帮忙 --------------------编程问答-------------------- 同求 帮你顶顶 --------------------编程问答-------------------- 求帮忙。。。
补充:Java , Java相关