Page 1 of 1
exec? system?
Posted: Thu Apr 10, 2003 7:18 pm
by RedFive
Hi,
I'm running a game server on XP and (unfortunately) it only runs in gui. So I tried, as a test, to exec notepad.exe but it just runs it in the background (lot of good that does!). I was wondering if there was anyway to get it to run in the foreground?
Posted: Thu Apr 10, 2003 11:08 pm
by bionicdonkey
system() should work
Posted: Fri Apr 11, 2003 1:30 pm
by RedFive
It doesn't...
So far I can only get it to run in the background. I want to be able to see it on the server...not possible?

Posted: Fri Apr 11, 2003 2:06 pm
by daven
check out passthru(). It should do what you want (execute a command and pass all output to the browser)
Posted: Fri Apr 11, 2003 2:23 pm
by RedFive
Mmmm, actually...I guess I should better explain it...
I have a game server running that only runs with the Windows GUI. I want to be able to start and stop it remotely via php...yet when I physically use the server, I still want to see it running in the foreground. Currently, I can only get php to run it in the background -- which means there's no way to access it when you're physically at the server computer. Does that make sense? I hope so

Posted: Fri Apr 11, 2003 3:49 pm
by Stoker
I don't know XP, for William NT and 2000 there is a SRVANY tool in the resourcekit, install the gameserver as a service, then use your phpscript to use system('net start servicename'); or something like that..
Posted: Fri Apr 11, 2003 9:49 pm
by RedFive
Woooohooo! It works!!
Thanks Stoker
