This code works for me, and should get you started...
code:
Dim regkey As RegistryKey = My.Computer.Registry.CurrentUser.OpenSubKey("Control Panel\Desktop", True)
You can then go on and use stuff like
code:
Dim svalue As String = regkey.GetValue("ScreenSaveActive")
regkey.DeleteValue("testingval")
etc...
A couple of other things I've noticed.
First,
code:
My.Computer.Registry.CurrentUser.OpenSubKey("HKEY_CURRENT_USER\Control Panel\Desktop", True)
Here you've already opened HKEY_CURRENT_USER, by stating it again you make it look for a subkey called HKEY_CURRENT_USER, which is one reason this line probably doesn't work.
Secondly, you used 2 If statements in a row:
code:
If <snip>
My.Computer.Registry.SetValue("HKEY_Current_User\Control Panel\Desktop\", "ScreenSaveActive", "0")
End If
If My.Computer.Registry.GetValue("HKEY_Current_User\Control Panel\Desktop\", "ScreenSaveActive", "Unknown") = "0" Then
If your code worked and changed the correct values, your first If statement would change a value to 0. Immediately after that your second If statement would also be executed and change it back to 1 (because the value is now 0). You should change to an If..Else statement or add an Exit Sub in your Ifs to avoid this.
Hope this helps