title: MSBuild - Copy All Bin Output - Debug|Release
body: <p>I have the following MSBuild targets file (below).</p>
  <p>How would I add an additional step after Default to copy all the <code>\bin\Debug</code> or <code>\bin\Release</code> from one of the projects to a folder called  <code>binaries</code> that is in the same folder as the <code>.targets</code> file was run?</p>
  <p>If I could get it to be smart about if it uses Debug or Release even better.</p>
  <p><strong>UPDATE</strong>: I have updated my code that I have gotten so far. Still would be nice to be able to run the .bat file that kicks this msbuild off in two operating modes: Release and Debug and then have two different folders in the Binaries folder</p>
  <p></p>
  <pre><code>  &lt;ItemGroup&gt;
      &lt;SolutionFiles Include=&quot;.\**\*.sln&quot;/&gt;
    &lt;/ItemGroup&gt;
  
    &lt;ItemGroup&gt;
      &lt;DebugBinFiles Include=&quot;.\src\Sample.Core\Sample.Core.Infrastructure\bin\Debug\**\*.*&quot;/&gt;
    &lt;/ItemGroup&gt;
  
    &lt;ItemGroup&gt;
      &lt;ReleaseBinFiles Include=&quot;.\src\Sample.Core\Sample.Core.Infrastructure\bin\Release\**\*.*&quot;/&gt;
    &lt;/ItemGroup&gt;
  
    &lt;Target Name=&quot;Default&quot; AfterTargets=&quot;AfterBuild&quot;&gt;
      &lt;MSBuild Projects=&quot;@(SolutionFiles)&quot; Condition=&quot;&quot;/&gt;
    &lt;/Target&gt;
  
    &lt;Target Name=&quot;AfterBuild&quot;&gt;
      &lt;Copy SourceFiles=&quot;@(BinFiles)&quot; DestinationFolder=&quot;.\binaries\Debug&quot; /&gt;
    &lt;/Target&gt;
  
  &lt;/Project&gt;
  </code></pre>