修复:完善了日志报告。
输入结果:
运行过程:
输出结果:
源码如下:
@echo off&setlocal enabledelayedexpansion
title 域名IP段批量生成器
if exist ips.txt del ips.txt
if not exist url.txt set /p=<nul>url.txt
echo 请输入域名:
notepad url.txt
set a=IP段批量生成中......
echo.
for /l %%a in (0,1,15) do ping 111.1 -n 1 -w 1 >nul&set /p=!a:~%%a,1!<nul
for /f %%a in (url.txt) do for /f %%a in ('ping %%a -n 1 -w 1') do for /f %%a in ('echo %%a^|find "."') do set b=%%a&for /l %%a in (0,1,7) do set /a c+=1&if "!b:~%%a,1!"=="." set /a d+=1&if !d! equ 2 for /f %%a in ("!c!") do echo !b:~0,%%a!0.0 !b!>>ips.txt&set /a c-=8&set d=0
if exist ips.txt (echo.&echo.&echo IP段生成完毕!¬epad ips.txt) else (echo.&echo.&set /p =无效域名!)