title: robocopy extra files move to another folder
body: <p>I am trying to write a batch to copy all files (those in subfolders too) from directory1 to directory2 and then moving any extra files (or directories if possible) found in directory2 to directory3.
  In other words, I am trying to mirror directory2 with directory1 but instead of the purge action, moving the extra files to directory3...</p>
  
  <p>So far, I've been able to get those extra files in a text file... Now, I don't know how to proceed...</p>
  
  <pre><code>ROBOCOPY directory1 directory2 /E /COPYALL /R:0 /XO /X /tee /njh /njs /np /ns /nc /ndl &gt; Extrafiles.txt
  </code></pre>
  
  <p>Further, the Extrafiles.txt does contain a lot of extra spaces at start of each file path that means a little string manipulation before moving the file. And which command to use to move the files by automatically creating the target directory if it does not exist?</p>
  
  <p>Sample output of Extrafiles.txt</p>
  
  <pre><code>                directory2\File1.txt
                  directory2\subdirectory2\deeper\File2.txt
  </code></pre>
  
  <p>Any help will be appreciated. Thank You.</p>
  
  <p>Making it a little more clear:</p>
  
  <p>Suppose directory1 contains:</p>
  
  <pre><code>\subdir1
      file4.txt
      file5.txt
      \deeper
          file6.txt
          file7.doc
  file1.txt
  file2.txt
  </code></pre>
  
  <p>and directory2 already contains:</p>
  
  <pre><code>\subdir1
      file4.txt
      file007.ppt
      \deeper
          file6.txt
          file7.doc
          \deepest
              file155.txt
  file1.txt
  </code></pre>
  
  <p>Then I want these files to be copied:</p>
  
  <pre><code>directory1\file2.txt to directory2\file2.txt
  directory1\subdir1\file5.txt to directory2\subdir1\file5.txt
  </code></pre>
  
  <p>And then these files to be moved:</p>
  
  <pre><code>directory2\subdir1\file007.ppt to directory3\subdir1\file007.ppt
  directory2\subdir1\deeper\deepest\file155.txt to directory3\subdir1\deeper\deepest\file155.txt
  </code></pre>
  
  <p>Hope I made it clear enough :)</p>