Jump to content

[SOLVED] Problem With PsEXEC and executing foreground programs


samarudge

Recommended Posts

Hi,

I have been having problems running PsEXEC on Windows XP Pro with Apache 2.2 and PHP5.

 

I have a PHP page with some code on and when someone visits the page I want the server to run a .exe program, I have used

exec('notepad.exe'); (I have also tried system(); )

now that worked fine except that Notepad opened as a process not as a proper program.

 

I downloaded PsEXEC because I was told that this would let me open the .exe properly but now all that happens when I visit the page is Notepad (I'm only using notepad as an example, what would be the point in having a web page that can open notepad on the server :) ) is not opened at all and PsEXEC goes into the system processes and the page wont load properly until I cancel the process through task manager.

 

Regards,

Sam Rudge

Link to comment
Share on other sites

The problem you have is to do with account access, PHP is running from the System account so notepad is launched from the System account,

what you need to is change the logon account for the APACHE service,

to do this go

Start -> Run

type

services.msc

fine APACHE and double click

Select the Log On Tab and change to 'Local System Account' & Allow services to interact with desktop

this should now load up notepad with the current user profile.

 

you may also try

exec('start notepad.exe');

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.