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

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 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.


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


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