@ECHO Off
SETLOCAL
set "dnsserverlines="
(
FOR /f "tokens=1*delims=:" %%b IN ('ipconfig /all') DO (
FOR /f "tokens=1,2" %%t IN ("%%b") DO (
IF DEFINED dnsserverlines IF "%%c" neq "" GOTO :EOF
IF DEFINED dnsserverlines IF "%%t" neq "0.0.0.0" ECHO %%t
If /i "%%t%%u"=="DNSServers" ECHO %%c&set "dnsserverlines=Y"
)
)
)> out.txt
GOTO :EOF
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…