popen won't work for me

Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

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');


Any ideas why I get this error message?



Site Timeline