系統:windows 需求:測試多台PC輸出三個網站並行ping、tracert結果,多台PC同時進行。 說明:以www.baidu.com、www.sina.com.cn、www.tencent.com為例。 創建ping-tracer、www.baidu.com、www.sina.com.cn、 ...
系統:windows
需求:測試多台PC輸出三個網站並行ping、tracert結果,多台PC同時進行。
說明:以www.baidu.com、www.sina.com.cn、www.tencent.com為例。
創建ping-tracer、www.baidu.com、www.sina.com.cn、www.tencent.com文件夾 ,輸出結果.txt到每個文件夾
ping -n 100 -l 32 host
ping -n 100次每次發送32個位元組 功能變數名稱
tracert -h 100 host
tracert -h 最大次數為100次 功能變數名稱
本次的bat是不顯示狀態的,直接輸出文本結果。
直接創建格式.txt命令後序格式.bat。
直接打開.bat運行即可。
1.md.bat
@echo off cd C:/Users/%computername%/Desktop/ md ping-tracert cd ping-tracert md www.baidu.com cd www.baidu.com md ping md tracert cd C:/Users/%computername%/Desktop/ cd ping-tracert md www.sina.com.cn cd www.sina.com.cn md ping md tracert cd C:/Users/%computername%/Desktop/ cd ping-tracert md www.tencent.com cd www.tencent.com md ping md tracert exit /b
2.www.baidu.com-ping.bat
@echo off cd C:/Users/%computername%/Desktop/ cd ping-tracert cd www.baidu.com cd ping echo Ping01 >> www.baidu.com-ping-01.txt && date/t >> www.baidu.com-ping-01.txt && time/t >> www.baidu.com-ping-01.txt && ping -n 100 -l 32 www.baidu.com >> www.baidu.com-ping-01.txt echo Ping02 >> www.baidu.com-ping-02.txt && date/t >> www.baidu.com-ping-02.txt && time/t >> www.baidu.com-ping-02.txt && ping -n 100 -l 32 www.baidu.com >> www.baidu.com-ping-02.txt echo Ping03 >> www.baidu.com-ping-03.txt && date/t >> www.baidu.com-ping-03.txt && time/t >> www.baidu.com-ping-03.txt && ping -n 100 -l 32 www.baidu.com >> www.baidu.com-ping-03.txt echo Ping04 >> www.baidu.com-ping-04.txt && date/t >> www.baidu.com-ping-04.txt && time/t >> www.baidu.com-ping-04.txt && ping -n 100 -l 32 www.baidu.com >> www.baidu.com-ping-04.txt echo Ping05 >> www.baidu.com-ping-05.txt && date/t >> www.baidu.com-ping-05.txt && time/t >> www.baidu.com-ping-05.txt && ping -n 100 -l 32 www.baidu.com >> www.baidu.com-ping-05.txt echo Ping06 >> www.baidu.com-ping-06.txt && date/t >> www.baidu.com-ping-06.txt && time/t >> www.baidu.com-ping-06.txt && ping -n 100 -l 32 www.baidu.com >> www.baidu.com-ping-06.txt echo Ping07 >> www.baidu.com-ping-07.txt && date/t >> www.baidu.com-ping-07.txt && time/t >> www.baidu.com-ping-07.txt && ping -n 100 -l 32 www.baidu.com >> www.baidu.com-ping-07.txt echo Ping08 >> www.baidu.com-ping-08.txt && date/t >> www.baidu.com-ping-08.txt && time/t >> www.baidu.com-ping-08.txt && ping -n 100 -l 32 www.baidu.com >> www.baidu.com-ping-08.txt echo Ping09 >> www.baidu.com-ping-09.txt && date/t >> www.baidu.com-ping-09.txt && time/t >> www.baidu.com-ping-09.txt && ping -n 100 -l 32 www.baidu.com >> www.baidu.com-ping-09.txt echo Ping10 >> www.baidu.com-ping-10.txt && date/t >> www.baidu.com-ping-10.txt && time/t >> www.baidu.com-ping-10.txt && ping -n 100 -l 32 www.baidu.com >> www.baidu.com-ping-10.txt exit /b
3.www.sina.com.cn-ping.bat
@echo off cd C:/Users/%computername%/Desktop/ cd ping-tracert cd www.sina.com.cn cd ping echo Ping01 >> www.sina.com.cn-ping-01.txt && date/t >> www.sina.com.cn-ping-01.txt && time/t >> www.sina.com.cn-ping-01.txt && ping -n 100 -l 32 www.sina.com.cn >> www.sina.com.cn-ping-01.txt echo Ping02 >> www.sina.com.cn-ping-02.txt && date/t >> www.sina.com.cn-ping-02.txt && time/t >> www.sina.com.cn-ping-02.txt && ping -n 100 -l 32 www.sina.com.cn >> www.sina.com.cn-ping-02.txt echo Ping03 >> www.sina.com.cn-ping-03.txt && date/t >> www.sina.com.cn-ping-03.txt && time/t >> www.sina.com.cn-ping-03.txt && ping -n 100 -l 32 www.sina.com.cn >> www.sina.com.cn-ping-03.txt echo Ping04 >> www.sina.com.cn-ping-04.txt && date/t >> www.sina.com.cn-ping-04.txt && time/t >> www.sina.com.cn-ping-04.txt && ping -n 100 -l 32 www.sina.com.cn >> www.sina.com.cn-ping-04.txt echo Ping05 >> www.sina.com.cn-ping-05.txt && date/t >> www.sina.com.cn-ping-05.txt && time/t >> www.sina.com.cn-ping-05.txt && ping -n 100 -l 32 www.sina.com.cn >> www.sina.com.cn-ping-05.txt echo Ping06 >> www.sina.com.cn-ping-06.txt && date/t >> www.sina.com.cn-ping-06.txt && time/t >> www.sina.com.cn-ping-06.txt && ping -n 100 -l 32 www.sina.com.cn >> www.sina.com.cn-ping-06.txt echo Ping07 >> www.sina.com.cn-ping-07.txt && date/t >> www.sina.com.cn-ping-07.txt && time/t >> www.sina.com.cn-ping-07.txt && ping -n 100 -l 32 www.sina.com.cn >> www.sina.com.cn-ping-07.txt echo Ping08 >> www.sina.com.cn-ping-08.txt && date/t >> www.sina.com.cn-ping-08.txt && time/t >> www.sina.com.cn-ping-08.txt && ping -n 100 -l 32 www.sina.com.cn >> www.sina.com.cn-ping-08.txt echo Ping09 >> www.sina.com.cn-ping-09.txt && date/t >> www.sina.com.cn-ping-09.txt && time/t >> www.sina.com.cn-ping-09.txt && ping -n 100 -l 32 www.sina.com.cn >> www.sina.com.cn-ping-09.txt echo Ping10 >> www.sina.com.cn-ping-10.txt && date/t >> www.sina.com.cn-ping-10.txt && time/t >> www.sina.com.cn-ping-10.txt && ping -n 100 -l 32 www.sina.com.cn >> www.sina.com.cn-ping-10.txt exit /b
4.www.tencent.com-ping.bat
@echo off cd C:/Users/%computername%/Desktop/ cd ping-tracert cd www.tencent.com cd ping echo Ping01 >> www.tencent.com-ping-01.txt && date/t >> www.tencent.com-ping-01.txt && time/t >> www.tencent.com-ping-01.txt && ping -n 100 -l 32 www.tencent.com >> www.tencent.com-ping-01.txt echo Ping02 >> www.tencent.com-ping-02.txt && date/t >> www.tencent.com-ping-02.txt && time/t >> www.tencent.com-ping-02.txt && ping -n 100 -l 32 www.tencent.com >> www.tencent.com-ping-02.txt echo Ping03 >> www.tencent.com-ping-03.txt && date/t >> www.tencent.com-ping-03.txt && time/t >> www.tencent.com-ping-03.txt && ping -n 100 -l 32 www.tencent.com >> www.tencent.com-ping-03.txt echo Ping04 >> www.tencent.com-ping-04.txt && date/t >> www.tencent.com-ping-04.txt && time/t >> www.tencent.com-ping-04.txt && ping -n 100 -l 32 www.tencent.com >> www.tencent.com-ping-04.txt echo Ping05 >> www.tencent.com-ping-05.txt && date/t >> www.tencent.com-ping-05.txt && time/t >> www.tencent.com-ping-05.txt && ping -n 100 -l 32 www.tencent.com >> www.tencent.com-ping-05.txt echo Ping06 >> www.tencent.com-ping-06.txt && date/t >> www.tencent.com-ping-06.txt && time/t >> www.tencent.com-ping-06.txt && ping -n 100 -l 32 www.tencent.com >> www.tencent.com-ping-06.txt echo Ping07 >> www.tencent.com-ping-07.txt && date/t >> www.tencent.com-ping-07.txt && time/t >> www.tencent.com-ping-07.txt && ping -n 100 -l 32 www.tencent.com >> www.tencent.com-ping-07.txt echo Ping08 >> www.tencent.com-ping-08.txt && date/t >> www.tencent.com-ping-08.txt && time/t >> www.tencent.com-ping-08.txt && ping -n 100 -l 32 www.tencent.com >> www.tencent.com-ping-08.txt echo Ping09 >> www.tencent.com-ping-09.txt && date/t >> www.tencent.com-ping-09.txt && time/t >> www.tencent.com-ping-09.txt && ping -n 100 -l 32 www.tencent.com >> www.tencent.com-ping-09.txt echo Ping10 >> www.tencent.com-ping-10.txt && date/t >> www.tencent.com-ping-10.txt && time/t >> www.tencent.com-ping-10.txt && ping -n 100 -l 32 www.tencent.com >> www.tencent.com-ping-10.txt exit /b
5.www.baidu.com-tracert.bat
@echo off cd C:/Users/%computername%/Desktop/ cd ping-tracert cd www.baidu.com cd tracert @echo Tracert01 >> www.baidu.com-tracert-01.txt && @echo %date% %time% >> www.baidu.com-tracert-01.txt && Tracert -h 100 www.baidu.com >> www.baidu.com-tracert-01.txt @echo Tracert02 >> www.baidu.com-tracert-02.txt && @echo %date% %time% >> www.baidu.com-tracert-02.txt && Tracert -h 100 www.baidu.com >> www.baidu.com-tracert-02.txt @echo Tracert03 >> www.baidu.com-tracert-03.txt && @echo %date% %time% >> www.baidu.com-tracert-03.txt && Tracert -h 100 www.baidu.com >> www.baidu.com-tracert-03.txt exit /b
6.www.sina.com.cn-tracert.bat
@echo off cd C:/Users/%computername%/Desktop/ cd ping-tracert cd www.sina.com.cn cd tracert @echo Tracert01 >> www.sina.com.cn-tracert-01.txt && @echo %date% %time% >> www.sina.com.cn-tracert-01.txt && Tracert -h 100 www.sina.com.cn >> www.sina.com.cn-tracert-01.txt @echo Tracert02 >> www.sina.com.cn-tracert-02.txt && @echo %date% %time% >> www.sina.com.cn-tracert-02.txt && Tracert -h 100 www.sina.com.cn >> www.sina.com.cn-tracert-02.txt @echo Tracert03 >> www.sina.com.cn-tracert-03.txt && @echo %date% %time% >> www.sina.com.cn-tracert-03.txt && Tracert -h 100 www.sina.com.cn >> www.sina.com.cn-tracert-03.txt exit /b
7.www.tencent.com-tracert.bat
@echo off cd C:/Users/%computername%/Desktop/ cd ping-tracert cd www.tencent.com cd tracert @echo Tracert01 >> www.tencent.com-tracert-01.txt && @echo %date% %time% >> www.tencent.com-tracert-01.txt && Tracert -h 100 www.tencent.com >> www.tencent.com-tracert-01.txt @echo Tracert02 >> www.tencent.com-tracert-02.txt && @echo %date% %time% >> www.tencent.com-tracert-02.txt && Tracert -h 100 www.tencent.com >> www.tencent.com-tracert-02.txt @echo Tracert03 >> www.tencent.com-tracert-03.txt && @echo %date% %time% >> www.tencent.com-tracert-03.txt && Tracert -h 100 www.tencent.com >> www.tencent.com-tracert-03.txt exit /b
8.測試
先打開 | 雙擊滑鼠 md.bat
桌面會創建文件夾
選擇ping和tracert文件bat右鍵打開
註:視窗全部消失即可完成。
各路大神,求帶飛有什麼建議敬請留言。QQ:861996013,李輝 。轉載請註明,謝謝。