Security\_SetFilePermissions
Description
Section titled “Description”Sets access right for a trustee on a file
sRight can be one of the following values:
- F: Full Control
- C: Change
- R: Read
- X: Execute
- E: Read Execute
- W: Write
- D: Delete
Syntax
Section titled “Syntax”Security_SetFilePermissions(sFile, sTrustee, sRight) As Boolean
Parameters
Section titled “Parameters”sDir (String)
Name of the File
sTrustee (String)
A trustee is a user or group. Trustee can either be “Domainname/username” or a Well-known SID’s (Security Identifier)
sRight (String)
Access Right that should be set
Example
Section titled “Example”VBScript
If bStatus Then bStatus = Security_SetFilePermissions(gsProgramFiles & "\CapaInstaller\CapaInstaller.bat", "S-1-5-4", "F")Related functions
Section titled “Related functions”Security functions Security_DenyFileAccess Security_RevokeFilePermissions