2

i have this folders and i want to merge in one folder

 - C:\1\a
 - C:\1\b
 - C:\1\c

how to merge this folders to

c:\1

and delete the original by using batch

manav m-n
  • 11,136
  • 23
  • 74
  • 97
Hauari
  • 43
  • 1
  • 2
  • 11

1 Answers1

3
robocopy /mt /move "C:\1\a" "C:\1" *
robocopy /mt /move "C:\1\b" "C:\1" *
robocopy /mt /move "C:\1\c" "C:\1" *
rd /s /q "C:\1\a"
rd /s /q "C:\1\b"
rd /s /q "C:\1\c"

Help: rd /?, robocopy /?, xcopy /?

David Ruhmann
  • 11,064
  • 4
  • 37
  • 47
  • The `/mt` switch won't work with `robocopy` versions earlier than the one shipped with Windows 7. – Ansgar Wiechers Dec 19 '12 at 17:15
  • 1
    @AnsgarWiechers Indeed that is true, but the OP did not indicate a version of Windows so I will assume the they are up to date. :) My goal is to provide the **best** and **simplest** answer for the targeted problem. – David Ruhmann Dec 19 '12 at 20:13
  • 2
    That's your decision, of course. However, it usually is safer to assume that a system does not necessarily run the latest version of something, and provide a solution that works on a broader range of systems. – Ansgar Wiechers Dec 19 '12 at 21:51
  • IMO, this is nos practical.. what if we want to merge 100 folders? Any solution that merges all folders on a directory? – Jack Casas Jan 10 '20 at 13:56