Friday, March 18, 2005

My job involves working with lots of config data, conveniently stored in the system registry.  Now, there are all kinds of ways to get at the registry.  You can:

  • use regedit and a .reg file.  To silently import a registry file use the /s switch.  To remove a key, prepend the registry key name with a ‘-‘.  This is really great for large amounts of data and works well with batch files
  • use VBScript or JavaScript and the Windows Scripting Host or WMI for full access to the registry (and the rest of your system
  • use the REG command line interface.  Check out this list of options: 

C:\Documents and Settings\Matt>reg /?

Console Registry Tool for Windows - version 3.0
Copyright (C) Microsoft Corp. 1981-2001.  All rights reserved


REG Operation [Parameter List]

  Operation  [ QUERY   | ADD    | DELETE  | COPY    |
               SAVE    | LOAD   | UNLOAD  | RESTORE |
               COMPARE | EXPORT | IMPORT ]

Return Code: (Except of REG COMPARE)

  0 - Successful
  1 - Failed

For help on a specific operation type:

  REG Operation /?

Examples:

  REG QUERY /?
  REG ADD /?
  REG DELETE /?
  REG COPY /?
  REG SAVE /?
  REG RESTORE /?
  REG LOAD /?
  REG UNLOAD /?
  REG COMPARE /?
  REG EXPORT /?
  REG IMPORT /?

Before today I didn’t even know this tool existed for me.  I’ve used the other two methods frequently for unattended installs on remote machines, but this new tool looks very promising.  I learned about it from this post by Scott Hanselman (note the first comment)

— Matt Ranlett

3/18/2005 11:59:53 PM (Eastern Standard Time, UTC-05:00)  #    Trackback
Tracked by:
"Texas holdem poker real money online" (Texas holdem poker real money online) [Trackback]