@echo off

set uaccheck=0

:CheckUAC
>nul 2>&1 "%SYSTEMROOT%\system32\cacls.exe" "%SYSTEMROOT%\system32\config\system"
if '%errorlevel%' NEQ '0' ( goto UACAccess ) else ( goto DEPLOY )

:UACAccess
echo Set UAC = CreateObject^("Shell.Application"^) > "%temp%\uac_get_admin.vbs"
set params = %*:"=""
echo UAC.ShellExecute "cmd.exe", "/c %~s0 %params%", "", "runas", 1 >> "%temp%\uac_get_admin.vbs"
"%temp%\uac_get_admin.vbs"
del "%temp%\uac_get_admin.vbs"
exit /b


:DEPLOY
chcp 949
color 9F
pushd %~dp0
cls


echo Start Installing...
@set L=C:\Windows\temp\Driver_install.log
@set L2=C:\Windows\temp\Driver_install_wlan_wifi.logs
@set IP=[********Install Pass********]
@set IPR=[********Install Pass, Restart is need********]
@set IF=[********Install Fail********]

@echo. > %L2%
@echo [%time%]=========Install WIFI driver========= >> %L%
@echo [%time%]=========Install WIFI driver========= >> %L2%

pnputil /add-driver "%~dp0Drivers\*.inf" /install >> %L%
pnputil /add-driver "%~dp0Drivers\PIE\*.inf" /install >> %L%
pnputil /add-driver "%~dp0Drivers\Special Configs\*.inf" /install >> %L%

@echo [%time%]=========WIFI driver Install Complete========= >> %L%
@echo [%time%]=========WIFI driver Install Complete========= >> %L2%
@echo. >> %L2%

type %L2%
pause