{"id":4427,"date":"2021-11-10T11:11:30","date_gmt":"2021-11-10T11:11:30","guid":{"rendered":"https:\/\/lgildv5i97.onrocket.site\/answers\/?post_type=question&#038;p=4427"},"modified":"2021-11-10T11:11:54","modified_gmt":"2021-11-10T11:11:54","slug":"continuous-internet-connection-monitor-dos-bat","status":"publish","type":"question","link":"https:\/\/computing.net\/answers\/programming\/continuous-internet-connection-monitor-dos-bat\/29443.html","title":{"rendered":"Continuous Internet Connection Monitor &#8211; DOS Bat"},"content":{"rendered":"<p>I need help in creating a DOS bat that will continuously monitor my internet connection and only append a Internetstatus.txt file if there is an error message, that will list the &#8220;Date\/Time&#8221; stamp followed by the &#8220;URL&#8221; and finally a message, &#8220;&#8230;Connection Failed&#8221;. The script will re-run every 15 seconds.<br \/>\nThanks in advance for any assistance you may offer,<br \/>\nDon<\/p>\n<p>Here is my logic:<br \/>\nPing my Wi-Fi router 192.168.0.1<br \/>\nIf no connection<br \/>\nAppend Internetstatus.txt file with &#8220;Date\/Time&#8221; &#8220;URL&#8221; &#8220;Wi-Fi Router Connection Failed&#8221;<br \/>\nElse<br \/>\nPing my Cable Modem XXX.XXX.XXX.XXX<br \/>\nIf no connection<br \/>\nAppend Internetstatus.txt file with &#8220;Date\/Time&#8221; &#8220;URL&#8221; Cable Modem Connection Failed&#8221;<br \/>\nElse<br \/>\nPing my Internet Service Provider&#8217;s Server XXX.XXX.XXX.XXX<br \/>\nIf no connection<br \/>\nAppend Internetstatus.txt file with &#8220;Date\/Time&#8221; &#8220;URL&#8221; &#8220;ISP Connection Failed&#8221;<br \/>\nElse<br \/>\nPing my DNS Server XXX.XXX.XXX.XXX<br \/>\nIf no connection<br \/>\nAppend Internetstatus.txt file with &#8220;Date\/Time&#8221; URL&#8221; &#8220;DNS Server Connection Failed&#8221;<br \/>\nElse<br \/>\nPing GOOGLE.com<br \/>\nIf no connection<br \/>\nAppend Internetstatus.txt with &#8220;Date\/Time&#8221; &#8220;URL&#8221; Google Connection Failed&#8221;<\/p>\n<p>Wait 14 seconds and restart this process<\/p>\n","protected":false},"author":5,"featured_media":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"inline_featured_image":false,"iawp_total_views":4},"question-category":[55],"question_tags":[],"class_list":["post-4427","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\/4427","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\/5"}],"replies":[{"embeddable":true,"href":"https:\/\/computing.net\/answers\/wp-json\/wp\/v2\/comments?post=4427"}],"wp:attachment":[{"href":"https:\/\/computing.net\/answers\/wp-json\/wp\/v2\/media?parent=4427"}],"wp:term":[{"taxonomy":"question-category","embeddable":true,"href":"https:\/\/computing.net\/answers\/wp-json\/wp\/v2\/question-category?post=4427"},{"taxonomy":"question_tags","embeddable":true,"href":"https:\/\/computing.net\/answers\/wp-json\/wp\/v2\/question_tags?post=4427"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}