====>>>>> I've moved to http://shallowhacker.blogspot.com

Sunday, May 1

taskkill.exe and PsTools

I was looking for a way to kill running tasks in from the command line in XP, and I came across information about the command line utility taskkill.exe. This does the trick but isn't available in XP Home. It will work with XP Home however.

I used to have a link to download taskkill.exe, but considering Microsoft might not be too keen on me redistributing their software, I now offer a link to a free suite of utilities PsTools provided by Microsoft, that contains the utility PsKill. PsKill will do the same job as taskkill.exe
Follow this link and you'll find a description of PsKill and a download link for the PsTools suite.
http://technet.microsoft.com/en-us/sysinternals/bb896683.aspx
[ thanks for the tip Anonymous ;-) ]

If you're still determined to download taskkill.exe from somewhere good luck.
Here is Microsoft's documentation on taskkill.exe: M$ taskkill.exe documentation and here are some usage examples from computerhope: Computerhope taskkill.exe help

8 comments:

Anonymous said...

why is it in german

Anonymous said...

I guess because it originally came from a German version of XP!
I'll see if I can swap it for an English version :)

Anonymous said...

By the way it is dutch not german.

A german.

Anonymous said...

How do I get it to run through a batch file. I need to kill processes on a lot of computers, and i don't want to type each computer name into the command line. I'd rather do it once and just run it as a batch and as a scheduled task every day at 9AM.

Anonymous said...

Jeff,
See my links above for the taskkill.exe syntax and some examples. You have to know a bit about writing atch files yourself because it's not my strong point ;)
I tried executing taskkill using a wildcard ('*') character in the computer name or IP address (when using the /s switch) but it didn't work.
So all I can suggest is writing your batch file like this:
c:\taskkill /s {computer_name_1} {parameters}
c:\taskkill /s {computer_name_2} {parameters}
c:\taskkill /s {computer_name_3} {parameters}
So you hard code the computer names in the batch file. If the names are always the same, then at least you'll only have to do this once.
If you don't know the names, but do know the IP addresses, use those instead.
If you're dealing with a lot of IP addresses, find a friend to write you a batch file which loops thru all the IP addresses. I can't write batch file code off the top of my head, but here's the pseudocode:
Where x=1 until 254
Do c:\taskkill /s 192.168.1.x {parameters}

Regards,
Josh

Anonymous said...

for taskkill you dont have to specify and computer name etc, just whether it is an image or not then the .exe extension. just thought that might help if you havent already solved this

Anonymous said...

Instead of running the risk to get slapped on the wrist for distributing copyrighted MS software, it would be better to point people to the equally and better wroking PsKill utility by Mark Russinovitch.

http://technet.microsoft.com/en-us/sysinternals/bb896683.aspx

Anonymous said...

for taskkill you dont have to specify and computer name etc, just whether it is an image or not then the .exe extension. just thought that might help if you havent already solved this----------------------------------

gigajosh.blogspot.com has moved to http://shallowhacker.blogspot.com

Hi, I recently moved to http://hallowhacker.blogspot.com so please come and find me there if you want to see my latest posts :-)

HTC TYTN II internet price graph

HTC TYTN II internet price graph

tracker

eXTReMe Tracker