求一个生成IP的bat或者vbs

2025-02-24 11:27:50
推荐回答(1个)
回答1:

@echo off&setlocal enabledelayedexpansion
cd .> 2.txt
for /f "tokens=1,2" %%a in (1.txt) do (
for /f "tokens=1-4 delims=." %%c in ("%%a") do (
set a1=%%c
set b1=%%d
set c1=%%e
set d1=%%f
)
for /f "tokens=1-4 delims=." %%c in ("%%b") do (
set a2=%%c
set b2=%%d
set c2=%%e
set d2=%%f
)
(for /l %%c in (!a1!,1,!a2!) do (
for /l %%d in (!b1!,1,!b2!) do (
for /l %%e in (!c1!,1,!c2!) do (
for /l %%f in (!d1!,1,!d2!) do echo %%c.%%d.%%e.%%f
)
)
))>> 2.txt
)