@echo off

echo Start Installing Intel Dynamic tuning 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 Dynamic tuning driver========= >> %L%
@echo [%time%]=========Install Intel Dynamic tuning driver=========

:ins1
@echo [%time%]1.dptf_cpu.inf>> %L%
pnputil /add-driver "%~dp0Drivers\dptf_cpu.inf" /install >> %L%
@if %errorlevel%==0 (echo [%time%]%IP% >> %L% & goto ins2)
@if %errorlevel%==259 (echo [%time%]%errorlevel% >> %L% & goto ins2)
@if %errorlevel%==3010 (echo [%time%]%IPR% & echo [%time%]%IPR% >> %L% & goto ins2)
@if not %errorlevel%==0 goto ERR

:ins2
@echo [%time%]2.dptf_acpi.inf >> %L%
pnputil /add-driver "%~dp0Drivers\dptf_acpi.inf" /install >> %L%
@if %errorlevel%==0 (echo [%time%]%IP% >> %L% & goto resultpass)
@if %errorlevel%==259 (echo [%time%]%errorlevel% >> %L% & goto resultpass)
@if %errorlevel%==3010 (echo [%time%]%IPR% & echo [%time%]%IPR% >> %L% & goto resultpass)
@if not %errorlevel%==0 goto ERR

:resultpass
@echo [%time%]=========Intel Dynamic tuning driver Install complete========= >> %L%
@echo [%time%]=========Intel Dynamic tuning driver Install complete=========
ECHO ERRRORLEVEL=%ERRORLEVEL% >> %L%
pause
EXIT /B 0

:ERR
echo [%time%]%IF% >> %L%
echo [%time%]%IF%
ECHO ERRRORLEVEL=%ERRORLEVEL% >> %L%
pause
EXIT /B 1
