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 file for a user account?

account deny file 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 sec As TSecurity Dim sd As TSd Dim strFile As String Set sec = CreateTSecurity() \’Grant full access to “groupusers” just deny “testuser1” strFile = “C:\YourPath\Yourfile.txt” Set sd = sec.GetFileSecurity(strFile, thbSI_All) sd.ResetRightsByString “testuser1” sd.ResetRightsByString “groupusers” sd.RevokeByString “testuser1”, thbAM_FILE_GENERIC_WRITE, thbIF_None sd.GrantByString “groupusers”, thbAM_FILE_ALL_ACCESS, thbIF_None, True sec.

Related Questions

What is your question?

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

Experts123