Fixed – Cannot Remove Folder: The Directory is Not Empty

If you are getting the issue "Cannot Remove Folder: The Directory is Not Empty" or "The Directory is Not Empty" while deleting folders from your internal or external hard drive, below step by step guide will help you to fix this issue.

Error While deleting folderOR

The directory is not empty error

This is the most common problem you will be facing if you are working as an IT Support or Help Desk Support. Typically this problem comes with Windows 10, 8 & 7 and can be resolved with a simple CHKDSK command.

What is CHKDSK?

CHKDSK (short for "check disk") is a Windows utility that verifies the file system integrity of your hard disk and fixes logical file system errors.

How to Fix "The Directory is Not Empty" Issue?

You are trying to delete a folder from your hard drive and you get the error message that "The directory is not empty". Just follow the complete steps to get the solution.

Step-1: Press the "Windows" key to open the "Start Menu".

Step-2: Select "Search" and Type-in "cmd".

Windows 10 Command Prompt

Step-3: Right-click on Command Prompt from the search results list and Click "Run as administrator".

Step-4: When Command Prompt launches, type the following command:

C:\>chkdsk E: /f  or  C:\>chkdsk E: /f /r

/f - option will attempt to fix any found errors.
/r - option will locate for bad sectors and recovery any readable information.

If are in E  Drive and want to run chkdsk utility on same drive then you can use the following command.

E:\>chkdsk /f  or  E:\>chkdsk /f  /r

Most likely, you will get the following message, if you are running chkdsk utility on your internal hard drive:

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. In this case the system will restart and then scan process will start.

OR

If you are running chkdsk utility on external hard drive or PEN Drive, you will get the following message.

Chkdsk cannot run because the volume is in use by another process. Chkdsk may run if this volume is dismounted first. ALL OPENED HANDLES TO THIS VOLUME WOULD THEN BE INVALID. Would you like to force a dismount on this volume? (Y/N)

Type Y for Yes and press Enter on your keyboard. In this case the system will not restart.

The directory is not empty fixed

Now let the scan run. Once the scan is completed, you can delete the folder. You will be able to delete it because CHKDSK has fixed the errors.

If you don't want the above message and force the volume to be dismounted, enter the following command.

C:\>chkdsk E: /f /r /x

The parameters for this command are:

/f - option will attempt to fix any found errors.
/r - option will locate for bad sectors and recovery any readable information.
/x - option will force the volume you’re about to check to be dismounted before the utility begins a scan.

If you have liked this article and want to help your friends & colleagues, don't forget to share with them.

Subscribe to get free tech advice, tips and in-depth articles.


Start Your Dream Website Today & Earn Money Online

To Start a dream website, choose a Domain Name & Reliable Hosting Provider, Self-hosted Blogging Platform, WordPress Theme, Email Marketing and SEO Tool for traffic.

SiteGround Hosting Discount - 60% OFF
ConvertKit The Best Email Marketing Software
Free SEMRush SEM and SEO Tool
Get Your Hosting Package with SiteGround, Increase new email subscribers with ConvertKit and Research Keywords with SEMRush to Boost Organic Traffic.





Leave a Reply

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