Home » Questions » Computers [ Ask a new question ]

How can I kill a process from the command prompt on Windows NT?

How can I kill a process from the command prompt on Windows NT?

How can I kill a process from the command prompt on Windows NT? Preferably with a tool that comes with the operating system.

Asked by: Guest | Views: 329
Total answers/comments: 2
Guest [Entry]

"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."
Guest [Entry]

"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"""