Command only listing active NIC?
Posted: 10 Apr 2019 11:34
Hi,
I'm trying to put to gather a script that search for a specific Network Adapter Name. But what ever i do only my Wireless card is the only adapter name i can get going.
I'm i using "find" incorrect?

-Evan
I'm trying to put to gather a script that search for a specific Network Adapter Name. But what ever i do only my Wireless card is the only adapter name i can get going.
I'm i using "find" incorrect?
Code: Select all
@echo off
for /f "skip=3 tokens=1,2,3* delims= " %%a in ('netsh interface show interface ^|find /v "Ethernet"') do Set AdapterName=%%d
if %AdapterName%=="Ethernet" (GOTO BEGIN) Else (GOTO SELECT_NIC)
:%%a = Status
:%%b = Connection status
:%%c = Type?
:%%d = Interface name
:BEGIN
echo You made it
:SELECT_NIC
echo **ERROR**
echo Could not find adapter name
echo.
echo %AdapterName%
pause

-Evan