Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

PHP, kill Windows process?

Is there a way to kill a Windows process, say calc.exe, with PHP without using exec?

exec calls an external program, I try to avoid using that command unless necessary.

like image 740
Zombo Avatar asked Dec 15 '22 23:12

Zombo


1 Answers

There is.

Use the W32api PHP extension, which provides access to the Win32 API - then use the TerminateProcess() API after aquiring a handle to the process.

like image 142
Eugen Rieck Avatar answered Dec 31 '22 18:12

Eugen Rieck