There are many empty folders and junk files available on your computer and we don’t even know about it. However, the junk files can be cleaned up, but the empty folders remain. If you want to find and delete the empty folders, check out these methods given below. Use these methods in Windows PC and get rid of all empty folders.

Best Ways to Find and Remove Empty Folders in Windows 10

Everyone has empty folders on the PC, though these folders do not take any space, but they can be annoying. So, let’s check out the different methods to delete Empty folders in Windows.

Also Read- How to Automatically Empty the Recycle Bin on Windows 10

Method 1: Use “for” and “rd” commands

By using Command Prompt you can identify the list of folders and delete the empty ones. For that, you must use for and rd command.

  1. First, you need to open the Command Prompt of the current folder, Press & Hold the Shift Key, and do right-click on the folder.
  2. Now, click on Open Command Window here. (Run the command from the parent folder path to find and remove the empty folder.)
  3. Once you are in the Command Prompt, run the command for /f “delims=” %i in (‘dir /s /b /ad ^| sort /r’) do rd “%i” 2>NUL

    Or

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

  4. As you run the above-given command, it will delete all the empty lists from the base folder path including the empty folders.

Do remember, if you are using the above command in a batch file, then replace %i with %%i.

Just Find the Empty Folders, & Don’t Delete

If you want to just find the folders but don’t want to delete them, then use the following command-line:

for /r “D:uploads2019” /d %F in (.) do @dir /b “%F” | findstr “^” >nul || echo %~fF

You will see the output containing the list of empty folders.

Method 2: Find and Remove empty folders using PowerShell

Use the PowerShell command-line and delete the empty folders that are located under the detailed base folder.

1.) Click on Start Menu, type PowerShell in the search bar, and click on Windows PowerShell.

2.) Start PowerShell and type the command given below

(gci “folderpath” -r | ? {$_.PSIsContainer -eq $True}) | ?{$_.GetFileSystemInfos().Count -eq 0} | remove-item

3.) Replace “folderpath” with the base folder location.

(gci “C:UsersrameshAppDataRoaming” -r | ? {$_.PSIsContainer -eq $True}) | ?{$_.GetFileSystemInfos().Count -eq 0} | remove-item

This command deletes all the empty sub-folder under %appdata% folder. However, this command only clears the last level of the empty folder, if you want to delete another folder then re-run the script and clear another level of a nested folder.

Method 3: Use DelEmpty.exe

Use a DelEmpty.exe tool from IntelliAdmin to delete empty directories. It can also delete the empty 0-byte files.

For the program, the command-line syntax is:

DelEmpty.exe OPTIONS [PATH]

To open the list of Empty folders:

To open the list of empty folders under the Mozilla directory under AppData, use the command:

DelEmpty.exe “%AppData%Mozilla” -d -c -s -y -l

This command shows the list of empty folders, and it will not delete the list as the list-only switch is used.

If you are using folder names with space(s),  then make sure you use the double-quotes around the path.

To delete the List of Empty folder:

Delete the empty folders under Mozilla directory under %AppData%, run the same command except the -l switch:

DelEmpty.exe “%AppData%Mozilla” -d -c -s -y

The program crosses through every subfolder and deletes the empty folders. Even the Nested empty folders are removed.

Method 4: Use the “Find Empty Files-n-Folders” utility

This tool finds and deletes the empty files (0-bytes) and also empty folders recursively.

  1. First, download the “Find Empty Files-n-Folders” tool from the given link.
  2. Once, it is downloaded, open it and select the folder
  3. Click on Scan Now. In separate tabs, the list of empty files and folders will be visible.
    find-empty-files-folders-1find-empty-files-folders-1
  4. Click on Mark all Folders and then click on Delete Folders

find-empty-files-folders-2

find-empty-files-folders-2

In the same way, you can delete the 0-byte files in the selected folder tree, by clicking on the Empty Files tab.

Method 5: Manually Search for Empty Folders

  1. First, turn on your PC and open This PC.
  2. At the top right corner, click on Search Tab to open Search Menu
  3. Set the Size Filter to Empty
    Set size filter to emptySet size filter to empty
  4. It will display all files and folders that do not use any memory space.
  5. Select the folders you want to delete, and do right-click on it, and then tap on Delete.

If you are using this method, you don’t need any software to be installed, it is just based on a search size.

Source

LEAVE A REPLY

Please enter your comment!
Please enter your name here