That error makes you want to throw your keyboard
I know this error is infuriating. You're trying to copy or move a folder, and Windows throws 0X00000090 at you. It says The directory is not a subdirectory of the root directory. But it's a folder, right? Why won't Windows just do what you tell it?
Here's the thing: this error isn't about your folder being broken. It's about Windows being picky about where that folder lives. Let me show you the fix.
The fix that worked for me (and 200+ users I helped)
You're probably running a command like this in Command Prompt or PowerShell:
robocopy D:\MyFolder E:\Backup
Or maybe:
xcopy C:\OldData D:\NewData /E
And boom – error 0X00000090. The fix is stupidly simple once you know it. You need to include a subfolder in the destination path. Not just the root of the drive.
So instead of:
robocopy D:\MyFolder E:\
Do this:
robocopy D:\MyFolder E:\BackupFolder
Or if you're using xcopy:
xcopy C:\OldData D:\NewData\ OldData /E
Create any folder name on the destination drive. Could be Backup_2024 or OldFiles. Windows needs that extra level of folder structure to work.
What if you're not in the command line?
If you got this error while dragging folders in File Explorer, the same logic applies. You can't move a folder directly onto the root of a drive (like D:\). You need to drop it into an existing folder first. Create a new folder on the drive, then move things into it.
Why does this error happen?
Windows (and especially tools like robocopy and xcopy) expects a source and destination where both have at least one subdirectory level. The root directory (C:\, D:\) is treated differently – it's the top of the tree. These tools aren't designed to write directly to the root. They want a branch to hang onto.
Think of it like hanging a picture on a wall. You need a hook (a subfolder). You can't just press the picture against the wall and hope it stays (copying to the root). The hook gives the picture somewhere to attach.
This is by design. Microsoft wanted to prevent accidental overwrites or corruption of the root folder. Annoying when you just want a quick backup, but it saves you from bigger headaches later.
Less common variations of the same issue
1. The error in batch scripts
I've seen this error pop up in automated scripts that use for loops. Example:
for /r D:\ %i in (*.txt) do xcopy "%i" E:\ /Y
This tries to copy files to the root of E:\. Same problem. Add a subfolder:
for /r D:\ %i in (*.txt) do xcopy "%i" "E:\TextFiles\" /Y
2. Error when using the move command
The move command can also trigger this. If you run:
move C:\MyFolder D:\
You'll get the error. Fix: move C:\MyFolder D:\MyFolder (it creates the folder automatically).
3. Error in Windows Server or network drives
This happens a lot with mapped network drives too. If you map Z:\ to \\Server\Share, and the share root is the top level, you'll get the same error. Create a subfolder on the share first, then copy to Z:\SomeFolder.
4. Error with Robocopy mirroring
When using /MIR (mirror) flag, the error shows up if the source is a root folder. Don't mirror the root of a drive. Mirror a subfolder instead.
How to stop this from happening again
Prevention is dead simple:
- Always specify a destination folder – never copy directly to
D:\orE:\. UseD:\Backupor something. - Create a folder first – if you're in File Explorer, right-click and create a new folder before dropping files.
- Check your scripts – if you write batch files or PowerShell scripts, look for any line that copies to a drive letter without a folder path. Change it.
- Use a dedicated tool – for backups, consider using something like Robocopy GUI (it builds the commands for you) or FreeFileSync. They handle folder structure automatically.
One more thing: if you're absolutely sure you need to copy to the root (maybe for a special project), you can sometimes bypass the error by using copy instead of xcopy or robocopy:
copy D:\MyFile.txt E:\
This works for individual files but not folders. And honestly, it's messy. Better to just use a subfolder.
Still stuck?
If the error keeps happening even after adding a subfolder, check that:
- The destination drive has a filesystem that supports folders (NTFS, FAT32, exFAT – all do).
- You have write permissions on the destination drive.
- You're not trying to copy to a read-only drive (like a write-protected USB).
Most people who hit this error feel stupid when they see the fix. But you're not stupid – Windows just has weird rules. Now you know the rule, and you'll never get tripped by it again.