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

:exit

TIMEOUT /T 10 >nul
exit
