Newbie Windows Registry Question

Stacy stacycollings at yahoo.com
Mon Jul 12 13:13:03 EDT 2004


Hi All,

I'm trying to automate some migration tasks on XP and one of the steps
involved is to export a reg key to install on a new machine.  After
days of surfing the web and trying things, I give!Ineedsome newbie
help.  What I want is to export the given key to my USB drive for
later import to the new machine's registry.  The Python code I've
written also copies User files, favorites, etc...Here's an example of
what I have tried as far as the reg key goes:

import _winreg
_winreg.SaveKey(hkey_local_machine\software\adobe,
r"C:\Python23\samplekey.reg")

This gives the following error:
SyntaxError: invalid token

Okay, so then I tried this:
_winreg.SaveKey(r"hkey_local_machine\software\adobe",
r"c:\python23\samplekey.reg")

And I get this error message:
TypeError: The object is not a PyHKEY object

Any idea what I am doing wrong?

Thanks!

Stacy :)



More information about the Python-list mailing list