Home > How to Tips

[Warning] Error 0x80070091: The directory is not empty

Updated on Tuesday, May 7, 2024

iBoysoft author Eudora Liu

Written by

Eudora Liu
Professional tech editor

Approved by

Jessica Shee

English Français Deutsch やまと Español Português

Fix Error 0x80070091 on Windows 7/8/10/11

Summary: If your computer is prevented from deleting folders, you may receive the error message Error 0x80070091: The directory is not empty. Don't be upset. This post explains what causes this error and offers you six methods to fix it.

Fix Error 0x80070091 on Windows

It's common for every computer user to write or read data on their computer. But you may receive an error prompt 'An unexpected error is keeping you from deleting the folder. Error 0x80070091: The directory is not empty.'

Like the error message described, you can't delete the folder you tried to delete. However, you may be confused about the error message 'The directory is not empty.'

If you are prevented from deleting your folder on your Windows 7/8/10/11, you are in the right place. Reading the following context and try to resolve Error 0x80070091 on Windows 7/8/10/11.

Have you received the error message on your Windows 7/8/10/11 we mentioned above? If yes, keep reading and find the solutions you want. Don't forget to share this tutorial on your social media.


What is Error 0x80070091 and what causes it?

Error 0x80070091 mainly occurs when you try to delete the folder from an external hard drive, SD card, or pen drive, sometimes, it can also happen on the system drive. It can be found on the computer running Windows 7 all the way up to Windows 11.

Except you could receive this error code when you try to delete a folder, you may also receive the error code 'System Restore failed while restoring the directory from the restore point. An unspecified error occurred during System Restore. (0x80070091)' when you use System Restore to take your computer back to any specified point in time that you have created before.

If you receive this message when using System Restore, it prevents you from successfully conducting a System Restore.

Although there is no exact reason to explain why this error occurred, there are still some possible reasons you can take as a reference:

  • Corrupted system files
  • Corrupted or damaged hard drives
  • Bad sectors on your drive
  • Excessive junk files in the temporary folder
  • Insufficient folder permission
  • Virus or malware infection

How to fix error 0x80070091 on Windows 7/8/10/11?

Sometimes, you can resolve this error by renaming this folder, but in most situations, this method is unavailable. This error might be a humble issue at first, but it can prevent you from performing many operations on your computer. Therefore, it's important for you to fix it as soon as possible.

Use Command Prompt to delete folders

Command Prompt is a default command-line interpreter for the Windows operating system, using text commands to interact with a computer. Command Prompt gives users another way to delete folders in Windows without issues. Using the CMD to delete folders might be a little complicated and more like a workaround, but it will help you delete folders successfully if it works.

  1. Press Win + Q to type in Command Prompt in the search box.
  2. Right-click it in the search result and choose Run as administrator. (Or you can press Win + Shift + Enter to open it with administrator privileges.)
  3. Type in the following commands and press Enter to run. Replace Folder Path with the location of the folder you want to delete, which must include the drive letter.rmdir /s "Folder Path"

Use Command Prompt to delete folders

Restart Windows File Explorer

Windows File Explorer is a file manager that allows users to manage files, folders, and network settings, as well as search for files and related components. So you can try restarting Windows Explorer and check whether you can delete the folder or not.

Closing and reopening the Windows Explorer windows will not restart it, you need to do the following:

  1. Simultaneously press Ctrl + Alt + Del to open the Security Options window.
  2. Select Task Manager from the list.
  3. Choose the Process tab and find File Explorer.
  4. Right-click File Explorer and then click Restart. (Or you can select File Explorer and click Restart at the right bottom of the window.) 
    Restart Windows File Explorer

Run System File Checker

One of the reasons that cause error 0x80070091 is corrupted system files, while System File Checker (SFC) will verify the integrity of specific Windows system files and repair corrupted system files automatically. Hence, try running SFC to repair the incorrect versions of the system files and fix the error.

  1. Click the search icon in the taskbar and then type in Command Prompt in the search box.
  2. Right-click Command Prompt and choose Run as administrator.
  3. Type in the following command.sfc/scannow

Run System File Checker

Wait for the process to finish and make sure you don't close the Command Prompt window or shut down your PC during the process.


In addition to missing or corrupted files may cause this error, bad sectors on your drive could cause this error as well. Thus, run CHKDSK to try repairing the bad sectors on the drive.

  1. Do the same operations above to run Command Prompt.
  2. Type in the following command and press Enter to run.chkdsk /f /r X:


Replace X with the letter of the storage disk where you store the affected files. After that, your computer will restart and perform the task. Wait for the CHKDSK stage to finish and retry deleting the folder to check whether error 0x80070091 has been fixed.

Change the permissions of the files or folders

Insufficient folder permission may prevent your computer from deleting folders. Set the full permission for the affected folders using the following steps:

  1. Right-click the affected folder and choose Properties in the pop-up list.
  2. Choose the Security tab and then click Advanced.
  3. Click Change next to Owner.
  4. Type in the name of your administrative account in the box under the Enter the object name to select section.
  5. Click Check Names and OK to confirm. 
    Change the permissions of the files or folders
  6. Select Replace Owner on subcontainers and objects.
  7. Click Apply and OK to confirm.

Scan the computer for viruses

If your computer was infected by viruses or malware and started receiving the error message when you delete folders, you can scan your computer using Windows Defender.

  1. Click the Windows icon in the left bottom of the desktop or you can press the Win key on your keyboard.
  2. Go to Settings > Update & Security > Windows Defender.
  3. Click Open Windows Defender Security Center.
  4. Choose Virus & threat protection and then select Advanced scan
    Scan the computer for viruses
  5. Choose Windows Defender Offline scan and then choose Scan now.

Have you deleted folders on your PC successfully by using the above solutions? If you have, don't forget to share these useful methods with people who need them.