Read 64bit registry from 32bit app, in VB.NET - Programmers Heaven

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!


Read 64bit registry from 32bit app, in VB.NET

3AgL3DJ3AgL3DJ ROPosts: 2Member
edited January 2014 in VB.NET

Hy guys.

I have a serious problem. I'm working on a project and i need to finish it tomorrow.

The problem is that i need to get a registry value, like this:

(32 bit) HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\TeamSpeak 3 Client
(64 bit) HKEY_LOCAL_MACHINE\SOFTWARE\TeamSpeak 3 Client

I read tons of forum topics, blogs, tutorials, and i can't find the answer. The idea is that i need to get the install path for TeamSpeak3 from registry, and for the 32bit app its stored in SOFTWARE\Wow6432Node\TeamSpeak 3 Client, but when i try to get the 64bit app path from SOFTWARE\TeamSpeak 3 Client i get the same path as the 32bit app.

I know i can bypass this by targeting 64bit CPUs. But I NEED to get the 64bit app path from HKEY_LOCAL_MACHINE\SOFTWARE\TeamSpeak 3 Client with my 32bit app.

How can i do that, IN VB.NET?

Please help! Thanks...



  • 3AgL3DJ3AgL3DJ ROPosts: 2Member
        Dim TS__x64 As Microsoft.Win32.RegistryKey = Microsoft.Win32.RegistryKey.OpenBaseKey _
                                                (Microsoft.Win32.RegistryHive.LocalMachine, Microsoft.Win32.RegistryView.Registry64)
        Dim CALE_TS__x64 As String = TS__x64.OpenSubKey("SOFTWARE\TeamSpeak 3 Client").GetValue(Nothing)
        Dim TS__x32 As Microsoft.Win32.RegistryKey = Microsoft.Win32.RegistryKey.OpenBaseKey _
                                        (Microsoft.Win32.RegistryHive.LocalMachine, Microsoft.Win32.RegistryView.Registry32)
        Dim CALE_TS__x32 As String = TS__x32.OpenSubKey("SOFTWARE\Wow6432Node\TeamSpeak 3 Client").GetValue(Nothing)
        TextBox1.Text = CALE_TS__x64
        TextBox2.Text = CALE_TS__x32
Sign In or Register to comment.