Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I'm trying to locate only the hidden files in a given subtree of the file system. The search box in Windows Explorer has facilities for tags like

Date Modified:

or

Size:

Is there a similar tag for hidden? This:

Hidden: true

doesn't seem to work.

Any other alternatives to find only the hidden files?

share|improve this question
    
See social.technet.microsoft.com/Forums/en-US/w7itproui/thread/… for details. –  Karan May 23 '13 at 14:28

2 Answers 2

In the Windows Search, you should be able to use attributes:2.

The attributes are a bit field with the following values:

FILE_ATTRIBUTE_READONLY = 1
FILE_ATTRIBUTE_HIDDEN = 2
FILE_ATTRIBUTE_SYSTEM = 4
FILE_ATTRIBUTE_DIRECTORY = 16
FILE_ATTRIBUTE_ARCHIVE = 32
FILE_ATTRIBUTE_ENCRYPTED = 64
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

Just add the ones you're looking for together.

share|improve this answer
    
Unfortunately, I was not able to get this to work on Windows Server 2008 R-2. Perhaps on another version? –  MgSam May 28 '13 at 13:43
    
@MgSam: Is the Windows Search Service role service installed on the server? It's part of the File Services role. –  Oliver Salzburg May 28 '13 at 14:32

Open up PowerShell, navigate to the desired subtree, and run the following command:

ls -Force | ?{$_.mode -match "h"}
share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.