Access 64-bit HKLM\Software registry by 32-bit C#.NET application While running 32-bit windows application on a 64-bit windows OS their is a registry redirection. Here if 32-bit application try to read a key under HKLM\Software, then due to Registry redirection effective path becomes HKLM\Software\Wow6432Node. For example, we are running 64-bit and 32-bit application to read registry keys as HKLM\Software\xyz and HKLM\Software\Wow6432Node\xyz So by default with an input of HKLM\Software, 64-bit application will read HKLM\Software\xyz while because of registry redirection 32-bit application will read HKLM\Software\Wow6432Node\xyz. In C#, to read 64-bit HKLM\Software registry keys we can use RegistryKey.OpenBaseKey method . This method takes two arguments- RegistryHive and RegistryView. Here sperate registry views are present for 32-bit and 64-bit. Here is the sample C# code to read AppPaths for 32-bit and 64-bit applications installed on the system - try
Learn Tips and tricks, Concepts, Ideas for software development