Command Line Backup & Restore Using reg.exe

November 11, 2009

A command line registry manipulation tool called reg.exe is included with Windows XP. This tool is useful for selectively backing up or restoring specific Registry subkeys. Numerous functions are available in reg.exe, including Registry exporting and importing.

To backup a Registry key using reg.exe, use the following syntax:

reg export rootkey\subkey filename

For rootkey, you can use the abbreviations HKLM, HKCU, HKCR, HKU or HKCC. Subkey must be the full name of a Registry key under the selected root. Filename is the name of the file to which you want to save the exported data.

To restore a Registry key using reg, use the following syntax:

reg import filename

When importing, filename can be any file created by reg export, from the regedit Registry Editor’s Export command, or created manually with a text editor.

%d bloggers like this: