by Ivan Jenic

INSTALL BY CLICKING THE DOWNLOAD FILE
The latest Windows 10 Preview build 14942 mainly focused on improving the system’s features, and bringing some new options to them. One of the nicest touches from the new build is definitely the introduction of an address bar for the Registry Editor (regedit).
What do you think about the introduction of the address bar in the Registry Editor? Will it make browsing through registry keys easier? Tell us in the comments.
RELATED STORIES YOU NEED TO CHECK OUT:
Microsoft. Win32. Registry.4.0.0.nupkg
nuget.org
dot.net
License
Frameworks
Provides support for accessing and modifying the Windows Registry.
Commonly Used Types:
Microsoft. Win32. RegistryKey
Microsoft. Win32. Registry
Microsoft. Win32. RegistryValueKind
Microsoft. Win32. RegistryHive
Microsoft. Win32. RegistryView
When using NuGet 3.x this package requires at least version 3.4.
Registry cleaning. Items or entries inside a registry can sometimes break, though it is a rare occurrence with modern versions of Windows registries. To fix broken entries, a registry cleaner is required, but unlike standard configuration files, entries inside a Windows registry cannot be opened or cleaned via standard text editors. While there are many third-party registry cleaners available, the Windows Registry Editor tool works well for removing unwanted data in the registry.
Finding strings. The Registry Editor can be helpful when searching for specific strings in key names, value names and value data.
Remote editing of the registry. The Windows Registry Editor can be used for remote editing of another computer’s registry on the same network.
Modification of registry keys. Registry keys can be modified, renamed or deleted by the Windows Registry Editor. The registry keys, subkeys, values and value data can also be manipulated.
1. In the taskbar search field, type regedit and select Registry Editor. The Windows Registry Editor Window should open and look like Figure 1.

Figure 1. How to open the Windows registry
2. Right-click Start or the Windows icon and select Run.
3. Type regedit in the box and select OK. The screen shown in Figure 2 will display.

Figure 2. The main view of the Windows registry

Figure 3. How to locate the registry key for backup

Figure 4. How to export the backup file in the registry

Figure 5. How to name the backup file
5. Click Save.
A corrupt Windows registry can be fixed by removing faulty keys manually through the Registry Editor. Cleaning the registry is especially beneficial after uninstalling programs. Sometimes, uninstalled programs can leave remnants of software inside the registry and hard drive, which could interfere with the OS and other applications.
1. Open the Registry Editor using the steps mentioned in the previous section and expand the HKEY LOCAL MACHINE The screen shown in Figure 6 will appear.

Figure 6. How to locate the HKEY_LOCAL_MACHINE folder
2. Locate the SOFTWARE folder and expand it. This will show a list of folders related to all the installed programs.

Figure 7. How to locate and expand the SOFTWARE folder
3. Find a folder for an unused program or invalid registry keys. The only registry files that can be removed safely from the registry are those that belong to programs that have already been uninstalled or are no longer used.
4. Right-click the folder to see a drop-down menu and click Delete.

Figure 8. How to delete a registry entry
5. Click Yes when prompted with “Are you sure you want to permanently delete this key and all of its subkeys?”

Figure 9. How to rename a registry key
2. To rename a registry key, right-click on that key and select Rename. Give the key a new name and press Enter to save.

Figure 10. How to rename the registry value
3. To rename a registry value, right-click on the value on the right and choose Rename. Give the registry value a new name and press Enter.
4. To change a value’s data, right-click on the value on the right and choose Assign a new Value data and then select OK to confirm, as shown in Figure 11.

Figure 11. How to change a value’s data
The Windows registry can be edited through command-line options as well. Learn how to edit the registry through the command prompt and look into the various parameters.
Must-know tips on the Windows tool
by Afam Onyimadu
Updated on January 10, 2023

If you want to customize your Windows 11 computer or troubleshoot problems, you’ll need to know how to use the Registry Editor, which allows you to view and edit the Registry.
In this article, we’ll show you how to access Registry Editor in Windows 11 and provide tips for using it safely and effectively.
Now you have gotten into the tool, let us explore some tips for using Registry Editor as well as a few common tasks.
It’s crucial to make a backup of the registry before making any modifications. In the event that any issues arise as a consequence of your modifications, this will enable you to restore the register to an earlier state.
Modify values
Be careful when modifying values; be sure to enter the correct data type and value. Incorrect data types or values can cause problems with the operating system or applications.
Remember to only make changes to the registry if you are sure they are necessary, since unnecessary changes can increase the risk of encountering problems.
Add values
The Registry Editor includes a search function that allows you to find specific keys or values within the registry. This can be helpful if you are looking for a specific setting or if you are trying to troubleshoot a problem.
Add Registry keys
Use caution when deleting keys, as this can cause problems with the Windows OS or applications. If you are unsure whether a key is safe to delete, do some research or ask for help before proceeding.
These pointers will help you utilize the Registry Editor to alter the registry and adjust your system in a secure and efficient manner.
Let us know in the comments below what you love most about the Registry Editor in Windows 11.
Приветствую всех, сегодня поговорим об одной интересной теме, работа с реестром.
Реестр Windows или системный реестр (Windows Registry) — иерархически построенная база данных параметров и настроек в большинстве операционных систем Microsoft Windows. Реестр содержит информацию и настройки для аппаратного обеспечения, программного обеспечения, профилей пользователей, пред установки. Большинство изменений в Панелиуправления, ассоциации файлов, системные политики, список установленного ПО фиксируются в реестре.
Windows хранит море информации о системе, настройках программ, пользователях и множество других данных в специальном хранилище— реестре. Существует возможность улучшить работу программ путем изменения параметров, содержащихся в реестре. В Интернете можно найти целый класс программ, называемых твикерами, в которых собраны различные полезные и интересные настройки, которые можно поменять в реестре, чтобы изменить функциональность программ. Не представляет труда самому написать такойтвикер при помощи управляемого кода.
Разделы реестра
Пространство имен для работы с реестром using Microsoft. Win32;
Registry — это статический класс, предоставляющий эксклюзивный доступ к ключам реестра для простых операций.
Registry — этот класс предоставляет набор стандартных корневых разделов, находящихся в реестре компьютеров, работающих под управлением Windows. Реестр является средством хранения сведений о приложениях, пользователях и стандартных системных параметрах. Например, приложения используют реестр для хранения сведений, которые необходимо сохранить после закрытия приложения и к которым необходимо получать доступ при перезагрузке приложения. Например, можно сохранять цветовые настройки, положение или размер окна. Для разных пользователей эти сведения могут сохраняться в различных местах реестра.
Класс Registry предоставляет доступ к следующим разделам:
LocalMachine – Сохраняет сведения о конфигурации для локального компьютера
ClassesRoot – Сохраняет сведения о типах (и классах) и их свойствах.
PerformanceData – Сохраняет сведения о производительности программных компонентов.
CurrentConfig – Сохраняет сведения об оборудовании, не являющемся специфическим для пользователя.
DynData – Stores dynamic data (Deprecated).
RegistryKey – the class implements methods for viewing child keys, creating new ones or reading and modifying existing ones, including setting security levels for them.
Reading from the registry is done using the GetValue method, the node must first be opened using the OpenSubKey method.
Data is written to the registry using the SetValue method, the node must exist and be previously opened using the OpenSubKey method, indicating the “open for writing” sign.
Displaying information about the registry structure
Read registry keys:
An example of adding a program to startup:
You should also pay more attention to deletion, the DeleteSubKey method does not have a recursive call, which means that you will have to delete the subkey first, and only then the subkey itself.
An example of searching the registry for a parameter by section using recursion, unfortunately access to some branches is denied, even under the admin, I had to use try cath
Starting with the release of windows 8, the rights of applications with the work of the registry were limited, for security purposes, and now in order for your application to make any changes, you must run it with administrator rights.
You can go 3 ways:
Another very important point if you have a 64bit system, then the save path will be different from 32bit, for example, to the software section, since the data will be stored in the SoftwareWOW6432Node section. Whatever the program saves along the Software path, you can use the following code:
C# and . NET — Multithreading and Files — Registry
In all versions of Windows since Windows 95, the registry is the central repository for all configuration information regarding Windows setup, user preferences, and installed software and hardware. Almost every commercial software these days uses a registry to store information about itself.
COM components also need to store information about themselves in the registry in order for clients to access them. Wednesday. NET Framework and its concept of zero-impact installation makes the registry a little less essential for applications, since the assemblies created with it are completely self-contained, i.e. no registry information is required for them, even if they are shared.
In addition to . NET Framework introduces the concept of isolated storage (applications can store per-user information in files) and . NET Framework takes care of the separate storage of data for each user logged into the system.
The fact that applications can now be installed using the Windows Installer frees developers from having to manipulate the registry, without which application installation was previously impossible. However, despite this, it remains possible that the distributed application will use the system registry to store information about its configuration.
For example, if an application should appear in the Add/Remove Programs dialog box in Control Panel, you will need to make appropriate entries in the system registry. The system registry may also be needed for backward compatibility with legacy code.
As you would expect from such an extensive library as . NET, it ships classes that allow you to access the registry. There are two such classes, Registry and RegistryKey, and both are in the Microsoft namespace. Win32. Before moving on to these classes, let’s take a quick look at the structure of the registry itself.
The registry has a hierarchical structure, much like a file system. Two utilities are commonly used to view and modify the contents of the registry: regedit and regedt32. The regedit utility is standard and comes with all versions of Windows since Windows 95. The regedt32 utility is included with Windows NT and Windows 2000 and is less user friendly than regedit, but it does allow access to security-related information that regedit does not allow viewing.
In Windows Server 2003, these utilities have been merged into a single new editor, simply called regedit. In discussions here, we are referring to the regedit utility that comes with Windows 7, which you can run by typing regedit in a dialog box to run programs or at the command prompt.
The figure shows what the regedit window looks like when you run this utility for the first time. In this figure, you can see that regedit has a tree/list style user interface that is similar to Windows Explorer and exactly reflects the hierarchical structure of the registry itself. However, some important differences will be shown soon:

In a file system, top-level nodes represent disk partitions — C: , D: and so on. In the registry, the equivalent of disk partitions are registry hives. Modifying existing partitions is not allowed – they are fixed and there are seven in total, although only five of them are visible in the regedit interface, which are listed below:
contains details about the types of files on the system (.txt, .doc, etc.) and which applications can open each of these file types. It also contains registration information for all COM components (this usually takes up the most space in the registry, since Windows now ships a huge variety of COM components).
contains details regarding the preferences of the user who is currently logged in locally. These preferences include desktop settings, environment variables, connections to networks and printers, and other settings that determine the appearance of the user’s work environment.
is a huge section that contains details about all the software and hardware installed on the machine. Also includes the HKCU key, which is not a separate key on its own, but merely a convenient mapping of the HKLM/SOFTWARE/Classes registry key.
contains details regarding the configuration of the equipment installed on the machine.
The other two root sections contain information that is temporary and changes frequently:
is a common container for any current data that needs to be stored somewhere in the registry.
contains information regarding the performance of currently running applications.
Inside the sections is a tree structure of registry keys. Each is much like a folder or file in a file system. However, there is one very important difference between them. The file system distinguishes between files (which store data) and folders (which mostly contain other files or folders), while the registry contains only keys. Each key can contain both data and other keys.
If the key contains data, then they are represented by a sequence of values. Each value has a name associated with it, a data type, and data itself. In addition, the key has an unnamed default value.
This whole structure can be seen using the regedit utility. The figure shows the contents of the HKCUConsole key:

Registry entries can be in the format of one of three data types:
As already mentioned, access to the registry allows you to get two classes from the Microsoft namespace. Win32: Registry and RegistryKey. An instance of RegistryKey represents a registry key.
This class has methods for viewing child keys, for creating new keys, and for reading and changing values in existing keys, i.e. you can do everything you would normally want to do with registry keys, including setting security levels for them. It is this class that is used to perform most of the work with the registry.
For example, to obtain a RegistryKey instance representing an HKLM key, you would write code like this:
RegistryKey hklm = Registry. local machine;
The process of obtaining a reference to a RegistryKey object is called opening a key. Although you might expect that, since the registry has the same hierarchical structure as the file system, the methods offered by the RegistryKey class should be similar to those implemented in DirectoryInfo, this is actually not the case.
Often the way the registry is accessed is different from the way files and folders are used, and RegistryKey implements methods that reflect this.
The most obvious difference has to do with how the key is opened in a certain place in the registry. The Registry class does not have any public constructor that can be used, nor does it have methods that let you jump to a key by name directly. Instead, you will have to get to the desired key from the topmost section.
If you need to create an instance of a RegistryKey object, then the only possible way is to start with the corresponding static property of the Registry class and work your way down from there. That is, for example, to read data from the HKLMSoftwareMicrosoft key, you need to get a link to it as follows:
RegistryKey hklm = Registry. local machine;
RegistryKey hkSoftware = hklm. OpenSubKey(“Software”);
RegistryKey hkMicrosoft = hkSoftware. OpenSubKey(“Microsoft”);
Accessing the key in this manner is read-only. If you need to write any data to the key (including writing its value, and creating or deleting its immediate children), you will need to use a different overridden version of OpenSubKey. It takes a second parameter of type bool indicating whether access to the key should be provided not only for reading, but also for writing. For example, to be able to change the Microsoft key (having system administrator rights), you would need to write the following code:
RegistryKey hklm = Registry. local machine;
RegistryKey hkSoftware = hklm. OpenSubKey(“Software”);
RegistryKey hkMicrosoft = hkSoftware. OpenSubKey(“Microsoft”, true);
By the way, since this key contains information used by Microsoft applications, in most cases this particular key should not be modified.
The OpenSubKey() method is called in cases where the key is expected to already exist. If the key is not there, OpenSubKey() returns a null reference. To create a key, you must use the CreateSubKey() method (which automatically grants both read and write access to the key via the returned reference):
RegistryKey hklm = Registry. local machine;
RegistryKey hkSoftware = hklm. OpenSubKey(“Software”);
RegistryKey hkMine = hkSoftware. CreateSubKey(“MyOwnSoftware”);
The way the CreateSubKey() method works is quite interesting. It creates the key if it doesn’t exist, and if the key exists, the method simply returns a RegistryKey instance that represents the existing key. The reason this method behaves this way has to do with how the registry is typically used.
The registry as a whole contains permanently stored data such as configuration information for Windows and various applications. Therefore, the need to create a key explicitly does not arise very often.
More often than not, applications need to check for the presence of some information in the registry—in other words, create keys if they don’t already exist, and do nothing if the keys are already there. The CreateSubKey() method is just perfect for this need. Unlike the situation with FileInfo. Open(), if CreateSubKey() is used, accidental deletion of any data is excluded. If you actually want to delete some registry keys, you will need to call the DeleteSubKey() method.
Given the importance of the registry to Windows, this makes sense. It is unlikely that anyone will like the prospect of accidentally crashing a Windows system simply by deleting a few important keys while debugging self-written C# code that works with the system registry.
After detecting a key to be read or modified, you can use the SetValue() or GetValue() method, respectively, to set or retrieve data
out of him. Both of these methods take a string with the name of the value as a parameter, but SetValue() also needs to additionally pass as a parameter a reference to an object that contains details about the value. Since, by definition, this parameter must be a reference to an object, it can actually be a reference to any class. Based on the type of the provided class, the SetValue() method will determine the type for the value – REG_SZ, REG DWORD, or REG_BINARY. For example:
RegistryKey hkMine = HkSoftware. CreateSubKey(“MyOwnSoftware”) ;
hkMine. SetValue(“MyStringValue”, “Hello World”);
hkMine. SetValue(“MyIntValue”, 20);
This code sets two values for the key: MyStringValue with REG_SZ type and MyIntValue with REG_DWORD type.



