Andrew
Andrew

Reputation: 1575

How append exported reg key to file.reg

Cannot find a way to append Reg export output to existing file, so i'm running this command

REG EXPORT HKEY_CLASSES_ROOT\Directory\Background\shellex\ContextMenuHandlers\NvCplDesktopContext\ backup.reg

To export some settings to backup.reg file when it try to export something else i'm getting message that this will override the file. Anyway i can append it to file instead of rewriting reg file?

Upvotes: 0

Views: 1127

Answers (2)

Eric
Eric

Reputation: 111

@Gene, Code works but I think the last line should be:

del /f /q current.tmp

Upvotes: 0

Gene
Gene

Reputation: 4232

How about ...

@echo off 

REG EXPORT HKEY_CLASSES_ROOT\Directory\Background\shellex\ContextMenuHandlers\First\ current.tmp /y
more current.tmp >> merged.reg

REG EXPORT HKEY_CLASSES_ROOT\Directory\Background\shellex\ContextMenuHandlers\Second\ current.tmp /y
more +1 current.tmp >> merged.reg

REG EXPORT HKEY_CLASSES_ROOT\Directory\Background\shellex\ContextMenuHandlers\Third\ current.tmp /y
more +1 current.tmp >> merged.reg

rm current.tmp

Upvotes: 3

Related Questions