简体   繁体   English

在Windows 7中应从.reg文件中的键中检索值

[英]Shall retrieve value from a key in .reg file in Windows 7

the path in registry : 注册表中的路径:
HKEY_CURRENT_USER\\Software\\Windows\\MySoftware\\Version1
Name: installpath
value: c:/Program files/MySoftware/

How do I get the installpath value via .reg file syntax? 如何通过.reg文件语法获取installpath值?

I have read MS document on .reg file, it can add/delete, but I don't find how to retrieve value. 我已经阅读了.reg文件上的MS文档,它可以添加/删除,但是我找不到如何检索值。 Any idea? 任何想法?

update 更新
I am trying to use *.reg file to set registry. 我正在尝试使用* .reg文件设置注册表。
Or whether .reg file can retrieve key's value? 还是.reg文件可以检索密钥的值?

There is no true way of actually retrieving the value of a registry key using a *.reg file. 没有使用* .reg文件实际检索注册表项的值的真正方法。 The .reg extension is not really a language but more like instructions given to registry editor to interpret and thus extremely limited. .reg扩展名并不是真正的语言,而是更像是给注册表编辑器的解释说明,因此非常受限制。

The easiest way to grab values is by going to your reg editor, going to that path then in the file menu selecting export. 获取值的最简单方法是转到注册表编辑器,转到该路径,然后在文件菜单中选择“导出”。

This will save that value as a .reg file. 这会将值另存为.reg文件。

To set a key use the following syntax 要设置密钥,请使用以下语法

Windows Registry Editor Version 5.00

[HKEY_CURRENT_USER\Software\Windows\MySoftware\Version1]
"installpath"="c:/Program files/MySoftware/"

Save that into file.reg and run it. 将其保存到file.reg中并运行它。

You can also use other utilities such as cmd and powershell if required to grab registry data. 如果需要获取注册表数据,还可以使用其他实用程序,例如cmd和powershell。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM