I need to abort a Perl script which is running in the background from another script.
Many perl scripts run on our machine. I need to abort one of the them on request. All I will know is the name of the perl script to abort. I need to abort that one particular script without affecting other processes.
I tried killing it using PID/Image Name but it did not work for the below reasons,
1)I do not know the PID of the script (as it runs from a trigger)
2)The script runs in the background, so the image name is always perl.exe and hence if image name is used , it kills all the other perl tasks as well.
I tried to get the perl script name from the 'windows title' and hence the corresponding PID, but it always shows 'NA'.
I even tried to delete the perl script(as I know the name and location) but it also did not work, as it runs the entire script from the memory (even though it is deleted)
Please help me with some options to kill the running perl, from another script.
Your script may write its pid to special file for another script to use.