2个回答
展开全部
@echo off
>tmp.vbs echo Dim Mx, cAS
>>tmp.vbs echo Set Mx = CreateObject("MsXml2.XmlHttp")
>>tmp.vbs echo Mx.open "get", "百度不给放网址自己放啊", False:Mx.send()
>>tmp.vbs echo Do Until Mx.readyState = 4 : WScript.Sleep 200 :Loop:WScript.Sleep 1000
>>tmp.vbs echo Set cAS = CreateObject("Adodb.Stream")
>>tmp.vbs echo cAS.Type = 1:cAS.Mode = 3:cAS.Open():cAS.Write Mx.responseBody:cAS.SaveToFile "tmp.txt", 2:Mx.abort:Set Mx = Nothing:cAS.Close
tmp.vbs
for /f "tokens=2 delims=[]" %%i in (tmp.txt) do >1.txt echo %%i
del tmp.*
start "" 1.txt
>tmp.vbs echo Dim Mx, cAS
>>tmp.vbs echo Set Mx = CreateObject("MsXml2.XmlHttp")
>>tmp.vbs echo Mx.open "get", "百度不给放网址自己放啊", False:Mx.send()
>>tmp.vbs echo Do Until Mx.readyState = 4 : WScript.Sleep 200 :Loop:WScript.Sleep 1000
>>tmp.vbs echo Set cAS = CreateObject("Adodb.Stream")
>>tmp.vbs echo cAS.Type = 1:cAS.Mode = 3:cAS.Open():cAS.Write Mx.responseBody:cAS.SaveToFile "tmp.txt", 2:Mx.abort:Set Mx = Nothing:cAS.Close
tmp.vbs
for /f "tokens=2 delims=[]" %%i in (tmp.txt) do >1.txt echo %%i
del tmp.*
start "" 1.txt
追问
怎么后台运行呢 就是隐藏CMD黑屏窗口
追答
你的目的达到,问题就结了
既然你说要批处理,我把vbs代码转成批处理,现在又要把批处理转换成vbs?
呵~~ 一箭双雕,悬赏分你自己看着给吧
Dim Mx, cAS
Set Mx = CreateObject("MsXml2.XmlHttp")
Mx.open "get", "百度不给放网址自己放啊", False:Mx.send()
Do Until Mx.readyState = 4 : WScript.Sleep 200 :Loop:WScript.Sleep 1000
Set cAS = CreateObject("Adodb.Stream")
cAS.Type = 1:cAS.Mode = 3:cAS.Open():cAS.Write Mx.responseBody:cAS.SaveToFile "tmp.txt", 2:Mx.abort:Set Mx = Nothing:cAS.Close
Set Fso = CreateObject("scripting.filesystemobject")
arr=Fso.OpenTextFile("tmp.txt").ReadAll()
num=InStr(arr, "您的IP是:[")
str=mid(arr,num+7)
ips=Split(str,"]")
For Each ip In ips
IP=IP:i=i+1:If i=1 Then Exit for
Next
Set cf = Fso.CreateTextFile("tmp.txt", True)
cf.WriteLine(IP)
cf.Close
CreateObject("Wscript.Shell").Run "tmp.txt"
本回答被提问者采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
@echo off
echo 正在连接,请稍等...
>Getip.vbs echo Set oDOM=WScript.GetObject("http://iframe.ip138.com/city.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>ip.txt
del Getip.vbs
echo 正在连接,请稍等...
>Getip.vbs echo Set oDOM=WScript.GetObject("http://iframe.ip138.com/city.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>ip.txt
del Getip.vbs
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询
广告 您可能关注的内容 |