@echo off

echo Start Installing Intel AX201 BT driver...
@set L=C:\windows\temp\Driver_install.log
@set IP=[===========Install Pass===========]
@set IPR=[===========Install Pass, Restart is need===========]
@set IF=[===========Install Fail===========]

@echo [%time%]=========Install Intel AX201 BT driver========= >> %L%
pnputil /add-driver "%~dp0Drivers\*.inf" /install >> %L%

@set value=%errorlevel%
@if %errorlevel%==0 (echo [%time%]%IP% >> %L% & set value=0)
@if %errorlevel%==259 (echo [%time%]%errorlevel% >> %L% & set value=0)
@if %errorlevel%==3010 (echo [%time%]%IPR% & echo [%time%]%IPR% >> %L% & set value=0)
@if not %value%==0 (echo [%time%]%IF% >> %L% & goto ERR)
@echo [%time%]=========Intel AX201 BT driver Install Complete========= >> %L%
@echo [%time%]=========Intel AX201 BT driver Install Complete=========
pause
exit

:ERR
echo [%time%]%IF%
pause
exit