slmgr commands that fix most activation problems
Windows has a built-in licensing diagnosis tool. These are the commands worth knowing.
| Command | What it does |
|---|---|
slmgr /xpr | Shows whether Windows is permanently activated or expiring |
slmgr /dli | Basic license information and channel |
slmgr /dlv | Full licensing details |
slmgr /upk | Uninstalls the current product key |
slmgr /cpky | Removes leftover key data from the registry |
slmgr /ipk XXXXX-... | Installs a product key |
slmgr /rearm | Resets licensing state; requires reboot |
The standard recovery sequence
When a previous activation attempt or system tweak leaves Windows in a strange state, run /upk, then /cpky, then /rearm, and reboot. Activate fresh afterwards instead of stacking keys on top of each other.
Run everything from an elevated command prompt; otherwise slmgr fails silently and you assume the command does nothing.
Typical scenarios and the command that solves them
- Old company KMS configured — inspect with
/dlv, clear the key using/upkand/cpky, then activate again. - Unknown if activation is permanent — run
/xpr; it answers without changing anything. - Trial ended unexpectedly —
/rearmresets the grace period but is not a licence. Activate properly afterwards. - Edition mismatch — slmgr cannot turn Home into Pro. Check the channel first instead of repeating rearm attempts.
Pair it with Office diagnostics
Office has its own script, OSPP.VBS, in the Office16 folder. Windows slmgr errors and Office licensing errors look similar but come from different stores; check the right one. A Word unlicensed banner is not solved by reactivating Windows, and the reverse is also true.
Safe order of operations
- Read the current state with
/dlvand save the output. - Only then remove keys or rearm, since that information disappears.
- Reboot where required.
- Activate once and verify again after another restart.
More guides on this site
slmgr Commands Every Windows User Should KnowThe useful slmgr.vbs commands: check activation, remove keys, rearm licensing, view licensWindows 11 Home Activation: Why KMS Needs the Right EditionWindows 11 Home uses retail licensing. Learn why volume KMS does not apply directly and whWindows Asks for Activation Again After an UpdateIf Windows loses activation after a feature update, diagnose the edition change, broken reActivate Windows Without a Product Key (Legit Options and KMS)Ways to use and activate Windows without buying a key: unactivated use, evaluation edition