I have multiple users running attachemate on a Windows 2003 server. I want to kill attachemate.exe started by user_1 without killing attachemate.exe started by user_2.
I want to use VBScript.
I have multiple users running attachemate on a Windows 2003 server. I want to kill attachemate.exe started by user_1 without killing attachemate.exe started by user_2.
I want to use VBScript.
Shell out to pskill from http://sysinternals.com/
Commandline: pskill -u user_1 attachemate.exe
You could use this to find out who the process owner is, then once you have that you can use Win32_Process to kill the process by the process ID.
MSDN Win32_Process class details
MSDN Terminating a process with Win32_Process
There is surely a cleaner way to do this, but here's what I came up with. NOTE: This doesn't deal with multiple processes of the same name of course, but I figure you can work that part out with an array to hold them or something like that. :)