How to deny write access to a registry key for a user account?
The following example grants full permissions to “groupusers” and just denies write access to “testuser1”. “testuser1” is a member of “groupusers”. Example: Dim reg As New THBRegistry Dim regsd As TSd Dim sec As TSecurity Set sec = CreateTSecurity() reg.KeyOpen , “HKEY_LOCAL_MACHINE\Software\YourKey” Set regsd = sec.RegGetKeySecurity(reg.KeyGet, thbSI_DACL_SECURITY_INFORMATION) regsd.ResetRightsByString “testuser1” regsd.ResetRightsByString “groupusers” regsd.RevokeByString “testuser1”, thbAM_KEY_WRITE, thbIF_ThisKeyAndSubkeys regsd.GrantByString “groupusers”, thbAM_KEY_ALL_ACCESS, thbIF_ThisKeyAndSubkeys, True sec.RegSetKeySecurity reg.