Mets Minor League Blog

Music theory, instruments and musicians

Mets Minor League Blog

Music theory, instruments and musicians

How to Fix Directory Not Empty Error 0x80070091 on Windows 11

How to Fix Directory Not Empty Error 0x80070091 on Windows 11

Encountering the “directory is not empty” error with code 0x80070091 on Windows 11 can be frustrating, especially when you’re trying to delete or move folders. This guide provides a clear, step-by-step approach to resolving this issue effectively. Whether you’re managing personal files or troubleshooting system directories, following these instructions will help you regain control over your file management tasks. Before starting, ensure you have administrator rights on your Windows 11 device, as some steps require elevated permissions. Additionally, it’s wise to back up important data to prevent accidental loss during the process.

What You’ll Need

  • Admin access to your Windows 11 PC
  • Basic familiarity with File Explorer and Command Prompt
  • Optional: A backup of your files, in case of accidental deletion

Step-by-Step

  1. Identify the Problematic Folder: Locate the folder that is giving you the “directory is not empty” error. Usually, this happens when deleting or moving folders that contain hidden or system files.
  2. Close All Open Files and Programs: Ensure no files within the folder are open. Close any programs that might be using files inside the directory, as this can prevent deletion.
  3. Use File Explorer to Attempt Deletion: Right-click the folder and select “Delete.” If you receive the 0x80070091 error, proceed to the next step.
  4. Check for Hidden Files: Enable viewing hidden files by clicking on the “View” tab in File Explorer and checking “Hidden items.” Delete any hidden files or folders within the directory that might be preventing its removal.
  5. Use Command Prompt to Force Delete: Open Command Prompt as an administrator. You can do this by pressing Windows key + X and selecting “Windows Terminal (Admin)” or “Command Prompt (Admin).” Then, type the following command:
    rmdir /s /q "C:\Path\To\Your\Folder"

    Replace “C:\Path\To\Your\Folder” with the actual path of the folder you’re trying to delete. Press Enter. This command attempts to delete the folder and all its contents forcefully.

  6. Use Disk Cleanup or CHKDSK to Fix Disk Errors: Sometimes, filesystem errors cause this issue. Run CHKDSK by typing:
    chkdsk C: /f /r

    Replace “C:” with the drive letter where the folder resides. Confirm and restart your PC if prompted.

  7. Try Safe Mode: Boot into Safe Mode by pressing Windows key + R, typing “msconfig,” and navigating to the Boot tab. Check “Safe boot,” then restart. Attempt deletion again in Safe Mode, then revert to normal boot.
  8. Use Third-Party Tools (if necessary): If all else fails, tools like Unlocker or IObit Unlocker can help identify and remove stubborn files or folders that Windows cannot delete normally.

Common Mistakes

  • Trying to delete folders that are still open or in use by running processes.
  • Ignoring hidden or system files that are preventing deletion.
  • Forgetting to run Command Prompt as an administrator, which is necessary for forceful deletions.
  • Not restarting after disk error checks or system changes, which can leave issues unresolved.

Tips

  • Always back up important data before performing force deletions.
  • Use the command line approach with caution, ensuring correct folder paths.
  • Regularly run disk checks to prevent filesystem corruption causing such errors.
  • Keep your Windows 11 updated to benefit from bug fixes that might resolve underlying issues.
  • Use third-party tools only from reputable sources to avoid malware or further system issues.

Troubleshooting

If you’ve followed all steps and still encounter the error, consider the following troubleshooting tips:

  • Reboot in Safe Mode: Sometimes, Safe Mode allows you to delete stubborn folders that normal mode cannot handle.
  • Check for Malware: Malware can lock files or folders, preventing deletion. Run a full system scan with Windows Defender or a trusted antivirus.
  • Perform System File Checker: Corrupted system files can cause errors. Open Command Prompt as administrator and run:
    sfc /scannow
  • Restore Windows: If the problem persists and is recent, consider performing a system restore to revert to a previous state where deletion was successful.

Frequently Asked Questions

1. Why does this error occur?

This error typically occurs when a folder contains hidden or system files, or when files are in use by running processes, preventing deletion.

2. Can I delete system folders with this error?

Deleting system folders is risky and not recommended unless you know exactly what you’re doing. Use caution and consider professional help.

3. Is it safe to use third-party tools to delete folders?

Yes, but only from reputable sources. Always back up your data before using such tools to avoid accidental data loss or malware infection.

4. What should I do if the command prompt method doesn’t work?

Try booting into Safe Mode and repeating the command. If it still fails, use third-party unlocking tools or check for disk errors.

5. How can I prevent this error in the future?

Regularly run disk checks, avoid force closing files, and keep your system updated to minimize filesystem issues that lead to such errors.

6. Will deleting this folder affect Windows stability?

If it’s a system or program folder, deleting it may cause issues. Always verify the folder’s purpose before deletion, and prefer safe methods or professional advice.

Related

How to Fix Directory Not Empty Error 0x80070091 on Windows 11
Scroll to top