复制代码
- 代码开始
- @echo off
- rem initial setting
- color a
- title RAS Dialer
- setlocal EnableDelayedExpansion
- mode con:cols=72 lines=22
- :initial
- echo Disconnecting exist connection...
- rasdial ras /disconnect
- echo Please Wait...Network interface is initialazing...
- netsh interface set interface lan disable
- echo Local Area Connection is restarting...
- netsh interface set interface lan enable
- echo Local Area Connection has ready for DIAL...
- echo Please follow the step below...
- :start
- color a
- echo ----------------------------------------------------------------------
- echo --------------------------Dialer For RAS------------------------------
- echo ----------------------------------------------------------------------
- echo Please choose method to Dial:
- echo 1. Automatic Dial
- echo 2. Manual Dial
- echo x. Exit Dialer
- choice /c 12x /n /m Select: /t 10 /d 1
- if %errorlevel%==1 cls & goto auto
- if %errorlevel%==2 cls & goto manual
- if %errorlevel%==3 goto eof
- rem set /p se=Select:
- remif %se%==1 cls & goto auto
- rem if %se%==2 cls & goto manual
- rem if %se%==3 goto eof
- rem goto start
- :manual
- color a
- set x=
- set y=
- set z=
- echo ----------------------------------------------------------------------
- echo --------------------------Dialer For RAS------------------------------
- echo ----------------------------------------------------------------------
- echo Please select your choice or enter your username and password...
- echo x. Exit Dialer
- echo m. Goto Main Menu
- echo Type "SPACE" at first character to instead "yhct2101"
- echo If PASSWORD is 8888 ...Just ignore them...
- set /p x=PPPoE Username:
- set z=%x%
- if "%x:~0,1%"=="x" goto eof
- if "%x:~0,1%"=="m" cls & goto start
- if "%x:~0,1%"==" " set z=yhct2101%x:~1,10%
- set /p y=PPPoE Password:
- if "%y:~0,1%"=="x" goto eof
- if "%y%"=="" set y=8888
- echo .............................................................
- echo Try with username "%z%" and password "%y%"
- echo .............................................................
- rasdial ras %z% %y% > nul
- set tt=%errorlevel%
- if !errorlevel!==0 (
- color d
- echo ______________________________________________________________________
- echo PPPoE session create successful !
- echo ______________________________________________________________________
- echo Press X to EXIT the Dialer...
- echo Press A to append username and password to Auto Dial Database...
- choice /c xam /n /m "Exit(X) or Append(A) or MainMenu(M):"
- if !errorlevel!==1 goto eof
- if !errorlevel!==2 goto append
- if !errorlevel!==3 cls & goto start
- )
- color c
- echo Error %tt% occur !
- echo press any key to continue manual dial...
- pause>nul
- color a
- goto manual
- :auto
- cls
- echo Autodialer is trying connect with the database data......
- for /F "skip=142 tokens=1,2" %%i in (%~dp0\D.bat) do (
- echo Trying with username %%i and password %%j
- rasdial ras %%i %%j>nul
- if !errorlevel!==691 echo Error 691...Trying with next...
- if !errorlevel!==0 (
- echo Success with username "%%i" and password "%%j" !
- goto success
- )
- if not !errorlevel!==691 set t1=!errorlevel! & goto err
- )
- echo All USERNAME and PASSWORD tried but faild to authenticate...
- echo Press any key back to main menu...
- pause>nul
- cls
- goto start
- :err
- color c
- echo -----------------------------------------------------------------------
- echo Error %t1% occur !!!
- echo Dialer will back to main menu...
- echo For more help:
- echo Type 'hh netcfg.chm'
- echo In help:
- echo 1st.click Troubleshooting
- echo 2nd.click Error Messages
- echo 3rd.click %errorlevel%
- echo -----------------------------------------------------------------------
- echo Press any key back to main menu...
- pause>nul
- cls
- goto start
- :append
- echo
- cls
- echo user:%z% and pass:%y% will be append to the database...
- echo %z% %y% >> %~f0
- echo Append Successful!
- pause > nul
- goto eof
- :success
- color d
- echo ______________________________________________________________________
- echo PPPoE connection has Eastablished with AUTO mode!!!
- echo ______________________________________________________________________
- echo Press any key to EXIT the Dialer...
- pause>nul
- goto eof
- :eof
- endlocal
- exit
- USERNAME PASSWORD
- 用户名 密码
- 第二个用户名 密码
- 。。。。。。
- 代码结束
欢迎光临 批处理之家 (http://www.bathome.net/) | Powered by Discuz! 7.2 |