Accessing Alternate Registry View
Keywords: 32-bit 64-bit Registry Redirect Redirection Alternate View WOW64 SYSWOW64
By default, a 32-bit WinBatch script running on WOW64 accesses the 32-bit registry view and a 64-bit script accesses the 64-bit registry view.
Windows implements registry redirection in order to prevent 32-bit applications from overwriting the 64-bit registry settings. Computers that are running an x64-based version of Windows store the settings for 32-bit programs in a new branch in the registry.
64-bit programs access keys and values that are stored in the following registry sub key:
HKEY_LOCAL_MACHINE\Software
32-bit programs run in WOW64 mode and access keys and values that are stored in the following registry sub key:
HKEY_LOCAL_MACHINE\Software\WOW6432node
If you would like your script to access the alternative view of the registry, you have a couple of choices:
- RegOpenFlags
This function lets you specify an alternate view of the registry for Reg[..] functions which create, open, and delete registry keys, when running on (or accessing) a 64-bit Windows platform.
- Registry Functions View-Flag
The Regisry functions view-flag optional parameter controls which registry view the function uses when accessing the Windows registry. The optional parameter's values can be 32 to use the 32-bit view, 64 to use the 64-bit view,
or 0 to use the view indicated by the last call to the RegOpenFlags. The parameter value of 0 can also cause a function to use the WinBatch default 64-bit view, if no call to RegOpenFlags has been made and setting the parameter to 0 is equivalent to omitting
the parameter entirely.
2 simple rules to accessing the registry on 64-bit systems:
- NEVER directly access keys stored under WOW6432node.
- If you do want access something under WOW6432node, just set the registry view to 32-bit and specify the key/value without using 'WOW6432node' in the registry path.
Note : You can launch the 32-bit version of Registry Editor on a 64-bit Windows platform using the following commandline:
C:\Windows\syswow64\regedit.exe
Article ID: W18226
Filename: Accessing Alternate Registry View.txt
File Created: 2012:11:14:09:27:14
Last Updated: 2012:11:14:09:27:14