How to create a link to execute a ".bat" file that is inside the PHP directory?

0

Everyone, good afternoon!

Next, I have a page in PHP that is open monitoring a link, I would like to know how I put a link that opens a .bat file that is in the same directory as the page ...

Example:

"Store 1 Down - Click here" Clicking on this link would open a BAT that runs on the server.

I do not want to do this with PHP itself, just call BAT by the same Windows.

: P

    
asked by anonymous 14.09.2016 / 21:46

2 answers

2

If you prefer to call via Javascript:

<input type="button" value="Click aqui" onclick="window.open('file:///C:pasta/teste.bat')" />

    
14.09.2016 / 22:20
0

Try something like this:

system("cmd /c C:[caminho para o arquivo]");

The System function is for running command on the application server.

    
14.09.2016 / 22:30