There are many problems I’ve come across while working the computer help-desk. One of the common issues I’ve encountered is one that involves folders not deleting properly. When this issue occurs, an error message appears that says “Cannot Delete foldername: The directory is not empty“.
This problem can happen in Windows 10, 8, and 7. The problem can usually be solved with a Chkdsk scan. Just use these steps.
- Select Start, type “CHKDSK /F” in the Start Search box, then press “Enter“.
Note: If the folder you are trying to delete is located on a drive that is not your C: drive, add the drive letter to the end of the command. Example: CHKDSK /F E:
- If you used a drive letter in the command above, you will get a prompt about dismounting the drive. Type “Y” for Yes and press “Enter“.
- Most likely, you will get a message like the following:
Chkdsk cannot run because the volume is in use by another process. Would you like to schedule this volume to be checked the next time the system restarts? (Y/N)
Type “Y” for Yes and press “Enter” on your keyboard. - Nothing will happen just yet. You’ll have to restart your computer, to let the scan run. Once the scan is completed, try to delete the folder. You should be able to delete it just fine because CHKDSK has fixed the errors preventing it.
jack says
checkdisk cannot run in readonly mode. how to make my 1 TB external ssd Not readonly please????
nevim says
Thanks. It works!
Carlos says
Great help…! Thanks a lot…!
Pavindu says
The following solution is way more helpful. Just one line command.
https://stackoverflow.com/a/53687576/8810941
Troy Haliwell says
Also works when trying to empty a recycle bin on a non-os drive but it will not delete. Run Admin cmd, chkdsk it, then you can RD it.
KC says
This is an older post, but there is a simple solution to removing the Windows.old directory for people who come across this post on the Web. In Windows 7, 8, 8.1, and 10, use Disk Cleanup for the C: drive and choose the option Clean up system files int he bottom left of the Disk Cleanup dialogue box. Check the box that says Previous Windows installation(s) and check any other boxes that you wish to clean up and click ok. Done. If for some reason you still get errors and the directory is not removed, then there is a bigger problem.
Fernando says
Thank you very much. It helped me a lot.
James says
I have tried everything said on this page an other sites and not working. The windows.old folder says not empty and by right clicking it says zero bites. I showed hidden files and still nothing and typing chkdsk the screen blinks and nothing shows up on the desktop to run it. 2.74gbs it said last week. Help!!!
Ryan says
Wow Stan thank you! Had the windows.old folder issue…just created a blank text file at the lowest level and suddenly am able to delete the whole tree of old folders under windows.old.
Dr.Saad says
It helped finally.
Thank you
Seán says
I had this windows.old folder after a reset of my PC. Could not delete it even with booting to linux and trying. Full path in the folder pointed to a mozilla profile folder? Added a text file in there and deleted the folder. Once that was gone I could delete the windows.old
Thanks to Stan for the heads up with the fix.
Stan says
After many useless and frustrating attempts at fixing the “Directory Not Empty” error, I found an obscure post that said they fixed it by creating a new file in the folder that refused to be deleted, So I went down to the bottom level of “Windows.old” directory and plunked a file there. Then I was able to delete that level and proceeded all the way up the rest of tree one at a time. Only took a week to discover this…..which actually started out as “Windows.old(1)”.
Karen Roberts says
I downloaded Avast antivirus and decided to take this off, went to control panel and to remove, A part of it ended up in Program files, called Avast software. I right click on it and another screen pops up saying Error with a bunch of numbers , says directory not empty. How do I get Avast crap off my computer , here as explained.
Frank P Parrinello says
Not working for me – trying to delete OneDrive folder that the OneDrive app refuses to allow to be used, cannot gain access to it to open or delete it. Any other ideas? Thanks!
Win10 User says
Thanks, this helped!
After many different attempts, including doing error checking through the file manager, this simple ancient command prompt command has finally done the trick.
The leftover windows.old folder is finally gone.
Alexey A Zengin says
Yes, it helped. Thank you!
Rebooting was not required on Windows 7 Professional
David Smith says
WIN10 – worked without having to re-boot – Thanks
SAMIT says
THANKS ITS WORKS