Hi,
I think that this is not correct.
PHP uses cmd.exe /c to execute the value passed to exec. I've the same problem and I am sure that the cwd of my script is used.
Example:
- start_test.bat is my batch i want to execute
- My PHP-script and the start_test.bat are located in C:\Inetpub\wwwroot\test
When call "type start_test.bat" (PHP executes "cmd.exe /c type start_test.bat") by this PHP code:
$a = array();
exec("type start_test.bat", $a);
print_r($a);
I get the lines of start_test.bat
When I call "start_test.bat" (PHP executes "cmd.exe /c start_test.bat") the result is NULL.
How can I get batch files working?