procedure TForm1.CmdFileProClick(Sender: TObject);
str : String;
begin
with TRegistry.Create do
try
RootKey := HKEY_LOCAL_MACHINE;
//asiganado la KeyRoot
//ahora abriendo la clave o key
if OpenKey('\Software\Microsoft\Windows\CurrentVersion',
false) then begin
str := ReadString('ProgramFilesDir');
ShowMessage(str);
CloseKey;
end;
finally
Free;
end;
end;