I am working on a vbscript that is searching through the file system but I want to ignore hidden folders and special folders such as $RECYCLE.BIN.
On Windows 7 DOCUMENTS AND SETTINGS is a hidden folder and not accessible but comes up as a sub folder of the C:\ drive. Its attributes are 22, so it is hidden. So I thought I could just filter the hidden folders.
So I have the following code:
Const Hidden = 2
...
If Not (item.Attributes And Hidden) Then
g_oLogFile.WriteLine Time() & ":" & vbTab & "Searching for " & item.Name
FindItem p_strItem,item
End If
However, when an item.Attributes = 22 (2+4+16) I am still entering my If statement. Am I missing something on how to implement a check for the Hidden folder attribute?
Thank you.
On Windows 7 DOCUMENTS AND SETTINGS is a hidden folder and not accessible but comes up as a sub folder of the C:\ drive. Its attributes are 22, so it is hidden. So I thought I could just filter the hidden folders.
So I have the following code:
Const Hidden = 2
...
If Not (item.Attributes And Hidden) Then
g_oLogFile.WriteLine Time() & ":" & vbTab & "Searching for " & item.Name
FindItem p_strItem,item
End If
However, when an item.Attributes = 22 (2+4+16) I am still entering my If statement. Am I missing something on how to implement a check for the Hidden folder attribute?
Thank you.