Jump to content

Detecting different versions of same process


Recommended Posts

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.

Link to comment
Share on other sites

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

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!

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...