RosettaCodeData/Task/DNS-query/Batch-File/dns-query-3.bat
2026-04-30 12:34:36 -04:00

14 lines
286 B
Batchfile

@echo off
setlocal enableextensions enabledelayedexpansion
call :getdns -4
call :getdns -6
goto :eof
:getdns
for /f "tokens=*" %%g in ('ping %1 -n 1 www.kame.net') do (
set a=%%g
if "!a:~0,15!" equ "Ping statistics" (
echo !a:~20,-1!
goto :eof
)
)
goto :eof