Page 1 of 1
How to exec a external Windows Prog ?
Posted: Sun Jul 13, 2003 7:39 am
by DarK DragoN
Hi
I want to exec a Windows Prog. from php so that this prog started on my local System
like this :
c:\Progamme\wincmd\wincmd.exe
the prog must be started on my local PC not on Server
I've tested with system(), passthru(), popen(), escapeshellcmd()
but nothing of them starts my windows prog
If anyone can help
thanks for
Posted: Sun Jul 13, 2003 8:47 am
by m3mn0n
Posted: Sun Jul 13, 2003 9:08 am
by DarK DragoN
I tested it with exec() too
I only forgett to write it in post over
but with exec nothing
Posted: Sun Jul 13, 2003 9:10 am
by m3mn0n
Read some of the user notes for Windows on the exec() page. It didn't work for me at first but the notes solved the problem.
Posted: Sun Jul 13, 2003 9:59 am
by redhair
the prog must be started on my local PC not on Server
The 'local PC'?
You mean a client with that?
Posted: Sun Jul 13, 2003 10:45 am
by alexus
I did it by using system(), cmd (Linux, XP, 2000, 2003) and the path to your program…
It might not work on your computer if you don’t have proper permissions for internet user…
I have no idea how to deal with Linux, but on windows you just go and set execute permission for I_USER (or something like that), and also don’t forget to allow execute files on your web site in IIS manager…
But again I’m 100% windows person so I can’t speak about other then MS products…
Posted: Sun Jul 13, 2003 12:26 pm
by DarK DragoN
yes to redhair
client pc
this is the code
Code: Select all
$prog="D:\Programme\flashfxp2\FlashFXP.exe";
$data=$username.":".$password."@".$host.":".$port.$path;
$getdata = $prog." ".$data;
$process2=exec($getdata);
if(!$process2) {
echo "<p>Error : bla bla bla</p>";
}
no flashfxp.exe starts
All the manuals I found are self than php manual and there is nothing about exec under Windows
My System runnig Server and php
Win2k Server
Apache 2.x
php 4.3x
Posted: Sun Jul 13, 2003 6:06 pm
by alexus
Like I said try to set execute permission for folder D:\Programme\flashfxp2\
For “IUSR_<machine_name>”
In users list just find IUSR_... it is only one there,
If you wouldn’t do it win 2000 will block the command and return 404.2 error
PS: unless you have default permission set, (all everything for everyone){in that case I sagest you to remove EVERYONE group and set up proper permission for your folder, just for security reasons…)
Posted: Sun Jul 13, 2003 6:26 pm
by Stoker
make the server side script execute something on the local client? that is possible with stuff like vbscript and very insecure/trusty settings on the client.. PHP itself can not execute something on a remote machine
Posted: Sun Jul 13, 2003 6:37 pm
by alexus
Well if he is talking about remote machine, you can still do it and you still have to use CMD console:
You can play with NET command (search Microsoft or TechNet for NET or NET USE), it might help you to get what you want, but tactically it will look like you are trying to hack your client machine through the web interface… and power of the server…
Posted: Sun Jul 13, 2003 8:16 pm
by redhair
As said, php can not start something on a client.
...simply because php is server based.
You must have some sort of client running on the client machine, wich will be activated when the php script on the server machine 'asks' something of the client machine.
For example...you could install php/apache on the client...have the server retreive a script on the client machine, and let that script execute something on the client machine.
Posted: Sun Jul 13, 2003 8:20 pm
by alexus
To: redhairyes.
Yes, PHP can't run e program but win2000 can, and he is running win2000...
And PHP can execute conslole command on server, so if he will use propper console command he can force the client machine to start app...
Posted: Sun Jul 13, 2003 8:26 pm
by redhair
alexus wrote:And PHP can execute conslole command on server,...
....so the client must be running some sort of client app.
Posted: Sun Jul 13, 2003 11:23 pm
by alexus
To redhair: yes and no, if the client has win2000, XP, or 2003 then you just can play with console ( yes it is no so many things you can do with it, but still)... Well if the client is running Me, 98, 95, 3.1 there will be big limitation on remote controll and remote managment... (And I have no ideas about linux, unix, sun, hp, palm, mac - those platforms are out of my certification...)
Posted: Mon Jul 14, 2003 1:39 am
by Tubbietoeter
You can do this with php, if you got telnet running.
See the link for details:
http://www.devnetwork.net/forums/viewto ... highlight=