How to execute batch file via PHP?

Share:
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.

No comments

'; (function() { var dsq = document.createElement('script'); dsq.type = 'text/javascript'; dsq.async = true; dsq.src = '//' + disqus_shortname + '.disqus.com/embed.js'; (document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(dsq); })();

Ads