It tells taskkill that the next parameter something.exe is an image name, a.k.a executable name

C:\>taskkill /?

TASKKILL [/S system [/U username [/P [password]]]]
         { [/FI filter] [/PID processid | /IM imagename] } [/T] [/F]

Description:
    This tool is used to terminate tasks by process id (PID) or image name.

Parameter List:
    /S    system           Specifies the remote system to connect to.

    /U    [domain\]user    Specifies the user context under which the
                           command should execute.

    /P    [password]       Specifies the password for the given user
                           context. Prompts for input if omitted.

    /FI   filter           Applies a filter to select a set of tasks.
                           Allows "*" to be used. ex. imagename eq acme*

    /PID  processid        Specifies the PID of the process to be terminated.
                           Use TaskList to get the PID.

    /IM   imagename        Specifies the image name of the process
                           to be terminated. Wildcard '*' can be used
                           to specify all tasks or image names.

    /T                     Terminates the specified process and any
                           child processes which were started by it.

    /F                     Specifies to forcefully terminate the process(es).

    /?                     Displays this help message.
Answer from EkriirkE on Stack Overflow
🌐
Microsoft Learn
learn.microsoft.com › en-us › windows-server › administration › windows-commands › taskkill
taskkill | Microsoft Learn
This command replaces the kill tool. taskkill [/s <computer> [/u [<domain>\]<username> [/p [<password>]]]] {[/fi <filter>] [...] [/pid <processID> | /im <imagename>]} [/f] [/t]
🌐
Wikihow
wikihow.com › computers and electronics › operating systems › windows › 4 ways to use the taskkill command in cmd & powershell
4 Ways to Use the Taskkill Command in CMD & PowerShell
February 19, 2026 - First, type in taskkill. Then, specify that you are killing the task based on its image name, so put in a space, and then type in /IM. After this, add another space and type the Image Name of the program that you want to end.
Discussions

CMD what does /im (taskkill)? - Stack Overflow
I just read the following command: taskkill /f /im something.exe I read that /f forces the task to close, but what does /im do? More on stackoverflow.com
🌐 stackoverflow.com
windows - Taskkill /f doesn't kill a process - Stack Overflow
Otherwise the commands will not run with Administrator privileges, even though your account has them. (This shouldn't allow them to return success when they clearly failed though ;)) ... This sort of question is more appropriate on superuser.com. Yup, they have quite good explanations there. This one helped me. ... taskkill ... More on stackoverflow.com
🌐 stackoverflow.com
Using Command prompt to kill a task and start a task; machine doesn't recognize?
So, this one has me pretty stumped. I’m pretty sure I’m doing everything right here, which is why I’m stumped, but that’s also why I’m coming to the experts for help! I have a user who wants to have a script autorun at 3am daily, which will kill the current kiosk-style PowerPoint ... More on community.spiceworks.com
🌐 community.spiceworks.com
18
8
October 20, 2021
How do I use something like taskkill?
Your question is not very clear. What operating system are you using? Windows or Linux or mac or? All the different ones håbe a kill command More on reddit.com
🌐 r/commandline
8
0
May 31, 2024
🌐
Marc Nuri
blog.marcnuri.com › home › windows: how to kill a process from the command line
Windows: How to kill a process from the command line - Marc Nuri
October 31, 2023 - In this post, I've shown you the possible ways to kill a process from the command line in Windows. Using the taskkill command from cmd or the Stop-Process cmdlet from powershell.
🌐
Computer Hope
computerhope.com › taskkill.htm
Taskkill Command
June 1, 2025 - The taskkill command allows a user running any version of Microsoft Windows from XP on to "kill" a task from a Windows command line by PID (Process IDentifier) or image name.
Find elsewhere
🌐
PDQ
pdq.com › blog › what-is-the-powershell-equivalent-of-taskkill
What is the PowerShell equivalent of taskkill? | PDQ
February 12, 2026 - TL;DR: The PowerShell equivalent of taskkill is Stop-Process. It terminates running processes by name or ID, supports force-stopping unresponsive apps, and works natively with Get-Process for safer scripting. If you’re coming from Command Prompt and moving your workflows into PowerShell, process management is one of the first things you’ll want to translate.
Top answer
1 of 16
1

Try this: wmic process where “name=‘myprocessname.exe’” delete

If you get an error with that too the see this:

Taskkill command fails with error initialization failure Windows
I have a script that kills a specific task. It has stopped running. When I manually type the command TASKKILL /F /IM “notepad.exe” I get error initialization failure. This script works on all other 2003 and 2008 servers. I am not actually trying to kill notepad that is just an example. It won’t work if typed in manually.
2 of 16
8

So, this one has me pretty stumped. I’m pretty sure I’m doing everything right here, which is why I’m stumped, but that’s also why I’m coming to the experts for help!

I have a user who wants to have a script autorun at 3am daily, which will kill the current kiosk-style PowerPoint that is running, and then re-open the file with Powerpoint - doing this because the file has been updated in the meantime, so it will open a new file for the next day.

The machine running the kiosk display is a woefully outdated windows Vista Machine. Not sure if that will affect cmd syntax of commands.

Anyway, here is my current script in a *.bat file:

@echo off

taskkill /IM PPTVIEW.exe /t /f
start PPTVIEW.exe “S:[File-Path]\Run Daily.ppsx”

And that’s it. everything I know about *.bat files says that this should work just fine. And it does, on my personal Windows 10 machine in the office. But it doesn’t run on the Windows Vista; it gives the “invalid namespace” error in cmd, and also a dialog box that says “Windows cannot find PPTVIEW.exe”.

I double checked that the task was running in task manager and that I had the right name, and I do. Furthermore, I was able to use Powershell to “Stop-Process -Name PPTVIEW -Force”, without issue.

I’ve tried giving cmd the exact file-path of PPTVIEW in the start command as well, but it still claimed it couldn’t find it. So the problem is somewhat two-fold; the machine can’t find the process to terminate it, and also cannot find the process to start it again.

🌐
SS64
ss64.com › nt › taskkill.html
Taskkill - end one or more processes. - Windows CMD - SS64.com
TASKKILL /S system /U domain\username /FI "USERNAME ne NT*" /IM * TASKKILL /S system /U username /P password /FI "IMAGENAME eq note*" “Here’s to the success of our impossible task!” ~ Soviet dissidents, 1975 · TSKILL - End a running process. PsKill - Kill processes by name or process ID.
🌐
NinjaOne
ninjaone.com › home › blog › it ops › how to kill a process in windows: 4 methods
How to Kill a Process in Windows | NinjaOne
April 30, 2025 - Command: taskkill /f /fi “status eq not responding” to quickly kill frozen processes.
🌐
LinkedIn
linkedin.com › all › engineering › operating systems
How can you use the "taskkill" command to stop processes?
November 16, 2023 - For example, if you want to stop the process named notepad.exe, you can use the command: taskkill /IM notepad.exe If you want to stop the process with the PID 1234, you can use the command: taskkill /PID 1234 You can also use the wildcard character (*) to match multiple processes with the same name or prefix.
🌐
Windows Command Line
windows-commandline.com › taskkill-kill-process
TaskKill: Kill process from command line (CMD)
December 4, 2022 - We can kill all the processes running a specific executable using the below command. ... c:\>taskkill /IM mspaint.exe SUCCESS: Sent termination signal to the process "mspaint.exe" with PID 1972.
🌐
Groovy Post
groovypost.com › how-to › end processes like a pro with the taskkill command
End Processes like a Pro with the Taskkill Command
August 13, 2021 - 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.
🌐
Help Desk Geek
helpdeskgeek.com › home › how-to › how to use the taskkill command in windows 10/11
How to Use the Taskkill Command in Windows 10/11
February 1, 2025 - You can now use the command tasklist /IM “NAME” /F to kill any process, where NAME has to be replaced with the actual name of the task you are looking to end. The /F parameter forces the process to terminate, which can be useful for many ...
🌐
Reddit
reddit.com › r/pcmasterrace › what does taskkill /f /im explorer.exe do?
r/pcmasterrace on Reddit: what does taskkill /f /IM explorer.exe do?
March 6, 2022 - and explorer.exe is your windows explorer menu, which includes a lot of things. If you taskkill explorer.exe, you'd have to restart it (something like run explorer.exe/run new task in task manager) or shut down and start again.
🌐
Liberian Geek
liberiangeek.net › home › windows › taskkill command in windows
Taskkill Command in Windows | Liberian Geek
February 28, 2024 - The “Taskkill” command in Windows kills the specified process. It takes the PID or Imagename as input and performs the specified operation, discussed below.
🌐
TutorialsPoint
tutorialspoint.com › batch_script › batch_script_taskkill.htm
Batch Script - TASKKILL
This batch command ends one or more tasks. The above command will send a termination message to any open programs of MS Paint.