GaSPaRD77 | Essaye ça :
Code :
- $fichier = "d:\EasyPHP\www\MRTG\Batch\config.bat" ;
- $WshShell = new COM("WScript.Shell" ) ;
- if (@$fp = fopen($fichier, "r+" )) {
- while (!feof($fp)) {
- $line = fgets($fp, "1024" ) ;
- if (preg_match("/(.)\\lan_([0-9]{0,3})\.{3}([0-9]{0,3})\.cfg$/", $line) {
- fclose($fp) ;
- $oExec = $WshShell->Run($fichier, 7, false) ;
- exit (0) ;
- } else {
- fwrite($fp, "perl c:\mrtg\bin\mrtg d:\EasyPHP\www\MRTG\lan_".$IP.".cfg" ) ;
- fclose($fp) ;
- $oExec = $WshShell->Run($fichier, 7, false) ;
- exit (0) ;
- }
- }
- }
- fclose($fp) ;
|
|