Originally posted by willsort at 2005-10-28 10:53:
Re dosfroum:
:: GetCard.cmd - Get "Description" of net card that IP address is "192.168.*.*"
:: Will Sort - 2005-10-28 - CMD@WinXP
@echo off
setlocal EnableDelayedExpansion
for /f "delims=" %%s in ('ipconfig /all') do (
set line=%%s
echo.!line! | findstr "Description" >nul && set CardName=!line:~44!
echo.!CardName! | findstr /r "\<#[0-9]" >nul && set CardName=!CardName:~0,-3!
echo.!line! | findstr "192.168." >nul && goto EchoName
)
:EchoName
echo CardName="%CardName%" |
|