Win32 Registry Manipulation w/PythonWin?

David LeBlanc whisper at oz.net
Mon Jul 29 13:51:35 EDT 2002


You know you don't need PythonWin to manipulate the registry? You can use
the standard Python module __winreg. That module has the following function:

DeleteValue(key, value)
Removes a named value from a registry key.
key is an already open key, or one of the predefined HKEY_* constants.

value is a string that identifies the value to remove.

Re the constants: probably grep the source Luke :->

David LeBlanc
Seattle, WA USA

> -----Original Message-----
> From: python-list-admin at python.org
> [mailto:python-list-admin at python.org]On Behalf Of Tim Daneliuk
> Sent: Monday, July 29, 2002 0:10
> To: python-list at python.org
> Subject: Re: Win32 Registry Manipulation w/PythonWin?
>
>
> Tim Daneliuk wrote:
> > Tim Daneliuk wrote:
>
> > This is where I run into a problem.  I am having a dickens of a time
> > figuring
> > out how to remove just a single value within a key.  I cannot
> seem to find
> > the magic that allows editing of the lowest level leaf nodes of
> a registry
> > entry on an individual basis.  If I try to treat them as *key* Python
> > grumbles
> > something to the effect that it cannot find that file at the
> OpenKey call.
> > If I try to use DeleteValue, I get permission denied even though I am
> > running
> > with Administrator privileges on a Win2K machine.
>
>
> Never Mind ;-(  I just figured out that I was not setting the access
> control properly when I opened the key which is what was causing the
> access denied error.
>
> On a related note, where in the docs are values for KEY_READ, KEY_WRITE,
> and so forth, defined?  I cannot seem to find these...
>
>
> --
> ------------------------------------------------------------------
> ------------
> Tim Daneliuk
> tundra at tundraware.com
>
> --
> http://mail.python.org/mailman/listinfo/python-list





More information about the Python-list mailing list