First time here? Check out the site's "greatest hits" or read a post from the archives. Feel free to leave a comment or ask a question, and consider subscribing to the latest posts via RSS or e-mail. Thanks for visiting!
« Team Hanselman and Diabetes Walk 2006 | Main | Hanselminutes Podcast 11 »

A very useful utility included with Windows XP and 2003 that a lot of folks may not be familiar with is Taskkill. This is installed in %WINDIR%\SYSTEM32\taskkill.exe. Here's some examples:

 TASKKILL /S system /F /IM notepad.exe /T
 TASKKILL /PID 1230 /PID 1241 /PID 1253 /T
 TASKKILL /F /IM notepad.exe /IM mspaint.exe
 TASKKILL /F /FI "PID ge 1000" /FI "WINDOWTITLE ne untitle*"
 TASKKILL /F /FI "USERNAME eq NT AUTHORITY\SYSTEM" /IM notepad.exe
 TASKKILL /S system /U domain\username /FI "USERNAME ne NT*" /IM *

Nice things are that you can blow stuff away by Window Title, CPU Time, Status, using filters. It's not as flexible as stop-process in MSH, but I'll talk about Monad on this week's Hanselminutes and in a later blog post.

I've got a batch file called cleanprocesses.bat that is filled with "net stop" and "taskkill" commands that takes my number of processes down from my standard 103 to 50. While extreme, I've found that when I'm giving a talk this makes my machine more stable. (Of course, not starting up the superfluous processes in the first place would be more clever.)

If you're running Windows 2000, I like PSKILL as an alternative.

Tracked by:
"Interesting Finds" (Jason Haley) [Trackback]
"Killing processes from the cmd line in XP" (James Clarke's Blog) [Trackback]


Monday, March 20, 2006 11:16:10 PM (Pacific Standard Time, UTC-08:00)
But not WinXP Home. Arghhh! When you try to do tech support at a relatives and find all your tools aren't available
RichB
Monday, March 20, 2006 11:17:16 PM (Pacific Standard Time, UTC-08:00)
Also, taskkill is actually a derivative of kill.exe from the Windows 2000/WinNT resource kit
RichB
Tuesday, March 21, 2006 12:05:55 AM (Pacific Standard Time, UTC-08:00)
Yeah, RichB, I hate that. Stupid market segmentation.

Neat trick though, I'll check it out. Win2k3 has a bunch of addons like this, I haven't had a chance to play with it too much. Considering it is a dual proc opteron system, I really should use it more...
Matt
Comments are closed.

Contact

Sponsors

Hosting By

Text Links

On this page...

Tags

Calendar

<August 2008>
SunMonTueWedThuFriSat
272829303112
3456789
10111213141516
17181920212223
24252627282930
31123456

Archives

Google Ads