使用本地PC上的批处理文件在远程PC上执行批处理文件 [英] Execute a batch file on a remote PC using a batch file on local PC
本文介绍了使用本地PC上的批处理文件在远程PC上执行批处理文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我要执行批处理文件
D:\ apache-tomcat-6.0.20 \ apache-tomcat-7.0.30 \ bin \ shutdown.bat
D:\apache-tomcat-6.0.20\apache-tomcat-7.0.30\bin\shutdown.bat
哪个在我的服务器inidsoasrv01
上.
我应该如何写我的.bat
文件?
How should I write my .bat
file?
推荐答案
使用Microsoft的工具执行远程命令: PsExec
Use microsoft's tool for remote commands executions: PsExec
如果远程主机上没有您的bat文件,请首先将其复制.例如:
If there isn't your bat-file on remote host, copy it first. For example:
copy D:\apache-tomcat-6.0.20\apache-tomcat-7.0.30\bin\shutdown.bat \\RemoteServerNameOrIP\d$\apache-tomcat-6.0.20\apache-tomcat-7.0.30\bin\
然后执行:
psexec \\RemoteServerNameOrIP d:\apache-tomcat-6.0.20\apache-tomcat-7.0.30\bin\shutdown.bat
注意:psexec的文件路径是远程服务器上文件的路径,而不是本地文件.
Note: filepath for psexec is path to file on remote server, not your local.
这篇关于使用本地PC上的批处理文件在远程PC上执行批处理文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文