>.> wrote: > That works for XP but not Vista, I guess M$ changed the API in Vista. > Oh by the way I mean to write win32pdhutil.browse() earlier. Thanks > for the help. > I didn't run it as admin in Vista before so I gave your script a try. > The output from your script as run in vista by administrator follows: > [code] > >>> win32pdhutil.browse() > Value of '\Network Interface(Intel[R] PRO_100 VE Network > Connection)\Current Bandwidth' is 100000000.0 > Added 'Current Bandwidth' on object 'Network Interface' (machine > \\SAIBOX-01), instance Intel[R] PRO_100 VE Network > Connection(0)-parent of None
Now, you know that "Current Bandwidth" is not what you want, right? This just shows it is a 100Mbit connection. > Traceback (most recent call last): > File > "C:\Python25\Lib\site-packages\pythonwin\pywin\framework\scriptutils.py", > line 310, in RunScript > exec codeObject in __main__.__dict__ > File "C:\Python25\getrcv.py", line 10, in <module> > tp,val = win32pdh.GetFormattedCounterValue( hc, > win32pdh.PDH_FMT_LONG ) > error: (-1073738810, 'GetFormattedCounterValue', 'No error message is > available') > >>> > [/code] > I'm new to working in windows and am curious as to how to go about > getting the error codes, I tried hex(1073738810) but thats not right. It's a 32-bit unsigned value that is printed as a signed value, so the minus sign is important. From Python, try hex(2**32 - 1073738810) You'll find it is C0000BC6, which is PDH_INVALID_DATA. Perhaps Microsoft change the counter name in some way in Vista. -- Tim Roberts, [EMAIL PROTECTED] Providenza & Boekelheide, Inc. _______________________________________________ python-win32 mailing list python-win32@python.org http://mail.python.org/mailman/listinfo/python-win32