Jump to content

Is There A Way To Close All Open Windows?

Recommended Posts

Not tested, but might work. It should keep activating and closing windows until none is left.

Send("!Tab");Alt+Tab switches to the next active window

While Not WinActive("Program Manager");Program Manager is the Desktop
   WinKill("");kills the active window
   WinClose("");Because WinKill might not work on Explorer windows
   sleep(100) ;pause a few milliseconds

Hmm, looking at my post count, this post is potentially :whistle:

Edited by CyberSlug
Use Mozilla | Take a look at My Disorganized AutoIt stuff | Very very old: AutoBuilder 11 Jan 2005 prototype I need to update my sig!
Link to post
Share on other sites

The reason why is I want to write a script that automates some tasks for myself on the internet and depending on my connection speed it might fail. If it fails I would like the ability to close all the windows on the desktop and start over fresh.

Thanks for all the great responses!

Link to post
Share on other sites

do you want to kill internet explorer windows specifically?

you could use ProcessClose("iexplore.exe")

[quote]I was busy waiting all night for the Columbus Day Bunny to come down my chimney and light fireworks in my pumpkin.There's so much wrong with that.Oh, I'm sorry, i forgot you were Jewish.[/quote]

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    No registered users viewing this page.

  • Create New...