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

后端 未结 4 1271
日久生厌
日久生厌 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:07

    If you are in same WORKGROUP shutdown.exe /s /m \\ should be enough shutdown /? for more, otherwise you need software to connect and control the target server.

    UPDATE:

    Seems shutdown.bat here is for shutting down apache-tomcat.

    So, you might be interested to psexec or PuTTY: A Free Telnet/SSH Client

    As native solution could be wmic

    Example:

    wmic /node: process call create "cmd.exe c:\\somefolder\\batch.bat"

    In your example should be:

    wmic /node:inidsoasrv01 process call create ^
        "cmd.exe D:\\apache-tomcat-6.0.20\\apache-tomcat-7.0.30\\bin\\shutdown.bat"
    

    wmic /? and wmic /node /? for more

提交回复
热议问题