Home › Forums › Partner and Community Forums › PHP Community › Why I can't exec batch file? ???
Previous Next
Last post 05-06-2008 12:32 PM by anilr. 2 replies.
Average Rating Rate It (5)Thank you for the rating!
Page 1 of 1 (3 items)
Sort Posts: Oldest to newest Newest to oldest
Hi,I've tried to use PHP exec() to execute DOS command.It works with command exec("md example_dir") .But when I put test.bat in same directory and run PHP with exec("test.bat") , it doesn't work. No error showed but not work.
Anyone can help me?
Thanks.
You'll need to specify that you wish to use the Windows command line to execute your batch file. Have you tried something like exec("cmd.exe /c test.bat") ?
Also, the current working directory of the php process (in the fastcgi case) is not the application/vdir root, but the directory from where php is run, so use a fully qualified path.