slmgr Commands: The Complete Windows Activation Reference

  • Reading time:4 mins read

slmgr (Software Licensing Management Tool) is the built-in Windows command that controls everything about activation — installing keys, activating, checking status, clearing keys and troubleshooting. Every command on this page works on Windows 11, Windows 10, Windows 8.1 and Windows Server.

First: open an admin Command Prompt. Press Win, type cmd, right-click Command Prompt and choose Run as administrator. Most slmgr commands fail silently without this.

The four commands you’ll actually use

slmgr /ipk YOUR-KEY — install a product key

Applies a 25-character product key to Windows. This replaces whatever key is currently installed.

slmgr /ipk XXXXX-XXXXX-XXXXX-XXXXX-XXXXX

Include the dashes. If you get an error here, the key doesn’t match your installed edition — check Settings → System → About.

slmgr /ato — activate online

Tells Windows to contact Microsoft’s activation servers and activate with the installed key. This is the command you run right after /ipk.

slmgr /ato

slmgr /xpr — is Windows activated?

The quickest status check. Returns either a permanent activation confirmation or an expiry date.

slmgr /xpr

slmgr /dlv — detailed licence information

Shows the licence name, description, partial product key (last 5 characters), licence status and remaining rearm count. This is the command to run before opening a support ticket.

slmgr /dlv

Full command reference

  • slmgr /ipk <key> — install a product key
  • slmgr /ato — activate Windows online
  • slmgr /dli — basic licence info (short version of /dlv)
  • slmgr /dlv — detailed licence info
  • slmgr /xpr — show activation expiry / permanence
  • slmgr /upk — uninstall the current product key
  • slmgr /cpky — clear the product key from the registry
  • slmgr /rearm — reset the activation timer
  • slmgr /dti — display the installation ID (for phone activation)
  • slmgr /atp <confirmation-id> — activate with a confirmation ID
  • slmgr /skms <host> — set a KMS server (volume licensing only)
  • slmgr /ckms — clear the KMS server setting
  • slmgr /rilc — reinstall licence files
  • slmgr /ato /? — show help for any switch

Common recipes

Install a new key and activate

slmgr /ipk XXXXX-XXXXX-XXXXX-XXXXX-XXXXX
slmgr /ato

The standard two-step. Full walkthrough in our change product key via CMD guide.

Activate by phone (when online activation fails)

slmgr /dti
slmgr /atp YOUR-CONFIRMATION-ID

/dti gives you the installation ID; you exchange it for a confirmation ID and feed that back with /atp. Our Confirmation ID tool handles that exchange for you — this route works when online activation refuses.

Remove a key before selling or handing over a PC

slmgr /upk
slmgr /cpky

/upk uninstalls the key; /cpky also wipes it from the registry so it can’t be read back.

Fix “DNS name does not exist” on a Volume ISO

slmgr /ckms
slmgr /ipk XXXXX-XXXXX-XXXXX-XXXXX-XXXXX
slmgr /ato

This clears a stale KMS setting and forces Windows to use your key directly. More context in our activation error code decoder.

Notes and gotchas

  • slui vs slmgrslui 3 opens the graphical “enter a product key” box and slui 4 opens the phone-activation wizard. Useful when you prefer a dialog.
  • Windows Server — the same commands apply. See activating Windows Server by phone.
  • Office is different — Office uses ospp.vbs, not slmgr. See how to change your Office product key.
  • No output? You almost certainly aren’t running as administrator.

Need a genuine key?

Every key we sell is genuine, delivered instantly on your order confirmation page, and backed by a 7-day activation warranty. Browse Windows, Office or Windows Server — or use our Windows Edition Finder if you’re unsure which edition fits. Stuck on an activation problem? Open a support ticket.

Frequently Asked Questions

What does slmgr stand for?
Software Licensing Management Tool. It’s the built-in Windows script that manages product keys and activation from the command line.

Do I need administrator rights to run slmgr?
Yes for anything that changes state (/ipk, /ato, /upk, /rearm). Read-only checks like /xpr may work without it, but running as administrator is the reliable approach.

How do I check if Windows is activated from the command line?
Run slmgr /xpr for a quick answer, or slmgr /dlv for full licence detail including the last five characters of the installed key.

What’s the difference between slmgr /upk and /cpky?
/upk uninstalls the product key from Windows. /cpky additionally removes it from the registry so it can’t be read back off the machine.

Related Guides