[python-win32] Error FindPerformanceAttributesByName

Tim Golden mail at timgolden.me.uk
Wed May 16 14:27:47 CEST 2007


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


More information about the Python-win32 mailing list