End Processes like a Pro with the Taskkill Command
Can’t stop a stubborn program from running? Find out how easy it is to quit stubborn programs, processes or services using the Task Kill Command in Windows 10.
By now, we are all familiar with force-quitting applications and processes. Whether you are hitting Ctrl + Alt + Del or launching the Task Manager and clicking End Task, there are times when you have to kill a process when it’s unresponsive, buggy, or bogging your system down with bloat.
What you might not know is that there is a hidden, even more powerful way to close pesky processes in Windows 10: the taskkill command.
The advanced task kill command gives you more control as you end processes and even works on tasks that refuse to close even after killing them in Task Manager. Oh, and we’ll be running this from the command line, so get your fingers ready.
Stop Programs from the Command Prompt Using Taskkill
Some programs and background services in Windows 10 can prove hard to kill when you want to exit them. Whether it’s a glitch or conflict in the system or something more malicious, a program can sometimes end up making the desktop unstable, oftentimes requiring a reboot.
Sometimes a program will run silently in the background for completely routine reasons but fail or get hung up somewhere along the line. Since there’s no user interface to it, you’d never know it was stuck in the background, eating up resources. For example, this can happen with a Windows installer package (msiexec.exe) when you boot Windows 10.
The Task Kill command can resolve such issues with a little more power and grace by getting to the root of the problem. This is thanks partly to its ability to home in on a program’s PID or process ID.
To stop this from happening, launch the command prompt with administrator privileges.
At the command prompt, type: tasklist, which will generate a list of running programs just like those you would find in the Windows Task Manager, only way cooler looking with more power. As you can see in the screenshot, a table lists all running programs by Image Name, PID, Session Name, Session#, and Memory Usage.
If there is a program, you want to kill, scroll through the list, then look for the PID. You are not restricted to using the PID only, and you can use the Image name too. So, say I want to kill Slack, but I don’t know which PID to chose in the list:
I can type:
Taskkill /IM slack.exe /F
The flags you see in the command: /IM and /F tell the command to reference the image name (/IM) and force (/F) the process to quit entirely regardless of any conflicts.
If there is a single process or part of a process you want to quit without stopping the entire program, then type:
Taskkill /PID ##### /F
where ##### is the PID for the exe, you want to close. This is handy when there are multiple processes with the same image name.
For example, Taskkill /PID 1592 /F would kill the Windows Store app. (Although there is no reason to do this since this does not delete the program, it only stops it from running.)
There is more beyond ending individual tasks that Task Kill can do. If you want to explore what’s available, type taskkill /? then hit Enter. This will reveal some powerful options for using Task Kill. For example, if you want to kill a group of programs, type: TASKKILL /PID 1230 /PID 1241 /PID 1253 /T. That should save you a lot of time.
Give taskkill a spin, but exercise a little caution while using it, since you can kill tasks to the point of making the system unstable.
Great Tip.. Thx!
Yea, I found out that the program remains in memory – is there any way to clean it out?
It’s taskkill /f (/im or /pid) (image name or pid). Not taskkill (/im or /pid) (image name or pid) /f.
Hi Damien – Thanks for the comment.
Either will work. You can put the /f before /im or after the imagename or pid.
Cool to know :D
What other options do I have if taskkill is unable to kill a process? I’m still getting a “Access is denied” reason.
Can the use of the Taskkill command be put in a program that (a) runs at the command prompt in the background, (b) repeatedly (at set time intervals) gives the tasklist command, (c) looks for/checks for specific tasks in the tasklist, and (d) invokes the taskkill command when it finds specific tasks it is looking for.
You may ask why? Windows 10 repeatedly puts some tasks back up in the background, later on, in the same session, after I have killed them.