How to Fix the “Directory Is Not Empty” Error 0x80070091 on Windows 11

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.

  1. Press Ctrl + Shift + Esc to open Task Manager.
  2. Scroll down and find Windows Explorer.
  3. Right-click it and choose Restart.
  4. Wait for the desktop to reload.
  5. 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.

  1. Open File Explorer.
  2. Click View → Show → Hidden items.
  3. Click View → Options → View tab.
  4. Uncheck Hide protected operating system files.
  5. 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.

  1. Right-click Start and choose Terminal (Admin) or Command Prompt (Admin).
  2. Run: rmdir /s /q "FullFolderPath" Example: rmdir /s /q "C:\Users\YourName\Documents\ProblemFolder"
  • /s removes all contents
  • /q forces 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.

  1. Press Windows + R, type resmon, and press Enter.
  2. Go to the CPU tab.
  3. Expand Associated Handles.
  4. Type the folder name in the search box.
  5. 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.

  1. Click the OneDrive icon in the system tray.
  2. Click Settings → Pause syncing.
  3. Choose 2 hours (or more).
  4. 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.

  1. Right-click the folder and choose Properties.
  2. Go to the Security tab.
  3. Click Advanced.
  4. Click Change next to Owner.
  5. Enter your username and click Check Names → OK.
  6. Check Replace owner on subcontainers and objects.
  7. 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.

  1. Open Command Prompt (Admin).
  2. Run: chkdsk C: /f
  3. If prompted, type Y and press Enter.
  4. 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.

  1. Open Settings → System → Recovery.
  2. Click Restart now under Advanced startup.
  3. Go to:
    • Troubleshoot → Advanced options → Startup Settings
  4. Restart and press 4 for Safe Mode.
  5. Delete the folder.
  6. 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.

  1. Open Command Prompt (Admin).
  2. Run: sfc /scannow
  3. After it completes, run: DISM /Online /Cleanup-Image /RestoreHealth
  4. Restart Windows and try again.

10. Rename the Folder First, Then Delete It

Renaming can break file locks.

  1. Right-click the folder and choose Rename.
  2. Rename it to something simple (e.g., temp123).
  3. 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.

Posted by Arpita

With a background in Computer Science, she is passionate about sharing practical programming tips and tech know-how. From writing clean code to solving everyday tech problems, she breaks down complex topics into approachable guides that help others learn and grow.