Copy registry branch to another location

You can use the reg command in Command Prompt. Note that administrator access is required to run this command. To open Command Prompt as Administrator:

  1. Open the Start Menu.
  2. In the search box, type cmd.
  3. Press Ctrl+Shift+Enter.

The syntax of the reg command is below.

REG COPY KeyName1 KeyName2 [/s] [/f]

  KeyName    [\\Machine\]FullKey
    Machine  Name of remote machine - omitting defaults to the current machine.
             Only HKLM and HKU are available on remote machines.
    FullKey  ROOTKEY\SubKey
    ROOTKEY  [ HKLM | HKCU | HKCR | HKU | HKCC ]
    SubKey   The full name of a registry key under the selected ROOTKEY.

  /s         Copies all subkeys and values.

  /f         Forces the copy without prompt.

I've used this to copy keys between the 64-bit and 32-bit areas of the registry. For example:

reg copy HKLM\SOFTWARE\ODBC\ODBC.INI\dsname HKLM\SOFTWARE\Wow6432Node\ODBC\ODBC.INI\dsname /s

  1. Use a better third party registry editor that allows cut/copy and paste of entire keys/branches.

  2. Export the HKLM\SOFTWARE\Wow6432Node\Python branch to a .REG file, use a text editor to replace all instances of HKLM with HKCU, save and import.