PDA

View Full Version : Changing Registry Permissions


Buffman
08-08-2006, 10:52 AM
Hey everyone,

I didn't find anything through the search, but is it possible or does anyone have any ideas for changing the permissions on registry keys? Of course the user would have permission to change reg perms. But i'd like to be able to change read/write for different groups/users, toggle permission inherency, etc.

Also, now that I'm mentioning registry permissions, what about file permissions too?

Any thoughts?

Tek
08-09-2006, 07:21 AM
I'm not sure about registry permissions as I have never tried that, but to get or set file or folder permissions, check out the File.GetAttributes and File.SetAttributes actions.

CWRIGHT
08-14-2006, 08:05 AM
See: http://setacl.sourceforge.net/

I used the SetACL ActiveX control in conjunction with LuaCOM in my AMS project to set both file and registry permissions and it worked well.

Been a while since I used it, but a quick example for you:


System.RegisterActiveX(_SourceFolder.."\\Tools\\Resources\\DLL\\SetACL.ocx");

objSetACL = luacom.CreateObject("SETACL.SetACLCtrl.1");
if (objSetACL) then
objSetACL:SetObject(My_Folder, 1);
objSetACL:SetAction(1);
objSetACL:AddACE("S-1-5-32-545", true, "full", 0, false, 1, 1);
objSetACL:Run();
end
objSetACL = nil;

objSetACL = luacom.CreateObject("SETACL.SetACLCtrl.1");
if (objSetACL) then
objSetACL:SetObject("HKLM\\SOFTWARE\\My_Key", 4);
objSetACL:SetAction(1);
objSetACL:AddACE("S-1-5-32-545", true, "full", 0, false, 1, 1);
objSetACL:Run();
end
objSetACL = nil;

System.UnregisterActiveX(_SourceFolder.."\\Tools\\Resources\\DLL\\SetACL.ocx");