WIN32 - get the GUID of a Network Device

Tim Golden mail at timgolden.me.uk
Mon Apr 26 12:58:23 CEST 2010


On 26/04/2010 11:47, Tim Golden wrote:
> OK; I'm going to hope that Tim Roberts or someone equally knowledgeable can
> kick in here as devices really isn't my area. However this looks like it *might*
> be doing what you want:
>
> <code>
> import wmi
>
> for nic in c.Win32_NetworkAdapter (MACAddress=i.MACAddress):
>     for pnp in c.Win32_PNPEntity (DeviceID=nic.PNPDeviceID):
>       print pnp.Caption, "=>", pnp.ClassGuid
>
> </code>

[replying to self] Please ignore that: not only does the code not
work, due to some rough cut-and-pasting, it also doesn't produce
the GUID you wanted. Sorry. Hopefully someone else has a clue.

TJG



More information about the Python-list mailing list