0

I am newbie to PHP programming and IIS. Somehow I managed to have my php application hosted on IIS server. I am able to perform all the data base transactions successfully. But now I am trying to run a batch file which is available in the root of IIS.

I have tried these two options below

$output=exec("C:\windows\system32\cmd.exe /c Start C:\inetpub\wwwroot\drupal\modules\batch\RunSuite.bat", $out);

cmd.exe is copied to the root folder before executing this line

$output=exec($_SERVER['DOCUMENT_ROOT']."\cmd.exe /c Start".$_SERVER['DOCUMENT_ROOT']."\drupal\modules\batch\RunSuite.bat", $out);

both of them do not work. Could you please help me to solve this issue? I am sure it is my ignorance :-(

First line of the above code works as expected, if we host the entire application using drupal locally and run it. I assume, it would be some configuration / permission issues, while triggering the batch as a service in IIS. Your help is really appreciated.

Thanks and Kind Regards

Anil

Anil
  • 1
  • 1
  • 2
  • Possible duplicate of : http://stackoverflow.com/questions/835941/how-do-you-run-a-bat-file-from-php – SachaDee Feb 09 '16 at 12:53
  • Thank you SachaDe. I went through this post earlier. But this post does not provide any info on why it works with some and why not with some others like mine. I would still think it is an authentication issue, but not enough expertise to fix it – Anil Feb 09 '16 at 16:28

0 Answers0