strComputer="."
Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\CIMV2")
Set colItems = objWMIService.ExecQuery("SELECT * FROM Win32_NetworkAdapter")
For Each objItem In colItems
WScript.Echo "Speed: " & objItem.Speed
Next
But nothing is being returned.
Does anybody know why?
Is there another way to get this information?
Thanks!!!
Felipe
I don't think there is a 100% accurate way to get the NIC speed. Some vendors
store it in the registry diffrently than others. This script may or my not be
usefult to you, but it will report Auto vs Forced. It will work on most network
adapters, but not all. I don't know if I wrote it or downloaded it, but I think
it was written for Windows 2000 and I've never updated it for Windows XP/2003.
Watch out for line wraps.
'==========================='
On Error Resume Next
Const HKEY_LOCAL_MACHINE = &H80000002
strComputer = "."
Set objReg = GetObject("winmgmts:{impersonationLevel=impersonate}!\\" &
strComputer & "\root\default:StdRegProv")
strKeyPath =
"System\Currentcontrolset\Control\Class\{4D36E972-E325-11CE-BFC1-08002be10318}"
strDriverValue = "DriverDesc"
strModeValue1 = "DuplexMode"
strModeValue2 = "SpeedDuplex"
strModeValue3 = "RequestedMediaType"
objReg.EnumKey HKEY_LOCAL_MACHINE, strKeyPath, arrSubKeys
For Each subkey In arrSubKeys
objReg.GetStringvalue HKEY_LOCAL_MACHINE, strKeyPath & "\" & subkey,
strDriverValue, strValue
WScript.Echo subkey & ": " & strValue
objReg.GetStringvalue HKEY_LOCAL_MACHINE, strKeyPath & "\" & subkey,
strModeValue1, dwValue
If dwValue <> "" then
WScript.Echo " " & strModeValue1 & ": " & dwValue
'0 - Auto Detect
'1 - 10Mbps \ Half Duplex
'2 - 10Mbps \ Full Duplex
'3 - 100Mbps \ Half Duplex
'4 - 100Mbps \ Full Duplex
End If
objReg.GetStringvalue HKEY_LOCAL_MACHINE, strKeyPath & "\" & subkey,
strModeValue2, dwValue
If dwValue <> "" then
WScript.Echo " " & strModeValue2 & ": " & dwValue
End If
objReg.GetStringvalue HKEY_LOCAL_MACHINE, strKeyPath & "\" & subkey,
strModeValue3, dwValue
If dwValue <> "" then
WScript.Echo " " & strModeValue3 & ": " & dwValue
End If
Next
'==========================='
"Carlos Felipe França da Fonseca" <car...@felipe.com.br> wrote in message
news:elEzt7zX...@TK2MSFTNGP03.phx.gbl...