RosettaCodeData/Task/DNS-query/Batch-File/dns-query-2.bat

12 lines
306 B
Batchfile
Raw Permalink Normal View History

2026-04-30 12:34:36 -04:00
@echo off
setlocal enableextensions enabledelayedexpansion
set catch=
for /f "skip=4 tokens=*" %%g in ('nslookup www.kame.net 2^>nul') do (
set "a=%%g"
if defined catch echo %%g
if "!a:~0,7!" equ "Address" (
for /f "tokens=2" %%h in ('echo %%g') do echo %%h
set catch=1
)
)