No announcement yet.

Reg export at runtime

This topic is closed.
  • Filter
  • Time
  • Show
Clear All
new posts

  • Reg export at runtime

    I need to read and export the HKCU/Software/%ProductName% after install. I can't just archive a copy because there are variables in the setup written to the registry.
    I'm sure there are command args for regedit, but can't find them.
    Or maybe there is a better way...
    My primary problem is install on NT, 2k, XP. Install requires Admin, so even doing runas, it only writes to the HKCU of the runas Admin. I need the reg settings for all users. I tried HKU/.Default/Software/%ProductName%, but the app just ignores it and writes it's own default settings to HKCU.


  • #2
    Re: Reg export at runtime

    [b]regedit.exe [options] [filename]
    filename   Import .reg file into the registry
    /s         Silent, i.e. hide confirmation box when importing files
    /e         Export registry file
               e.g. regedit /e file.reg HKEY_USERS\.DEFAULT
    /L:system  Specify the location of the system.dat to use
    /R:user    Specify the location of the user.dat to use
    /C         Compress [filename] (Windows 98)
    You can get regedit.exe to output these options by passing it the /? command line argument from a true DOS mode DOS prompt. (It can't just be the NT command need to boot into DOS or use a boot disk. Which is more of a pain than it's worth, so I'd just keep the above text handy if I were you. Or do an Google search, like I did.)
    --[[ Indigo Rose Software Developer ]]


    • #3
      Re: Reg export at runtime


      Why don't you write you information into HKEY_LOCAL_MACHINE instead of HKEY_CURRENT_USER? The information that you write to HKEY_LOCAL_MACHINE should be visible to all users.

      MSI Factory The Next Generation Intelligent Setup Builder


      • #4
        Re: Reg export at runtime

        Thanks Lorne,
        Now why didn't I think of that. I went to MSKB and couldn't find anything. After reading Mark's reply, I think I'll just use this as a backup in the %AppDir% for the customer should they mess up their settings.

        Thanks Mark,
        I didn't think of that either. Go figure, overlook the obvious. I think that will work, based on a quick test. Now I'll have to edit over 1200 lines in SUF6. Unless I can figure out a way to import without screwing up the variables.

        Thanks All,