<p>Just wondering if someone could help me with some msbuild scripts that I am trying to write.  What I would like to do is copy all the files and sub folders from a folder to another folder using msbuild.</p>
<pre><code>{ProjectName}
      |-----&gt;Source
      |-----&gt;Tools
              |-----&gt;Viewer
                       |-----{about 5 sub dirs}
</code></pre>
<p>What I need to be able to do is copy all the files and sub folders from the tools folder into the debug folder for the application.  This is the code that I have so far.</p>
<pre><code>&lt;ItemGroup&gt;
    &lt;Viewer Include=&quot;..\$(ApplicationDirectory)\Tools\viewer\**\*.*&quot; /&gt;
&lt;/ItemGroup&gt;

&lt;Target Name=&quot;BeforeBuild&quot;&gt;
    &lt;Copy SourceFiles=&quot;@(Viewer)&quot; DestinationFolder=&quot;@(Viewer-&gt;'$(OutputPath)\\Tools')&quot; /&gt;
&lt;/Target&gt;
</code></pre>
<p>The build script runs but doesn't copy any of the files or folders.</p>
<p>Thanks</p>

Did you try to specify concrete destination directory instead of
```
```
DestinationFolder="@(Viewer->'$(OutputPath)\\Tools')" ?
```
```
I'm not very proficient with advanced MSBuild syntax, but
```
```
@(Viewer->'$(OutputPath)\\Tools')
```
```
looks weird to me. Script looks good, so the problem might be in values of
```
$(ApplicationDirectory)
```
and
```
$(OutputPath)
```
Here is a blog post that might be useful:
How To: Recursively Copy Files Using the <Copy> Task