Click here to Skip to main content
14,641,699 members
Rate this:
Please Sign up or sign in to vote.
See more:
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...
Rate this:
Please Sign up or sign in to vote.

Solution 1

64 bit Windows uses registry redirection, that can be override while opening the key for access.[^]
Unfortunately for you .NET hides this so you have to go back to WIN32 API...
Rate this:
Please Sign up or sign in to vote.

Solution 4

I DID IT!!! :)

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

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100