Set File Attributes Method

The Set File Attributes method sets the file attributes for a specified file. It does not return a value.

You cannot use a wildcard in the pathname argument. If the file is open, you can modify the file attributes, but only if it is opened for Read access.

Format

SetAttr pathname, attributes 

The following table describes the arguments that you can use with this method.

Argument Description

pathname

A string or string expression that evaluates to the name of the file.

attributes

An integer expression that contains the new attributes of the file.

Usage

The following table describes the attributes you can modify.

Value Description

0

Normal file.

1

Read-only file.

2

Hidden file.

4

System file.

32

Archive. File has changed since the last backup.

Example

For an example, see Select Case Statement.