Calling XP control panel applets from php

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
Brent
Forum Newbie
Posts: 4
Joined: Fri Aug 04, 2006 12:09 pm

Calling XP control panel applets from php

Post by Brent »

I am able to directly call control panel applets using the command prompt i.e. "control desk.cpl". The problem is that when using php or even javascript to run the command the applet never appears. I have tried running a batch file to execute the command. I have tried using CALL. It works properly when I use the PHP CLI to run it but when I run the PHP CLI from a PHP page I still have the same problem. I have tried exec(), system(), passthru(), shell_exec(), all with the same result. I would greatly appreciate any help or if anyone knows of another way to open control panel applets from a browser.

exec('control desk.cpl');

Thanks

Note: This will be hosted and accessed on the local machine.
User avatar
s.dot
Tranquility In Moderation
Posts: 5001
Joined: Sun Feb 06, 2005 7:18 pm
Location: Indiana

Post by s.dot »

Seems your PHP script would need an absolute path to the program (not sure what that would be).
Set Search Time - A google chrome extension. When you search only results from the past year (or set time period) are displayed. Helps tremendously when using new technologies to avoid outdated results.
Brent
Forum Newbie
Posts: 4
Joined: Fri Aug 04, 2006 12:09 pm

Post by Brent »

scottayy wrote:Seems your PHP script would need an absolute path to the program (not sure what that would be).
The php-cgi.exe and obviously control.exe are in the PATH. The bat file resides in the same directory as the php page it is being run from, although I have tried specifying the complete path with no results.
User avatar
volka
DevNet Evangelist
Posts: 8391
Joined: Tue May 07, 2002 9:48 am
Location: Berlin, ger

Post by volka »

Brent wrote:works properly when I use the PHP CLI to run it
understood, but
Brent wrote:but when I run the PHP CLI from a PHP page I still have the same problem.
what does "php cli from a php page" mean?
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

When php is run from the command prompt it has all the rights of your logged in user. When run from the web server it takes on the rights of the web server's user, which is rarely the same as who you are logged in as.

...That's a hint as to a possible solution.
User avatar
Weirdan
Moderator
Posts: 5978
Joined: Mon Nov 03, 2003 6:13 pm
Location: Odessa, Ukraine

Post by Weirdan »

services are usually not allowed to interact with desktop, there's specific setting under My Computer/Manage/Services/Apache that has to be turned on
Post Reply