3

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?

1 Answer 1

8

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)

:-)

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .