:ALS
sc query "AtolLicSvc" | find "RUNNING"
if "%ERRORLEVEL%"=="0" (
   goto UEM
) else (
   timeout /T 30
   goto ALS
)

:UEM
sc start "uem-agent"
sc query "uem-agent" | find "RUNNING"
if "%ERRORLEVEL%"=="0" (
   goto FRONTOL
) else (
   timeout /T 30
   goto UEM
)

:FRONTOL
cd %ProgramFiles(x86)%\ATOL\Frontol6\BIN\
rem cd %ProgramFiles%\ATOL\Frontol6\BIN\
start /B Frontol.exe
