starting executable

Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

Threaded View
I am trying to figure out how to get the CMD (dos) window to come up when I
call a executable.  I have this working on a Win2000/apache machine and am
trying to use the same code on a identical machine.

Here is how I start the executable.  It is initiated from the browser on the
machine itself:
 pclose(popen("start " . $exe . $params, "r"));

What normally happens is a cmd window pops up showing the executable's
output to screen.  My php code then gets the PID for the executable by
running a tlist.exe and searching for the name of the executable.   I take
this PID and sleep till a certain time and then kill the executable.

When I do it on the new machine the executable runs but no cmd window comes
up.  I also cannot get a PID for the executable because tlist output shows
the executable's PID but has no information about it.  When I manually use
Tasklist I can see the name of the executable.

PHP and apache are setup identically on both machines so it must be
something in windows.  From looking around I think it may have to do with
'apache not interacting with the desktop' ?

I need to have the cmd window come up and I feel if I can get that
accomplished the PID problem will be taken care of too.

Jay Haslup

Re: starting executable

I remembered that under Services there is a 'allow service to interact with
desktop' that must be checked.

This fixes my problem.  Now a CMD window pops up and I can retrieve the PID

Quoted text here. Click to load it

Site Timeline