सामग्री पर जाएँ
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.

परखा गया 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

लेखक

Inder Kochar

सिस्टम्स और नेटवर्क इंजीनियर – मैं वही समाधान लिखता हूँ जो क्लाइंट्स के साथ इस्तेमाल करता हूँ, असली सिस्टम पर परखे हुए। ऐसी ही किसी समस्या में फँसे हैं?

आगे पढ़ें

सवाल पूछें या अपना समाधान बताएँ

आपका ईमेल प्रकाशित नहीं होगा। टिप्पणियाँ जाँची जाती हैं – कृपया विषय से जुड़ी रखें।