Run a Bat File with Java Program


Sample JAVA Code:

public class RunBat {

public static void main(String[] args) throws IOException, InterruptedException{

Runtime runtime = Runtime.getRuntime();
Process process = runtime.exec("cmd /c F:\\bb.bat");
process.waitFor();
}
}