Windows 11 Activation CMD: Safe Command-Line Methods
Adam Smart
8 minute read
By Adam Smart, Ecokeys Support Engineer — Last updated 26 July 2026
The quickest safe method: open Command Prompt as an administrator, install a valid Windows 11 product key with slmgr.vbs /ipk, then request online activation with slmgr.vbs /ato.
This guide explains the legitimate Windows licensing commands built into Windows 11. It does not use activator scripts, unofficial KMS servers, product-key generators or methods designed to bypass Microsoft licensing.
Before You Activate Windows 11 Using CMD
Command Prompt can install a valid product key, request activation and display licensing information. It cannot make an invalid, blocked, reused or edition-mismatched key valid.
Before continuing, confirm that you have:
- A valid 25-character Windows product key in the format
XXXXX-XXXXX-XXXXX-XXXXX-XXXXX. - The correct Windows edition installed. A Windows 11 Pro key will not directly activate Windows 11 Home unless the edition is upgraded.
- Administrator access to the PC.
- A working internet connection for normal online activation.
Prefer the normal Settings method? Open Settings > System > Activation > Change product key. CMD is most useful when you want to check detailed licence information or the Settings screen is not completing activation.
How to Open Command Prompt as Administrator
- Press Windows key + S.
- Type Command Prompt or cmd.
- Right-click Command Prompt.
- Select Run as administrator.
- Select Yes when the User Account Control prompt appears.
The title bar should show Administrator: Command Prompt.
Check the Current Windows 11 Activation Status
Before changing anything, check whether Windows is already permanently activated:
slmgr.vbs /xprA small Windows Script Host window will display the activation state. A retail licence that is fully activated normally reports that the machine is permanently activated.
For a brief licensing summary, use:
slmgr.vbs /dliFor more detailed licensing information, use:
slmgr.vbs /dlvThe detailed view can help identify the installed edition, licence channel, partial product-key characters and current licence status.
Do not post a screenshot containing licence information publicly. Even though Windows normally masks most of the key, licensing screens can still reveal device or activation details that are better kept private.
Install a Valid Windows 11 Product Key Using CMD
To install or replace the product key, enter:
slmgr.vbs /ipk XXXXX-XXXXX-XXXXX-XXXXX-XXXXXReplace the placeholder characters with your own valid Windows 11 key. Do not include angle brackets.
For example, the command structure is:
slmgr.vbs /ipk YOUR-VALID-25-CHARACTER-KEYIf the product key is valid for the installed edition, Windows should report that it was installed successfully. If a different key was already present, this command replaces it.
Activate Windows 11 Online Using CMD
After installing the product key, request online activation:
slmgr.vbs /atoWindows will contact the appropriate activation service and attempt to activate the installed edition.
After the command completes, check the result again:
slmgr.vbs /xprComplete CMD Activation Sequence
For a straightforward retail-key activation, the normal sequence is:
slmgr.vbs /ipk XXXXX-XXXXX-XXXXX-XXXXX-XXXXX
slmgr.vbs /ato
slmgr.vbs /xprRun each line separately in an elevated Command Prompt. Never publish or send a screenshot showing your full product key.
Useful Windows 11 Activation Diagnostic Commands
Display brief licence information
slmgr.vbs /dliShows a short summary of the active Windows licence.
Display detailed licence information
slmgr.vbs /dlvShows more detailed activation and licensing information.
Check activation expiry
slmgr.vbs /xprShows whether activation is permanent or has an expiry date.
Install or replace a product key
slmgr.vbs /ipk XXXXX-XXXXX-XXXXX-XXXXX-XXXXXInstalls a valid product key that matches the installed edition.
Request online activation
slmgr.vbs /atoPrompts Windows to attempt activation using the installed key or configured licence method.
Removing an Installed Product Key
Only remove a product key when there is a clear reason, such as preparing to transfer an eligible retail licence or replacing an incorrectly installed key.
To uninstall the key from the current Windows edition:
slmgr.vbs /upkAfter a restart, Windows may show as unlicensed until a valid key is installed and activated.
To remove the stored key from the registry after uninstalling it, Microsoft also documents:
slmgr.vbs /cpkyDo not use these removal commands as a routine troubleshooting step. They can leave Windows unactivated. Record the licence details and confirm that you are entitled to reinstall or transfer the key before removing it.
Can CMD Activate Windows 11 Home to Pro?
A Pro product key can be entered through CMD, but an edition upgrade is usually clearer and safer through Windows Settings:
- Open Settings > System > Activation.
- Expand Upgrade your edition of Windows.
- Select Change beside Change product key.
- Enter the valid Windows 11 Pro key.
- Follow the prompts and restart the PC when requested.
Files and installed applications should remain in place during a normal Home-to-Pro edition upgrade, but keep a current backup before changing Windows.
Windows 11 Activation CMD Not Working
If slmgr.vbs /ato returns an error, use the following checks before repeating commands.
1. Confirm the installed edition
Open Settings > System > About and check the Windows edition. A Home key must match Home, and a Pro key must match Pro unless you are completing an edition upgrade.
2. Check the key for typing errors
Product keys contain five groups of five characters. Copy and paste the key carefully, without extra spaces before or after it.
3. Check internet, date and time
Online activation can fail when the PC cannot reach Microsoft’s activation service or the system date and time are incorrect.
4. Restart the PC
After installing a new key, restart Windows and run:
slmgr.vbs /ato5. Run the Activation troubleshooter
Open Settings > System > Activation and select Troubleshoot when that option appears.
6. Check for a hardware-change issue
A major hardware change, especially a motherboard replacement, can prevent Windows from matching the existing digital licence to the device. Sign in with the Microsoft account previously linked to the licence and use the Activation troubleshooter where eligible.
7. Read the exact error code
The error code is more useful than repeatedly uninstalling keys or resetting licensing components. Common causes include an edition mismatch, an invalid or blocked key, a reused volume key, network problems or a licence that is already associated with different hardware.
For a wider diagnosis, see our Windows product key not working guide.
Commands We Do Not Recommend as General Fixes
slmgr.vbs /rearm
This command resets activation timers in specific deployment and licensing scenarios. It does not turn an invalid key into a valid licence, and it should not be promoted as a way to extend unlicensed Windows use.
Activation batch files from the internet
Do not run unknown .bat, PowerShell or registry scripts claiming to activate Windows for free. They may change licensing settings, connect the PC to unauthorised servers, disable security controls or install malicious software.
Unofficial KMS servers
KMS is a legitimate volume-activation technology for properly licensed organisations. Public or third-party KMS servers are not a legitimate substitute for a valid personal or retail licence.
Safe rule: use only your own valid product key, the activation method supplied by your organisation, or Microsoft’s built-in Activation settings and licensing commands.
Does CMD Prove That Windows Is Genuine?
CMD can report activation and licensing status, but activation is not the same as independently proving the origin or authenticity of a licence. It confirms that Windows accepted the installed key or digital entitlement for that hardware and edition.
Windows 11 Activation CMD: Final Steps
For a legitimate retail-key activation, use this sequence:
- Confirm that the installed Windows edition matches the key.
- Open Command Prompt as administrator.
- Run
slmgr.vbs /ipkwith your valid product key. - Run
slmgr.vbs /ato. - Run
slmgr.vbs /xprto confirm the activation state.
When CMD reports an error, diagnose the edition, key and error code rather than downloading an activation script.
Need Windows 11 Pro?
View the retail licence for one compatible PC, including download and activation guidance.
View Windows 11 ProCompare Windows editions
Review Windows 11 Home, Pro and other available Microsoft Windows licences.
View Windows product keysFrequently Asked Questions
What CMD command activates Windows 11?
Use slmgr.vbs /ipk YOUR-PRODUCT-KEY to install a valid key, followed by slmgr.vbs /ato to request online activation. Then use slmgr.vbs /xpr to check the result.
How do I check Windows 11 activation using CMD?
Run slmgr.vbs /xpr to check whether activation is permanent or has an expiry date. Use slmgr.vbs /dli for a brief summary or slmgr.vbs /dlv for detailed licensing information.
Can CMD activate Windows 11 without a product key?
No legitimate command can create a valid licence. Windows requires an appropriate digital licence, product key or authorised organisational activation method.
Why does the Windows 11 activation command fail?
Common causes include the wrong Windows edition, an invalid or blocked key, a typing error, no internet connection, incorrect date and time, an activation-server problem or a significant hardware change.
Is it safe to use a Windows 11 activation batch file?
Do not run unknown activation batch files. A legitimate administrator may create a simple internal deployment script using valid organisation-owned keys, but public “free activation” scripts can be unauthorised and unsafe.
What does slmgr /ato do?
It prompts Windows to attempt activation using the currently installed product key or configured licence method. It does not supply a licence or fix an invalid key.
What does slmgr /upk do?
It uninstalls the product key from the current Windows edition. After a restart, Windows can become unlicensed until another valid key is installed and activated.
Can I activate Windows 11 Pro while Home is installed?
A valid Pro key can be used to upgrade an activated Home installation to Pro. The recommended route is Settings > System > Activation > Upgrade your edition of Windows > Change product key.