Hello:
I have come code that reads and changes the system registry values. I am baffled. We have two values that need to change, located in the following two places.
My code only reads and changes the WOW6432Node value, regardless of which one I call to read or write.
Is it somehow automatically deciding for me, based on the OS (64-bit vs 32-bit)?
I have come code that reads and changes the system registry values. I am baffled. We have two values that need to change, located in the following two places.
Code:
HKEY_LOCAL_MACHINE\SOFTWARE\SolidWorks\Applications\PDMWorks Enterprise\Databases\Sackett-Waconia
HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\SolidWorks\Applications\PDMWorks Enterprise\Databases\Sackett-Waconia
Code:
Private Function ReadArchiveLocation()
' For some reason, this action only controls the WOW32 section???
Dim readValue As String = My.Computer.Registry.GetValue("HKEY_LOCAL_MACHINE\SOFTWARE\SolidWorks\Applications\PDMWorks Enterprise\Databases\Sackett-Waconia", "ServerLoc", Nothing)
' Dim readValue As String = My.Computer.Registry.GetValue("HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\SolidWorks\Applications\PDMWorks Enterprise\Databases\Sackett-Waconia", "ServerLoc", Nothing)
Return readValue
End Function
Private Function SwitchArchiveServerLocation(_val As String)
' For some reason, this action only controls the WOW32 section???
My.Computer.Registry.SetValue("HKEY_LOCAL_MACHINE\SOFTWARE\SolidWorks\Applications\PDMWorks Enterprise\Databases\Sackett-Waconia", "ServerLoc", _val, Microsoft.Win32.RegistryValueKind.Unknown)
Shell("rundll32.exe user32.dll,UpdatePerUserSystemParameters", 1, True)
'My.Computer.Registry.SetValue("HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\SolidWorks\Applications\PDMWorks Enterprise\Databases\Sackett-Waconia", "ServerLoc", _val, Microsoft.Win32.RegistryValueKind.Unknown)
'Shell("rundll32.exe user32.dll,UpdatePerUserSystemParameters", 1, True)
InitializeForm()
End Function