note 70338 deleted from function.shell-exec by cmb
| From: | cmb@php.net | Date: | Sun, 07 Jul 2019 15:32:09 +0000 |
| Subject: | note 70338 deleted from function.shell-exec by cmb | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-211531@lists.php.net to get a copy of this message | ||
Note Submitter: kees dot schepers at infolook dot nl
----
If you are using a Windows server with IIS, and you try to execture a batch file with shell_exec()
function, or his related functions you should do it like this:
<?
shell_exec("C:\\path\\to\\cmd.exe /c C:\\batchfile.cmd");
?>
Note the parameter /c which says "Carries out the ommand specified by string and then
terminates"
If you don't add the parameter /c the batch file will not be executed, only the cmd.exe file
will.
As, also mentiod in these commants, put your cmd.exe file in your php folder, and your windows
folder for security reasons.