in reply to Re^2: WindowsRegistry{ServiceName} V.S. wmic{ServiceName}
in thread WindowsRegistry{ServiceName} V.S. wmic{ServiceName} UPDATE: Solved

Many thanks NetWallah for the great update! Your use of the correct term for the hex servicename (GUID), jogged my memory on when I last looked into this stuff. I may be able to dig up something from the past.

Here is the problem I asking for direction with now:

On my machine, "wmic nic list brief" gives me 22 devices:

AdapterType DeviceID MACAddress Name Ethernet 802.3 1 xx:xx:xx:xx:xx:xx Intel(R) PRO/1000 PL Ne Ethernet 802.3 2 xx:xx:xx:xx:xx:xx Intel(R) PRO/Wireless 3 3 Infrared Port Ethernet 802.3 4 xx:xx:xx:xx:xx:xx Packet Scheduler Minipo 6 Bluetooth Device (Perso 7 RAS Async Adapter 8 WAN Miniport (L2TP) Wide Area Network 9 xx:xx:xx:xx:xx:xx WAN Miniport (PPTP) Wide Area Network 10 xx:xx:xx:xx:xx:xx WAN Miniport (PPPOE) 11 Direct Parallel 12 WAN Miniport (IP) Ethernet 802.3 13 xx:xx:xx:xx:xx:xx Packet Scheduler Minipo Ethernet 802.3 14 xx:xx:xx:xx:xx:xx Packet Scheduler Minipo Ethernet 802.3 15 xx:xx:xx:xx:xx:xx Lucent VPN Miniport Ethernet 802.3 16 xx:xx:xx:xx:xx:xx Lucent VPN Miniport Ethernet 802.3 17 xx:xx:xx:xx:xx:xx Lucent VPN Miniport 18 WAN Miniport (Network Ethernet 802.3 19 xx:xx:xx:xx:xx:xx Packet Scheduler Minipo 20 Linksys Etherfast USB 21 Packet Scheduler Minipo 22 Lucent VPN Miniport
However, looking at the registry with the following code, I only get information on 3 of the devices:
use strict; use Win32::TieRegistry; use Data::Dumper; my $dev="LMachine/SOFTWARE/Microsoft/Windows NT/CurrentVersion/Network +Cards/"; my $key= $Registry->Open($dev, { Access => "KEY_READ", Delimiter => "/ +" } ); print Dumper($key); $VAR1 = bless( { '2/' => bless( { '/ServiceName' => '{8BAA28BF-8565-43BE-81C0-E7BBD94187D3}', '/Description' => 'Intel(R) PRO/1000 PL Network Connection' }, 'Win32::TieRegistry' ), '21/' => bless( { '/ServiceName' => '{15B70374-1CD7-416E-A08A-22F96A502A54}', '/Description' => 'Linksys Etherfast USB 10/100 Ethernet Adapter' }, 'Win32::TieRegistry' ), '3/' => bless( { '/ServiceName' => '{7F8B1DE7-B0AA-40C0-8D89-D0325F269899}', '/Description' => 'Intel(R) PRO/Wireless 3945ABG Network Connectn' }, 'Win32::TieRegistry' ) }, 'Win32::TieRegistry' );
I would like to get the GUID for a device that doesn't appear in the registry. How do I do this?

Anticipating a possible answer: If the GUID doesn't exist, how can I get one created for a given device?

Many, many, thanks!

-Craig

Replies are listed 'Best First'.
Re^4: WindowsRegistry{ServiceName} V.S. wmic{ServiceName}
by NetWallah (Canon) on Sep 20, 2007 at 21:57 UTC
    Sorry - that is a bit deeper into the network stack and Registry interaction than I have dived.

    In fact, I am not comfortable with the code I posted, because I do not understand the interaction between "wmic nic" information and the registry location (which was pointed out by ikagami, I believe. To me, the code is a hack, and there ought to be a better way (but I do not have the time or motivation to research it).

    I'm not sure it is meaningful to invent and attach GUIDs to devices that Windows does not care enough about to assign GUIDs.

         "As you get older three things happen. The first is your memory goes, and I can't remember the other two... " - Sir Norman Wisdom