I think that the echo exec('c:\scripting.bat');
line it's causing you the problem. Try to just execute it without the echo
statement.
If you trying to see the output of the function, you must use the second functions parameter: &$output
, acording to the documentation itself. See it in the docs here.
I hope it will be useful to you! :D