I want to replicate the folder structure from a location in another location. Also, I want only the structure which is one level deep to be replicated. Is there a way to do it?

I'm running Windows 7 Professional 64 bit.

link|improve this question

80% accept rate
Are you looking for a tool that does that or you need to implement that? – detunized Dec 2 '10 at 20:35
a tool, I guess that makes this question more relevant to superuser? Could someone move it? – Pulkit Sinha Dec 2 '10 at 21:14
feedback

migrated from stackoverflow.com Dec 15 '10 at 11:22

This question came from our site for professional and enthusiast programmers.

3 Answers

up vote 6 down vote accepted

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

link|improve this answer
feedback

From a command prompt:

cd C:\Path\To\Source
for /d %i in (*) do @md "C:\Path\To\Destination\%i"

Make sure to quote the destination path to take into account any folders with spaces in the name.

link|improve this answer
feedback

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.

link|improve this answer
feedback

Your Answer

 
or
required, but never shown

Not the answer you're looking for? Browse other questions tagged or ask your own question.