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

Mike Driscoll mdriscoll at co.marshall.ia.us
Fri Dec 5 15:22:12 CET 2008


Tim Roberts wrote:
> 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
>
>   

I suppose I should have completely explained the project, but I didn't 
think the other details mattered. I will be running this as part of my 
login script, and writing each subfolder to a directory tree on a per 
user basis. We are trying to figure out which users have which sessions 
of a certain program and how to best manage said sessions and their 
respective configurations, hence the audit.

I wasn't aware of this function but I don't know if it will run on every 
XP machine I touch. I keep running into screwy oddities on our machines 
where stuff that I thought should be standard isn't actually there. I'll 
look into your suggestion and see if it's viable though. Thanks for the 
info.

Mike


More information about the python-win32 mailing list