Wednesday, 15 July 2015

batch file - get full list of devices from arp -a command -



batch file - get full list of devices from arp -a command -

i made (very) simple batch file:

@echo off :start arp -a | findstr 20-7c-8f-3f-03-9c cls if %errorlevel% geq 1 ( echo device offline echo device offline @ %time% on %date%. >> log.txt ) else ( echo device online. echo device online @ %time% on %date%. >> log.txt ) timeout 3 >nul /nobreak goto start

while works fine , dandy, doesn't work if said device not listed, ie phones.

here's mean.

all of devices connected router don't show in arp -a output. mac address of ipod 18:e7:f4:86:75:9f. there alternative way observe if on lan? or should other software. using this, , having running in background. extremely useful tool. tell when parents home, or if know @ house. serve lazy security program. thinking of ideas , potential have.

am improve off using nmap?

i figured out roundabout method issue. doesn't solve problem, makes my programme work. uses tool called wireless network watcher, , uses command line features. print on programs screen file.txt, , scan file.txt mac address. takes around 7 seconds cycle through whole process, gets job done.

code:

@echo off echo gathering info . . . :start if exist info.txt del info.txt wnetwatcher.exe /stext info.txt :loop if exist "info.txt" ( goto aaa ) timeout 2 >nul /nobreak goto loop :aaa cls find info.txt "18-e3-a4-86-75-9c" >nul if %errorlevel% geq 1 ( color c0 echo. echo. echo. cole's ipod offline. ) else ( color a0 echo. echo. echo. cole's ipod online. ) echo. echo. echo. echo. echo. echo. echo. echo refreshing (7s) goto start

it still nice have answer, i.e., why ipod not show up?

batch-file networking arp

No comments:

Post a Comment