[python-win32] Access is denied while retriving 64 bit registry from 32bit python script
siddhartha veedaluru
siddhartha.veedaluru at gmail.com
Tue Jul 29 13:27:17 CEST 2008
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
gives
C:\Precert>test.py
Traceback (most recent call last):
File "C:\Precert\test.py", line 4, in <module>
regHandle = OpenKey(HKEY_LOCAL_MACHINE,"SOFTWARE\Value Systems\ValApp\In
stance001",0,KEY_WOW64_64KEY or KEY_READ or KEY_WRITE)
WindowsError: [Error 5] Access is denied
Please help
regards
Siddhartha
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-win32/attachments/20080729/236f37b0/attachment.htm>
More information about the python-win32
mailing list