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

Discussion in 'Windows 64bit' started by Guest, Feb 29, 2008.

  1. Guest

    Guest 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/

    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,
    Guest, Feb 29, 2008
    1. Advertisements

  2. Guest

    Carlos Guest

    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, Feb 29, 2008
    1. Advertisements

  3. Guest

    Guest Guest

    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!

    IF ( Is64bit ) THEN
    import 64-bit .reg settings
    import 32-bit .reg settings
    Guest, Feb 29, 2008
    1. Advertisements

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.