Board logo

标题: [网络连接] [分享]批处理版adsl自动连接(送给adsl总掉线的朋友) [打印本页]

作者: batman    时间: 2009-11-9 00:15     标题: [分享]批处理版adsl自动连接(送给adsl总掉线的朋友)

本程序是自身隐藏运行的,你可以加入系统启动项,也可以放在桌面上点击,使用前请将代码中的连接名、adsl帐号、密码改为自己实际的值,代码如下:
  1. @echo off
  2. if "%1" == "h" goto begin
  3. mshta vbscript:createobject("wscript.shell").run("%~nx0 h",0)(window.close)&&exit
  4. :begin
  5. if not defined flag rasdial 连接名 adsl帐号 密码&set "flag=a"
  6. for /f "tokens=7 delims== " %%a in ('ping www.baidu.com^|findstr /i lost') do set "str=%%a"
  7. if %str% geq 2 (
  8.    rasdial /disconnect>nul
  9.    rasdial 连接名 adsl帐号 密码
  10. )
  11. goto begin
复制代码

作者: wjx79my    时间: 2011-8-3 13:34

学习中。谢谢老大的分享




欢迎光临 批处理之家 (http://bathome.net./) Powered by Discuz! 7.2