The taskkill command allows a user running any version of Microsoft Windows from XP on to “kill” a task from a Windows command line by PID (process id) or image name. This command is similar to end tasking a program in Windows.

Availability

Taskkill is an external command that is available for the following Microsoft operating systems as taskkill.exe.

  • Availability

  • Taskkill syntax

  • Taskkill examples

  • Windows XP Professional

  • Windows Vista

  • Windows 7

  • Windows 8

  • Windows 10

  • Windows 11

Taskkill syntax

Windows Vista and later syntax

TASKKILL [/S system [/U username [/P [password]]]] { [/FI filter] [/PID processid | /IM imagename] } [/T] [/F]

Filters:

Windows XP Home editions utilize this command. Use the command tskill instead.

  • Windows Vista and later syntax.
  • Windows XP and earlier syntax.

Note:

  • Wildcard ‘*’ for /IM switch is accepted only when a filter is applied.
  • Termination of remote processes is done forcefully (/F).
  • “WINDOWTITLE” and “STATUS” filters are not considered when a remote machine is specified.

Windows XP and earlier syntax

taskkill [/s Computer] [/u Domain\User [/p Password]]] [/fi FilterName] [/pid ProcessID]|[/im ImageName] [/f][/t]

Taskkill examples

taskkill /f /im notepad.exe

Kills the open Notepad task.

See the operator definition for full information about operators and eq, ge, gt, le, lt, and ne.

If you need to see a listing of all running tasks, use the tasklist command.

taskkill /pid 9764

Kill the task with PID 9764. If successful, this command should give you a message similar to the example below.

SUCCESS: Sent termination signal to the process with PID 9764.

  • See our task definition for further information and related links on this term.