Personal computing discussed

Moderators: Flying Fox, Ryu Connor

Minister of Gerbil Affairs
Topic Author
Posts: 2970
Joined: Tue Sep 24, 2002 6:57 pm
Location: Alpha Epsilon Pi for life

How to kill particular hanging process

Thu Jan 06, 2011 12:04 pm

My office has 12 terminal servers in a mini cloud. They are running Server 2003. There is a particular HP driver which gets loaded for some users' printers. It loads msiexec, which hangs. It doesn't bring the server down or anything (4 cores available so it just shows 24-25%), but it stops any other printers from being loaded by other users. When we see it, we kill it and subsequent printers load just fine. However, with 12 servers and 150-180 or so users connecting and disconnecting, it's impossible to keep an eye on each server for this little bugger.

What I'd like is a daemon/process monitor that would specifically look at msiexec and if it is at >50% CPU usage for more than 10 seconds, kill it.

I started poking at PSAPI, but it's a bit above my head.

Any thoughts?
Chaos reigns within. Reflect, repent, and reboot. Order shall return.
Slivovitz owns you.
Minister of Gerbil Affairs
Posts: 2420
Joined: Sun Oct 16, 2005 7:21 pm

Re: How to kill particular hanging process

Mon Jan 10, 2011 5:34 pm

I used an auto-process killer once to stop a virus from loading a big exe every time it was killed so I could wipe the thing out, but triggering based on CPU % and duration will probably require something custom.

I found this on Google, but I have never used it myself:
4- Taskkill batch file/Command Line

There’s a Windows command called Taskkill which is used to terminate processes. Simply create a shortcut with the following command:

taskkill.exe /f /fi “status eq not responding”

You can also download this shortcut from the following location and use it from wherever you want.

Task Kill Shortcut (77.0 KiB, 2,428 hits)

Here's the MS Docs. ... x?mfr=true

The question is whether the "not responding" would = 10 seconds @ 50% criteria, or something similar. No experience with this myself, maybe someone else does.
Ryu Connor
Gold subscriber
Global Moderator
Posts: 4215
Joined: Thu Dec 27, 2001 7:00 pm
Location: Marietta, GA

Re: How to kill particular hanging process

Mon Jan 10, 2011 6:34 pm

All of my written content here on TR does not represent or reflect the views of my employer or any reasonable human being. All content and actions are my own.
Posts: 21
Joined: Wed Jan 17, 2007 4:23 pm

Re: How to kill particular hanging process

Fri Jan 14, 2011 11:23 am

Process Lasso, might help you.

Who is online

Users browsing this forum: Google [Bot], Redocbew and 3 guests