Sign in to follow this  
Followers 0
hatchetman

Is There A Way To Close All Open Windows?

5 posts in this topic

Hello,

I am new to AutoIT and I was wondering if there is a way to close (killl) all open windows on the desktop.

-Thanks

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

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
   Send("!Tab")
   sleep(100) ;pause a few milliseconds
WEnd

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!

Share this post


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!

Share this post


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]

Share this post


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
Sign in to follow this  
Followers 0