How to achieve batch acquisition of bat code for IP to generate TXT text
This article mainly introduces how to achieve batch processing to obtain IP to generate TXT text bat code, the article introduces in great detail, has a certain reference value, interested friends must read it!
The first method:
The code is as follows:
@ echo off
Tmp.vbs
Cscript / / NoLogo / e:vbscript tmp.vbs 1 > ip.txt
Echo > nul & & del tmp.vbs
Goto:eof
Set oDOM = WScript.GetObject ("http://www.duosc.com/ip.aspx")
Do until oDOM.readyState = "complete"
WScript.sleep 200
Loop
S=oDOM.documentElement.innerText
Set re = New RegExp
Re.Pattern= "(\ d +)\. (\ d +)"
For Each m in re.Execute (s)
WScript.Echo m
Next
The second method is to use vbs code.
The code is as follows:
@ echo off
Echo is connecting, please wait a moment.
> 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 your IP address is:% I% j > ip.txt
Del Getip.vbs
The above is all the content of the article "how to batch obtain the bat code of TXT text generated by IP". Thank you for reading! Hope to share the content to help you, more related knowledge, welcome to follow the industry information channel!