[Windows] Copy directory structure only

Linux howto's, compile information, information on whatever we learned on working with linux, MACOs and - of course - Products of the big evil....
Post Reply
gilthanaz
Site Admin
Posts: 444
Joined: Fri Aug 29, 2003 9:29 pm
Contact:

[Windows] Copy directory structure only

Post by gilthanaz »

[Problem]
I want to create an exact copy of the directory structure of drive to another drive, without copying any files. "xcopy" has failed the job because some path names are longer than 255 chars (this triggers an out of memory error).

[Solution]
More recent versions of windows come with "robocopy", which can handle the job:

robocopy a: b: /e /xf * /W:0 /R:0

/e: Copy empty directories
/xf *: Exclude all files
/W:0 Wait zero seconds
/R:0 Do not retry (0 times) if there is an error (e.g. permission denied).

This command did exactly what I wanted and re-created the majority of the structure with the exception of some known access issues! :)
Post Reply