First step is to find the details that I want to change. I've been using WMI
class Win32_NetworkAdapter and found a very close match in the Description &
Name properties but not exactly.
WMI Description: Intel(R) PRO/100 VM Network Connection
IPCONFIG Description: Intel(R) PRO/100 VM Network Connection #3
Am I on the right path in tracking these details. All help greatly
appreciated.
Regards,
Si.
I have a feeling these are stored in the registry. If you query the key:
HKLM\System\CurrentControlSet\Control\Class\{4d36E972-E325-11CE-BFC1-08002bE10318}
Read each sub key to locate the correct network interface (see the
DriverDesc value) and then obtain the NetCfgInstanceId value.
Read all subkeys within:
HKLM\Software\Microsoft\Windows NT\CurrentVersion\NetworkCards
Look for a value called ServiceName that matches NetCfgInstanceId
Once you've found it, the corresponding Description value should give you
what you're looking for.
I once used the following to force speed/duplex to 100Mbps Half duplex.
Hopefully this should give you an idea of how to process each subkey:
On Error Resume Next
Set shell = CreateObject("wscript.shell")
Dim strRegKey, strregVal, strDone
strDone = "No"
for i = 1 to 20
strRegVal = ""
strRegKey =
"HKLM\System\CurrentControlSet\Control\Class\{4d36E972-E325-11CE-BFC1-08002bE10318}\000"
& i
strRegVal = shell.RegRead(strRegKey & "\DriverDesc")
if strRegVal = "" then
i = 1000
else
Select Case strRegVal
Case "Intel(R) PRO/100 VM Network Connection"
shell.RegWrite strRegKey & "\SpeedDuplex", 3
strDone = "Yes"
Case "Intel(R) PRO/100 VE Network Connection"
shell.RegWrite strRegKey & "\SpeedDuplex", 3
strDone = "Yes"
Case "Intel(R) PRO/1000 MT Network Connection"
shell.RegWrite strRegKey & "\SpeedDuplex", 3
strDone = "Yes"
End Select
end if
next
if strDone = "Yes" then
msgbox "Your network adapter has been set to 100 Mbps Half duplex."
else
msgbox "Unable to set network adapter speed."
end if
Re-reading your original post gives me a thought - your WMI Description
field appears to match the DriverDesc field. So, you could do something
like:
1. Get the WMI Description
2. Use a script like mine above to look for the WMI Description in
DriverDesc
3. Read the corresponding NetCfgInstanceId
4. Use another chunk of code like mine above to query the subkeys under
NetworkCards
5. Change the Description for the matching ServiceName
Hope you find this useful.
Regards,
Stace.