Error 0x80070091 When Deleting a Folder: 4 Fixes That Work
Error 0x80070091 means the folder is not empty, even though it looks empty — hidden files, a locked file inside, or a damaged entry is blocking the delete. Force it from the command line or clear the contents out with robocopy.
-
1. Show Hidden Files and Folders
Explorer hides files by default, and a hidden file inside the folder is the most common reason a delete reports not-empty. Open File Explorer, go to `View > Show > Hidden items`, and tick it. Reopen the folder. Whatever appears inside is…
-
2. Check the Folder in a Terminal
The command line shows everything: run `dir /a "C:\Path\To\Folder"`. The `/a` flag lists hidden and system entries alongside normal ones. Compare it against what Explorer showed. Anything listed here is the leftover the delete is…
-
3. Look for a File That Is Locked Open
A file inside the folder that a program has open cannot be deleted, and its presence makes the whole folder undeletable. Open Resource Monitor, search the folder path in Associated Handles, and note which process is holding something…
-
4. Check for Read-Only or System Attributes
Files marked read-only or system resist deletion even when visible. Run `attrib "C:\Path\To\Folder\*.*"` to list the attributes of every entry inside. Anything flagged R or S needs its attribute cleared before the delete — the next method…
-
5. Try the Delete Once More After Closing Apps
Before forcing anything, close every open program and retry the delete. A file that was locked a moment ago may now be free. If it still reports not-empty with nothing visible inside, the leftover is hidden, locked, or damaged — and it is…
-
6. Force Delete With rmdir /s /q
Open a terminal and run `rmdir /s /q "C:\Path\To\Folder"`. `/s` removes everything inside, `/q` skips the confirmation prompts. This deletes files Explorer refuses to touch, including hidden ones. If the folder is large, give it a moment…
-
7. Clear Attributes Before Deleting
If rmdir still fails, strip the protective attributes first: `attrib -r -s -h "C:\Path\To\Folder\*.*" /S /D`. The flags remove read-only, system, and hidden attributes from every entry inside. Run `rmdir /s /q` immediately after, and the…
-
8. Use PowerShell's Remove-Item -Force
PowerShell offers the same force with clearer errors: `Remove-Item "C:\Path\To\Folder" -Recurse -Force`. `-Recurse` deletes the contents, `-Force` overrides read-only and hidden flags. Any error it prints names the exact entry blocking…
-
9. Delete the Stubborn Entry by Its Short Name
Some damaged entries cannot be addressed by their normal name. Run `dir /x` in the parent folder to get the 8.3 short name — something like `FOLDER~1` — then delete with the short name: `rmdir /s /q FOLDER~1`. The short name bypasses the…
-
10. Empty It With the Robocopy /MIR Trick
For a folder that refuses every delete, mirror nothingness into it: create an empty folder with `mkdir C:\empty`, then run `robocopy C:\empty "C:\Path\To\Folder" /MIR`. `/MIR` mirrors the empty folder over it, deleting every leftover…
-
11. Run chkdsk on the Drive
When deletes fail repeatedly on the same drive, the file table has damaged entries that report phantom contents. Run `chkdsk D: /f` on the drive in an elevated terminal — add `/r` on an external drive. After the scan and a reboot, the…
-
12. Delete It in Safe Mode
Safe Mode runs without the third-party processes that lock files. Hold Shift and click Restart, choose Troubleshoot > Advanced options > Startup Settings > Restart, then press 4. Delete the folder there. With no background apps running,…
-
13. Check That the Drive Letter Has Not Moved
If you are deleting through a script or shortcut, confirm the folder's drive letter still matches. External drives get reassigned, and a delete pointed at the old letter reports errors that look like content problems. Open Disk…
-
14. Take Ownership When Permissions Block the Delete
A folder owned by another account or by the system refuses deletion from your session. In an elevated terminal, run `takeown /f "C:\Path\To\Folder" /r /d y`, then `icacls "C:\Path\To\Folder" /grant administrators:F /T`. Both complete…
-
15. Stop the Process That Re-creates the Folder
A folder that reappears after every successful delete is being recreated by a running program — a log folder, a cache, a sync target. Watch Task Manager while you delete, and note which process touches it. Close or uninstall that program,…