@echo off

reg QUERY "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion" /v "EditionID" > %TEMP%\Edition.txt

findstr /i "Starter" "%TEMP%\Edition.txt" && cscript %windir%\system32\slmgr.vbs -ipk RDJXR-3M32B-FJT32-QMPGB-GCFF6
findstr /i "homeBasic" "%TEMP%\Edition.txt" && cscript %windir%\system32\slmgr.vbs -ipk MB4HF-2Q8V3-W88WR-K7287-2H4CP
findstr /i "HomePremium" "%TEMP%\Edition.txt" && cscript %windir%\system32\slmgr.vbs -ipk VQB3X-Q3KP8-WJ2H8-R6B6D-7QJB7
findstr /i "Professional" "%TEMP%\Edition.txt" && cscript %windir%\system32\slmgr.vbs -ipk YKHFT-KW986-GK4PY-FDWYH-7TP9F
findstr /i "Ultimate" "%TEMP%\Edition.txt" && cscript %windir%\system32\slmgr.vbs -ipk FJGCP-4DFJD-GJY49-VJBQ7-HYRR2

cscript //nologo %windir%\system32\slmgr.vbs -ilc %windir%\Setup\scripts\OemFiles\Gigabyte.xrm-ms >nul

REGEDIT /S %windir%\Setup\scripts\OemFiles\GIGABYTE.reg >nul

::for all_oem's cmd::

MD %windir%\System32\oem >nul
COPY /Y %windir%\Setup\scripts\OemFiles\*.xrm-ms %windir%\System32\oem >nul
COPY /Y %windir%\Setup\scripts\OemFiles\*.theme %windir%\Resources\Themes >nul

IF EXIST %windir%\Setup\scripts\OemFiles\Wallpaper.jpg (
   MOVE /Y %windir%\Setup\scripts\OemFiles\Wallpaper.jpg %windir%\Web\Wallpaper >nul
)
IF EXIST %windir%\Setup\scripts\OemFiles\Wallpaper (
   XCOPY /E /Y %windir%\Setup\scripts\OemFiles\Wallpaper %windir%\Web\Wallpaper >nul
)
IF EXIST %windir%\system32\oobe\info\USER.bmp (
   Attrib -h %systemdrive%\ProgramData >nul
   DEL /F /Q "%systemdrive%\ProgramData\Microsoft\User Account Pictures\user.bmp" >nul
   COPY /Y %windir%\system32\oobe\info\USER.bmp "%systemdrive%\ProgramData\Microsoft\User Account Pictures\user.bmp" >nul
   Attrib +h %systemdrive%\ProgramData >nul
)

:CLEANUP
RD /Q /S %windir%\Setup\scripts\OemFiles >nul
RD /Q /S %windir%\Setup\scripts >nul
DEL /F /Q %0% >nul