The following function will start a batch file to monitor when a program closes and restart if necessary. If you need more explanation than that, then this function isn't for you. Note: You can close the batch file using either the PID returned by _AlwaysRun() (which you'll have to store somewhere e.g. INI file) OR using the Task Manager to manually close the process. Function: Using a Batch file. Save as _AlwaysRun.au3 #include-once
#include <Constants.au3>
; #FUNCTION# ==============
guinness, thank you sir for this wonderful script. I found some problems:
The tasklist return value, the exe name is cut by 25 characters in length. So if your exe name is greater than 25 characters then nothing is returned. If nothing is returned then exe gets ran over and over.
When you close out the exe another cmd.exe gets ran thus making multiple processes and wasting resources.
This one is not a 'huge' problem, but its wasteful. Multiple .bat files get generat