批处理脚本:批量ping IP地址并记录成功结果
@echo off setlocal enabledelayedexpansion set success=false for /f %%i in ('1.txt') do ( ping -n 1 %%i >nul if !errorlevel! equ 0 ( echo %%i >>2.txt set success=true ) ) if !success! equ false ( echo None of the addresses were successfully pinged. >2.txt ) echo Done. Results saved to 2.txt.
原文地址: https://www.cveoy.top/t/topic/nCei 著作权归作者所有。请勿转载和采集!