Jump to content

Executing an exe


HaRRiKiRi

Recommended Posts

Hi. I have some bizarre problem with exec (other any other method) to launch exe's. I am making a game server booking system and the part that is not working is the one with the launching the server itself. Its not connected to the server exe's as far as I know because I can't launch no exe at all. The closes thing I have come is launching the process, but the window does not show up. Here is the code I am using now:

$commandString = 'start /b notepad.exe';
pclose(popen($commandString, 'r'));

I have also tried WshShell.Run and psexec.exe method. All of them yields the same results... nothing. It launches the process (it shows up in the task manager process tab), but does not launch the application itself (does not show up in task managers applications tab) and the window is not visible. I would expect it to run the exe (in this case notepad), but it doesn't. I think it could be something to do with php.ini or somewhere else in the configs. Are there any things I should turn on when I want to launch apps?

Link to comment
https://forums.phpfreaks.com/topic/177958-executing-an-exe/
Share on other sites

Then there is no way.
Its kind of pessimistic as you haven't even ever used that function. As there are like 6 ways to launch an exe then there is a way.

 

Anyway, I found out the problem. My Apachi Service was not set to "Allow service to interact with desktop". This should be more documented as now it took 3 days to figure this simple thing out.

 

Any googlers here, If you have this problem then go to ControlPanel>Administrative Tools>Services>Apache properties>Log On> And check "Allow service to interact with desktop" checkbox.

Link to comment
https://forums.phpfreaks.com/topic/177958-executing-an-exe/#findComment-939287
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.