24

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.

1
  • 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? May 14 '13 at 19:00
28

Try this:

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

This will export registry values according to windows REG format.

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.

1
  • Never heard of SETX but it was exactly what I was looking for. Thanks!
    – bigjosh
    Jan 3 '19 at 18:35
1

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

1
  • 1
    Hey 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"? Jan 1 '17 at 21:59
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

1
  • Not working while it has white space (ERROR: The system was unable to find the specified registry key or value.)
    – Abbas
    Apr 19 at 9:15
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

1
  • 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
    Nov 7 '16 at 12:47

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.