如何将导出的注册密钥附加到 file.reg



找不到将 Reg 导出输出附加到现有文件的方法,所以我正在运行此命令

REG EXPORT HKEY_CLASSES_ROOTDirectoryBackgroundshellexContextMenuHandlersNvCplDesktopContext backup.reg

要将某些设置导出到 backup.reg 文件,当它尝试导出其他内容时,我收到消息说这将覆盖该文件。无论如何,我可以将其附加到文件中而不是重写reg文件?

怎么样...

@echo off 
REG EXPORT HKEY_CLASSES_ROOTDirectoryBackgroundshellexContextMenuHandlersFirst current.tmp /y
more current.tmp >> merged.reg
REG EXPORT HKEY_CLASSES_ROOTDirectoryBackgroundshellexContextMenuHandlersSecond current.tmp /y
more +1 current.tmp >> merged.reg
REG EXPORT HKEY_CLASSES_ROOTDirectoryBackgroundshellexContextMenuHandlersThird current.tmp /y
more +1 current.tmp >> merged.reg
rm current.tmp

@Gene,代码有效,但我认为最后一行应该是:

del /f /q current.tmp

最新更新