|
Posted by M on 07/08/05 21:49
Hi Folks,
I would like to use popen and redirect output from a program, except it
doesn't seem to work. I am using IIS 5.1 on Windows XP Pro.
Error messages are as follows:
Warning: popen(C:\Test\runcmd.bat Output.exe,r) [function.popen]: No such
file or directory in c:\Inetpub\wwwroot\Php\POpenTest.php on line 15
Warning: pclose(): supplied argument is not a valid stream resource in
c:\Inetpub\wwwroot\Php\POpenTest.php on line 16
Test Code so far is as follows:
define('RUNCMDPATH', 'C:\\Test\\runcmd.bat');
function runCmd($cmd) {
$externalProcess=popen(RUNCMDPATH.' '.$cmd, 'r');
pclose($externalProcess);
}
runCmd('Output.exe');
Any ideas why I get this error message?
Regards,
Martin
[Back to original message]
|