- UID
- 31191
注册时间2007-5-1
阅读权限20
最后登录1970-1-1
以武会友
TA的每日心情 | 开心 2024-6-9 16:20 |
---|
签到天数: 24 天 [LV.4]偶尔看看III
|
文章作者:blackhorse
@echo off&&mode con cols=30 lines=1
rem 设置窗体大小
title SBaidu v1.0 by blackhorse
rem 显示标题栏
echo 本批处理由Blackhorse制作,转载请留下此信息
rem 显示版权信息
if exist info.txt del info.txt
rem 判断info.txt存在则删除之
rasdial | find "已连接"
rem 查询宽带连接否
if errorlevel 1 goto close
rem 如果已连接就goto close
:close
for /f "tokens=3" %%i in ('reg query "HKLM\SOFTWARE\Microsoft\RAS AutoDial\Default"') do set pppoe=%%i
rem 读去注册表寻找宽带文件名
rasphone -h %pppoe%
rem 关闭宽带连接
if not errorlevel 1 goto set
rem 如果未连接就goto set
:set
set user=
set pass=
set url=
set time=
rem 设置变量 user pass url time
set/p user=请输入宽带帐号:
set/p pass=请输入宽带密码:
set/p url=请输入网站地址:
set/p time=请输入间隔时间:
rem 给user pass url time变量赋值
for /f "tokens=3" %%i in ('reg query "HKLM\SOFTWARE\Microsoft\RAS AutoDial\Default"') do set pppoe=%%i
echo %pppoe% %user% %pass% %url% %time% >info.txt
rem 生成文件info.txt,保存以上信息
:again
for /f "tokens=1,2,3 delims= " %%j in ('more info.txt') do rasdial %%j %%k %%l
rem 读取信息,宽带连接
echo 宽带连接成功!
for /f "tokens=4 delims= " %%j in ('more info.txt') do start /min http://%%j
rem 读取信息,打开网站
for /f "tokens=5 delims= " %%j in ('more info.txt') do ping -n %%j 127.1>nul
rem 等待%%j秒
taskkill /f /im iexplore.exe
rem 关闭ie
for /f "tokens=5 delims= " %%j in ('more info.txt') do ping -n %%j 127.1>nul
rem 等待%%j秒
for /f "tokens=1 delims= " %%j in ('more info.txt') do rasphone -h %%j
rem 关闭宽带
echo 宽带关闭成功!
goto again
rem 返回agin,循环开始 |
|