Sign in to follow this  
Followers 0
Ravel

Ending a program in task manager

5 posts in this topic

I have a quick question do you guys know if there is a generic code (script) for ending a task in task manager? I am trying to set up a script to end an instance of a program that is in task manager. Also is there a way to have it set up to end all of the instances if there are multiple instances? I appreciate any advice that you guys have. Thanks.

D.

Share this post


Link to post
Share on other sites



ProcessClose() is what you want:

ProcessClose('notepad.exe')

To kill multiple processes of the same name:

Local $List = ProcessList('notepad.exe')
For $I = 1 To $List[0][0]
    ProcessClose($List[$I][1])
Next

Share this post


Link to post
Share on other sites

#3 ·  Posted (edited)

ProcessClose() is what you want:

ProcessClose('notepad.exe')

To kill multiple processes of the same name:

Local $List = ProcessList('notepad.exe')
For $I = 1 To $List[0][0]
    ProcessClose($List[$I][1])
Next
*EDIT* Grrr.. i think i got what you meant... Thats what i get for skimming...lol9 Edited by Ravel

Share this post


Link to post
Share on other sites

#4 ·  Posted (edited)

do i replace notepad.exe with whatever program that I want to close?

Yes, exactly as it's shown in the Task Manager.

Edit: Added context.

Edited by LxP

Share this post


Link to post
Share on other sites

Thanks again LxP I appreciate it!

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