Jump to content
Sign in to follow this  
acrane76

kill multiple duplicate process from taskbar

Recommended Posts

acrane76

hi how i can kill all the duplicate for example of notepad.exe and remain only one exe in the taskbar ?

Share this post


Link to post
Share on other sites
acrane76

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

Share this post


Link to post
Share on other sites
Earthshine

Read the help file regarding Process stuff


My resources are limited. You must ask the right questions

 

Share this post


Link to post
Share on other sites
rudi

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!

Share this post


Link to post
Share on other sites
acrane76
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

Share this post


Link to post
Share on other sites
Earthshine

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 by Earthshine

My resources are limited. You must ask the right questions

 

Share this post


Link to post
Share on other sites
OldGuyWalking

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.

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  

×