How to: Determine if a File is Hidden in Visual Basic
The GetFileInfo method can be used to get a FileInfo object, which contains information about the specified file, including a FileAttributes enumeration.
To determine if a file is hidden
Get a FileInfo object for the file you wish to examine. This example gets a FileInfo object for the file Testfile.txt.
Get a FileAttributes object from the FileInfo object. This example gets FileAttributes from the FileInfo object.
Query FileAttributes to determine if the file is hidden. This example determines if the file is hidden and displays a result accordingly.