Reading 64bit Registry from a 32bit application
you have to use the KEY_WOW64_64KEY param when creating/opening the registry key. But AFAIK that's not possible with the Registry class but only when using the API directly.
This might help to get you started.
Reading registry in both 64 and 32 bit windows
Windows 64 bit system divide registry into two part. One for 32 and another for 64 bit system.
I believe you should update your call to following:
RegOpenKeyEx(HKEY_LOCAL_MACHINE, Path, 0, KEY_ALL_ACCESS | KEY_WOW64_32KEY, &hKey)
Accessing 64-bit Registry in 32-bit application
I solved this now - thanks goes to Petrucio who posted this solution in 2012: read/write to Windows Registry using Java.
E.g. - Read Operation:
try {
String value = WinRegistry.readString(WinRegistry.HKEY_LOCAL_MACHINE, "SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Run", "TestValue", WinRegistry.KEY_WOW64_64KEY);
System.out.println(value);
} catch (Exception ex) {
ex.printStackTrace();
}
I hope that is usefully for someone.
Modifying 64-bit registries using 32-bit application or vice versa
You need to use RegistryKey.OpenBaseKey()
to create a RegistryKey
object for the desired view (32bit or 64bit) of the Registry.
RegistryKey ^key = RegistryKey::OpenBaseKey(RegistryHive::LocalMachine, RegistryView::Registry32);
// the next call maps to "SOFTWARE\\WOW6432Node\\Apple Computer" on a 64bit system...
if (key->OpenSubKey("SOFTWARE\\Apple Computer, Inc."))
{
key->DeleteSubKeyTree("QuickTime");
key->Close();
}
string path = "SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Uninstall";
RegistryKey^ key;
key = RegistryKey::OpenBaseKey(RegistryHive::LocalMachine, RegistryView::Registry32);
key->DeleteSubKeyTree(path);
key = RegistryKey::OpenBaseKey(RegistryHive::LocalMachine, RegistryView::Registry64);
key->DeleteSubKeyTree(path);
Read 64bit registry from 32bit app, in VB.NET
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
Related Topics
How to Inject JavaScript in Webbrowser Control
How to Abort a Task Like Aborting a Thread (Thread.Abort Method)
Open Existing File, Append a Single Line
How to Merge Multiple Assemblies into One
How to Write a Backslash (\) in a String
How to Get Dropdownlist Selectedvalue in Controller in MVC
Delegate Keyword VS. Lambda Notation
Using Stored Procedure Output Parameters in C#
How to Protect My .Net Assemblies from Decompilation
Selectsinglenode Returns Null When Tag Contains Xmlnamespace
Embedding JavaScript Engine into .Net
Deserialize JSON with Known and Unknown Fields
How to Bind a List to a Combobox
Can Anonymous Class Implement Interface
C# Download All Files and Subdirectories Through Ftp
How to Deserialize Xml into List<T>
List of Timezone Ids for Use with Findtimezonebyid() in C#
How to Create a Dynamic Button Click Event on a Dynamic Button