ping 一个IP段可用IP批处理文件
2014-06-17 23:15
239 查看
使用场景:知道一个IP端都属于某个公司,但不知道有哪些IP可用
用法: pingseg.bat 127.0.0
或 pingseg.bat 127.0.0 > 127.0.0.txt
批处理文件(pingseg.bat)
要输出以 | 分隔的IP列表
用法: pingseg.bat 127.0.0
或 pingseg.bat 127.0.0 > 127.0.0.txt
批处理文件(pingseg.bat)
@echo off setlocal enabledelayedexpansion ;:Timeout for ping command in milliseconds Set _t0=500 :start IP (last number) Set _t1=1 :ending IP (last number) Set _t2=254 if "%1"=="" ( echo ping a ip segment xxx.xxx.xxx.* echo usage: pingseg xxx.xxx.xxx goto:eof ) else ( Set _t4=%1. ) echo start pinging..., it may take several minutes echo available ip are: for /L %%I in (%_t1%,1,%_t2%) do set _t3=%%I & (ping %_t4%%%I -n 1 -w %_t0% >nul ) & call:_e!errorlevel! echo All IPs tested :clear the temp variables that were used for /L %%I in (0,1,4) do set _t%%I= goto:eof :_e0 echo %_t4%%_t3% goto:eof :_e1 goto:eof
要输出以 | 分隔的IP列表
@echo off setlocal enabledelayedexpansion ;:Timeout for ping command in milliseconds Set _t0=500 :start IP (last number) Set _t1=1 :ending IP (last number) Set _t2=254 if "%1"=="" ( echo ping a ip segment xxx.xxx.xxx.* echo usage: pingseg xxx.xxx.xxx goto:eof ) else ( Set _t4=%1. ) echo start pinging..., it may take several minutes echo available ip are: for /L %%I in (%_t1%,1,%_t2%) do set _t3=%%I& (ping %_t4%%%I -n 1 -w %_t0% >nul ) & call:_e!errorlevel! echo. echo All IPs tested :clear the temp variables that were used for /L %%I in (0,1,4) do set _t%%I= goto:eof :_e0 echo|set /p="%_t4%%_t3%|" goto:eof :_e1 goto:eof
相关文章推荐
- 批处理文件-循环ping多个ip并自动分别保存通及不t通的ip的结果
- PING 一个范围内的IP,把不通的保存下来的方法(批处理脚本)
- 使用批处理把某一文件拷贝到另外一个盘下的所有文件夹
- 小小玩玩,一个关机前备份一些自己需要的文件的批处理
- ping 一个ip,看它是否有效
- 一个实现关机的批处理文件
- ASP网站数据采集程序制作:一个采集入库生成本地文件的几个FUCTION(可用来生成HTML静态网页)
- Windows下用命令行修改IP详解,附批处理文件
- 多重网络环境下动态切换TCP/IP网络配置的批处理文件
- ASP网站数据采集程序制作:一个采集入库生成本地文件的几个FUCTION(可用来生成HTML静态网页)
- 一个清理Visual Studio最近打开的项目和文件的历史列表的批处理文件
- 一个很有用的方法,可用根据一个类文件找到他的路径
- 一个自动配置网络的批处理文件
- 制作一个批处理文件(bat文件)来备份数据
- 我的图象是JPEG文件,是放在远程一个固定IP电脑下面的一个目录,我如何读取这个JPEG文件呢?
- 实用批处理文件 (IP设置.bat, 清理系统垃圾.bat, atc.)
- 使用批处理ping ip段内主机
- 一个批处理文件
- [导入]多重网络环境下动态切换TCP/IP网络配置的批处理文件
- Windows脚本 - 关于本机ARP静态绑定批处理文件讲解[绑定ip-mac脚本详解]