copy registry parts

midmoon

New member
Joined
Oct 2, 2003
Messages
4
hi, as i am a beginner in vb7, i startet to play with the registry. i know how to read and write into it, but i want to copy a whole branch in the registry (hkeylocalmachine\software\application\xxx )
i want to bachup this xxx in vb and restore it. and the worse is, there are always different words in it ( so i cant write. is there an easy way to do this ? ( Microsoft.Win32.Registry.... or soemthing )like that ?)
 
ok, i found it out... mess my brain
...
key = Microsoft.Win32.Registry.LocalMachine.OpenSubKey(KEY_LOCATION)
Microsoft.Win32.Registry.LocalMachine.CreateSubKey(key_location2)
key2 = Microsoft.Win32.Registry.LocalMachine.OpenSubKey(key_location2, True)

test2 = key.GetValueNames()
anzahl = key.ValueCount

For x = 0 To anzahl - 1
key2.SetValue(test2(x), key.GetValue(test2(x)))
Next x
...
 
Back
Top