中国DOS联盟论坛

中国DOS联盟

-- 联合DOS 推动DOS 发展DOS --
联盟域名:www.cn-dos.net 论坛域名:www.cn-dos.net/forum
游客 | 登录 | 注册 | 会员 | 搜索 | 中国DOS联盟
中国DOS联盟论坛
现在时间是 2026-08-02 00:20
48,037 主题排行 / 350,122 发帖 / 今日 2 篇 / 48,250 会员排行
DOS批处理 & 脚本技术(批处理室) » [原创].bat获取adsl动态ip
可打印版本  1,852 / 1
第1楼 vkill 发表于 2006-08-22 13:36
金牌会员 发帖 1,744 积分 4,103 来自 甘肃.临泽
[原创].bat获取adsl动态ip
献给需要的朋友 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楼 vkill 发表于 2006-08-23 21:46
金牌会员 发帖 1,744 积分 4,103 来自 甘肃.临泽
再测试下

[ Last edited by he200377 on 2006-8-27 at 20:44 ]
[ 联系联盟系统管理团队 - 中国DOS联盟 - 标准版 ]
Sponsored by ifanr Inc | © 2001–2023