Can't find empty folders using Windows Explorer search function Solved

Page 1 of 2 12 LastLast
  1.    #1

    Can't find empty folders using Windows Explorer search function


    I'm trying to find all folders that are empty. Within Windows Explorer I select the folder, which contains a number of sub-folders. Click in the search box which then brings up the search options at the top of the window. I select All Subfolders; Type as Folders: Size as Empty, which puts into the search box the following statement:-

    kind:=folder size:empty

    It then goes through the motions of searching but doesn't produce any results and I know for a fact there are several empty folders, some of which I specifically made to test this function.

    Any thoughts on what I'm doing wrong or does it just not work.

    Many thanks
      My ComputerSystem Spec

  2.    #2

    Hi, this apparently used to...
    How do I find all the empty folders and delete them. - Microsoft Community

    but not 'now' (I'm on build 1709)

    Other size specifications (non-zero) appear to work.

    There are 3rd party tools:
    7 Tools To Find And Delete Empty Folders in Windows • Raymond.CC

    Tools like Ultrasearch, Everything, don't help here as far as I can see.

    XYPlorer can- but it uses the NTFS MFT to list folder sizes, which explorer can't.
    Click image for larger version. 

Name:	1.jpg 
Views:	37 
Size:	58.1 KB 
ID:	216722
      My ComputersSystem Spec


  3. Posts : 248
    Microsoft Windows 10 Home
       #3

    You can use PowerShell. Assumed you're in the top-level folder you want to search, the command is:

    Code:
    gci -recurse -Directory | ?{(gci $_.Fullname).count -eq 0}
    and for a list of their fully-qualified paths:

    Code:
    gci -recurse -Directory | ?{(gci $_.Fullname).count -eq 0} | select -expand FullName
    Keith
      My ComputerSystem Spec

  4.    #4

    Thanks for the replies. I'll try a couple of your suggestions and see what works best for me.
      My ComputerSystem Spec

  5.    #5

    Thank you @dalchina for the link to the various "Empty Folder Tools".

    Do you know a tool that is still mantained and get localized for a non english Windows 10 b1903?
    (I would like to see a german context menu entry for such a tool )
      My ComputerSystem Spec

  6.    #6

    Hi, you'd need to search for such a tool or check which languages it supports.

    Otherwise you could change the context menu entry yourself, using one of the various context menu editing tools around.

    My guess as to why e.g.
    folder:size<1
    and similar, whilst highlighted as valid syntax, doesn't work is that Windows does not size folders by design.
      My ComputersSystem Spec


  7. Try3's Avatar
    Posts : 2,297
    Windows 10 Home x64 and Pro x86
       #7

    KeithM said: View Post
    You can use PowerShell. Assumed you're in the top-level folder you want to search, the command is: ...and for a list of their fully-qualified paths:
    Code:
    gci -recurse -Directory | ?{(gci $_.Fullname).count -eq 0} | select -expand FullName
    Keith,

    This picked up several correct folders but also one that contained two shortcuts [.lnk files, total size 3KB].

    Is there a way of avoiding this?

    Denis
      My ComputerSystem Spec


  8. Posts : 248
    Microsoft Windows 10 Home
       #8

    Try3 said: View Post
    This picked up several correct folders but also one that contained two shortcuts [.lnk files, total size 3KB].
    Is there a way of avoiding this?
    Denis
    Do those files have hidden or system attributes set? Does using the -force parameter change your results?

    Code:
    gci -recurse -Directory | ?{(gci $_.Fullname -force).count -eq 0} | select -expand FullName
    Keith
      My ComputerSystem Spec

  9.   My ComputersSystem Spec

  10. Try3's Avatar
    Posts : 2,297
    Windows 10 Home x64 and Pro x86
       #10

    KeithM said: View Post
    Do those files have hidden or system attributes set? Does using the -force parameter change your results?
    Code:
    gci -recurse -Directory | ?{(gci $_.Fullname -force).count -eq 0} | select -expand FullName
    Keith
    Keith,

    No, they are just standard shortcuts - they have no attributes set but I also tried with their A bits on just for a laugh.

    Click image for larger version. 

Name:	Test folder - contents.PNG 
Views:	9 
Size:	5.7 KB 
ID:	242684

    No, the -force argument makes no dfference.

    - - - - - - - - - - - -

    The folder was called Repair-Volume [ChkDsk]. After I renamed it Repair-Volume ChkDsk I had correct results.
    - To confirm the cause I created another folder with [] in its name and the same thing happened until I removed the [].
    - PS cannot accept even a CD command to a folder with [] in its name.

    So the problem is solved and I've learnt not to include any symbols in folder names if I want to use PS processing.

    This lesson has been valuable so thank you.

    Denis
      My ComputerSystem Spec


 
Page 1 of 2 12 LastLast

Related Threads
A Google search seemed to come up with quite a few scripts as well as CMD instructions but if I can I would like to avoid that procedure since no telling what kind of damage I could cause : ) I followed one instruction that had me just use the...
Hi, how is it done in Win Explorer, to find search terms including a dot ? search for 10.20 to find the file abc_10.20.pdf ? Right now i receive 0 results, although the file exists. Regards, Frank
i read alot about this, yes i did index everything. idk wat else to try, please help. iv been using windows 8 for a few years, search also sucked, so i eventually started using explorer to search for my files. not practical at all, i was hoping win...
Hello, I have recently been tasked with upgrading my office to Windows 10 Professional from Windows 7. For a few weeks we encountered just minor bugs mostly caused by software compatibility. Recently however, I have found that some computers...
As the title implies, the search function on the Explore window does not work but only when Explore is being used by another program to open a file. That is a if I were to open Explore by itself I can search just fine. If on the other hand I open up...
Our Sites
Site Links
About Us
Windows 10 Forums is an independent web site and has not been authorized, sponsored, or otherwise approved by Microsoft Corporation. "Windows 10" and related materials are trademarks of Microsoft Corp.

© Designer Media Ltd
All times are GMT -5. The time now is 20:06.
Find Us