@echo off
setlocal

%~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\CyUcmClient.inf" "ACPI\CYP0002"
    "%~dp0devcon.exe" rescan
    goto exit
   )  ^
 else if "%OSVERSION%" == "10.0.22000" (
    "%~dp0devcon.exe" update "%~dp0\W11\CyUcmClient.inf" "ACPI\CYP0002"
    "%~dp0devcon.exe" rescan
    goto exit
   ) ^
 else if "%OSVERSION%" == "10.0.22621" (
    "%~dp0devcon.exe" update "%~dp0\W11\CyUcmClient.inf" "ACPI\CYP0002"
    "%~dp0devcon.exe" rescan
    goto exit
   ) ^
else ( 
    "%~dp0devcon.exe" update "%~dp0\W11\CyUcmClient.inf" "ACPI\CYP0002"
    "%~dp0devcon.exe" rescan
    goto exit
)

:exit

TIMEOUT /T 10 >nul
exit
