On the command prompt type:
FOR /L %i IN (1,1,254) DO nbtstat -a 192.168.0.%i>>nbtstat.txt
(1,1,254) - (start,step,end)
%i - variable.
nbtstat.txt - Resulting file.
192.168.0 - the first 3 octet of ip address, change it to you own subnet.
The 4th octet is the variable from 1 to 254 or you can limit it to any number you want.
Did you get the idea?