try
{
Process process = Process.Start(processName);
bool exit = false;
while (true)
{
exit = process.WaitForExit(100);
if (exit)
{
break;
}
System.Threading.Thread.Sleep(100);
}
}
catch (Exception ex)
{
System.Diagnostics.Debug.WriteLine(ex.ToString());
}