java执行bat代码

2018-12-26

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

下载地址

百度网盘
密码: