How to fix “Directory is Not Empty” error 0x80070091 in Windows 10 and 11 – WP Reset

How to fix “Directory is Not Empty” error 0x80070091 in Windows 10 and 11 – WP Reset

4 minutes, 45 seconds Read

Encountered error code 0x80070091 can be frustrating, especially if you try to delete a folder in Windows 10 or 11 and receive the message that the “Folder is not empty.” Fortunately, this problem is relatively common and there are several solutions that can help solve the problem. This error usually occurs when Windows thinks the folder is still in use, is corrupted, or contains hidden or locked files.

This article provides a detailed guide to troubleshoot and resolve the ‘Folder is not empty’ error in Windows 10 and 11 using various methods. Whether you are a beginner or an advanced user, you will find step-by-step instructions here that will help you solve the problem efficiently.

Common causes of error 0x80070091

Before diving into the solutions, it is helpful to understand what could be causing the problem. Some common reasons are:

  • File system corruption
  • Running background processes that use the folder
  • Directory rights or ownership conflicts
  • Hidden system files in the folder
  • Malware or antivirus software interference

How to fix the ‘Folder is not empty’ error

1. Restart your computer

Before attempting complex solutions, restart your computer. A restart can often kill background processes that may be using the folder so you can delete them later.

2. Use Command Prompt to force removal

Using the Command Prompt gives you more control over system operations. To manually delete a folder via CMD:

  1. Search for “Command Prompt” in the Start menu.
  2. Right click on it and choose “Run as administrator.”
  3. In the command prompt window, type:
    rd /s /q "C:\Path\To\Folder"
    Replace C:\Path\To\Folder with the actual path of the folder you want to delete.

Remark: This command will forcefully delete the folder and all its contents without prompting you for confirmation.

3. Check for hidden files

Sometimes hidden files or system files prevent a folder from being recognized as empty.

  1. Open File Explorer and navigate to the appropriate folder.
  2. Click on the Display and tab enable ‘Hidden Items’.
  3. If you see any files appear, delete them before trying to delete the folder again.

4. Use safe mode

Windows Safe Mode loads only essential system drivers and services, allowing you to delete folders that are otherwise in use.

To boot into Safe Mode:

  1. Press Win + R and type msconfigand then press Enter.
  2. Under the Boot tab, check “Safe boot” and select ‘Minimal’.
  3. Click OK and restart your computer.
  4. Try deleting the problematic folder again.
  5. After uninstalling, return to msconfig and disable “Secure Boot” to boot normally.

5. Use CHKDSK to fix file system errors

Corrupted file systems can cause deletion errors. Running CHKDSK can resolve these issues:

  1. Open Command Prompt as administrator.
  2. Type the following command:
    chkdsk /f /r C:
  3. If you are asked to schedule the scan on the next restart, type Y and press Enter.
  4. Restart your PC and let the scan complete.

Once your system has restarted, try deleting the folder again.

6. Scan for malware

Some malware can prevent folders from being deleted. Use Windows Defender or a third-party antivirus program to scan your PC.

  • Open Windows security from the Start menu.
  • Go to Protection against viruses and threats.
  • Run one Full scan to detect and remove malicious software.

After the scan, try deleting the folder again.

7. Take ownership of the folder

A lack of ownership rights can block takedown attempts. To become an owner:

  1. Right-click on the folder and select Properties.
  2. Go to the Security tab and click Advanced.
  3. Click Change next to Owner.
  4. Type your username, click Check namesand then OK.
  5. Bill “Replace owner of subcontainers and objects.”
  6. Click Apply and then OK.

Set permissions

8. Use a third-party tool

If you are still having problems, you can use third-party tools such as Unlocker or Unlock IT can help remove stubborn files and folders.

These apps identify processes that are locking the directory and terminate them so that you can safely proceed with the deletion.

9. Restore default Windows permissions with DISM

Corrupted permissions can sometimes cause the error 0x80070091. Use DISM to restore system health:

  1. Open Command Prompt as an administrator.
  2. Type the following command:
    DISM /Online /Cleanup-Image /RestoreHealth
    Then press Enter.
  3. Wait for the process to complete and then restart your PC.

10. Delete folder via PowerShell

PowerShell provides another method to forcibly delete folders.

  1. Search for Windows PowerShell and run it as Administrator.
  2. Enter the following command:
    Remove-Item -Path 'C:\Path\To\Folder' -Recurse -Force
  3. Replace C:\Path\To\Folder with your destination folder path.

Frequently Asked Questions (FAQ)

  • Question: What does error 0x80070091 mean in Windows?
    A: This code usually indicates that the folder is not empty, even though it may appear to be so. It is often the result of hidden files, system corruption, or permission errors.
  • Question: Is it safe to delete folders using CMD or PowerShell?
    A: Yes, as long as you are sure of the path. Errors can lead to data loss, so double-check before executing any commands.
  • Question: Why can’t I delete a folder even in safe mode?
    A: If folder deletion fails even in safe mode, you may be dealing with disk corruption or malware. Use CHKDSK and antivirus scans to address deeper issues.
  • Q: What is the best third party tool to fix folder deletion errors?
    A: Reliable tools such as Unlocker or IObit unlocker are commonly used to remove locked folders and fix error 0x80070091.
  • Question: Can I prevent this problem in the future?
    A: Regular system maintenance, disk scans, and avoiding force shutdowns can help prevent file system errors that cause this problem.

By following the steps described above, users can effectively troubleshoot and resolve issues “Folder is not empty” error in Windows 10 and 11. Always proceed with caution, especially when using command-line tools or manipulating system files and permissions.

#fix #Directory #Empty #error #0x80070091 #Windows #Reset

Similar Posts

Leave a Reply

Your email address will not be published. Required fields are marked *