I think you just want this:
var process = Process.Start(...);
process.WaitForExit();
See the MSDN page for the method. It also has an overload where you can specify the timeout, so you’re not potentially waiting forever.
More Related Contents:
- How do I start a process from C#?
- What is the best choice for .NET inter-process communication? [closed]
- How to spawn a process and capture its STDOUT in .NET? [duplicate]
- How do I get output from a command to appear in a control on a Form in real-time?
- How do I determine the owner of a process in C#?
- How can I know if a process is running?
- Kill child process when parent process is killed
- .NET Events for Process executable start
- How can I get the PID of the parent process of my application
- How can a Windows Service start a process when a Timer event is raised?
- Using Process.Start() to start a process as a different user from within a Windows Service
- Async process start and wait for it to finish
- process.start() arguments
- How to execute a command in a remote computer?
- .NET – WindowStyle = hidden vs. CreateNoWindow = true?
- C# – Making a Process.Start wait until the process has start-up
- How to asynchronously read the standard output stream and standard error stream at once
- How can I tell if my process is running as Administrator?
- Foo.cmd won’t output lines in process (on website)
- Error in Process.Start() — The system cannot find the file specified
- C# – WCF – inter-process communication
- Monitor child processes of a process
- To run cmd as administrator along with command?
- Why does StandardOutput.Read() block when StartInfo.RedirectStandardInput is set to true?
- How to send keys instead of characters to a process?
- PostMessage WM_KEYDOWN send multiply keys?
- How to kill a process without getting a “process has exited” exception?
- How to call .NET methods from Excel VBA?
- Custom xmlWriter to skip a certain element?
- Remove Item in Dictionary based on Value