Click here to Skip to main content
15,887,485 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
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...
Posted

I DID IT!!! :)

VB
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
 
Share this answer
 
64 bit Windows uses registry redirection, that can be override while opening the key for access.
http://msdn.microsoft.com/en-us/library/windows/desktop/aa384129(v=vs.85).aspx[^]
Unfortunately for you .NET hides this so you have to go back to WIN32 API...
 
Share this answer
 

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



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900