RoboCopy Class | MSBuild Extension Pack Help 4.0.12.0 |
This task wraps RoboCopy. Successful non-zero exit codes from Robocopy are set to zero to not break MSBuild. Use the ReturnCode property to access the exit code from Robocopy
Inheritance Hierarchy
Microsoft.Build.UtilitiesToolTask
MSBuild.ExtensionPack.FileSystemRoboCopy
Namespace: MSBuild.ExtensionPack.FileSystem
Assembly: MSBuild.ExtensionPack (in MSBuild.ExtensionPack.dll) Version: 4.0.0.0
The RoboCopy type exposes the following members.
Constructors
Name | Description | |
---|---|---|
RoboCopy |
Properties
Name | Description | |
---|---|---|
Destination |
Destination Dir (drive:\path or \\server\share\path).
| |
Files |
File(s) to copy (names/wildcards: default is "*.*").
| |
LogToConsole |
Set to true to log output to the console. Default is false
| |
Options |
Type 'robocopy.exe /?' at the command prompt for all available options
| |
ReturnCode |
Gets the Return Code from RoboCopy
| |
Source |
Source Directory (drive:\path or \\server\share\path).
|
Examples
<Project ToolsVersion="4.0" DefaultTargets="Default" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> <PropertyGroup> <TPath>$(MSBuildProjectDirectory)\..\MSBuild.ExtensionPack.tasks</TPath> <TPath Condition="Exists('$(MSBuildProjectDirectory)\..\..\Common\MSBuild.ExtensionPack.tasks')">$(MSBuildProjectDirectory)\..\..\Common\MSBuild.ExtensionPack.tasks</TPath> </PropertyGroup> <Import Project="$(TPath)"/> <Target Name="Default"> <MSBuild.ExtensionPack.FileSystem.RoboCopy Source="C:\b" Destination="C:\bbzz" Files="*.*" Options="/MIR"> <Output TaskParameter="ExitCode" PropertyName="Exit" /> <Output TaskParameter="ReturnCode" PropertyName="Return" /> </MSBuild.ExtensionPack.FileSystem.RoboCopy> <Message Text="ExitCode = $(Exit)"/> <Message Text="ReturnCode = $(Return)"/> <MSBuild.ExtensionPack.FileSystem.RoboCopy Source="C:\a" Destination="C:\abzz" Files="*.txt" Options="/e"> <Output TaskParameter="ExitCode" PropertyName="Exit" /> <Output TaskParameter="ReturnCode" PropertyName="Return" /> </MSBuild.ExtensionPack.FileSystem.RoboCopy> <Message Text="ExitCode = $(Exit)"/> <Message Text="ReturnCode = $(Return)"/> </Target> </Project>
See Also