How to export a specific registry key to a text file using command line

23

4

How can I export specific value from the registry to a text file using the command line?

For example, I want to export Hkey_local_Machine\Software\mcafee to a text file in C:. I just need the key – that's it.

I tried with reg export – it's giving everything, but I just require the key of the partiular thing.

Sohail

Posted 2013-05-14T18:39:08.463

Reputation: 351

It's kind of hard to follow what you actually want to export. What do you mean by reg export "giving everything"? Did you specify the exact key you wanted to export? – Ƭᴇcʜιᴇ007 – 2013-05-14T19:00:11.857

Answers

26

Try this:

reg export Hkey_local_Machine\Software\mcafee C:\export.txt

This will export registry values according to windows REG format.

Nathan C

Posted 2013-05-14T18:39:08.463

Reputation: 2 522

3

You can export a specific registry value to a text file with a setx command Copy/pasta from there:

SetX _TZone /k HKLM\System\CurrentControlSet\Control\TimeZoneInformation\StandardName
>Tzone.txt echo %_TZone%


The alternative to above is to write it to a reg file using the methods in the above answers:

REG EXPORT HKLM\System\CurrentControlSet\Control\TimeZoneInformation\StandardName C:\Windows\Temp\Tzone.reg

The reg file can be opened for read/write, check here for format.

Laurie Stearn

Posted 2013-05-14T18:39:08.463

Reputation: 344

Never heard of SETX but it was exactly what I was looking for. Thanks! – bigjosh – 2019-01-03T18:35:30.660

1

Sometimes one has to enclose the registry key in quotes in order to get down to individual items

REG EXPORT "HKCU\Software\SS64\xxxx" C:\MyReg.REG

Maxjonz

Posted 2013-05-14T18:39:08.463

Reputation: 11

1

reg export Hkey_local_Machine\Software\mcafee\key C:\export.txt && type C:\export.txt | findstr /i "key"

Joshua

Posted 2013-05-14T18:39:08.463

Reputation: 11

1Hey this looks kinda like what I'm looking for. can I export all keys containing "specialString" by using reg export C:\export.reg findstr /i "specialString"? – Metallkiller – 2017-01-01T21:59:16.090

0

Enter this in at the DOS prompt :

reg export HKLM\Software\Microsoft\Windows\CurrentVersion\Uninstall test.txt && type test.txt | findstr /i "DisplayName" > list.txt | notepad list.txt

Garbunkel

Posted 2013-05-14T18:39:08.463

Reputation: 11

Please consider using ``` to mark your command line as code. In addition consider adding an explanation of how it works so it would be clearer on how to adapt it to the original question. – Seth – 2016-11-07T12:47:33.110