By using Apache Commons-Exec I can start a program successfully, however the starter program suspended after the program started.
May I ask how to start a program and exit immediately so it will not block the following execution?
DefaultExecutor executor = new DefaultExecutor();
executor.execute( "cmd /c start C:\\Users\\xx\\program.exe");
I’m on Win7 64bit.
Thanks
According to documentation,
execute(CommandLine)starts synchronous execution. That is, it blocks the calling thread. You probably want asynchronous execution, so useexecute(CommandLine command, ExecuteResultHandler handler). For example,