How do I find all the empty folders and delete them.

Anonymous
2011-04-03T17:52:58+00:00

My music has a bunch of folders that are empty but it will take forever to look at every single one.  I want to search by size or someway that will make it easier to find and delete

Windows for home | Previous Windows versions | Files, folders, and storage

Locked Question. This question was migrated from the Microsoft Support Community. You can vote on whether it's helpful, but you can't add comments or replies or follow the question.

0 comments No comments
Answer accepted by question author
Anonymous
2011-05-15T16:05:51+00:00

Hello !

If you do want to delete all the empty folders only ! go to Computer and at the top right click on search. Click on kind and Select folder, now click again on search and click on size, select 0 and click on search.

This should list all the empty folders

Regards

Was this answer helpful?

800+ people found this answer helpful.
0 comments No comments

55 additional answers

Sort by: Oldest
  1. Anonymous
    2015-12-06T11:15:21+00:00

    This does not work and hasn't as long as I can remember.  

    SO

    Sohail.Khan911's response below points to a nice little application that does work.

    Was this answer helpful?

    0 comments No comments
  2. Anonymous
    2015-12-20T16:07:52+00:00

    This powershell command will remove empty directories in the working directory:

    dir -Directory -Recurse | where {($_ | dir).Count -eq 0} | rmdir

    The command must be run in a powershell window. Be sure to cd to the immediate parent directory containing the empty directories you want to delete (you can double-check with the pwd command).

    Use this command to check what will be deleted without actually deleting stuff:

    dir -Directory -Recurse | where {($_ | dir).Count -eq 0} | rmdir -WhatIf

    NB: To delete directories that contained only empty directories run the command again.

    Was this answer helpful?

    0 comments No comments
  3. Anonymous
    2015-12-28T18:08:10+00:00

    nahi ho raha hai bhai....nekar hai method.

    Was this answer helpful?

    0 comments No comments
  4. Anonymous
    2016-01-29T02:25:25+00:00

    I get the following from PowerShell:

    PS Y:> dir -Directory -Recurse | where {($_ | dir).Count -eq 0} | rmdir

    Get-ChildItem : A parameter cannot be found that matches parameter name 'Directory'.

    At line:1 char:15

    • dir -Directory <<<<  -Recurse | where {($_ | dir).Count -eq 0} | rmdir

        + CategoryInfo          : InvalidArgument: (:) [Get-ChildItem], ParameterBindingException

        + FullyQualifiedErrorId : NamedParameterNotFound,Microsoft.PowerShell.Commands.GetChildItemCommand

    Please let me know what I did wrong.  Running Windows 7 Ultimate SP1.

    Thank You!-)

    Was this answer helpful?

    0 comments No comments