title: Copy entire directory to output folder maintaining the folder structure?
body: <p>I want a specific directory to be copied to output folder ("bin") on every build. I think it can be handled via post build scripts. But I'm not sure how to copy a directory itself. I know how to handle specific files.</p>
  
  <p>For eg, this works for a file:</p>
  
  <p>In</p>
  
  <blockquote>
    <p>Project > Properties > Build Events> Post Build</p>
  </blockquote>
  
  <pre><code>COPY "$(SolutionDir)Resources\Release Notes.pdf" "$(TargetDir)"
  </code></pre>
  
  <hr>
  
  <p>But suppose I have a directory <code>Template</code>, now I need everything under <code>Template</code> to come to <code>bin</code> folder upon successful build <strong>maintaining the folder structure</strong>.</p>
  
  <p>I tried this:</p>
  
  <pre><code>COPY "$(SolutionDir)Resources\Template\" "$(TargetDir)"
  </code></pre>
  
  <p>Only the files in <code>Template</code> directory gets copied this way and not the sub directories and the files inside <code>Template</code> folder. I want the folder <code>Template</code> itself to come inside my output <code>bin</code> folder. In other words, <code>bin</code> should look like:</p>
  
  <pre><code>bin &gt; Template &gt; abc.xxx  
                   xxx.yyy
                   Subdirectory1 &gt; asd.qwe
                                   zxc.qwe 
                   Subdirectory2 &gt; ...
  </code></pre>
  
  <p>This could be a duplicate, but I couldn't find a relevant thread. Thanks.</p>