Killing processes on windows

TaskKill: Kill process from command line (CMD)

We can kill a process from GUI using Task manager. If you want to do the same from command line., then taskkill is the command you are looking for. This command has got options to kill a task/process either by using the process id or by the image file name.

Kill a process using image name:

We can kill all the processes running a specific executable using the below command.

Example:
Kill all processes running mspaint.exe:

Kill a process forcibly

In some cases, we need to forcibly kill applications. For example, if we try to to kill Internet explorer with multiple tabs open, tasklist command would ask the user for confirmation. We would need to add /F flag to kill IE without asking for any user confirmation.

/F : to forcibly kill the process. If not used, in the above case it will prompt the user if the opened pages in tabs need to be saved.

To kill Windows explorer, the following command would work

The above command would make all GUI windows disappear. You can restart explorer by running ‘explorer’ from cmd.

Not using /F option, would send a terminate signal. In Windows 7, this throws up a shutdown dialog to the user.

Kill a process with process id:

We can use below command to kill a process using process id(pid).

Example:
Kill a process with pid 1234.

Kill processes consuming high amount of memory

For example, to kill processes consuming more than 100 MB memory, we can run the below command

More examples

Sometimes applications get into hung state when they are overloaded or if the system is running with low available memory. When we can’t get the application to usable state, and closing the application does not work, what we usually tend to do is kill the task/process. This can be simply done using taskkill command.

To kill Chrome browser from CMD

Kill Chromedirver from command line

To kill firefox browser application

To kill MS Word application(Don’t do this if you haven’t saved your work)

Sometimes, the command window itself might not be responding. You can open a new command window and kill all the command windows

This even kills the current command window from which you have triggered the command.

i have a question about this.
I have a process that runs in my domain that puts outlook suspended. As soon as I do a task kill forced as administrator it runs.

I wrote a little script, now i want to add admin rights to the script via GPO.

How to Kill a Process in Windows 10

When you start an app, the operating system creates a process for an executable file of the app. It contains the program code and its current activity. Windows assigns a special number known as Process Identifier (PID) which is unique for every process. There are a number of reasons you might want to kill a process, and different methods you can use to terminate it. Here is how it can be done.

To kill a process in Windows 10, do the following.

  1. Open Task Manager.
  2. Click on «More details» in the bottom right corner to enter Full view mode.
  3. Select the desired app in the app list.
  4. Click on the End task button or hit the Del key on the keyboard.

This is Task Manager’s most well known method.

Note: The same can be done from the Details tab. It is a special tab which lists process names instead of app names. There you can select a process in the list and either click on the End process button or hit the Del key.

Using the End Task button means Windows first tries to see for a certain timeout if the process has really stopped responding, and attempts to collect a crash or memory dump of the process. It then terminates the app.

Читайте также:  Очистить кэш скайпа windows 10

Tip: We highly recommend you read the article How to end a process quickly with Task Manager in Windows 10 to learn all Task Manager tricks. Also, you can get the classic Task Manager app in Windows 10 to end processes or tasks.

Another classic method to close a process is the console tool taskill. It comes bundled with modern versions of Windows.

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.

  1. Open the command prompt as the current user or as Administrator.
  2. 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.

  • To kill a process by its PID, type the command:
  • To kill a process by its name, type the command
  • For example, to kill a process by its PID:


    To kill a process by its 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.

    1. Open PowerShell. If required, run it as Administrator.
    2. Type the command Get-Process to see the list of running processes.
    3. To kill a process by its name, execute the following cmdlet:
    4. To kill a process by its PID, run the command:

    Examples:
    This command will close the notepad.exe process.

    The next command will close a process with PID 2137.

    If you need to kill a Store app, see the following article:

    Winaero greatly relies on your support. You can help the site keep bringing you interesting and useful content and software by using these options:

    Share this post

    About Sergey Tkachenko

    Sergey Tkachenko is a software developer from Russia who started Winaero back in 2011. On this blog, Sergey is writing about everything connected to Microsoft, Windows and popular software. Follow him on Telegram, Twitter, and YouTube.

    10 thoughts on “ How to Kill a Process in Windows 10 ”

    Some good ways to kill a process, but you forgot Process Explorer, I have been using it since Microsoft bought his company. And have replaced Task Manager with it. Thanks for you description on killing a process with power shell….janek

    Well, i’ve tried to cover native methods. Sure, there are tons of extra ways to kill a process.

    Is there a way to have tasklist output sorted alphabetically? It truly is a long list.
    Thank You

    Try
    TASKLIST /NH | SORT

    tip: does not need to type anything in uppercase 😉

    Thank you for this information. I was trying to remote in to work but my outlook was stuck/frozen and could not access anything but command. The taskkill information saved me a long commute in to work.

    Thank you for your information on how to kill a Windows process.

    Could you possibly advise how to “restart” a process stopped by using taskkill in the command line?

    For example, how can taskhostw.exe be restarted in the command line after the using the command “taskkill /F /IM taskhostw.exe” in the command line?

    It depends on the process.
    If it is a service, you should issue the appropriate command for the service.
    If it is a regular executable, you need to start it by typing its executable name and its arguments, if they needed.
    Also, there is a start command in the command prompt. Run start /? to see what it can do for you.

    Really killing a process in Windows

    Occasionally a program on a Windows machine goes crazy and just hangs. So I’ll call up the task manager and hit the «End Process» button for it. However, this doesn’t always work; if I try it enough times then it’ll usually die eventually, but I’d really like to be able to just kill it immediately. On Linux I could just kill -9 to guarantee that a process will die.

    This also could be used for writing batch scripts and writing batch scripts is programming.

    Is there some program or command that comes with Windows that will always kill a process? A free third-party app would be fine, although I’d prefer to be able to do this on machines I sit down at for the first time.

    Читайте также:  Super users in linux

    9 Answers 9

    «End Process» on the Processes-Tab calls TerminateProcess which is the most ultimate way Windows knows to kill a process.

    If it doesn’t go away, it’s currently locked waiting on some kernel resource (probably a buggy driver) and there is nothing (short of a reboot) you could do to make the process go away.

    Unix based systems like Linux also have that problem where processes could survive a kill -9 if they are in what’s known as «Uninterruptible sleep» (shown by top and ps as state D ) at which point the processes sleep so well that they can’t process incoming signals (which is what kill does — sending signals).

    Normally, Uninterruptible sleep should not last long, but as under Windows, broken drivers or broken userpace programs ( vfork without exec ) can end up sleeping in D forever.

    6 Ways to Kill Multiple Windows Processes at Once

    Whenever you want to view or kill a running process or task in Windows, the obvious thing to do is open up Windows Task Manager, look for what you want to kill and then click End Process or End Task. Even if you are not a fan of the Windows version, there are plenty of alternative task management utilities around that can do the basics while offering more features and more advanced functionality

    A limitation with Windows Task Manager is its inability to kill more than one process at the same time. This is sometimes required if there are malicious or potentially unwanted programs on the system because often they consist of more than one process. If you kill one process, another related process will relaunch it again soon afterwards. It’s also similar when trying to kill processes that are controlled by services because the background service can simply re-launch the program.

    By terminating all processes that are causing the issue at once, it doesn’t give anything the chance to respawn and hopefully stops things running that you don’t want running. As Windows Task Manager can’t do it, you will need another method, here are six for you to try out.

    As far as ease of use goes, Multi-Process Killer is about as simple as you could wish for. Although it’s a portable executable the Java Runtime Environment is required for Multi-Process Killer to work so it will need to be downloaded and installed separately if not already on your system.

    Run the program, select the processes that you would like to terminate by ticking their boxes, then click the Kill Selected Processes button. After a confirmation box everything you asked for should be terminated. The only option to speak of is changing the refresh rate of the process list from the default 1.5 seconds.

    2. Ultimate Process Killer

    Like Multi-Process Killer above, Ultimate Process Killer is a standalone portable program that shows you all running processes and allows you kill them in batches. This program however, doesn’t require Java Runtimes to function and is only 153KB in size.

    Simply run the program or refresh the list if it’s already open, tick the process boxes you want to kill and then press Kill Checked Process, the procedure is immediate and has no confirmation dialogs. To kill a single process click on it and press Kill Selected Process, an option is also available to terminate any single process on double click. A useful function is the simple logging with “Show Detail after Termination” which tells you how the procedure went in the Detail and Options tab.

    3. KillProcess

    This program is a little different because in addition to being a simple task manager, KillProcess can also make use of predefined process lists. The Kill Lists can then be loaded on your own or any other computer and all the running processes in the list will be killed (or inverted and not killed) at the click of a button. Sadly the lists provided by the author are outdated and stopped at Windows 7, you can easily make your own though.

    To create a list for batch killing processes, go to File > New Kill List, give it a name and location. Then click on any process in the list and press the Insert key (or right click and “Add to list”), and when you are ready press the bottom left button to execute the list and kill the selected processes. Alternatively add other executable files to the list manually in the edit list window. Kill Lists can be inverted and turned into lists of processes to keep by using the tick box in Edit Kill List > List Information.

    Читайте также:  Очень долго ставиться windows

    A useful feature worth mentioning is the ability for KillProcess to sit in the tray actively watching the running process list and killing specific processes in the Kill List as soon as they run. To do that select the process while editing the list and tick the Scan for process box. As soon as the program appears in the list of running processes, KillProcess will automatically kill it again.

    4. MiTec Task Manager Deluxe

    There are several task managers around but not all of them can multi select processes for batch termination. For instance, probably the most popular task manager Process Explorer can only select one process at a time. We’ve chosen to look at MiTec Task Manager Deluxe because it’s one of the easiest to perform batch process kills in addition to being portable and having the ability to replace Windows Task Manager if you want.

    Like other programs, MiTec Task Manager has a simple selection method of ticking the boxes for each process to kill and then clicking the Terminate checked processes button at the bottom. Something useful is the dropdown at the top that can hide system processes and show only non system processes which is where you’ll find running malicious or third party programs that you’re more inclined to want to kill. Separate 32-bit and 64-bit versions are available.

    Additional: Although it does not use boxes to select the processes for termination, another popular task manager that can multi kill is Process Hacker. Selecting what to kill is very much like Windows Explorer, Shift+click, Ctrl+click or click and drag to select the processes, then press the Del key.

    5. Auto Kill Any Process

    Auto Kill Any Process is similar to KillProcess by having the ability to create lists which can then be used to batch terminate processes, although this time they are call Hitlists. Unlike KillProcess, it is still in active development and listed as being compatible up to Windows 8.1, but unless you use Universal Extractor to unpack the MSI installer, it will have to be installed.

    Running processes can be added to a Hitlist and batch terminated every time you execute the list or killed immediately. To do either go to the Add Running Processes tab, tick each process to be killed from the running list and then click Save to Hitlist or Kill Now! You can of course create, edit and run custom Hitlists when you like. Another useful option in Other Settings is the timer which will execute the chosen Hitlists every set number of minutes from the system tray.

    6. Kill Multiple Processes From Command Line or Scripts

    In addition to Task Manager, Windows has a built in command line tool that is able to kill running processes from a Command Prompt window or script file. Taskkill is available on all recent versions of Windows (excluding XP Home) and can easily kill several different processes at once by either supplying their image name or process identifier (PID), both can be found in Task Manager. The syntax is quite simple:

    Taskkill /T /F /IM Firefox.exe /IM Iexplore.exe /IM Chrome.exe [/IM processname.exe]

    With the addition of /F the above command will force kill all instances of Firefox, Internet Explorer and Chrome using the image names given. Use /PID instead of /IM if you wish to kill a process by PID. Using PID will not kill multiple process instances with the same name, for example all Chrome.exe’s, because each process will have a different PID.

    You can also add a command similar to the above in the location box when creating a desktop shortcut, this will automatically kill all selected processes with a double click.

    Оцените статью