Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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.

share|improve this question

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

share|improve this answer
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 9:12

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.