The reg command restores and reg saves in Windows
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:
- Summary of 20 common Run commands on Windows operating system
- Summary of shortcuts to know in Windows 10
- Basic Linux commands everyone needs to know
- Table summarizes the basic PowerShell commands
You should read it
May be interested
- 10 useful commands in Windows you should knowcommand prompt is used to execute batch files, perform tasks quickly, help you troubleshoot and solve some windows problems when the system crashes. however, not all commands in windows are useful and must be done regularly. with the 10 command lines in the following article it is very useful even if you are not an administrator.
- How to use the option equivalent to the 'ls' command in Windowsthe 'ls' command (note ls, not is) is one of the first terminal commands veterans teach to linux beginners.
- The command reg add in Windowsthe reg add command adds new subkeys or entries to the registry.
- Rem command in Windowsthe rem command helps write comments (comments) in a batch file or config.sys.
- Instructions for using Command Promptdeep in windows is a command-line world that is obscure. in this article, we will show you how to solve errors and make your computer more secure.
- Rd command in Windowsthe rd command helps delete a directory
- Push operation in HTMLjerry modifies the previous commits using the git commit -a operation (signing changes) and he is ready to push the changes. push operation saves permanent data to git repository. after a successful push operation, other programmers can observe jerry's changes.
- Cmd command in Windowsthe cmd command starts a new version of the command interpreter, cmd.exe. if used without parameters, cmd will display copyright information and the version of the operating system.
- How to use the command history function in Command Promptcommand prompt is an extremely familiar command for anyone using windows operating system. besides, a lot of current software also supports the command line to perform actions on the command prompt window, instead of on the screen.
- The sfc command in Windows(applies to windows server (semi-annual channel), windows server 2016, windows server 2012 r2, windows server 2012)