Results 1 to 4 of 4

Thread: Delete Registry Key

  1. #1

    Thread Starter
    Junior Member
    Join Date
    Nov 2005
    Location
    Germany
    Posts
    18

    Delete Registry Key

    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

  2. #2

    Thread Starter
    Junior Member
    Join Date
    Nov 2005
    Location
    Germany
    Posts
    18

    Re: Delete Registry Key

    Any Shell Command to delete the Key would also work...???

  3. #3

  4. #4

    Thread Starter
    Junior Member
    Join Date
    Nov 2005
    Location
    Germany
    Posts
    18

    Re: Delete Registry Key

    Hello,

    It does not work... i even tried RegDelete, RegDel, RegRemove, RegRem, RegErase...

    but none is working..

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width