MikeMonroe
asked on
Registry
I have administrator account. I want to change the permissions for a registry key. I want all the users of a computer to be able to change a certain registry key through my program. How can I do that by Delphi programming? Please, help me.
The registry in NT has permissions just like files. They are set and modified using REGEDT32.EXE.
Browse to the keys or subkeys you want to modify, then select "Security", "Permissions" from the menus. Add permissions just like you would to files and folders, specifying "Replace permission on existing subkeys" if necessary.
To assign all possible permissions, select the root of "HKEY_LOCAL_MACHINE" and "HKEY_USERS". These are really the only 2 root keys. The others are derived.
Once the users have the proper registry permissions, then can use any method available to them to do what they need to do..be it directly using regedit or regedt32, or programmatically.
Browse to the keys or subkeys you want to modify, then select "Security", "Permissions" from the menus. Add permissions just like you would to files and folders, specifying "Replace permission on existing subkeys" if necessary.
To assign all possible permissions, select the root of "HKEY_LOCAL_MACHINE" and "HKEY_USERS". These are really the only 2 root keys. The others are derived.
Once the users have the proper registry permissions, then can use any method available to them to do what they need to do..be it directly using regedit or regedt32, or programmatically.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
You will have to add the 'Registry' unit to the main uses clause.
procedure TMainForm.FormCreate(Sende
var Reg: TRegistry;
begin
Reg := TRegistry.Create;
Reg.RootKey := HKEY_LOCAL_MACHINE;
Reg.OpenKey('Software\Borl
//then you can use
Reg.ReadString('variable name'); // to read info. from registry
Reg.WriteString('variable'
Reg.CloseKey;
Reg.Free;
end;