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");
}
}
要用绝对路径
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");
}
}