title: How do I pattern-match filenames in a batch script
body: <h2>My specific situation</h2>
  
  <p>I want to copy files to two different locations depending on the fourth character of the file name. Monochrome images should go to B/W folder and Colour images should go to Colour Folder. The 4th character of file name will be either C or B (for Colour or Black / white).</p>
  
  <p>For example, F0#CG.eps would be a color image file, and F0#BG.eps would be a monochrome image file.</p>
  
  <p>I also add usernames at the end of the filename while copying. Here's what I have so far:</p>
  
  <pre><code>@echo off
  copy *.eps* \\Server\Directory1\BW\??????????%username%.*
  copy *.eps* \\Server\Directory1\COL\??????????%username%.*
  </code></pre>