title: How to move/copy folders using wildcards in batch?
body: <p>I am having trouble with a simple "move" command in a batch file.</p>
  
  <p>To give some potentially helpful context, the overarching purpose of the file I am writing is to sort named folders into alphabetically labeled folders.</p>
  
  <p>For example, a folder called "Allen, Jake" would be sorted into a folder called "A" and a folder called "Brown, Sarah" would be sorted into a folder called "B" and so on.</p>
  
  <p>Here is the line of code I am having trouble with:</p>
  
  <pre><code>    move "%SourceDirectory%\A*" "%DestinationDirectory%\A"
  </code></pre>
  
  <p>When I run the command I expect a folder called "Allen, Jake" to be moved from %SourceDirectory% into "%DestinationDirectory\A". </p>
  
  <p>Instead, I see the following output:</p>
  
  <pre><code>    C:\Users\alecm\Desktop&gt;move "C:\Users\alecm\Desktop\Source\A*" 
      "C:\Users\alecm\Desktop\Destination\A"
  
      The filename, directory name, or volume label syntax is incorrect.
  </code></pre>
  
  <p>I presume I'm making a simple syntax error here but I can't seem to figure it out. Thanks in advance for taking the time to look over this.</p>