Page 1 of 1

_SaveRegistry() and _RestRegistry()

Posted: Wed Jan 20, 2016 2:52 am
by unixkd
Hi All

I need functions like say _SaveRegistry() and _RestRegistry() that will enable me to save the entire windows registry to disk and restore it when needed.

The functions should receive optional parameters like:

DC_RegQuery( [<nHKey>], [<cRegSubKey>], [<cEntryName>] )

Thanks

Joe

Re: _SaveRegistry() and _RestRegistry()

Posted: Sat Jan 23, 2016 4:50 am
by Auge_Ohr
hm ... do you want to "save" Registry in same Format as do it manuel with RegEdt32.EXE or Reg.EXE ?
c:\Windows\System32\reg.EXE export /?

REG EXPORT Schlüssel Datei[/y]

Schlüssel STAMMSCHLÜSSEL[\Unterschlüssel] (nur lokaler Computer).
STAMMSCHLÜSSEL [ HKLM | HKCU | HKCR | HKU | HKCC ]
Unterschlüssel Vollst. Name eines Registrierungsschlüssels unter dem
STAMMSCHLÜSSEL.

Datei Name der zu exportierenden Datenträgerdatei..

/y Erzwingt das Überschreiben der vorhandenen Datei ohne
Aufforderung.

Beispiele:

REG EXPORT HKLM\Software\MyCo\MyApp AppBkUp.reg
Exportiert alle untergeordnete Schlüssel und Werte des Schlüssels
MyApp in die Datei AppBkUp.reg
same Way you can Import a *.REG File.

if you want use Xbase++ to get Access to Registry you can use Thomas Braun Registry Class.
it include Method where you can travel up/down a Registry Tree to get "Key" and "Value".
regclass.zip
(40.9 KiB) Downloaded 783 times

Re: _SaveRegistry() and _RestRegistry()

Posted: Mon Feb 01, 2016 6:39 am
by unixkd
Hi

Yes, I want to be able to save the entire registry in the reg format and also be able to restore the registry if it gets corrupted for whatever reasons.

Thanks

Joe

Re: _SaveRegistry() and _RestRegistry()

Posted: Mon Feb 01, 2016 8:18 am
by Tom
This. Is. Not. A. Good. Idea.

You don't have any control about what happened between your last Reg-backup and the point of restorage. If anything happened with any application inbetween, you may f*ck the whole system.

Save "your" keys and restore them if needed. Don't do that with the complete registry database.

Re: _SaveRegistry() and _RestRegistry()

Posted: Mon Feb 01, 2016 9:29 am
by rdonnay
This. Is. Not. A. Good. Idea.
Tom - I was wondering who would be the first person to post this great truth.
I thought it might be you. :clap:

That, of course, was the first thing I thought of when this post started.
There is nothing more dangerous than trying to save and restore the registry.

Heisenberg must be rolling in his grave at the idea of it.

Re: _SaveRegistry() and _RestRegistry()

Posted: Mon Feb 01, 2016 12:07 pm
by bwolfsohn
Windows has a system restore point already built in...

don't re-invent the wheel.. especially using a flat tire..