How can I implement the launch of the list of applications in turn in a separate thread? Those. The following application is launched in a separate thread after the previous one is completed.

  • it is devoid of any common sense. Threads exist to and only to run task execution in parallel , rather than sequentially. - Vladyslav Matviienko
  • If you are given an exhaustive answer, mark it as correct (a daw opposite the selected answer). - Nicolas Chabanovsky

1 answer 1

Applications themselves have a separate process. To wait for the completion of a running application, there is a WaitForExit method.

It should turn out something like this:

new Thread(() => { foreach(var cmd in cmds) Process.Start(cmd).WaitForExit(); }).Start();