slmgr commands that fix most activation problems

Windows has a built-in licensing diagnosis tool. These are the commands worth knowing.

CommandWhat it does
slmgr /xprShows whether Windows is permanently activated or expiring
slmgr /dliBasic license information and channel
slmgr /dlvFull licensing details
slmgr /upkUninstalls the current product key
slmgr /cpkyRemoves leftover key data from the registry
slmgr /ipk XXXXX-...Installs a product key
slmgr /rearmResets 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

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

  1. Read the current state with /dlv and save the output.
  2. Only then remove keys or rearm, since that information disappears.
  3. Reboot where required.
  4. Activate once and verify again after another restart.

More guides on this site