5 Methods to Delete Empty Folders in Windows

5 Methods to Delete Empty Folders in Windows

How To Delete Empty Folders In Windows - With Step By Step Guide With Pictures - Using Free Tools And Keep A Healthy PC (CMD - Robocopy - Manual Search)

Wondershare Recoverit Authors

Dec 25, 2020 • Filed to: Recover & Repair Files • Proven solutions

0

Learn to Delete Empty Folders in Windows like a pro.

If you have a working habit like myself,

I create many folders projects - but have little time to follow through and see if I completed everything.

Besides, everyone appreciates a neat desktop one with smartly named folders and files by extension. While creating new folders is easy, maintaining them is not a task most of us do best, and that includes your ability to do away with empty folders.

You are required to master one skill - How to remove empty folders in Windows.

Creating folders in windows is easy, but maintaining them can be an uphill task.

This post will walk you through the tweaks you need to master managing folders/directories.

Method 1: Manual Search to Delete Empty Folders in Windows

A manual search for empty folders acts like any other search on your computer. However, you have to be very clear regarding the size of the folder (It has to be zero bytes - nothing stored in it)

manual search empty folders

Steps: This is a Manual way and very useful when done right

Specify The folder search size to be 0 for the empty folders

show parameter zero file folders files


Method 2: Using Command prompt to Search for and locate empty folders

Using the command prompt to delete empty folders is an effective way. The downside with it is its technical bit. Not everybody can navigate through with ease. Nonetheless, here are the handy steps:

run cmd

Pro-Tip: the EMPTIES.BAT command sorts all folders by the memory-size in reverse order.

This method may seem complicated, but it is instrumental since it peruses into sub-folders.


Method 3: Remove empty folders using "for" and "rd" commands

Remove empty folders using "for" and "rd" commands.

You enumerate and delete all empty folders using CMD internal commands for and rd. This is specific and deletes only the empty ones.

Press and hold on the Shift key. Next, right-click on a target folder and select the option Open command window here. N/B The command opens the CMD console reading the path to the folder you prompted it to open from.

Pro-Note: Ensure to launch the CMD console from the folder where you target to sort out for empty folders (and sub-folders for deletion)

Once you’re in the desired directory in the Command Prompt, run this command-line:

The command will delete all folders that are empty within directories and across subdirectories right form your base folder path (that includes any nested empty folders)

CMD console

Another Handy Tip: If you want to run the command within any batch file, ensure you replace %i with %%i. Secondly, the command omits the deletion of folders whose names have special characters

One major disadvantage with the method arises from its failure to find the empty folders without their deletion.

Tip: Finding Empty Folders Without The Need to Delete Them

To attain the subject, you’ll be required to deploy the following command via the CMD console:

for /r "D:\uploads\2019" /d %F in (.) do @dir /b "%F" | findstr "^" >nul || echo %~fF

Below is the output showing all empty folders/directories after running the above command.

find empty directories dobnot delet after search


Method 4: Find and remove empty folders using Robocopy

Using Robocopy to Find and Remove Empty Folders

Robocopy is a handy and built-in tool with an array of advanced features.

Assume we have a folder by the name sam, and in it are sub-folders, some of them. Let’s go about deleting the empty folders using Robocopy.

Pro-Note: The whole idea using the Robocopy move command is using the same folder path containing the "source" and the "destination."

  1. Launch a Command Prompt window.
  2. Type in the following string/command and hit the ENTER button:

robocop "d:\automobile rates\cars" "d:\automobile rates\cars" /S /move

Remember, the source and destination paths are the same-(deliberately) the same. Therefore, the /S parameter directs Robocopy not to use the target "destination" path. Since both are the same, Robocopy will effect a delete action for all the empty folders. That arises from the /S switch.

cmd console robocopy

See the above- all empty folders in the target path/directory all get cleared.

Let's do it practically.

Look at my %APPDATA% folder; usually, it's full of empty folders arising from outdated software.

directories empty undeleted

Looking at the properties, the folder- Roaming has 3,629 folders.

Pretty sure some are empty.

Next, I effect the command” robocopy "%appdata%" "%appdata%" /S /MOVE”

empty directories deleted

The folders moved from 3,629 to 2,993


Method 5: Using Empty folder cleaner for Windows 10 Users

One more helpful solution delete empty folders is a Registry cleaner..

It's a tool for wiping out redundant folders that accumulate over time.

If you look online for registry cleaners, you'll get many. But, here is a list of six best ones.

In case this is your firs time using a registry cleaner, here are useful tips:

Finally, check to see if the empty folders have been deleted.


Pro-Users Tip: Recover the files in the folder deleted by accidently?

Everyday, computer users lose data due to many incidences and accidents.

Could be power outages, pure negligence or malfunction f the computer.

Whichever your case is, there's amazing opportunity to recover everything you've lost.

Here's the magical software to turn things around with data loss - Recoverit Data Recovery

In very precise words, Recoverit brings simplicity into the complex situation with data recovery.

And it cover you for both Mac and Windows

Step 1: Select a location to scan

computer data recovery

Step 2: Scan the location

computer scan

Step 3: Recover and save files

word preview


Summing Up

Users cannot run away from the creation of folders in a windows PC. The programs running locally and downloads create and leave empty folders.

It's a process you cannot escape from. The best way to go about it is to create time to clear the folders from time to time.

You can clear the empty folders manually. But, do you have the time?

The situation complicates when you are working with several client or servers. It's worst if you are working on remote PCs/servers.

You should not fear erasing empty folders and files from your PC. Keep in mind that, ordinarily deleting seemly moves the folders/ files into the recycle bin.

Over time, you get the need to recover a folder or two. And that is where Recoverit Data Recovery software comes in. With Recoverit in the picture, you can delete empty files and folders to optimize the storage and performance of your PC.

And anytime you require data recovery, Recoverit covers you.

Recoverit author

Eleanor Reed

staff Editor

(Click to rate this post)

Generally rated4.5(105participated)

Home > Resources > Recover & Repair Files > 5 Methods to Delete Empty Folders in Windows
x