Modifying scanmac.cmd to show remote computer names

  • Thread starter Thread starter vagabond
  • Start date Start date
V

vagabond

I've been using the script found at http://www.experts-exchange.com/Operating_Systems/WinNT/Q_11040185.html and, working in a large network environment which has been put together in a piece-meal fashion, I find it very useful to associate MAC addresses and IPs.

The author of the script suggests that it would be easy to substitute nbtstat for arp and get machine names. I can't figure out how to do this. I thought that changing arp -a to nbtstat -A would do the trick but I guess that "Echo IP: %1 MAC: %2" needs to be modified to deal with the different output from nbtstat.

Any tips (and maybe an outline of how the script does its stuff) would be very welcome.

Thanks

John
 
I've been using the script found at http://www.experts-
exchange.com/Operating_Systems/WinNT/Q_11040185.html and,
working in a large network environment which has been put
together in a piece-meal fashion, I find it very useful to
associate MAC addresses and IPs.
The author of the script suggests that it would be easy to
substitute nbtstat for arp and get machine names. I can't
figure out how to do this. I thought that changing arp -a
to nbtstat -A would do the trick but I guess that
"Echo IP: %1 MAC: %2" needs to be
modified to deal with the different output from nbtstat.

The ".NetValue Series" of Mount/\Commands provide several variations of
comma-separated lists that will do what you need. In particular, the
command ".NetIPMacs" provides a list in the format

ComputerName,nnn.nnn.nnn.nnn,xx-xx-xx-xx-xx-xx

The syntax for this command is simply

%.NetIPMacs%

That one-word command CONSISTENTLY provides this list under NT/2K/XP/K3.

See (http://TheSystemGuard.com/MtCmds/NetValue) for more info.

Any tips (and maybe an outline of how the script does its stuff) would be
very welcome.

The essence of the .NetIPMacs command is to reformat the output of Net View
for computernames only, send it to Nbtstat to pick up the MAC addresses, and
then combine the first two with ping to get the IP Addresses.

By structuring the code into a "single line command" or Mount/\Command, and
then giving it a "sounds like what it does" name (i.e., NetIPMacs), your
scripts will be self-documenting. For more info on MountCommands, see
(http://MountCommands.com).

*******
Notes:

1. .Mount/\Commands are constructed using ONLY builtin
commands common to all four platforms (NT/2K/XP/K3).
2. .M/\C's are NOT case sensitive. Mixed case is used
for Visual Clarity only.
3. ntlib.cmd provides over 100 resources to assist with
writing and documenting cross-platform scripts,
including 57 fully functional .Mt/\Cmds.
You can obtain it at (http://ntlib.com).

*******

-tsg
____________________________________________________________
TheSystemGuard.com | BoomingOrFuming.com | MountCommands.com
Free and "Almost Free" Knowledge for Windows System Admins!
 
Back
Top