for /l %%i in (0,1,254) do echo 192.168.0.%%i >> mac.txt && getmac /s 130.144.176.%%i /NH /FO csv >> Mac.txt this is for getting the MAC-adresses for all computers that are on, i think this does also wat you need, else it is easy to change to a ping (try "| find") you can also lay this against a AD dump to see the computers that are not running gr /\/\o\/\/