M
Matt Brandes
I am looking for a solution that would allow me to recursively backup a
given registry key that I could then use to import into another machine.
The problem that I keep having is the inability to specify the type of data
in the key and get that data output to screen or file. Specifically
Reg_Binary or Reg_Multi_Sz
Here is just the latest hack that I am working with, most of which is
directly from msdn. Any suggestions or modification that would accomplish
that goal would be appreciated.
Dim RegKey As RegistryKey =
Registry.LocalMachine.OpenSubKey("SYSTEM\CurrentControlSet\Services\LanmanSe
rver\Shares")
Console.WriteLine("There are {0} subkeys under " & RegKey.Name &
".", _
RegKey.SubKeyCount.ToString())
Console.WriteLine(vbCrLf & "There are {0} values for " & _
"{1}.", RegKey.ValueCount.ToString(), RegKey.Name)
For Each valueName As String In RegKey.GetValueNames()
Console.WriteLine("{0,-8}: {1}", valueName, _
RegKey.GetValue(valueName.tostring))
Next
For Each subKeyName As String In RegKey.GetSubKeyNames()
Dim tempKey As RegistryKey = _
RegKey.OpenSubKey(subKeyName)
Console.WriteLine(vbCrLf & "There are {0} values for " & _
"{1}.", tempKey.ValueCount.ToString(), tempKey.Name)
For Each valueName As String In tempKey.GetValueNames()
Console.WriteLine("{0,-8}: {1}", valueName, _
tempKey.GetValue(valueName.ToString))
Next
Next
End
Thanks in Advance,
Matt
given registry key that I could then use to import into another machine.
The problem that I keep having is the inability to specify the type of data
in the key and get that data output to screen or file. Specifically
Reg_Binary or Reg_Multi_Sz
Here is just the latest hack that I am working with, most of which is
directly from msdn. Any suggestions or modification that would accomplish
that goal would be appreciated.
Dim RegKey As RegistryKey =
Registry.LocalMachine.OpenSubKey("SYSTEM\CurrentControlSet\Services\LanmanSe
rver\Shares")
Console.WriteLine("There are {0} subkeys under " & RegKey.Name &
".", _
RegKey.SubKeyCount.ToString())
Console.WriteLine(vbCrLf & "There are {0} values for " & _
"{1}.", RegKey.ValueCount.ToString(), RegKey.Name)
For Each valueName As String In RegKey.GetValueNames()
Console.WriteLine("{0,-8}: {1}", valueName, _
RegKey.GetValue(valueName.tostring))
Next
For Each subKeyName As String In RegKey.GetSubKeyNames()
Dim tempKey As RegistryKey = _
RegKey.OpenSubKey(subKeyName)
Console.WriteLine(vbCrLf & "There are {0} values for " & _
"{1}.", tempKey.ValueCount.ToString(), tempKey.Name)
For Each valueName As String In tempKey.GetValueNames()
Console.WriteLine("{0,-8}: {1}", valueName, _
tempKey.GetValue(valueName.ToString))
Next
Next
End
Thanks in Advance,
Matt