However, this also copies all the content within the folder, as well as the sub-folders.

This is also true for copy-pasting using the context menu.

There are times when you only wish to copy the folder/directory structure and not the files inside of them.

Copy folder structure

Now you want to do the same for 2022-2023.

Of course, any sub-directories would also be duplicated.

From Command Prompt

XCOPYis a Windows command line tool that is preinstalled in all Windowsversions.

Duplicate folder structure using XCOPY

XCOPY “t” and “e” switches

Robocopy has an even lengthier list of switches than XCOPY, making it more functional.

However, we can achieve the same with Robocopy as we did with XCOPY.

Here, we will be using the following 2 switches:SwitchDescription/eCopies subdirectories.

Folder structure duplicated

Folder structure duplicated

This option automatically includes empty directories./xf *Excludes files that match the specified names or paths.

Wildcard characters (*and?)

To explain this better, lets refer to the XCOPY and Robocopy methods.

Duplicate folder structure using Robocopy

Duplicate folder structure using Robocopy

The folder structure of TestFolder was duplicated into WorkFolder.

Open a Terminal window.

Tap the Launchpad button and bang out Terminal in the search bar, then open it.

Statistics of data copy using Robocopy

Statistics of data copy using Robocopy

Then drag and drop the destination folder into the Terminal window.

Use theCTRL + Alt + Tshortcut keys to pop pop the Terminal.

Your source directory structure will now be copied to the destination directory without the files.

Copy folder structure using PowerShell

Copy folder structure using PowerShell

Closing Words

Now everyone just needs to duplicate their folder structures.

2

Get weekly insights, tips and exclusive content delivered straight to your inbox.

Talk to us straight and get your questions answered right away

Entire folder is duplicated without Files using PowerShell

Entire folder is duplicated without files using PowerShell

Download Windows 11 IoT Enterprise LTSC ISO

Startup folder in all versions of Windows

Download Windows 11 Version 24H2

source: www.itechtics.com