Execute a batch file on a remote PC using a batch file on local PC

后端 未结 4 1298
日久生厌
日久生厌 2021-02-19 02:33

I want to execute a batch file

D:\\apache-tomcat-6.0.20\\apache-tomcat-7.0.30\\bin\\shutdown.bat

Which is on my server inidso

4条回答
  •  春和景丽
    2021-02-19 03:00

    While I would recommend against this.

    But you can use shutdown as client if the target machine has remote shutdown enabled and is in the same workgroup.

    Example:

    shutdown.exe /s /m \\ /t 00
    

    replacing with the URI for the target machine,

    Otherwise, if you want to trigger this through Apache, you'll need to configure the batch script as a CGI script by putting AddHandler cgi-script .bat and Options +ExecCGI into either a local .htaccess file or in the main configuration for your Apache install.

    Then you can just call the .bat file containing the shutdown.exe command from your browser.

提交回复
热议问题