Registery values backup and restore

M0B3R

New Member
Hello

Let me start by saying I have no background of programing at all and was wondering if someone generous is willing to help me out.
I flash alot of ROMs and have to make the same registry edits everytime (well atleast most of the time)

I am thinking of a very simple prog that will probably have 2 buttons, one backup and the other restore. Once the backup is clicked I would like it to save 3 to 5 registry values in a file somewhere (eg: .reg file) and the restore will obviously restore these values (import these reg files)

Anyone is willing to help a n00b out? I really appreciate ur replies and please take it easy on me, im just another :sign0104:

:sign0089:
m0b3r
 

derez

Expert
Licensed User
Longtime User
The registry library enables you to read keys and values from the registry and write them to the registry.
So what you need to do in backup is to read the specific values and store them in a text file or a binary file. Then for restore you read the values from that file and write them to the registry.

The only problem is that you have to be a member (own a B4ppc s/w) to use the library.

The following is the overview from the help file for the library.

The Registry library allows access to the desktop or the device registry.
Writing to the registry should be done with great care as incorrect settings could damage the computer.
The Registry library includes two files: RegistryDevice.dll - for the device and RegistryDesktop.dll - for the desktop.
Prior to using this library you should add a reference to the library using the Components dialog, add an object of this type and initialize the object with the New1 method.


The registry is divided to four (on the device) or five (on the desktop) root keys.
Using the RootKey method you can choose the relevant root key.


Example:
'Add a Registry object named reg.
Sub Globals
key = "Software\My Application"
End Sub


Sub App_Start
form1.Show
reg.New1
reg.RootKey(reg.rtCurrentUser)
ErrorLabel(NotCreatedYet)
msgbox("The value is: " & reg.GetValue(key,"Settings"))
return
NotCreatedYet: 'creates the subkey if it didn't exist
reg.CreateSubKey("",key)
msgbox("The key was created.")
End Sub


Sub Form1_Close
reg.SetStringValue(key,"Settings","Something important that should be saved in the registry.")
End Sub
 
Last edited:
Top