Results 1 to 4 of 4

Thread: Deleting a registry key...

  1. #1

    Thread Starter
    Addicted Member theonetrueace's Avatar
    Join Date
    Jan 2002
    Location
    South Alabama
    Posts
    196

    Deleting a registry key...

    *** IS WRONG HERE?!?!?!

    Microsoft.Win32.Registry.LocalMachine.DeleteSubKey("reg://HKEY_CURRENT_USER\Software\GameSpy\GameSpy 3D\Registration\Crypt")

    Crypt has a value....trying to totally delete Crypt

    it says it cant find a subkeytree for the path....

    I NO ITS THERE!

    HELP PLZZZZZ!

  2. #2
    l33t! MrPolite's Avatar
    Join Date
    Sep 2001
    Posts
    4,428

    Re: Deleting a registry key...

    Originally posted by theonetrueace
    *** IS WRONG HERE?!?!?!

    Microsoft.Win32.Registry.LocalMachine.DeleteSubKey("reg://HKEY_CURRENT_USER\Software\GameSpy\GameSpy 3D\Registration\Crypt")

    Crypt has a value....trying to totally delete Crypt

    it says it cant find a subkeytree for the path....

    I NO ITS THERE!

    HELP PLZZZZZ!
    meh, found your problem
    first of all if the subkey isnt empty you should use the DeleteSubKeyTree method. Second, the path doesnt exist, it's right. why? because you are trying to access "LocalMachinereg://HKEY_CURRENT_USER\Software\GameSpy\GameSpy 3D\Registration\Crypt"

    since you are using Registy.LocalMachine, you dont need to use the compelete path in the argument. Use this instead:
    VB Code:
    1. Microsoft.Win32.Registry.LocalMachine.DeleteSubKey("Software\GameSpy\GameSpy 3D\Registration\Crypt")

    HTH
    rate my posts if they help ya!
    Extract thumbnail without reading the whole image file: (C# - VB)
    Apply texture to bitmaps: (C# - VB)
    Extended console library: (VB)
    Save JPEG with a certain quality (image compression): (C# - VB )
    VB.NET to C# conversion tips!!

  3. #3

    Thread Starter
    Addicted Member theonetrueace's Avatar
    Join Date
    Jan 2002
    Location
    South Alabama
    Posts
    196
    An unhandled exception of type 'System.ArgumentException' occurred in mscorlib.dll

    Additional information: Cannot delete a subkey tree because the subkey does not exist.

    ...

    heres my code....

    ...

    Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
    Microsoft.Win32.Registry.CurrentUser.DeleteSubKey("Software\Microsoft\Windows\CurrentVersion\Uninsta ll\mpath")
    Microsoft.Win32.Registry.CurrentUser.DeleteSubKey("Software\GameSpy\GameSpy 3D\Registration\Crypt")
    Microsoft.Win32.Registry.ClassesRoot.DeleteSubKey("CLSID\{154329C7-BCC5-11d5-A481-000102C260CC}\InProcServer32\ThreadingModel")
    End Sub

    ...

    i need those to be deleted...
    Last edited by theonetrueace; Aug 21st, 2002 at 09:13 PM.

  4. #4
    l33t! MrPolite's Avatar
    Join Date
    Sep 2001
    Posts
    4,428
    well if it says it doesnt exists, then it doesnt exist
    rate my posts if they help ya!
    Extract thumbnail without reading the whole image file: (C# - VB)
    Apply texture to bitmaps: (C# - VB)
    Extended console library: (VB)
    Save JPEG with a certain quality (image compression): (C# - VB )
    VB.NET to C# conversion tips!!

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