Sign up for the ITPro Today newsletter
Stay on top of the IT universe with commentary, news analysis, how-to's, and tips delivered to your inbox daily.
October 28, 2001
Using netdiag from the Windows 2000 support tools, I have scripted NICSpeed.bat to answer the subject question.
NICSpeed has no arguments and returns two string environment variables:
NIC - is a text string that identifies the installed network adapter. Example: Intel 8255x-based PCI Ethernet Adapter (10/100)NICSpeed - is is a text string that identifies the Media Speed. Example: 100Mbps
NOTE: I have made no attempt to handle multi-homed computers.
You can use workstation.bat to run a batch file that calls NICSpeed on all your workstations.
NICSpeed.bat contains:
@echo offsetlocalset NIC=set NICSpeed=set fnd=nfor /f "Tokens=*" %%i in ('netdiag /v') do @set string=%%i&call :parseendlocal&set NIC=%NIC%&set NICSpeed=%NICSpeed%goto :EOF:parseif "%fnd%" EQU "y" goto nicinfoif NOT "%string:~0,31%" EQU "Information of Netcard drivers:" goto :EOFset fnd=ygoto :EOF:nicinfoif "%string:~0,12%" EQU "Description:" set NIC=%string:~13,99%if NOT "%string:~0,12%" EQU "Media Speed:" goto :EOFset work=%string:~13,99%set work=%work: =%set NICSpeed=%work%set fnd=n
You May Also Like