running external command w/o showing

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
joe_T
Forum Newbie
Posts: 1
Joined: Wed Apr 16, 2008 1:59 am

running external command w/o showing

Post by joe_T »

Hi
I am trying to run an .exe file on my server, at user's request.
My page is in ActionScript 3.
To do so, the user's click opens a new window which loads a PHP file that runs my .exe.
Once the .exe is done with it's job, I wish to close that window automatically.
A better thing would be not to open the window in the first place, just run the php script.
Is there a way to do any of these?
Thanks,
Joe
N1ck
Forum Newbie
Posts: 2
Joined: Tue Apr 15, 2008 8:25 pm

Re: running external command w/o showing

Post by N1ck »

Hi Joe

I am having a similar problem. I used the following code on my test server:

<?php
$cmd = '"c:\\Program Files\\Messenger\\msmsgs.exe"';
$WshShell = new COM("WScript.Shell");
$oExec = $WshShell->Run($cmd, 7, false);
?>

this will launch MSN messenger or any application you choose, minimised without showing the cmd window. This wont solve all your problems but I hope it helps, there is a little more info on my post: Post subject: Local test Server Configuration

regards

Nick
Post Reply