中国DOS联盟论坛

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-08-12 08:45
47,811 topics / 349,897 posts / today 0 new / 48,256 members
DOS批处理 & 脚本技术(批处理室) » How to tell whether the IP address changed after using an automatic disconnect/redial batch script?
Printable Version  1,184 / 4
Floor1 hhxy3389 Posted 2010-09-10 15:18
新手上路 Posts 3 Credits 3
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?
Floor2 hhxy3389 Posted 2010-09-10 15:19
新手上路 Posts 3 Credits 3
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.
Floor3 hhxy3389 Posted 2010-09-28 01:54
新手上路 Posts 3 Credits 3
Bump, nobody?
Floor4 voiL Posted 2010-10-04 10:59
中级用户 Posts 189 Credits 384
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. ^_^
Floor5 lmlz41 Posted 2010-10-29 14:08
初级用户 Posts 16 Credits 21
Waiting for a reply! An expert, please explain!
[ Contact the Union admin team - 中国DOS联盟 - Standard version ]
Sponsored by ifanr Inc | © 2001–2023