Hello everyone,
Hope you can help. Might be pretty easy for some of you.
I am trying to close an Internet Explorer Window with a specific URL e.g. http://www.google.com and only this particular Internet Explorer Window while leaving other ones open.
Additional info (not sure if they are necessary)
I have several Internet Explorer windows open
The Internet Explorer window that needs to be closed has no additional tabs just the http://www.google.com
The Internet Explorer window that needs to be closed is most likely not the active window
I know I could just kill Iexplorer.exe but that would kill all the windows, not just the one with http://www.google.com
I would appreciate any help.
Thanks.
Closing a specific website script
- Blackholyman
- Posts: 1293
- Joined: 29 Sep 2013, 22:57
- Location: Denmark
- Contact:
Re: Closing a specific website script
Before going down the long way
Have you tried winClose with the wintitle as show by winSpy?
WinSpy come's with the autohotkey install
Have you tried winClose with the wintitle as show by winSpy?
WinSpy come's with the autohotkey install
Courses on AutoHotkey
My Autohotkey Blog
-
- Posts: 20
- Joined: 11 Sep 2015, 21:00
Re: Closing a specific website script
Code: Select all
IECloseExcept("https://www.google.com/?gws_rd=ssl",true)
IECloseExcept("www.google.com")
IECloseExcept(url, exact := "")
{
if ( exact == true )
{
For wb in ComObjCreate( "Shell.Application" ).Windows
{
;msgbox % "LocationURL = " . wb.locationurl . "`nFull Name = " . wb.fullname . "`nurl = " . url
if InStr( wb.FullName, "iexplore.exe" )
{
if (wb.locationurl = url)
{
;msgbox % wb.locationurl
continue
}
else
wb.quit()
}
}
}
else
{
For wb in ComObjCreate( "Shell.Application" ).Windows
{
;msgbox % "LocationURL = " . wb.locationurl . "`nFull Name = " . wb.fullname . "`nurl = " . url
if InStr( wb.FullName, "iexplore.exe" )
{
if instr(wb.locationurl, url)
continue
else
wb.quit()
}
}
}
}
Last edited by timelizards on 05 Feb 2016, 01:56, edited 2 times in total.
-
- Posts: 20
- Joined: 11 Sep 2015, 21:00
Re: Closing a specific website script
credits to jethrow for the ieget function which i probably butchered to make this. i use something like this but not exactly for my own needs