"Bob Connell" <> wrote in message news:...
I have a C executable program which takes several arguments that I want to be able to spawn off using the Java Runtime and Process classes on a Windows XP workstation.
Failed Solution 1:
----------------
I have found that if I start my process as such...
pe = runt.exec("cmd.exec /c myprocess.exe -arg1 -arg2");
(where runt is: Runtime runt = Runtime.getRuntime(); )
... there are no problems with the execution but I cannot kill my process (which may be needed) with the Process destroy() method. It seems to kill the cmd.exe but the sub-sub process (e.g., myprocess.exe) continues to run.
Failed Solution 2:
------------------
I have also found that if I run as the following (without the cmd command)...
pe = runt.exec("myprocess.exe -arg1 -arg2");
My process will hang but I can kill it. I am assuming that it hangs because it does recognize the arguments
Anyone have a solution to this problem or what I should attempt next?
NOTE: I have tried organizing the command into an array without any success.
thanks!
Bob
Does your executable generate any data on standard output or standard error? If you do not gobble up that output, it may fill the process's buffer and your executable will hang. Also, looking at the output may help you figure out what's actually wrong.
Cheers,
Matt Humphrey
http://www.iviz.com/