title: How to robocopy to copy only files without creating parent folder tree of the file
body: <p>I am using robocopy to copy certain files from a long hierarchy-ed folder structure. E.g.: <code>*.properties</code> files. They may reside in very deep level of the directory structure (e.g. <code>C:\a\v\b\g\f\aa.properties</code>). Now I want to copy these properties files to another keeping only the top most parent folder (e.g.: destination folder structure will be <code>a\aa.properties</code>); I have used <code>/S</code> option to do so but it includes the parents too.
  Below is the batch file I've tried:</p>
  
  <pre><code>@echo off 
  
  ::Author = SHUBHENDU
  
  echo Copying files from %1 to %2
  
  
  set source=%1
  set destination=%2
  
  set list=abc def
  (for %%a in (%list%) do (
     echo Copying files from  %%a
     ROBOCOPY %source%\%%a %destination%\%%a *_en.properties /S
  ))
  </code></pre>
  
  <p>Source directory (sample):</p>
  
  <pre><code>F:.
  │   temp.bat
  │
  └───ss
      ├───asd
      │       ss_en.properties
      │
      └───asdfsdsd
          │   aa_en.properties
          │
          ├───dd
          │       asdsa.txt
          │
          └───ff
                  ff_en.properties
  </code></pre>
  
  <p>Required destination directory:</p>
  
  <pre><code>F:.
  ├───asd
  │       ss_en.properties
  │
  └───asdfsdsd
          aa_en.properties
          ff_en.properties
  </code></pre>