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?

1
  • 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 stackoverflow.com/questions/995050/… 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, 2013 at 10:38

1 Answer 1

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>
3
  • Why do you use the -s parameter? Did cost us an hour : p
    – D.R.
    Jul 10, 2013 at 13:54
  • Another advice: Do not put arguments of the application inside the double quotes of the path.
    – D.R.
    Jul 10, 2013 at 14:23
  • -s runs psexec as "system" on the remote machine, without that flag it runs as the account that msbuild is ruining under
    – James Reed
    Jul 10, 2013 at 22:59

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.