I am using the exec() function to execute the same external programs, and I want to stop one of them in some case. But the following command:
taskkill /IM program.exe
will get all program.exe killed. So the best way I thought was to kill program process by its PID.
So,I thought the way was to get the PID every time the program was executed, and then kill it.
I am using PHP 5.3 on Windows XP.
exec on Windows hangs until child process is over. You need PID of a child, so I suppose you want to nohup a child.
Try this code, it worked for me. It nohups notepad.exe and displays its PID
pay attention to $WshShell->exec and not $WshShell->run as some googled ressources claim.
May it help someone else