i want to run a specified file (.exes) in background...
File file = new File ("C:\\Documents and Settings\\INTEL\\My Documents\\NetBeansProjects\\demo\\calc.exe");
Desktop.getDesktop().open(file);
what if i use Runtime stuff
在单独的过程中执行指定的字符串命令。
Process process = Runtime.getRuntime().exec("C:\\Documents and Settings\\INTEL\\My Documents\\NetBeansProjects\\demo\\calc.exe");
You could execute your process in another thread
Thread thread = new Thread(){
public void run(){
try {
Runtime.getRuntime().exec("...");
} catch (Exception e) { ... }
}
}
thread.start();
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.