Sander Timmerman Posted July 18, 2007 Share Posted July 18, 2007 Hi, I wanted to make a mass ip pinger. However I can't make up a code that calculates the correct ip range e.g. $ip1 = 192.168.1.1 To $ip2 = 192.168.5.1 How can I put all the ip addresses in that range on to an array?! Thanks in advance! (I'am dutch bla bla you know ;-)) Link to comment Share on other sites More sharing options...
James Posted July 18, 2007 Share Posted July 18, 2007 Look at StringSplit. Blog - Seriously epic web hosting - Twitter - GitHub - Cachet HQ Link to comment Share on other sites More sharing options...
Sander Timmerman Posted July 18, 2007 Author Share Posted July 18, 2007 Look at StringSplit.And then? I really don't have any clue how to do it...Would someone please post a code he or she already maked, that's the best way I can learn it Thanks! Link to comment Share on other sites More sharing options...
Developers Jos Posted July 18, 2007 Developers Share Posted July 18, 2007 replace the Consolewrite with Ping and whatever else you need there: $ip1 = "192.168.1.1" $ip2 = "192.168.5.1" $range1 = StringSplit($ip1, ".") $range2 = StringSplit($ip2, ".") For $OCt1 = $range1[1] To $range2[1] $oct2End=$range2[2] If $OCt1 < $range2[1] then $oct2End= 254 For $OCt2 = $range1[2] To $oct2End $oct3End=$range2[3] If $OCt2 < $range2[2] then $oct3End= 254 For $OCt3 = $range1[3] To $oct3End $oct4End=$range2[4] If $OCt3 < $range2[3] then $oct4End= 254 For $OCt4 = $range1[4] To $oct4End ConsoleWrite("Ip:" & $OCt1 & '.' & $OCt2 & '.' & $OCt3 & '.' & $OCt4 & @lf) Next Next Next Next SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past. Link to comment Share on other sites More sharing options...
Sander Timmerman Posted July 18, 2007 Author Share Posted July 18, 2007 replace the Consolewrite with Ping and whatever else you need there: $ip1 = "192.168.1.1" $ip2 = "192.168.5.1" $range1 = StringSplit($ip1, ".") $range2 = StringSplit($ip2, ".") For $OCt1 = $range1[1] To $range2[1] $oct2End=$range2[2] If $OCt1 < $range2[1] then $oct2End= 254 For $OCt2 = $range1[2] To $oct2End $oct3End=$range2[3] If $OCt2 < $range2[2] then $oct3End= 254 For $OCt3 = $range1[3] To $oct3End $oct4End=$range2[4] If $OCt3 < $range2[3] then $oct4End= 254 For $OCt4 = $range1[4] To $oct4End ConsoleWrite("Ip:" & $OCt1 & '.' & $OCt2 & '.' & $OCt3 & '.' & $OCt4 & @lf) Next Next Next Next Thank you very very very much! Exactly what I was looking for! Link to comment Share on other sites More sharing options...
Kempeck Posted September 7, 2009 Share Posted September 7, 2009 Thank you very very very much!Exactly what I was looking for! I'm a bit new, and was wondering was this the entire script? TIA. Link to comment Share on other sites More sharing options...
SoulA Posted September 7, 2009 Share Posted September 7, 2009 Entire script? I'm sure there was more. Link to comment Share on other sites More sharing options...
Developers Jos Posted September 8, 2009 Developers Share Posted September 8, 2009 I'm a bit new, and was wondering was this the entire script? TIA.Sure..Entire script? I'm sure there was more.What is missing in your opinion?Jos SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past. Link to comment Share on other sites More sharing options...
SoulA Posted September 8, 2009 Share Posted September 8, 2009 The pinging part, gathering the results and outputting those results somehow. Link to comment Share on other sites More sharing options...
99ojo Posted September 8, 2009 Share Posted September 8, 2009 The pinging part, gathering the results and outputting those results somehow.Hi,Jos said everything........replace the Consolewrite with Ping and whatever else you need thereSo look in helpfile for return from ping and you can code what you want....;-))Stefan Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now