Security_SetFilePermissions
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
Security_SetFilePermissions(sFile, sTrustee, sRight) As Boolean
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 (Security Identifier)
sRight (String)
Access Right that should be set
Example
VBScript
If bStatus Then bStatus = Security_SetFilePermissions(gsProgramFiles & "\CapaInstaller\CapaInstaller.bat", "S-1-5-4", "F")
Related functions
Security functions Security_DenyFileAccess Security_RevokeFilePermissions