VTS Posted April 2, 2007 Share Posted April 2, 2007 Well as the title states, I have a .bat file that copies certain files across a network and I needed a way to run this file using PHP. I was looking at exec() but I was not sure exactly how to use it. I was also using pstools but could not get them to work with PHP. Can someone give me an example of how to do this or send me somewhere where I can read up on this? thanks in advance, vts Quote Link to comment Share on other sites More sharing options...
per1os Posted April 2, 2007 Share Posted April 2, 2007 <?php exec("path/to/file.bat"); ?> www.php.net/exec Also to run a .bat you need windows not linux. Quote Link to comment Share on other sites More sharing options...
VTS Posted April 2, 2007 Author Share Posted April 2, 2007 Thanks for the info. I tried using this: <?php exec("c:\\test.bat"); ?> When I ran it, nothing happened. The .bat file works when I just run it so I know it is not the .bat file messing up. I also tried using "c:\test.bat" and "c:/test.bat" and none of them worked either. What am I missing? Quote Link to comment Share on other sites More sharing options...
VTS Posted April 3, 2007 Author Share Posted April 3, 2007 Anyone have any ideas? Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.