How to Fix a “The Directory Is Not Empty” Error on Windows
Luckily it’s not too hard to deal with
Does Microsoft Windows display a “The Directory Is Not Empty” error when you try to delete a folder? Your folder may be locked, or you may not have the required permission to remove the folder. You can follow a few easy methods to fix this problem and delete your folder successfully.
Some reasons you may not be able to remove your folder is that File Explorer is experiencing a minor glitch, your disk has a bad sector, you don’t have permission to remove the folder, or Windows’ system files are corrupt.
Restart File Explorer
When you get a “The Directory Is Not Empty” error, an easy fix you can apply to fix your issue is to restart File Explorer. Doing so resolves any minor problems with your file manager utility, allowing you todelete your items without any problems.
Renaming Your Folder to Resolve the Issue
If you stillcan’t delete your folder, give your folder a new name, and then try to remove the item. This method should resolve the issue if a minor system glitch is causing the problem.
Delete the Folder Using the Free Unlocker App
If you stillcan’t remove your folder, that may be because an app or service on your computer is using that folder. In this case, you can use a free app called Unlocker toremove all locking handles from your folderand delete the folder.
Delete Files Using Command Prompt
Command Prompt is a good alternative to use when you can’t use File Explorer to remove items. You can use a command in this command-line utility toremove your chosen folderfrom your storage.
Check Disk for Bad Sectors to Fix the Empty Error
The hard disk where you’ve stored your folder may have a bad sector, preventing you fromdeleting your items. In this case, use Windows’ built-in CHKDSK command to find and fix bad sectors on your disk.
Get Full Permission for Your Folder to Fix Error
You may not have full permission for your folder, which leads to a “The Directory Is Not Empty” error when you try to remove the folder. You can fix that by taking ownership of your chosen folder.
Run a Full Virus Scan on Your Windows PC
Your Windows PC may have a virus or malware infection, and this item may have gained unauthorized control over your folder, preventing you from deleting your folder. In this case, you can run a full virus check and find and remove all the threats from your PC.
You can use a third-party antivirus program or Windows’ built-in Microsoft Defender Antivirus to scan your computer. Here are the steps for running a full scan using the latter.
Fix Corrupt Windows Files
Windows’ operating system files may have become corrupt, causing your folder not to delete. In this case, you can use Windows’ built-in SFC (System File Checker) tool tofind and fix all corrupt fileson your computer.
This tool runs from a Command Prompt window and recognizes and replaces all the faulty system files on your storage.
Restore Your Windows System
If Windows’ “The Directory Is Not Empty” error still doesn’t go away, roll back any recent changes you may have made to your PC. One way to do this is byusing Windows’ built-in System Restore tool.
This tool allows you to roll back your system to a restore point created in the past, which helps fix many issues.
Finally, You Can Delete Your Folder on Your Windows PC
It quickly gets frustrating when you want to delete a folder but can’t do that asWindows keeps displayingthe “The Directory Is Not Empty” error. Luckily, this error isn’t too hard to deal with, and you can use the methods above to resolve the problem.
Once the item locking the folder is gone, you’ll be able to delete your folder without any issues.
Mahesh has been obsessed with technology since he got his first gadget a decade or so ago. Over the last few years, he’s written a number of tech articles on various online publications including but not limited to MakeTechEasier and Android AppStorm.Read Mahesh’s Full Bio
Welcome to Help Desk Geek- a blog full of tech tips from trusted tech experts. We have thousands of articles and guides to help you troubleshoot any issue. Our articles have been read over 150 million times since we launched in 2008.
HomeAbout UsEditorial StandardsContact UsTerms of Use
Copyright © 2008-2024 Help Desk Geek.com, LLC All Rights Reserved