Changing Remote Registry

Gabriel Genellina gagsl-py2 at
Thu Aug 13 06:39:40 CEST 2009

En Mon, 10 Aug 2009 09:47:19 -0300, Kevin Holleran <kdawg44 at>  
> On Fri, Aug 7, 2009 at 2:08 PM, Tim Golden <mail at> wrote:
>> Kevin Holleran wrote:
>>> hKey = _winreg.OpenKey (keyPath, path, 0, _winreg.KEY_SET_VALUE)
>>> value,type = _winreg.QueryValueEx(hKey, item)
>>> if (value == wrongValue):
>>>       _winreg.SetValue(hKey,'',_winreg.REG_SZ,correctValue)
>>> When I do this I receive the error:
>>> _winreg.SetValue WindowsError: [Error 5] Access Denied
> I guess my question is will Windows let me change the registry remotely?
> The error is a Windows permission error on the KEY_SET_VALUE.  I am  
> running
> this as a domain admin on a machine on the domain.  Does the connection
> inherit the credentials I am running it under or will I need to pass  
> those
> in?  Or does Windows simply not let me change the registry?

Try doing the same interactively with regedt32.exe (logged as the same  
user). You can check your actual permissions under the Edit menu.
Also, try using KEY_WRITE instead of KEY_SET_VALUE.

Gabriel Genellina

More information about the Python-list mailing list