[python-win32] Walking the registry and creating reg files

Tim Roberts timr at probo.com
Fri Dec 5 00:13:48 CET 2008


Mike Driscoll wrote:
>
> We're doing what amounts to a registry session audit here at work, so
> I need to walk a specific set of subfolders in our registry and get
> the contents thereof. The subfolders will vary from user to user. I
> found Tim Golden's excellent registry walking script on his website here:
>
> http://timgolden.me.uk/python-on-windows/programming-areas/registry/walk-the-registry.html
>
>
> My problem is that I need to output the data into *.reg files. Is
> there a builtin way to do that with _winreg or PyWin32 or do I just
> need to roll my own?

I'm not answering the question you asked, but are you aware of the very
handy "reg" tool included with XP?  "reg export" can export a full key
in a format that is compatible with regedit.
    reg export HKLM\system\CurrentControlSet\Services\vgasave  xxx.reg

-- 
Tim Roberts, timr at probo.com
Providenza & Boekelheide, Inc.



More information about the python-win32 mailing list