Windows Registry is one of the mysterious parts of the Windows operating system that allows us to tweak and modify almost all the sections of Windows. Even though we work with the registry all the time, most people have only a little understanding of what it really is and are not sure of how to create custom keys and values. So let’s find out a thing or two about Windows Registry and its components.
What is Windows Registry
Windows Registry is nothing but a collection of different configurations and settings related to the operating system, programs, and users. You can think of it like a database that virtually stores all the important information. This information includes anything related to system hardware, application settings, installed programs, user profiles, etc. Since all the important information is stored in a single place, Windows refers to the Registry all the time, and it is actually easier and faster for Windows to manage different parts of the operating system without messing with tons of individual configuration files located in different locations.
Components of Windows Registry
Windows Registry consists of three main components – the Root level keys, Keys, and Values. “Root-level keys” hosts all the “Keys” and the “Keys” will have their own set of “Values.” You can think of it like “LocalDrive -> Folder -> File” in your system.
There are five different Root level keys which have their own specific purpose in the registry. Here is a gist of these root keys.
HKEY_CLASSES_ROOT (HKCR): This Root key is used by Windows to manage Object Linking and Embedding (OLE) and file type associations. This is the key where Windows links all your files to their relevant programs so that you can open and interact with them.
HKEY_CURRENT_USER(HKCU): This section of Windows Registry hosts all the data, user-level settings and configurations associated with the currently logged in user. Not only the Windows operating system, but other programs also store data relevant to the current user.
HKEY_LOCAL_MACHINE (HKLM): Regardless of the user status, this section contains all the system related keys including any hardware settings, software settings, etc. Since this key hosts most of the system-wide information, HKLM is one of the most accessed root keys of Windows Registry.
HKEY_USERS (HKU): As you can see from the name, this root key hosts all the settings of all the users including any logged in and logged off users on the system. As you can find settings regarding other users, don’t confuse this root key with HKCU.
HKEY_CURRENT_CONFIG (HKCC): Simply put, you can call this a pseudo root key as it is just a direct link to the Current Hardware Profile Settings in the HKLM root key.
Each of the above Root Keys has their own Keys, and each Key has its own values. For each Key, you can create six different values, and those values depend entirely upon the target program and/or the configuration requirements.
String Value: String Values are mostly human readable and only have a single line of textual information, like file paths. String Values are one of the most commonly used values in the Windows Registry.
Binary Value: As the name implies, these values only contain binary data (0, 1). Often these values are used to turn on or off a particular setting.
DWORD Value (32-bit): DWORD values are similar to Binary values but are also capable of storing any integer in the range of 32-bit. DWORD values are designed to work with 32-bit systems, but are also used in 64-bit systems for backward compatibility.
QWORD Value (64-bit): QWORD values are just like DWORD values but are capable of holding any integer within the range of 64-bits. You can say these are designed to work with 64-bit systems.
Multi-String Value: If String values are used to store single line strings, Multi-String values are used to store multi-line strings or textual information.
Expandable String Value: Expandable String values are similar to normal String values but contain the environmental variables.
Creating New Keys and Values
Creating Keys and Values in Windows Registry is relatively easy and straightforward. But before doing anything, please back up your Windows Registry as any misconfigurations or unwanted deletions may cause critical errors.
To create a new Key, right-click on the Root level key and select the option “New” and then “Key.” By default, the newly created key will look like a folder and will be named something like “New Key #.” You can always modify the key name as required. The same procedure is applied whenever you want to create a new Sub-Key.
To create a new value, right-click in the right pane and select the value depending on your needs as discussed above. Once the value is created, you need to name it; the name depends entirely upon the specific requirement. But do note that if you select the option “Key” in the right-pane, Windows Registry will automatically create a new Sub-Key.
Once the new value is created and renamed, you need to enter the value data. To do that, double-click on the value and enter the “Value Data” as required. Again, the Value Data depends on the program or the specific settings.
That’s all there is to do, and hopefully this helps you to understand the Windows Registry and its components better and to create new keys and values as required.