Jump to content

Need help executing a .bat file with PHP


VTS

Recommended Posts

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

Link to comment
https://forums.phpfreaks.com/topic/45338-need-help-executing-a-bat-file-with-php/
Share on other sites

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? 

 

 

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.