Find Machine Names on local network from IP

I had an issue today where I needed to find all of the machine names on the local network along with their IP addresses.
Here is a batch file that helps do just that:
@echo off
echo > c:\network.txt IP Address NetBIOS Name
echo > c:\network.txt ============================
for /F %%a in (‘net view ^ find “\\”‘) do call :Sub %%a
goto [...]