I am trying to run a .bat file from PHP in a WAMP server on Windows. Below is my code, the first "if" statement runs and prints "Successful" to the screen. So, the function "exec" is running, but no file has been copied. Any help or advice please.
// Function run bat file
private function run_bat(){
$path = 'wamp\www\application\common\get_file.bat';
$batchCmd = "C:\\".$path;
echo "<br>".$batchCmd;
//if(exec('cmd /c '.$batchCmd)){
if(exec($batchCmd)){
echo '<br>Successful';
return TRUE;
} else {
echo '<br>Error in run bat';
return FALSE;
}
} // end function run bat file
my bat file just copies one file to a new folder. The other file is on a networked drive.