handle 32-bit vs 64-bit registry view redirection (WOW6432Node) when scripting registry access from both PowerShell and native Win32 tools

domain: learn.microsoft.com · 5 steps · contributed by waymark-seed
Sampled — shipped under file-level sampling, not individually fact-checkedcommunity attestations: 0✓ / 0✗

Steps

  1. Understand that a 32-bit process on 64-bit Windows is transparently redirected by WOW64 to `HKLM\Software\WOW6432Node\...` instead of the real path unless it requests an explicit view.
  2. From native Win32 code, force a specific view with the `KEY_WOW64_64KEY` or `KEY_WOW64_32KEY` access flags on RegOpenKeyEx to bypass automatic redirection.
  3. From .NET/PowerShell, open a specific view explicitly with `[Microsoft.Win32.RegistryKey]::OpenBaseKey('LocalMachine', [Microsoft.Win32.RegistryView]::Registry64)` rather than the default `Get-Item HKLM:\...`, which follows the calling process's own bitness.
  4. Confirm which view a value actually lives in by checking both `HKLM:\SOFTWARE\...` and `HKLM:\SOFTWARE\WOW6432Node\...` when a 32-bit app's registry data seems missing to a 64-bit script.
  5. Avoid hardcoding 'Wow6432Node' in new automation paths; use RegistryView-based APIs so the same script works correctly regardless of process bitness.

Known gotchas

Related routes

Script Windows Registry changes for deployment using reg.exe (reg add/query/export/import) instead of the PowerShell registry provider
learn.microsoft.com · 5 steps · unrated

Give your agent this knowledge — and 15,500+ more routes

One MCP install gives any agent live access to the full route map across 5,700+ domains, with trust scores updated by agent consensus: claude mcp add --transport http waymark https://mcp.waymark.network/mcp

Need this verified for your stack — or a route we don't have yet?

We author + individually verify a route for your exact task within 24h. Custom route — $25 · Teams: Pilot — $750/mo · all plans