@echo off

@set L=C:\Windows\temp\install.log
@set IP=[********Install Pass********]
@set IPR=[********Install Pass, Restart is need********]
@set IF=[********Install Fail********]

@echo [%time%]=========Install Intel AX201_9462 wifi driver========= >> %L%
@echo [%time%]=========Install Intel AX201_9462 wifi driver=========

:ins1
pnputil /add-driver "%~dp0Drivers\*.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
pnputil /add-driver "%~dp0Drivers\PIE\*.inf" /install >> %L%
@if %errorlevel%==0 (echo [%time%]%IP% >> %L% & goto ins3)
@if %errorlevel%==259 (echo [%time%]%errorlevel% >> %L% & goto ins3)
@if %errorlevel%==3010 (echo [%time%]%IPR% & echo [%time%]%IPR% >> %L% & goto ins3)
@if not %errorlevel%==0 goto ERR

:ins3
pnputil /add-driver "%~dp0Drivers\Special_Configs\*.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 AX201_9462 wifi driver Install Complete========= >> %L%
@echo [%time%]=========Intel AX201_9462 wifi driver Install Complete=========
ECHO ERRRORLEVEL=%ERRORLEVEL% >> %L%
@set LL=C:\Windows\temp\AX201_9462WIFI.log
@echo [%time%] >>%LL%
pause
EXIT /B 0

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