Fix The Directory is not empty “Error 0x80070091” in Windows 11 or 10

Methods to solve Error 0x80070091: The Directory is not empty in Windows 10 and 11.

0x80070091

Are you seeing the vexing error 0x80070091 when attempting to remove files on your Windows 10 or 11 system? This perplexing File Explorer bug displays the deceptive “The directory is not empty” message, obstructing your folder deletion efforts. Surprisingly, even seemingly empty directories cause this issue, exacerbating the situation.

Not to worry, there is a solution. While simple folder renaming may provide temporary relief, more robust options are available in this blog. Investigate the following techniques to gently handle this issue and finally bid farewell to stubborn folders.

The directory is not empty Error 0x80070091 in Windows 10 or 11

Here is how to fix the directory is not empty Error 0x80070091 in Windows 10 or 11:

Run SFC Scan and DISM Commands

To rectify the Directory is Not Empty error 0x80070091, utilizing the System File Checker and Deployment Image Servicing and Management command line tools is the best and easiest step.

SFC scan can meticulously examine and repair corrupted or missing system files and replace their copy from %WinDir%\System32\dllcache folder that might be causing the problem. On the other hand, the DISM functions to fix system image issues, further bolstering the Windows’ health.

  1. Click on Start and type cmd.exe.
  2. Select Run as administrator.
  3. User account control prompt appears; click on Yes.
  4. Type the following command and press EnterSFC /SCANNOW
  5. After you see “Windows Resource Protection did not find any integrity violations.”, reboot the device.
  6. Go to “Settings > Windows Update” and click on “Check for updates”.
  7. If the process fails and error code 0x80070091 shows then open “Administrator: Command Prompt” again.
  8. Then execute the following command lines sequentially:
DISM /Online /Cleanup-Image /CheckHealth
DISM /Online /Cleanup-Image /ScanHealth
DISM /Online /Cleanup-Image /RestoreHealth
how to fix Directory is Not Empty Error 0x80070091 in Windows 10 or 11
  1. After all the 3 commands are finished running restart the computer.
  2. Now check for updates and see if it is successfully installed.

Read: SFC /Scannow, DISM.Exe, CHKDSK Windows 11 or 10.

Restart Windows Explorer

A simple yet effective remedy to solve the 0x80070091 error code in your system is by restarting Windows File Explorer. This action will refresh your explorer’s processes, often resolving the error and allowing hassle-free folder deletions. The steps are mentioned below:

  1. Access Task Manager by pressing Ctrl + Shift + Esc.
  2. Locate Windows Explorer in Processes.
  3. Right-click on this and select Restart.
Restart Windows Explorer from Task Manager Context menu

Reference: How to Restart File Explorer Using Task Manager in Windows 10

Use Command Prompt to Remove Folders

Deleting the problematic folder using the Command lines provides a potential way for solving The Directory is Not Empty error 0x80070091 in your Windows system. By directly navigating the system’s file structure, this method sidesteps the error message and allows successful folder removal.

  1. Press Winkey and type cmd.
  2. Copy and paste the cd command to reach the folder’s location. (Remember to replace Pathtoyourfolder with the path of your folder).
cd C:\Pathtoyourfolder
  1. Press Enter.
  2. Then run the following command in the same way:
rmdir /s /q Yourfoldername

Note: /s will erase all content, including the folder, and /q will suppress confirmation prompts.

  1. If prompted, type Y and press Enter to confirm.

Read: How to Forcibly Delete Files on Windows 10

Perform a Disk Scan to Uncover Errors

If you are yet to find a way to fix the error code 0x80070091 on your Windows you might scan your disk for errors to potentially identify and rectify underlying issues that trigger this error. Follow these steps:

  1. Open Command Prompt as Admin as mentioned in the previous method.
  2. Enter the Check Disk command, and press Enter:
CHKDSK /F /R /X
fix Directory is Not Empty Error 0x80070091
  1. Press Y to schedule the scan on restart.
  2. In the end, click Start > Power > Restart.

Run Antivirus Scan

Curious, if your Windows antivirus scan holds the solution to tackle the concerned error? It very well could! By initiating an antivirus scan, you’re taking a proactive step to detect and remove potential malware causing this glitch.

  1. Click on Search and type Windows Security.
  2. Press Enter.
  3. Go to Virus & Threat Protection > Scan options.
  4. Choose Full Scan (comprehensive but lengthy).
  5. Click on Scan now to start the antivirus scan.
Windows defender virus & threat protection scan options full scan
  1. Wait and Remove if detection finds threats.
  2. Click Start actions to apply.

Adjust Folder Permissions

You can also try to modify the folder’s permissions by adjusting permissions, you’re granting the necessary access to erase files, potentially putting an end to the error code’s 0x80070091 reign. Follow these steps:

  1. Open File Explorer (Winkey+E) and right-click the affected folder.
  2. Choose Properties.
  3. Click the Security tab.
  4. Press the Advanced button.
  5. Click Change by Owner name.
  6. Enter the Windows user account name in the object name box.
  7. Select Check Names, then OK.
  8. Check the box Replace all child object permission entries with inheritable permission entries from this object.
  9. Press Apply and OK in the Advanced Security Settings window.
Directory is Not Empty Error 0x80070091

See: How to Change File Permission to Grant Ownership in Windows 10

Use Installation Media External Drive to delete the folder

Some users report that using installation media in external drive helps them to remove the directory without getting error 0x80070091. Move forward with the steps:

  1. Insert the installation media into the port of your computer.
  2. On the initial setup screen, select your language and other preferences, and then click on “Next”.
  3. Then click on “Repair your computer”.
  4. When Choose an option screen appears, go to Troubleshoot > Advance Option > Command Prompt.
  5. Type notepad on Command Prompt and hit Enter.
  6. On the Notepad, click on File > Open.
  7. Then, select All files from the drop-down and browse the location where the folder is located.
  8. Right-click on the folder and select Delete.

Use Windows Recovery Environment

Windows Recovery Environment (RE) can be a valuable ally in combating persistent startup errors, especially the Directory is Not Empty Error 0x80070091. This particular solution within Windows is equipped with a plethora of tools for repairing and troubleshooting common system startup issues.

  1. Type system restore in the search.
  2. Hit Enter.
  3. Click on System Restore…
  4. Click Next on the wizard.
  5. Choose a restore point, and click “Next“.
  6. Then, select Finish on the wizard to complete.
  7. On the warning popup, click on Yes.

Start in Safe Mode

Find respite from the troubling error code in your Windows through a simple approach which is rebooting into Safe Mode as it can help you in creating a conducive environment to tackle the error head-on, ensuring a smooth path for folder management.

  1. Open the Start menu, and press the Shift key.
  2. Click the power icon, and select Restart.
  3. You will see the WinRe environment after the restart.
  4. Choose Troubleshoot > Advanced options.
  5. Select Startup Settings, and click Restart.
  6. Press number four or F4 on the next screen.
  7. You’re now in Safe Mode.
  8. Delete the troubling folder.
  9. Reboot the PC to return to normal mode.

We hope with these 9 ways you will be able to Fix The Directory is Not Empty Error 0x80070091 in your Windows 10 or 11.

Methods:
Run SFC Scan and DISM Commands
Restart Windows Explorer
Use Command Prompt to Remove Folders
Perform a Disk Scan to Uncover Errors
Run Antivirus Scan
Adjust Folder Permissions
Use Installation Media External Drive to delete the folder
Use Windows Recovery Environment
Start in Safe Mode

That’s all!!

Sharing is caring    Share Whatsapp

 
Topics:  Windows