Hi !
I need to create a Sub that is able to kill running internet browsers. After killing a browser process, it needs to check again that there isn't another instance running. For example,the script would check to see if Internet Explorer was running. In testing the script could see that "iexplore.exe" or "FireFox" or "Chrome.exe" was running and would kill the process. I would see all browser windows closed through the single process even though there were many instances listed in Task Manager.
I have this code from the Net but i don't know how to kill them ?
Thank you in advance !
I need to create a Sub that is able to kill running internet browsers. After killing a browser process, it needs to check again that there isn't another instance running. For example,the script would check to see if Internet Explorer was running. In testing the script could see that "iexplore.exe" or "FireFox" or "Chrome.exe" was running and would kill the process. I would see all browser windows closed through the single process even though there were many instances listed in Task Manager.
I have this code from the Net but i don't know how to kill them ?
Code:
Set wmiSvc = GetObject("winmgmts:\\.\root\cimv2")
wql = "SELECT * FROM Win32_Process WHERE Name='iexplore.exe' OR Name='firefox.exe'"
Set procs = wmiSvc.ExecQuery(wql)
Do While procs.Count > 0
' do stuff
'procs.Terminate()??
'TerminateProcess(procs) ??
'Set procs = wmiSvc.ExecQuery(wql)
Loop
Thank you in advance !