# How to use XCOPY to copy a folder stucture and NO files.



## gwashington (Jul 2, 2007)

i have a folder named "WebDesign" with two folders "Fonts" and "Layouts". I need a great .bat file to execute a 'copy all the folders but not the files' 

Im thinikn and tryin to figure out this setup

F:\WebDesign\Fonts
F:\WebDesign\Layouts

i want to practice using XCOPY to copy ONLY the folder sturcture.

I want to XCOPY the F:\ drive to my N:\
xcopy f:\ - t -e isnt working ..or is this a unkwn syntax that dont work?
is there a better way?


----------



## Ent (Apr 11, 2009)

It should be 
Xcopy f: n: /T /E


----------



## TheOutcaste (Aug 8, 2007)

You need to specify a path (the root folder in this case, *\*}as well as the drive letter. If you specify just the drive letter, it will use the current folder on each drive, which might not be the root.
*xcopy f:\ n:\ /E /T*
If any folders have the hidden or system attributes set, you need to also use the */H* switch.


----------



## gwashington (Jul 2, 2007)

i will try it out and let u all know my results..i see the issue was that i was using a "-" instead of the forward slah.i feel so stupid cause i suppose to know this ..sigh


----------



## Ent (Apr 11, 2009)

gwashington said:


> i will try it out and let u all know my results..i see the issue was that i was using a "-" instead of the forward slah.i feel so stupid cause i suppose to know this ..sigh


I've started making that same mistake after trying to learn the Linux command line. It is really annoying, but it's nice to know what problems you commonly suffer from so you can check them before doing a comprehensive debug.


----------

