How To Copy Folder Structure Without Copying Files On A Windows PC, Mac, Or Linux

If you’ve found an effective way to organize your data across folders and subfolders, you probably want to replicate that structure. However, typical ways of copying folders also include duplicating files, so you’ll have to waste time emptying the folders. Fortunately, several methods bypass this issue in Windows 11 and 10, macOS, and Linux-based computers. Continue reading to find out how to duplicate a folder structure without its original files.

How To Copy Folder Structure Without Copying Files On A Windows PC, Mac, Or Linux

Copy Folder Structure Without Copying Files in Windows 11

Windows File Explorer offers no built-in option for automatically replicating complex folder structures. Going through folder hierarchies and replicating them is tedious and requires time and effort. Luckily for Windows 11 users, there are still two other methods to copy folder structures without transferring files.

The first way involves using the Command Prompt. “Xcopy” is short for “extended copy” and this command allows you to transfer folder structures to a new storage location without duplicating the files. The command line uses the “/t” switch to do so. The issue is that the duplicating switch cannot detect empty folders, so it’s necessary to modify it and add the “/e” switch. Combining the two helps the Command Prompt to identify empty folders and copy their organization model. Here’s how to use “xcopy” in the Command Prompt:

  1. Hold Windows + R to open the Run dialog.
    How To Copy Folder Structure Without Copying Files On A Windows PC, Mac, Or Linux
  2. Type cmd in the dialog window and click on the OK button to launch the Command Prompt.
    How To Copy Folder Structure Without Copying Files On A Windows PC, Mac, Or Linux
  3. In the Command Prompt window, type the following without pressing enter:
    xcopy
    How To Copy Folder Structure Without Copying Files On A Windows PC, Mac, Or Linux
  4. Enter the path that stores the folder structure you want to duplicate. Ensure you have a space after xcopy.
    How To Copy Folder Structure Without Copying Files On A Windows PC, Mac, Or Linux
  5. Type the destination path where you want to store the copied hierarchy. Ensure there is a space after the source directory.
    How To Copy Folder Structure Without Copying Files On A Windows PC, Mac, Or Linux
  6. Type the switches below. Ensure there is a space after the destination directory.
     /t /e
  7. Your completed command should look something like this:
    xcopy “C:\users\my_username_here\Documents\Archived\Work” “D:\Backups\Documents\Work” /t /e
    The example command above copies the archived work folder structure and pastes it into a new/active work directory.
  8. Tap Enter on the keyboard to activate the command to copy the folder structure.

The “/t” switch creates the folder structure in the destination directory.

The “/e” switch includes and adds all empty folders to the destination directory.

You can also use the Command Prompt with a Robocopy command to copy folder directories, hierarchies, and structures. Microsoft intended for Robocopy to serve as a more functional version of xcopy, providing users with more options to manipulate and organize files and folders.

Robocopy lets you rerun the command multiple times, and you can use it to add new folders without recopying everything. The feature takes the hassle of copying complicated file directories by typing a relatively short command line. To do so:

  1. Press Windows + R to launch the Run dialog.
    How To Copy Folder Structure Without Copying Files On A Windows PC, Mac, Or Linux
  2. Type cmd in the pop-up window.
    How To Copy Folder Structure Without Copying Files On A Windows PC, Mac, Or Linux
  3. Hold down Ctrl + Shift + Enter to enable the Run as administrator option.
  4. When the Command Prompt window appears, type the following command line:
    robocopy
    How To Copy Folder Structure Without Copying Files On A Windows PC, Mac, Or Linux
  5. Type the source folder structure in quotations with a space after it.
    How To Copy Folder Structure Without Copying Files On A Windows PC, Mac, Or Linux
  6. Type the destination folder structure with quotations and a space after it.
    How To Copy Folder Structure Without Copying Files On A Windows PC, Mac, Or Linux
  7. Copy the following switches and paste them at the end of the command:
    /e /xf
  8. Your completed command should look something like this:
    robocopy “C:\users\my_username_here\Documents\Archived\Work” “D:\Backups\Documents\Work” /e /xf *
  9. Hit the Enter key to activate the command.

The “/e” switch allows the system to copy empty folders in the directory structure.

The “/xf *” switch tells the command to exclude files.

The second option for Windows 11 users is copying folder structures with third-party software. This is an excellent choice if you feel uncomfortable when working with command lines or are uncertain about your technical knowledge. One of the most user-friendly programs is Duplicate Directory. The developers want you to determine how useful the tool is, so there’s no fixed price tag. The customers can donate any amount they want to download the software. To replicate structures with Duplicate Directory, do the following:

  1. Download and launch Duplicate Directory.
    How To Copy Folder Structure Without Copying Files On A Windows PC, Mac, Or Linux
  2. Choose the original folder structure path.
  3. Select the copied folder structure location path.
  4. Press the Duplicate button.

The program will replicate all the source folders in a new location without moving or copying the files.

Copy Folder Structure Without Copying Files in Windows 10

Windows File Explorer is useful for manually creating folders for your files, but it has no feature that lets Windows 10 users create copies of folder structures and directories. If you’re working on intricate personal or professional projects, your folders are probably packed with subfolders. Recreating this structure takes a lot of patience and energy. Fortunately, you can use command lines to recreate folder structures with ease.

Command lines act as pseudo-code and are typically used with the Command Prompt to execute various tasks. The “xcopy” command replicates folders, and you can modify it using switches that determine which aspects will be copied or excluded. The “/t” switch signals to the system that it should replicate all folders without the files. Since this function doesn’t register empty folders, the command line will also include the “/e” switch. The system will scan structures containing empty folders and replicate them in their entirety. To execute the command:

  1. Tap Windows + R to open the Run dialogue.
    How To Copy Folder Structure Without Copying Files On A Windows PC, Mac, Or Linux
  2. Type cmd and click on OK to launch the Command Prompt.
    How To Copy Folder Structure Without Copying Files On A Windows PC, Mac, Or Linux
  3. Type or copy/paste the following command (include the space at the end) without pressing the Enter key:
    xcopy
  4. Type the source directory within quotation marks and add a space after it. Don’t press Enter.
    How To Copy Folder Structure Without Copying Files On A Windows PC, Mac, Or Linux
  5. Type the destination folder where you’ll copy the source’s folder structure, then add a space after it. Do not press Enter.
    How To Copy Folder Structure Without Copying Files On A Windows PC, Mac, Or Linux
  6. Copy and paste the following switches:
    /t /e
  7. Your complete command line should look something like this:
    xcopy “C:\users\my_username_here\Music” “F:\Music” /t /e
    The above example copies the folder hierarchy/structure (including empty folders) of the user’s Music folder and creates it in the external drive’s Music folder.
  8. Press Enter on your keyboard.

Another option is the Robocopy command which allows multiple repeat actions and lets you add only new folders if desired. Here’s how to copy a folder structure with a Robocopy line:

  1. Click on Windows + R to bring up the Run dialog.
    How To Copy Folder Structure Without Copying Files On A Windows PC, Mac, Or Linux
  2. Type cmd in the new window.
    How To Copy Folder Structure Without Copying Files On A Windows PC, Mac, Or Linux
  3. Hold Ctrl + Shift + Enter to run the Command Prompt as administrator.
  4. Type the following text (with a space at the end) into the command line without pressing Enter:
    robocopy
  5. Type the source folder with quotation marks at the ends, and add a space after it. Do not press Enter.
    How To Copy Folder Structure Without Copying Files On A Windows PC, Mac, Or Linux
  6. Type the destination folder and add a space after it. Do not press Enter.
    How To Copy Folder Structure Without Copying Files On A Windows PC, Mac, Or Linux
  7. Type or copy/paste the following switches:
    /e /xf
  8. Tap the Enter key to launch the complete command.

The action replicates the structure, preserving all subfolders and excluding the original files.

The “/e” switch tells it to include all empty folders and subfolders (everything).

The “/xf” switch excludes files.

Copy Folder Structure Without Copying Files on a Mac

If you have a MacBook, you can copy a folder structure with a command line or third-party software.

MacOS executes commands using Mac Terminal. To copy a folder structure with the program:

  1. Open the source folder of the structure.
  2. Open the destination folder for the duplicate structure.
  3. Tap the Launchpad button and type Terminal in the search bar.
    How To Copy Folder Structure Without Copying Files On A Windows PC, Mac, Or Linux
  4. When it shows up in the search results, tap the program to open it.
    How To Copy Folder Structure Without Copying Files On A Windows PC, Mac, Or Linux
  5. Type the following command in the Terminal window: rsync -avf"+ */" -f"- *"
    How To Copy Folder Structure Without Copying Files On A Windows PC, Mac, Or Linux
  6. Drag and drop the source folder into the window.
  7. Drag and drop the destination folder into the Terminal as well.
  8. Press Enter on the keyboard.

The action will clone the folder structure in the new location without keeping any original files.

You can also copy structures and hierarchies with the Duplicate Directory software. The app doesn’t involve writing command lines and works on donations. Users can decide how much the program is worth and download it after making a donation. Here’s how to use the software:

  1. Download and launch Duplicate Directory.
    How To Copy Folder Structure Without Copying Files On A Windows PC, Mac, Or Linux
  2. Pick the source path of the folder structure.
  3. Select the location path of the cloned structure.
  4. Click on the Duplicate button.

The program will replicate the folders and subfolders, but won’t preserve the files, allowing you to store and organize new data.

Copy Folder Structure Without Copying Files in Linux

Linux systems let users execute numerous commands, but it’s sometimes challenging to remember all the command lines. The quickest way to copy a folder structure in Linux is with the “rsync” command, a tool for replicating files and directories. Since “rsync” utilities come preinstalled on Linux products, cloning folder hierarchies without files is relatively straightforward. To do so:

  1. Press Crtl + Alt + T to open the Terminal app.
  2. Type the following “rsync” command in the Terminal window: $ rsync -av -f "(source)" "(destination)"
  3. Replace “source” with the path containing the original folder structure.
    How To Copy Folder Structure Without Copying Files On A Windows PC, Mac, Or Linux
  4. Replace “destination” with the path where the copied structure will be created.
    How To Copy Folder Structure Without Copying Files On A Windows PC, Mac, Or Linux
  5. Hit the Enter key.
    How To Copy Folder Structure Without Copying Files On A Windows PC, Mac, Or Linux

The modified command line instructs the system to replicate folders and subfolders but skip files.

Replicate Folder Structures Efficiently

Our laptops and PCs help us keep track of personal and professional information and documents, so it’s essential that the data is well-organized. To ensure your data is in order, you can replicate empty folder structures on your device using either command lines or third-party programs.

Have you ever copied a folder hierarchy or directory? Did you use one of the methods outlined in this article? Let us know in the comments section below.

Sign up and earn $1000 a day ⋙

How to fix error 0xa00f4288 in Camera app on Windows 10 & 11

How to fix error 0xa00f4288 in Camera app on Windows 10 & 11

How to fix error 0xa00f4288 in the Camera app on Windows 10 & 11. Windows' default Camera App is the main tool for taking photos. So in the case of Win 10 & 11 cameras

How to open multiple programs with one shortcut on Windows 10

How to open multiple programs with one shortcut on Windows 10

How to open multiple programs with one shortcut on Windows 10, You can actually open multiple programs at the same time with a single key. Here's how to use one

How to delete old boot menu options on Windows

How to delete old boot menu options on Windows

How to remove old boot menu options on Windows, Windows 10 dual boot is useful but can leave redundant boot options in the menu. Here's how to remove the menu

Instructions for fixing Snipping Tool errors on Windows 11

Instructions for fixing Snipping Tool errors on Windows 11

Instructions for fixing Snipping Tool errors on Windows 11. Windows 11 has officially been released for a while, but during use there are still many errors

Instructions for entering text by voice on Windows 11

Instructions for entering text by voice on Windows 11

Instructions for entering text by voice on Windows 11, Entering text by voice on Windows 11 helps you significantly improve your work efficiency. Here's how

How to turn on/off Sticky Key on Windows 11

How to turn on/off Sticky Key on Windows 11

How to turn on/off Sticky Key on Windows 11, Sticky Key makes the PC keyboard easier to use. Here's how to turn Sticky Key on and off on Windows 11.

What is Windows Modules Installer?

What is Windows Modules Installer?

What is Windows Modules Installer?, Windows Modules Installer sometimes takes up a lot of system resources. Is Windows Modules Installer important or not?

How to increase volume in Windows 10

How to increase volume in Windows 10

How to increase volume in Windows 10, How to increase computer volume to maximum level? Let's learn with WebTech360 how to increase Windows 10 computer volume

How to use Windows 11 Installation Assistant to install Windows 11

How to use Windows 11 Installation Assistant to install Windows 11

How to use Windows 11 Installation Assistant to install Windows 11, Windows 11 Installation Assistant is one of the best ways to upgrade your computer to Windows 11.

How to turn off the startup sound in Windows 11

How to turn off the startup sound in Windows 11

How to turn off the startup sound in Windows 11, Does the PC startup sound bother you? Then please refer to how to turn off the startup sound for PC running Windows 11 below

Instructions for changing the screen lock timeout on Windows 11

Instructions for changing the screen lock timeout on Windows 11

Instructions for changing the screen lock timeout on Windows 11. While using Windows 11, there are times when users will need to leave the computer for a period of time.

Windows 11 optimization guide to increase FPS when playing games

Windows 11 optimization guide to increase FPS when playing games

Instructions for optimizing Windows 11 to help increase FPS when playing games, Windows 11 is an operating system platform that is introduced as more improved in gaming quality, helping games

Windows 11: How to use and customize the Quick Settings menu

Windows 11: How to use and customize the Quick Settings menu

Windows 11: How to use and customize the Quick Settings menu, Windows 11 brings some great new features and the Quick Settings menu is no exception. Here it is

How to fix the error of not being able to start Windows 11 after enabling Hyper-V

How to fix the error of not being able to start Windows 11 after enabling Hyper-V

How to fix the error of not being able to start Windows 11 after turning on Hyper-V. Hyper-V helps you run virtual machines on Windows. However, after enabling Hyper-V, you cannot post again

How to fix error 0xc00007b in Windows

How to fix error 0xc00007b in Windows

How to fix error 0xc00007b in Windows, Windows displays error 0xc00007b when the application does not work properly. Below is a step-by-step guide to fix error 0xc00007b in

How to change the login screen on Windows 10/11

How to change the login screen on Windows 10/11

How to change the login screen on Windows 10/11, Don't like the blurry screen when logging in on Windows 10/11? So, instructions on how to turn off and change the login screen

How to uninstall drivers in Windows 11

How to uninstall drivers in Windows 11

How to uninstall drivers in Windows 11, Do you want to remove unwanted drivers on Windows 11? Then please see instructions on how to remove drivers in Windows

How to fix No Internet Secured error on Windows 10

How to fix No Internet Secured error on Windows 10

How to fix No Internet Secured error on Windows 10, No Internet Secured is a common error on Windows 10. Below are simple ways to fix No Internet Secured error

How to fix the error of not being able to save Excel files on Windows

How to fix the error of not being able to save Excel files on Windows

How to fix the error of not being able to save an Excel file on Windows. If you can't save the Excel file, don't worry too much. Below are ways to fix the error of not being able to save the above Excel file

How to open DMG files on Windows

How to open DMG files on Windows

How to open DMG files on Windows, DMG is a file format specific to the macOS operating system. However, you still have a way to open DMG files on Windows.