07-16-2013 06:51 PM
Are you referring to my SetFileSecurityAccess-Windows-dotNET.vi?
It is called SET file security access, not "clear" file security access. So technically it is fully working, you just want it to do something else.
Did you try changing the "AddAccessRule" node to "RemoveAccessRule"? I haven't tried it but it seems logical.
07-17-2013 07:16 AM
Did you try changing the "AddAccessRule" node to "RemoveAccessRule"? I haven't tried it but it seems logical.
I did, but it doesn't work either.
07-17-2013 06:16 PM
Well I just tried it and it worked.
I created a new user access rule on a file for the "Guests" user to have full control.
Then I modified the SetFileSecurityAccess VI as below, ran it, and the security access was cleared.
Notice I did this using what I knew to be the username rather than looking up the username from the SID. It simplifies the VI but makes it harder to use if you don't know the username.
See security tab for file before and after.
This is just an educated guess but two things may be preventing a change to security access rules (excluding admin rights):
You may need to remove "inheritance" from the file properties if it is inheriting the access rule from it's parent folder.
The file system itself may be preventing a change if clearing access rules results in nobody having access rights.