How to Fix ‘The Directory Is Not Empty’ (Error 0x80070091) in Windows 11

Attempting to delete, move, or rename a folder in Windows 11 can occasionally be halted by an unexpected operating system alert: ‘An unexpected error is keeping you from deleting the folder. Error 0x80070091: The directory is not empty.’ Opening the problematic folder frequently reveals that it appears completely vacant, with zero visible files or subdirectories. Despite appearing empty, the NTFS file system index continues to register unallocated or orphaned file clusters, preventing the shell from unlinking the folder structure.

What Causes Error 0x80070091 in Windows 11?

The 0x80070091 error represents an NTFS or FAT32 master file table (MFT) indexing inconsistency. Common triggers include:

  • Corrupted NTFS File System Records: Sudden power loss, system crashes, or unmounting external drives while write caching is active, leaving orphaned record entries in the folder’s file table.
  • Hidden, System, or Locked Attribute Files: Hidden files (such as desktop.ini, Thumbs.db, or temporary lock files) remaining inside the directory that standard File Explorer views do not display.
  • Damaged WindowsApps or Package Folders: Residual folders left behind by uninstalled Windows Store applications with locked security descriptors.
  • Antivirus or Background Process File Handles: Background indexing or antivirus services maintaining an open read handle on a hidden file inside the directory.
  • Bad Disk Sectors: Physical storage sector degradation preventing the disk controller from committing folder deletion updates.

Step 1: Reveal Hidden and Protected Operating System Files

Ensure that hidden system files are made visible so they can be deleted individually.

  1. Open File Explorer (Win + E).
  2. Click the View dropdown menu on the top toolbar.
  3. Hover over Show and tick Hidden items.
  4. Click the three dots (…) on the command bar and select Options.
  5. Switch to the View tab.
  6. Scroll down and uncheck Hide protected operating system files (Recommended). Click Yes when the security confirmation appears, then click OK.
  7. Open the problematic directory. If any hidden files (such as desktop.ini or temporary application files) appear, delete them manually.

Step 2: Run Check Disk (CHKDSK) to Repair the File System

Running CHKDSK is the most effective resolution for Error 0x80070091 because it scans the NTFS Master File Table and unlinks corrupted directory records.

  1. Press the Start button, type cmd, right-click Command Prompt, and select Run as administrator.
  2. Type the following command (replace C: with the drive letter containing the problematic folder):
    chkdsk C: /f /r
  3. If checking the system drive (C:), the utility will prompt: ‘Would you like to schedule this volume to be checked the next time the system restarts? (Y/N)’.
  4. Type Y and press Enter.
  5. Restart your computer. Windows will perform disk verification during the boot sequence, repairing invalid index records and clearing orphaned folder pointers.
  6. Once back on the desktop, delete the folder; it will disappear immediately.

Step 3: Force Delete the Directory via Command Prompt

Command-line deletion tools bypass Explorer shell hooks and remove stubborn directories directly.

  1. Open Command Prompt as administrator.
  2. Type the rmdir command followed by the recursive and quiet flags, wrapping the full path in quotes:
    rmdir /s /q "C:\path\to\problematic_folder"
  3. Press Enter. The /s parameter removes all subdirectories and hidden files, while /q suppresses confirmation dialogues.

Step 4: Take Ownership and Reset Permissions

If access restrictions prevent folder unlinking, reclaim ownership using the takeown utility.

  1. In administrative Command Prompt, run:
    takeown /F "C:\path\to\folder" /r /d y
  2. Next, grant full administrative access rights:
    icacls "C:\path\to\folder" /grant administrators:F /t
  3. Attempt to delete the directory again using File Explorer or rmdir.

Step 5: Delete the Folder from Windows Safe Mode

If third-party background drivers maintain locked handles on the directory, Safe Mode isolates active interference.

  1. Press Win + I to open Settings.
  2. Navigate to System > Recovery.
  3. Next to Advanced startup, click Restart now.
  4. After rebooting to the recovery screen, select Troubleshoot > Advanced options > Startup Settings > Restart.
  5. Upon reboot, press 4 or F4 to enter Safe Mode.
  6. In Safe Mode, open File Explorer and delete the folder. Reboot normally once finished.

Get the best tech tips delivered straight to your inbox.

Join thousands of readers mastering Apple, Google, Microsoft, and Linux.