Jeff Key
Posts: 481
Nickname: jeffreykey
Registered: Nov, 2003
|
Jeff Key is legally sane, but questionably competent.
|
|
|
|
32-bit registry access from WSH script running in x64 Windows
|
Posted: Apr 26, 2005 9:02 PM
|
|
We use a hybrid approach for pulling the latest "good" binaries to our machines every day. A VBS bootstrapper starts the process, and one of the things it does is check the registry. Sounds reasonable, right? It was for the past few years, but now there's a problem when running this script on a 64-bit OS: It doesn't find the registry values. 64-bit Windows uses a number of things to make 32-bit apps live happily in a 64-bit world. One of these is the registry redirector. Simply, the OS gives 32-bit apps their own view of certain parts of the Windows registry, including HKLM\Software. Our VBS file looks for a value that's added by the .NET installer, which is a 32-bit process. The gotcha is that VBS files are associated with the 64-bit wscript.exe, so when it runs and looks for the value insterted by the 32-bit .NET installer, it can't find it. Luckily, a 32-bit version of wscript is included in the %windir%\SysWOW64 directory. Launching a VBS with this version will give you access to the 32-bit sections of registry.
Read: 32-bit registry access from WSH script running in x64 Windows
|
|