note 29571 rejected from function.exec by rioter
| From: | rioter@php.net | Date: | Tue, 18 Feb 2003 01:40:32 +0000 |
| Subject: | note 29571 rejected from function.exec by rioter | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-44125@lists.php.net to get a copy of this message | ||
Please Help - Cannot get exec() executes commands under Windows
I am new to PHP and I am running my script on WinXP IIS/5.1 w/ PHP 4.2.x.
I have the following code and it does not work whatsoever:
<?
$command = "cmd /c xcopy I:\\Websites\\*.* \\\\some-pc\\wwwroot\\*.* /E /F /R /Y";
$rtn = exec($command);
echo $rtn;
//passthru($command); // tried this as well
?>
This script spends no time in execution and does not appear to do anything. I have tried to run the
xcopy command under the prompt, it went fine. But PHP does not seems to excute it. The $rtn and
pssthru() returns nothing!
I even have a copy of cmd.exe in the directory with the .php file.
Can anyone kindly lend me a hand and give me some hints please?