If you’ve encountered the “Directory is Not Empty” error with code 0x80070091 on Windows 10 or 11, you’re likely trying to delete, move, or rename a folder that Windows refuses to modify. This error can be frustrating, especially when it prevents you from cleaning up your files or reorganizing your data. Fortunately, with some straightforward troubleshooting steps, you can resolve this issue and regain control over your directories. This guide walks you through the necessary preparations, specific steps, common pitfalls, and additional tips to fix the error effectively.
What You’ll Need
- A Windows 10 or Windows 11 PC with administrator rights
- Access to File Explorer
- Optional: Command Prompt with administrator privileges
- Backup of important data (recommended before making significant changes)
Step-by-Step
- Close all open programs and restart your computer. Sometimes, the error occurs due to files being in use. Restarting can release any locks on the folder.
- Identify the problematic folder. Note its location and name. Ensure that no files within it are open or in use by other applications.
- Check for hidden files or system files. Enable hidden files in File Explorer by clicking on the “View” tab and checking “Hidden items.” Delete or move any hidden files inside the folder.
- Attempt to delete or move the folder normally via File Explorer. If you still see the error, proceed to the next step.
- Use Command Prompt to delete the folder:
- Right-click the Start menu and select “Windows Terminal (Admin)” or “Command Prompt (Admin)”.
- In the command window, type:
rmdir /S /Q "C:\Path\To\Your\Folder"and press Enter. Replace the path with your folder’s actual location. - If the folder contains files or subfolders, the /S switch ensures all are deleted quietly.
- If command line deletion fails, try Safe Mode:
- Open Settings > Update & Security > Recovery.
- Under “Advanced startup,” click “Restart now.”
- Navigate to Troubleshoot > Advanced options > Startup Settings > Restart.
- After reboot, press 4 to select Safe Mode.
- Repeat the command prompt deletion process in Safe Mode.
- Run the System File Checker (SFC) to repair potential file system issues:
- Open Command Prompt as administrator.
- Type:
sfc /scannowand press Enter. - Wait for the scan to complete and follow any prompts.
- Use Disk Cleanup or Check Disk utility to fix disk errors:
- Open Command Prompt as administrator.
- Type:
chkdsk /f /r C:(replace C: with your drive letter) and press Enter. - Schedule the check if prompted, then restart your PC.
- Ensure no malware or antivirus conflicts. Run a full system scan with Windows Defender or your preferred antivirus software.
- Use third-party tools like Unlocker or FileASSASSIN if standard methods fail. These tools can forcibly delete stubborn folders.
Common Mistakes
- Not closing all programs that might be using files within the folder, leading to persistent lock issues.
- Attempting to delete the folder without administrative privileges, which can restrict access.
- Ignoring hidden or system files that might be preventing deletion.
- Using the wrong path in command prompt, resulting in errors or accidental deletion of wrong folders.
- Not restarting after system repairs or disk checks, which can leave issues unresolved.
Tips
- Always back up important data before performing deep system operations.
- Run command prompt as administrator for full access to system files.
- Use Safe Mode for stubborn deletions to minimize interference from running processes.
- If the folder is part of a shared network or synced cloud storage, pause sharing or sync before deleting.
- Regularly update Windows to ensure you have the latest fixes for file system bugs.
Troubleshooting
If the above steps do not resolve the “Directory is Not Empty” error, consider the following:
- Check for disk errors: Use the Check Disk utility (
chkdsk) to scan and repair disk issues that might cause file system corruption. - Boot into Safe Mode with Networking to perform operations with minimal interference.
- Disable third-party security software temporarily to rule out conflicts.
- Use Windows Recovery Options to repair system files or reset your PC if necessary.
- If all else fails, consult professional data recovery or IT support services to avoid data loss or further complications.
Frequently Asked Questions
1. Why do I get the “Directory is Not Empty” error when trying to delete a folder?
This error occurs when Windows detects hidden or in-use files within the folder, or when the folder is corrupted, preventing its deletion.
2. Can I force delete a folder that shows this error?
Yes, using command prompt with the rmdir /S /Q command or third-party tools like Unlocker can force deletion, but proceed cautiously to avoid deleting important files.
3. How do I identify if files are in use?
You can use Task Manager to close applications that might be using the folder, or use tools like Process Explorer to see which process locks the files.
4. Is it safe to delete system folders with this error?
No. Deleting system folders can cause Windows instability. Only delete folders you are certain are safe or non-essential.
5. What if the error persists after trying all these steps?
If the problem remains, consider running a full system scan, repairing Windows with SFC or DISM commands, or performing a clean install if necessary.
6. How can I prevent this error in the future?
Regularly update Windows, avoid force deleting files, close applications properly, and run disk checks periodically to maintain system health.
By following these steps and tips, you should be able to resolve the “Directory is Not Empty” error 0x80070091 in Windows 10 and 11. Remember to proceed carefully, especially when using command line tools or third-party utilities, to avoid unintended data loss or system issues. If problems persist, consulting a professional is advisable to prevent further complications.
Related
- How to Fix Snapchat Web Not Working on Chrome Effectively
- How to Fix Snapchat Web Not Working on Chrome
- How to Fix Snapchat Support Code SS06 Error on Android and iPhone