title: In Windows batch, how do I copy multiple folders selected by a naming criteria with robocopy?
body: <p>I would like to use robocopy to copy multiple directories based on a similarity in the folder names' first few characters. <strong>How do I pick out certain directory names (perhaps with regular expressions?) and a loop of some sort so that I can avoid this horrible redundancy in copying the directories and their contents?</strong> The programmer in me dies a little bit each time I copy and paste these 3 lines and modify the folder names manually.</p>
  
  <pre><code>set "src=C:\Users\MyName\Photos\2015-10-25"
  set "dest=E:\ExtBackup\2015-photo-backup\2015-10-25"
  robocopy "%src%" "%dest%"
  set "src=C:\Users\MyName\Photos\2015-10-13"
  set "dest=E:\ExtBackup\2015-photo-backup\2015-10-13"
  robocopy "%src%" "%dest%"
  set "src=C:\Users\MyName\Photos\2015-10-02"
  set "dest=E:\ExtBackup\2015-photo-backup\2015-10-02"
  robocopy "%src%" "%dest%"
  </code></pre>
  
  <p>Rules</p>
  
  <ul>
  <li>I'm not copying all the directories in Photos, so a way to pick out the directory name is needed</li>
  <li>The source directory name must be copied too. That's why I'm repeating the source dir name in the destination</li>
  <li>must use <code>robocopy</code></li>
  <li>I wish to learn batch and avoid redundant scripting</li>
  </ul>