title: Using 'move' command instead of 'xcopy' in a loop
body: <p>This line of code fines all folders in a directory that have a certain bit of text in common and copies all the contents of those folders to a new destination. </p>
  
  <pre><code>dir /b /s /a:d "\\SERVER\Path\Directory\*FolderTag" | for /f "delims=\; tokens=3,4,5*" %%a in ('findstr FolderTag') do @xcopy /i /s /y "\\SERVER\Path\Directory\%%b\%%c" "E:\%%b\"
  </code></pre>
  
  <p>It works like a charm. But I'd like to be able to move the files instead of just copying them so that they are removed from their original location. I can't simply replace <code>xcopy</code> with <code>move</code> but I can't figure out how to convert the structure of this loop into one that will work with move. Would it be easier just to write another loop that deletes the files? I doubt <code>rm</code> instead of <code>xcopy</code> would work and I'm always a little scared to touch <code>rm</code>. </p>
  
  <p>I tried putting together a working example batch script but because the loop is so dependent on the path structure, i wasn't able to get it working. So basically my question revolves around my implementation of <code>xcopy</code> in this loop and how it could be changed to let <code>move</code> work in its place.</p>