Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Close IE without prompt

15 views
Skip to first unread message

Colin

unread,
Jul 14, 2003, 2:19:45 PM7/14/03
to
Is it possible to close IE without a messagebox prompt. I would like a .vbs
or .hta file to close a certain window. The below script loops through open
windows and will close the google home page but I would like to get rid of
the prompt.


option explicit
dim shApp, x
set shApp=createobject("shell.application")

For x=0 to shApp.windows.count-1
With shApp.windows.item(x)
If IsObject(.document.frames) Then

'This should close the google search page
If shApp.Windows.item(x).LocationName = "Google" Then
.document.frames.close
End If

End If
End With
'wscript.Echo shApp.Windows.item(x).LocationName
Next


Tom Lavedas

unread,
Jul 14, 2003, 2:49:47 PM7/14/03
to
This seemed to work for me ...

option explicit
dim shApp, x, bTest
set shApp=createobject("shell.application")

For x=0 to shApp.windows.count-1
With shApp.windows.item(x)

on error resume next
bTest = IsObject(.document)
if err<>0 then bTest = false
on error goto 0
If bTest Then

'This should close the google search page

If .LocationName = "Google" Then
.document.parentWindow.opener = "me"
.document.frames.close
End If

End If
End With
Next

Tom Lavedas
===========

>.
>

0 new messages