Recommended Free Tools
Windows 11 File Explorer has no built-in command to copy only a folder structure. To copy folders without their files, open Command Prompt and run XCOPY with /T /E /I, or use ROBOCOPY with /E /XF *.
XCOPY is a straightforward choice; use ROBOCOPY when you need logging, junction-point controls, permission options, or long-path support. Both commands can include empty folders.
Before you start
- Open Start, search for Command Prompt, and open it.
- Identify the complete source and destination paths.
- Put paths in double quotation marks when they contain spaces.
For example, a source might be C:\Users\Alex\Documents\Project Templates, while the destination might be D:\Backup\Project Templates.
Method 1: Copy folders only with XCOPY
Run this command:
xcopy "C:\Source" "D:\Destination" /T /E /I
Replace both paths with your own. The switches mean:
Quick wins for a faster PC:
Scan for outdated or missing drivers - takes under a minuteDriver Scan →Repair Windows errors before they cause bigger problemsFix Now →Fix the driver behind crashes, sound loss and screen glitchesFind Drivers →#1 Best Overall
- Easily store and access 2TB to content on the go with the Seagate Portable Drive, a USB external hard drive
- Designed to work with Windows or Mac computers, this external hard drive makes backup a snap just drag and drop
- To get set up, connect the portable hard drive to a computer for automatic recognition no software required
- This USB drive provides plug and play simplicity with the included 18 inch USB 3.0 cable
- The available storage capacity may vary.
| Switch | Purpose |
|---|---|
| /T | Copies the directory tree without copying files. |
| /E | Includes empty folders and all subfolders. |
| /I | Assumes the destination is a directory, avoiding the file-or-directory question when the destination does not yet exist. |
Example:
xcopy "C:\Users\Alex\Documents\Website" "D:\Backup\Website" /T /E /I
This creates the Website directory structure under the destination, including folders that contain no files. It does not copy the files from the source.
Why /E matters
/T alone does not produce a complete structure if the source contains empty directories. Add /E to include them. The /S switch is not a replacement: it copies subdirectories but excludes empty directories.
XCOPY’s destination prompt
If the destination does not exist, does not end with a backslash, and you omit /I, XCOPY may ask:
Does <Destination> specify a file name or directory name on the target (F = file, D = directory)?
Press D to identify it as a directory. Using /I in the standard folders-only command prevents this question.
Rank #2
- 【Versatile Storage Expansion – For Gaming, Work & Everyday Use】 Running out of space on your PS5 or Xbox Series X/S? This external hard drive lets you store and play PS4 / Xbox One games directly, instantly freeing up your console’s internal storage for next‑gen titles. At the same time, it handles work file backups, media libraries, and cross‑device data transfers with ease. One drive, all your needs. *(Note: PS5 / Xbox Series X|S games cannot be run or stored directly from the external hard drive. However, by offloading your PS4 / Xbox One games, you can free up valuable space for newer titles.)*
- 【Patented Silicone Sleeve – Data Protection You Can Count On】 Worried about drops? We’ve got you covered. The patented built‑in silicone sleeve acts like a shock‑absorbing armor, cushioning your drive against bumps and falls. Whether it’s important work documents, precious family photos, or hard‑earned game saves, your data deserves this level of protection.
- 【Plug & Play, Compatible with Computers & Consoles】 No complicated setup—just plug in and go. Works seamlessly with Windows, Mac, and Linux computers, as well as PS4, PS5, Xbox One, and Xbox Series X/S. Process files at the office, back up data at home, or enjoy gaming in your downtime—one drive handles all your devices, simply and hassle‑free.
- 【USB 3.0 Ultra‑Fast Transfer – No More Waiting】 Tired of watching progress bars crawl? With USB 3.0 speeds up to 5Gbps, large files transfer in seconds. Whether you’re moving work documents, transferring hundreds of gigs of games, or backing up a year’s worth of photos, you get more done in less time.
- 【Sleek, Lightweight, and Ready to Go】 Weighing just 0.16 kg—lighter than a can of soda—this compact drive features a stylish mirror‑and‑frosted finish. Toss it in your bag and go, whether you’re heading to the office, visiting a friend for a gaming session, or giving a presentation on the road.
XCOPY limitations and exit codes
XCOPY can report an “insufficient memory” error when a source file or folder path exceeds 255 characters. For more demanding directory trees, ROBOCOPY is usually the better choice.
If you need to check the result in a script, XCOPY returns these documented exit codes:
| Code | Meaning |
|---|---|
| 0 | Files copied without error. |
| 1 | No files were found to copy. |
| 4 | Initialization error, insufficient memory or disk space, invalid drive, or invalid syntax. |
| 5 | Disk-write error. |
Source: Microsoft XCOPY command reference.
Method 2: Copy folders only with ROBOCOPY
ROBOCOPY normally copies files as well as directories, so the file-exclusion switch is essential. Run:
robocopy "C:\Source" "D:\Destination" /E /XF *
Here, /E copies all subdirectories, including empty ones, and /XF * excludes files matching the wildcard *.
Example:
robocopy "C:\Users\Alex\Documents\Website" "D:\Backup\Website" /E /XF *
When the command finishes, the destination contains the source folder structure but not the source files.
The Tool Desk
Outbyte PC Repair FREERepair Windows errors before they cause bigger problemsFix Now →Outbyte Driver Updater FREEScan for outdated or missing drivers - takes under a minuteDriver Scan →Rank #3
- Easily store and access 1TB to content on the go with the Seagate Portable Drive, a USB external hard drive.Specific uses: Personal
- Designed to work with Windows or Mac computers, this external hard drive makes backup a snap just drag and drop. Reformatting may be required for Mac
- To get set up, connect the portable hard drive to a computer for automatic recognition no software required
- This USB drive provides plug and play simplicity with the included 18 inch USB 3.0 cable
- The available storage capacity may vary.
Important ROBOCOPY switches to avoid
| Switch | Why not to use it here |
|---|---|
| /E alone | Includes empty directories, but does not exclude files. Add /XF *. |
| /S | Excludes empty directories. Use /E when every folder must be reproduced. |
| /CREATE | Creates zero-length files as well as the directory tree, so it is not folders-only. |
| /NOCOPY | Is primarily documented for use with /PURGE, not as the normal folders-only command. |
| /MIR | Equals /E plus /PURGE and can delete destination files and folders that are absent from the source. |
| /MOVE or /MOV | Deletes source directories or files after copying. They are inappropriate when the source must remain unchanged. |
Exclude junction points
ROBOCOPY normally includes junction points. A junction can point outside the source tree, potentially causing ROBOCOPY to process directories you did not intend to include.
To exclude all junction points, add /XJ:
robocopy "C:\Source" "D:\Destination" /E /XF * /XJ
To exclude directory junction points specifically, use /XJD instead:
robocopy "C:\Source" "D:\Destination" /E /XF * /XJD
Handle permissions and long paths
If access is denied, /B runs ROBOCOPY in backup mode and can override file and folder ACL restrictions when your account has the required backup privileges. /ZB starts in restartable mode and switches to backup mode if access is denied:
robocopy "C:\Source" "D:\Destination" /E /XF * /ZB
ROBOCOPY supports paths longer than 256 characters by default. Do not add /256 unless you specifically want to turn off long-path support.
Save a ROBOCOPY log
For a large tree or an operation you need to verify later, write the output to a log:
Rank #4
- Easily store and access 4TB of content on the go with the Seagate Portable Drive, a USB external hard drive.Specific uses: Personal
- Designed to work with Windows or Mac computers, this external hard drive makes backup a snap just drag and drop
- To get set up, connect the portable hard drive to a computer for automatic recognition no software required
- This USB drive provides plug and play simplicity with the included 18 inch USB 3.0 cable
- The available storage capacity may vary.
robocopy "C:\Source" "D:\Destination" /E /XF * /LOG:"C:\Temp\folder-structure.log"
The C:\Temp folder must already exist. ROBOCOPY does not create missing parent folders for the log path. Create it first if necessary:
mkdir "C:\Temp"
Interpret ROBOCOPY’s exit code
ROBOCOPY’s exit code is not a simple success-or-failure value. In general:
| Code | Meaning |
|---|---|
| 0 | Nothing was copied and no failure occurred. |
| 1 | All files were copied successfully. For a folders-only operation, the directory work can still complete successfully even though files are excluded. |
| 2–7 | Additional files, mismatches, or combinations of successful operations; these codes do not necessarily indicate failure. |
| 8 or higher | At least one failure occurred. |
Source: Microsoft ROBOCOPY command reference.
Which command should you use?
| Requirement | Recommended command |
|---|---|
| Simple copy of a directory tree, including empty folders | xcopy "C:\Source" "D:\Destination" /T /E /I |
| Long paths, junction control, permissions, logging, or better diagnostics | robocopy "C:\Source" "D:\Destination" /E /XF * |
Use XCOPY when the job is straightforward. Choose ROBOCOPY when the source contains junctions, access restrictions, very long paths, or enough folders that a saved log is useful.
Can File Explorer do this?
Not directly. File Explorer, opened with Start > File Explorer or Windows logo key + E, provides normal Copy and Paste commands for files and folders, but it has no documented command to copy only a folder structure. In Windows 11 version 22H2 and later, the former Quick access landing page is called File Explorer Home; this naming change does not add a folders-only copy feature.
Source: Microsoft File Explorer help.
Verify the destination
- Open the destination in File Explorer.
- Open several nested folders to confirm that the hierarchy was reproduced.
- Check that no files were created.
- If you used ROBOCOPY with /LOG, review the log for errors and confirm that the exit code is below 8.
FAQ
Does XCOPY copy the source files with this command?
No. The /T switch tells XCOPY to copy the directory tree without files. The added /E includes empty directories.
Best Value
- [Upgraded Version] - This external hard drive features a mirrored logo stripe combined with a striped anti-slip design, and the rounded corners of the casing make it easier to grip. The stripes also have a heat dissipation function, ensuring stable and fast data transfer.
- 【Ultra-thin and quiet】 - The motherboard adopts JMicron 578 noise-free solution, giving you a quiet working environment. Lightweight and portable size designed to fit in your pocket for easy portability.
- 【Ultra-Fast Data Transfers】 - Pairing this external hard drive with JMicron 578 solution USB 3.0 and USB 2.0 interfaces enables blazing-fast data transfer. It boasts theoretical read speeds of up to 125MB/s and write speeds of up to 103MB/s.
- 【Plug and Play】 - With no software to install, just plug it in and the drive is ready to use.The hard disk chip is wrapped with an aluminum anti-interference layer to increase heat dissipation and protect data.
- 【What You Get】 - 1 x Portable Hard Drive, 1 x USB 3.0 Cable, 1 x User Manual, Gift-type shell packaging ,Three-year manufacturer's warranty and free technical support services.
Why are some empty folders missing after using XCOPY?
You probably used /T or /S without /E. Use xcopy "C:\Source" "D:\Destination" /T /E /I to include empty directories.
Does ROBOCOPY /E copy folders only?
No. /E copies subdirectories, including empty ones, but ROBOCOPY also normally copies files. Add /XF * to exclude the files.
Will these commands delete files in the destination?
The standard XCOPY and ROBOCOPY commands shown here do not mirror or purge the destination. Do not add ROBOCOPY /MIR, because it can delete destination items missing from the source.
Can I copy the folder structure to another drive?
Yes. Use a destination such as D:\Destination, an external drive letter, or another accessible path. Make sure the destination drive is available before running the command.
What’s actually slowing this PC down?
Pick the symptom - the matching free tool is one click away.
The Bottom Line
For a normal Windows 11 folders-only copy, run:
xcopy "C:\Source" "D:\Destination" /T /E /I
Use ROBOCOPY instead when you need logging, long-path support, junction-point exclusions, or permission-handling options:
robocopy "C:\Source" "D:\Destination" /E /XF *
In both cases, /E preserves empty folders, and the ROBOCOPY command must include /XF * because ROBOCOPY’s default behavior includes files.
Quick Recap
Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.

