@echo off :: Check for administrator privileges net session >nul 2>&1 if %errorlevel% neq 0 ( echo Requesting administrator privileges... powershell -Command "Start-Process '%~f0' -Verb RunAs" exit /b ) echo Administrator privileges granted. Starting Windows activation... powershell -NoProfile -ExecutionPolicy Bypass -Command ^ "Clear-Host; ^ $osInfo = Get-CimInstance Win32_OperatingSystem; ^ $osName = $osInfo.Caption; ^ Write-Host '==================================================' -ForegroundColor Gray; ^ Write-Host \"Current OS: $osName ($($osInfo.OSArchitecture))\" -ForegroundColor Cyan; ^ Write-Host '==================================================' -ForegroundColor Gray; ^ Write-Host ''; ^ $key = $null; ^ if ($osName -like '*Windows 10*' -or $osName -like '*Windows 11*') { ^ if ($osName -like '*Pro*') { $key = 'W269N-WFGWX-YVC9B-4J6C9-T83GX' } ^ } elseif ($osName -like '*Server*') { ^ if ($osName -like '*2016*') { $key = 'WC2BQ-8NRM3-FDDYY-2BFGV-KHKQY' } ^ elseif ($osName -like '*2019*') { $key = 'N69G4-B89J2-4G8F4-WWYCC-J464C' } ^ elseif ($osName -like '*2022*') { $key = 'VDYBN-27WPP-V4HQT-9VMD4-VMK7H' } ^ elseif ($osName -like '*2025*') { $key = 'TVRH6-WHNXV-R9WG3-9XRFY-MY832' } ^ }; ^ if ($null -eq $key) { ^ Write-Host 'Could not automatically determine the KMS key for this OS version.' -ForegroundColor Yellow; ^ $choice = Read-Host 'Please enter the key manually or press Enter to exit'; ^ if ([string]::IsNullOrWhiteSpace($choice)) { exit } else { $key = $choice.Trim() } ^ } else { ^ Write-Host \"Detected OS matches automated KMS key. Using key: $key\" -ForegroundColor Yellow; ^ }; ^ Write-Host 'Installing product key...' -ForegroundColor Green; ^ cscript //nologo %windir%\system32\slmgr.vbs -ipk $key; ^ Write-Host 'Waiting 5 seconds...' -ForegroundColor Magenta; ^ Start-Sleep -Seconds 5; ^ Write-Host 'Setting KMS host kms.helpdesk38.ru...' -ForegroundColor Green; ^ cscript //nologo %windir%\system32\slmgr.vbs -skms kms.helpdesk38.ru; ^ Write-Host 'Waiting 5 seconds...' -ForegroundColor Magenta; ^ Start-Sleep -Seconds 5; ^ Write-Host 'Activating Windows...' -ForegroundColor Green; ^ cscript //nologo %windir%\system32\slmgr.vbs -ato; ^ Write-Host 'Done.' -ForegroundColor Cyan; ^ Read-Host 'Press Enter to exit'" pause