摘要:Ping網段
Windows命令指示列:批次處理
For /L %variable IN (start,step,end) DO command [command-parameters]
1. for /l %p in (1,1,254) do @ping 192.168.1.%p -n 1:PING 192.168.1.1~254
2. for /l %p in (1,1,254) do @ping 192.168.1.%p -n 1 | find "回覆自" /i:查詢特定條件
3. for /l %p in (30,1,60) do @ping 192.168.1.%p -n 1:設定PING範圍為192.168.1.30~60
4. for /l %%p in (1,1,254) do @ping 192.168.1.%%p -n 1:寫入批次檔中,於『%』前多一個『%』
5. for /l %p in (1,1,254) do @ping -n 1 -w 40 192.168.1.%p & if errorlevel 1 (echo 192.168.1.%p>>na.txt)
else (echo 192.168.1.%p>>act.txt):依據回覆結果儲存在不同檔案內,根據實況更改參數『-n 1 -w 40』
6. for /l %p in (1,1,65535) do @ping -n 1 -w 40 192.168.%p:PING網段
轉載自:http://wdlxxl.blog.hexun.com.tw/27132514_d.html
參考:https://app.shopback.com/RBANl9P3Ysb