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.
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 ^^
I've used https://www.sordum.org/8478/reg-converter-v1-2/ to convert basic .reg files into .bat files and have had reasonable success - although it would probably depend on the types of keys (as mentioned).