08-22-2008, 04:56 PM
I tried the same code but it is closing only process explorer...Try the below code.
Code:
'Get the WMI object
Set WMI = GetObject("winmgmts:\\")
'Get collection of processes for with name iexplore.exe
Set allIE = WMI.ExecQuery("Select * from Win32_Process Where Name = 'iexplore.exe'")
'Loop through each process and terminate it
For Each IE in allIE
IE.Terminate()
Next