I am trying to kill all processes on a terminal server for a specific user, but I want to have 2 or more processes not killed. I am unsure on how to filter multiple Imagenames that are not equal?
I have previously tried using -and or declaring /FI "Imagename ..." again and did not then filter any of them
taskkill.exe /F /FI "USERNAME eq bot1" /FI "IMAGENAME ne Code.exe" /FI "IMAGENAME ne OUTLOOK.EXE"
I would expect this to close everything apart from the two items stated but this still closes all of them. If I delete the second instance of "IMAGENAME" it runs and does not close Code.exe as stated. How can I have exceptions of processes, I do not want closed?