The reg command restores and reg saves in Windows

The reg command restores and reg save.

Reg restore command

The reg restore command helps to save saved subkeys and entries back to the registry.For a better understanding of how to use this command, see the example section below.

Syntax command reg restore

 Reg restore 

Parameter reg command restore

Parameters

Describe

 

Specifying the full path of the subkey will be restored.The reg restore command only works with the local computer.The KeyName parameter must include a valid root key.Valid root keys will be: HKLM, HKCU, HKCR, HKU and HKCC.

 

Specifies the name and path of the file whose content is written to the registry.This file must be created in advance by executing the reg save command and using the .hiv extension.

/?

Show help at thecommand prompt.

Reg restore command

Before editing any registry entries, save the original subkeys with the reg save command. If the editing process fails, restore the original subkey with the reg restore command.

The following table lists the return values ​​for the reg restore command:

Value

Meaning

0

Success

first

Failure

Reg restore command example

To restore a file named NTRKBkUp.hiv to HKLMSoftwareMicrosoftResKit key and overwrite the existing content of that key, enter:

 REG RESTORE HKLMSoftwareMicrosoftResKit NTRKBkUp.hiv 

Reg save command

The reg save command saves a copy of the subkey, the entry and value of the registry specified in a specified file.For a better understanding of how to use this command, see the example section below.

Syntax reg save command

 reg save [/ y] 

Parameter reg save command

Parameters

Describe

 

Specify the full path of the subkey.To specify a remote computer, attach the computer name (in the format) as part of the KeyName parameter.In addition, the KeyName parameter must also include a valid root key.Valid root keys for local computers are: HKLM, HKCU, HKCR, HKU and HKCC.If the remote computer is specified, valid root keys will be HKLM and HKU.

 

Specify the name and path of the created file.If no path is specified, the current path will be used by default.

/ y

Specify to overwrite an existing file with the name FileName without prompting to confirm.

/?

Show help at thecommand prompt.

Note the save command reg

The following table lists the return values ​​for the reg save command:

Value

Meaning

0

Success

first

Failure

Before editing any registry entries, save the original subkeys with the reg save command. If the editing process fails, restore the original subkey with the reg restore command.

For example the reg save command

To save the hive named MyApp to the current directory as a file called AppBkUp.hiv, enter:

 REG SAVE HKLMSoftwareMyCoMyApp AppBkUp.hiv 

See more:

  1. Summary of 20 common Run commands on Windows operating system
  2. Summary of shortcuts to know in Windows 10
  3. Basic Linux commands everyone needs to know
  4. Table summarizes the basic PowerShell commands
Update 26 May 2019
Category

System

Mac OS X

Hardware

Game

Tech info

Technology

Science

Life

Application

Electric

Program

Mobile