@echo off chcp 65001 >nul setlocal EnableDelayedExpansion :: ----------------------------------------------------------------------- :: Auto-elevate to Administrator if not already elevated :: ----------------------------------------------------------------------- net session >nul 2>&1 if %errorlevel% neq 0 ( echo Requesting administrator privileges... powershell -NoProfile -Command "Start-Process -FilePath '%~f0' -Verb RunAs" exit /b ) :: ----------------------------------------------------------------------- :: Paths :: ----------------------------------------------------------------------- set "SCRIPT_DIR=%~dp0" set "DEPLOY_PS1=%SCRIPT_DIR%Deploy-Windows.ps1" set "CONFIG_JSON=%SCRIPT_DIR%config\config.json" set "CONFIG_EDITOR=%SCRIPT_DIR%config-editor.hta" set "LOG_FILE=C:\Windows\Setup\Scripts\Deploy.log" :MENU cls echo. echo ================================================ echo X9 - Windows Deployment echo ================================================ echo. echo Config : %CONFIG_JSON% echo Log : %LOG_FILE% echo. echo [1] Full deployment (uses config.json) echo [2] Dry run (no changes, log only) echo [3] Skip bloatware removal echo [4] Skip software install echo [5] Open config editor (config-editor.hta) echo [0] Exit echo. set /p CHOICE=" Select [0-5]: " if "%CHOICE%"=="0" goto EXIT if "%CHOICE%"=="1" goto FULL if "%CHOICE%"=="2" goto DRYRUN if "%CHOICE%"=="3" goto SKIP_BLOATWARE if "%CHOICE%"=="4" goto SKIP_SOFTWARE if "%CHOICE%"=="5" goto OPEN_EDITOR echo Invalid choice. Try again. timeout /t 2 >nul goto MENU :: ----------------------------------------------------------------------- :: [1] Full deployment :: ----------------------------------------------------------------------- :FULL cls echo. echo Starting full deployment... echo. powershell -NoProfile -ExecutionPolicy Bypass -File "%DEPLOY_PS1%" goto DONE :: ----------------------------------------------------------------------- :: [2] Dry run :: ----------------------------------------------------------------------- :DRYRUN cls echo. echo Starting dry run (no changes will be made)... echo. powershell -NoProfile -ExecutionPolicy Bypass -File "%DEPLOY_PS1%" -DryRun goto DONE :: ----------------------------------------------------------------------- :: [3] Skip bloatware :: ----------------------------------------------------------------------- :SKIP_BLOATWARE cls echo. echo Starting deployment (bloatware removal skipped)... echo. powershell -NoProfile -ExecutionPolicy Bypass -File "%DEPLOY_PS1%" -SkipBloatware goto DONE :: ----------------------------------------------------------------------- :: [4] Skip software :: ----------------------------------------------------------------------- :SKIP_SOFTWARE cls echo. echo Starting deployment (software install skipped)... echo. powershell -NoProfile -ExecutionPolicy Bypass -File "%DEPLOY_PS1%" -SkipSoftware goto DONE :: ----------------------------------------------------------------------- :: [5] Config editor :: ----------------------------------------------------------------------- :OPEN_EDITOR if not exist "%CONFIG_EDITOR%" ( echo ERROR: config-editor.hta not found: %CONFIG_EDITOR% pause goto MENU ) start "" mshta.exe "%CONFIG_EDITOR%" goto MENU :: ----------------------------------------------------------------------- :: Done :: ----------------------------------------------------------------------- :DONE echo. echo ================================================ echo Deployment finished. echo Log: %LOG_FILE% echo ================================================ echo. pause goto MENU :EXIT endlocal exit /b 0