acrane76 Posted February 8, 2018 Share Posted February 8, 2018 hi how i can kill all the duplicate for example of notepad.exe and remain only one exe in the taskbar ? Link to comment Share on other sites More sharing options...
acrane76 Posted February 8, 2018 Author Share Posted February 8, 2018 if there are 10 opened exe of notepad.exe in the taskbar , i want that with a autoit script must remain only one exe of the program notepad.exe Link to comment Share on other sites More sharing options...
Earthshine Posted February 8, 2018 Share Posted February 8, 2018 Read the help file regarding Process stuff My resources are limited. You must ask the right questions Link to comment Share on other sites More sharing options...
rudi Posted February 8, 2018 Share Posted February 8, 2018 Hello @acrane76 welcome to the forums! Are you familiar with the helpfile system? #include <array.au3> for $i = 1 to 10 Run("notepad.exe") Next $aPID=ProcessList("notepad.exe") _ArrayDisplay($aPID) for $i = 2 to $aPID[0][0] ProcessClose($aPID[$i][0]) Sleep(50) Next Sleep(500) $aPID=ProcessList("notepad.exe") _ArrayDisplay($aPID) be aware, that closing notepad.exe instances this way will kill all processes but the last one. Data not saved will be lost. Regards, Rudi. Earth is flat, pigs can fly, and Nuclear Power is SAFE! Link to comment Share on other sites More sharing options...
acrane76 Posted February 8, 2018 Author Share Posted February 8, 2018 5 hours ago, rudi said: Hello @acrane76 welcome to the forums! Are you familiar with the helpfile system? #include <array.au3> for $i = 1 to 10 Run("notepad.exe") Next $aPID=ProcessList("notepad.exe") _ArrayDisplay($aPID) for $i = 2 to $aPID[0][0] ProcessClose($aPID[$i][0]) Sleep(50) Next Sleep(500) $aPID=ProcessList("notepad.exe") _ArrayDisplay($aPID) be aware, that closing notepad.exe instances this way will kill all processes but the last one. Data not saved will be lost. Regards, Rudi. yes i have read the helpfile but I did not find what I needed Link to comment Share on other sites More sharing options...
Earthshine Posted February 8, 2018 Share Posted February 8, 2018 (edited) you have posted no code that you have personally tried. people around here are not going to write it for you. start with sample code from help file and work your way forward. Post it here if you have trouble. and please do not quote everyone, we know what we posted. it just makes the threads huge for no reason. Edited February 8, 2018 by Earthshine My resources are limited. You must ask the right questions Link to comment Share on other sites More sharing options...
Au3Builder Posted February 9, 2018 Share Posted February 9, 2018 (edited) different solution. https://www.autoitscript.com/autoit3/docs/libfunctions/_Singleton.htm Edited February 9, 2018 by Au3Builder Link to comment Share on other sites More sharing options...
JohnOne Posted February 9, 2018 Share Posted February 9, 2018 On 2/8/2018 at 5:16 PM, acrane76 said: yes i have read the helpfile but I did not find what I needed I think what you meant to day was, "thanks rudi". AutoIt Absolute Beginners Require a serial Pause Script Video Tutorials by Morthawt ipify Monkey's are, like, natures humans. Link to comment Share on other sites More sharing options...
OldGuyWalking Posted February 11, 2018 Share Posted February 11, 2018 ACrane - As mentioned by others, the AutoIT help file is a marvelous resource and it's generally easy to use. The code examples might be a bit vague but if you find a function in AutoIT that you need to learn more about you can do a search in the forums for that function. Another option is to look at any AutoIt code you can find in the wild to see how others have done things. That also goes for the Include files as well. These are all text files so they can be opened in any text editor, including Notepad. There is a lot of partially written and/or broken code in these forums that people have written and came to the forums to get help. No one makes any mistakes in AutoIt that someone else hasn't already done. So, while it might seem odd, you can learn alot from other peoples mistakes and problems. If you can't find something in here you can also Google the function. There's a pretty large community out there. I've been using AutoIT since before 2006 and everything I just suggested you do, I do on a very regular basis. There's always a learning curve but if you've done any programming, AutoIt won't be that difficult to learn (at least the basics). But... here are 2 bread crumbs to follow into the jungle known as the AutoIt Help File.... ProcessExists and ProcessClose Good Luck. 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