Movatterモバイル変換


[0]ホーム

URL:


Skip to main content

This browser is no longer supported.

Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.

Download Microsoft EdgeMore info about Internet Explorer and Microsoft Edge
Table of contentsExit editor mode

taskkill

Feedback

In this article

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.

Syntax

taskkill [/s <computer> [/u [<domain>\]<username> [/p [<password>]]]] {[/fi <filter>] [...] [/pid <processID> | /im <imagename>]} [/f] [/t]

Parameters

ParameterDescription
/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.
/fSpecifies that processes be forcefully ended. This parameter is ignored for remote processes; all remote processes are forcefully ended.
/tEnds the specified process and any child processes started by it.

Filter names, operators, and values

Filter NameValid OperatorsValid Value(s)
STATUSeq, neRUNNING | NOT RESPONDING | UNKNOWN
IMAGENAMEeq, neImage name
PIDeq, ne, gt, lt, ge, lePID value
SESSIONeq, ne, gt, lt, ge, leSession number
CPUtimeeq, ne, gt, lt, ge, leCPU time in the formatHH:MM:SS, whereMM andSS are between 0 and 59 andHH is any unsigned number
MEMUSAGEeq, ne, gt, lt, ge, leMemory usage in KB
USERNAMEeq, neAny valid user name (<user> or<domain\user>)
SERVICESeq, neService name
WINDOWTITLEeq, neWindow title
MODULESeq, neDLL name

Remarks

  • 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.

Examples

To end the processes with process IDs1230,1241, and1253, type:

taskkill /pid 1230 /pid 1241 /pid 1253

To forcefully end the processNotepad.exe if it was started by the system, type:

taskkill /f /fi "USERNAME eq NT AUTHORITY\SYSTEM" /im notepad.exe

To 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 *

Related links


Feedback

Was this page helpful?

YesNoNo

Need help with this topic?

Want to try using Ask Learn to clarify or guide you through this topic?

Suggest a fix?

  • Last updated on

In this article

Was this page helpful?

YesNo
NoNeed help with this topic?

Want to try using Ask Learn to clarify or guide you through this topic?

Suggest a fix?