Cyberessentials: Technology MagazineCyberessentials: Technology MagazineCyberessentials: Technology Magazine
  • Tech news
  • PC & Hardware
  • Mobile
  • Gadget
  • Guides
  • Security
  • Gaming
  • Crypto
Search
  • Contact
  • Cookie Policy
  • Terms of Use
© 2025 Cyberessentials.org. All Rights Reserved.
Reading: How to Fix the “Directory is Not Empty” Error 0x80070091 in Windows 10 & 11
Share
Notification Show More
Font ResizerAa
Cyberessentials: Technology MagazineCyberessentials: Technology Magazine
Font ResizerAa
  • Gadget
  • Technology
  • Mobile
Search
  • Tech news
  • PC & Hardware
  • Mobile
  • Gadget
  • Guides
  • Security
  • Gaming
  • Crypto
Follow US
  • Contact
  • Cookie Policy
  • Terms of Use
© 2022 Foxiz News Network. Ruby Design Company. All Rights Reserved.
a macbook air laptop in a dark room
Guides

How to Fix the “Directory is Not Empty” Error 0x80070091 in Windows 10 & 11

Last updated: September 24, 2025 12:13 pm
Cyberessentials.org
Share
SHARE

This guide explains what that cryptic code means and how you can regain control when Windows blocks a deletion. Many causes trigger the message: File Explorer glitches, bad disk sectors, missing permissions, apps keeping files open, or corrupt system files.

Contents
  • Understand the “Directory is Not Empty” error 0x80070091 in Windows
  • Quick fixes to try before advanced steps
  • How to Fix the Directory is Not Empty error via Command Prompt
  • Resolve file locks and permission issues blocking folder deletion
    • Take ownership and give your account full control
    • Use Unlocker or a similar tool to release handles
  • Repair Windows and drives that cause the error
    • Scan for malware with Microsoft Defender
    • Run DISM and System File Checker
    • Check the drive with CHKDSK
  • Roll back recent changes and prevent future directory issues
    • Use System Restore to revert to a stable restore point
    • Best practices: proper shutdowns, updates, and storage health checks
  • Conclusion
  • FAQ
    • What causes the 0x80070091 message when removing a folder?
    • Can a simple restart help when a folder won’t delete?
    • How do I delete a stubborn folder using Command Prompt?
    • What if permissions prevent folder removal?
    • Will Safe Mode help delete the folder?
    • Could malware cause this removal issue?
    • How do I repair system files that might block deletion?
    • When should I run CHKDSK for this problem?
    • Can OneDrive or other cloud services block folder deletion?
    • What if command-line methods still fail?
    • Is System Restore useful for this issue?
    • How can I prevent this from happening again?

Start with fast, safe checks. Restart Windows Explorer from Task Manager, try renaming the target folder, or remove synced items via the OneDrive web interface. These steps often let you delete folder entries without deeper repair.

If a process locks contents, a reputable unlock tool can show handles and schedule removal at reboot. For stubborn cases, open an elevated Command Prompt and use rmdir /s “PATH” or schedule CHKDSK /F on reboot to fix bad sectors.

Later sections walk through taking ownership in Security > Advanced, running DISM and SFC for system integrity, and using System Restore when recent changes cause trouble. Follow the order here for a quick, safe recovery of your data and system.

Understand the “Directory is Not Empty” error 0x80070091 in Windows

Check what’s holding that folder back before attempting repairs. The 0x80070091 code means Windows cannot remove a target folder because items remain inside, often hidden or locked.

Common causes include apps keeping a file handle open, permission or ownership mismatches, bad sectors on a drive, or corruption in system components. Third‑party antivirus can block deletes while scanning. Abrupt shutdowns or incomplete removals may leave ghost entries that resist normal cleanup.

  • This message often appears in File Explorer or other file manager dialogs when a delete fails.
  • In a command session, rmdir or rd returns the same text at the prompt with the path shown.
  • Bad disk sectors can prevent read/write and leave partial folders that neither Explorer nor the shell can remove.
  • Pausing real‑time protection or booting Safe Mode helps isolate the case when security software interferes.

Understanding which pattern matches your situation makes choosing the next step—unlocking files, repairing the disk, or restoring system files—much easier.

Quick fixes to try before advanced steps

Small resets and isolation steps can free stubborn folders fast. Try these first. They often solve the issue without running complex commands or repairs.

Restart File Explorer: Right‑click the taskbar, open Task Manager, right‑click Windows Explorer and choose Restart. After the shell restarts, try delete folder again.

  • Rename then delete. Right‑click the folder and pick Rename (or press F2). A new name can break a stale handle. Then attempt removal.
  • Safe Mode removal. Boot into Safe Mode so only essential services run. In that environment, try delete from File Manager to avoid third‑party interference.
  • OneDrive web removal. If the folder syncs with OneDrive, sign in online and remove it there. The change will sync back and often frees the local path.
  • Use an unlock tool. When a running app holds files, use a reputable tool like Unlocker to reveal handles and schedule deletion at reboot.
Method When to use Key steps Risk level
Restart Explorer UI glitches, shell lock Task Manager → Restart Explorer → try delete Low
Rename folder Stale references Right‑click or F2 → rename → delete Low
Safe Mode Third‑party apps blocking Boot Safe Mode → use File Manager → delete Low
OneDrive web Sync conflicts Sign in online → delete folder → sync Low
Unlocker tool Process locking files Run tool → release handles → schedule deletion Medium

How to Fix the Directory is Not Empty error via Command Prompt

An administrator command session gives direct control for cleaning out a locked folder. This approach uses built‑in tools in Windows when Explorer cannot delete a path.

Open an elevated command prompt window: open Start, type Command Prompt, right‑click and choose Run as administrator. Approve the UAC prompt and you’ll see a prompt window with admin rights.

Target the exact full path and always wrap it in quotes if it contains spaces. Then run either:

  • rmdir /s “C:FullPathToTarget” — removes the directory and its contents and will prompt unless /q is used.
  • rd /s /q “C:FullPathToTarget” — removes trees quietly without confirmation.

If the shell reports access denied or the directory still appears nonempty, clear hidden and system flags and read‑only attributes using:

attrib -h -r -s /s /d “C:FullPathToTarget*.*”

After running attrib, retry the remove directory command. Press enter after each command and read the output carefully; messages often indicate locks, permission issues, or file system faults. If disk errors persist, schedule CHKDSK separately rather than combining commands in one line.

Resolve file locks and permission issues blocking folder deletion

If files remain locked or permissions block access, begin by securing full rights over the folder. This step often clears the most common problem without running repairs.

Take ownership and grant full control

Take ownership and give your account full control

Right‑click the folder → Properties → Security → Advanced. Select Change next to Owner, enter your Windows username, click Check Names, then OK. Apply and close.

After owning the folder, grant Full control to your account or the Administrators group. Propagate permissions to subitems so inherited protections do not keep files locked.

Use Unlocker or a similar tool to release handles

Close any editors, media players, or cloud sync apps that may hold open handles. Launch the Unlocker app as an administrator, select the folder, and review locking processes.

Choose Delete from the drop‑down or schedule removal at reboot when immediate deletion fails. If command operations still fail, open an elevated command prompt and retry using standard remove commands while in Safe Mode if needed.

Action When to use Key step
Take ownership Permissions block access Properties → Security → Advanced → Change owner → Apply
Grant Full control Unable to modify contents Add account → Full control → Replace child permissions
Close apps Files locked by programs Exit editors, sync clients, media players
Unlocker tool Persistent handles Run as admin → select folder → release or schedule delete
Elevated prompt GUI and tool fail Run administrator command prompt → using command remove

These steps usually let you able delete the stubborn folder and return your system to normal quickly.

Repair Windows and drives that cause the error

When simple steps fail, run scans and repair commands that restore system integrity. These tools find malware, repair corrupted system files, and fix disk faults that prevent removal.

Scan for malware with Microsoft Defender

Open Windows Security → Virus & threat protection → Scan options. Choose a Full scan first.

If the folder still resists removal, run Microsoft Defender Offline scan. This catches threats that run before Windows loads.

Run DISM and System File Checker

Open an elevated command prompt. Run: DISM.exe /Online /Cleanup-image /Restorehealth. After it finishes, run sfc /scannow.

Wait until each utility completes. These commands repair servicing components and replace corrupt system file entries.

Check the drive with CHKDSK

In an admin command session, run CHKDSK /F C: (swap C: for your target drive). If prompted, type Y to schedule at restart and then restart Windows.

CHKDSK runs before Windows loads and fixes bad sectors that can leave phantom contents behind.

  • Rule out malware first: run a Full scan, then Offline if needed.
  • Repair system: run DISM, then run the file checker.
  • Repair disk: schedule CHKDSK for the affected drive and reboot.
Utility Main purpose Command / Steps When to use
Microsoft Defender Detect and remove malware Windows Security → Scan options → Full or Offline scan Suspected infections blocking file actions
DISM Repair servicing components DISM.exe /Online /Cleanup-image /Restorehealth Corrupt update or component store
System File Checker Restore system file integrity sfc /scannow (run after DISM) Missing or damaged system file entries
CHKDSK Repair disk errors and bad sectors CHKDSK /F X: (replace X with drive) → schedule and restart Drive faults, read/write failures, recurring folder issues

Roll back recent changes and prevent future directory issues

When recent changes break normal file behavior, rolling back can restore a stable setup quickly. Use System Restore if deletes worked before a driver, update, or app install changed system state. This method preserves personal files while reverting system files and drivers.

Use System Restore to revert to a stable restore point

In Windows: open Start, search Recovery, select Open System Restore, then Next. Pick the most recent restore point and follow the prompts: Next → Finish. The computer will restart and apply the selected restore.

If Windows won’t boot: hold Shift while clicking Restart. Choose Troubleshoot → Advanced options → System Restore and follow the recovery prompts from that environment.

Best practices: proper shutdowns, updates, and storage health checks

  • Shut down normally and avoid forced power-offs. That reduces incomplete writes that can leave inconsistent folders.
  • Keep Windows and storage drivers current to prevent compatibility issues that affect file operations.
  • Schedule periodic disk health scans and run a drive scan if you notice odd behavior.
  • Back up important data so recovery steps or service on a failing drive won’t risk your files.

These precautions pair with system restore as a lasting solution and cut the chance of seeing this issue again.

Conclusion

Conclusion

Use a clear, staged path when a folder refuses removal on Windows. Start with non‑destructive moves: restart Explorer, rename the folder, then try delete folder in Safe Mode or remove it from OneDrive web if synced.

When simple steps fail, open an elevated command prompt window and run attrib -h -r -s /s /d “PATH*.*”, then rd /s /q “PATH”. Verify the path in the prompt window and press enter only after checking.

Resolve locks and permissions by taking ownership in Properties → Security → Advanced, or use a reputable unlock tool to release handles. If the problem persists, run DISM and the system file checker, scan with Microsoft Defender, and run check disk with CHKDSK /F. As a last resort, use System Restore for recovery.

Follow these steps and you’ll have a reliable, repeatable solution for this common error and a safer way to remove directory content on your computer.

FAQ

What causes the 0x80070091 message when removing a folder?

Common causes include files or apps holding locks, insufficient permissions, corrupted system files, or disk problems such as bad sectors. Cloud sync clients like OneDrive can also block removal if the folder is syncing.

Can a simple restart help when a folder won’t delete?

Yes. Restarting File Explorer or rebooting Windows often clears file locks and temporary issues. Try ending explorer.exe in Task Manager, then restart it or reboot and attempt deletion again.

How do I delete a stubborn folder using Command Prompt?

Open Command Prompt as an administrator. Use rmdir /s “C:pathtofolder” or rd /s /q “C:pathtofolder” to force remove the folder and its contents. Use attrib -s -h -r “C:pathtofile” first if hidden or read-only items block removal.

What if permissions prevent folder removal?

Take ownership and assign full control. Right-click the folder, choose Properties → Security → Advanced, change the owner to your user, then grant full control. You can also use takeown /f “C:path” and icacls “C:path” /grant %username%:F in an elevated prompt.

Will Safe Mode help delete the folder?

Yes. Booting into Safe Mode loads minimal drivers and services, which lowers the chance of locks. From Safe Mode, try deleting the folder using File Explorer or Command Prompt.

Could malware cause this removal issue?

Malware can lock or hide files. Run a full or offline scan with Microsoft Defender or a reputable antivirus to rule out infection before making deeper repairs.

How do I repair system files that might block deletion?

Run System File Checker and DISM from an elevated Command Prompt: sfc /scannow, then DISM /Online /Cleanup-Image /RestoreHealth. These commands repair corrupt system components that may affect file operations.

When should I run CHKDSK for this problem?

If disk errors or bad sectors are suspected, run chkdsk C: /f (replace C: with the drive letter). It fixes filesystem errors and can release files stuck due to disk problems. You may need to schedule it at next boot for system volumes.

Can OneDrive or other cloud services block folder deletion?

Yes. If a folder is syncing, OneDrive may prevent local deletion. Pause syncing or remove the folder from OneDrive web, then delete locally. Unsyncing the folder via OneDrive settings often frees it.

What if command-line methods still fail?

Try third-party unlock tools like Unlocker or Process Explorer to find and close file handles. As a last resort, boot from WinPE or a Linux live USB and remove the folder from outside Windows.

Is System Restore useful for this issue?

If recent changes caused the problem, rolling back with System Restore can help. Restore to a point before the issue appeared, then check whether the folder can be removed normally.

How can I prevent this from happening again?

Keep Windows updated, shut down properly, maintain healthy storage, avoid abrupt removals, and monitor sync clients. Regularly run disk checks and backups to minimize risk of corruption or locked files.

AWS Discounts for Startups: How to Lower Cloud Spend Early
Best Ways to Double Dip on Cashback and Credit Card Rewards
Best Ways to Save Money Shopping for Kids’ Clothes Online
How I Saved $500 This Year Doing Absolutely Nothing at Checkout
Why Your Promo Codes Never Work (And How to Fix It)
Share This Article
Facebook Copy Link Print
Share
Previous Article Youtube application screengrab How to See What Videos Were Removed From My Paylist on YouTube
Next Article white and silver electronic device How to Change Your Browser’s User Agent and Trick Websites
Leave a Comment

Leave a Reply Cancel reply

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

Latest News

black flat screen computer monitor
Programming languages – compiled vs. interpreted. What are the differences?
WWW
a hundred dollar bill sticking out of the back pocket of a pair of jeans
The Ultimate Guide to Earning Rewards on Online Purchases
Guides
A green iPhone sitting on top of a wooden table
How to Save on DoorDash and UberEats Orders Every Time – Use Coupons
Guides
Rakuten vs. Coupert: Which Offers Better Cashback Rates?
Guides
a dollar bill sticking out of the back pocket of a pair of jeans
How to Make Money Back While Shopping Online
Guides
a phone with a pay pay logo on it
The Best Cashback Extensions That Pay Directly to PayPal
Guides
fan of 100 U.S. dollar banknotes
How to Earn Passive Cashback on Your Everyday Purchases
Guides
white and gold perfume bottle
Best Ways to Save Money on Sephora and Ulta Beauty Hauls
Guides

							banner							
							banner
Cyberessentials.org
Discover the latest in technology: expert PC & hardware guides, mobile innovations, AI breakthroughs, and security best practices. Join our community of tech enthusiasts today!

Recommended

Bybit vs Stormgain: Which crypto platform is right for you?
Crypto
The Cables in Your PC’s Power Supply, Explained
Guides
elevenlabs ai voice generator
ElevenLabs Review: The Ultimate AI Voice Generation Platform
AI Software
Margin Trading on ByBit Exchange: A Beginner’s Guide
Crypto
person in green shirt wearing black knit cap
Entry-Level Cyber Security Jobs With No Experience – Is It Easy to Get Into Cyber Security Without Experience?
Security
pink and white vr goggles
Where do I find the serial number of my Oculus Quest 2?
Guides
red and white circuit board
What to do With a Raspberry Pi
Guides Technology
person in gray shirt and blue denim jeans holding blue denim jeans
10 Secret Hacks to Save Money on Online Shopping in 2026
Guides
graphical user interface, text
Top 5 Best Coupon Extensions for Chrome in 2026
Guides
chart, funnel chart
What is Hiberfil.sys and Is It Safe to Delete?
Guides

You Might also Like

focus photography of person counting dollar banknotes
Guides

Top Ways College Students Can Save Money on Tech and Fashion

Cyberessentials.org
19 Min Read
A close up of a cell phone on a table
Guides

How to Hack AliExpress for Extra Discounts and Cashback

Cyberessentials.org
21 Min Read
A phone that is sitting on a table
Guides

How to Find Working Promo Codes for Shein and Temu

Cyberessentials.org
21 Min Read
a computer screen with the walmart logo on it
Guides

The Best Walmart Hacks to Save Money on Every Order

Cyberessentials.org
25 Min Read
logo
Guides

Best Browser Extensions for Finding Travel and Flight Deals

Cyberessentials.org
25 Min Read
a screen with a message on it
Guides

How to Get Free Shipping and Extra Discounts on eBay

Cyberessentials.org
21 Min Read
a computer screen with the amazon logo on it
Guides

How to Get Secret Discounts and Coupons on Amazon

Cyberessentials.org
29 Min Read
a person using a cell phone while sitting in front of a laptop
Guides

Stop Searching for Promo Codes Manually: Do This Instead

Cyberessentials.org
17 Min Read
a person stacking coins on top of a table
Guides

The Ultimate Guide to Saving Money on Groceries and Delivery Apps

Cyberessentials.org
24 Min Read
//

Discover the latest in technology: expert PC & hardware guides, mobile innovations, AI breakthroughs, and security best practices. Join our community of tech enthusiasts today!

Categories

  • AI
  • Crypto
  • Gadget
  • Gaming
  • Guides
  • Marketing
  • Mobile
  • News
  • PC & Hardware
  • Security
  • Software
  • Technology
  • Uncategorized
  • WWW

Recent Articles

  • AWS Discounts for Startups: How to Lower Cloud Spend Early
  • Programming languages – compiled vs. interpreted. What are the differences?
  • Best Ways to Double Dip on Cashback and Credit Card Rewards
  • Best Ways to Save Money Shopping for Kids’ Clothes Online
  • How I Saved $500 This Year Doing Absolutely Nothing at Checkout

Support

  • PRIVACY POLICY
  • TERMS OF USE
  • COOKIE POLICY
  • OUR SITE MAP
  • CONTACT US
Cyberessentials: Technology MagazineCyberessentials: Technology Magazine
© 2025 Cyberessentials.org. All Rights Reserved.
Welcome Back!

Sign in to your account

Username or Email Address
Password

Lost your password?