Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Unconditionally Kill a process (Windows) [duplicate]

Tags:

c++

windows

In C++ is there a way to unconditionally kill a process?

No matter what state this process is in.

I know about TerminateProcess, but it can still fail. What if you don't want it to fail.

Like when you kill a process in Task Manager, it dies; no matter what. That's the kind of killing I'm looking for.

like image 944
Tony The Lion Avatar asked Jan 21 '23 13:01

Tony The Lion


1 Answers

Not every process can be killed from Task Manager. This depends both on permissions and on process state. Some processes, hung in winsock can't be killed (and even Task Manager will hang).

like image 183
joekoyote Avatar answered Feb 01 '23 10:02

joekoyote