Re: ejecutar .exe con php
| From: | Denyl Meneses Guillén | Date: | Wed, 09 Nov 2005 19:29:16 +0000 |
| Subject: | Re: ejecutar .exe con php | ||
| References: | 1 | Groups: | php.general.es |
| Request: | Send a blank email to general-es+get-56567@lists.php.net to get a copy of this message | ||
Revisa esto
<?php
function windExec($cmd,$outputfile = "C:\\tmp\\tmp.txt"){
// runs a command line and returns
// the output even for Wind XP SP2
// example: $cmd = "fullpath.exe -arg1 -arg2"
// $outputString =
windExec($cmd,"C:\\my_alternate\\path_to\\a_tmp_file.txt");
// Setup the command to run from "run"
$cmdline = "cmd /C $cmd > $outputfile";
// Make a new instance of the COM object
$WshShell = new COM("WScript.Shell");
// Make the command window but dont show it.
$oExec = $WshShell->Run($cmdline, 0, true);
// Read the file file.
$retArr = file($outputfile);
// Delete the temp_file.
unlink($outputfile);
// convert array to string
$retStr = implode(' ', $retArr);
return $retStr;
}
?>
----- Original Message -----
From: " Corral" <cccarvajal2@wanadoo.es>
To: <php-es@lists.php.net>
Sent: Tuesday, October 18, 2005 2:23 PM
Subject: [PHP-ES] ejecutar .exe con php
hola, tengo un problema, me gustaria ejecutar un archivo .exe desde php(por
ejemplo el notepad) pero no se como hay que hacerlo , uso:
<?php
exec("c://windows//system32//notepad.exe");
?>
pero nada, soy bastante nuevo en esto, espero puedan ayudarme, gracias
¡Consigue GRATIS el nuevo BLOQUEADOR de POPUPS! Descarga la barra
miniWanadoo http://busca.wanadoo.es/toolbar2
----------------------------------------------------------------------------
----
> --
> PHP Spanish Localization Talk Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
----------------------------------------------------------------------------
----
No virus found in this incoming message.
Checked by AVG Anti-Virus.
Version: 7.0.344 / Virus Database: 267.12.2/140 - Release Date: 18/10/2005