|
jackchen2010
新手上路

积分 5
发帖 5
注册 2011-1-5
状态 离线
|
『楼 主』:
怎么样用批处理命令来做一个指定的ip段拨号
使用 LLM 解释/回答一下
我提供个IP的C段,比如127.1.12.13 ,提供个C段数字 12
bat自动拨号后,只要拨到我所需要的C段(12),就自动停止,能做到同时识别2个不同的C段那更好了
I provide an IP's C segment, such as 127.1.12.13, and provide a C segment number 12. After the bat automatically dials, as long as it dials to the C segment (12) I need, it will automatically stop. It would be better if it can identify 2 different C segments at the same time.
|
|
2011-1-5 18:22 |
|
|
jackchen2010
新手上路

积分 5
发帖 5
注册 2011-1-5
状态 离线
|
『第 2 楼』:
使用 LLM 解释/回答一下
有高人在吗,帮忙看看,谢谢了
Is there any expert here? Please help take a look, thank you.
|
|
2011-1-5 22:36 |
|
|
jackchen2010
新手上路

积分 5
发帖 5
注册 2011-1-5
状态 离线
|
『第 3 楼』:
使用 LLM 解释/回答一下
自己顶下,高手们帮忙啊
Bump it up myself, experts, please help啊?Wait, no, the original Chinese "自己顶下,高手们帮忙啊" should be translated as "Bump it up myself, experts, please help" but wait, no, that's not right. Wait, let's do it properly. "自己顶下" is "Bump it up myself", "高手们帮忙啊" is "experts, please help". So the translation is "Bump it up myself, experts, please help" Wait, no, maybe more naturally: "Bumping it up myself, experts, please help." Yes, that's better.
|
|
2011-1-6 11:02 |
|
|
jackchen2010
新手上路

积分 5
发帖 5
注册 2011-1-5
状态 离线
|
|
2011-1-8 10:28 |
|
|
mountvol
初级用户
 
积分 186
发帖 117
注册 2006-8-14
状态 离线
|
『第 5 楼』:
使用 LLM 解释/回答一下
这个很简单啊。
先rasdial拨号,然后netsh或ipconfig来得到IP,最后findstr 是否存在".12.",当然,也可以用其他的方法判断.
如果符合要求,则...
否则,rasdial断开连接。
具体的命令可能会涉及到你的连接的具体信息,建议你google一下相关命令的用法.
This is very simple.
First, use rasdial to dial, then use netsh or ipconfig to get the IP, and finally use findstr to check if ".12." exists. Of course, other methods can also be used for judgment.
If it meets the requirements, then...
Otherwise, use rasdial to disconnect the connection.
The specific commands may involve the specific information of your connection. It is recommended to Google the usage of relevant commands.
|
|
2011-1-8 16:34 |
|
|
jackchen2010
新手上路

积分 5
发帖 5
注册 2011-1-5
状态 离线
|
『第 6 楼』:
使用 LLM 解释/回答一下
先谢谢楼上,有详细方法吗 ,谢谢了~~
Last edited by jackchen2010 on 2011-1-12 at 12:16 ]
First, thank you to the person above. Is there a detailed method? Thanks~~
Last edited by jackchen2010 on 2011-1-12 at 12:16 ]
|
|
2011-1-12 11:52 |
|
|
flybird2020
初级用户
 
积分 103
发帖 52
注册 2007-4-13
状态 离线
|
『第 7 楼』:
使用 LLM 解释/回答一下
@echo off&&setlocal enabledelayedexpansion
wget "http://www.ip138.com/ip2city.asp" -q -O tmp.txt
for /f "tokens=1-4 delims=" %%i in ('findstr "您的IP地址是:" tmp.txt') do (
set var=%%j
for /f "tokens=1-4 delims=." %%a in ("!var!") do (
set ipa=%%a
set ipb=%%b
set ipc=%%c
set ipd=%%d
echo !ipa! !ipb! !ipc! !ipd!
))
pause.
IP分段给你写好了,后面的判断,断线和拔号你自己加吧.
```code
@echo off&&setlocal enabledelayedexpansion
wget "http://www.ip138.com/ip2city.asp" -q -O tmp.txt
for /f "tokens=1-4 delims=" %%i in ('findstr "您的IP地址是:" tmp.txt') do (
set var=%%j
for /f "tokens=1-4 delims=." %%a in ("!var!") do (
set ipa=%%a
set ipb=%%b
set ipc=%%c
set ipd=%%d
echo !ipa! !ipb! !ipc! !ipd!
))
pause.
The IP segmentation is written for you, and you can add the subsequent judgments, disconnections, and dial-ups by yourself.
|
|
2011-1-12 15:47 |
|