#NoTrayIcon
If ($CmdLine[0]) And ($CmdLine[1] = '/ping') Then
Do
Sleep(500)
Until Ping($CmdLine[2])
Exit
EndIf
Opt('TrayIconHide', 0)
Global $Pid = 0
OnAutoItExitRegister('AutoItExit')
;Область произвольного кода
If @compiled Then
$Pid = Run(@ScriptFullPath & ' /ping iog-office.dyndns.org')
Else
$Pid = Run(@AutoItExe & ' "' & @ScriptFullPath & '" ' & ' /ping iog-office.dyndns.org')
EndIf
;Продолжение произвольного кода
While ProcessExists($Pid)
Sleep(100)
WEnd
$Pid = 0
MsgBox(0, 'Ping', 'OK!')
Func AutoItExit()
If $Pid Then
ProcessClose($Pid)
EndIf
EndFunc ;==>AutoItExit