PDA

Click to See Complete Forum and Search --> : Deleting a registry key...


theonetrueace
Aug 21st, 2002, 04:59 PM
*** 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!

MrPolite
Aug 21st, 2002, 05:40 PM
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 :D
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:
Microsoft.Win32.Registry.LocalMachine.DeleteSubKey("Software\GameSpy\GameSpy 3D\Registration\Crypt")

HTH :)

theonetrueace
Aug 21st, 2002, 09:00 PM
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\Uninstall\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...

MrPolite
Aug 21st, 2002, 10:19 PM
well if it says it doesnt exists, then it doesnt exist:)