public Test() throws Exception {
this.Execute("cmd.exe /c E:\\java\\workspace\\ip\\ip.bat");
} public void Execute(String cmd){
try {
java.lang.Runtime.getRuntime().exec(cmd);
} catch (IOException e) {
e.printStackTrace();
}
}ip.batjava -jar ip.jar如果执行 ip.jar后正常的话应该会在当前目录下创建个文本可以上面的程序运行后没有创建文件怎么回事
this.Execute("cmd.exe /c E:\\java\\workspace\\ip\\ip.bat");
} public void Execute(String cmd){
try {
java.lang.Runtime.getRuntime().exec(cmd);
} catch (IOException e) {
e.printStackTrace();
}
}ip.batjava -jar ip.jar如果执行 ip.jar后正常的话应该会在当前目录下创建个文本可以上面的程序运行后没有创建文件怎么回事
public Test() throws Exception {
this.Execute("E:\\java\\workspace\\ip\\ip.bat");
} public void Execute(String cmd){
try {
java.lang.Runtime.getRuntime().exec(cmd);
} catch (IOException e) {
e.printStackTrace();
}
}
public static void run(String command)
{
Runtime runtime = Runtime.getRuntime();
try
{
Process process = runtime.exec("cmd /c start "+command);
} catch (Exception ex)
{
ex.printStackTrace();
}
}