本帖最后由 pcl_test 于 2015-9-13 23:39 编辑
- @echo off
- :0
- cls
- echo;1.设置光猫 2.测试网速
- echo;
- set c=
- set /p c=输入序号并按回车键:
- if "%c%" equ "1" (goto :设置光猫) else if "%c%" equ "2" (goto :测试网速) else goto :0
-
- :设置光猫
- set ip=192.168.18.18
- set mask=255.255.255.0
- set gateway=192.168.18.1
- ver|find "5.2" >nul&&(
- netsh interface ip set address name="本地连接" source=static addr=%ip% mask=%mask% gateway=%gateway%
- )||(
- netsh interface ipv4 set address name="本地连接" source=static address=%ip% mask=%mask% gateway=%gateway%
- )
- echo;设置静态IP完成
- ping -n 5 0 >nul&start "" "http://192.168.18.3"
- goto :0
-
- :测试网速
- ver|find "5.2" >nul&&(
- netsh interface ip set address name="本地连接" source=static addr=0.0.0.0 mask=0.0.0.0 gateway=0.0.0.0 >nul
- netsh interface ip set address name="本地连接" source=dhcp
- netsh interface ip set dns name="本地连接" source=dhcp
- )||(
- netsh interface ipv4 set address name="本地连接" source=static address=0.0.0.0 mask=0.0.0.0 gateway=0.0.0.0 >nul
- netsh interface ipv4 set address name="本地连接" source=dhcp
- netsh interface ipv4 set dnsservers name="本地连接" source=dhcp
- )
- echo;设置动态IP完成
- ping -n 5 0 >nul&start "" "http://adsl.online.com.cn"
- goto :0
复制代码
|