Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Shaun E on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Computer name

Status
Not open for further replies.

bacevedo

MIS
Jun 13, 2003
12
US
I am able to ping an IP address and I receive a response, but how do I obtain the computer name. When i ping it does not give me the name. Thanks,
 
You could use the command

nbtstat -a 10.0.0.1



---
Make the best use of what is in your power, and take the rest as it happens.
 
ping -a 10.0.0.1

-------------------------------

If it doesn't leak oil it must be empty!!
 
Hello bacevedo,

You can use the plain text script. Make it with extension .vbs and double-click to go.
Code:
shost="[blue]127.0.0.1[/blue]"    '<<<change this to the ip address in question
set svc=getobject("winmgmts:\\" & shost & "\root\cimv2")
for each ox in svc.execquery("select * from win32_computersystem")
	wscript.echo ox.name
next
set svc=nothing
regards - tsuji
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top