starting executable

This is a discussion on starting executable within the PHP Language forums, part of the PHP Programming Forums category; I am trying to figure out how to get the CMD (dos) window to come up when I call a ...


Go Back   Usenet Forums > PHP Programming Forums > PHP Language

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 11-02-2004
Jay Haslup
 
Posts: n/a
Default starting executable

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.

Thanks,
Jay Haslup


Reply With Quote
  #2 (permalink)  
Old 11-03-2004
Jay Haslup
 
Posts: n/a
Default 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


"Jay Haslup" <jay.haslup@jhuapl.edu> wrote in message
news:cm6o8i$bc8$1@aplcore.jhuapl.edu...
> 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.
>
> Thanks,
> Jay Haslup
>
>



Reply With Quote
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT +1. The time now is 05:28 AM.


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.0.0