Forum Discussion
Batch File That TaskKill Won't Stop
The loop keeps running because the batch file is not a process image; it is being executed by cmd.exe. Several stop commands therefore target the wrong thing, and killing every cmd.exe instance could terminate unrelated consoles. Since your script already sets title MY_LOOP_SCRIPT, use the title as a precise filter: taskkill /F /T /FI "WINDOWTITLE eq MY_LOOP_SCRIPT". The quotation marks must surround the complete filter expression. /T also ends child processes started by that command process. Test first with tasklist /FI "WINDOWTITLE eq MY_LOOP_SCRIPT" so you can confirm exactly what will be selected. Do not use the batch filename with /IM, because it is not an executable image, and avoid the unrestricted taskkill /IM cmd.exe /F. If the child applications survive, stop them separately by their exact executable names. Finally, the posted script contains a password-like value; remove it and rotate it if it is real
Thanks for the try but the solution did not work, at least I couldn't get it to work...