Jump to content
Sign in to follow this  
bradadair

Detecting different versions of same process

Recommended Posts

bradadair

I have a question. I am writing a process monitoring script. The problem that I don't know how to address is this. We have some programs that we run multiple instances of. For example there is a program with a binary name of card_col.exe. We run two instances, and each one uses a different config. I would like for my script to detect if one is stopped and restart the appropriate instance, however, since they both use the same image name when checking the task manager processes, I don't know how to have the script detect multiples. Does anyone have any suggestions? I would really appreciate it.

Share this post


Link to post
Share on other sites
PsaltyDS

Use ProcessList() to get a 2D array with the names (even though all the same), and PIDs (all different). Refer to the processes by their unique PIDs, not by name.

:mellow:


Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law

Share this post


Link to post
Share on other sites
bradadair

Ok, then how would I know which one to correlate.

For example:

-There are two instances of card_col

-One of them is started using coll11.bat and uses coll11.cfg as the config file

-One of them is started using coll12.bat and uses coll12.cfg as the config file

How would I be able to tell from the name and pid which .bat I would need to have executed to restart the proper process. Would I have to use the script to start them initially so it can keep track of the pids or is there another way.

Thanks again for any and all help!

Share this post


Link to post
Share on other sites
PsaltyDS

Search the example scripts section for _ProcessListProperties() to get the other details on each process.

:mellow:


Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law

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  

×