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
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