Skip to content

Security\_SetFilePermissions

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

Security_SetFilePermissions(sFile, sTrustee, sRight) As Boolean

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

VBScript

If bStatus Then bStatus = Security_SetFilePermissions(gsProgramFiles & "\CapaInstaller\CapaInstaller.bat", "S-1-5-4", "F")

Scripting Guidelines

Security functions Security_DenyFileAccess Security_RevokeFilePermissions