Search code examples
pythonregistrywinreg

Merge a .reg file via Python 2.7


I am looking for a simple way to merge a .reg file into the registry as part of my automated script in Python 2.7. I am rather lost on this issue and haven't found very much useful information.

I can do this via a batch file, but when I call that batch via python, no changes are made to the registry.

Any advice on how I might do this within Python would be greatly appreciated.


Solution

  • I was unable to find a way to successfully merge a .reg with the registry. However, you can make all of those same changes to the registry using _winreg. This will allow you to modify individual keys, subkeys, and values. Thus, I was able to manually make all of the registry changes that are set in the .reg file.