Jump to content
Sign in to follow this  
Dirk98

ProcessClose() to close all instances?

Recommended Posts

Dirk98

Guys ProcessClose() doesn't close all instances of the running process. How to close ALL INSTANCES of the same process?

Thanks.

Share this post


Link to post
Share on other sites
Dirk98

ProcessWaitClose() helped. Don't know if it is the best method though.

Share this post


Link to post
Share on other sites
rasim

While ProcessExists("notepad.exe")
    ProcessClose("notepad.exe")
WEnd

Share this post


Link to post
Share on other sites
SmOke_N

While ProcessExists("notepad.exe")
    ProcessClose("notepad.exe")
WEnd
This is a good example, but keep in mind you are continuously enuming the process list here, where as if you do it the way I have in the other example, you enum it once.

Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.

Share this post


Link to post
Share on other sites
Dirk98

This is a good example, but keep in mind you are continuously enuming the process list here, where as if you do it the way I have in the other example, you enum it once.

Do you mean it runs continuously until the script exits, right?

Share this post


Link to post
Share on other sites
Dirk98

Do you mean it runs continuously until the script exits, right?

Will it work if the process I want to close is AutoIt.exe to avoid multiple instances of the same? Or there's some third way to achieve that?

Many thanks.

Share this post


Link to post
Share on other sites
Generator

#include<misc.au3>
_Singleton("Myscript")

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  

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.