Paedow Paedow - 11 months ago 53
C# Question

How can I start a new Process and wait until it finishes?

I want to start a program with C# (could use

). Then my program should wait until the started program is closed, before it continues.

How do I do this?

Answer Source

After your Start() call, add: use Process.WaitForExit()

 var myProcess = new Process {StartInfo = new ProcessStartInfo(processPath)};