Code: Select all
::@echo off
setlocal
Call :wmic nicconfig where "IPConnectionMetric!=''" get ipaddress,macaddress,defaultipgateway,caption /format:list
exit /b
:wmic
for /f "delims=" %%A in ('"wmic %*"') do for /f "delims=" %%B in ("%%A") do echo %%B
exit /b
And
Code: Select all
::@echo off
setlocal
Call :wmic nicconfig where "IPConnectionMetric>0" get ipaddress,macaddress,defaultipgateway,caption /format:list
exit /b
:wmic
for /f "delims=" %%A in ('"wmic %*"') do for /f "delims=" %%B in ("%%A") do echo %%B
exit /b
But neither work and I'm not sure why. Any clues? I'm hoping it's something simple.