note 27065 deleted from ref.exec by vincent
| From: | vincent@php.net | Date: | Fri, 12 Sep 2003 05:51:19 +0000 |
| Subject: | note 27065 deleted from ref.exec by vincent | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-56292@lists.php.net to get a copy of this message | ||
Note Submitter: wusheng@swau.edu.cn
----
use exec() on win2k and IIS , want to execute WScript.exe to write register. It's strange, the
same parameter of exec( ) , can only be execute when refresh another page which contain the exec( )
code, and do nothing when in the pre page. so I create a new page and locate to it .
//---------------------------------------------
<?php
......
......
$cmd="'"."C:\\WINNT\\System32\\WScript.exe
C:\\Inetpub\\wwwroot\\ONE.VBS"."'";
//---- I feel using ' better than using " --//
$openfile=fopen("./REGWRITE.PHP","w+");
$filestr="<"."?php exec($cmd); ?".">";
echo $regstring;
$file_writed=fwrite($openfile,$filestr);
?>
<script>
location.href="REGWRITE.PHP"; //locate to the new page
</script>
//------------------------------------------------
if the code such as below , return no error but do nothing
//------------------------------------------------
<?php
......
......
$cmd="'"."C:\\WINNT\\System32\\WScript.exe
C:\\Inetpub\\wwwroot\\ONE.VBS"."'";
exec($cmd);
?>