![]() |
China DOS Union-- Unite DOS · Advance DOS · Grow DOS --Union site: www.cn-dos.net Forum site: www.cn-dos.net/forum |
| Guest | Log in | Register | Members | Search | China DOS Union |
|
中国DOS联盟论坛 The time now is 2026-09-23 16:24 |
47,812 topics / 349,917 posts / today 0 new / 48,273 members |
| DOS批处理 & 脚本技术(批处理室) » How to use batch commands to make a dial-up for a specified IP segment |
| Printable Version 2,019 / 6 |
| Floor1 jackchen2010 | Posted 2011-01-05 18:22 |
| 新手上路 Posts 5 Credits 5 | |
|
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.
|
|
| Floor2 jackchen2010 | Posted 2011-01-05 22:36 |
| 新手上路 Posts 5 Credits 5 | |
|
Is there any expert here? Please help take a look, thank you.
|
|
| Floor3 jackchen2010 | Posted 2011-01-06 11:02 |
| 新手上路 Posts 5 Credits 5 | |
|
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.
|
|
| Floor4 jackchen2010 | Posted 2011-01-08 10:28 |
| 新手上路 Posts 5 Credits 5 | |
| Floor5 mountvol | Posted 2011-01-08 16:34 |
| 初级用户 Posts 117 Credits 186 | |
|
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. |
|
| Floor6 jackchen2010 | Posted 2011-01-12 11:52 |
| 新手上路 Posts 5 Credits 5 | |
|
First, thank you to the person above. Is there a detailed method? Thanks~~
[ Last edited by jackchen2010 on 2011-1-12 at 12:16 ] |
|
| Floor7 flybird2020 | Posted 2011-01-12 15:47 |
| 初级用户 Posts 52 Credits 103 | |
|
```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. |
|
|
[ Contact the Union admin team -
中国DOS联盟 -
Standard version ] Sponsored by ifanr Inc | © 2001–2023 |