Search code examples
.netmsbuildteamcitymsbuild-task

install a service on a remote computer from a MSBuild script


I have this task that creates a service:

Target Name="InstallService" DependsOnTargets="CopyFiles"
Exec Command="sc \ \remotecomputer create "ServiceHost" binPath= "E:\ServiceHost.exe" DisplayName= "ServiceHost"" WorkingDirectory="c:\" ContinueOnError="false" /Target

The problem is that when I run this script it doesn't know the \ \remotecomputer.


Solution

  • I figured it out: you have to use it like this: """\ \remotecomputer"""