The “Directory is not empty” error (0x80070091) usually appears when you try to delete, move, rename, or restore a folder in Windows. It’s especially common during file deletion, System Restore, or when working with OneDrive / backup folders. Even though the folder looks empty, Windows insists it isn’t—and blocks the action.
If you’re seeing this error on Windows 11, the problem is almost always caused by hidden files, corrupted directory metadata, file locks, or permission issues, not by actual data still being present.
This guide walks you through all proven fixes, from simple to advanced, with clear explanations for each step.
Why Error 0x80070091 Happens
Windows throws this error when it cannot safely modify a folder. Common causes include:
- Hidden or system files inside the folder
- Corrupted file system metadata
- Files locked by background processes
- OneDrive or backup sync conflicts
- Permission or ownership issues
- File Explorer glitches
- Errors left behind after failed restore or update operations
The fixes below target each cause directly.
Fix “Directory Is Not Empty” Error 0x80070091 on Windows 11
Follow the steps in order. After each method, retry the action that caused the error.
1. Restart File Explorer and Try Again
This clears temporary file locks.
- Press Ctrl + Shift + Esc to open Task Manager.
- Scroll down and find Windows Explorer.
- Right-click it and choose Restart.
- Wait for the desktop to reload.
- Try deleting or modifying the folder again.
This often fixes the issue if Explorer was holding a lock.
2. Show Hidden and System Files
The folder may not actually be empty.
- Open File Explorer.
- Click View → Show → Hidden items.
- Click View → Options → View tab.
- Uncheck Hide protected operating system files.
- Click Apply → OK.
Now open the problematic folder:
- If you see files, delete them manually
- Then try deleting the folder again
Re-enable protected files afterward for safety.
3. Delete the Folder Using Command Prompt (Very Effective)
Command Prompt bypasses many Explorer limitations.
- Right-click Start and choose Terminal (Admin) or Command Prompt (Admin).
- Run:
rmdir /s /q "FullFolderPath"Example:rmdir /s /q "C:\Users\YourName\Documents\ProblemFolder"
/sremoves all contents/qforces deletion without prompts
If this works, the error was Explorer-related.
4. Check for Locked Files Using Resource Monitor
A background process may be using the folder.
- Press Windows + R, type
resmon, and press Enter. - Go to the CPU tab.
- Expand Associated Handles.
- Type the folder name in the search box.
- If a process appears:
- Close that app
- Or restart the PC
Afterward, retry the operation.
5. Temporarily Pause OneDrive or Backup Sync
Cloud sync tools often lock folders.
- Click the OneDrive icon in the system tray.
- Click Settings → Pause syncing.
- Choose 2 hours (or more).
- Retry deleting or modifying the folder.
If this works, the folder was being actively synced.
6. Take Ownership and Fix Permissions
Permission issues can cause false “not empty” errors.
- Right-click the folder and choose Properties.
- Go to the Security tab.
- Click Advanced.
- Click Change next to Owner.
- Enter your username and click Check Names → OK.
- Check Replace owner on subcontainers and objects.
- Apply changes and close all dialogs.
Now try the operation again.
7. Run Disk Check (Very Important for Corruption)
File system corruption is a common cause of error 0x80070091.
- Open Command Prompt (Admin).
- Run:
chkdsk C: /f - If prompted, type Y and press Enter.
- Restart your PC and let the scan complete.
If the folder is on another drive, replace C: with the correct letter.
8. Use Safe Mode to Remove the Folder
Safe Mode prevents most services from locking files.
- Open Settings → System → Recovery.
- Click Restart now under Advanced startup.
- Go to:
- Troubleshoot → Advanced options → Startup Settings
- Restart and press 4 for Safe Mode.
- Delete the folder.
- Restart normally.
This is very effective for stubborn folders.
9. Fix System Files (If Error Appears During Restore or Update)
If the error appears during System Restore, system files may be damaged.
- Open Command Prompt (Admin).
- Run:
sfc /scannow - After it completes, run:
DISM /Online /Cleanup-Image /RestoreHealth - Restart Windows and try again.
10. Rename the Folder First, Then Delete It
Renaming can break file locks.
- Right-click the folder and choose Rename.
- Rename it to something simple (e.g.,
temp123). - Delete the renamed folder.
Surprisingly effective in many cases.
When Error 0x80070091 Appears During System Restore
If this error occurs specifically during System Restore, it often involves:
- Corrupted restore points
- Locked user profile folders
In such cases:
- Try restoring from a different restore point
- Or run System Restore from Advanced Startup
Wrapping Up
The “Directory is not empty” error 0x80070091 in Windows 11 is usually caused by hidden files, file locks, permission issues, or file system corruption—not because the folder actually contains visible data. By revealing hidden files, deleting the folder via Command Prompt, fixing permissions, and running disk checks, you can resolve the issue in almost all cases.
If the folder still refuses to go away, Safe Mode and disk repair tools are the final and most reliable solutions.