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

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 XP, Windows 7 and Vista. Usually, the problem can be solved by with a Chkdsk scan. This can be done be following these steps.

  • Windows XP: Go to Start > Run. In the Open: line type CHKDSK /F and press Enter.
  • Windows 7 & Vista: Click the Windows orb and type CHKDSK /F in the Start Search box and 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

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)

Chkdsk prompt

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.

Comments

  1. ParaBolt says

    LOL I got a folder “WugYrLtl” in my Program Files directory [Win XP]. Can’t delete using Chkdsk… Can’t delete using fancy software.. AntiVirus can’t delete it! Any other solution? Folder is of 0 bytes, Read-Only… and if I try to rename-move it gives Access Denied message. Thanks.. for future replies?

  2. Garvin says

    Mitch:

    I can only echo the gratitude expressed by the previous people. Your solution was concise, easy to understand and execute, AND IT WORKED!!!.

    THANK YOU VERY MUCH.

    Garvin

  3. Helvetica says

    Thankyou thankyou thankyou. For three days I have been reading dozens of suggestions on forums, downloading various weird and wonderful programs, trying all kinds of things to get rid of a 0 byte file/folder on my little mp3 player (like an Ipod but not an Ipod). Nothing worked, not even Total Commander, not using DEL… in the Command line. I found your page and within 2 minutes the file could be deleted (Note for anyone else deleting a file from an ipod-like device and XP: Ignore the warning that it is not a Windows compatible drive, click Y for yes, and later click N for No when it asks whether it should save the faulty data as a file).
    Many many thanks again.

  4. Adil says

    100% working method

    thanx a lot man …. I had tried evrything from changing permissions to using ‘ unlocker ‘ just evrything ..

    but in vain …

    CHKDSK method is the BEST WORKING METHOD INDEED !!!!

  5. Alberto says

    Thank you! This allowed me to remove a corrupted folder that could not be removed by specialized software.

  6. William Bannerjee says

    chkdsk /f d: has no effect in deleting a folder in my data drive d:. Can anyone suggest a basic solution? Where are the Windows experts. Answers are given only by children. Is there not a single expert in Windows who can suggest how to delete a folder in XP?

  7. YoJembo says

    Thanks mate worked for me.

    We boot Puppy Linux up from a flash card to do our financials. I copied some files over to the C drive from within PL and somehow things got corrupted. Couldn’t even delete the folder from within Puppy. CHKDSK /F worked but the screen went blank after reboot and the process started. All I could do was watch the drive active light and reboot manually when it stopped flashing. We use a SSD.

  8. GERALD says

    Thanks a lot for the help I had a big problem deleting a folder from my USB but with your advice I have managed to delete.

  9. Albert says

    I tried other free programs to delete stubborn files and folders. None of them worked. I tried this check disc method. It worked like magic. The problem folder was in a USB Hard drive. Thanks…

  10. Raju says

    Problem: Files Folders got named with weird characters & those files folders cannot be copied or deleted.

    Source of problem: Virus infection

    Solution:
    1. Write click on the flash drive
    2. Select “properties”
    3. Click on “Tools”
    4. Click on “Check Now”
    5. Ensure “tick mark” is there in the box in front of “Automatically fix file system errors.
    6. Other tick mark is not necessary even if you put it is OK.
    7. Click “Start”
    After this process, you can delete that folder or file.

    I struggled to get this simple solution from morning till evening. I found it on my own by the grace of God.
    Am sure it will work right with all those who are facing this problem.

    With regards Raju

  11. Dave says

    The software on my external back up drive was corrupt and I couldn’t delete the old files (so that I could move a new version of the software to the drive). Your tip worked like a charm!
    Thanks!

  12. Galane says

    I have some folders on a GPS device that are “not empty”. I need to delete them, usually the only method that works when Windows starts seeing things that aren’t there is to format the memory card or drive etc, but reformatting the memory of this GPS will of course brick it.

    Neither checkdisk, rmdir nor Unlocker have been able to touch these folders. They are NOT original folders on the device, they were created by Miopocket.

  13. Dennis says

    I have 4gb micro sd, but i can’t format.When i am deleting the music file, i can’t delete and some of the deleted files are automatically return into the specific folder.

  14. Larry Guerra says

    Hi,
    Thanks for the tip to check disk, it ran the scan just like you said. It didn’t change anything though. I got the same pop up as before. The registry is not empty.
    I am the only user of windows xp and changed the properties of the file to administrator/owner and still no go. Thanks anyway
    Larry

  15. Drag0n says

    Simply amazing , I tried unlocker, moving it into the recycle bin, and others, and I couldn’t delete a folder that was in my usb drive. I tried this method, it checked my C drive, then my usb, and it fixed the problem in my usb, and I was able to delete the folder! Thanks so much for this tip.

  16. Shy says

    Thanks so much for this tip….it worked like magic! I couldn’t stand having folders that couldn’t be deleted. For anyone attempting this make sure you do not interrupt the computer when restarting as it conducts disk checks etc. That’s when it will be fixing the problem. Let it just restart normally and remember to put a space between K and /. Thanks a million!

  17. The_power of NumBSKuLL says

    Yo, Superahppy fun time, your issue is EXACTLY the same as mine within your description, couldnt be more specifically identical! Any joy on resolving this yet, if so, PLEASE ook me up this is driving me nuts.

  18. CIKO says

    try use the ‘unlocker’ freeware..download at filehippo.com…right click the folder u want to delete and change no ‘action’ to ‘delete’ and select ‘unlock-all’ or ‘kill process’ then click ‘ok’…but this blog post actually really help me some other way…

Leave a Reply

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

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>