MSBuild中的Exec任务,用于在远程计算机上执行命令 [英] Exec Task in MSBuild for execution of command on remote machine

查看:165
本文介绍了MSBuild中的Exec任务,用于在远程计算机上执行命令的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用以下命令通过MSBuild文件安装服务.效果很好

I am using following command to install a service via MSBuild file. This works great

 <Exec Command= 'c:\test\myService.Appservices.exe install' ContinueOnError='false' />

但是上述命令将服务安装在本地计算机上.我想在远程计算机上安装服务.如何使用此命令指定计算机名称?

But the above command install the service on local machine. I want to install the service on a remote machine. How can I specify the machine name using this command?

推荐答案

根据Mike Vine的评论,MSBuild不包含用于远程执行的工具.但是,您可以使用 psexec 之类的东西.例如

As per Mike Vine's comment, MSBuild doesn't include tools for remote execution. You could however use something like psexec. e.g.

<Exec Command='psexec -accepteula -s \\RemoteServer "C:\Path To EXE on Remote Machine\my.EXE"' IgnoreExitCode="false" ContinueOnError="false" Timeout="600000" >
    <Output TaskParameter="ExitCode" PropertyName="exitCode1"/>
</Exec>

这篇关于MSBuild中的Exec任务,用于在远程计算机上执行命令的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆