This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
Note
Access to this page requires authorization. You can trysigning in orchanging directories.
Access to this page requires authorization. You can trychanging directories.
Ends one or more tasks or processes. Processes can be ended by process ID or image name. You can use thetasklist command command to determine the process ID (PID) for the process to be ended.
Note
This command replaces thekill tool.
taskkill [/s <computer> [/u [<domain>\]<username> [/p [<password>]]]] {[/fi <filter>] [...] [/pid <processID> | /im <imagename>]} [/f] [/t]| Parameter | Description |
|---|---|
/s<computer> | Specifies the name or IP address of a remote computer (do not use backslashes). The default is the local computer. |
/u<domain>\<username> | Runs the command with the account permissions of the user who is specified by<username> or by<domain>\<username>. The/u parameter can be specified only if/s is also specified. The default is the permissions of the user who is currently logged on to the computer that is issuing the command. |
/p<password> | Specifies the password of the user account that is specified in the/u parameter. |
/fi<filter> | Applies a filter to select a set of tasks. You can use more than one filter or use the wildcard character (*) to specify all tasks or image names. The valid filters are listed in theFilter names, operators, and values section of this article. |
/pid<processID> | Specifies the process ID of the process to be terminated. |
/im<imagename> | Specifies the image name of the process to be terminated. Use the wildcard character (*) to specify all image names. |
| /f | Specifies that processes be forcefully ended. This parameter is ignored for remote processes; all remote processes are forcefully ended. |
| /t | Ends the specified process and any child processes started by it. |
| Filter Name | Valid Operators | Valid Value(s) |
|---|---|---|
| STATUS | eq, ne | RUNNING | NOT RESPONDING | UNKNOWN |
| IMAGENAME | eq, ne | Image name |
| PID | eq, ne, gt, lt, ge, le | PID value |
| SESSION | eq, ne, gt, lt, ge, le | Session number |
| CPUtime | eq, ne, gt, lt, ge, le | CPU time in the formatHH:MM:SS, whereMM andSS are between 0 and 59 andHH is any unsigned number |
| MEMUSAGE | eq, ne, gt, lt, ge, le | Memory usage in KB |
| USERNAME | eq, ne | Any valid user name (<user> or<domain\user>) |
| SERVICES | eq, ne | Service name |
| WINDOWTITLE | eq, ne | Window title |
| MODULES | eq, ne | DLL name |
TheWINDOWTITLE andSTATUS filters aren't supported when a remote system is specified.
The wildcard character (*) is accepted for the*/im option, only when a filter is applied.
Ending a remote process is always carried out forcefully, regardless whether the/f option is specified.
Providing a computer name to the hostname filter causes a shutdown, stopping all processes.
To end the processes with process IDs1230,1241, and1253, type:
taskkill /pid 1230 /pid 1241 /pid 1253To forcefully end the processNotepad.exe if it was started by the system, type:
taskkill /f /fi "USERNAME eq NT AUTHORITY\SYSTEM" /im notepad.exeTo end all processes on the remote computerSrvmain with an image name beginning withnote, while using the credentials for the user accountHiropln, type:
taskkill /s srvmain /u maindom\hiropln /p p@ssW23 /fi "IMAGENAME eq note*" /im *To end the process with the process ID2134 and any child processes that it started, but only if those processes were started by the Administrator account, type:
taskkill /pid 2134 /t /fi "username eq administrator"To end all processes that have a process IDgreater than or equal to 1000, regardless of their image names, type:
taskkill /f /fi "PID ge 1000" /im *Was this page helpful?
Need help with this topic?
Want to try using Ask Learn to clarify or guide you through this topic?
Was this page helpful?
Want to try using Ask Learn to clarify or guide you through this topic?