title: MsBuild Copy output and remove part of path
body: <p>I have an MsBuild project which builds various solutions and then copies the output of Web Deployment Projects into a destination folder with two sub folder as follows:</p>
  
  <p>The WDP output folders are copied over from the BuildFolder "Release".</p>
  
  <pre>
  DestFolder/PresentationTier/MyProject.xxx0Services_deploy/**Release**/Files...    
  DestFolder/MidTier/MyProject.xx1UI_deploy/**Release**/Files...
  </pre>
  
  <p>This works but I want to remove the <code>$(Configuration)</code> value from the output.</p>
  
  <p>So the desired output folder layout is to be:</p>
  
  <pre>
  DestFolder/PresentationTier/MyProject.xxx0Services_deploy/Files...    
  DestFolder/MidTier/MyProject.xx1UI_deploy/Files...
  </pre>
  
  <p>Note the removal of "<strong>Release</strong>" folder</p>
  
  <p>My code is below.</p>
  
  <p>How can I change this to give the desired out please:</p>
  
  <p>Code extract is as follows</p>
  
  <pre><code>  &lt;Target Name="CopyMidTierBuildOutput" DependsOnTargets="CopyPresentationTierBuildOutput" &gt;
  &lt;Message Text="Copying midTier Build Output=================" /&gt;
  
  &lt;CreateItem Include="$(DeploymentRoot)**/MyProject.xxx0Services_deploy/$(Configuration)/**/*.*;
              $(DeploymentRoot)**/MyProject.xxx1Services.Host_deploy/$(Configuration)/**/*.*;
              $(DeploymentRoot)**/MyProject.xxx2.Host.IIS.csproj_deploy/$(Configuration)/**/*.*;
              $(DeploymentRoot)**/MyProject.xxx3Services_deploy/$(Configuration)/**/*.*;
              $(DeploymentRoot)**/Nad.xxx4_deploy/$(Configuration)/**/*.*;
              $(DeploymentRoot)**/Nad.xxx5Services.Host_deploy/$(Configuration)/**/*.*;
              $(DeploymentRoot)**/Nad.xxx6Services.Host_deploy/$(Configuration)/**/*.*;
              $(DeploymentRoot)**/Nad.xxx7Service.Host.IIS_deploy/$(Configuration)/**/*.*;
              $(DeploymentRoot)**/Nad.xxx8Services.Host_deploy/$(Configuration)/**/*.*;
              $(DeploymentRoot)**/Nad.xxx9Service.Host.IIS.csproj_deploy/$(Configuration)/**/*.*;
              $(DeploymentRoot)**/Nad.xxx10Services.Host_deploy/$(Configuration)/**/*.*"&gt;
  
  
    &lt;Output TaskParameter="Include" ItemName="MidTierDeploys"/&gt;
  
  &lt;/CreateItem&gt;
  
  
  &lt;Copy
      SourceFiles="@(MidTierDeploys)"
      DestinationFolder="$(DestFolder)/MidTier/%(RecursiveDir)" ContinueOnError="false"  /&gt;
  </code></pre>
  
  <p></p>