Edit Registry from Command Prompt
Adding, modifying, or deleting Windows registry subkeys and values should only be done by advanced users, admins, and IT professionals. Take caution before you make changes. Since this is a registry operation, it is recommended that you back up the registry or create a system restore point in case the procedure goes wrong. Once you have taken the necessary precautionary measures, you can proceed as follows: Press Windows key + R to invoke the Run dialog. In the Run dialog box, type cmd and then press CTRL + SHIFT + ENTER to open Command Prompt in admin mode. To get the list of operations, run command the command below: The Operation List will appear, as well as the Return Code for each command. Here’s the list of operations and what each does, as described by Microsoft:
Add: Adds a new subkey or entry to the registry.Compare: Compares specified registry subkeys or entries.Copy: Copies a registry entry to a specified location on a local or remote machine.Delete: Deletes a subkey or entries.Export: Copies the specified subkeys, entries, and values of the local computer into a file for transfer to other servers.Import: Copies the contents of a file that contains exported registry subkeys, entries, and values into the registry of the local computer.Load: Writes saved subkeys and entries into a different subkey in the registry. This is intended to be used with temp files that are used for troubleshooting or editing registry entries.Query: Returns a list of the next tier of subkeys and entries that are located und a specified subkey in the registry.Restore: Writes saved subkeys and entries back to the registry.Save: Saves a copy of specified subkeys, entries, and values of the registry in a specified file.Unload: Removes a section of the registry that was loaded using the REG LOAD operation.
And, the return codes:
0: Successful1: Failed
To get help for with a specific operation, append the operation name to the middle of the previous command: Example, if you wanted help on the Add operation, run the following command: When the command executes, all of the information that you need about the specified operation is returned, including the syntax, parameters, and even some examples. Now that we know all that we need to know about REG ADD, let’s try to put it in action.
Add a SubKey or Entry to the Registry
To begin, below is the syntax for REG ADD from using the REG ADD /? command:
The
Press Windows key + R to invoke the Run dialog.In the Run dialog box, type regedit and hit Enter to open Registry Editor.Navigate or jump to the registry key path below:
Delete a SubKey or Entry from the Registry
To delete a subkey or entry from the registry, run the following syntax: So, let’s say we want to delete/remove the subkey named TheWindowsClubSubkey under HKLM\Software, the command (syntax) will look like this: You’ll be prompted if you really want to delete the subkey. Type Yes and hit Enter. Once the command executes the subkey will be deleted from the registry. That’s it on how to edit the Registry from Command Prompt in Windows 10.