I need to make sure that a process is running before moving on with a method.
The statement is:
Process.Start("popup.exe");
Can you do a WAIT command or set a delay on this value?
Do you mean wait until it's done? Then use Process.WaitForExit
:
var process = new Process {
StartInfo = new ProcessStartInfo {
FileName = "popup.exe"
}
};
process.Start();
process.WaitForExit();
Alternatively, if it's an application with a UI that you are waiting to enter into a message loop, you can say:
process.Start();
process.WaitForInputIdle();
Lastly, if neither of these apply, just Thread.Sleep
for some reasonable amount of time:
process.Start();
Thread.Sleep(1000); // sleep for one second