1 min read

How to execute batch file via PHP?

The main issue was of path and permission. I have gotten my batch file to execute.
Here is my solution:
  1. I run my batch file from the same folder the php file is in.
    exec("mybatch.bat");
  2. I make sure that Apache Service has enough permission to run the batch file. Just to test i used an administrator account for Apache to log on with.
Share your Love

Leave a Reply

Your email address will not be published. Required fields are marked *