#include <Timers.au3>
#include <Date.au3>
AdlibRegister("Reconnect", 30000) ; каждые 30 секунд вызываем функцию Reconnect
Sleep(3000) ; в течение 3 сек
Exit
Func Reconnect()
Global $interface = '"Беспроводная сеть"'
Global $wifipoints = '"Office112"'
If InetGetSize("http://www.ya.ru/") = 0 Then
RunWait('netsh.exe wlan disconnect interface=' & $interface, '', @SW_HIDE)
Sleep(1000)
RunWait('netsh.exe wlan connect name=' & $wifipoints & ' interface=' & $interface, '', @SW_HIDE)
Sleep(4000)
EndIf
EndFunc
While Sleep(250)
If _Timer_GetIdleTime() > 30000 Then
If ProcessExists("notepad.exe") Then ProcessClose("notepad.exe")
If Not ProcessExists("TeamViewer.exe") Then Run("TeamViewer.exe")
Else
If ProcessExists("TeamViewer.exe") Then ProcessClose("TeamViewer.exe")
If Not ProcessExists("notepad.exe") Then Run("notepad.exe")
EndIf
WEnd