DIAdem Help

Property: Attributes for File

  • Updated2024-09-12
  • 1 minute(s) read

Property: Attributes for File

Specifies the attributes of a file.

Object.Attributes
ObjectFile
Object with this property
Object.AttributesEnumeration with read and write access and the following selection terms:
0NormalFolder without attributes.
1ReadOnlyWrite-protected file. Attribute with read and write access.
2HiddenHidden folder. Attribute with read and write access.
4SystemSystem folder Attribute with read and write access.
8VolumeHard disk name. Attribute with read access.
16DirectoryFolder. This attribute is read-only.
32ArchiveChanges were made to the file after the last backup.
Attribute with read and write access.
1024AliasOperator. Attribute with read access.
2048CompressedCompressed file. Attribute with read access.

The following example removes the write-protection of a file:

Sub MakeWritable(sFile)
  Dim fso, oMyFile
  Set fso = CreateObject("Scripting.FileSystemObject")
  Set oMyFile = fso.GetFile(sFile)
  If oMyFile.Attributes and 1 Then
    oMyFile.Attributes = oMyFile.Attributes - 1
  End If
End Sub

Log in to get a better experience