How to kill a Windows process
If you’ve finished with some Windows application then you’ll probably get rid of it by pressing Alt+F+X, clicking the top-right Close button, or following some other documented route.
This is generally the safest approach, too, as it gives the program an opportunity to close down properly, save important data, delete temporary files and generally clean up. But if the application won’t close, or you’re looking to do something more advanced -- close several processes in one operation, maybe -- then there are other options you might want to try.
1. Safety first
Start with something standard, like pressing Alt+F4. This sends a "close" signal to the program, and if this is recognized it should shut down as normal.
If the program would normally close, but this time nothing is happening, then that could mean it’s busy doing something else. Close any open dialogs, pause or stop any non-essential tasks the app might be running, and try again.
You could also press Ctrl+Shift+Esc to launch Task Manager, and check the CPU, Disk or Network columns to look for current activity.
Right-click the process, select Go to Details, right-click it again and select Analyze Wait Chain to see if it’s waiting for some other process (if not, you’ll be told it’s "running normally").
If the task is highlighted as "not responding" then that’s also a sign that it’s stuck in a loop, engaged in a lengthy task, or maybe waiting for some other system event.
If the process is busy or not responding then that’s probably the real reason that it won’t close, and your top priority should be researching the cause.
That’s no help right now, of course, but there are other shutdown tricks you can try.
2. Task Manager
Press Ctrl+Shift+Esc to launch Task Manager, if it’s not running already.
Click the Processes tab, find and click your application in the list (click the "Name" column header if app and background processes are mixed up).
Right-click the app, select End Task, and Task Manager sends a Terminate message to that window. That’s a serious step which should close the application without any of the usual housecleaning -- no "do you want to save your document?" messages, so data may be lost -- but it’s also much more likely to work.
If "End Task" doesn’t work, you may have more success by right-clicking the app, selecting Go To Details, right-clicking again and selecting "End Process Tree". This ends any processes the app might have launched before closing the app itself, which might free up some crucial resource.
Be careful, though -- Task Manager doesn’t show you the process tree so you can’t tell what you’re closing. Avoid this unless you know exactly what you’re doing. Or just skip straight to step 3.
3. Process Hacker
The portable free Process Hacker improves on Task Manager immediately by displaying your processes in a tree, so you can see what each process has launched.
For example, on our test PC we could see Nvidia’s nvstreamsvc.exe had launched both NvStreamNetworkService.exe and another copy of nvstreamsvc.exe, both of which had then launched copies of conhost.exe. Simply having that tree tells you much more about what’s happening on your PC.
Process Hacker has many ways to close a troublesome process, too. If you’re really sure you want to do this -- because closing down a system process could crash your PC immediately -- then right-click whatever you want to shut down, and click Terminate to close it, or Terminate Tree to shut down everything it’s launched, as well.
Windows experts who want to understand why something won’t close can right-click a process and select Miscellaneous > Terminator. This allows users to try any combination of 15+ shutdown-related options, which may -- eventually -- help you identify what’s working in this case.
TaskKill is a Windows console tool which can shut down processes from the command line, batch files, scripts and shortcuts.
The program uses the same techniques as Task Manager, so won’t work in every situation, but it’s still handy for automating shutdowns.
This command will shut down all processes with an image name (file name) of notepad.exe, for example.
taskkill /im notepad.exe
If that doesn’t work, adding an /f switch will force the process to close. (As before, this means it won’t warn you of unsaved work, or have a chance to clean up properly.)
taskkill /f /im notepad.exe
Running taskkill /? shows how you can also filter and select processes by PID, CPU time and more.
Here’s one interesting option:
taskkill /f /fi "STATUS eq NOT RESPONDING"
This forcibly closes every process marked as "not responding", but without having to load Task Manager for you to check.
5. More Tools
As we’ve pointed out, forcing processes to close is usually a bad idea. Not only is there a risk of losing data, but if the process is marked critical, your system may even have a blue-screen crash.
That’s understandable for Windows system processes, but unfortunately malware sometimes uses the same technique to block any cleanup attempts.
If you’re getting BSODs when you try to close something, ProcessCritical can remove the critical flag for you, which might help. Although beware: if this really is some legitimate system-critical process, there’s no telling what harm closing it might do.
If you prefer something simpler, KillProcess allows you to multi-select applications and then kill them all in one operation.
It can also monitor running processes on your PC, and close anything on your "kill list" as soon as it appears.
Finally, KillEmAll is a free tool which is designed to kill all non-essential processes in a single operation, originally to help fight malware although it has plenty of other uses.
The program should be treated with caution, because it doesn’t ask politely before taking action -- run it and everything else (more or less) closes immediately.
Still, even if you don’t need its bulk-closing abilities, KillEmAll has other advantages. In particular its handy ability to run in the local system account may allow the program to terminate processes which other apps can’t touch.