@echo off FOR /f %%i IN (D:\test\iptest.txt) DO (ping -n 1 %%i|findstr TTL>nul&&echo Ping得通.||echo Ping不通) pause