I spend a weird amount of my week staring at Windows activation errors. I run a small shop that sells Windows and Office keys, so when something won't activate, it lands in my inbox. After a few hundred of these I noticed I always reach for the same handful of commands, so here they are, with what each one actually tells you.
Everything below needs an elevated prompt. Right click Start, pick Terminal (Admin), and go from there. If you run these as a normal user you'll get "access denied" and think something is broken.
First, a small trick: stop the popups
slmgr is just a VBScript (slmgr.vbs) and by default every command pops up a little message box. That's annoying when you want to copy the output or run a few commands in a row. Run it through cscript instead and it prints straight to the console:
cscript //nologo %windir%\system32\slmgr.vbs /dli Same commands, same output, just text you can actually copy.
slmgr /dli: what am I looking at?
This is always my first command. It shows the edition, the license channel and the last five characters of the installed key.
The line that matters most is Description. It tells you the channel:
-
RETAIL channel: a key someone bought on its own. Can usually move to a new PC. -
OEM_DM channel: the key that came with the laptop, tied to that hardware. -
VOLUME_KMSCLIENT channel: the machine expects a company KMS server. -
VOLUME_MAK channel: a volume key that activates directly with Microsoft.
Half the "mystery" activation errors I see make sense the moment you read this line. If a home PC says VOLUME_KMSCLIENT, it's going to throw KMS errors like 0x8007232B or 0xC004F074 forever, because there's no company server for it to talk to.
slmgr /dlv: the verbose version
Same as /dli plus a lot more: activation ID, installation ID, remaining rearm count, and KMS details if it's a volume machine. I mostly use it when /dli didn't explain things, or when I need the installation ID for phone activation.
slmgr /xpr: is it permanent?
One line answer. Either "The machine is permanently activated" or a date when activation runs out. If you see a date about 180 days out, that's a KMS activation, not a permanent one. Super common on used business laptops, and the reason people get the "your Windows license will expire soon" popup months after buying the machine.
slmgr /ipk <key> and slmgr /ato: swap and activate
/ipk installs a new product key (replacing the old one). /ato tells Windows to go activate right now instead of waiting.
slmgr /ipk XXXXX-XXXXX-XXXXX-XXXXX-XXXXX slmgr /ato Give it a few seconds between the two. If /ato fails, the error code it shows is the most useful piece of information you'll get, so write it down before you start googling.
slmgr /upk and slmgr /cpky: before you wipe an old PC
/upk uninstalls the product key from the current machine. I tell people to run it on their old PC before moving a retail key to a new one, so the old machine isn't still holding it.
/cpky clears the key from the registry so it can't be read back out by tools that dump product keys. Doesn't deactivate anything, just tidies up.
The PowerShell way
VBScript is being phased out of Windows, so it's worth knowing the PowerShell equivalent too. The licensing info lives in a CIM class called SoftwareLicensingProduct:
Get-CimInstance SoftwareLicensingProduct -Filter "PartialProductKey IS NOT NULL" | Select-Object Name, Description, LicenseStatus, PartialProductKey That lists Windows and any Office installs that use the same licensing service. LicenseStatus is a number:
| Value | Meaning |
|---|---|
| 0 | Unlicensed |
| 1 | Licensed |
| 2 | Initial grace period |
| 3 | Additional grace period |
| 4 | Non-genuine grace period |
| 5 | Notification mode |
| 6 | Extended grace period |
If you only care about Windows itself, filter on the Windows application ID:
Get-CimInstance SoftwareLicensingProduct -Filter "ApplicationID='55c92734-d682-4d71-983e-d6ec3f16059f' AND PartialProductKey IS NOT NULL" | Select-Object Name, Description, LicenseStatus And one more I use a lot: if the machine shipped with Windows, the original OEM key is often stored in the firmware. This reads it:
(Get-CimInstance SoftwareLicensingService).OA3xOriginalProductKey Blank output just means there's no key in the firmware, which is normal on custom builds.
My actual order of operations
When someone sends me "Windows won't activate", this is basically it:
-
/dlito see the edition and channel. Wrong edition or a volume channel explains most problems straight away. -
/xprto see if it was ever permanently activated. - Check the date, time and time zone. A wrong clock breaks the secure connection to the activation servers (hello, 0x80072F8F).
-
/ipkwith the right key for that edition, then/ato. - If
/atofails, read the error code and go from there.
Most of the time it never gets past step 1 or 2. The error messages Windows shows are pretty bad at explaining themselves, but these commands usually tell you the real story in about ten seconds.
If you've got a weird activation error you keep running into, drop it in the comments. I've probably seen it, and if I haven't I'd like to.