_SaveRegistry() and _RestRegistry()

This forum is for general support of Xbase++
Post Reply
Message
Author
User avatar
unixkd
Posts: 575
Joined: Thu Feb 11, 2010 1:39 pm

_SaveRegistry() and _RestRegistry()

#1 Post 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

User avatar
Auge_Ohr
Posts: 1422
Joined: Wed Feb 24, 2010 3:44 pm

Re: _SaveRegistry() and _RestRegistry()

#2 Post 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 881 times
greetings by OHR
Jimmy

User avatar
unixkd
Posts: 575
Joined: Thu Feb 11, 2010 1:39 pm

Re: _SaveRegistry() and _RestRegistry()

#3 Post 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

User avatar
Tom
Posts: 1205
Joined: Thu Jan 28, 2010 12:59 am
Location: Berlin, Germany

Re: _SaveRegistry() and _RestRegistry()

#4 Post 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.
Best regards,
Tom

"Did I offend you?"
"No."
"Okay, give me a second chance."

User avatar
rdonnay
Site Admin
Posts: 4775
Joined: Wed Jan 27, 2010 6:58 pm
Location: Boise, Idaho USA
Contact:

Re: _SaveRegistry() and _RestRegistry()

#5 Post 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.
The eXpress train is coming - and it has more cars.

bwolfsohn
Posts: 649
Joined: Thu Jan 28, 2010 7:07 am
Location: Alachua, Florida USA
Contact:

Re: _SaveRegistry() and _RestRegistry()

#6 Post by bwolfsohn »

Windows has a system restore point already built in...

don't re-invent the wheel.. especially using a flat tire..
Brian Wolfsohn
Retired and traveling around the country to music festivals in my RV.
OOPS.. Corona Virus, so NOT traveling right now...
http://www.breadmanrises.com
FB travel group: The Breadman Rises

Post Reply