How-To Kill / End a Process Using Command Prompt in Windows 10

In this learning path I will go into all of the options the Command Prompt in Windows has to offer. I know it looks like DOS has returned to life but it has a lot of great options and can be incredibly powerful when used correctly. In this part I will go into the option you have to kill a process. Great for when your Task Manager gets stuck or unresponsive thanks to bad scripting by the developer.

Carefull
Be aware that this method can kill system related process that would render your system unusable till restart or automatically force your system to shut down. Please be very sure which processes you kill.

Kill Processes using the Command Prompt (CMD)

For us to kill a process using CMD there are two command we need to know. The first will be Tasklist and the other one would be Taskkill. Tasklist displays a list of applications and services with their Process ID (PID) for all tasks running on either a local or a remote computer. And Taskkill ends one or more tasks or processes. Processes can be killed by process ID or image name.

Syntax Tasklist

tasklist[.exe] [/s computer] [/u domain\user [/p password]] [/fo {TABLE|LIST|CSV}] [/nh] [/fi FilterName [/fi FilterName2 [ ... ]]] [/m [ModuleName] | /svc | /v]

Parameters

/s Computer : Specifies the name or IP address of a remote computer (do not use backslashes). The default is the local computer.
/u Domain \ User : Runs the command with the account permissions of the user specified by User or Domain\User. The default is the permissions of the current logged on user on the computer issuing the command.
/p Password : Specifies the password of the user account that is specified in the /u parameter.
/fo { TABLE | LIST | CSV } : Specifies the format to use for the output. Valid values are TABLE, LIST, and CSV. The default format for output is TABLE.
/nh : Suppresses column headers in the output. Valid when the /fo parameter is set to TABLE or CSV.
/fi FilterName : Specifies the types of process(es) to include in or exclude from the query. The following table lists valid filter names, operators, and values.

Syntax Taskkill

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

Parameters

/s Computer : Specifies the name or IP address of a remote computer (do not use backslashes). The default is the local computer.
/u Domain \ User : Runs the command with the account permissions of the user specified by User or Domain\User. The default is the permissions of the current logged on user on the computer issuing the command.
/p Password : Specifies the password of the user account that is specified in the /u parameter.
/fi FilterName : Specifies the types of process(es) to include in or exclude from termination. The following are valid filter names, operators, and values.

Now that we know how all the command work, it’s time to start using them. Since it isn’t that complicated to use, I will just give one preview of the syntax uses. After that it’s up to you to use them!

Syntax uses

Let’s start by running the Command Prompt in Administrator mode.

How to Run a TraceRoute on Windows. Run CMD

Enter the Tasklist command and see it showing a list of all the processes running at the moment.

Now to kill Internet Explorer for example we would use

Taskkill /IM iexplore.exe /F
Using /F to forcekill the proccess.

That’s all there is to it! If you need any help, feel free to commend. suggestions for new ‘CMD learnings’ can also be left in the commend. I will be happy to help with whatever problem you might be having.

Yuri Pustjens
About the Author

2014, 2015, 2016, 2017 and 2018 Microsoft Most Valuable Professional Windows
Yuri specializes in troubleshooting (crash analysis and devices), system resource utilisation and system performance. He is also very interested in Customer Security. Yuri can be found as Windows Community Moderator and Wiki Author on Microsoft Answers and is active on different communities all across the web.

Leave a Reply

Your email address will not be published. Required fields are marked *