@echo off工具
cd \測試
color 0A.net
title PING TEST
dir c:\ | find "測試數據"
if %errorlevel%==0 goto main REM--若是有就跳到:ok
if %errorlevel%==1 goto end REM--若是沒就跳到:end
:end
md c:\測試數據
:mainip
mode con: cols=80 lines=30get
cls產品
echo --------------------------------------------------------------------------------it
echo 說 明
echo.
echo PING包測試工具
echo.
echo 訊風通訊 產品部 V1.1版class
echo --------------------------------------------------------------------------------
echo 1.本機查看
echo 2.本機設置
echo 3.遠端設置
echo 4.查看測試結果
echo 5.退出date
set /p ch= 請選擇[1,2,3,4,5];im
if %ch%==1 goto ping1
if %ch%==2 goto ping2
if %ch%==3 goto ping3
if %ch%==4 goto ping4
if %ch%==5 exit
:ping1
ipconfig /all
echo 按任意反回主界面... && pause>nul
goto main
:ping2
set /p staticaddr=請輸入本機ip地址:
set /p gateway=請輸入網關:
::【批處理設置靜態IP】********** 複製如下內容保存爲bat
netsh interface ip set address name="本地鏈接" source = static addr =%staticaddr% mask=255.255.255.0
netsh interface ip set address name="本地鏈接" gateway =%gateway% gwmetric =0
echo 按任意反回主界面... && pause > nul
goto main
:ping3
set /p ipadress=請輸入ip地址:
set /p L=請輸入數據包長度:
set /p N=請輸入PING包個數:
set "T=%time:~0,-3%"
set "D=%date:~0,-3%"
echo start time: %date% %time% >>測試時間"%D%%T::=-%".txt
ping %ipadress% -l %L% -n %N%
ping %ipadress% -l %L% -n %N% >>測試時間"%D%%T::=-%".txt
echo end time: %date% %time% >>測試時間"%D%%T::=-%".txt
set path=%path%;c:\
@Echo off
move 測試時間"%D%%T::=-%".txt c:\測試數據
echo 按任意反回主界面... && pause > nul
goto main
:pingX
echo start time: %date% %time% >>測試時間"%D%%T::=-%".txt
ping 192.168.0.33 >>測試時間"%D%%T::=-%".txt
echo end time: %date% %time% >>測試時間"%D%%T::=-%".txt
echo 按任意反回主界面... && pause > nul
goto main
:ping4
start c:\測試數據\測試時間"%D%%T::=-%".txt
echo 按任意反回主界面... && pause > nul
goto main