Windows XP Windows 7 Windows 2003 Windows Vista Windows 綜合教學 Linux 系統教學
Windows 10 Windows 8 Windows 2008 Windows NT Windows Server 電腦軟體教學

Windows 系統中追蹤 IP 位址:批次檔自動掃描可用 IP

編輯:XP 系統基礎知識

排查 DHCP 故障時需找出指定範圍內未使用的 IP。傳統 for 迴圈 ping 需人工檢視大量輸出。改寫批次檔自動過濾僅顯示未回應 IP 並存檔。

建立 IPTracker.bat

記事本輸入以下內容(單行):

@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。需將範例 IP 替換為實際網段。執行後自動開啟記事本顯示未使用 IP 清單,可重複使用。

注意:僅適用 Windows XP Professional 版本。

Copyright © Windows教程網 All Rights Reserved