GetAttr

This method returns a number representing the attributes of a file, directory, or folder.

Syntax

filesystem.GetAttr(pathname)

Parameters

filesystem
Reference to a FileSystem control.
pathname
Required. String expression that specifies a file name or directory or a folder name. The pathname can include the directory or folder.

Return Value

Sum of attribute values. The following table shows the sums that can be returned.

Constant
Value
Description
vbNormal 0 Normal
VbReadOnly 1 Read-only
VbHidden 2 Hidden
VbSystem 4 System
VbDirectory 16 Directory or folder
VbArchive 32 File has changed since last backup

Remarks

To determine which attributes are set, use the And operator to perform a bitwise comparison of the value returned by the GetAttr method and the value of the individual file attribute you want. If the result is not zero, that attribute is set for the named file.