473,804 Members | 5,054 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

nbtstat - getting NetBIOS name of remote machine

hello

I want to write a little console application to get the NetBIOS names
of a remote machine...exact ly like the command nbtstat -a [IP], but in
a programmatic way.
I googled around quite a bit but without success. Could someone plz
guide me how to go abt doing this.

Thanks
Siddharth
Nov 16 '05 #1
3 9506
Also, is there any way to call the nbtstat command from a program and
get the output in a string?

Thanks again.
Siddharth

Nov 16 '05 #2
The DnsQuery Win32 API function should hunt down the machine's name
however necessary, including using NetBT.

The .Net method System.Net.Dns. GetHostByAddres s() should be using
DnsQuery to do the work.

--
Truth,
James Curran
[erstwhile VC++ MVP]
Home: www.noveltheory.com Work: www.njtheater.com
Blog: www.honestillusion.com Day Job: www.partsearch.com
"siddharth jain" <si************ **@rediffmail.c om> wrote in message
news:84******** *************** ***@posting.goo gle.com...
hello

I want to write a little console application to get the NetBIOS names
of a remote machine...exact ly like the command nbtstat -a [IP], but in
a programmatic way.
I googled around quite a bit but without success. Could someone plz
guide me how to go abt doing this.

Thanks
Siddharth

Nov 16 '05 #3
You want to have a look at the diagnostics classes, and the system.proccess
classes. These will alow you to execute a command line tool and redirect the
output to a string, Then you can parse the string to get what you need.

"Siddharth Jain" <si************ **@rediffmail.c om> wrote in message
news:11******** **************@ c13g2000cwb.goo glegroups.com.. .
Also, is there any way to call the nbtstat command from a program and
get the output in a string?

Thanks again.
Siddharth

Nov 16 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
16272
by: Snuffy2 | last post by:
I'm looking to try to get a users MAC and/or NetBIOS name when they visit my website. It somehow can be done, I'm not sure with PHP, but it can be done. Does anyone have any idea how? As an example check out: http://stealthtests.lockdowncorp.com/ On that site, there are tests that will display NetBIOS & MAC addresses.
5
5435
by: hangten | last post by:
I have a service that 1) uses filewatcher to watch a directory on a remote machine. 2) checks if a certain application is running on the local machine before starting it. The problem is while checking for an existing instance of the application. I do the following code : Process processes = Process.GetProcessesByName(stProcName, localcpu); Where stProcName is the process I am checking localcpu is the local machine name.
1
3604
by: db | last post by:
Hello, I am writing a utility to get the performance counters from a remote machine. Currently, I am usign the System.Diagnostics.PerformanceCounter class to retrieve these counters, but they only retrieve the counters with the permissions of the owneer of my utility's process. I dont see any way within this class to provide a different authentication to let the user get the counters with different permissions (windows...
4
15897
by: rdonnici | last post by:
Hi all, Is there any way to, given an IP address(or NETBIOS machinename - I can convert from one to other) from my network, and assuming that everyone needs to log on a NT/2K/Windows Server 2003 Server, to discover the user name for the user logged on that machine? The final result desired is something like a table, with pairs at the moment the program is run. Any ideas? I have hunted high and low on the newsgroups and have not...
4
3650
by: Michael Tissington | last post by:
Is it possible to read the NetBIOS domain name and if so how ? -- Michael Tissington http://www.oaklodge.com http://www.tabtag.com
2
3150
by: Brad Baker | last post by:
Using ASP.NET (or classic ASP) is there a way to capture the NETBIOS name of the server that a page was run on? Currently we have email based error reports which get sent to us from our web sites. We have hundreds of websites on half a dozen servers. Sometimes the same website is load balanced across multiple servers so figuring out the "origin" of an error can be a challenging.
2
2385
by: snixten | last post by:
Hi How can I retrive the machinename/netbios-name of a remote computer, using c/c++. Not DnsQuery().
8
7809
by: =?iso-8859-1?q?Magnus_T=F6rnvall?= | last post by:
Hi! I'm trying to write a program that can tell if a remote computer is running Windows or not. The thing is, it have to go very fast, so I don't want to "connect" to the computer. My plan is to send a netbios request and if I get a response I know it's probably a Windows machine. The problem is that I can't use the Netbios function in NETAPI32.DLL,
11
5277
by: Herminio | last post by:
I have been given a text file that contains 'nbtstat -a' output for various computers in our network. The script needs extract the name of the computer and if there is a user name that nbtstat reads; extract that as well. If there is no user name then the script needs to say something like 'no user found'. does anyone have an idea how i would do that?
0
10577
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10332
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10320
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10077
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9150
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
6853
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5521
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5651
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3820
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.