Get IT Solutions

How to do IT
Menu
  • Home
  • SCCM 2012
    • Deploy Packages
    • Troubleshooting errors SCCM 2012
  • Windows
    • Applications Silent Install
    • Windows Tools
    • Windows Error
    • Script
    • Exchange Server
    • Troubleshooting Office
    • Applications Errors
  • Database
    • SQL Server
    • MySQL
    • Oracle
  • Cybersecurity
  • Other
  • Reviews

How to Edit registry using (CMD) | Switches | Operations description

In this article, we will explain everything about Windows Registry and working on it through the command prompt (CMD). You will learn:

  • Switches/parameter description
  • Operations that you can use

Before you make any change on the registry, be sure to make a backup of your registry or to the computer. The editing registry is very dangerous and needs to be done by professional users that know what they are doing. As the registry store all settings that system and applications need in order to operate normally, any change on them can break the system.

Check Also:

How to add registry key & values with CMD | PowerShell | Batch

How to Delete Registry Key/value

 

Table of Contents

  • Understanding registry through command prompt (CMD)
    • Operations List
    • Default commands of all operations
    • Switches description
    • How to edit registry using (CMD)
    • Conclusions:

Understanding registry through command prompt (CMD)

Every administrator used at least once the registry to enable any feature or fix any issue. It’s like a database where the system and the application store settings and configurations. Most users use the Windows interface to access e modify the registry. In this case, we will use reg.exe, which is a command-line tool that allows you to edit the Registry. The reg.exe has the same functionality as the regedit interface (GUI). This can help also people that need to create scripts to play with the registry.

The structure that registry saves items is:

Hives -> Keys -> Values

Hives – The root location for example – HKEY_CURRENT_USER (HKCU)

Keys – Are a sub-entries in order to split and categorize values in several groups

Values – the final entries that the application and system has created that store data

 

Operations List

Below we will show the list of operations and descriptions of them. To access reg.exe open the command prompt as an administrator:

  1. Open Start.
  2. Search for CMD.
  3. Right-click the result and select Run as administrator.
  4. To get the list of all operations. type the following command and press Enter:
READ ALSO -   Solutions To Fix MMC Could Not Create The Snap-In Error

reg /?

The full list of operations and return codes will appear.

All registy operations

The description of operations and what each does is described at Microsoft:

  • Add – The switch to add and edit a subkey or entry to the registry.
  • Compare – Compares 2 or more specified registry subkeys or entries/values.
  • Copy – Copies a registry entry to a specified location on a local or remote machine.
  • Delete – Remove a subkey or values.
  • Export – Copies entries and keys of the computer into a specific file in order to transfer to a different computer.
  • Import – Copies the contents of a file that we export above to the target computer.
  • Load – Writes saved keys and values into a different key in the registry.
  • Query – Returns a list of the next tier of keys and values that are located und a specified key in the registry.
  • Restore – Writes saved keys and values back to the registry from a saved file.
  • Save – Saves a copy of specified keys, entries, and values in a specified file.
  • Unload – Removes a section of the registry that was loaded using the REG LOAD  

And, the return codes:

  • 0 – Successful
  • 1 – Failed

 

You can get help also for a specific operation. For example, if you want to get more help for the Compare operation uses the below command:

REG ADD /?

Switches

Switches

Default commands of all operations

REG ADD KeyName [/v ValueName | /ve] [/t Type] [/s Separator] [/d Data] [/f] REG DELETE [{/v ValueName | /ve | /va}] [/f] REG COMPARE [{/v ValueName | /ve}] [{/oa | /od | /os | on}] [/s] REG COPY [/s] [/f] REG EXPORT KeyName FileName [/y] REG IMPORT FileName REG LOAD KeyName FileName REG QUERY [{/v | /ve}] [/s] [/se ] [/f ] [{/k | /d}] [/c]

[/e] [/t <Type>] [/z] REG RESTORE <KeyName> <FileName> REG SAVE <KeyName> <FileName> [/y] REG UNLOAD <KeyName>

 

Switches description

 
Parameter Description
<KeyName> Specifies the full path of the subkey or entry to be added. To specify a remote computer, include the computer name (in the format \\<ComputerName>) as part of the KeyName. Omitting \\ComputerName\ causes the operation to default to the local computer. The KeyName must include a valid root key. Valid root keys for the local computer are: HKLM, HKCU, HKCR, HKU, and HKCC. If a remote computer is specified, valid root keys are: HKLM and HKU. If the registry key name contains a space, enclose the key name in quotes.
/v <ValueName> Specifies the name of the registry entry to be added under the specified subkey.
/ve Specifies that the registry entry that is added to the registry has a null value.
/t <Type> Specifies registry types to search. Valid types are: REG_SZ, REG_MULTI_SZ, REG_EXPAND_SZ, REG_DWORD, REG_BINARY, REG_NONE. If not specified, all types are searched.
/s <Separator> Specifies the character to be used to separate multiple instances of data when the REG_MULTI_SZ data type is specified and more than one entry needs to be listed. If not specified, the default separator is \0.
/d <Data> Specifies the data for the new registry entry.
/f Adds the registry entry without prompting for confirmation.
/oa  
Specifies that all differences and matches are displayed. By default, only the differences are listed.
 
/od Specifies that only differences are displayed. This is the default behavior.
/os Specifies that only matches are displayed. By default, only the differences are listed.
/on Specifies that nothing is displayed. By default, only the differences are listed.
/s Compares all subkeys and entries recursively.
/va Deletes all entries under the specified subkey. Subkeys under the specified subkey are not deleted.
<FileName> Specifies the name and path of the file to be created during the operation. The file must have a .reg extension.
/y Overwrites any existing file with the name FileName without prompting for confirmation.
/se <Separator> Specifies the single value separator to search for in the value name type REG_MULTI_SZ. If Separator is not specified, \0 is used.
/f <Data> Specifies the data or pattern to search for. Use double quotes if a string contains spaces. If not specified, a wildcard (*) is used as the search pattern.
/k Specifies to search in key names only.
/d Specifies to search in data only.
/c Specifies that the query is case sensitive. By default, queries are not case sensitive.
/e Specifies to return only exact matches. By default, all the matches are returned.
/z Specifies to include the numeric equivalent for the registry type in search results.
/? Displays help for reg <operation> at the command prompt.
 

How to edit registry using (CMD)

To edit the registry we will need to use ADD operation but following with the /F switches to overwrite the existing entries. If we don't use the /F switches the command line with asking you to confirm to overwrite. Let's change the value from 1 to 0.
reg  add  HKEY_CURRENT_USER\Software\NewTestKey\ /v  TestValue /t  REG_DWORD /d  0

That its. The value of entries "TestValue" will change from 1 to 0.

edit registry using (CMD)

edit registry using (CMD)

 

Conclusions:

This is all about to understand the windows registry and to be available to edit the registry using (CMD). We will write and explain different articles real examples to add, edit, or delete keys and entries on the registry using CMD. Stay with US!

Share
Tweet
Google+
Pinterest
Linkedin
Stumble
Email
Prev Article
Next Article

Related Articles

pdf preview handler outlook
The PDF preview handler error most of the time is …

Troubleshoot PDF Preview Handler – This File Cannot Be Previewed

How to delete files using PowerShell
Often, system admins, engineers, or developers might need to deploy …

How to delete files using PowerShell

Best Computers & Laptops

Best Computer for Cyber Security – Laptop and Desktop
Best Computer for Cyber Security
Hey, are you seeking the best computer for cyber security? Well, we must say you have come to the right place to find your answer and guidance. There are a plethora of products out there for you to pick from ...
Read More
Best Computer for Microsoft Office & Excel – Laptop and Desktop
Best Computer for Microsoft Office & Excel
Are you finding the Best Computer for Microsoft Office and Excel? In modern days, the best laptop or desktop set is the one which is both portable, has good looks and offers the smoothest performance. Microsoft Office is a package ...
Read More
Best Computer for Hacking – Laptop and Desktop Selection
Best computer for Hacking
When it comes to hacking, either laptop or desktop, choosing the best computer for hacking would be an exhilarating job. There are many specifications to be considered for hacking ...
Read More

SQL Server Tips

FIX sqlstate 42000 – mysql error 1064 – you have an error in your sql syntax
Sqlstate 42000 Is a general code that come together with other number. Most often comes with the code 1064 and ...
Read More
The execute permission was denied on the object – SQL Server Error
The execute permission was denied on the object
The following article will handle “the execute permission was denied on the object” error appears on SQL Server. This error ...
Read More
How to Read Data from LDF file in SQL Server – A Complete Guide
Read LDF File
Hello Everyone, Today we are going to address the most popular query of SQL users, how to read data from ...
Read More

Search

We are on:

Get FREE SPACE for your PC

3 Method to Delete Temp Files in Windows 7/10 including vbs script

In this post we will explain how to delete temp files windows 7 using three different methods including vbs script ...
Read More

Fastest way to delete hiberfil sys from windows 10/8/7 and XP – CMD

In this article we will explain how to remove or delete hiberfil sys from Windows 10/8/7 and XP . If you does ...
Read More

Learn How to Silent Install Applications

Silent Install Adobe Flash Player
In this tutorial will explain how to silent install adobe flash player 25, Msi and Exe version. How to disable auto update and uninstall older ...
Read More
Java Silent Install and Uninstall Older Version – Deploy Package MSI
This tutorial will explain how to silent install Java MSI/EXE version and disable auto-update. The command line will also uninstall the ...
Read More
Silent Install Adobe Shockwave Player 12 and disable update
In this tutorial will explain how to silent install Adobe Shockwave Player 12 msi and disable auto update. The command will uninstall older ...
Read More
Silent Install Google Chrome MSI, Silent Uninstall and Disable Auto Update
This tutorial will explain how to silent install Google Chrome MSI and disable auto update. The command will uninstall older version of ...
Read More
Silent Install Adobe Reader 11 and DC – msi and exe – disable update
In this tutorial will explain how to silent install Adobe Reader version 11 and DC. We will user both version "msi" ...
Read More
Silent Install Mozilla Firefox msi and exe file – Including Silent Uninstallation
This tutorial will explain how to silent install Mozilla Firefox. We will use MSI and EXE files to perform a silent ...
Read More
Skype Silent Install Msi and disable updates
In this tutorial will explain how to silent install skype  and disable auto update. The command will uninstall older version of Skype and ...
Read More
Filezilla Silent Install msi and exe version
Filezilla silent install tutorial will explain how to perform a silent installation of application. We will explain methods, silent install ...
Read More
Silent install VLC Media Player
In this tutorial will explain how to silent install VLC Media Player. We will explain both methods for exe and ...
Read More
Notepad++ silent install exe and msi version – Command Line
Notepad++ silent install is the new article from a series of silent installations. Notepad++ as free software has two main ...
Read More

Batch File Solutions

How to list files in cmd – Command Prompt – Windows 10
Whenever you want to search and make a list of all files on a specific folder, you used the windows ...
Read More
Batch rename multiple files in folder – CMD script – Bulk Method – Win 10
The following article will teach how to rename multiple files in a folder with the bulk method using Command Line ...
Read More
Batch script rename file using Command Line (CMD) & PowerShell – Windows 10
The following article will use the “rename” or “ren” command to rename the file using a command prompt. Also, we ...
Read More
Change extension of multiple files at once – CMD batch file
The following article will teach the methods to change the extension of multiple files at once using command prompt and ...
Read More
How to delete registry key with command line | PowerShell | Batch
The following article is the third of series about registry and working on it through command line (CMD) and PowerShell ...
Read More
How to add registry key & values with CMD | PowerShell | Batch
The registry is the place where most of the applications store the settings but not only. Used also from the ...
Read More
Unmap Network Drive CMD – (Batch file) – net use delete command
After we posted the methods to map network drive using cmd commands we come this time with the method to ...
Read More
Map Network Drive cmd (batch file) – net use user password
This article will focus on another way to map a network drive on your computer instead of from the explorer ...
Read More
How to Find Large Files on Windows 7 & 10 – CMD Forfiles Command
If the capacity of your hard drive is running low, it is time to clean off some files and to ...
Read More
CMD Script to check disk space on windows and multiple remote servers
The following article will provide you script to check disk space. The Script monitor space on windows and multiple remote ...
Read More

Get IT Solutions

How to do IT

About Us

Get IT Solutions is a personal blog, which is managed to guide people for various topic.

Second Menu

  • Donate
  • About Us
  • Contact Us
  • Privacy Policy

What Will You Find

Automation is our area of writing where are included scripts, batch and various tips to automate your daily job.
Copyright © 2025 Get IT Solutions