{"id":11478,"date":"2021-12-08T04:16:05","date_gmt":"2021-12-08T04:16:05","guid":{"rendered":"https:\/\/lgildv5i97.onrocket.site\/answers\/?post_type=question&#038;p=11478"},"modified":"2021-12-08T04:16:29","modified_gmt":"2021-12-08T04:16:29","slug":"ping-list-of-computers-from-txt-file","status":"publish","type":"question","link":"https:\/\/computing.net\/answers\/programming\/ping-list-of-computers-from-txt-file\/21916.html","title":{"rendered":"Ping List Of Computers From Txt File"},"content":{"rendered":"<p>Continuing from post <a href=\"https:\/\/web.archive.org\/web\/20130522144133\/https:\/\/computing.net\/answers\/programming\/ping-list-of-computers-from-a-txt-file\/19843.html\" target=\"_blank\" rel=\"noopener\">https:\/\/computing.net\/answers\/pr&#8230;<\/a><br \/>\n&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;<br \/>\nI need to try and modify the script below to tell me if the machine was pingable or not. This script doesn&#8217;t work well if the machine&#8217;s IP address was cached in the DNS server.<\/p>\n<p>@echo off<br \/>\nset ComputerList=list.txt<\/p>\n<p>Echo Computername,IP Address&gt;Final.csv<br \/>\nsetlocal enabledelayedexpansion<\/p>\n<p>for \/f &#8220;usebackq tokens=*&#8221; %%A in (&#8220;%ComputerList%&#8221;) do (<br \/>\nfor \/f &#8220;tokens=3&#8221; %%B in (&#8216;ping -n 1 -l 1 %%A ^|findstr Reply&#8217;) do (<br \/>\nset IPadd=%%B<br \/>\necho %%A,!IPadd:~0,-1!&gt;&gt;final.csv<br \/>\n))<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"inline_featured_image":false,"iawp_total_views":10},"question-category":[55],"question_tags":[],"class_list":["post-11478","question","type-question","status-publish","hentry","question-category-programming"],"jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/computing.net\/answers\/wp-json\/wp\/v2\/question\/11478","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/computing.net\/answers\/wp-json\/wp\/v2\/question"}],"about":[{"href":"https:\/\/computing.net\/answers\/wp-json\/wp\/v2\/types\/question"}],"author":[{"embeddable":true,"href":"https:\/\/computing.net\/answers\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/computing.net\/answers\/wp-json\/wp\/v2\/comments?post=11478"}],"wp:attachment":[{"href":"https:\/\/computing.net\/answers\/wp-json\/wp\/v2\/media?parent=11478"}],"wp:term":[{"taxonomy":"question-category","embeddable":true,"href":"https:\/\/computing.net\/answers\/wp-json\/wp\/v2\/question-category?post=11478"},{"taxonomy":"question_tags","embeddable":true,"href":"https:\/\/computing.net\/answers\/wp-json\/wp\/v2\/question_tags?post=11478"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}