Solved

batch file for nbtstat -a and write results to log

Posted on 2011-03-15
2
1,768 Views
Last Modified: 2012-05-11
Hi,
i need to find a whole bunch of UID's logged onto various machine IP's.
Rather than manually go through each one, i would like to create a bat file that will do the following:

read a source txt file for IP's
run nbtstat -a to listed IP's
write UID part from the output to a txt file.

Thanks guys.
0
Comment
Question by:-P-Henderson
2 Comments
 
LVL 9

Accepted Solution

by:
Vampireofdarkness earned 500 total points
ID: 35145049
This is as far as I got, before running out of time

@echo Off

IF EXIST ip-output.txt DEL ip-output.txt

FOR /f %%i IN (ips.txt) DO nbtstat -a %%i | find "<00>  UNIQUE">> tmp.txt
FOR /f "tokens=1,2,3,4,5 delims= " %%e IN (tmp.txt) DO echo %%e >>ip-output.txt
 
del tmp.txt

Open in new window


You need ips.txt in the same folder as the .bat, I used one IP as an example. The ip-output.txt shows "DESKTOP" (which is the name of my PC). I understand from google that the UID is meant to be <03>, but I don't have <03>. I do have <00>.

Perhaps it can help? Perhaps I'm completely off-mark.
0
 

Author Closing Comment

by:-P-Henderson
ID: 35146461
Worked a treat, thankyou.
0

Featured Post

NFR key for Veeam Backup for Microsoft Office 365

Veeam is happy to provide a free NFR license (for 1 year, up to 10 users). This license allows for the non‑production use of Veeam Backup for Microsoft Office 365 in your home lab without any feature limitations.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Network Packet Broker Gigamon compared to VSS 2 1,037
HP Networking 1 175
Regarding upgrading my graphics card 5 98
Auto failover with 2 different site to site VPNs connection 9 87
As dyndns has reduced the capabilities of the free service, I looked around for other free providers of Dynamic DNS service. After testing several I decided to move my DNS hosting to Hurricane Electric as then domains that require dynamic hostnam…
Managing 24/7 IT Operations is a hands-on job and indeed a difficult one. Over the years I have found some simple tips and techniques to increase the efficiency of the overall operations. The core concept has always been on continuous improvement; a…
After creating this article (http://www.experts-exchange.com/articles/23699/Setup-Mikrotik-routers-with-OSPF.html), I decided to make a video (no audio) to show you how to configure the routers and run some trace routes and pings between the 7 sites…
Here's a very brief overview of the methods PRTG Network Monitor (https://www.paessler.com/prtg) offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…

829 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question