Important Notice: Our web hosting provider recently started charging us for additional visits, which was unexpected. In response, we're seeking donations. Depending on the situation, we may explore different monetization options for our Community and Expert Contributors. It's crucial to provide more returns for their expertise and offer more Expert Validated Answers or AI Validated Answers. Learn more about our hosting issue here.

How to deny write access to a registry key for a user account?

account deny key Registry user write
0

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.

Related Questions

What is your question?

*Sadly, we had to bring back ads too. Hopefully more targeted.

Experts123