How to Fix “Directory is Not Empty” Error 0x80070091 in Windows 10 & 11

If you’ve ever tried to delete a stubborn folder in Windows 10 or 11 and were greeted with the frustrating “Directory is not empty” error, officially known as error 0x80070091, you’re not alone. This problem affects many users who are attempting to remove outdated files, clean up their systems, or uninstall programs. Though it might seem minor, the error can resist normal deletion methods—sometimes even overriding administrator privileges. But don’t worry. In this guide, we’ll provide comprehensive solutions for resolving this issue while keeping your system safe and intact.

What Causes the “Directory is Not Empty” Error?

The error 0x80070091 generally occurs when Windows believes a folder you’re trying to delete is not empty, even when it visually appears so. This can happen due to a variety of issues:

  • Corrupted system files
  • File indexing or search service interference
  • Permissions or access rights issues
  • Virus or malware infection
  • Issues with third-party applications (e.g., antivirus or backup tools)

Understanding the cause is helpful, but sometimes it’s not immediately obvious. So, the following solutions are designed to fix the issue regardless of its root cause.

1. Reboot Your PC in Safe Mode

Before trying more advanced solutions, it’s wise to attempt fixing the issue in Safe Mode. This mode limits background programs and system processes that might be interfering.

  1. Click Start > Press and hold Shift while clicking Restart.
  2. Select Troubleshoot > Advanced options > Startup Settings > Restart.
  3. Once your PC restarts, choose option 4 or F4, to boot into Safe Mode.

Now, try navigating to the folder and delete it again. If this fails, move on to more direct fixes.

2. Use Command Prompt to Force Delete the Folder

You can bypass folder visual glitches and Windows Explorer limitations by using Command Prompt:

  1. Press Windows + S, type cmd, right-click it, and choose Run as administrator.
  2. Type the following command and press Enter:
rd /s /q "C:\Path\To\Folder"

Make sure you replace the path with the actual one intended for deletion.

The /s flag deletes all files and subfolders in the target directory, and /q suppresses confirmation prompts.

3. Run CHKDSK to Fix File System Errors

Sometimes a corrupted file system marks folders as non-empty or locked. Windows comes with a built-in disk checking tool:

  1. Open Command Prompt as Administrator.
  2. Enter the following command:
chkdsk C: /f /r /x

This command tells Windows to:

  • /f – Fix detected errors
  • /r – Locate bad sectors and recover readable info
  • /x – Force dismount of the drive

If the folder is on a different drive, replace C: with the correct drive letter.

4. Use a Live Linux USB Drive

If Windows continues to refuse deletion, you can try using a live Linux USB to bypass Windows file restrictions. Here’s how:

  1. Download a Linux distro like Ubuntu.
  2. Create a bootable USB using tools like Rufus.
  3. Restart your PC and boot from the USB drive.
  4. Navigate to the problematic folder using the Linux file explorer and delete it with ease.

This method is particularly effective when files are locked by the Windows File Explorer or corrupted system processes.

5. Turn Off Indexing Service

Windows Search Indexing can lock directories, making them undeletable. Try turning it off temporarily:

  1. Press Windows + R, type services.msc, then hit Enter.
  2. Scroll down and double-click Windows Search.
  3. Click Stop, then change the Startup type to Disabled.
  4. Attempt folder deletion again.

Don’t forget to re-enable Windows Search once you’ve resolved the problem.

6. Check for Malware

Malware can create hidden or protected files that resist deletion. Run a full scan with your antivirus tool. You can also use Microsoft’s malware removal tool:

  1. Download Microsoft Safety Scanner from the official site.
  2. Run a full system scan to detect and remove harmful files.

After removal, try deleting the folder again.

7. Use a Third-Party Folder Unlocker

Programs like Unlocker, IObit Unlocker, or LockHunter can terminate file locks and allow you to delete problem folders safely.

To use:

  1. Download and install your chosen unlocker program.
  2. Open the program and browse to the directory causing the issue.
  3. Select the folder and choose to unlock and delete it.

These tools are especially helpful when background processes keep folders actively linked, preventing deletion.

8. Modify Folder Permissions

Lack of permission can also trigger error 0x80070091. Here’s how to gain control:

  1. Right-click the folder, select Properties.
  2. Go to the Security tab and click Edit.
  3. Click Add, type your username, then click Check Names.
  4. Grant full control permissions and click Apply.

Once permissions are set, attempt to delete the folder again.

9. Disable System Restore (Temporarily)

Some users report that System Restore locks backup folders, preventing deletion.

  1. Go to Control Panel > System > System Protection.
  2. Select the drive and click Configure.
  3. Choose Disable System Protection and apply the changes.

After deleting the folder, don’t forget to re-enable System Restore to protect your system moving forward.

10. Perform a Clean Boot

Background services can interfere with file operations. A clean boot disables all non-Microsoft services:

  1. Press Windows + R, type msconfig, hit Enter.
  2. Under the Services tab, check Hide all Microsoft services and click Disable all.
  3. Go to the Startup tab and open Task Manager.
  4. Disable all startup items.
  5. Restart your PC and try deleting the directory.

This method helps isolate if the issue is due to third-party applications.

Final Thoughts

The error 0x80070091 – Directory is not empty can be frustrating, but as this article shows, there are multiple strategies to resolve it effectively. You might solve it with a simple Safe Mode reboot or need a more advanced method like using a Linux USB or command-line utility. Whichever approach you choose, make sure to back up important data beforehand—especially when using tools like