@echo off
mode con: cols=60 lines=20
title Driver installer - jins.kr
chcp 949 > nul
color 0f

:: °ü¸®ÀÚ ±ÇÇÑ Ã¼Å©
net session >nul 2>&1
if %errorlevel% neq 0 (
    echo °ü¸®ÀÚ ±ÇÇÑÀ¸·Î ½ÇÇàÇÕ´Ï´Ù...
    powershell -Command "Start-Process '%~f0' -Verb RunAs"
    exit /b
)

cd /d %~dp0

echo.
echo  1. Driver Backup
echo.
echo  2. Driver install
echo.
echo  Q. ³ª°¡±â
echo.
choice /c 12Q /n /m ": ¼±ÅÃÇÏ¼¼¿ä : "
if %errorlevel%==1 goto DB
if %errorlevel%==2 goto DI
if %errorlevel%==3 goto END

:DB
   cls
   echo.
   echo==== Driver Backup ====
   winget install lostindark.DriverStoreExplorer --interactive --accept-source-agreements --accept-package-agreements --scope machine
   start %systemroot%\system32\cmd.exe /c rapr
goto END

:DI
   cls
   echo.
   echo ==== Driver install ====
   echo.
   echo µå¶óÀÌ¹öÆÄÀÏ(*.inf)ÀÌ ÀúÀåµÈ °æ·Î¸¦ ÀÔ·ÂÇÏ¼¼¿ä.
   set /p input= : 
   pnputil /add-driver "%input%\*.inf" /subdirs /install
   echo.
   echo µå¶óÀÌ¹ö ¼³Ä¡ ¿Ï·á!
   pause
goto END

:END
exit