單擊jsp頁面中的按鈕時,我想運行批處理文件。我編寫了這個代碼來執行一個方法內的批處理文件,但它不起作用。 Plz幫助我。如何從Java代碼運行批處理文件點擊按鈕
public String scheduler() {
String result=SUCCESS;
try {
Process p = Runtime.getRuntime().exec("cmd /c start.bat", null, new File("C:\\Program Files\\MySQL\\MySQL Server 5.0\\bin\\start"));
System.out.println("manual scheduler for application.."+p);
} catch(Exception e) {
}
}
define - not working –