• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 504
  • Last Modified:

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.
0
MikeMonroe
Asked:
MikeMonroe
  • 2
1 Solution
 
nafeelmCommented:
This is just to give you an idea how you could change information stored in the registry.


You will have to add the 'Registry' unit to the main uses clause.

procedure TMainForm.FormCreate(Sender: TObject);
var Reg: TRegistry;
begin
  Reg := TRegistry.Create;
  Reg.RootKey := HKEY_LOCAL_MACHINE;
  Reg.OpenKey('Software\Borland',False);

  //then you can use
  Reg.ReadString('variable name'); // to read info. from registry

  Reg.WriteString('variable', 'data value'); // to write info. into registry

  Reg.CloseKey;
  Reg.Free;
end;
0
 
tkalchevCommented:
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.

0
 
tkalchevCommented:
0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now