@ECHO OFF

:: Check for administrator rights using net session
net session >nul 2>&1
if %errorLevel% neq 0 (
    echo Requesting administrative privileges...
    powershell -Command "Start-Process '%~f0' -Verb RunAs"
    exit /b
)

CD /D %~dp0
SET root=%~dp0
:QUERY
SC QUERYEX iTurboSvc
IF %ERRORLEVEL% == 0 GOTO :RESTART
GOTO :FAIL

:RESTART
SC STOP iTurboSvc
timeout /t 10
SC START iTurboSvc
set errcode=%ERRORLEVEL%
IF %errcode% == 0 GOTO :PASS
IF %errcode% == 1056 GOTO :PASS

:FAIL
ECHO RESTART ITURBO SVC FAIL
ECHO FAIL!FAIL!FAIL!FAIL!FAIL!
color 4f
PAUSE
EXIT /B1


:PASS
cls
ECHO RESTART ITURBO SVC
ECHO PASS!PASS!PASS!PASS!PASS!
color 2f
timeout /t 3
EXIT /B0
