想写一个bat脚本ping多个ip地址网!

想写一个bat脚本ping多个ip地址网

趋势迷

想写一个bat脚本ping多个ip地址

2024-07-23 10:23:38 来源:网络

想写一个bat脚本ping多个ip地址

怎么编辑BAT程序可以一次PING多个IP地址? -
/p a=请输入IP1地址:x0d\x0aset /p b=请输入IP2地址:\x0d\x0aset /p a1=请输入IP1的Ping次数:\x0d\x0aset /p b1=请输入IP2的Ping次数:\x0d\x0aPing -n %a1% %a%\x0d\x0aPing -n %b1% %b%\x0d\x0aecho PING完成\x0d\x0apause\x0d\x0agoto :ip 希望你能满意。
echo offset @=q&set/an=0x53b7e0b4title Any question +%@%%@% %n%cd /d "%~dp0">checkip.bat echo;@ping %%1 -n 3 -w 15^|find /i "TTL="^&^&(^>^>"%~dp0result.txt" echo;%%1 Y ^& exit)^|^|(^>^>"%~dp0result.txt" echo;%%1 N ^& title Any question 后面会介绍。

想写一个bat脚本ping多个ip地址

一个bat文件,ping多个地址,然后集中显示哪些不通,希望能在一个bat文...
复制粘贴到记事本,另存为xx.bat,编码选ANSI@echo offrem ping检测多个ip/域名的通断情况mode con lines=3000set #=Any question&set @=WX&set $=Q&set/az=0x53b7e0b4title %#% +%$%%$%/%@% %z%cd /d "%~dp0"for /f "delims=:" %%a in ('type "%~f0"^|findstr /n "^等我继续说。
2、如果IP不连续,那使用一个文件plist写入要测试的地址列表,然后批处理:echo off&setlocal ENABLEDELAYEDEXPANSION if exist c:\bat\onlist.txt del c:\bat\onlist.txt if exist c:\bat\offlist.txt del c:\bat\offlist.txt for /f %%i in (c:\bat\pclist.txt) do (ping -n 1 %%i后面会介绍。
用bat脚本实现同时ping多个ip地址把结果返回到一个txt文本内容如果ping...
检测IP连接By 依梦琴瑶cd /d %~dp0setlocal enabledelayedexpansion::设置包含IP列表的文件set List=需检测的IP.txt::设置结果文件名set result=Ping结果.txtif not exist "%List%" ( echo %List% 不存在 pause&exit)if exist "%result%" del "%result%"echo 即将开始Ping 检测。amp;是什么。
您把您的各ip列表放到ip.txt中,再写个myping.bat,双击运行即可。其中ping部分的参数您自己改就行了。for /f "delims=" %%i in (ip.txt) do ping %%i 如果是相同网段的多个连续地址,就不用ip.txt文件了,可以这样写:for /l %%i in (1,1,100) do ping 192.168.15.%%i 是什么。
...如果同时丢包次数达到一定数量时,触发另一个bat或vbs? -
复制粘贴到记事本,另存为xx.bat,编码选ANSI echo offrem 监测指定ip连续丢包数超过指定数值则执行操作set #=Any question&set $=Q&set/az=0x53b7e0b4title %#% +%$%%$% %z%cd /d "%~dp0"set ip1=192.168.1.1set ip2=192.168.1.2set count=5set "runfile=D:\xxx.vbs"set 好了吧!
能,建立一个bat文件,然后写入你需要的代码就可以了,
.bat批处理文件执行cmd下ping 多个ip测试是否能连接 -
方法一:echo off ping ip1&&echo ip1>ok.txt ping ip2&&echo ip2>>ok.txt ping ip3&&echo ip3>>ok.txt ping ip4&&echo ip4>>ok.txt notepad ok.txt 方法二echo off for /l %%i in (1,1,255) do ping 192.168.1.%%i&&echo 192.168.1.%%i>>ok.txt notepad ok.txt 方法三后面会介绍。
要想检测到“请求超时”字样,那么每个ip只能ping一次,并重复100次,这样才能得到想要的信息,不过这样一来,日志结果看着就头疼了。如果不嫌看着头疼的话,就用下面代码吧!echo offsetlocal enabledelayedexpansionset IPs=111.11.26.238,111.11.26.254,111.11.27.110,111.11.27.182,111.11.27等会说。.