China DOS Union

-- Unite DOS · Advance DOS · Grow DOS --

Union site: www.cn-dos.net Forum site: www.cn-dos.net/forum
DOS stands for freedom, openness and progress. Let us work hard, learn from the openness and GNU spirit of FreeDOS and Linux, and together build and grow a free GNU GPL world!

中国DOS联盟论坛
The time now is 2026-08-12 07:54
中国DOS联盟论坛 » DOS批处理 & 脚本技术(批处理室) » How to tell whether the IP address changed after using an automatic disconnect/redial batch script? View 1,182 Replies 4
Original Poster Posted 2010-09-10 15:18 ·  中国 河南 郑州 电信
新手上路
Credits 3
Posts 3
Joined 2010-07-31 07:14
16-year member
UID 171517
Gender Male
Status Offline
I use
@echo off
cls
rasphone -h 上网
rasdial 上网 /disconnect

to disconnect from the network,
then use

CreateObject("WScript.Shell").run"Rasdial
this VPS to reconnect automatically.

I combined these two into one batch script that automatically disconnects and reconnects.


My goal is:

during each automatic disconnect-reconnect cycle, I want the IP address to change. If it does not change, then automatically run this script again.

Right now I use ipcomfig each time to check and look at the IP address,
but it really feels too troublesome.

If it could automatically verify it, and if the IP address is the same, automatically run this script again, that would be great.


Hope an expert can help?
Floor 2 Posted 2010-09-10 15:19 ·  中国 河南 郑州 电信
新手上路
Credits 3
Posts 3
Joined 2010-07-31 07:14
16-year member
UID 171517
Gender Male
Status Offline
I forgot to mention that I use ASDL dial-up Internet access. Sometimes the network is very laggy, and changing the IP and dialing again fixes it.

But I want to use a script, it feels faster and also very convenient.
Floor 3 Posted 2010-09-28 01:54 ·  中国 河南 郑州 电信
新手上路
Credits 3
Posts 3
Joined 2010-07-31 07:14
16-year member
UID 171517
Gender Male
Status Offline
Bump, nobody?
Floor 4 Posted 2010-10-04 10:59 ·  中国 广东 清远 联通
中级用户
★★
Credits 384
Posts 189
Joined 2005-10-19 13:12
20-year member
UID 43709
Gender Male
Status Offline
Search the forum. There used to be a lot of stuff about how to get the IP address. Just compare the old and new ones and make a judgment.

But I don't really know the specifics either, I'm a newbie too. ^_^
Floor 5 Posted 2010-10-29 14:08 ·  中国 山东 潍坊 电信
初级用户
Credits 21
Posts 16
Joined 2010-10-24 18:42
15-year member
UID 176462
Gender Male
Status Offline
Waiting for a reply! An expert, please explain!
Forum Jump: