Exec Task in MSBuild for execution of command on remote machine

青春壹個敷衍的年華 提交于 2019-12-10 12:19:43

问题


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?


回答1:


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>


来源:https://stackoverflow.com/questions/16769856/exec-task-in-msbuild-for-execution-of-command-on-remote-machine

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!