public override void Run() { SystemProcess p = shell.GetProcess(); try { p.ExitValue(); } catch (Exception) { //Process has not terminated. //So check if it has completed //if not just destroy it. if (p != null && !shell.completed.Get()) { shell.SetTimedOut(); p.Destroy(); } } }