Well, I find that on the computer that I use as a webserver for a local application, in addition to the webserver, there are a couple of exe files that clean up old files. These exe files, from time to time and due to connectivity problems of the network units they monitor, cause some kind of exception and crash, stopping their tasks.
I would like to know if, since it is the same computer as the webserver, I can create a php file that auto-refreshes every X minutes and checks if the exe file is running on the same computer, and if not, I can run it from the same php with any of these php functions
It should be noted that the exe file is made with C# and I have access to the code, although I'm very fishy about C#, and since it's not my code, I'd rather not mess with it, although... it occurs to me that perhaps with a try/catch I could solve it, but come on, I prefer to do it from php/js if possible.
With the windows tasklist command, if it is the operating system of your server, you can see the programs that are running, you execute it from php and you get the output as a string, you look for the one you executed and if it does not appear, you do what you wanted. I was investigating a little more and here I leave my answer, I'm still using tasklist but I can narrow the search by passing a filter, the code is documented.