W4lk3r Posted July 28, 2018 Posted July 28, 2018 Hello guys, i need help for a tiny trouble I'm creating a watchdog in autoit 3, and i need to check how much instances of a executable are open, basically, 10 instances of nox.exe may be open, and if less than 10 instances are open my script will do a correction process, so i wanna count how much executables are open. Note: i can't do it with pid variables, autoit cannot start the main executable (and so capture the pid) itself cuz needs some unknown arguments. The executables starts using clicks in the main screen of nox. I wanna count the "nox.exe" times. Thanks in advance!
Developers Jos Posted July 28, 2018 Developers Posted July 28, 2018 30 minutes ago, W4lk3r said: Note: i can't do it with pid variables, autoit cannot start the main executable (and so capture the pid) itself cuz needs some unknown arguments. Sounds pretty strange.... can you elaborate? Jos SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past.
W4lk3r Posted July 28, 2018 Author Posted July 28, 2018 Simple. I start 10 instances of a program called "nox.exe", so 10 process nox.exe will be visible in windows task manager. My auto it script monitores the quantity of instances of nox.exe are running. If 10 instances are running, nothing happens; If one or more instances crash, will rest less than 10 stances, so the script will reboot the computer. I wanna know what function i can use to count the number of processes nox.exe still running.
Developers Jos Posted July 28, 2018 Developers Posted July 28, 2018 My quote was about not being able to use Run() to capture the pid, which you said isn't possible. I was just wondering why? Could you share what you have so far so we understand what needs to be changed? Jos SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past.
W4lk3r Posted July 28, 2018 Author Posted July 28, 2018 Well, nox is a Android emulador and every instance is a virtual machine, all the instances uses the process "nox.exe", If i use run() i'll need to put some parameters in the executable shortcut to open an especific virtual machine (only running nox.exe just open the first virtual machine). So, the parameters to do this are unknown, to open 10 instances i'm using nox multi instance manager, a clickable interface where my script just click in "start" of every VM present in this... And, i can't use run Cuz i don't know the parameters to start all the 10 virtual machines. If i find a way to create 10 shortcuts to start the 10 virtual machines i will able to use run() and capture the pid of every instance. But its a thing that i'm searching for until now. Thanks for the patience.
W4lk3r Posted July 28, 2018 Author Posted July 28, 2018 Thanks for the help! Finally i finded the parameter: Nox.exe -clone:(the nox folder) every folder contains one virtual machine, put the folder name after -clone parameter will start the specified virtual machine. now i'm able to use run() and store every pid! thanks!
W4lk3r Posted July 28, 2018 Author Posted July 28, 2018 But its the first part Now i can save the pid of every process but, how can autoit can check if the process still open?
W4lk3r Posted July 28, 2018 Author Posted July 28, 2018 Can i use processexists() with a pid valeu? How?
Developers Jos Posted July 28, 2018 Developers Posted July 28, 2018 No clue, maybe the helpfile will tell you? Jos SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past.
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now