How to activate Windows with Command Prompt (CMD)

How to activate Windows with Command Prompt (CMD)

Updated Oct 31, 2026, 9:14 AM EDT Sign in to your XDA account Table of contents Installing Windows 11 Activating Windows 11 Manage Windows 11 updates Usually, you'd activate Windows 11 through the Settings app. But if you're managing a fleet or prefer the terminal, Command Prompt (via PowerShell) is faster. Important: Microsoft deprecated the legacy VBScript `slmgr` approach in late 2026. Using "activators" or leaked keys from third-party sites is risky; they often contain malware. Stick to official keys or your volume license server. Keep in mind that it's always best to use an official Windows product key for activation. Activation of Windows through Command Prompt and KMS servers is usually only intended for mass volume activations of multiple PCs, or fresh activation on factory reset PCs. We won't provide unlicensed activation keys in this guide, only the steps to follow if you have a legitimate activation key and server already. The new OSLicense standard for Windows 11 If you have bought a Windows license directly from Microsoft or an official reseller, and you just want to activate it using Command Prompt rather than the Settings app, you can do that relatively easily. Here's how it works. Open the Start menu, search for PowerShell, and choose Run as administrator. Retrieve your OEM key from firmware (if available): (Get-CimInstance -Query "select * from SoftwareLicensingService").OA3xOriginalProductKey Install the key using the new OSLicense module: Invoke-OSLicense -InstallProductKey -ProductKey "XXXXX-XXXXX-XXXXX-XXXXX-XXXXX" Activate online: Invoke-OSLicense -Activate If you need to wipe an old key before installing a new one, use the uninstall command first: Uninstall Key: slmgr /upk Clear License: slmgr /cpky After you follow the steps above, you should see Windows 10 or Windows 11 prompting you with a note that the product has been activated successfully. Legacy slmgr commands (Compatibility Only) The old VBScript method still works on older builds or specific enterprise configs, but it is officially deprecated. Use this mapping if you must: Task Legacy slmgr OSLicense Equivalent Install Key slmgr /ipk KEY Invoke-OSLicense -InstallProductKey Activate slmgr /ato Invoke-OSLicense -Activate Set KMS Server slmgr /skms SERVER Invoke-OSLicense -KmsServer Activate Windows license in seconds As always, we strongly recommend obtaining Windows 11 licenses from a reputable retailer rather than resorting to activation tricks. Command Prompt activations are usually only for volume licenses, so most typical users shouldn't be using this method, and it really only makes sense for certain business scenarios. If you have a regular product key for Windows, you can activate it using the Settings app. Phone Activation and Error Fixes If online activation fails, you can activate via phone. Press Windows + R, type slui 4, and follow the prompts. Common errors include: 0xC004F025: The product key is blocked. Check your volume license status. 0xC004F050: The computer's BIOS key doesn't match the installed edition. 0x803F7001: The key is invalid or not found. Double-check for typos. Once you activate Windows, check out the first things to do with your Windows PC for more useful tips. If you want to make the most out of your PC, we've also compiled some optimizations you can make to boost your productivity.

Original Source

Read the full article at Xda-developers →

KhanList aggregates and links to publicly available news content. We do not host full articles from third-party sources. Always verify important information with original sources.