Saltar al contenido
Windows

Taskkill: Stop Windows Processes from the Command Line

taskkill /im notepad.exe /f ends a process by name; taskkill /pid 1234 /t /f ends a process and its children. Use tasklist first to find names and PIDs.

Probado en Windows 11 24H2, Windows Server 2019

taskkill ends running processes from the command line. It’s faster than Task Manager when an app is frozen, it works in scripts, and it can stop processes on another computer on your network.

Find the process first

Command Prompt
tasklistntasklist /fi u0022imagename eq chrome.exeu0022

Syntax

Syntax
taskkill [/s Computer [/u Domainu005cUser [/p Password]]] [/fi Filter] [/pid ProcessID | /im ImageName] [/t] [/f]
OptionMeaning
/imImage (executable) name, e.g. notepad.exe. Wildcards like note* work.
/pidProcess ID from tasklist or Task Manager.
/fForce – end the process immediately, without letting it save.
/tTree – also end child processes it started.
/fiFilter, e.g. by status, user, memory or window title.
/s /u /pTarget a remote computer, optionally with other credentials.

Everyday examples

Command Prompt
rem End Notepad, forcefullyntaskkill /im notepad.exe /fnnrem End a process and everything it startedntaskkill /pid 4120 /t /fnnrem End every app that is u0022Not Respondingu0022ntaskkill /fi u0022status eq not respondingu0022 /fnnrem End a user's Excel on a remote PCntaskkill /s PC-042 /u CORPu005cadmin /im excel.exe /f

Useful filters

FilterExample
Status/fi "status eq not responding"
User/fi "username eq CORPjsmith"
Memory (KB)/fi "memusage gt 500000"
Window title/fi "windowtitle eq Untitled*"
Service/fi "services eq spooler"

Use /f with care

Forced termination skips “do you want to save?” prompts, so unsaved work is lost. Never end system processes such as csrss.exe, wininit.exe or lsass.exe – Windows will crash. Ending processes owned by other users or services needs an administrator prompt.

In PowerShell the equivalent is Stop-Process -Name notepad -Force or Stop-Process -Id 4120.

Inder Kochar

Escrito por

Inder Kochar

Ingeniero de sistemas y redes – Documento las soluciones que aplico con mis clientes, probadas en sistemas reales. ¿Atascado con algo parecido?

Seguir leyendo

Haga una pregunta o comparta su solución

Su correo no se publica. Los comentarios se moderan – por favor, cíñase al tema.