Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Export registry in plain text format

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

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:

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.

Any help will be highly appreciated.

like image 252
Rock with IT Avatar asked Jan 07 '11 16:01

Rock with IT


People also ask

How do I Export my entire registry?

In Registry Editor, locate and click the registry key or subkey that you want to back up. Select File > Export. In the Export Registry File dialog box, select the location to which you want to save the backup copy, and then type a name for the backup file in the File name field. Select Save.

How do I save a registry file in Notepad?

Just use the File menu while in Notepad and use the Save As... function and rename the file with a . reg extension.

Is registry a text file?

REG files are text files: Create them within a text editor when you save a file with the . reg extension. On Windows, right-click a REG file and open it with Notepad, or the text editor of your choice, to edit it. To use a REG file, simply open it and its contents will be added to the Windows Registry.


1 Answers

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.

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

like image 159
npocmaka Avatar answered Sep 20 '22 15:09

npocmaka