Ok, the program can read from and write to a registry entry, but it cannot delete a registry entry. However, I can go inside the registry and delete it manually, so I think I do have administrative rights.
Here's the code I'm using:
VB Code:
Private Sub cmdRemoveAccount_Click() On Error GoTo ErrHandler Set Win32Script = CreateObject("WScript.Shell") Win32Script.RegDelete ("HKEY_LOCAL_MACHINE\SOFTWARE\Gitmail\Main Settings\" & lvwAccounts.SelectedItem) For i = 1 To lvwAccounts.ListItems.Count If lvwAccounts.ListItems(i).Selected = True Then lvwAccounts.ListItems.Remove lvwAccounts.ListItems(i) End If Next i Exit Sub ErrHandler: MsgBox "Error " & Err.Number & ": " & Err.Description, vbCritical, "Can't delete account" Exit Sub End Sub




Reply With Quote