http://www.microsoft.com/technet/scriptcenter/scripts/python/pyindex.mspx has some scripts that appear to do what you need.
(Quite cool that we can now post a microsoft.com address for help with Python scripts ;) Mark. > -----Original Message----- > From: [EMAIL PROTECTED] > [mailto:[EMAIL PROTECTED] Behalf Of Chris Miles > Sent: Monday, 25 July 2005 7:45 AM > To: python-win32@python.org > Subject: [python-win32] Fetching network interface instance names > > > Hi, I am querying win32pdh to fetch statistics from each network > interface on the machine. I am able to fetch the stats I need, using > the code below, from each network interface, provided I already know > the network interface instance name (eg: intf below). > > My Q is: how can I programmatically find out what the network > interface instance names are? > > I can see the instance names manually from the GUI using > win32pdhutil.browse() but that doesn't help my program do it. > > >>> intf = 'Intel[R] PRO_100 Network Connection - Packet Scheduler > Miniport' > >>> import win32pdh > >>> hq = win32pdh.OpenQuery() > >>> cp = win32pdh.MakeCounterPath( (None, 'Network Interface', intf, > None, -1, 'Bytes Sent/sec') ) > >>> hc = win32pdh.AddCounter( hq, cp ) > >>> type,val = win32pdh.GetFormattedCounterValue( hc, > win32pdh.PDH_FMT_LONG ) > >>> type > 272696320 > >>> val > 0 > > Cheers, > Chris > > -- > Chris Miles > http://chrismiles.info/ > > _______________________________________________ > Python-win32 mailing list > Python-win32@python.org > http://mail.python.org/mailman/listinfo/python-win32 _______________________________________________ Python-win32 mailing list Python-win32@python.org http://mail.python.org/mailman/listinfo/python-win32