以编程方式将 .reg 文件合并到 win32 注册表中 [英] programmatically merge .reg file into win32 registry

查看:49
本文介绍了以编程方式将 .reg 文件合并到 win32 注册表中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

以编程方式将 .reg 文件合并到注册表中的最佳方法是什么?这是用于单元测试;.reg 文件是一个测试工件,它将在测试开始和结束时添加然后删除.

What's the best way to programmatically merge a .reg file into the registry? This is for unit testing; the .reg file is a test artifact which will be added then removed at the start and end of testing.

或者,如果有更好的方法对注册表进行单元测试...

Or, if there's a better way to unit test against the registry...

推荐答案

可以使用 .reg 文件删除注册表项,但我不确定它的文档记录情况.方法如下:

It is possible to remove registry keys using a .reg file, although I'm not sure how well it's documented. Here's how:

REGEDIT4

[-HKEY_CURRENT_USER\Software\<otherpath>]

密钥名称前面的 - 告诉 Regedit 您要删除密钥.

The - in front of the key name tells Regedit that you want to remove the key.

要静默运行,请键入:

regedit /s "myfile.reg"

这篇关于以编程方式将 .reg 文件合并到 win32 注册表中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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