2010年11月26日

[ cmd ] Simple Network Debug Tool 簡易網路除錯工具

話說這個 Simple Network Debug Tool 簡易網路除錯工具
已經躺在我電腦裡好幾年了,期間也修修改改不少

今日Google一下,最早的源頭應該是這篇 2005-05-12 的文章
WINDFLY Forum :: 觀看文章 - 網路除錯小工具
吃果子拜樹頭,感恩 <(_ _)>

目前已知適用的作業系統 Windows XP

NetDebug_cht.cmd (下載後請加上副檔名.bat)

簡易網路除錯工具 中文版 (下列cmd文字視覺上與執行上略有不同)
@echo off
set file=test.txt
echo > %file%

:Start
echo 按任意鍵繼續...
Pause>nul
echo.
echo.
echo.
echo              簡易網路除錯工具       !!!測試前請關閉電腦防火牆!!!
echo *******************************************************************************
echo   我的電腦  ---  Hub  ---  區域網路路由器  ---  中華電信路由器  ---  Internet
echo      │           │             │                                     │
echo      IP        其他電腦         LAN                                 168.95.1.1
echo      │           │             │                                     │
echo  測試 1/2/7    測試 3/7       測試 4/7                              測試 5/6/7
echo.
echo  測試:
echo         0.顯示網路卡組態設定 : 檢查電腦IP位址是否正確
echo         1.自我測試           : 檢查電腦的網路卡驅動是否正常 (127.0.0.1)
echo         2.自我測試           : 檢查電腦的網路卡IP位址
echo         3.測試其他電腦       : 檢查電腦與其他電腦的連線
echo         4.測試閘道器         : 檢查電腦與機房路由器的連線
echo         5.測試網際網路連線   : 檢查電腦與中華電信DNS的連線 (168.95.1.1)
echo         6.測試DNS名稱解析    : 檢查Google網域名稱的解析是否正常
echo         7.追蹤路由連線       : 檢查電腦與中華電信DNS哪裡斷線
echo         8.將所有測試結果存檔 : 將所有測試結果另存新檔為 %file%
echo         9.離開
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%'=='7' GOTO s7
IF /I '%select%'=='8' GOTO s8
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
netsh -c diag ping iphost www.google.com
goto Start

:s7
tracert 8.8.8.8
goto Start

:s8
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%
netsh -c diag ping iphost www.google.com >> %file%
tracert 168.95.1.1 >> %file%
echo ok...
goto Start

:bStart
echo 請輸入其他電腦的IP位址...
goto Start

:end


NetDebug_en.cmd (下載後請加上副檔名.bat)

Simple Network Debug Tool 英文版 (下列cmd文字視覺上與執行上略有不同)
感謝友人 William 的翻譯( ̄▽ ̄)y @echo off
set file=test.txt
echo > %file%

:Start
echo Press any key to continue...
Pause>nul
echo.
echo.
echo.
echo  Simple Network Debug Tool  !!!Please turn off the firewall before the test!!!
echo *******************************************************************************
echo  The Computer --- Hub --- Local Area Router --- Hinet Router --- Internet
echo       │           │             │                                │
echo       IP        Neighbor         LAN                            168.95.1.1
echo       │           │             │                                │
echo   Test 1/2/7    Test 3/7       Test 4/7                         Test 5/6/7
echo.
echo   Test:                         
echo         0.Show Config   : Check the IP address's correctness.
echo         1.Self Test     : Check the network card's driver is normally.
echo         2.Self Test     : Check the network card's IP address.
echo         3.Neighbor Test : Check the connection with others.
echo         4.Gateway Test  : Check the connection with gateway.
echo         5.Internet Test : Check the connection with Internet. (168.95.1.1)
echo         6.DNS Test      : Check the resolve with the domain name "Google".
echo         7.Tracert Test  : Check your connection that where's it broken.
echo         8.Save All Test : Save as %file%
echo         9.Quit
echo *******************************************************************************
echo.
SET select=
SET /P select=        Please 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%'=='7' GOTO s7
IF /I '%select%'=='8' GOTO s8
IF /I '%select%'=='9' GOTO end
echo "%select%"        !! Select invalid, please 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=        Enter Neighbor's IP address:
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
netsh -c diag ping iphost www.google.com
goto Start

:s7
tracert 168.95.1.1
goto Start

:s8
echo Please wait...
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%
netsh -c diag ping iphost www.google.com >> %file%
tracert 168.95.1.1 >> %file%
echo ok...
goto Start

:bStart
echo Enter Neighbor's IP address...
goto Start

:end

沒有留言:

張貼留言