How to track whether Process has completed?

Process process = Process.Start(PATH); 

And is it necessary to do something with the process object if the process has been completed?

  • 2
    Exited Occurs at the end of the process. - Grundy

2 answers 2

Several ways:

  1. Register what you want to happen in the Process.OnExited() event
  2. After the process starts, insert Process.WaitOnExit() and the program will not run further until the process is completed.
  • In fact, the trick is that I need the process (or several) to live on its own, and the program would just check if the process has not completed - tCode

Decided to use Process.HasExited