Importing a .reg file in 32-bit and 64-bit

  • Thread starter Thread starter nuttinbutspam@gmail.com
  • Start date Start date
N

nuttinbutspam@gmail.com

Guest
I need to import a .reg file on 32-bit and 64-bit systems. The .reg
file contains settings for a 32-bit-only program. In a 32-bit
environment the settings are stored at "HKLM/Software/CompanyName/
ProductName", but on a 64-bit system, the settings are stored at "HKLM/
Software/Wow6432Node/CompanyName/ProductName".

I understand the idea of the "Wow6432Node" registry key: 32-bit apps
in a 64-bit environment that read and write to the "Software" key, are
automatically redirected (behind the scenes) to the "Sofware/
Wow6432Node" key. Unfortunately, this seems to only work when the 32-
bit app itself accesses the registry.

Is there a mechanism in the .reg file syntax or in the "reg add"
command line syntax to ALWAYS treat the .reg file as if it were a 32-
bit application accessing the registry? Currently I have 2 .reg files
(one for each architecture), but that could get messy. I mean, just
imagine if I accidentally imported a "Wow6432Node" on a 32-bit system.
I have seen several scripts use the existence of this key to determine
what the architecture is. Given, this is a horrible idea for detecting
the architecture, but it nevertheless presents the possibility of
corrupting the registry.

TIA for any help,
-Jack
 
RE: Importing a .reg file in 32-bit and 64-bit

Hi,
Launch the 32-bit version of Windows Explorer
(C:\Windows\SysWOW64\explorer.exe) and run your .reg file from there.
What I do is to run the .reg files from ZTreeWin, which happens to be a
32-bit file manager (resembling the old DOS XTree) in order to redirect them
to the Wow6432Node.
Carlos

"nuttinbutspam@gmail.com" wrote:

> I need to import a .reg file on 32-bit and 64-bit systems. The .reg
> file contains settings for a 32-bit-only program. In a 32-bit
> environment the settings are stored at "HKLM/Software/CompanyName/
> ProductName", but on a 64-bit system, the settings are stored at "HKLM/
> Software/Wow6432Node/CompanyName/ProductName".
>
> I understand the idea of the "Wow6432Node" registry key: 32-bit apps
> in a 64-bit environment that read and write to the "Software" key, are
> automatically redirected (behind the scenes) to the "Sofware/
> Wow6432Node" key. Unfortunately, this seems to only work when the 32-
> bit app itself accesses the registry.
>
> Is there a mechanism in the .reg file syntax or in the "reg add"
> command line syntax to ALWAYS treat the .reg file as if it were a 32-
> bit application accessing the registry? Currently I have 2 .reg files
> (one for each architecture), but that could get messy. I mean, just
> imagine if I accidentally imported a "Wow6432Node" on a 32-bit system.
> I have seen several scripts use the existence of this key to determine
> what the architecture is. Given, this is a horrible idea for detecting
> the architecture, but it nevertheless presents the possibility of
> corrupting the registry.
>
> TIA for any help,
> -Jack
>
 
Re: Importing a .reg file in 32-bit and 64-bit

Thanks for replying. I should have mentioned that I can write a script
to import the different .reg files depending on the architecture. I
don't think there will be a more efficient way than running a script
unless it is built in to Windows. I just don't feel like writing a
script (imho, I shouldn't have to). Thanks though, I will have to
check out ZTreeWin!

Pseudocode:
IF ( Is64bit ) THEN
import 64-bit .reg settings
ELSE
import 32-bit .reg settings
ENDIF




On Feb 29, 3:44 pm, Carlos <Car...@discussions.microsoft.com> wrote:
> Hi,
> Launch the 32-bit version of Windows Explorer
> (C:\Windows\SysWOW64\explorer.exe) and run your .reg file from there.
> What I do is to run the .reg files from ZTreeWin, which happens to be a
> 32-bit file manager (resembling the old DOS XTree) in order to redirect them
> to the Wow6432Node.
> Carlos
>
> "nuttinbuts...@gmail.com" wrote:
> > I need to import a .reg file on 32-bit and 64-bit systems. The .reg
> > file contains settings for a 32-bit-only program. In a 32-bit
> > environment the settings are stored at "HKLM/Software/CompanyName/
> > ProductName", but on a 64-bit system, the settings are stored at "HKLM/
> > Software/Wow6432Node/CompanyName/ProductName".

>
> > I understand the idea of the "Wow6432Node" registry key: 32-bit apps
> > in a 64-bit environment that read and write to the "Software" key, are
> > automatically redirected (behind the scenes) to the "Sofware/
> > Wow6432Node" key. Unfortunately, this seems to only work when the 32-
> > bit app itself accesses the registry.

>
> > Is there a mechanism in the .reg file syntax or in the "reg add"
> > command line syntax to ALWAYS treat the .reg file as if it were a 32-
> > bit application accessing the registry? Currently I have 2 .reg files
> > (one for each architecture), but that could get messy. I mean, just
> > imagine if I accidentally imported a "Wow6432Node" on a 32-bit system.
> > I have seen several scripts use the existence of this key to determine
> > what the architecture is. Given, this is a horrible idea for detecting
> > the architecture, but it nevertheless presents the possibility of
> > corrupting the registry.

>
> > TIA for any help,
> > -Jack
 
Back
Top