Here's an alternative approach:
'Get all of the files on the C:\
Dim fileList As IO.FileInfo() = New IO.DirectoryInfo("C:\").GetFiles()
'Stores a file's attributes as a string
Dim atts AsString = String.Empty
'Files marked as Hidden
'------------------------------
Debug.WriteLine("Files marked as Hidden")
Debug.WriteLine(NewString("-"c, 30))
'Loop through each file in the list (on C:\)
ForEach file As IO.FileInfo In fileList
'Get the file's attributes
atts = file.Attributes.ToString()
'View only Hidden Files
If atts.IndexOf(IO.FileAttributes.Hidden.ToString()) > -1 Then _
Debug.WriteLine(file.Name.PadRight(30) & file.Attributes.ToString())
Next
'Files marked as Hidden, System or Archive
'------------------------------
Debug.WriteLine(System.Environment.NewLine)
Debug.WriteLine("Files marked as Hidden, System or Archive")
Debug.WriteLine(NewString("-"c, 30))
'Loop through each file in the list (on C:\)
ForEach file As IO.FileInfo In fileList
'Get the file's attributes
atts = file.Attributes.ToString()
'View Hidden, System, Archive (Use the enumerator's .ToString() method)
If atts.IndexOf(IO.FileAttributes.Hidden.ToString()) > -1 OrElse _
atts.IndexOf(IO.FileAttributes.System.ToString()) > -1 OrElse _
atts.IndexOf(IO.FileAttributes.Archive.ToString()) > -1 Then
Debug.WriteLine(file.Name.PadRight(30) & file.Attributes.ToString())
End If
Next
Stop'View Output Window