As the title says...

An example: I have these files & dirs:

c:\file.txt
c:\a\somefile.txt
c:\b\anotherfile.txt

And with some magic I want this structure on the destination:

d:\a\somefile.txt
d:\b\anotherfile.txt

Can this be done with xcopy?

link|improve this question
feedback

1 Answer

up vote 4 down vote accepted

Yes:

C:\> FOR /D %d in (*) DO xcopy /S /I %d d:\%d
  • /D : Just directories
  • /S : Copy subdirectories
  • /I : Targets are directory (not file)

:-)

link|improve this answer
feedback

Your Answer

 
or
required, but never shown

Not the answer you're looking for? Browse other questions tagged or ask your own question.