본문 바로가기

Academy I/Windows

[Windows10]Kill a process using Taskkill

Kill a process using Taskkill



Note: Some processes are running as Administrator (elevated). In order to kill them, you need to open an elevated command prompt instance.


Open the command prompt as the current user or as Administrator.

Type tasklist to see the list of running processes and their PIDs. Since the list might be very long, you can use a pipe character with the more command.



tasklist | more



Windows 10 Tasklist


To kill a process by its PID, type the command:


taskkill /F /PID pid_number


To kill a process by its name, type the command

taskkill /IM "process name" /F




For example, to kill a process by its PID:


taskkill /F /PID 1242


Windows 10 Taskkill By Pid




To kill a process by its name:


taskkill /IM "notepad.exe" /F


Windows 10 Taskkill By Name




Taskkill supports many useful options which you can use to terminate apps. You can learn them by running it as follows: taskkill /?. Using taskkill, you can close all not responding tasks at once in Windows 10.






Kill a process using PowerShell



Note: To kill a process which runs elevated, you need to open PowerShell as Administrator.


Open PowerShell. If required, run it as Administrator.


Type the command Get-Process to see the list of running processes.


To kill a process by its name, execute the following cmdlet:


Stop-Process -Name "ProcessName" -Force


To kill a process by its PID, run the command:


Stop-Process -ID PID -Force




Examples:


This command will close the notepad.exe process.


Stop-Process -Name "Notepad" -Force



Windows 10 Powershell Kill A Process


The next command will close a process with PID 2137.


Stop-Process -ID 2137 -Force