Hi,

I am trying to delete one of the values in my registry using the follwoing code...

The Adding of the value works when i use "Registry.RegWrite".... but deleting is not working...

Private Sub Command1_Click()
If (Text1.Text = "O") Then
Registry_Write "HKEY_CLASSES_ROOT\MailTo\Shell\Open\Command\", "(Default)", """%ProgramFiles%\Outlook Express\msimn.exe""", "REG_EXPAND_SZ"
ElseIf (Text1.Text = "M") Then
Registry_Write "HKEY_CLASSES_ROOT\MailTo\Shell\Open\Command\", "(Default)", """C:\PROGRA~1\MICROS~2\Office\OUTLOOK.EXE""", "REG_SZ"
End If
End Sub

Private Sub Registry_Write(Key_Path As String, Key_Name As String, Key_Value As Variant, Optional Key_Type As String)
On Error Resume Next
Dim Registry As Object
Dim Registry_Value As Variant
Set Registry = CreateObject("WScript.Shell")
If (Key_Type = "") Then
Registry.RegDel Key_Path & Key_Name, Key_Value
Else
Registry.RegDel Key_Path & Key_Name, Key_Value, Key_Type
End If
MsgBox "Done"
End
End Sub


Can any one see and say..hwo to delete the key..

Thanks