4 comments. Current rating: (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 dobegin
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.