Results 1 to 3 of 3

Thread: Modify System Registry Values

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Mar 2013
    Location
    Minneapolis, MN
    Posts
    486

    Modify System Registry Values

    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.
    Code:
    HKEY_LOCAL_MACHINE\SOFTWARE\SolidWorks\Applications\PDMWorks Enterprise\Databases\Sackett-Waconia
    HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\SolidWorks\Applications\PDMWorks Enterprise\Databases\Sackett-Waconia
    My code only reads and changes the WOW6432Node value, regardless of which one I call to read or write.

    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
    Is it somehow automatically deciding for me, based on the OS (64-bit vs 32-bit)?
    - A 'Hyperactive Member' trying to make a difference in a hyperactive world!

  2. #2
    Frenzied Member
    Join Date
    Feb 2003
    Posts
    1,369

    Re: Modify System Registry Values

    Doesn't this depend on the target CPU you use for your project?

  3. #3
    New Member
    Join Date
    Jun 2021
    Posts
    4

    Re: Modify System Registry Values

    Quote Originally Posted by Peter Swinkels View Post
    Doesn't this depend on the target CPU you use for your project?
    Agreed

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width