Solved

ping a list of computers by name

Posted on 2009-07-15
5
656 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 250 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 250 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

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

The Windows functions GetTickCount and timeGetTime retrieve the number of milliseconds since the system was started. However, the value is stored in a DWORD, which means that it wraps around to zero every 49.7 days. This article shows how to solve t…
I was prompted to write this article after the recent World-Wide Ransomware outbreak. For years now, System Administrators around the world have used the excuse of "Waiting a Bit" before applying Security Patch Updates. This type of reasoning to me …
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 …
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.

691 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