[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....

[Windows] Copy directory structure only

Postby gilthanaz » Mon Jul 09, 2018 3:27 pm

[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! :)
  • 0

User avatar
gilthanaz
Site Admin
 
Posts: 443
Joined: Fri Aug 29, 2003 9:29 pm
Reputation: 0

Return to Knowledge Base

Who is online

Users browsing this forum: No registered users and 4 guests

Who is online over last 24 hours

Users browsed this forum in the last 24 hours: Bing [Bot] and 13 guests

cron
Reputation System ©'