Starstar Posted July 15, 2013 Share Posted July 15, 2013 (edited) How can i close all apps that are running with autoit? Sometimes script goes wrong due to other running windows.Therefore i want to close every running windows firstly. First method $DELAY = 200 Send("!{F4}") Send("!{F4}") Sleep($DELAY) Send("!{F4}") Send("!{F4}") Sleep($DELAY) Send("{ESc}") Second Run("taskmgr.exe") WinWait("Windows Task Manager","","SysListView321") ControlSend("Windows Task Manager","","SysListView321","+{DOWN 15}") sleep(200) ControlSend("Windows Task Manager","","SysListView321","!e") Sleep(100) ControlSend("Windows Task Manager","","SysListView321","!f") Sleep(100) ControlSend("Windows Task Manager","","SysListView321","x") Can anyone help me please??????? Edited July 16, 2013 by adnanbaloch Life is like a coin. You can spend it Anyway as you wish and for your kind information. "you can spend it only once." Link to comment Share on other sites More sharing options...
Moderators JLogan3o13 Posted July 15, 2013 Moderators Share Posted July 15, 2013 Take a look at WinList in the help file to get a list of all open windows. You can then selectively close the ones you would like. "Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball How to get your question answered on this forum! Link to comment Share on other sites More sharing options...
Starstar Posted July 15, 2013 Author Share Posted July 15, 2013 (edited) thanks i shall try><<...But i want to close all windows at once. Edited July 15, 2013 by adnanbaloch Life is like a coin. You can spend it Anyway as you wish and for your kind information. "you can spend it only once." Link to comment Share on other sites More sharing options...
Moderators JLogan3o13 Posted July 15, 2013 Moderators Share Posted July 15, 2013 But i want to close all windows at once. That is a subjective statement. Even if you go into Task Manager and select all Programs and choose End, they're not going to all close at exactly the same second. "Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball How to get your question answered on this forum! Link to comment Share on other sites More sharing options...
Starstar Posted July 15, 2013 Author Share Posted July 15, 2013 (edited) That is a subjective statement. Even if you go into Task Manager and select all Programs and choose End, they're not going to all close at exactly the same second. i agree but i need a short command like this method. Run("taskmgr.exe") WinWait("Windows Task Manager","","SysListView321") ControlSend("Windows Task Manager","","SysListView321","+{DOWN 15}") sleep(200) ControlSend("Windows Task Manager","","SysListView321","!e") Sleep(100) ControlSend("Windows Task Manager","","SysListView321","!f") Sleep(100) ControlSend("Windows Task Manager","","SysListView321","x") Edited July 15, 2013 by adnanbaloch Life is like a coin. You can spend it Anyway as you wish and for your kind information. "you can spend it only once." Link to comment Share on other sites More sharing options...
DW1 Posted July 15, 2013 Share Posted July 15, 2013 What is the purpose of this script? AutoIt3 Online Help Link to comment Share on other sites More sharing options...
0xdefea7 Posted July 15, 2013 Share Posted July 15, 2013 run this in CMD: taskkill /? Link to comment Share on other sites More sharing options...
Moderators JLogan3o13 Posted July 15, 2013 Moderators Share Posted July 15, 2013 run this in CMD: taskkill /? The OP has pointed out that he wants to do all at once (which I don't believe possible). Using Taskkill will be just the same as WinClose or any other method, he'll have to obtain a list and then cycle through it. I am with danwilli, especially knowing the OP's history, I'm curious why every window needs to be closed at once. "Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball How to get your question answered on this forum! Link to comment Share on other sites More sharing options...
0xdefea7 Posted July 15, 2013 Share Posted July 15, 2013 I have another idea but I'll wait for OP to explain why... Link to comment Share on other sites More sharing options...
Gianni Posted July 15, 2013 Share Posted July 15, 2013 thanks i shall try><<...But i want to close all windows at once. unplug the power cord of your computer is the quickest way to stop all of your tasks simultaneously:... Xandy, 0xdefea7 and jacQues 3 Chimp small minds discuss people average minds discuss events great minds discuss ideas.... and use AutoIt.... Link to comment Share on other sites More sharing options...
Starstar Posted July 16, 2013 Author Share Posted July 16, 2013 (edited) unplug the power cord of your computer is the quickest way to stop all of your tasks simultaneously:... it is a good joke............ha ha ha Try to help someone instead teasing....But never mind Edited July 16, 2013 by adnanbaloch Life is like a coin. You can spend it Anyway as you wish and for your kind information. "you can spend it only once." Link to comment Share on other sites More sharing options...
Starstar Posted July 16, 2013 Author Share Posted July 16, 2013 I have another idea but I'll wait for OP to explain why... What is the purpose of this script? Sometimes script goes wrong due to other running windows.Therefore i want to close every open windows firstly. Life is like a coin. You can spend it Anyway as you wish and for your kind information. "you can spend it only once." Link to comment Share on other sites More sharing options...
VixinG Posted July 16, 2013 Share Posted July 16, 2013 CTRL + Break? [indent=3][/indent] Link to comment Share on other sites More sharing options...
Starstar Posted July 16, 2013 Author Share Posted July 16, 2013 CTRL + Break? i want to close not stop or break.....any way thanks Life is like a coin. You can spend it Anyway as you wish and for your kind information. "you can spend it only once." Link to comment Share on other sites More sharing options...
Solution Gianni Posted July 16, 2013 Solution Share Posted July 16, 2013 (edited) it is a good joke............ha ha ha Try to help someone instead teasing....But never mind ok, try this: ( a little modification from the autoit help for winlist()) Local $var = WinList() For $i = 1 To $var[0][0] ; Only display visble windows that have a title If $var[$i][0] <> "" And IsVisible($var[$i][1]) Then WinKill($var[$i][1]) EndIf Next Func IsVisible($handle) If BitAND(WinGetState($handle), 2) Then Return 1 Else Return 0 EndIf EndFunc ;==>IsVisible bye Edited July 16, 2013 by Pincopanco Starstar 1 Chimp small minds discuss people average minds discuss events great minds discuss ideas.... and use AutoIt.... Link to comment Share on other sites More sharing options...
Starstar Posted July 16, 2013 Author Share Posted July 16, 2013 ok, try this: ( a little modification frome the autoit help for winlist()) Local $var = WinList() For $i = 1 To $var[0][0] ; Only display visble windows that have a title If $var[$i][0] <> "" And IsVisible($var[$i][1]) Then WinKill($var[$i][1]) EndIf Next Func IsVisible($handle) If BitAND(WinGetState($handle), 2) Then Return 1 Else Return 0 EndIf EndFunc ;==>IsVisible bye Thank you very very much...............it solved my problem...... Life is like a coin. You can spend it Anyway as you wish and for your kind information. "you can spend it only once." Link to comment Share on other sites More sharing options...
Moderators JLogan3o13 Posted July 16, 2013 Moderators Share Posted July 16, 2013 Thank you very very much...............it solved my problem...... Using the function I suggested in Post #2. Had you read for yourself and tried it out, instead of waiting to be spoon fed, you'd have been done a lot sooner Starstar 1 "Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball How to get your question answered on this forum! Link to comment Share on other sites More sharing options...
Starstar Posted July 16, 2013 Author Share Posted July 16, 2013 (edited) Using the function I suggested in Post #2. Had you read for yourself and tried it out, instead of waiting to be spoon fed, you'd have been done a lot sooner sorry JLogan3o13 sorry i had not enough idea of winlist........you are the first helper for me thank you very much...... Edited July 16, 2013 by adnanbaloch Life is like a coin. You can spend it Anyway as you wish and for your kind information. "you can spend it only once." Link to comment Share on other sites More sharing options...
n1kobg Posted March 5, 2021 Share Posted March 5, 2021 On 7/16/2013 at 10:06 AM, Chimp said: ok, try this: ( a little modification from the autoit help for winlist()) Local $var = WinList() For $i = 1 To $var[0][0] ; Only display visble windows that have a title If $var[$i][0] <> "" And IsVisible($var[$i][1]) Then WinKill($var[$i][1]) EndIf Next Func IsVisible($handle) If BitAND(WinGetState($handle), 2) Then Return 1 Else Return 0 EndIf EndFunc ;==>IsVisible bye Why the old Windows Shutdown Menu apears (in the middle of the screen) with this? Any idea how not to start it. I can remove it afterwards but its not ideal. Link to comment Share on other sites More sharing options...
Nine Posted March 5, 2021 Share Posted March 5, 2021 Cause you probably trying to WinKill Windows itself. Put a ConsoleWrite in the loop and when you know which windows is causing it, simply discard that window. “They did not know it was impossible, so they did it” ― Mark Twain Spoiler Block all input without UAC Save/Retrieve Images to/from Text Monitor Management (VCP commands) Tool to search in text (au3) files Date Range Picker Virtual Desktop Manager Sudoku Game 2020 Overlapped Named Pipe IPC HotString 2.0 - Hot keys with string x64 Bitwise Operations Multi-keyboards HotKeySet Recursive Array Display Fast and simple WCD IPC Multiple Folders Selector Printer Manager GIF Animation (cached) Screen Scraping Multi-Threading Made Easy Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now