Saturday, March 21, 2009

How To Copy A Directory Structure

To copy a directory structure without copying and of the files which are in the directory structure:

Click Start > Run.
Type:

xcopy /T /E /I

Example:
xcopy "C:\Documents and Settings\User Name\My Documents" "D:\My Documents Backup" /T /E /I


Notes:
The meaning of the switches for xcopy are the following:
  • /T : Creates directory structure, but does not copy files. Does not include empty directories or subdirectories. /T /E includes empty directories and subdirectories.
  • /E : Copies directories and subdirectories, including empty ones. May be used to modify /T.
  • /I : If destination does not exist and copying more than one file, assumes that destination must be a directory.

No comments:

Post a Comment