Search for (LIST) hidden Folders?


varxtis

Well-known member
Local time
2:25 AM
Posts
22
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

System One

  • 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

System One System Two

  • OS
    Win11 Pro 24H2
    Computer type
    PC/Desktop
    Manufacturer/Model
    Self-built
    CPU
    Intel i7 11700K
    Motherboard
    ASUS Prime Z590-A MB
    Memory
    64GB (Waiting for warranty replacement of another 64GB for 128GB total)
    Graphics Card(s)
    No GPU - Built-in Intel Graphics
    Sound Card
    Integrated
    Monitor(s) Displays
    HP Envy 32
    Screen Resolution
    2560 x 1440
    Hard Drives
    1 x 1TB NVMe SSD
    1 x 2TB NVMe SSD
    1 x 4TB NVMe SSD
    3 x 512GB 2.5" SSD
    1 x 4TB 2.5" SSD
    5 x 8TB Seagate Barracuda HDD
    PSU
    Corsair HX850i
    Case
    Corsair iCUE RGB 5000X mid tower case
    Cooling
    Noctua NF-S12A chromax.black.swap case fans (Qty. 7) & Home Computer Specifications, Configuration, and Usage Notes General Specifications ASUS Prime Z590-A motherboard, serial number M1M0KC222467ARP Intel Core i7-11700K CPU (11th Gen Rocket Lake / LGA 1200 Socket) 128GB Crucial Ballistix RGB DDR4 3200 MHz DRAM (4 x 32GB) Corsair iCUE RGB 5000X mid tower case Noctua NH-D15 chromax.black CPU cooler Noctua NF-S12A chromax.black.swap case fans (Qty. 7) & Corsair LL-120 RGB Fans (Qty. 3)
    Keyboard
    Corsair K70 Max RGB Magnetic Keyboard
    Mouse
    Logitech MX Master 3
    Internet Speed
    1Gb Up / 1 Gb Down
    Browser
    Edge
    Antivirus
    Windows Defender
    Other Info
    The five 8TB drives and three 512GB SSDs are part of a DrivePool using StableBit DrivePool software. The three SSDs are devoted purely to caching for the 8TB drives. All of the important data is stored in triplicate so that I can withstand simultaneous failure of 2 disks.

    Networking: 2.5Gbps Ethernet and WiFi 6e
  • Operating System
    Win11 Pro 23H2
    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
    Mouse
    Buttonless Glass Precision Touchpad
    Keyboard
    Backlit, spill resistant keyboard
    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

System One

  • OS
    Windows 11 23H2
    Computer type
    PC/Desktop
    Manufacturer/Model
    custom
    CPU
    intel i7-8700 (non-K)
    Motherboard
    Asus Z370 TUF Gaming
    Memory
    32Gb
    Graphics Card(s)
    On-board Intel iGPU
    Sound Card
    On-board Realtek
    Hard Drives
    Samsung_SSD_850_EVO
    PSU
    Corsair Rm850X
    Cooling
    All air
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

System One

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

My Computer

System One

  • OS
    Windows 11 23H2
    Computer type
    PC/Desktop
    Manufacturer/Model
    custom
    CPU
    intel i7-8700 (non-K)
    Motherboard
    Asus Z370 TUF Gaming
    Memory
    32Gb
    Graphics Card(s)
    On-board Intel iGPU
    Sound Card
    On-board Realtek
    Hard Drives
    Samsung_SSD_850_EVO
    PSU
    Corsair Rm850X
    Cooling
    All air
@_@ ... 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

System One

  • 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

System One

  • 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

System One System Two

  • OS
    Win11 Pro 24H2
    Computer type
    PC/Desktop
    Manufacturer/Model
    Self-built
    CPU
    Intel i7 11700K
    Motherboard
    ASUS Prime Z590-A MB
    Memory
    64GB (Waiting for warranty replacement of another 64GB for 128GB total)
    Graphics Card(s)
    No GPU - Built-in Intel Graphics
    Sound Card
    Integrated
    Monitor(s) Displays
    HP Envy 32
    Screen Resolution
    2560 x 1440
    Hard Drives
    1 x 1TB NVMe SSD
    1 x 2TB NVMe SSD
    1 x 4TB NVMe SSD
    3 x 512GB 2.5" SSD
    1 x 4TB 2.5" SSD
    5 x 8TB Seagate Barracuda HDD
    PSU
    Corsair HX850i
    Case
    Corsair iCUE RGB 5000X mid tower case
    Cooling
    Noctua NF-S12A chromax.black.swap case fans (Qty. 7) & Home Computer Specifications, Configuration, and Usage Notes General Specifications ASUS Prime Z590-A motherboard, serial number M1M0KC222467ARP Intel Core i7-11700K CPU (11th Gen Rocket Lake / LGA 1200 Socket) 128GB Crucial Ballistix RGB DDR4 3200 MHz DRAM (4 x 32GB) Corsair iCUE RGB 5000X mid tower case Noctua NH-D15 chromax.black CPU cooler Noctua NF-S12A chromax.black.swap case fans (Qty. 7) & Corsair LL-120 RGB Fans (Qty. 3)
    Keyboard
    Corsair K70 Max RGB Magnetic Keyboard
    Mouse
    Logitech MX Master 3
    Internet Speed
    1Gb Up / 1 Gb Down
    Browser
    Edge
    Antivirus
    Windows Defender
    Other Info
    The five 8TB drives and three 512GB SSDs are part of a DrivePool using StableBit DrivePool software. The three SSDs are devoted purely to caching for the 8TB drives. All of the important data is stored in triplicate so that I can withstand simultaneous failure of 2 disks.

    Networking: 2.5Gbps Ethernet and WiFi 6e
  • Operating System
    Win11 Pro 23H2
    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
    Mouse
    Buttonless Glass Precision Touchpad
    Keyboard
    Backlit, spill resistant keyboard
    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

System One

  • 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

System One System Two

  • OS
    Win11 Pro 24H2
    Computer type
    PC/Desktop
    Manufacturer/Model
    Self-built
    CPU
    Intel i7 11700K
    Motherboard
    ASUS Prime Z590-A MB
    Memory
    64GB (Waiting for warranty replacement of another 64GB for 128GB total)
    Graphics Card(s)
    No GPU - Built-in Intel Graphics
    Sound Card
    Integrated
    Monitor(s) Displays
    HP Envy 32
    Screen Resolution
    2560 x 1440
    Hard Drives
    1 x 1TB NVMe SSD
    1 x 2TB NVMe SSD
    1 x 4TB NVMe SSD
    3 x 512GB 2.5" SSD
    1 x 4TB 2.5" SSD
    5 x 8TB Seagate Barracuda HDD
    PSU
    Corsair HX850i
    Case
    Corsair iCUE RGB 5000X mid tower case
    Cooling
    Noctua NF-S12A chromax.black.swap case fans (Qty. 7) & Home Computer Specifications, Configuration, and Usage Notes General Specifications ASUS Prime Z590-A motherboard, serial number M1M0KC222467ARP Intel Core i7-11700K CPU (11th Gen Rocket Lake / LGA 1200 Socket) 128GB Crucial Ballistix RGB DDR4 3200 MHz DRAM (4 x 32GB) Corsair iCUE RGB 5000X mid tower case Noctua NH-D15 chromax.black CPU cooler Noctua NF-S12A chromax.black.swap case fans (Qty. 7) & Corsair LL-120 RGB Fans (Qty. 3)
    Keyboard
    Corsair K70 Max RGB Magnetic Keyboard
    Mouse
    Logitech MX Master 3
    Internet Speed
    1Gb Up / 1 Gb Down
    Browser
    Edge
    Antivirus
    Windows Defender
    Other Info
    The five 8TB drives and three 512GB SSDs are part of a DrivePool using StableBit DrivePool software. The three SSDs are devoted purely to caching for the 8TB drives. All of the important data is stored in triplicate so that I can withstand simultaneous failure of 2 disks.

    Networking: 2.5Gbps Ethernet and WiFi 6e
  • Operating System
    Win11 Pro 23H2
    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
    Mouse
    Buttonless Glass Precision Touchpad
    Keyboard
    Backlit, spill resistant keyboard
    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

System One

  • OS
    Windows 7
Back
Top Bottom