Solved

batch file for nbtstat -a and write results to log

Posted on 2011-03-15
2
1,786 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Forrester Webinar: xMatters Delivers 261% ROI

Guest speaker Dean Davison, Forrester Principal Consultant, explains how a Fortune 500 communication company using xMatters found these results: Achieved a 261% ROI, Experienced $753,280 in net present value benefits over 3 years and Reduced MTTR by 91% for tier 1 incidents.

Question has a verified solution.

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

Suggested Solutions

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…
Data center, now-a-days, is referred as the home of all the advanced technologies. In-fact, most of the businesses are now establishing their entire organizational structure around the IT capabilities.
This video gives you a great overview about bandwidth monitoring with SNMP and WMI with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're looking for how to monitor bandwidth using netflow or packet s…
In this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're interested in additional methods for monitoring bandwidt…

735 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