如何使用Java调用执行java执行bat代码.txt文件中的批处理命令?
- 内容介绍
- 文章标签
- 相关推荐
本文共计66个文字,预计阅读时间需要1分钟。
javapublic static void runBat(String path, String filename) { String cmd=cmd /c start + path + / + filename; try { Runtime.getRuntime().exec(cmd); } catch (IOException e) { e.printStackTrace(); }}
java执行bat代码.txtpublic static void runbat(String path,String filename) { String cmd = "cmd /c start"+path+"/"+filename; //String cmd = "cmd /c start F:/mysqlbackup/guohua/backup.bat"; try { Runtime.getRuntime().exec(cmd); } catch(IOException ioe) { ioe.printStackTrace(); } }
本文共计66个文字,预计阅读时间需要1分钟。
javapublic static void runBat(String path, String filename) { String cmd=cmd /c start + path + / + filename; try { Runtime.getRuntime().exec(cmd); } catch (IOException e) { e.printStackTrace(); }}
java执行bat代码.txtpublic static void runbat(String path,String filename) { String cmd = "cmd /c start"+path+"/"+filename; //String cmd = "cmd /c start F:/mysqlbackup/guohua/backup.bat"; try { Runtime.getRuntime().exec(cmd); } catch(IOException ioe) { ioe.printStackTrace(); } }

