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

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

5 Answers

Try this:

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

This will export registry values according to windows REG format.

You can export a specific registry value to a text file with a setx commandCopy/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

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

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

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

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

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

You Might Also Like