Re: Re: [PHP] exec or system in windowz to stop mysql or apache from remote (and restart them)

From: Date: Mon, 27 Nov 2000 19:18:56 +0000
Subject: Re: Re: [PHP] exec or system in windowz to stop mysql or apache from remote (and restart them)
Groups: php.general 
Request: Send a blank email to php-general+get-27428@lists.php.net to get a copy of this message
If your running IE5, try this saved as file.hta: <html> <head> <script> function runApp(){ var shell = new ActiveXObject("WScript.Shell"); shell.run('notepad.exe' ,1,false); } </script> </head> <body> <button onClick="runApp()">run app</button> This is a little bit of windows scripting host functionality. It has to be in an HTA to get around security. I would imagine this can be done in IE4 or Netscape, you have to figure out how to get around security though. Chris On Mon, 27 Nov 2000, Ignacio Vazquez-Abrams wrote: > Date: Mon, 27 Nov 2000 10:03:39 -0500 (EST) > To: Delbono <delbono@dsc.it> > From: Ignacio Vazquez-Abrams <ignacio@openservices.net> > Subject: Re: [PHP] exec or system in windowz to stop mysql or apache > from > remote (and restart them) > > On Mon, 27 Nov 2000, Delbono wrote: > > > Hello, > > > > did any of you experiment EXEC or PASSTHRU or SYSTEM in windows? > > > > I tried: > > > > <? > > $cmd = "c:\apache\htdocs\ec.bat"; > > system($cmd, $out); > > echo $out; > > exit; > > > > ?> > > > > Where ec.bat is simply: > > > > echo "done" > > exit > > > > > > (dos batch commands) > > > > If I execute the exec.php file, a dos win pops up, executes the > echo > > command, exits, but in the browser nothing happens. And php hangs > to wait > > for something, like it is described in the manual. > > > > I read I have to pass output to a file or something but don't know > how. > > I saw samples for linux, but I work with dos/win and those examples > don't > > work for me (Or I'm not able to get them working) > > > > > > Do you have any advice for me? Or working sample? > > > > > > > > > > For the fact that the dos win pops up I can modify ALLOW > APPLICATION TO > > INTERACT WITH DESKTOP directive, but for the rest I don't know. > > > > > > > > // I'd like to be able to stop-restart Mysqld from remote and even > try to > > stop/restart apache from remote.. > > with a batch file. > > Thnaks > > > > The process execution functions/commands (exec(), passthru(), > system(), and > ``) don't currently work under Win32. Try using COM to have another > program > execute the batch file. > > -- > Ignacio Vazquez-Abrams <ignacio@openservices.net> > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net > For additional commands, e-mail: php-general-help@lists.php.net > To contact the list administrators, e-mail: > php-list-admin@lists.php.net >

« previous php.general (#27428) next »