'Create a description for browser
Set oBrowser = Description.CreateoBrowser("micclass").Value = "Browser"
Set oPage = Description.Create
oPage("micclass").Value = "Page"
'Get all browsers
Set allBrowser = Desktop.ChildObjects(oBrowser)Dim i, iCount
iCount = allBrowser.Count - 1
For i = 0 To iCount
'Get the page object from the browser
Set oPg = allBrowser(i).ChildObjects(
'Get the URL of the
If InStr(oPg.GetROProperty("'Close the browser
allBrowser(i).Close
End If
Next
By now you must be wondering about the line
'Get the page object from the browser
Set oPg = allBrowser(i).ChildObjects(
'Name/IP of the computer
sComp = "."
'Get the WMI object
Set WMI = GetObject("winmgmts:\\" & sComp & "\root\cimv2")
'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 allIEIE.Terminate()
Post a Comment