中国DOS联盟论坛

China DOS Union

-- Unite DOS · Advance DOS · Grow DOS --
Union site: www.cn-dos.net Forum site: www.cn-dos.net/forum
Guest | Log in | Register | Members | Search | China DOS Union
中国DOS联盟论坛
The time now is 2026-08-11 16:40
47,811 topics / 349,897 posts / today 0 new / 48,256 members
DOS批处理 & 脚本技术(批处理室) » Get the number of online people in the LAN within one minute (without relying on third-party software)
Printable Version  3,340 / 17
Floor16 fyb198351 Posted 2009-04-11 13:33
初级用户 Posts 12 Credits 24
@echo off
arp -d
for /l %%i in (1 1 254) do start /min ping -n 1 -w 1 192.168.1.%%i>nul
arp -a|findstr /v "00-00-00-00-00-00"
@pause>nul

[ Last edited by fyb198351 on 2009-4-12 at 02:23 ]
Floor17 THENEWLIFE Posted 2009-04-12 03:27
初级用户 Posts 64 Credits 78
for /l %%i in (1 1 254) do (start /min ping -n 1 192.168.1.%%i)
arp -a | find /v "00-00-00-00-00">>1.txt
for /f "tokens=3" %%a in ('find /v /c "" 1.txt') do echo "There are %%a machines"
pause

Is there any more efficient way besides using NBTSCAN?
Floor18 不得不爱 Posted 2009-04-12 10:03
超级版主 Posts 2,044 Credits 5,310 From 四川南充
for /l %%i in (1 1 254) do ping -n 1 -w 1 192.168.1.%%i
arp -a
Prev  1 2
[ Contact the Union admin team - 中国DOS联盟 - Standard version ]
Sponsored by ifanr Inc | © 2001–2023