Copy only folders

Microsoft Windows 2019


How copy only a folder structure and not the files therein?


Use robocopy:

robocopy "source"  "destination" /e /xf *

Above will copy folder structure from source to destination folder, without the security.

/E copy subdirectories, including Empty ones.
/XF file [file]… eXclude Files matching given names/paths/wildcards.

Add /SEC and the security for the file is also copied.

/SEC Copy files with SECurity (equivalent to /COPY:DATS). Useful if you just want to copy over security changes.

More Information: