需找出區網(如 192.168.1.x)哪些 IP 未被使用?撰寫批次檔利用 ping 掃描,自動將「Request timed out」的 IP 記錄至文字檔。
@Echo off
date /t > IPList.txt
time /t >> IPList.txt
echo =========== >> IPList.txt
For /L %%f in (1,1,100) Do Ping.exe -n 2 192.168.1.%%f | Find "Request timed out." && echo 192.168.1.%%f Timed Out >> IPList.txt && echo off
cls
Echo Finished!
@Echo on
Notepad.exe IPList.txt
IPTracker.bat(注意 For...Do 命令必須在單一行)。192.168.1. 改為實際區網網段。
適用版本:Windows XP Professional(專業版),Home Edition 無 gpedit.msc 但批次檔仍可執行。