I have to get IP of webpages that I'll deliver from txt file: for example txt file looks like:
google.com
yahoo.com
toyota.com
bmw.com
etc...
I'll have to get something like
81.177.116.172
11.127.114.122
etc..
or
81.177.116.172 - google.com
11.127.114.122 - yahoo.com
I know that I can use
ping websiteurl.com > ping.txt
but i want to check like 2000 pages. Please advice how to do it the fastest way, and how to deliver line from txt file as parameter to ping. Thanks
Next updated and commented code snippet is faster than code in my original answer:
Data:
Output (run from an open
cmd
window):Beautified output:
I know this is a PowerShell answer to a batch question, but I find that many people ask how to do things in batch when they are really just wanting a command line. If you are wanting to learn how to do things like this, learn PowerShell instead of batch as it is much easier to learn than the convoluted batch FOR command (my apologies to those of you who actually understand it).