Quantcast
Channel: Sysinternals Forums
Viewing all articles
Browse latest Browse all 10386

PsTools : PSkill using taskkill filter switches - possible?

$
0
0
Author: subi75
Subject: PSkill using taskkill filter switches - possible?
Posted: 12 June 2013 at 1:19pm

I'm trying to use as part of a script taskkill.exe to kill a speciifc process (by name not pid as that can obviously change every time the process runs) and I may have multiple instances that is running under a given user account (eg using the /FI "username eq userid" filter) that I want to kill.

Unfortunately for some reason, taskkill is not working on this specific server, regardless of which switches I use (including the /f force and /T switches). Instead, taskkill errors out with "ERROR: This operation returned because the timeout period expired". there is no OS log entry that I can determine to provide details as to why its failing.

However, I've found that if I use pskill, it will certainly kill the desired process im after, but I cant filter the process by name and user on a single command line as with taskkill.

I understand that with a number of other PStools, I can modify the script to work out the process' specific PID/s, and then have the script kill it (and if there are multiple occurences running under the one account I then obviously need to loop the script to ensure they are all killed for the given user account) but surely there is an easier way with pskill (or another pstool) to do this in a single command line, or if someone knows of another tool that can be scripted like taskkill to do it I'd appreciate the feedback.

Viewing all articles
Browse latest Browse all 10386

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>