• Skip to main content
  • Skip to primary sidebar

Technipages

Tutorials and fixes for smartphone, gadget, and computer problems

  • Topics
    • Android
    • Gaming
    • Hardware
    • Internet
    • iOS
    • MacOS
    • Office
    • Software
    • Windows
    • Definitions
  • Product Reviews
  • Downloads
  • About Technipages
Error “Cannot Delete folder: The directory is not empty” Fix

Error “Cannot Delete folder: The directory is not empty” Fix

By Mitch Bartlett 18 Comments

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.

  1. 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:
    Running Chkdsk in Windows 7
  2. 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“.
  3. 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.Chkdsk prompt
  4. 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.

You Might Also Like

  • How to Add or Delete Printers in Active Directory
    How to Add or Delete Printers in Active Directory
  • Active Directory: Fix Replication Error 8203
    Active Directory: Fix Replication Error 8203
  • Windows 10: An Error Occurred While Creating the Directory
    Windows 10: An Error Occurred While Creating the Directory
  • What is the Windows.old Folder? Can You Delete It?
    What is the Windows.old Folder? Can You Delete It?
  • What to Do If You Can’t Delete the MountUUP Folder
    What to Do If You Can’t Delete the MountUUP Folder
  • Bitwarden: How to Edit or Delete a Folder
    Bitwarden: How to Edit or Delete a Folder
  • Can't Delete Folder "You have been denied permission" Fix for Windows
    Can't Delete Folder "You have been denied permission" Fix…
  • Fix Error 0x80070032 When Creating Folder in Windows
    Fix Error 0x80070032 When Creating Folder in Windows
  • Error 1324: The Folder Path Contains an Invalid Character
    Error 1324: The Folder Path Contains an Invalid Character

Filed Under: Windows Tagged With: win7, Windows 10

Reader Interactions

Comments

  1. jack says

    June 7, 2021 at 3:12 pm

    checkdisk cannot run in readonly mode. how to make my 1 TB external ssd Not readonly please????

  2. nevim says

    March 26, 2021 at 6:51 am

    Thanks. It works!

  3. Carlos says

    February 4, 2021 at 3:29 pm

    Great help…! Thanks a lot…!

  4. Pavindu says

    October 23, 2020 at 10:14 pm

    The following solution is way more helpful. Just one line command.
    https://stackoverflow.com/a/53687576/8810941

  5. Troy Haliwell says

    January 1, 2020 at 2:07 pm

    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.

  6. KC says

    September 13, 2019 at 11:08 am

    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.

  7. Fernando says

    June 29, 2019 at 6:44 pm

    Thank you very much. It helped me a lot.

  8. James says

    June 20, 2019 at 5:11 pm

    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!!!

  9. Ryan says

    June 18, 2019 at 8:04 pm

    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.

  10. Dr.Saad says

    February 17, 2019 at 3:09 am

    It helped finally.
    Thank you

  11. Seán says

    January 17, 2019 at 9:23 pm

    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.

  12. Stan says

    September 9, 2018 at 12:12 pm

    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)”.

  13. Karen Roberts says

    August 10, 2018 at 5:58 pm

    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.

  14. Frank P Parrinello says

    August 4, 2018 at 6:34 pm

    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!

  15. Win10 User says

    July 1, 2018 at 9:31 am

    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.

  16. Alexey A Zengin says

    December 13, 2017 at 2:14 pm

    Yes, it helped. Thank you!
    Rebooting was not required on Windows 7 Professional

  17. David Smith says

    December 10, 2017 at 1:32 pm

    WIN10 – worked without having to re-boot – Thanks

  18. SAMIT says

    March 23, 2017 at 2:53 pm

    THANKS ITS WORKS

Did this help? Let us know!

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

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Primary Sidebar

Recent Posts

  • Windows 11: How to Add Clocks with Different Time Zones
  • Google Assistant: How to Never Miss a Birthday
  • Windows 11: How to Disable Notifications and Ads
  • How to Use Oculus Quest 2 Air Link
  • How to Create an Avatar in the Oculus Quest 2
  • 5 Free and Fun Math Apps for Kids
  • Windows 11: How to Discover What Graphics Card You’re Using
  • How to Change Display Resolution on Windows 10 and 11

Who’s Behind Technipages?

Baby and Daddy My name is Mitch Bartlett. I've been working in technology for over 20 years in a wide range of tech jobs from Tech Support to Software Testing. I started this site as a technical guide for myself and it has grown into what I hope is a useful reference for all.

© Copyright 2022 Technipages · All Rights Reserved · Privacy