Search for (LIST) hidden Folders?


varxtis

Well-known member
Local time
12:27 PM
Posts
23
OS
Windows 10
I need a way of searching for and listing Hidden folders within a directory. I'm not referring to showing hidden folders, making hidden folders visible, not reveal. I already have File Explorer "showing" hidden folders. I just need a way of searching for and listing hidden folders in File Explorer, without add-ons like voidtools.com.
 

My Computer My Computer

At a glance

Windows 10
OS
Windows 10
That's a good question.

Using "Windows Search Syntax" you can perform all sorts of advanced searches. For example, in the search box you could include "kind:folder" and then only folders matching your criteria will be displayed. You can also select these options via the "search options" in the File Explorer GUI. What's odd is that I know that you should be able to also add "attributes:hidden" but this does not seem to work. You can tell that File Explorer recognizes these keywords because as you type "attributes:" you will see the color change indicating a recognized keyword. Likewise, once you finish and add the word "hidden" you will see that it too changes color. However, it simply does not work.

Bottom line is that I cannot tell you how to do this in File Explorer, but I can tell you how to do this from a command line.

Try this:

DIR /ADH

The /A tells dir to display items matching the specified attributes. The "D" tells it to show only directories, the "H" tells it to display items that are hidden. Combined, this tells dir to show hidden directories only. To include subdirectories, add a /S like this:

DIR /ADH /S

Finally, consider adding a /B to show the output in "bare" format without all the annoying header info like this:

DIR /ADH /S /B

I hope that this helps and that someone else can maybe provide a way to do this in File Explorer.
 

My Computers My Computers

  • At a glance

    Win11 Pro 25H2 (RTM+)Intel i7-14650HX32 GBNo GPU - Built-in Intel Graphics
    OS
    Win11 Pro 25H2 (RTM+)
    Computer type
    PC/Desktop
    Manufacturer/Model
    Acemagic
    CPU
    Intel i7-14650HX
    Memory
    32 GB
    Graphics Card(s)
    No GPU - Built-in Intel Graphics
    Sound Card
    Integrated
    Monitor(s) Displays
    Varies as machine will often be moved to locations with different monitors
    Screen Resolution
    Varies
    Hard Drives
    1 x 1TB Gen 4 NVMe SSD
    PSU
    120W Power Brick
    Keyboard
    Corsair K70 Max RGB Magnetic Keyboard
    Mouse
    Logitech MX Master 3
    Internet Speed
    1Gb Up / 1 Gb Down
    Browser
    Edge
    Antivirus
    Windows Defender
  • At a glance

    Win11 Pro 25H2 (RTM+)Intel i7-1255U16 GBIntel Iris Xe Graphics
    Operating System
    Win11 Pro 25H2 (RTM+)
    Computer type
    Laptop
    Manufacturer/Model
    Lenovo ThinkBook 13x Gen 2
    CPU
    Intel i7-1255U
    Memory
    16 GB
    Graphics card(s)
    Intel Iris Xe Graphics
    Sound Card
    Realtek® ALC3306-CG codec
    Monitor(s) Displays
    13.3-inch IPS Display
    Screen Resolution
    WQXGA (2560 x 1600)
    Hard Drives
    2 TB 4 x 4 NVMe SSD
    PSU
    USB-C / Thunderbolt 4 Power / Charging
    Keyboard
    Backlit, spill resistant keyboard
    Mouse
    Buttonless Glass Precision Touchpad
    Internet Speed
    1Gb Up / 1Gb Down
    Browser
    Edge
    Antivirus
    Windows Defender
    Other Info
    WiFi 6e / Bluetooth 5.1 / Facial Recognition / Fingerprint Sensor / ToF (Time of Flight) Human Presence Sensor
To be able to show a list of Hidden folders in Explorer, you might try an Explorer Search with following search item in the specific folder or drive:

Code:
Attributes: (18 OR 19 OR 50 OR 51 OR 8210 OR 8211 OR OR 8142 OR 8243)

This would list only Directories (whether or not their contents are Indexed or not) with the Hidden + attrib combinations shown below, but not with the System attrib.
To include any further specific Attributes, you need to extend the search term with additional Attribute values.

eg: have a look here (to see how to get the Attribute Total values).

(Hopefully, one of the Gurus can help further if there are any issues.)

Attributes as shown in Explorer and their Attribute Constants(Totals) as per the lists mentioned in the above links.
Code:
Directory            2
Hidden              16    =18

Directory             2
Hidden               16
Read Only             1   =19

Directory             2
Hidden               16
Archive              32   =50

Directory             2
Hidden               16
ReadOnly              1
Archive              32   =51

Also add 8192 for dir without content indexing
18 + 8192 = 8210 
19 + 8192 = 8211
50 + 8192 = 8242
51 + 8192 = 8243

Search Term:
Attributes: (18 OR 19 OR 50 OR 51 OR 8210 OR 8211 OR 8242 OR 8243)
 

My Computer My Computer

At a glance

Win 11 25H2intel i7-870032GbIntel iGPU
OS
Win 11 25H2
Computer type
PC/Desktop
Manufacturer/Model
custom
CPU
intel i7-8700
Motherboard
Asus Z370 TUF Gaming
Memory
32Gb
Graphics Card(s)
Intel iGPU
Sound Card
Realtek
Hard Drives
Samsung
PSU
Corsair
Cooling
Fans
das10's results are correct, but he switched the values for HIDDEN and DIRECTORY.
Keep this in mind this if you're only looking for hidden files (subtract 16 from each result).
Code:
FILE_ATTRIBUTE_READONLY      = 1
FILE_ATTRIBUTE_HIDDEN        = 2
FILE_ATTRIBUTE_SYSTEM        = 4
FILE_ATTRIBUTE_DIRECTORY     = 16
FILE_ATTRIBUTE_ARCHIVE       = 32
FILE_ATTRIBUTE_ENCRYPTED     = 64 or 16384
FILE_ATTRIBUTE_NORMAL        = 128
FILE_ATTRIBUTE_TEMPORARY     = 256
FILE_ATTRIBUTE_SPARSE_FILE   = 512
FILE_ATTRIBUTE_REPARSE_POINT = 1024
FILE_ATTRIBUTE_COMPRESSED    = 2048
FILE_ATTRIBUTE_OFFLINE       = 4096
FILE_ATTRIBUTE_NOT_CONTENT_INDEXED = 8192

Here's another way to visualize the combinations:
Code:
+R +H +A = 51
+R +H -A = 19
+R -H +A = visible
+R -H -A = visible
-R +H +A = 50
-R +H -A = 18
-R -H +A = visible
-R -H -A = visible

attributes:(18 OR 19 OR 50 OR 51)
 

My Computer My Computer

At a glance

Windows 7
OS
Windows 7
@garlin, yes, I made a mistake whilst transcribing my notes to the post :)
 

My Computer My Computer

At a glance

Win 11 25H2intel i7-870032GbIntel iGPU
OS
Win 11 25H2
Computer type
PC/Desktop
Manufacturer/Model
custom
CPU
intel i7-8700
Motherboard
Asus Z370 TUF Gaming
Memory
32Gb
Graphics Card(s)
Intel iGPU
Sound Card
Realtek
Hard Drives
Samsung
PSU
Corsair
Cooling
Fans
@_@ ... so. . . If I go to any given directory (Documents for instance)
Just type <attribute 2 16>?
I figure thats not right since nothing showed up. Though this could mean I have no hidden folders/sub-directories
 

My Computer My Computer

At a glance

Windows 10
OS
Windows 10
The irony is for Explorer search to display which hidden folders are found, you must have Hidden folders set to visible.
This desktop is W10, but the same principle applies to 11.

Capture.PNG
 

My Computer My Computer

At a glance

Windows 7
OS
Windows 7
Good discussion! That worked for me. Searching with attributes:18 found all the hidden folders for me.

Why is documentation on this stuff so hard to find from Microsoft?

This is one to bookmark for sure!
 

My Computers My Computers

  • At a glance

    Win11 Pro 25H2 (RTM+)Intel i7-14650HX32 GBNo GPU - Built-in Intel Graphics
    OS
    Win11 Pro 25H2 (RTM+)
    Computer type
    PC/Desktop
    Manufacturer/Model
    Acemagic
    CPU
    Intel i7-14650HX
    Memory
    32 GB
    Graphics Card(s)
    No GPU - Built-in Intel Graphics
    Sound Card
    Integrated
    Monitor(s) Displays
    Varies as machine will often be moved to locations with different monitors
    Screen Resolution
    Varies
    Hard Drives
    1 x 1TB Gen 4 NVMe SSD
    PSU
    120W Power Brick
    Keyboard
    Corsair K70 Max RGB Magnetic Keyboard
    Mouse
    Logitech MX Master 3
    Internet Speed
    1Gb Up / 1 Gb Down
    Browser
    Edge
    Antivirus
    Windows Defender
  • At a glance

    Win11 Pro 25H2 (RTM+)Intel i7-1255U16 GBIntel Iris Xe Graphics
    Operating System
    Win11 Pro 25H2 (RTM+)
    Computer type
    Laptop
    Manufacturer/Model
    Lenovo ThinkBook 13x Gen 2
    CPU
    Intel i7-1255U
    Memory
    16 GB
    Graphics card(s)
    Intel Iris Xe Graphics
    Sound Card
    Realtek® ALC3306-CG codec
    Monitor(s) Displays
    13.3-inch IPS Display
    Screen Resolution
    WQXGA (2560 x 1600)
    Hard Drives
    2 TB 4 x 4 NVMe SSD
    PSU
    USB-C / Thunderbolt 4 Power / Charging
    Keyboard
    Backlit, spill resistant keyboard
    Mouse
    Buttonless Glass Precision Touchpad
    Internet Speed
    1Gb Up / 1Gb Down
    Browser
    Edge
    Antivirus
    Windows Defender
    Other Info
    WiFi 6e / Bluetooth 5.1 / Facial Recognition / Fingerprint Sensor / ToF (Time of Flight) Human Presence Sensor
Another way is to use PowerShell:
powershell (Get-ChildItem "C:\Users\GARLIN" -Hidden -Directory -Recurse).FullName

Edit: Forgot the -Recurse argument to look for sub-folders.
 
Last edited:

My Computer My Computer

At a glance

Windows 7
OS
Windows 7
@_@ ... so. . . If I go to any given directory (Documents for instance)
Just type <attribute 2 16>?
I figure thats not right since nothing showed up. Though this could mean I have no hidden folders/sub-directories
Use this:

attributes:18

You need to add the values together, you want "attributes" (plural with an s), and you need the colon (:).
 

My Computers My Computers

  • At a glance

    Win11 Pro 25H2 (RTM+)Intel i7-14650HX32 GBNo GPU - Built-in Intel Graphics
    OS
    Win11 Pro 25H2 (RTM+)
    Computer type
    PC/Desktop
    Manufacturer/Model
    Acemagic
    CPU
    Intel i7-14650HX
    Memory
    32 GB
    Graphics Card(s)
    No GPU - Built-in Intel Graphics
    Sound Card
    Integrated
    Monitor(s) Displays
    Varies as machine will often be moved to locations with different monitors
    Screen Resolution
    Varies
    Hard Drives
    1 x 1TB Gen 4 NVMe SSD
    PSU
    120W Power Brick
    Keyboard
    Corsair K70 Max RGB Magnetic Keyboard
    Mouse
    Logitech MX Master 3
    Internet Speed
    1Gb Up / 1 Gb Down
    Browser
    Edge
    Antivirus
    Windows Defender
  • At a glance

    Win11 Pro 25H2 (RTM+)Intel i7-1255U16 GBIntel Iris Xe Graphics
    Operating System
    Win11 Pro 25H2 (RTM+)
    Computer type
    Laptop
    Manufacturer/Model
    Lenovo ThinkBook 13x Gen 2
    CPU
    Intel i7-1255U
    Memory
    16 GB
    Graphics card(s)
    Intel Iris Xe Graphics
    Sound Card
    Realtek® ALC3306-CG codec
    Monitor(s) Displays
    13.3-inch IPS Display
    Screen Resolution
    WQXGA (2560 x 1600)
    Hard Drives
    2 TB 4 x 4 NVMe SSD
    PSU
    USB-C / Thunderbolt 4 Power / Charging
    Keyboard
    Backlit, spill resistant keyboard
    Mouse
    Buttonless Glass Precision Touchpad
    Internet Speed
    1Gb Up / 1Gb Down
    Browser
    Edge
    Antivirus
    Windows Defender
    Other Info
    WiFi 6e / Bluetooth 5.1 / Facial Recognition / Fingerprint Sensor / ToF (Time of Flight) Human Presence Sensor
Sorry, @das10 is correct.

attributes:18 only covers DIRECTORY + HIDDEN, but excludes D+H and other combinations of READONLY and ARCHIVE.
There are 8 permutations of R/H/A, but only 4 are interesting (+H).

Capture.PNG
 

My Computer My Computer

At a glance

Windows 7
OS
Windows 7

Latest Support Threads

Back
Top Bottom