DelphiFAQ Home Search:

Accessing a remote registry over the network

 

comments4 comments. Current rating: 5 stars (1 votes). Leave comments and/ or rate it.

Question:

For remote administration, my tool needs to access the registry of all computers on our network. How can I do that in Delphi?

Answer:

The regular registry class provides a method for this: TRegistry.RegistryConnect(). Before calling RegistryConnect, you need to assign property RootKey for its registry object to HKEY_USERS or HKEY_LOCAL_MACHINE.

uses
  Registry;

var
  Red: TRegistry;
begin
  Reg := TRegistry.Create;
  with Reg do 
  begin
    RootKey := HKEY_LOCAL_MACHINE;
    RegistryConnect('\\peters_notebook');
    OpenKeyReadOnly('Software\Microsoft');
    Free;
  end;
end;
You don't like the formatting? Check out SourceCoder then!

Comments:

2005-11-17, 01:24:09
rec83@hotmail.com from Bolivia  
I have a question, please I need help. I've tried RegistryConnect() but is not working, my question is what are the restrictions for RegistryConnect ??? what can I do?
2006-08-28, 03:36:22
anonymous from China  
WriteString('test','AB'); //It is not working here! Somebody help me !
2006-09-15, 09:23:17
anonymous from Germany  
Hi rec83,

I had the same problem when I used ip adresses. When I used hostname it works.

nightfighter
2007-06-26, 02:59:40
laskar_adam@yahoo.co.id from Indonesia  
rating
how repair network with delphi

 

 

NEW: Optional: Register   Login
Email address (not necessary):

Rate as
Hide my email when showing my comment.
Please notify me once a day about new comments on this topic.
Please provide a valid email address if you select this option, or post under a registered account.
 

Show city and country
Show country only
Hide my location
You can mark text as 'quoted' by putting [quote] .. [/quote] around it.
Please type in the code:

Please do not post inappropriate pictures. Inappropriate pictures include pictures of minors and nudity.
The owner of this web site reserves the right to delete such material.

photo Add a picture: