需求:测试多台PC输出三个网站并行ping、tracert结果,多台PC同时进行。
说明:以、、为例。
创建ping-tracer、、、文件夹 ,输出结果.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 cd md ping md tracert cd C:/Users/%computername%/Desktop/ cd ping-tracert md cd md ping md tracert cd C:/Users/%computername%/Desktop/ cd ping-tracert md cd md ping md tracert exit /b
2.
@echo off cd C:/Users/%computername%/Desktop/ cd ping-tracert cd cd ping echo Ping01 >> ping-01.txt && date/t >> ping-01.txt && time/t >> ping-01.txt && ping -n 100 -l 32 >> ping-01.txt echo Ping02 >> ping-02.txt && date/t >> ping-02.txt && time/t >> ping-02.txt && ping -n 100 -l 32 >> ping-02.txt echo Ping03 >> ping-03.txt && date/t >> ping-03.txt && time/t >> ping-03.txt && ping -n 100 -l 32 >> ping-03.txt echo Ping04 >> ping-04.txt && date/t >> ping-04.txt && time/t >> ping-04.txt && ping -n 100 -l 32 >> ping-04.txt echo Ping05 >> ping-05.txt && date/t >> ping-05.txt && time/t >> ping-05.txt && ping -n 100 -l 32 >> ping-05.txt echo Ping06 >> ping-06.txt && date/t >> ping-06.txt && time/t >> ping-06.txt && ping -n 100 -l 32 >> ping-06.txt echo Ping07 >> ping-07.txt && date/t >> ping-07.txt && time/t >> ping-07.txt && ping -n 100 -l 32 >> ping-07.txt echo Ping08 >> ping-08.txt && date/t >> ping-08.txt && time/t >> ping-08.txt && ping -n 100 -l 32 >> ping-08.txt echo Ping09 >> ping-09.txt && date/t >> ping-09.txt && time/t >> ping-09.txt && ping -n 100 -l 32 >> ping-09.txt echo Ping10 >> ping-10.txt && date/t >> ping-10.txt && time/t >> ping-10.txt && ping -n 100 -l 32 >> ping-10.txt exit /b
3.
@echo off cd C:/Users/%computername%/Desktop/ cd ping-tracert cd cd ping echo Ping01 >> ping-01.txt && date/t >> ping-01.txt && time/t >> ping-01.txt && ping -n 100 -l 32 >> ping-01.txt echo Ping02 >> ping-02.txt && date/t >> ping-02.txt && time/t >> ping-02.txt && ping -n 100 -l 32 >> ping-02.txt echo Ping03 >> ping-03.txt && date/t >> ping-03.txt && time/t >> ping-03.txt && ping -n 100 -l 32 >> ping-03.txt echo Ping04 >> ping-04.txt && date/t >> ping-04.txt && time/t >> ping-04.txt && ping -n 100 -l 32 >> ping-04.txt echo Ping05 >> ping-05.txt && date/t >> ping-05.txt && time/t >> ping-05.txt && ping -n 100 -l 32 >> ping-05.txt echo Ping06 >> ping-06.txt && date/t >> ping-06.txt && time/t >> ping-06.txt && ping -n 100 -l 32 >> ping-06.txt echo Ping07 >> ping-07.txt && date/t >> ping-07.txt && time/t >> ping-07.txt && ping -n 100 -l 32 >> ping-07.txt echo Ping08 >> ping-08.txt && date/t >> ping-08.txt && time/t >> ping-08.txt && ping -n 100 -l 32 >> ping-08.txt echo Ping09 >> ping-09.txt && date/t >> ping-09.txt && time/t >> ping-09.txt && ping -n 100 -l 32 >> ping-09.txt echo Ping10 >> ping-10.txt && date/t >> ping-10.txt && time/t >> ping-10.txt && ping -n 100 -l 32 >> ping-10.txt exit /b
4.