Is it posible to kill sessions using xxx.exe but exclude a user?
Hi, I would like to kill processes that are still active that are using xxx.exe, on a regular basis as a scheduled task. I also though, I want to include a little logic and for this process not to kill a specific user. Does this community have any advice for me please? Thanks Lee
July 20th, 2012 7:23am

taskkill /im your.exe /fi "USERNAME ne yourdomain\yourusername" should do the trick. test it before using it productive though and check /? for the parameters
Free Windows Admin Tool Kit Click here and download it now
July 20th, 2012 7:40am

This will have been perfect but I have two exclusions (I have just found out) ? Is there anyway to introduce more logic to this process to support two exclusions? Thanks for your time... Lee
August 1st, 2012 5:27am

I have just spotted that a wildcard can be used. Which will resolve my two users but in a case where I can't use a wildcard then for the future any assistance would be helpful. Thanks Lee
Free Windows Admin Tool Kit Click here and download it now
August 1st, 2012 5:31am

you can apply filter "/fi" more then once (http://technet.microsoft.com/en-us/library/cc725602(v=ws.10).aspx) so you should be able to extend the command like below taskkill /im your.exe /fi "USERNAME ne yourdomain\yourusername1" /fi "USERNAME ne yourdomain\yourusername2"
August 1st, 2012 5:52am

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics