title: Xcopy - Trying to copy a folder with certain arguments to another location
body: <p>I'm trying to xcopy certain folders from a directory of 5000 folders, that start with the number 9097*
  Approx 2000 folders start with 9097.</p>
  
  <pre><code>for /f %%A in ('DIR /b /a:D') do (
      set temp=%%A
      set ID=!temp:~0,4!
      if !ID!==9097 xcopy  *!ID!* F:\%INPUT% /S /i
  </code></pre>
  
  <p>My problem is that when it finds the first folder starting with 9097, the code then goes and copies all contents of all the folders, I want it to only copy the 9097 folders. I understand why the code above is doing what it is doing but I can't seem to think of the way for it to just copy the folders and contents starting with 9097.</p>
  
  <p>Any advice would be greatly appreciated.</p>