How To Duplicate A Folder Structure in Windows Without Copying Everything

Let’s say you have built a complicate folder structure that includes many sub-folders in many layers, and have been saving files into it. Now you want to use the same structure as the template for another project, and you are wondering if there is an easy way to duplicate the folder structure you have made to a different location without copying its content.

Luckily, here are some options that can help you out.

Use XCopy

It’s probably the simplest way to duplicate a folder structure without copying the original content. XCopy, stands for extended copy, is a long time Windows built-in command line that copies multiple files or entire directory trees from one location to the other. With the switch /t, you can easily to create the same structure in the destination without copying the files. But if the original location includes any empty folders, you will need the switch¬†/e included in the command as well. See the full syntax below:

xcopy source target /t /e

And the following Figure 1 shows how I did it to duplicate my SkyDrive folder structure to my Z: drive in Temp folder.

XCopy - duplicate folder structure

Figure 1 – Example of using XCopy command line

Using XXCopy

XXCopy is a 3rd party command line similar to XCopy but with much more features in over 230 switches. In fact, it’s built to mainly compete with Microsoft’s another powerful file copying tool, RoboCopy. It works perfectly well on both 32-bit and 64-bit of Windows.

Figure 2 – XXCopy utility

In most cases, you probably only need XCopy as it fulfills the mission completely. But in other cases, you may want a tool like XXCopy. There are 2 situations where I think XXCopy does what XCopy couldn’t.

For one, XXCopy can duplicate the folder structure with a limitation to certain levels. For example, I only want to the first 2 levels of folder structure being duplicated. Using switch /DL<n> can limits the processing to n levels.

For another, XXCopy can duplicate not only the folder structure but also copy the security information as well. It’s extremely helpful when dealing with a directory tree that has different security settings on different folders.

That pretty much covers it. If you are looking for a tool that has a graphic user interface, 47foldersapp might be your option.

Kent Chen

Microsoft MVP, IT Professional, Developer, Geek, and the co-founder of Next of Windows.

Last updated: 04/23/2015

Posted in: Tips & Tricks
Discover more: , ,