Editing Registry

RedMan

New member
Joined
May 26, 2006
Messages
2
Programming Experience
1-3
I have the following code

Dim ProfileKey, MainKey As RegistryKey
ProfileKey = Registry.CurrentUser.OpenSubKey(
"Software\\Microsoft\\Windows NT\\CurrentVersion\\Windows Messaging Subsystem\\Profiles\\Novell Default Settings", True)
MainKey = Registry.CurrentUser.OpenSubKey(
"Software\\Microsoft\\Windows NT\\CurrentVersion\\Windows Messaging Subsystem\\Profiles", True)
If ProfileKey Is Nothing Then
MsgBox("Error Finding Novell Default Settings Profile Key")
Else
MainKey.DeleteSubKeyTree("Novell Default Settings")
End If
If MainKey.GetValue("DefaultProfile") Is Nothing Then
MsgBox("Error Setting Default Profile")
Else
MainKey.SetValue("DefaultProfile", "Default Outlook Profile")
End If

The purpose of this code is to delete a registry key, and all of its subkeys, for the current logged on user. The code works fine on my local machine, however when I deploy this to another machine the program cannot find the registry keys. I think it is looking under .DEFAULT and should not be, but I am not 100% sure. I have verified that the keys are in fact there, and tested on over 10 machines with the same results. Anyone shed some light on the subject? Thanks in advance :)
 
Ok, I have found the problem but I am clueless on how I should go about fixing it. I have verified that it is in fact trying to read from HKEY_USERS\.DEFAULT instead of HKEY_CURRENT_USER. I Verified this by deleteing the value and running the program again. Anyone have any ideas? Thanks :)
 
Back
Top