3

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.

nhinkle
  • 567
  • 2
  • 17

2 Answers2

2

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 ^^

Oskar Duveborn
  • 10,740
  • 3
  • 32
  • 48
  • That's usually the best solution indeed, just having them separate. But sometimes it's helpful to have everything in one file, particularly when you have to distribute that file to users and would rather avoid having to distribute several files. Thanks for the input though. – nhinkle Sep 26 '10 at 09:12
0

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).

Svenkle
  • 101
  • 1