Skip to content

File_SetFileAttributes

Sets specified attribute on file

File_SetFileAttributes(sFile, iAttribute, bMustExist) As Boolean

Filename

Constants to set

File must exist. In the current version of the library, this parameter has no effect: the function always returns False if the file doesn’t exist.

If the file doesn’t already have the attribute, the function replaces all the file’s attributes with iAttribute. For example, setting FILE_HIDDEN on a read-only file removes the read-only attribute. To keep several attributes, add the constants together, for example FILE_READONLY + FILE_HIDDEN.

If bStatus Then bStatus = File_SetFileAttributes("C:\CapaInstaller.txt", FILE_READONLY, False)

Scripting Guidelines

File_RemoveFileAttributes File_SetTreeAttributes