How to run a bat-file on a remote server via ssh2 php?

Raised to the main page by a community spirit member 5 hours ago .

This question contains answers that can be both good and bad; the system offered them for verification.

  • What is the OS on the remote server? - andreymal
  • Windows serv 2012 - Raten
  • If safe_mode is enabled in the web server settings, then it will not work. - Oboroten
  • Run dir is running - Raten
  • cmd /c "c:\\full\\path\\to\\my\\bat\\file.bat" - rjhdby

1 answer 1

 <?php $run = cmd /c "c:\\full\\path\\to\\my\\bat\\file.bat"; exec($run); ?>