Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Rhinorhino on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How can i export registry keys as text

Status
Not open for further replies.

MirceaVleju

Programmer
Joined
Oct 10, 2003
Messages
32
Location
RO
The RegSaveKey function only saves registry values an binary.But if i want to save then as text (like you see in .Reg files) what do i have to do?
 
put the keys into string by reading the values and paths, and then saving the string
 
Yes but how do i convert a binary value to a string?
 
Hi there

To Read From a Registry:
procedure TForm1.Button2Click(Sender: TObject);
begin
\\HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\Class\Display
IniFile := TRegIniFile.Create ('HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\Class\Display\');
label1.caption:= IniFile.ReadString( '.0000','(Default)','DriverDesc');
end;
end.

To Write In to Registry:

// changes the beep sound
procedure TForm1.Button1Click(Sender: TObject);
begin
IniFile := TRegIniFile.Create ('AppEvents\Schemes\Apps\.Default\.Default\');
inifile.DeleteKey('.Current','(Default)');
IniFile.writeString('.Current', '', 'c:\alarm.wav');
{in any case destroy the IniFile object}
IniFile.Destroy;
end;

Forgot to mension
var IniFile: TRegIniFile;

Good Luck

Good Luck !
Spent
mail:spentbg@yahoo.com
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top