Jump to content

is there a way to do "if [section] in INI exists"


gcue
 Share

Recommended Posts

I want to run this for every [Location] listed - but of course this is unpredicatble any ideas?

$location1 = IniRead("eh.ini", "Location1", "location1", "Not Found")

$L1ips = IniReadSection("eh.ini", "Location1_IPs")
If @error Then 
    MsgBox(4096, "", "Error occurred, probably no INI file.")
Else
    For $i = 1 To $L1ips[0][0]

    Ping($L1ips[$i][1])

    If @error Then
     $status="OFFLINE"
    EndIf

    If Not @error Then
     $status="ONLINE"
    EndIf
 
FileWrite($file, '' &@CRLF & _
                 $location1 & "," & $L1ips[$i][0] & "," & $status)  

Next
EndIf
Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...