Results 1 to 1 of 1

Thread: Problem deleting registry entry in XP... I think I do have admin rights.

  1. #1

    Thread Starter
    Fanatic Member hothead's Avatar
    Join Date
    Mar 2002
    Location
    Missouri
    Posts
    692

    Problem deleting registry entry in XP... I think I do have admin rights.

    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:
    1. Private Sub cmdRemoveAccount_Click()
    2.     On Error GoTo ErrHandler
    3.     Set Win32Script = CreateObject("WScript.Shell")
    4.     Win32Script.RegDelete ("HKEY_LOCAL_MACHINE\SOFTWARE\Gitmail\Main Settings\" & lvwAccounts.SelectedItem)
    5.     For i = 1 To lvwAccounts.ListItems.Count
    6.         If lvwAccounts.ListItems(i).Selected = True Then
    7.             lvwAccounts.ListItems.Remove lvwAccounts.ListItems(i)
    8.         End If
    9.     Next i
    10.     Exit Sub
    11. ErrHandler:
    12.     MsgBox "Error " & Err.Number & ":  " & Err.Description, vbCritical, "Can't delete account"
    13.     Exit Sub
    14. End Sub
    Last edited by hothead; Nov 22nd, 2002 at 05:47 PM.

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