I am running several batch files every 5 minutes which call perl or vbscripts. In the task manager I see several cmd.exe as well as perl.exe or cscript.exe processes as these batch files run for several minutes.
If one stalls for whatever reason, I want to be able to kill the right one. This would be possible if I know the PID of the cmd.exe and/or perl.exe and/or cscript.exe.
I was thinking of getting the PID as the batch files starts and dropping its value in a log file.
However, I have no clue on how to get the PID of such a cmd.exe using DOS tools nor on how to get it in Perl or VBScript.
Does anyone know how to get the PID?