在 Windows 中重写注册表文件 [英] Rewrite Registry File in Windows

查看:49
本文介绍了在 Windows 中重写注册表文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我一直试图找到一种方法来整理"注册表 在我的 Windows 机器上.首先,这有意义吗?这样做有什么好处吗?(在 superuser.com 上不太喜欢)其次,我正在寻找一种使用 C/C++ 和 Windows API 重写注册表的方法.有没有办法读取注册表并将其写入一个新文件,以便在此过程中摆脱未使用的字节?(我可能必须写入新文件,然后启动到另一个操作系统/磁盘才能覆盖原始文件……但我愿意冒这个险.)

I have been trying to find a way to "defragment" the registry on my Windows machine. Firstly, does this make sense? Any benefits in doing this? (Not much love on superuser.com) Secondly, I am looking for a way to rewrite the registry using C/C++ with 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 might have to write the new file and then boot into another OS/disk before I can overwrite the original... but I am willing to take that risk.)

推荐答案

Microsoft 的 PageDefrag 正是这样做的,因为它在其页面上声明PageDefrag 使用标准文件碎片整理 API 对文件进行碎片整理."

Microsoft's PageDefrag does exactly this, as it states on its page "PageDefrag uses the standard file defragmentation APIs to defragment the files."

(链接文章的副本在这里 因为在典型的 MSDN 样式中,它们的链接已失效.)

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

这篇关于在 Windows 中重写注册表文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆