'===================================================================
'===================================================================
Private Sub RegCreateSubKey(ByVal SubKey As String,
ByVal KeyName As String)
'-------------------------------------------------
'DESCRIPTION:
' Procedure for creating registry subkey.
'--------------------------------------------------
Dim regKey As RegistryKey
regKey = Registry.LocalMachine.OpenSubKey(SubKey, True)
regKey.CreateSubKey(KeyName)
regKey.Close()
End Sub
'===================================================================
'===================================================================
Private Sub RegCreateKeyValue()
'-------------------------------------------------
'DESCRIPTION:
' Procedure for creating registry values.
'--------------------------------------------------
Dim regKey As RegistryKey
regKey = Registry.LocalMachine.OpenSubKey
("SOFTWARE\SampleApplication", True)
regKey.SetValue("Application", "Sample")
regKey.Close()
End Sub
'===================================================================
'===================================================================
Private Sub RegDeleteSubKey()
'-------------------------------------------------
'DESCRIPTION:
' Procedure for deleting a subkey
'--------------------------------------------------
Dim regKey As RegistryKey
regKey = Registry.LocalMachine.OpenSubKey
("SOFTWARE", True)
regKey.DeleteSubkey ("SampleApplication")
regKey.Close()
End Sub
Enjoy:)

Accessing Windows Registry in Visual Basic 2005