C# How to wait for a process to end?
You can use the WaitForExit method to wait for the process to complete. Your code will wait synchronously for the process to finish, then it will resume execution. Let’s look at an example: The code above will start a new cmd.exe process, and execute the timeout 5 command. The process.WaitForExit() call will force your program…