將下列文字複製到 check-pi.bat
===================從下列起==================
@Echo off
del act.txt
del na.txt
echo 192.168.1.104 APRX >> act.txt
echo 192.168.1.105 Zero >> act.txt
echo 192.168.1.106 One >> act.txt
echo 192.168.1.107 Zero(白) >> act.txt
echo 192.168.1.108 mail >> act.txt
echo 192.168.1.104 APRX >> na.txt
echo 192.168.1.105 Zero >> na.txt
echo 192.168.1.106 One >> na.txt
echo 192.168.1.107 Zero(白) >> na.txt
echo 192.168.1.108 mail >> na.txt
echo ==========正常連線的設備========== >> act.txt
echo ==========斷線========== >> na.txt
@for /l %%i in (105,1,108) do @ping -n 2 -w 40 192.168.1.%%i& if errorlevel 1 (echo 192.168.1.%%i>>na.txt) else (echo 192.168.1.%%i>>act.txt)
cls
Echo 完成!!
@echo on
notepad act.txt & notepad na.txt
===================自上列起==================