將以下存成 *.bat 檔
@echo off
set file=TEST.TXT
echo > %file%
:Start
echo 按任意鍵繼續
Pause>nul
echo.
echo xx寬頻社區網路 簡易網路除錯工具 !!!測試前請關閉防火牆!!!
echo ****************************************************************************
echo [我的電腦] --- HUB --- [xx社區路由器 ] --- 中華電信路由器 ---INTERNET
echo │ │ │ │
echo I P 鄰居 LAN 168.95.1.1
echo │ │ │ │
echo 測試點1/2 測試點3 測試點4 測試點5
echo.
echo.
echo 測試點:
echo 0. 測試網路卡組態 : 查看是否拿到正確的IP位址
echo 1. 自我測試 : 測試我的網路卡驅動是否正常 127.0.0.1.
echo 2. 自我測試 : 測試我的網路卡 IP 位址.
echo 3. 對網路上的鄰居做測試 : 測試我的電腦與隔壁的電腦連線是否正常.
echo 4. 對閘道器做測試 : 測試我的電腦與機房的路由器連線是否正常.
echo 5. 對網際網路連線做測試 : 測試能否與 Internet 上的電腦溝通.
echo 6. 將以上測試結果存檔 : 將存檔為 %file%
echo.
echo 9. 離開
echo ****************************************************************************
echo.
echo.
echo.
SET select=
SET /P select= 請選擇:
IF NOT '%select%'=='' SET Choice=%select:~0,1%
echo.
IF /I '%select%'=='0' GOTO s0
IF /I '%select%'=='1' GOTO s1
IF /I '%select%'=='2' GOTO s2
IF /I '%select%'=='3' GOTO s3
IF /I '%select%'=='4' GOTO s4
IF /I '%select%'=='5' GOTO s5
IF /I '%select%'=='6' GOTO s6
IF /I '%select%'=='9' GOTO end
echo "%select%" !! 選擇無效,請選擇:
echo.
GOTO Start
:s0
netsh -c interface ip show config
goto Start
:s1
netsh -c diag ping loopback
goto Start
:s2
netsh -c diag ping ip
goto Start
:s3
SET NIP=
SET /P NIP= 請輸入鄰居IP:
if "%NIP%"=="" goto bStart
netsh -c diag ping iphost %NIP%
goto Start
:s4
netsh -c diag ping gateway
goto Start
:s5
netsh -c diag ping iphost 168.95.1.1
goto Start
:s6
echo 請稍候...
netsh -c interface ip show config >> %file%
netsh -c diag ping loopback >> %file%
netsh -c diag ping ip >> %file%
netsh -c diag ping gateway >> %file%
netsh -c diag ping iphost 168.95.1.1 >> %file%
echo ok...
goto Start
:bStart
echo 請輸入鄰居的IP...
goto Start
:end
沒有留言:
張貼留言