使用本地 PC 上的批处理文件在远程 PC 上执行批处理文件 [英] Execute a batch file on a remote PC using a batch file on local PC
本文介绍了使用本地 PC 上的批处理文件在远程 PC 上执行批处理文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我想执行一个批处理文件
I want to execute a batch file
D:apache-tomcat-6.0.20apache-tomcat-7.0.30inshutdown.bat
D:apache-tomcat-6.0.20apache-tomcat-7.0.30inshutdown.bat
在我的服务器上inidsoasrv01
.
我应该如何编写我的 .bat
文件?
How should I write my .bat
file?
推荐答案
使用微软的远程命令执行工具: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.20apache-tomcat-7.0.30inshutdown.bat \RemoteServerNameOrIPd$apache-tomcat-6.0.20apache-tomcat-7.0.30in
然后执行:
psexec \RemoteServerNameOrIP d:apache-tomcat-6.0.20apache-tomcat-7.0.30inshutdown.bat
注意:psexec 的文件路径是远程服务器上的文件路径,而不是您本地的路径.
Note: filepath for psexec is path to file on remote server, not your local.
这篇关于使用本地 PC 上的批处理文件在远程 PC 上执行批处理文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文