The definition at http://java.sun.com/j2se/1.4.2/docs/api/java/lang/Process.html#waitFor() (waitFor() method of Process Class) causes the current thread to wait, if necessary, until the process represented by this Process object has terminated. This method returns immediately if the subprocess has already terminated. If the subprocess has not yet terminated, the calling thread will be blocked until the subprocess exits.
So, the waitFor() method will not be indefinitely waiting. It will wait till the subprocess finishes. Hence, it is better to include waitFor() method, it will auto close the java program and in lack of this you are abruptly forcing java program to close when you are closing the subprocess (regedit in this case). Hope I tried to clear you. V. Srinivasan --~--~---------~--~----~------------~-------~--~----~ To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/javaprogrammingwithpassion?hl=en -~----------~----~----~----~------~----~------~--~---
