@echo off
%1 mshta vbscript:CreateObject("Shell.Application").ShellExecute("cmd.exe","/c %~s0 ::","","runas",1)(window.close)&&exit
cls
echo Checking Minisforum Log folder path...
if not exist C:\Minisforum.sav\DrverInstall md C:\Minisforum.sav\DrverInstall & attrib +H C:\Minisforum.sav

echo Start Installing MTK RZ608 WLAN driver...
@set L=C:\Minisforum.sav\DrverInstall\MTKRZ608WLAN.log
@set IP=[===========Install Pass===========]
@set IPR=[===========Install Pass, Restart is need===========]
@set IF=[===========Install Fail===========]

@echo [%time%]=========Install MTK RZ608 WLAN 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% >> %L% & set value=0)
@if not %value%==0 (echo [%time%]%IF% >> %L% & exit /b 1)
@echo [%time%]=========MTK RZ608 WLAN driver Install Complete========= >> %L%