mukeshgulia Posted July 13, 2009 Share Posted July 13, 2009 Hi, I tried to run a batch file via PHP functions exec()/passthru()/system() Basically my batch file picks all the xml files from the current location and ftp them to a server. None of the functions worked for me. Please help. All files are located at the configured IIS folder Test IIS batch file 'ftp.bat' contents are: cd c:\windows\system32 ftp -s:c:\TestIIS\ftp.txt 128.91.16.203 'ftp.txt' file contains: ora10g ora10g cd /home/oracle/dit/XMLDIR prompt off lcd c:\TestIIS bin mput *.xml bye I tried the following code:. <?php if(isset($_POST['submit'])) { echo exec('ftp.bat'); echo "Done!"; } else { // display the form ?> <form action="" method="post"> <input type="submit" name="submit" value="DO IT!"> </form> <?php } ?> I am unable to run this file successfully. Please help Link to comment https://forums.phpfreaks.com/topic/165763-execute-batch-file/ Share on other sites More sharing options...
FD_F Posted July 13, 2009 Share Posted July 13, 2009 try give full path in exec() also check for permissions (check the user running the IIS service ) Link to comment https://forums.phpfreaks.com/topic/165763-execute-batch-file/#findComment-874399 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.