GetAttr

Returns a Long representing the attributes of a file, directory, or folder.

Syntax

filesystem.GetAttr(pathname)

The required pathname argument is a string expression that specifies a file name or directory or folder name. The pathname may include the directory or folder, and the drive.

Return Values

The value returned by GetAttr is the sum of the following attribute values:

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 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.