Overwrite registry file in Windows

I am trying to find a way to "defragment" the registry on my Windows machine. First, does it make sense? Any benefits to this? (Not much love at superuser.com) Secondly, I am looking for a way to rewrite the registry using C / C ++ using the Windows API. Is there a way to read the registry and write it to a new file, getting rid of unused bytes along the way? (I may have to write a new file and then boot onto another OS / drive before overwriting the original ... but I'm ready to take a chance.)

+4
source share
3 answers

Microsoft PageDefrag does just that, as indicated on its page. "PageDefrag uses standard file defrag files to defrag files."

(A copy of the related article here , because in the typical MSDN style, their link is dead.)

+2
source

http://www.larshederer.homepage.t-online.de/erunt/ - NTREGOPT NT Registry Optimizer

Like Windows 9x / Me, registry files on an NT-based system can become fragmented over time, taking up more disk space than necessary, and reducing overall performance. You should regularly use the NTREGOPT utility, but especially after installing or uninstalling the program, to minimize the size of the registry files and optimize access to the registry. The program works by recreating each registry hive from scratch, thus removing any free space that may be left with previously changed or deleted keys.

http://reboot.pro/index.php?showtopic=11212 - offline registry registry Offreg.dll MS WDK

The offline registry library (Offreg.dll) is used to modify the registry hive outside the active registry. This library is intended for registry update scripts, such as servicing an operating system image. The library supports hive registry formats starting with Windows XP. Developer Audience

http://reboot.pro/topic/11312-offline-registry/ - offline registry MS WDK Command-Line Tool

A command line tool that allows you to read and write to an offline registry hive.
+2
source

Reading values ​​should be possible.

But I have never seen any specifications about how registry files are written to disk, and if you do not find them, you will have to reverse engineer these files on your OS (there may be differences between XP and 7, etc.). Then you must remember that the registry is not only one file, it is several files, and some of them belong to certain users, and I think that they use SIDs and not usernames, so even if you move them to a new one computer, you must make sure that the same OS version with the same users with the same SIDs that are installed on it.

All this is for little or no gain, so I would agree with superuser users that this makes no sense.

0
source

Source: https://habr.com/ru/post/1313065/


All Articles