[python-win32] Python and Win 7 Registry VirtualStore

Tim Roberts timr at probo.com
Tue Jun 4 19:10:41 CEST 2013


John Spitzer wrote:
> I have an application I built that ran fine on Windows XP, but now fails 
> on Windows 7. The place I'm encountering the problem is where I try to 
> read a key from the registry. I believe it's because of the 
> Virtualization of the registry on Windows 7. This key is created by 
> another app that I'm trying to co-ordinate with. ...
> The code fragment that is reading the registry is:
> -----
> from _winreg import *
>
>          ConnKey = OpenKey(HKEY_LOCAL_MACHINE, r'SOFTWARE\Interface 
> Software\ConnMgr', 0, KEY_READ)
>          ConnValue = QueryValueEx(ConnKey, "DB Path")
>          EWDataSource = os.path.split(str(ConnValue[0]))
> ------
> The OpenKey fails with the message: WindowsError: (2, 'The system cannot 
> find the file specified"). I believe this is because the key does not 
> exist at the path [HKEY_LOCAL_MACHINE\SOFTWARE\Interface Software\ConnMgr].
>
> After all this, the question is: Why isn't the OpenKey call being 
> redirected to the VirtualStore? What can I change in the program, ACLs 
> or other to make it be redirected?

Is your application a service?  Is it running elevated?

-- 
Tim Roberts, timr at probo.com
Providenza & Boekelheide, Inc.



More information about the python-win32 mailing list