mworthington@ntlworld.com
Guest
[SOLVED] File Attributes
Hi,
I am using the FileSystemObject to get a file (objImage), and need to
determine whether is has both its Hidden and System attributes set.
Help says :
To determine which attributes are set, use the And operator to perform
a bitwise comparison (a bit-by-bit comparison between identically
positioned bits in two numeric expressions) of the value returned by
the Attributes function and the value of the individual file attribute
you want. If the result is not zero, that attribute is set for the
named file.
OK. So can someone please help me understand why the first 2 work, but
the last 2 don't?!
If objImage.Attributes And vbHidden Then MsgBox "vbHidden"
If objImage.Attributes And vbSystem Then MsgBox "vbSystem"
If objImage.Attributes And vbHidden And _
objImage.Attributes And vbSystem Then MsgBox "vbHidden &
vbSystem"
If objImage.Attributes And vbHidden = vbHidden And _
objImage.Attributes And vbSystem = vbSystem Then MsgBox
"vbHidden & vbSystem"
Any guidance is much appreciated!
Cheers,
Mark
Bookmarks