@echo off
TITLE Install Drivers
>nul 2>&1 "%SYSTEMROOT%\system32\cacls.exe" "%SYSTEMROOT%\system32\config\system"
if %ERRORLEVEL% EQU 0 (
	if exist "%temp%\getadmin.vbs" del /q "%temp%\getadmin.vbs"
) else (
	if NOT "%~1"=="" set file= ""%~1""
	(echo Set UAC = CreateObject("Shell.Application"^)
	@echo UAC.ShellExecute "cmd.exe", "/c %~s0%file%", "", "runas", 1)> "%temp%\getadmin.vbs"
	"%temp%\getadmin.vbs"
	exit /b 0
	if exist "%temp%\getadmin.vbs" del /q "%temp%\getadmin.vbs"
)
cd /d %~dp0
set DEVCON=%~dp0Tools\devcon_x64.exe
set DIR="%~dp0"
echo DIR=%DIR%
for /R %DIR% %%f in (*.inf) do ( 
	pnputil /add-driver %%f /install
	%DEVCON% rescan
)

:END
echo.
echo === The Driver Installation successful.===
echo      === Continue the reboot.===
echo.
popd
pause
shutdown /r /t 0
goto :EOF