Modifying the registry of an image without running that image

  • Thread starter Thread starter Georges Berenger
  • Start date Start date
G

Georges Berenger

I hope the answer is trivial, but I couldn't find anything good in the
mass of answers I got using google...

I want to massage some registry entries of my image before duplicating
it. Of course, I could write a program or a script that I would run
while the image is running, but that would be more complicated than what
I hope a simple command line tool will let me do: I just want to modify
the registry files of my non-running XPe image... Is there such a tool?

Thanks,
-georges
 
Hi Georges,

You can use regedit.
Create one dummy key anywhere in the registry.
Import one of hive files from XPe image to this key.
Modify registry keys.
And then export whole branch back to hive file you opened.

Also you might want to do that from system account because you will have privileges to change anything in registry.

Either create simple service that will launch regedit in system account. Or use second XPe based on minlogon with regedit in it so
you can open and modify offline hive files.

Best regards,
Slobodan
 
Slobodan said:
Hi Georges,

You can use regedit.
Create one dummy key anywhere in the registry.
Import one of hive files from XPe image to this key.
Modify registry keys.
And then export whole branch back to hive file you opened.

Very cool, thank you! I didn't quite make it the way you suggest, but
you lead me in the right direction. Regedit can't be scripted, but the
reg tool that can. Therefore, I tried to use it again to do what you
suggested, despite the very terse documentation.
Reg has the load function that I didn't understand properly before,
because I was trying to operate directly on the file itself, and I
didn't realize that it would just let me do that, with a twist.
To do what I wanted to do:
- load the reg file in the registry:
reg load hku\mytemplocation myregistryfile
- make the changes in that location using the other reg commands
reg add ... / reg delete ... etc.
- unload the reg file from the registry:
reg unload kku\mytemplocation

Et voilà!

Thanks again! Without your suggestion to take me in the right direction,
I'd still be looking :-)
-georges
 
Hi Georges,

I'm glad to be able to help you.

I prefer either to do the things trough API or regedit, but reg.exe can do the job just fine (as you used it).

Best regards,
Slobodan
 
Back
Top