
Activating Windows 11 makes sure your copy of Windows is genuine and fully functional (updates, personalization settings, and some features require activation).
You can perform activation from the Settings app, but if you prefer the command line — or need to script / troubleshoot activation — Windows includes a built-in command-line tool (slmgr.vbs
) that lets you install/change a product key, activate online, query status, and run phone activation helpers.
This guide shows safe, legitimate ways to activate Windows 11 using Command Prompt (or an elevated terminal), explains the common commands, and gives troubleshooting tips.
Quick overview — what you’ll use
slmgr.vbs
(Software Licensing Management Tool) — a Visual Basic script included in Windows for licensing tasks. You typically run it throughcscript.exe
from an elevated Command Promptslui.exe 4
— opens the phone-activation dialog if you need to activate by telephone.
Important: don’t use or search for “activators”, leaked keys, or public KMS servers on the internet. Those are illegal or unsafe. Always use a legitimate product key or a valid digital license associated with your Microsoft account. If you don’t have a license, buy one from Microsoft or an authorized reseller.
Step 1 — check current activation status
Before changing anything, check your current activation status in Settings:
- Go to Start > Settings > System > Activation and read the status (e.g., Windows is activated with a digital license).
From an elevated Command Prompt (run as Administrator) you can also check with slmgr
:
cscript %windir%\system32\slmgr.vbs /xpr
cscript %windir%\system32\slmgr.vbs /dli
cscript %windir%\system32\slmgr.vbs /dlv
/xpr
reports whether the machine is permanently activated./dli
shows a short license summary./dlv
shows detailed license information (useful for troubleshooting).
Step 2 — open an elevated Command Prompt or Windows Terminal
Most slmgr
actions require admin rights:
- Press Win + X and choose Windows Terminal (Admin) or Command Prompt (Admin).
- If prompted by UAC, select Yes.
You’ll see the elevated prompt — commands below assume that context.
Step 3 — install a product key (if you have one)
If you already have a valid 25-character product key for the edition of Windows you have (Home/Pro/Enterprise), install it with:
cscript %windir%\system32\slmgr.vbs /ipk XXXXX-XXXXX-XXXXX-XXXXX-XXXXX
Replace XXXXX-...
with your real key. After the key is accepted, run:
cscript %windir%\system32\slmgr.vbs /ato
/ipk
installs the key; /ato
attempts online activation. If the key and edition match and the PC can reach Microsoft activation servers, activation should succeed.
Step 4 — activate against a corporate KMS host (only for organizations)
If your organization uses a Key Management Service (KMS) host, do not use public KMS servers from the internet. If your IT department provided a KMS host name, you can point your PC to it and activate like this:
cscript %windir%\system32\slmgr.vbs /skms kms.yourcompany.local:1688
cscript %windir%\system32\slmgr.vbs /ato
This is valid only for legitimate, internal KMS setups managed by your organization. For public/home users, you should use a retail/MAK key or a digital license.
Step 5 — phone activation (if online activation fails)
If online activation doesn’t work and you have a valid key, you can activate by phone:
- Press Win + R, type
slui 4
and press Enter. - Select your country, call the provided number, and follow the automated instructions (you’ll provide the installation ID shown on screen and receive a confirmation ID to enter). If the automated system can’t finish, it can route you to a Microsoft support agent.
Useful slmgr.vbs
commands (cheat-sheet)
cscript %windir%\system32\slmgr.vbs /ipk <product-key>
— install product key.cscript %windir%\system32\slmgr.vbs /ato
— attempt online activation.cscript %windir%\system32\slmgr.vbs /xpr
— show whether activation is permanent.cscript %windir%\system32\slmgr.vbs /dli
— short license info.cscript %windir%\system32\slmgr.vbs /dlv
— detailed license info (verbose).cscript %windir%\system32\slmgr.vbs /upk
— uninstall the product key (use carefully; requires reactivation).
Common activation problems and fixes
- Invalid product key or error code 0xC004F050 — usually means the key doesn’t match the Windows edition or is blocked/invalid. Double-check the edition (Home vs Pro vs Enterprise) and the exact key you entered. If the key was purchased from Microsoft, check your Microsoft account order history.
- Network or server errors — ensure the PC has internet access and no firewall or proxy is blocking activation traffic. Retry
/ato
after confirming connectivity. - Hardware change caused deactivation — if you replaced major hardware (motherboard) and had a digital license, sign in with the same Microsoft account and use the Activation troubleshooter in Settings to reactivate. Link your Microsoft account to the digital license ahead of time to simplify reactivation after hardware changes.
If you can’t resolve the problem, Microsoft’s activation support pages walk through error codes and next steps, and phone activation can sometimes resolve hardware/transfer issues.
Safety & legal reminder
Activating Windows with a valid product key or a digital license is legal and supported. Using cracked software, leaked keys, or unauthorized “activators” is illegal, exposes you to malware, and can lead to a blocked license and loss of support. If you don’t have a license, buy one from Microsoft or an authorized reseller, or use the unactivated Windows experience (which is limited) until you obtain a genuine license.
Short troubleshooting checklist
- Run
cscript %windir%\system32\slmgr.vbs /dlv
(check detailed status). - Confirm the product key matches your Windows edition.
- Ensure internet connectivity / no firewall blocking activation.
- Try
slui 4
for phone activation. - Contact Microsoft Support if activation still fails.
Common problems and practical fixes
1. “Key does not work” or activation error
- Make sure the key matches the Windows edition installed (Home vs Pro vs Enterprise).
- Double-check the key for typos.
- If the key is retail, ensure it hasn’t been used more times than allowed. If it’s volume (MAK/KMS), confirm the correct activation method.
2. Network or server errors when running /ato
- Verify internet connectivity.
- Ensure there’s no restrictive firewall or proxy blocking activation URLs. Temporarily disable third-party firewalls to test.
- Try again after confirming network access.
3. Hardware change/deactivation after motherboard replacement
- If you previously linked Windows to a Microsoft account (digital license), sign in with the same account and use the Activation troubleshooter (Settings → Activation) to reactivate. If not linked, phone activation or contacting Microsoft support may be necessary.
4. Corporate environment issues
- If your PC should use a company KMS, confirm the KMS host details with IT. Don’t attempt to use arbitrary public KMS servers.
5. Persistent or cryptic error codes
- Note the exact error code and message; that information helps support staff or documentation pinpoint the cause. If local troubleshooting fails, contact the licensing support channel provided by your vendor or organization.
Final tips and recommended workflow
- Always check status first (
/xpr
,/dli
,/dlv
) so you understand the starting point. - Install keys carefully — copy/paste the 25-character key when possible to avoid typos.
- Use an elevated shell for all
slmgr
commands. - Document corporate settings (KMS hostname, port, key type) or consult IT before making changes.
- Keep proof of purchase (order emails, license keys) in case you need to validate ownership.
Final words
Using the command line to activate Windows 11 is handy for power users, sysadmins, and when troubleshooting activation on multiple PCs. Stick to official Microsoft methods (slmgr.vbs
, slui
, Settings), use valid keys or digital licenses, and contact Microsoft support for stubborn errors. If you’d like, I can also draft a one-page printable checklist (with the commands) or a short PowerShell script to report activation status across several machines — tell me which you prefer.