Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to achieve batch acquisition of bat code for IP to generate TXT text

2025-02-24 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/03 Report--

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!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report