How To Edit Windows Registry Via Command Prompt

The Windows registry is a database that contains information about various PC settings and application configurations for systems running the Microsoft Windows operating system. Although not all applications need to run on configuration data stored in the Windows registries (some store configuration data in XML files or in a separate executable), the registries are essential to the proper operation of your Windows PC.

Windows allows users to modify these registries if they want to change the configuration settings of an application or program on their computer. Let’s see how you can use these records and change them as you see fit:

How do the Windows registers work?

The information stored in Windows registries is organized into three different registry levels:

It is a collection of keys, subkeys and registry values represented by records. These folders are divided into subfolders according to the type of data values stored in them.

These are the subdirectories that make up the hives of the registry. They are considered the standard organizational unit in window control. These are similar to the folders in Windows File Explorer that contain different types of files on your computer. Similarly, registry keys store registry values.

These are instructions or information about system configurations and settings. Each registry value contains instructions for specific system settings, applications, or related configurations.

Read more: Add, modify and delete registry keys and values via Regedit

How do I modify the Windows registry from the command line?

In case you need to modify the Windows registry, you can control the process from the command line on your Windows 10 PC. Just follow the procedure below:

Open the command line

alt=How to edit the Windows Registry using the command line width=628 height=296 data-ezsrc=http://server.digimetriq.com/wp-content/uploads/2021/03/How-To-Edit-Windows-Registry-Via-Command-Prompt.jpg />

First, go to the Windows search bar.

Then type cmd into the search box. In the search results, the command prompt appears as the first result.

Right-click on the command line options and select Run as administrator.

This opens a command prompt in admin mode on your Windows PC.

Read more: To change the background of the command line

Types of register processing operations

Step one: Run the following command to get a list of all the operations you can perform to modify the Windows registry.

REG / ?

The types of operations determine the changes you want to make to the Windows registry, for example. B. by adding a subkey using the Add operation type.

alt=How to edit the Windows Registry with the command line width=620 height=364 data-ezsrc=http://server.digimetriq.com/wp-content/uploads/2021/03/1615558346_543_How-To-Edit-Windows-Registry-Via-Command-Prompt.jpg />

Step two: The command line shows all the operations and a return code for each of these commands. The return codes determine whether the execution of the command failed or succeeded.

Message: Microsoft provides content in the following tables

Operation Task
Add Adds a new entry to the register
Compare Compares two or more subclasses or register records.
Copy of Copies the registry entry to a specified location on the local or remote computer.
Download Writes the subkey and registered items to another subkey in the registry. It is intended for temporary files used for debugging or editing registry entries.
Recovery Writes subcategories and saved items to the registry.
Request Returns a list of sublayers and next-level records that are in the registry under the specified sublayers.
Entry Copies the contents of the file containing the subkeys, entries and values of the exported registry to the registry of the local computer.
Export Copies the subclasses, records and values from the specified local computer to a file for transfer to other servers.
Save Saves a copy of the specified buffers, records, and registry values to the specified file.
Delete Deletes a subkey or entries.
Unloading the site Deletes a registry partition that was loaded with the REG LOAD operation.

Source: Microsoft

Return codes Results
Good luck
1 Failure

Source: Microsoft

Syntax search

To find the syntax, simply insert the name of the operation between the previous REG command. That’s it, it’s done…

REG

This particular step provides all the necessary information about that particular operation, including all the parameters and the syntax. Let’s look at the syntax using the Add operation as an example.

Performing an operation using modes Add a port or input

Step one: Use the Add operation to add a subkey to the registry. To start editing, you need to define the type of operation between the REG command.

Since we are using the action type Add, it is necessary to use the –

REG

Step two: The syntax is in the second line of the tip.

REG ADD [{/v ValueName | /ve}] [/t DataType] [/s Separator] [/d Data] [/f].

alt=How to edit the Windows Registry using the command line width=628 height=219 data-ezsrc=http://server.digimetriq.com/wp-content/uploads/2021/03/1615558347_931_How-To-Edit-Windows-Registry-Via-Command-Prompt.jpg />

Here.

  • specifies the path to the subkey. In general, root keys used as paths are referred to as HKLM or HKU.
  • /v ValueName indicates the name of the subkey.

The other syntax parameters are not required when adding an operational mode.

Step three: Suppose your subkey name is MySubkey; the command that would fit this type of operation would be: -.

REG ADD HKLMSoftwareMySubkey

Removal of connections

Step one: Syntax of the Delete operation –

REMOVE [{/v Value name | /ve | /va}] [/f].

alt=How to edit the Windows registry with the command line width=628 height=204 data-ezsrc=http://server.digimetriq.com/wp-content/uploads/2021/03/1615558348_178_How-To-Edit-Windows-Registry-Via-Command-Prompt.jpg />Step 2: Suppose you need to delete the same subkey you created in the previous step; the command would be –

HKLMSoftwareMySubkey removal

Step three: Enter YES to confirm the deletion order.

Step four: Press the Enter key.

It’s just two surgeries. Each operation requires a different syntax that you now know, and each operation performs different tasks. You can refer to this document published by Microsoft to learn more about the types, syntax, and parameters of registry operations.

Read more: How to fix Windows 10 registration errors

Denial: Why shouldn’t I edit the Windows Registry?

All changes to Control Panel settings, system associations, software or application installations, etc. are automatically adopted into the Windows registry. If you try to change Windows registries manually, these settings, configurations, and system policies can be corrupted. This can lead to various computer problems, such as. For example, system crashes, damaged applications, unbootable drives, problems with saved files and system folders.

Therefore, it is not recommended to edit the Windows registry unless you are very familiar with its syntax and settings, or have a compelling reason to do so.

You might also like

Why it’s important to fix registry problems

To change a Windows password without knowing your current password

frequently asked questions

Can you edit the registry from the command line?

By default, users of Microsoft Windows 95, 98, ME, and 2000 can import registry files from the command line using the Regedit command. With this command and the registry file containing the appropriate commands, the user can add, delete, and modify the registry from the command line.

How do I open the registry editor from the command line?

Method 2: Open the Registry Editor from the command line Press Win + X. From the options provided, select the command line (Admin). Type regedit at the command prompt and press Enter. It immediately starts the registry editor.

How do I change the registry permissions in CMD?

Synopsis. Use the Regini.exe utility to change registry values or permissions from the command line or from a script. The Regini.exe utility is included in the Windows NT Server 4.0 Resource Kit, the Microsoft Windows 2000 Resource Kit, and the Microsoft Windows Server 2003 Resource Kit.

Related Tags:

Feedback,regedit command line windows 10,edit registry from cmd,regedit command line windows 7,reg query,rename registry key command line,registry editor,Privacy settings,How Search works,Windows Registry,Registry Editor,add registry key command line,modify registry key powershell