Jump to content

kill multiple duplicate process from taskbar


 Share

Recommended Posts

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

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

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

 

Link to comment
Share on other sites

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

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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...