I will sometimes get a process such that if I run taskkill /im the_process.exe /f /t
, then it won't kill it, because:
ERROR: The process with PID 6492 (child process of PID 5788) could not be terminated.
Reason: There is no running instance of the task.
But if I open Task Manager and click End Process, then it goes away. Why does task manager work but taskkill not? I need to be able to kill the process programically, so I need to find a CLI command that will successfully kill this process.
I've googled around but I haven't found a working solution yet.
a) Type the following command into the command prompt, to kill only one Process, and press Enter Key. For Example - To kill Notepad, run the command as, taskkill /PID 2404 /F, where /F is used to kill the process forcefully.
Taskkill is a program that needs administrative privileges to kill a task. If you start command prompt as admin and run the same command, it will succesfully kill the task.
Also, if are debugging the process under Visual Studio, you will get this exact situation. You need to detach the debugger or terminate the process from the debugger.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With