SharpCoder
SharpCoder

Reputation: 19189

Exec Task in MSBuild for execution of command on remote machine

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?

Upvotes: 1

Views: 4242

Answers (1)

James Reed
James Reed

Reputation: 14052

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>

Upvotes: 5

Related Questions