Skip to content

Windows TASKKILL command

The Windows taskkill command is a powerful tool to terminate processes on a Windows system. It allows users to end tasks based on either the process name or the process ID. This can be useful for troubleshooting, managing system resources, or stopping unresponsive applications. By using taskkill, users can force the termination of a process that may be causing issues or consuming too many resources. The command can be run from the Command Prompt or PowerShell, and it offers various options for customizing the termination process.

TASKKILL Syntax:

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

Options:

OptionDescription
/sSpecifies the remote system to connect to.
/uSpecifies the user context under which the command should execute.
/pSpecifies the password for the user context.
/fiApplies a filter to select the tasks to terminate.
/pidSpecifies the PID (Process ID) of the process to be terminated.
/imSpecifies the image name of the process to be terminated.
/fForces the termination of the process without prompting for confirmation.
/tTerminates the specified process and any child processes started by it.

Parameters:

ParameterDescription
ComputerSpecifies the remote computer to connect to.
DomainSpecifies the domain of the user account.
UserSpecifies the user name for the taskkill command.
PasswordSpecifies the password for the user account specified.
FilterSpecifies a set of criteria to filter the processes by.
ProcessIDSpecifies the Process ID of the process to be terminated.
ImageNameSpecifies the image name of the process to be terminated.

TASKKILL Usage:

End a Process by PID

Terminal window
taskkill /pid 1234 /f

Terminate the process with PID 1234 forcefully.

End a Process by Name

Terminal window
taskkill /im notepad.exe /f

Forcefully end the notepad.exe process.

End a Process on a Remote Computer

Terminal window
taskkill /s REMOTEPC /pid 4321 /f

Terminate the process with PID 4321 on a remote computer named REMOTEPC.

End Multiple Processes by Image Name

Terminal window
taskkill /im chrome.exe /im firefox.exe /f

Forcefully end all running instances of Chrome and Firefox simultaneously.

How do I use taskkill in Windows?

To use the taskkill command in Windows, execute the following command:

Terminal window
taskkill /PID <processID>

How can I end a process by its name using taskkill?

To end a process by its image name, run the following command:

Terminal window
taskkill /IM <imagename>.exe

Can I force the termination of a process with taskkill?

Yes, you can forcibly terminate a process by adding the /F parameter. Here’s an example:

Terminal window
taskkill /F /PID <processID>

How can I view a list of running processes before using taskkill?

To list all running processes and corresponding Process IDs, use the tasklist command:

Terminal window
tasklist

Is it possible to end multiple processes at once with taskkill?

You can terminate multiple processes simultaneously by specifying multiple Process IDs. Here is the command:

Terminal window
taskkill /PID <processID1> /PID <processID2>

Can I use taskkill remotely to end a process on another computer?

Yes, you can connect to another computer and terminate a process remotely with taskkill. Here’s an example using the /S and /U options:

Terminal window
taskkill /S <computername> /U <username> /PID <processID>

Applications of the TASKKILL Command

  • Terminate a process by name or process ID
  • Forcefully terminate a process
  • End multiple processes at once using filters
  • Show a list of running processes and their process IDs
  • Stop unresponsive or hung processes
  • Close applications that cannot be closed through normal means