Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

taskkill doesn't kill process

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.

like image 818
Jeff M Avatar asked Dec 19 '14 19:12

Jeff M


People also ask

How do I kill a process in taskkill?

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.

Does taskkill require admin?

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.


1 Answers

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.

like image 59
BenV136 Avatar answered Nov 16 '22 02:11

BenV136