I'm tearing out my hair on this one. I've looked all over the internet and I have no idea why my code isn't working. What I'm trying to do is run a batch file (.bat) from within PHP. I have PHP 5.2.14 running on IIS on my Windows 7 machine. One of the examples I looked on online that's used to check if exec is working had this code:
Code: Select all
exec('dir', $response);
foreach($response as $line) {
echo $line . "<br>";
}
Code: Select all
exec("cmd.exe /c notathome.bat");
I've tried this using other functions like system(), popen(), and even tried my hand at the Windows Shell with similar results. I'm sure I'm just missing a small something. Anyone have any idea?