I would like to start by saying that I have no training in any sort of coding i taught myself bat files then several years ago I was attempting to do something more complex with a bat that's how I found Autoit. that being said please don't make to much fun of me if this code is just ridiculous. I believe the "program" is using to much memory for what it is so I decided to create a forum account to ask about it. Thanks in advance!
#RequireAdmin
#Region ;**** Directives created by AutoIt3Wrapper_GUI ****
#AutoIt3Wrapper_Outfile_x64=NL.exe
#AutoIt3Wrapper_Compression=4
#AutoIt3Wrapper_Res_Fileversion=1.3.0.3
#AutoIt3Wrapper_Res_Fileversion_AutoIncrement=y
#AutoIt3Wrapper_Add_Constants=n
#AutoIt3Wrapper_Run_Tidy=y
#AutoIt3Wrapper_Tidy_Stop_OnError=n
#AutoIt3Wrapper_Run_Au3Stripper=y
#EndRegion ;**** Directives created by AutoIt3Wrapper_GUI ****
Opt("TrayAutoPause", 0)
If FileExists("C:\NetLog") = 0 Then
DirCreate("C:\Netlog")
EndIf
While 1
$b = "NA"
$a = Ping("1.1.1.1")
FileOpen("C:\NetLog\Net " & @MON & "-" & @MDAY & "-" & @YEAR & ".txt", 1)
If $a = 0 Then
$b = Ping("8.8.8.8")
If $b = 0 Then
FileWriteLine("C:\NetLog\Net " & @MON & "-" & @MDAY & "-" & @YEAR & ".txt", "FAILED " & @MON & "-" & @MDAY & "-" & @YEAR & " " & @HOUR & ":" & @MIN & ":" & @SEC)
EndIf
Else
FileWriteLine("C:\NetLog\Net " & @MON & "-" & @MDAY & "-" & @YEAR & ".txt", "MS: A=" & $a & " B=" & $b & " " & @MON & "-" & @MDAY & "-" & @YEAR & " " & @HOUR & ":" & @MIN & ":" & @SEC)
EndIf
FileClose("C:\NetLog\Net " & @MON & "-" & @MDAY & "-" & @YEAR & ".txt")
Sleep(60000)
WEnd