1

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?

SharpCoder
  • 18,279
  • 43
  • 153
  • 249
  • 1
    This isn't really an msbuild question. AFAIK msbuild has no built in support for remote machine installation, it can just execute commands. When you know which command to execute, msbuild can take over from there. Something like http://stackoverflow.com/questions/995050/install-software-on-a-remote-machine may point you in the right direction. Alternatively edit your tags to include things like 'remote-access' to get a broader coverage. – Mike Vine May 28 '13 at 10:38

1 Answers1

5

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>
James Reed
  • 13,873
  • 51
  • 60