DelphiFAQ Home Search:
General :: Programming :: Delphi :: Network
Network (local network and Internet) programming under Windows with Delphi.

Articles:

This list is sorted by recent document popularity (not total page views).
New documents will first appear at the bottom.

Featured Article

Accessing a remote registry over the network

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!
Generated 16:01:26 on Nov 12, 2018