Kevin,

Also check the permissions on the problem users registry. I would expect that to cause a different error, but it might be worth checking.

Most users are local admins. And it's just been happening for the last couple of weeks, so it's likely what Roger said: a corrupt registry entry. I tried upgrading to 211 last night and am waiting for that user to login again. For some reason, after upgrading to 211, I am getting an import error on my wx module. Are these tied together in some weird way?


Kevin Horn

On Mon, Jun 23, 2008 at 2:25 PM, Roger Upole <[EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]>> wrote:


    Mike Driscoll wrote:

        Mike Driscoll wrote:

            Hi,

            In one of my login scripts for work, I run a query to see
            if the VNC
            service is running using the win32serviceutil module. The
            code for
            that I am using looks something like this:

            <code>
            import win32serviceutil
            serviceState = win32serviceutil.QueryServiceStatus('VNC
            Server')[1]
            </code>

            This works in 99.99% of cases. However, I have on user
            that keeps
            getting the following traceback:

            Traceback (most recent call last):
             File "\\ourServer\pathName\PostLogon.py", line 207, in ?
              serviceState = win32serviceutil.QueryServiceStatus('VNC
            Server')[1]
             File
            
"\\ourServer\pathName\Python24\lib\site-packages\win32\lib\win32serviceutil.py",
            line 479, in QueryServiceStatus
              hs = SmartOpenService(hscm, serviceName,
            win32service.SERVICE_QUERY_STATUS)
             File
            
"\\ourServer\pathName\Python24\lib\site-packages\win32\lib\win32serviceutil.py",
            line 81, in SmartOpenService
              name = _GetServiceShortName(name)
             File
            
"\\ourServer\pathName\Python24\lib\site-packages\win32\lib\win32serviceutil.py",
            line 62, in _GetServiceShortName
              skey = win32api.RegOpenKey(hkey, svc, 0, access)
            error: (2, 'RegOpenKeyEx', 'The system cannot find the
            file specified.')


            <snip>



        I forgot to mention that we use Windows XP, Python 2.4 and PyWin32
        version 210.

        Mike


    You might want to try build 211.  It uses the API function
    GetServiceKeyName instead of manually enumerating the
    registry.

    However, it sounds like you could have a corrupt registry key.
    Try reinstalling the service and see if that helps.

           Roger


Mike
_______________________________________________
python-win32 mailing list
python-win32@python.org
http://mail.python.org/mailman/listinfo/python-win32

Reply via email to