Skip navigation

JSI Tip 4286. What NIC am I running and what speed does it support?


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 off
setlocal
set NIC=
set NICSpeed=
set fnd=n
for /f "Tokens=*" %%i in ('netdiag /v') do @set string=%%i&call :parse
endlocal&set NIC=%NIC%&set NICSpeed=%NICSpeed%
goto :EOF
:parse
if "%fnd%" EQU "y" goto nicinfo
if NOT "%string:~0,31%" EQU "Information of Netcard drivers:" goto :EOF
set fnd=y
goto :EOF
:nicinfo
if "%string:~0,12%" EQU "Description:" set NIC=%string:~13,99%
if NOT "%string:~0,12%" EQU "Media Speed:" goto :EOF
set work=%string:~13,99%
set work=%work: =%
set NICSpeed=%work%
set fnd=n


Hide comments

Comments

  • Allowed HTML tags: <em> <strong> <blockquote> <br> <p>

Plain text

  • No HTML tags allowed.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Lines and paragraphs break automatically.
Publish