- @echo off
- (for /f "delims=" %%a in (List.txt) do (
- for /f "tokens=1* delims=: " %%b in ('nslookup %%a 2^>nul') do (
- if defined flag (
- if /i "%%b"=="Addresses" (
- for %%d in (%%c) do echo,%%d#%%a
- ) else if /i "%%b"=="Address" echo,%%c#%%a
- set "flag="
- )
- if /i "%%b"=="Name" set flag=1
- )
- ))>Answer.txt
复制代码
|