[python-win32] Access is denied while retriving 64 bit registry from 32bit python script

Tim Golden mail at timgolden.me.uk
Tue Jul 29 14:18:38 CEST 2008


siddhartha veedaluru wrote:
> Hi,
> Hello,
>  
> I have installed 32bit python on x64 bit machine.
> I also installed pywin32-211.win32-py2.5.exe
>  
> As part of a script i required to access the registry and i used the 
> following code snippet.
>  
> import os, sys
> from _winreg import *
> KEY_WOW64_64KEY = 256
> regHandle = OpenKey(HKEY_LOCAL_MACHINE,"SOFTWARE\Valule 
> Systems\ValApp\Instance001",0,KEY_WOW64_64KEY or KEY_READ or KEY_WRITE)
> print regHandle
> val = QueryValue(regHandle,"sPhysicalNodeName")
> print val


Ignoring for the moment the problem at hand...

...why do you think that KEY_WOW64_64KEY or KEY_READ or KEY_WRITE
will give you a bitwise or?

Try this in the interpreter:

<code>
A, B, C = 1, 2, 4

print A or B or C

</code>

You probably want A | B | C

TJG


More information about the python-win32 mailing list