测试多个网关网络工具

哈,标题党来了。
说说这个东西,因为工作需要要不停的换IP地址这样的操作,而且去的都是些网络管理有点严格的客户那里,每次配完IP都要测试一下网络,每次都是win键——》cmd——》ping网关(win7好啊,减少了一个输入R键),真是麻烦,于是出现了这个批处理,选择性的输入网关地址,自动ping测试,很简单的东东,没啥太多的技术含量,修修改改出来的,不多说,上代码。

@ECHO OFF
CLS
color 1f

:menu
cls
echo.
echo               网络测试V1.0
echo              by cnkiller
echo              ====================
echo.
echo               0、测试TCP/IP协议
echo.
echo               1、192.168.0.1
echo.
echo               2、192.168.1.1
echo.
echo               3、172.16.31.1
echo.
echo               4、10.10.10.1
echo.
echo               5、192.168.
echo.
echo               6、172.16.
echo.
echo               7、10.
echo.

:cl
echo.
set /p choice=              请选择要进行的操作,然后按回车:
IF NOT "%choice%"=="" SET choice=%choice:~0,1%
if /i "%choice%"=="0" goto s0
if /i "%choice%"=="1" goto s1
if /i "%choice%"=="2" goto s2
if /i "%choice%"=="3" goto s3
if /i "%choice%"=="4" goto s4
if /i "%choice%"=="5" goto s5
if /i "%choice%"=="6" goto s6
if /i "%choice%"=="7" goto s7

echo.
echo              选择无效,请重新输入
echo.
goto cl

:s0
ping 127.1
pause
goto menu

:s1
ping 192.168.0.1
goto menu

:s2
ping 192.168.1.1
goto menu

:s3
ping 172.16.31.1
goto menu

:s4
ping 10.10.10.1
goto menu

:s5
set /p ip=192.168.
ping 192.168.%ip%
goto menu

:s6
set /p ip=172.16.
ping 172.16.%ip%
goto menu

:s7
set /p ip=10.
ping 10.%ip%
goto menu

 保存为bat使用。



Related Posts



No Response

Leave a Reply