I dont see why you would run something to close the pop-up windows rather than simply preventing them from ever opening. This is what I did: I made a program that listens locally and set up IE to use proxy server "localhost". IE then connects to the program and requests the webpage, the program fetches the page and removes any pop-ups/known banners. It's relativly simple, it acts seemlessly to prevent IE from ever even seeing the HTML/script. Plus it only parses the HTML when IE requests it, meaning it uses no resources when you arent pulling a webpage, better than a program that constantly watches for pop-up windows and closes them, which means many wasted cycles.