java呼叫exe檔案

bingtears發表於2009-05-09
Runtime.getRuntime().exec("***.exe");
要用絕對路徑

JAVA呼叫exe檔案
2008-03-13 16:20
/**
* @param args
*/
public static void main(String[] args) {
Runtime rn = Runtime.getRuntime();
Process p = null;
try
{
String str = "\"D:\\Program Files\\Microsoft Visual Studio 8\\Common7\\IDE\\devenv.exe\"" ;
p = rn.exec(str);
}
catch (Exception e)
{
System.out.println("Error to run the exe");
}
}

相關文章