Sign in to follow this  
Followers 0
gcue

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

2 posts in this topic

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

Share this post


Link to post
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
Sign in to follow this  
Followers 0