How To Remove Empty Directories In Windows 10

For Windows 10 How-To PC Optimization

Over time as you use your system, Windows gets cluttered with more and more junk data and hundreds of empty folders. These files occupy unnecessary space but using the best disk cleanup and PC optimizer tool they can be cleaned up. Yet, empty directories and empty folders do remain and they make organizing data bulky. So, if you are looking for a way to get rid of these empty directories and folders, this article is just right for you.

In this post, we will discuss both manual and automatic ways to delete empty directories that are left behind, generally after uninstalling a product. If you have the right tool, removing these directories is not at all difficult but if you are thinking of sifting through each folder to find these empty folders then it can take forever and you will not be able to find them all.

How To Delete Empty Folders And Directories

List of Contents

1. What Is An Empty Directory/Folder And How To Find It In Windows 10?

An empty folder or directory is one without a sub-directory or files in it. Though these files don’t occupy disk space, they can create annoyance. Hence, if you don’t want this unwanted data on your Windows, read further and learn how to search and remove an empty folder/directory – Windows 10.

Tip: Before deleting a file or running a batch file to delete empty folders/directories, we suggest backing up data on an external drive.

  1. Manually searching for empty folders
  2. Double-click This PC.
  3. Hit Search Tab, this will open the Search Menu.
  4. Click the Size option and select Empty filter. When doing so ensure All subfolder feature is checked.
  5. Wait for the search to finish, you will now see all empty folders and directories that do not take space but do clutter the system.
  6. Select folders/ directories that you don’t want > right-click >

To use this manual method, you don’t need third-party software, as the search is based on size. But this method searches only at the system level. This means using this step on a surface level, you can get rid of empty folders or directories. However, if you are looking for a thorough and more effective way, then we suggest using Advanced System Optimizer. This tool will not only help detect and delete these files but will also help fix invalid registry entries and do a lot more.

2. Removing Empty Folder, Invalid Registry Entries Using Advanced System Optimizer

A good and powerful PC Optimizer can help delete redundant files, junk data but if it has a registry cleaner and optimizer, then things become easy. So, if you have been just using a PC cleanup tool without a registry cleaner, try Advanced System Optimizer. This best PC Optimizer offers registry cleaner the best way to remove empty directories, and boost the system’s performance. To use it, follow the steps below:

ASO Overview

  1. Download, install and run Advanced System Optimizer.
  2. Launch the tool > select Deep Scan and click Start Smart PC Care. Wait for the operation to perform
  3. Once done, click Clean Now to repair all detected errors and fix invalid registries. This way you can remove empty directories, folders easily.

To know more about this robust tool, read the comprehensive review on Advanced System Optimizer.

3. Removing Empty Folder Using Command Prompt

Using elevated Command Prompt and running commands like for and rd, you can list down and delete empty folder/directories. To learn how to do that, follow the steps below:

  1. In the Windows search bar, type Command Prompt
  2. Select the search result > Run as administrator
  3. Here, type for /f "delims=" %i in ('dir /s /b /ad ^| sort /r') do rd "%i" 2>NUL


for /f "usebackq delims=" %i in (`"dir /s /b /ad | sort /r"`) do rd "%i" 2>NUL

Note: Before you run this command, make sure you are in the correct directory. Once that is cross-checked, only then run the command. Moreover, to run the command as a batch file, replace %i with %%i.

  1. Wait for the command to run.
  2. Once done all the empty directories and subdirectories will be removed from the base folder path, including empty folders.

Note: If there are any folders with special characters, the above command will not work on them. Also, the command automatically deletes empty folders/ directories. This means if you want to check the list of empty folders before they are removed, you cannot.

In addition to this, if you are an advanced user, you can run DIR /AD/B/S | SORT /R > EMPTIES.BAT file to remove empty folders.

Again, to run this command, you need to use an elevated Command Prompt. Also, EMPTIES.BAT contains a list of folders in reverse order. Once you have the list, you can use an editor like Word to find the files and replace files.

To do so, open the word editor press Ctrl + F, and enter ^p as search criteria replace it with ^pRD. Then save the EMPTIES>BAT file and exit

Now run the BAT file to delete all empty folders.

Note: This method is a bit complex. So, if you are not sure you can skip it.

Using these simple steps, you can easily remove empty folders/directories from Windows 10. In addition to these steps, you can also use PowerShell, Windows Scripting. But both these methods are complex and only advanced users can use them. Hence, we haven’t explained it to them. In case you want us to explain them to drop in your message in the comments section. We hope you like the post and found it useful. If you like it, share it with others who need help.

In the end, an additional tip

If you are running the system as a guest user without admin rights, then you might face problems. In such a case to remove empty directories and folders, you need to ask the owner for admin rights. Once you are using the Administrator account, you can remove the unnecessary folders. There you go, you have now learned how to delete empty directories and folders.

What Do You Think?


  • JohnM
    Most of the time we dont know about such directory and dont have any option and tricks to delete them or remove them but this process help me a lot.

    1 year ago Reply

Leave a Reply