Workaround:
Set some properties on the closed process, and then execute Process.kill ()
Code
1system.diagnostics.process[] Myprocesses =System.Diagnostics.Process.GetProcesses ();2 3 foreach(System.Diagnostics.Process myprocessinchmyprocesses)4 {5 if(MyProcess.ProcessName.ToUpper () = ="IEXPLORE")6 {7 8 Try9 {TenMyProcess.StartInfo.FileName ="Iexplore.exe"; OneMyProcess.StartInfo.Arguments =""; AMyProcess.StartInfo.WorkingDirectory =""; -MyProcess.StartInfo.UseShellExecute =false; -MyProcess.StartInfo.RedirectStandardInput =true; theMyProcess.StartInfo.RedirectStandardOutput =true; -MyProcess.StartInfo.RedirectStandardError =true; -MyProcess.StartInfo.ErrorDialog =false; -MyProcess.StartInfo.CreateNoWindow =true; + Myprocess.kill (); - + } A Catch(Exception ex) at { -Txtlog. Write ("error closing IE file!"+Ex. Message); - - Continue; - } - } in}
View Code
Error closing IE process, prompting for access denied