Reading registry as restricted user lazarus / 31-LCL ---------------------------------------------------------------------- Eclipticon · 2011-05-15 15:59 Hi, I am readings strings from the registry (using TRegistry) ... code like this works like a charm with an admin account, but returns an empty string when run by a restricted user: Code: [Select]procedure TForm1.Button3Click(Sender: TObject); var   ARegistry: TRegistry; begin   ARegistry := TRegistry.Create;   ARegistry.RootKey := HKEY_LOCAL_MACHINE;   ARegistry.OpenKey('\Software\Microsoft\Windows NT\CurrentVersion', False);   Caption := ARegistry.ReadString('ProductId');   ARegistry.Free; end; I can, however, access the value w/o problems in registry editor. Can anyone provide me with an explanation/solution? Thanks! ---------------------------------------------------------------------- Leledumbo · 2011-05-15 16:05 Try using OpenKeyReadOnly instead of just OpenKey ---------------------------------------------------------------------- Eclipticon · 2011-05-15 16:25 I tried, and it works. Thank you.