windows Regedit:从命令提示符查找和导出密钥
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/15409138/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Regedit: Find and export keys from command prompt
提问by Ara
I'm wondering is there any option via command line to search for a string and export all found keys in Windows registry?
我想知道是否有任何选项可以通过命令行搜索字符串并导出 Windows 注册表中所有找到的键?
采纳答案by durilka
Powershell has registry iteration capabilities. Start here: http://technet.microsoft.com/en-us/library/ee176841.aspx
Powershell 具有注册表迭代功能。从这里开始:http: //technet.microsoft.com/en-us/library/ee176841.aspx
回答by Abhineet
Ex:: If you want to check whether "HKLM\software\etc" key exists.
例如:如果你想检查“HKLM\software\etc”键是否存在。
reg.exe query "HKLM\Software\etc"
will return all the subkeys and values in command prompt if found or an error if not found.
reg.exe query "HKLM\Software\etc"
如果找到,将返回命令提示符中的所有子项和值,如果未找到则返回错误。
ALso, you can directly do
另外,你可以直接做
reg.exe export "HKLM\software\etc" "C:\etc.reg"
This will export the registry key and subkeys if found otherwise error if not found.
如果找到,这将导出注册表项和子项,否则会出现错误。
回答by T.Todua
export key (with all sub-keys), from CMD (or RUN) i.e.:
导出密钥(包含所有子密钥),来自 CMD(或 RUN),即:
regedit /e c:\output.reg "HKEY_LOCAL_MACHINE\System\YourLocation"
p.s. you should run this in CMD with ADMIN PRIVILEGES. for that, right click on START>Run CMD (as Admin)
ps 你应该在 CMD 中使用 ADMIN PRIVILEGES 运行它。为此,右键单击START>Run CMD (as Admin)