using Shell.Application to close all IE windows
Posted on 2005-04-28
I wrote a vbscript that closes Internet explorer windows. The main reason i'm doing it this way it to get the LocationURL property of the objIE object before I call Quit on it.
The problem is that not all windows close this way if you have around 5 open Internet Explorer Windows.
Set objShell = CreateObject("Shell.Application")
Set objShellWindows = objShell.Windows
dim i, nCount
nCount = objShellWindows.Count
nCount = nCount - 1
for i = 0 to nCount
set objIE = objShellWindows.Item(i)
if (not objIE is nothing) then
'Do objIE.LocationURL related stuff here