?
Solved

ping a list of computers by name

Posted on 2009-07-15
5
Medium Priority
?
660 Views
Last Modified: 2013-11-09
I have the folowing script that can ping computers by IP and returns the name and the result is dumped in the text file.
for /f "tokens=*" %%a in ('type c:\computers.txt 2^>NUL') do ping -a %%a >> c:\result.txt
can someone modify this so that it pings by Name and returns IPs and dumps the result in a text file?

thanks

 

0
Comment
Question by:jskfan
[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
5 Comments
 
LVL 2

Accepted Solution

by:
CptArAb earned 750 total points
ID: 24863595
I don`t think thats possible, although i might be wrong. But IMHO, i would rather just use a program like angry IP scanner which can be found at:

http://www.angryziber.com/w/Download

And in the options tell it to only display live IP results. The program already has a built in option to save the result to a text file. So there`s your answer. I`m sure with some creativity you can automate the whole process if need be, else you can even download the source code for free at angryziber`s home page at take it from there.
0
 
LVL 8

Assisted Solution

by:joefreedom
joefreedom earned 750 total points
ID: 24863781
repost your question in a scripting zone.  I know you can ping a machine by its hostname using the command line, there has to be a way to script it.  In the script you are running right now it is the "-a" attribute that tells ping to return the hostname so it may be as simple as removing that attribute and making some other minor changes.
0
 

Author Comment

by:jskfan
ID: 24864442
actually, I just created a batch file with:
ping comp1
ping comp2
...
...
ping compX
Pause

then copied and pasted it to a text file.
0
 
LVL 8

Expert Comment

by:joefreedom
ID: 24864457
glad you figured it out
0
 

Expert Comment

by:PhillyTech
ID: 37943245
THIS DOES NOT ANSWER THE QUESTION, IT JUST LIST A SOFTWARE TO DOWNLOAD. GLAD I DID NOT PAY FOR THE WEBSITE YET I ALMOST DID.
0

Featured Post

Get 15 Days FREE Full-Featured Trial

Benefit from a mission critical IT monitoring with Monitis Premium or get it FREE for your entry level monitoring needs.
-Over 200,000 users
-More than 300,000 websites monitored
-Used in 197 countries
-Recommended by 98% of users

Question has a verified solution.

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

This article helps those who get the 0xc004d307 error when trying to rearm (reset the license) Office 2013 in a Virtual Desktop Infrastructure (VDI) and/or those trying to prep the master image for Microsoft Key Management (KMS) activation. (i.e.- C…
Windows 10 Creator Update has just been released and I have it working very well on my laptop. Read below for issues, fixes and ideas.
This Micro Tutorial hows how you can integrate  Mac OSX to a Windows Active Directory Domain. Apple has made it easy to allow users to bind their macs to a windows domain with relative ease. The following video show how to bind OSX Mavericks to …
This is used to tweak the memory usage for your computer, it is used for servers more so than workstations but just be careful editing registry settings as it may cause irreversible results. I hold no responsibility for anything you do to the regist…
Suggested Courses

800 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