- @echo off&setlocal enabledelayedexpansion
- pushd %~dp0
-
- :start
- cls
- Rasdial /Disconnect
- Rasdial 宽带连接 xxxxx 123456
- for /f "tokens=1,2 delims=:" %%a in ('ipconfig /all ^|findstr /i /c:"IP Address"') do (
- if not exist ip.txt echo %%b>ip.txt&goto :eof
- for /f "tokens=1* delims=." %%c in (ip.txt) do set aa=%%c&set bb=%%d
- for /f "tokens=1* delims=." %%i in ("%%b") do (
- if "%%i"=="!aa!" (if "%%j"=="!bb!" (goto start
- ) else (echo %%b>ip.txt&goto :eof)
- ) else (goto start)
- )
- )
复制代码 不知道能不能行,试试吧。 |