File_SetFileAttributes
Description
Section titled “Description”Sets specified attribute on file
Syntax
Section titled “Syntax”File_SetFileAttributes(sFile, iAttribute, bMustExist) As Boolean
Parameters
Section titled “Parameters”sFile (String)
Section titled “sFile (String)”Filename
iAttribute (Integer)
Section titled “iAttribute (Integer)”Constants to set
bMustExist (Boolean)
Section titled “bMustExist (Boolean)”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.
Remarks
Section titled “Remarks”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.
Example
Section titled “Example”If bStatus Then bStatus = File_SetFileAttributes("C:\CapaInstaller.txt", FILE_READONLY, False)