java执行bat代码

Posted 大天狗子

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了java执行bat代码相关的知识,希望对你有一定的参考价值。


java执行bat代码.txt


public 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();
    }
}       

以上是关于java执行bat代码的主要内容,如果未能解决你的问题,请参考以下文章