Automated method to convert .reg registry file to reg.exe commands

Occasionally I need to put registry entries into batch files to use in login scripts, unattended installers, etc. While it's pretty easy to add one or two registry commands to a batch file using reg.exe, when there is a large amount of registry data, it becomes tedious. I usually just end up merging an external reg file in those cases, which I would like to avoid, since it ruins the self-contained nature of the batch file. Does anybody know of any tools which can automatically convert a .reg file to a series of REG ADD and REG DELETE commands? This would make life a lot easier! Thanks.


Solution 1:

I think it could lead to trouble as the registry can contain extended characters like in unicode format and so on and bat files might not handle that so great, depending on what you do with the strings.

I've always called separate .reg files for this and it feels more natural to separate your "code-base" in as small chunks as possible and not use one giant file for everything.

It sounds like it should be quite easy to write a script to do the basics of it though if nothing comes up ^^