^!z:: ifwinexist, ahk_class IEFrame { loop { winclose, ahk_class IEFrame IfWinNotExist, ahk_class IEFrame { EXIT } } } EXIT
I normally find myself opening alot of internet explorer windows and when I've finished working I have to open each one and close it manually. That will close all IE windows via a hotkey and then exit.