@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.

帮我写一个bat运行文件需求是ping同文件夹内的1txt文件列表内的所有地址只要有返回一次都算成功1txt内的列表地址格式为一行一个把成功的写出到同目录2txt文件内1txt有600个地址使用一些兼容性比较好和稳定的写法

原文地址: https://www.cveoy.top/t/topic/c3vH 著作权归作者所有。请勿转载和采集!

免费AI点我,无需注册和登录