东拼西凑,也就这个结果了,那位有更好的?- @echo off
- echo 正在连接,请稍等...
- >Getip.vbs echo Set oDOM=WScript.GetObject("http://www.ip138.com/ip2city.asp"):Do Until oDOM.readyState="complete":WScript.sleep 200:Loop:WScript.echo oDOM.documentElement.outerText:Set oDOM=nothing
- for /f "tokens=2,* delims=:" %%i in ('"cscript //nologo Getip.vbs"') do echo %%i %%j>ip.txt
- del Getip.vbs
- @ECHO OFF&SETLOCAL ENABLEDELAYEDEXPANSION
- FOR /F "TOKENS=1,2 DELIMS=]" %%A IN (ip.txt) DO (SET W=%%A
- SET W=!W:]=!&SET W=!W:[=!
- ECHO !W!>ip.txt)
- for /f "delims=. tokens=1,2,3" %%i in (ip.txt) do echo %%i.%%j.%%k.1-%%i.%%j.%%k.254 >ip.txt
复制代码
|