Killing spawned external process with java
I have a java program that spawns an external process (IE browser, actually) using the Runtime exec() method. I use Process.waitFor() so the calling java will respond appropriately when the browser is closed. However, I would like to do the converse as well - kill the browser when the java exits. The destroy() method just kills the attached java thread and doesn't affect the browser; it just continues on asynchronously.
This would be simple to resolve on UNIX, but unfortunately we are running on Windows XP. I can't find any way to determine the PID (there could be more than one IE running and I only want to kill the one spawned by the java process) to kill the browser with a system call. Does anyone have any ideas on how to resolve this?
J

