1.1 脚本名称
Check_IP_Not_Use.bat
1.2 脚本代码
@Echo off set /p input_number=请输入网络位(192.168.1.): IF EXIST %cd%\%input_number%X.txt (goto clear_file) :clear_file cd.>"%cd%\%input_number%X.txt" date /t >> %input_number%X.txt time /t >> %input_number%X.txt echo ============ >> %input_number%X.txt echo ============
echo 开始PING检测 For /L %%f in (1,1,254) Do (
Ping -n 1 %input_number%%%f | Find /i "请求超时。" > nul && echo %input_number%%%f >> %input_number%X.txt
) pause exit
1.3 脚本运行方法
双击Check_IP_Not_Use.bat脚本文件直接运行,运行效果如下: