How can I run a .bat in the site folder by a button? This can be done in other languages too if not possible only by PHP
<button type="submit" class="btn btn-primary btn-lg">Executar .bat</button>
How can I run a .bat in the site folder by a button? This can be done in other languages too if not possible only by PHP
<button type="submit" class="btn btn-primary btn-lg">Executar .bat</button>
In PHP, you can use the shell_exec
>:
<?php
$output = shell_exec('seu-arquivo.bat');
echo "<pre>$output</pre>";
?>
It is important, however, first of all to make sure that this is safe, ensuring that it is not possible for any user to run any script.