How can I kill a process from the command prompt on Windows NT? Preferably with a tool that comes with the operating system.
4 Answers
If you had XP or later you could use TASKKILL
. This on not NT though.
I think you're going to have to download something to do this. I'd recommend pskill
from Sysinternals.
You can use this either with a process ID or just with a process name. For example:
pskill notepad.exe
Another option is KILL
from the NT Resource Kit.
-
1"This on not NT though." -- Windows XP is NT series, and has
taskkill
. So I guess you meant "NT 4.0 or older", or something like that.– user1686Oct 1, 2009 at 13:07
To kill process with children (like apache), from Windows XP to Windows Seven :
TASKKILL /T /F /PID 4520
We can use VBScript and WMI to kill processes:
Dim strComputer,objWMIService,objProcessList,objProcess
strComputer = "."
Set objWMIService = GetObject("winmgmts:" & "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")
Set objProcessList = objWMIService.ExecQuery("SELECT * FROM Win32_Process WHERE Name = 'THE PROCESS NAME'")
For Each objProcess in objProcessList
objProcess.Terminate()
Next
Or in modern windows editions, we can use Powershell:
Stop-Process -Name "PROCESS NAME WITHOUT EXTENSION"
There are a couple of choices:
KILL Command
kill process name or id
or
kill -f process name or id
AT Utility
at time /interactive cmd /c kill -f process name or id
And of course
Reboot :-)
-
2The AT utility doesn't kill the command. The command line is still using KILL. The advantage of calling it using AT as the KILL runs as LocalSystem instead of the current user which means it my kill some more processes which are less inclined to die. Oct 1, 2009 at 8:03