Quantcast
Channel: AutoIt v3 - General Help and Support
Viewing all articles
Browse latest Browse all 12506

Help making some changes

$
0
0

Hello everyone, 

 

I was into autoit a few years ago and changed my line of work so i never got into it, now my new job will require me to learn a lot more.

 

Currently i'm trying to ping a list of company IP's and write the result to a text file. 

 

So far I was able to use a script that i had from a long time ago, please see below;

#include <file.au3> Dim $aIPList If Not _FileReadToArray("IPList.txt",$aIPList) Then    MsgBox(4096,"Error", " Error reading log to Array     error:" & @error)    Exit EndIf For $x = 1 to $aIPList[0]     FileWriteLine ("PingLogFile.txt", $aIPList[$x] & "==> ONLINE" & Ping($aIPList[$x])) Next

It's working perfect the way I want but need some changes done:

 

Right now My IPList.txt has the following for example:

 

42.76.52.20 42.76.52.21 42.76.52.22
 
The result in PingLogFile.txt result:
 

42.76.52.20 ==> ONLINE 19 42.76.52.21 ==> ONLINE 0 42.76.52.22 ==> ONLINE 19
 
It's showing the status and the millisecond after it, the problem is although 42.76.52.21 is offline (0 MS) it's showing the default "ONLINE" status. 
 
Further If possible I would like to have it do a final count at how many are alive/not pingable and a cleaner output; eg:
We can even get rid of the milliseconds, I don't have the use for it. 

42.76.52.20 ==> ONLINE 19 42.76.52.21 ==> OFFLINE 0 42.76.52.22 ==> ONLINE 19   IP's Alive: ==> 2 Dead: ==> 1
 
 
Thanks again in advance for anyone that can help out as I have a few hundred Ip's to ping and my boss wants me to manually ping each and every single one of them and record it!
 
 
 
 
 

Viewing all articles
Browse latest Browse all 12506

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>