@echo off

%~d0
cd %~dp0

for /f "tokens=4-7 delims=. " %%i in ('ver') do set OSVERSION=%%i.%%j.%%k

if "%OSVERSION%" LEQ "10.0.19045" ( 
    "%~dp0devcon.exe" update "%~dp0\W10\ITEUcmCxClient.inf" "ACPI\ITE8853"
    "%~dp0devcon.exe" rescan
    if '%errorlevel%' == '0' ( goto Pass ) else ( goto End )
   )  ^
 else if "%OSVERSION%" == "10.0.22000" (
    "%~dp0devcon.exe" update "%~dp0\W1121H2\ITEUcmCxClient.inf" "ACPI\ITE8853"
    "%~dp0devcon.exe" rescan
    if '%errorlevel%' == '0' ( goto Pass ) else ( goto End )
   ) ^
 else if "%OSVERSION%" == "10.0.22621" (
    "%~dp0devcon.exe" update "%~dp0\W1122H2\ITEUcmCxClient.inf" "ACPI\ITE8853"
    "%~dp0devcon.exe" rescan
    if '%errorlevel%' == '0' ( goto Pass ) else ( goto End )
   ) ^
else ( 
    "%~dp0devcon.exe" update "%~dp0\W1122H2\ITEUcmCxClient.inf" "ACPI\ITE8853"
    "%~dp0devcon.exe" rescan
    if '%errorlevel%' == '0' ( goto Pass ) else ( goto End )
    )

:Pass
echo %ERRORLEVEL%
echo Pass
"%~dp0AsusFCNotificationSetup\AsusFCNotificationSetup.exe" -s
if errorlevel 0 goto Exit
%~dp0AsusFCNotificationSetup\AsusFCNotificationSetup.exe -s
EXIT

:END
echo %ERRORLEVEL%
echo Fail

:Exit
EXIT