windows 以纯文本格式导出注册表

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/4627521/
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

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-15 15:55:36  来源:igfitidea点击:

Export registry in plain text format

windowsbatch-filecmd

提问by Rock with IT

My object is to export the Windows registry in txt format using a batch file.

我的目标是使用批处理文件以 txt 格式导出 Windows 注册表。

If I use either of the following two lines from a batch file:

如果我使用批处理文件中的以下两行之一:

REG EXPORT C:\t.txt "HKEY_CURRENT_USER\Software"
REGEDIT /E C:\t.txt "HKEY_CURRENT_USER\Software"

I get output similar to this:

我得到类似于这样的输出:

Windows Registry Editor Version 5.00

[HKEY_CURRENT_USER\Software]

[HKEY_CURRENT_USER\Software\Adobe]

I am surprised with the output of export using the REGEDIT GUI. If I select File->Export and change the "Save as type" to "Text Files", I get output similar to this:

我对使用 REGEDIT GUI 导出的输出感到惊讶。如果我选择 File->Export 并将“Save as type”更改为“Text Files”,我会得到类似这样的输出:

Key Name:          HKEY_CURRENT_USER\Software
Class Name:        <NO CLASS>
Last Write Time:   1/5/2011 - 8:27 AM

Key Name:          HKEY_CURRENT_USER\Software\Adobe
Class Name:        <NO CLASS>
Last Write Time:   11/4/2010 - 12:01 PM

I think the second example shows the data in a more readable format. I want to achieve the same output using cmd or batch file.

我认为第二个示例以更易读的格式显示数据。我想使用 cmd 或批处理文件实现相同的输出。

Any help will be highly appreciated.

任何帮助将不胜感激。

回答by npocmaka

Try it like this

像这样试试

START /W REGEDIT /E file.txt %REG_PATH%

By default it saves files with the .reg file extension. But it's a text file which can be executed by regedit and make changes in registry.

默认情况下,它使用 .reg 文件扩展名保存文件。但它是一个文本文件,可以由 regedit 执行并在注册表中进行更改。

If you think this is not readable enough, try Import/Export registry sections as XML.

如果您认为这不够可读,请尝试将注册表部分导入/导出为 XML