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 strongm 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
Oct 10, 2003
32
0
0
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
 
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