Copy folder structure on Windows

Solution 1:

You can use XXCOPY with the /T and /DL switches.

/DL Limits processing of directory nesting to n levels.

/T Creates directory structure, but does not copy files. It copies all directories including empty ones

http://www.xxcopy.com

Solution 2:

If you don't want to use third party programs, the windows 7 native XCOPY command can also duplicate a folder structure.

xcopy source dest /t /e

will create the directory structure including empty folder but without copying the files.

Solution 3:

Robocopy supercedes/replaces xcopy in Windows 7, and allows limiting copies to N folder levels deep, e.g.:

robocopy <source> <dest> /e /create /lev:2
  • /e includes subfolders, even if empty (use /s instead to exclude empty folders)

  • /create only copies the folder structure and zero-length files

  • /lev:N limits subfolder traversal to N levels, including the <source> folder you specified... so /lev:1 would only include the <source> folder itself, and /lev:2 includes any subfolders immediately under <source>, but not their subfolders, and so on

See http://technet.microsoft.com/en-us/library/cc733145.aspx for details.