Set The File Attributes Of Any File

This API call is used to set the file attributes of any file, e.g. Read Only,
Hidden, Normal, etc. To use this API, paste the following code into the
declaration section:

Public Declare Function SetFileAttributes Lib "kernel32" Alias
"SetFileAttributesA" (ByVal lpFileName As String, ByVal dwFileAttributes As
Long) As Long

Then to set the file attributes, type:

Variable = SetFileAttributes ("File Location", Value)

The FileLocation is the location of the file for which you want to set the file
attributes. The Value is the value given of the attribute you want to set. Here
is a table of Values:

Value Attribute
0 Normal (No Attributes)
1 Read Only
2 Hidden
3 Read Only & Hidden

You can try placing other numbers to set other attributes. So, for example, to
make a file hidden and read only that is located at C:\Work\Work.txt, type:
Variable = SetFileAttributes ("C:\Work\Work.txt", 3)

Dig Deeper on Lotus Notes Domino Administration Tools

Start the conversation

Send me notifications when other members comment.

Please create a username to comment.




  • iSeries tutorials's tutorials provide in-depth information on the iSeries. Our iSeries tutorials address areas you need to know about...

  • V6R1 upgrade planning checklist

    When upgrading to V6R1, make sure your software will be supported, your programs will function and the correct PTFs have been ...

  • Connecting multiple iSeries systems through DDM

    Working with databases over multiple iSeries systems can be simple when remotely connecting logical partitions with distributed ...