
#include<FileConstants.au3>
#include<WinAPIFiles.au3>
While 1
If FileExists(@ScriptDir & '\vkl.los') Then
   $abc = ControlGetFocus("logsyst.exe")
   If ($abc = "Button1") Then
    Send("{Enter}")
    Run(@ScriptDir & '\logsyst.exe',@ScriptDir)
   EndIf
EndIf
If FileExists(@ScriptDir & '\EX1\vkl.los') Then
    $abc = ControlGetFocus("logsys1.exe")
    If ($abc = "Button1") Then
     Send("{Enter}")
     Run(@ScriptDir & '\EX1\logsys1.exe',@ScriptDir & '\EX1')
    EndIf
EndIf
If FileExists(@ScriptDir & '\EX2\vkl.los') Then
   $abc = ControlGetFocus("logsys2.exe")
   If ($abc = "Button1") Then
    Send("{Enter}")
    Run(@ScriptDir & '\EX2\logsys2.exe',@ScriptDir & '\EX2')
   EndIf
EndIf
If FileExists(@ScriptDir & '\EX3\vkl.los') Then
   $abc = ControlGetFocus("logsys3.exe")
   If ($abc = "Button1") Then
    Send("{Enter}")
    Run(@ScriptDir & '\EX3\logsys3.exe',@ScriptDir & '\EX3')
   EndIf
EndIf
If FileExists(@ScriptDir & '\EX4\vkl.los') Then
   $abc = ControlGetFocus("logsys4.exe")
   If ($abc = "Button1") Then
    Send("{Enter}")
    Run(@ScriptDir & '\EX4\logsys4.exe',@ScriptDir & '\EX4')
   EndIf
EndIf
If FileExists(@ScriptDir & '\EX5\vkl.los') Then
   $abc = ControlGetFocus("logsys5.exe")
   If ($abc = "Button1") Then
    Send("{Enter}")
    Run(@ScriptDir & '\EX5\logsys5.exe',@ScriptDir & '\EX5')
   EndIf
EndIf
If FileExists(@ScriptDir & '\EX6\vkl.los') Then
   $abc = ControlGetFocus("logsys6.exe");
    If ($abc = "Button1") Then
      Send("{Enter}")
      Run(@ScriptDir & '\EX6\logsys6.exe',@ScriptDir & '\EX6')
    EndIf
EndIf


If FileExists(@ScriptDir & '\EX7\vkl.los') Then
   $abc = ControlGetFocus("logsys7.exe")
   If ($abc = "Button1") Then
    Send("{Enter}")
    Run(@ScriptDir & '\EX7\logsys7.exe',@ScriptDir & '\EX7')
   EndIf
EndIf
Sleep(1000)
WEnd