Backup individual registry keys to file from command line
While setting up some backup scripts for a windows server (using NasBackup - go go gadget free plug) I realized I should also be backing up certain registry keys to go along with the files. Clearly a solution that could be initiated from command line (in a bash batch script as I can’t write VBscript and don’t want to learn) would be the best option.
There are 2 ways to handle this:
REG EXPORT <keyname> <file> /y
(/y so it will overwrite an existing file without prompting)
or
regedit /e <file> <key> \
I went with the first option, it works well. I inserted it as the first line in start.phase in NasBackup so that I can backup the reg files after they have been exported.
