中国DOS联盟

-- 联合DOS 推动DOS 发展DOS --

联盟域名:www.cn-dos.net 论坛域名:www.cn-dos.net/forum
DOS,代表着自由开放与发展,我们努力起来,学习FreeDOS和Linux的自由开放与GNU精神,共同创造和发展美好的自由与GNU GPL世界吧!

中国DOS联盟论坛
现在时间是 2026-08-01 23:18
中国DOS联盟论坛 » DOS批处理 & 脚本技术(批处理室) » [原创].bat获取adsl动态ip 查看 1,851 回复 1
楼 主 [原创].bat获取adsl动态ip 发表于 2006-08-22 13:36 ·  中国 甘肃 张掖 电信
金牌会员
★★★★
积分 4,103
发帖 1,744
注册 2006-01-20 13:00
20年会员
UID 49241
性别 男
来自 甘肃.临泽
状态 离线
献给需要的朋友 by:Ye - *

主要三个文件,都在%windir%目录下,ftp ip:192.168.0.1 name:admin password:pass

at.bat

@echo off
rem 开机10分钟后执行%windir%\up.bat ,xp下测试,时间24小时制
set h=%time:~0,2%
set /a m=%time:~3,2%+10
if %m% GEQ 60 (set /a m=m-60 & set /a h=h+01)
if %m% lss 10 (set /a m=m+10)
if %h% EQU 24 (set a=00)
set xtime=%h%%time:~2,1%%m%
at.exe %xtime% /interactive %windir%\up.bat



up.bat

@echo off
echo set dns=%%2 >ping.bat
ping.exe -n 1 163.com |find /i "ping" >temp.bat
ren %windir%\system32\ping.exe ping_.exe
call temp.bat
ren %windir%\system32\ping_.exe ping.exe
if %dns%==for (cd %windir%
echo %date% %time% >>ip.txt
ipconfig /all >>ip.txt
ftp -n -s:up.scr 192.168.0.1
) else (call at.bat)



up.scr

user admin
pass
put ip.txt
quit


[ Last edited by he200377 on 2006-8-27 at 20:48 ]
2 发表于 2006-08-23 21:46 ·  中国 甘肃 张掖 电信
金牌会员
★★★★
积分 4,103
发帖 1,744
注册 2006-01-20 13:00
20年会员
UID 49241
性别 男
来自 甘肃.临泽
状态 离线
再测试下

[ Last edited by he200377 on 2006-8-27 at 20:44 ]
论坛跳转: