WIN32 - get the GUID of a Network Device

Tim Golden mail at timgolden.me.uk
Tue Apr 27 03:42:06 EDT 2010


On 26/04/2010 22:07, Tim Roberts wrote:
> Tim Golden wrote:
>> On 26/04/2010 09:49, Richard Lamboj wrote:
>>> thanks for your response. No, i don't mean the MAC Address. I mean
>>> the GUID ->
>>> Sample: {1E2428C1-9F2C-48D7-AB53-3229DFB7E217}
>>>
>>> I want to change TcpAckFrequency and TcpDelTicks of a Network
>>> Interface. I Try
>>> to change it over the Registry, but maybe there is another way?
>>
>> 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>
>
> No, the PnP class GUID is the "Class" line from the top of the INF
> file.  That will be the same for all network cards.
>
> You can look up the network interface GUID in the registry, in
> HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\NetworkCards.  There's
> one subkey for each interface, containing a Description and a
> ServiceName.  The ServiceName is the interface GUID.
>

Thanks, Tim. I was sure you'd be in the know :)

TJG



More information about the Python-list mailing list