We can kill a process from GUI using Task manager. If you want to do the same from the command line in Windows 11 or Windows 10, then taskkill is the command you are looking for. This command has options to kill a task/process either by using the process id or by the image file name.
Save your work before using these commands. Using /F can lose unsaved changes.
Kill a process using image name:
We can kill all the processes running a specific executable using the below command.
taskkill /IM executablename
Example:
Kill all processes running mspaint.exe:
C:\>taskkill /IM mspaint.exe SUCCESS: Sent termination signal to the process "mspaint.exe" with PID 1972.
Kill a process forcibly
In some cases, we need to forcibly kill applications. We can add the /F flag to taskkill for this. For example, to forcibly close Microsoft Edge, run the below command.
taskkill /F /IM msedge.exe
This targets all running Microsoft Edge processes named msedge.exe, not just one tab or window. Unsaved work may be lost.
/F : to forcibly kill the process. Do not rely on a save prompt when using this option.
To kill Windows explorer, the following command would work
C:\>taskkill /F /IM explorer.exe SUCCESS: The process "explorer.exe" with PID 2432 has been terminated.
The above command closes Explorer windows and can make the desktop and taskbar disappear. It does not close every application. You can restart explorer by running ‘explorer’ from cmd.
C:\>explorer
Not using /F sends a termination request. In the original Windows 7 example below, this opened a shutdown dialog.
C:\>taskkill /IM explorer.exe SUCCESS: Sent termination signal to the process "explorer.exe" with PID 2432. C:\>
Kill a process with process id:
We can use the command below to kill a process using process ID (PID).
taskkill /PID processId
We can find the PID by running tasklist.
Example:
Kill a process with PID 1234.
taskkill /PID 1234
To also kill child processes started by this process, add /T. Use this only if you intend to close those child processes too.
taskkill /PID 1234 /T
Kill processes consuming a high amount of memory
taskkill /FI "memusage gt value" /IM *
The memory value is in KB. First list the processes using more than 102400 KB (100 MB):
tasklist /FI "memusage gt 102400"
The below command targets all matching processes, not just the application you are troubleshooting. Check the list and save your work before running it. To close only one process, use its PID instead.
taskkill /FI "memusage gt 102400" /IM *
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
Taskkill /F /IM Chrome.exe
Kill ChromeDriver from command line
Taskkill /F /IM Chromedriver.exe
To kill Firefox browser application
taskkill /F /IM firefox.exe
To kill MS Word application(Don’t do this if you haven’t saved your work)
taskkill /F /IM WinWord.exe
Sometimes, the command window itself might not be responding. You can open a new command window and kill all the command Windows
taskkill /F /IM cmd.exe
This even kills the current command window from which you have triggered the command.
I want to taskkill everything, how would i do that
Using taskkill in Matlab to kill Chrome, how do I prevent taskkill from outputting all the kill information?
Why can’t I get this to kill all cmd.exe?
taskkill /f /im cmd.exe will only work on a single instance. If you have more than 1 instance it will not kill any instances.
How do I close a specific tab in chrome using batch file?
How do I kill the administrator?
He is a very annoying person…
Is there any way to just end all programs in one go?
I also just found the awnser to my own question: taskkill /F /T /FI “memusage gt 1”
How to kill a process based on command line, since many process run with same name.
Example ade.exe ade.exe, I want to kill only one based on command line. I’m not supposed to use pid to kill the process
I dont want to open cmd every time is it possible to make a .bat file that can auto-kill the process?
for example:
taskkill /f /im GTA5.exe
Yes. Create a batch file with your command. Store the batch file in a folder on the hard drive. Create a shortcut to the batch file and place it on your desktop. Right-Click the Shortcut, go to Properties, Advanced, and check the box that says “Run as Administrator”. Save the shortcut. Now when you open the shortcut, you will get the prompt to Run As Administrator, then you just click “Yes”. Even with admin rights, you will still get the prompt.
I have a program and when I close that, it displays a OK / Cancel message window. How can I pass ‘OK’ to TASKKILL command. Please help……
is there any way to kill specific tab of chrome through this taskkill as if we use chrome.exe to kill ,it will terminate all the processes.
Be careful never user *taskkill /t /f /im explorer.exe* or your desktop will disappear!
or in that case;
Press the Windows key + r
Type explorer.exe
press enter
With the most recent version of Windows 11 Pro x64, in the Task Manager, Details section, if you right-click on a process or exe, it now gives you the option to “restart” the task. Is there a command line version of the “restart” command? I know taskkill.exe can stop the process, and start.exe can start one, but is there one combined command to stop, then restart it?
ok..can any say how we can able find PORT
number just by typing the PROCESS ID
Please how to kill a program as administrator.
I have created a cmd file with the comand taskkill /im programname /f
but it doesn’t kill the program, so put at the end the comand pause to see what happened
and have noticed that it gave me access denied.
Please how can i do?
Thanks
Enzo
Use Taskkill /t /f /im `your cmd file name`
/t terminate all process including sub-ones
/f with force
/im with image name
how to kill my Wifi or internet access if my VPN dies? I mean there is a specific task to kill-close immediately my internet?
Open command prompt with administrator
in command prompt, type following command
taskkill /IM Excel.exe
and press enter
But how can you taskkill all??
Hold down the power button for 10 seconds or run the command “shutdown /s”
I use this command: taskkill /IM iperf.exe /F from regular command line window and it fails but when I run same command from command line that was run as administrator – it works fine – why and what can be done?
Well, its clear that you need be administrator for kill this processes ;)
I didn’t see how to kill specific file.
for example i have three A.docx, B.docx, and C.docx files and I want kill just A.docx.
if I use taskkill /IM winword.exe then I will kill all of them.
When you kill with image name, it kills every process so all files would be closed. To kill a Word session for a specific file, use the process id.
im just saying on admin cmd command like this: (taskkill /f /im wininit.exe /t ) and my windows frezze and blue screen of death hehehe im was very stupid
Now set it as a startup item or a task in the task manager!
That’s gonna crash their computer forever, resulting that you will need to buy a new computer o-o
How can keep the line below from showing in the open DOS box?
SUCCESS: The process “program.exe” with PID 2868 has been terminated.
taskkill /f /im blah > nul
Hello,
I want to kill 3 images once a condition is matches,
taskkill /fi “USERNAME eq %USERNAME%” /im java.exe ssonsvr.exe wfshell.exe
could anyone tell me what is the right syntax to do so?
Thanks
FOR %I IN (java.exe ssonsvr.exe wfshell.exe) DO taskkill /fi “USERNAME eq %USERNAME%” /im %I
Use %%I if it is included in a batch
Taskkill /f /Im V4GLTE.exe
Hi,
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.
Can you help me with that?
Kind regards,
Karim