Batch file to kill a process on login
I tried Taskkill, but it simply doesn't work. I have one machine that no matter who logs in, it starts a process under a user that is not logged in nor is even listed as a user on the machine. It is a domain user however and has logged into the machine previously. I have deleted the local account on the machine. It's for a program we need, but if the process is already running, we get an error when the user tries to run the program. You can kill it in task manager, but that's just annoying to have to do every time. I tried taskkill with the /f and /t parameters,
@ echo off
taskkill /f /t /im program.exe
but it pops up the cmd window and if you have echo off it's just a black screen that stays there forever. If echo off is not included, the command runs indefinitely. And the process never dies.
I've looked in msconfig for it, not there. Looked in all users, start menu programs startup folder, not there. I have removed all registry entries referring to user john123
So, I need a batch file that runs at startup that either kills off user john123 or kills process "program.exe". I can't seem to prevent either one from happening. I can uninstall the program and naturally it doesn't happen, but we use this program all day every day. I am guessing it's somewhere in a login script that our corporate honks put in, but they don't allow me to change those.
We are on a domain if that matters.
If I log in as the user in question, there's no problem at all because it allows the program to run. But we have multiple users that use this machine.
I will not go back.