Tim Golden wrote :
> le dahut wrote:
>> Hi,
>>
>> I'm using win32pdhutil.FindPerformanceAttributesByName in order to know 
>> if 'explorer.exe' is running or not. Sometimes I get this error :
>> """
>>    File "win32pdhutil.pyc", line 97, in FindPerformanceAttributesByName
>>
>>    File "win32pdhutil.pyc", line 60, in GetPerformanceAttributes
>>
>> pywintypes.error: (-2147481643, 'CollectQueryData', 'No error message is 
>> available')
>> """
>>
>> I've googled for "2147481643" but didn't find interesting pages. Can 
>> someone explain me what's happening ?
> 
> Notice that the number is actually negative: -2147481643
> which equates to hex 800007d5. Might be worth searching on
> that. Meanwhile...
> 
> ... I can't easily think of a situation under Windows when
> explorer.exe *isn't* running, since it powers thing like
> your desktop. This code snippet, for example, shows
> the explorer processes running on my machine with
> nothing running in the foreground except the Python
> process itself:
> 
> <code>
> import wmi
> for i in wmi.WMI ().Win32_Process (Name="explorer.exe"):
>    print i.CommandLine
> 
> # => c:/windows/explorer/exe
> </code>
> 
> What are you trying to do with the explorer.exe
> once you find it?
> 
> TJG

Kill it  ;-)

this code is part of an winlogon notification package that setup users' 
environment like hide drives which require explorer to be restarted.

If you're interested in how to make that, here's the subversion's url
- for the .dll that runs the python script
http://eole.orion.education.fr/depot/listing.php?repname=Eole&path=%2FEole2%2Fscribe%2Fcontrole-vnc%2Ftrunk%2Fsources%2Fcliscribe_dll%2F&rev=0&sc=0
- for the python script itself (look for logon.py)
http://eole.orion.education.fr/depot/listing.php?repname=Eole&path=%2FEole2%2Fscribe%2Fcontrole-vnc%2Ftrunk%2Fsources%2Fservscribe%2F&rev=0&sc=0

I've re-written my "isrunning" and the killProcName functions with 
ctypes which runs very faster than the python version (look for 
process.py in subversion).


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

Reply via email to