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

posted @ 2019-01-03 13:02  大天狗子  阅读(1964)  评论(0编辑  收藏  举报