The Windows Registry is a collection of settings that Windows and applications can use. It is a directory which stores settings and options for the operating system for Microsoft Windows. It contains information and settings for all the hardware, operating system software, most non-operating system software, users, preferences of the PC, etc.
The Registry consists of the following 5 Root Keys. Root Keys contain SubKeys. Subkeys may contain subkeys of their own too and contain at least one value, called its Default Value. A key with all its subkeys and values is called a Hive.
Each key has one of the Data Types – data types:
- REG_SZ, REG_BINARY,
- REG_MULTI_SZ or
In this post, we will show you how to create a Registry Key in Windows 10.
The Windows Registry is complex by architecture and built such that general consumers won’t understand. It is also advisable that you know the basics and do not modify it unless you know what you are doing.
The hierarchy of Registry
To edit the Registry, we use the built-in Registry Editor or regedit. It displays a tree-like navigation structure. The topmost is your computer, followed by a list of folders, and subfolders. These folders are called KEYS, and there are five fixed set of folders under the Computer.
- HKEY_CLASSES_ROOT: Contains file extension association information which helps the computer understand what to do with a task when asked.
- HKEY_CURRENT_USER: It contains configuration information for Windows and software for the current user.
- HKEY_LOCAL_MACHINE: It stores the configuration for the software installed on the computer, and also for the Windows OS
- HKEY_USERS: Here you can find a user-specific configuration for all users on that computer.
- HKEY_CURRENT_CONFIG: Its a pointer to HKEY_LOCAL_MACHINE
These are the master keys as you cannot create a NEW KEY under Computer – but you can generate new keys under any of these master keys.
How to create a Registry Key in Windows 10
1] Using Registry Editor
Creating a Registry Key is easy. Right-click on any folder or white space and choose New. You can create a Key, String Value, Binary Value, DWORD Value (32-bit), QWORD value (64-bit), Multi-String Value or Expandable String Value. This method is useful when you plan to perform a minor change to fix a problem on your computer. It could be related to an application or on the OS level.
- To edit an existing value, double-click on it to launch the editor.
- To delete a key, right-click on it and select Delete.
- You also have the option to Rename, Export, Copy, and set Permissions.
2] Using the Command Line
You can also use Command Line to manipulate registry keys along with tips, features and safety methods.
3] Use Notepad to create REG files
Right-click on any of the existing keys, and export it. Open that file in notepad, and it will help you understand how you can edit a key and its values. It is useful when you want to perform bulk editing, with backup in place.
Note the version declaration, followed by a blank line, then the path followed by rest in quotes, and a blank line again. Once the edit is complete, you can right-click, and choose to merge the file into the registry hive.
4] Third-Party Tools
If you find the default registry editor complex, you can use tools like RegCool, Registrar Registry Manager Lite, and Registry Commander. They offer features like Undo, Redo, permission management, tabbed window, import, export, favorites and so on.
3] Use Programming
If you are an application developer, you should use programming to manage your application settings in the registry. Here is an example, and it will vary depending on the language you use to develop the application.
RegistryKey key = Registry.LocalMachine.CreateSubKey(@"SYSTEM\CurrentControlSet\services\eventlog\MyApplication\MyService"); key.Close();
Now that you know how to do it, we also recommend you to read what each of these means. It’s essential, and will only help you to make sure the changes you make are correct.
What makes a Registry Key?
If you imagine “Key” as a folder, the rest of them are different types of file types that store various kinds of values. So if you build an application, you can have a master folder, and then subfolders to separate one set from another. Here is a bit about each of them:
DWORD & QWORD: Double Word can store a 32-bit unit of data, while QWORD can store 64-bit of data.
String Value (REG_SZ): It can store either a Unicode or an ANSI string, and contains a null at the end.
Multi-String value: When you want to store multiple numbers of String Value, you can use this. However, make sure to terminate it by an empty string (\0). Here is a simple example:
Note “\0” at the end marks the end of the first string, and the last \0 marks the end of the multi-string.
Expandable String Value: You can use this for Environment Variables using Unicode or ANSI string. The advantage here is that you can expand it unlike String and Multi-String value.
Binary Value: The simplest of all – it contains 0 and 1.
We hope that you find this post useful.
- Tags: Registry