public class transferExe {
public static void main(String[] args) {
openWinExe();
openExe();
}
//用Java调用windows系统的exe文件比如notepadcalc之类
public static void openWinExe() {
Runtime rn = RuntimegetRuntime();
Process p = null;
try {
String command = notepad;
p = rnexec(command);
} catch (Exception e) {
Systemoutprintln(Error win exec!);
}
}
//调用其他的可执行文件例如自己制作的exe或是下载安装的软件
public static void openExe() {
Runtime rn = RuntimegetRuntime();
Process p = null;
try {
p = rnexec(\D:/QQexe\);
} catch (Exception e) {
Systemoutprintln(Error exec!);
}
}
}