_winreg.saveKey question

Larry Bates larry.bates at websafe.com
Mon Oct 23 15:23:02 EDT 2006


> remotekey = _winreg.OpenKey(rhostreg, key)


Try adding the sam=_winreg.KEY_SET_VALUE parameter.

Help on built-in function OpenKey in module _winreg:

OpenKey(...)
    key = OpenKey(key, sub_key, res = 0, sam = KEY_READ) - Opens the
          specified key.

    key is an already open key, or any one of the predefined HKEY_* constants.
    sub_key is a string that identifies the sub_key to open
    res is a reserved integer, and must be zero.  Default is zero.
    sam is an integer that specifies an access mask that describes the desired
     security access for the key.  Default is KEY_READ

    The result is a new handle to the specified key
    If the function fails, an EnvironmentError exception is raised.


The default is KEY_READ so you can't update.

-Larry Bates



More information about the Python-list mailing list