# Security_SetRegPermissions

> Sets access right for a trustee on a Registry Key.

Source: https://docs.capaone.com/capainstaller/vb-scripting-library/security-functions/security-setregpermissions/  
Product: CapaInstaller — a separate CapaSystems product; do not apply this page to any other.

### Description

Sets access right for a trustee on a Registry Key

sRight can be one of the following values:

- F: Full Control
- R: Read
- A: Read Control
- Q: Query Value
- S: Set Value
- C: Create Sub key
- E: Enumerate Sub keys
- Y: Notify
- L: Create Link
- D: Delete
- W: Write DAC
- O: Write owner

### Syntax

Security_SetRegPermissions(sHandle, sKey, sTrustee, sRight, bIncludeSubKeys) As Boolean

### Parameters

#### sHandle (String)

Registry Key

#### sKey (String)

Name of sub key

#### sTrustee (String)

A trustee is a user or group. Trustee can either be "Domainname/username" or a [Well-known SID's](/capainstaller/vb-scripting-library/addendum/well-known-sid-s/) (Security Identifier) 

#### sRight (String)

Access Right that should be set

#### bIncludeSubKey (Boolean)

sInclude sub keys (True/False)

### Example

**VBScript**

```vb
If bStatus Then bStatus = Security_SetRegPermissions("HKLM", "Software\CapaInstaller", "S-1-5-4", "F", True)
```

[Scripting Guidelines](/capainstaller/vb-scripting-library/scripting-guidelines/)

### Related functions

[Security functions](/capainstaller/vb-scripting-library/security-functions/) [Security_DenyRegAccess](/capainstaller/vb-scripting-library/security-functions/security-denyregaccess/) [Security_RevokeRegPermissions](/capainstaller/vb-scripting-library/security-functions/security-revokeregpermissions/) [Constants](/capainstaller/vb-scripting-library/addendum/constants/) [Package Property](/capainstaller/vb-scripting-library/addendum/package-property/) [Variables](/capainstaller/vb-scripting-library/addendum/variables/)
