Delete Empty Folders in Windows 10 – How To

It’s best to never have an empty directory in Windows 10. Because whenever a virus hits your computer, it’s directories always look for space inside the empty folders. So here, I’ve written about How To Delete Empty Folders in Windows 10. All of the drafted methods don’t require any assistance from third-party programs.

HOW TO LAUNCH RECOVERY MODE IN WINDOWS 10

3 Ways to Delete Empty Folders in Windows 10

Find & Remove Empty Folders via Search

Remove Empty Folders

  • Launch the file explorer and navigate to This PC
  • Click once on the Search bar and go to the search menu
  • Select the file size as Empty (0 KB)
  • After getting the search results, select & delete empty folders of your choice.

Delete Empty Directories via Command Prompt

Delete Empty Directories

  • Launch Command Prompt with admin privileges through Cortana search.
  • Run the following command in cmd:
    • DIR /AD/B/S | SORT /R > EMPTIES.BAT
  • Launch the EMPTIES.BAT with Notepad or any script editor.
  • Locate ^p and change it to ^pRD
  • Save changes and run the edited file to delete empty directories.

Erase Empty Folders Through PowerShell

Delete Empty Folders in Windows 10

  • Press Win + X keys and select Windows PowerShell (Admin)
  • Execute the following command:
    • (gci “C:” -r | ? {$_.PSIsContainer -eq $True}) | ?{$_.GetFileSystemInfos().Count -eq 0} | remove-item
  • Keep executing the command until you are notified that no empty folders are left.

Note: In the above-provide command, you are allowed to change C: into any file path of your choice. Also, this command only removes the sub-folders in nests. So to be successful in removing all the empty folders, you’ll have to keep running the command.

How To Check Empty Folders?

If you only want to get a list of empty folders, but not to delete them, then run the following command in PowerShell:

  • (gci “C:” -r | ? {$_.PSIsContainer -eq $True}) | ?{$_.GetFileSystemInfos().Count -eq 0} | select FullName | Out-GridView

What If You Are Unable to Remove Empty Folders?

If you are facing trouble in locating and removing empty folders in Windows 10, then here’s what you should be doing. Ensure that you have the right privileges to complete the file deleting tasks. And it would be best if you have logged in with an administrative account.

That’s all, keep visiting WindowsBoy for more.

Leave a Comment