Link to home
Create AccountLog in
Avatar of Samuel-AMC

asked on

Batch to Kill a running process on XP,Vista, or 7

I've tried all this methods on killing a running process, but none of this work for me.
I need to make this work in Windows 7 which is the one i am working with right now.

tskill running.exe /A
process -k running.exe
TASKKILL /F /IM "running.exe"
I even tried by process ID: TASKKILL /F /PID 1234

This is the error message i get when i use any of the commands i described above:
ERROR: The process "running.exe" could not be terminated. Reason: Access is denied.

Please give a hand on which one would do the task, thanks in advance.
Avatar of Steven Carnahan
Steven Carnahan
Flag of United States of America image

Link to home
Create an account to see this answer
Signing up is free. No credit card required.
Create Account
Avatar of Samuel-AMC


Thank You pony10us, i never thought of that :-)
Yes, this sounds like you haven't done "Run as Administrator".  To test this when you start your DOS Command window to test the commands you mention above, make sure you right click the link and do "Run as Administrator".

Mine worked fine after trying and running the script as admin
Yeah thanks Bill, you right, i was trying but not as admin :-)
Yup, glad you got that sorted out.

Glad to help.   :)
Thank you Pony, thank you Bill.