slmgr Commands Explained: Check, Install and Activate Windows Licences – LicenceHouse guide

slmgr (Software Licensing Management Tool, slmgr.vbs) is the command-line tool built into Windows for checking, installing and activating Windows licences. This reference explains the commands home users and technicians actually need, what their output means, and which commands you should leave alone on a personal PC. Every option below is taken from Microsoft's Slmgr.vbs options documentation.

Command What it does Admin needed?
slmgr /dli Shows basic licence information for the active edition No
slmgr /dlv Shows detailed licence information, including activation IDs No
slmgr /xpr Shows the activation expiry date (relevant mainly to KMS clients) No
slmgr /ipk <key> Installs or replaces the product key Yes
slmgr /ato Activates Windows online with the installed key Yes, for online activation
slmgr /upk Uninstalls the current product key Yes
slmgr /cpky Clears the product key from the registry Yes
slmgr /dti Shows the installation ID for offline (phone) activation Not stated by Microsoft
slmgr /atp <ConfirmationID> Activates with a confirmation ID from phone activation Not stated by Microsoft
slmgr /rearm Resets activation timers (for imaging and Sysprep) Yes
slmgr /skms, /ckms Sets or clears a KMS host on volume-licensed PCs Yes

What is slmgr and how do you run it?

slmgr is a Visual Basic script, slmgr.vbs, that Windows uses to manage the Software Protection Service, which stores product keys and handles activation, and you run it from Command Prompt or PowerShell by typing slmgr followed by an option, with state-changing options needing an administrator window.

  1. Select Start, type cmd, right-click Command Prompt and choose Run as administrator.
  2. Type a command such as slmgr /dli and press Enter.
  3. Read the result in the pop-up window, or use cscript slmgr.vbs /dlv all to print the output in the console instead.

Advanced nuance: Microsoft documents a remote syntax, slmgr.vbs <ComputerName> <User> <Password> <Option>, for managing another PC. For many machines, Microsoft recommends the Volume Activation Management Tool (VAMT) instead.

How do you check your Windows licence with slmgr /dli, /dlv and /xpr?

Use slmgr /dli for a short summary of the active Windows licence, slmgr /dlv for detailed information including activation IDs, and slmgr /xpr to see whether activation is permanent or expires on a date, and because none of these three commands needs administrator rights, they are safe first checks on any Windows PC.

  • /dli shows the edition name, a description that indicates the licence channel, a partial product key and the licence status.
  • /dlv adds the activation ID, installation ID, and counts and timers used by volume activation. /dlv all lists every installed licence.
  • /xpr is mainly useful for KMS clients. Microsoft notes that MAK and retail activation is perpetual, so a retail PC normally reports that it is permanently activated.

Cause and effect: a KMS client must renew with its KMS host periodically, which is why /xpr shows an expiry date on corporate volume-licensed PCs. If a home PC you bought shows a KMS expiry date, it was probably activated through a KMS tool rather than a genuine retail or OEM key.

Our guide to OEM, retail and volume licence keys explains how to read the channel shown in the description line.

How do you install and activate a product key with slmgr /ipk and /ato?

To install and activate a key, run slmgr /ipk followed by your 25-character product key in an administrator Command Prompt, wait for the confirmation, then run slmgr /ato to activate online, keeping in mind that Microsoft says /ipk silently replaces any existing key and recommends a restart afterwards to keep the licensing service stable.

  1. Open Command Prompt as administrator.
  2. Run slmgr /ipk XXXXX-XXXXX-XXXXX-XXXXX-XXXXX using the key from your order email.
  3. Wait for the message confirming the key was installed.
  4. Run slmgr /ato and wait for the activation result.
  5. Restart the PC, then confirm with slmgr /dli or Settings > System > Activation.

Advanced nuance: /ipk validates the key against the installed edition before accepting it. A Pro key entered on Home is therefore handled as an edition change, which Microsoft documents as a supported command-line upgrade method; the Settings route in our Windows 10 Home to Pro upgrade guide is easier for most users.

What we commonly see: /ato fails with 0xC004F050 when the key belongs to another edition or product, or with 0xC004C008 when the key has reached its activation limit. Our 0xC004C008 troubleshooting guide explains the second case.

Activate Windows with slmgr – LicenceHouse

How do you remove a product key with slmgr /upk and /cpky?

To remove a product key, run slmgr /upk in an administrator Command Prompt to uninstall the key from Windows, then run slmgr /cpky to clear it from the registry, but only when retiring or reassigning a licence, because Microsoft states that after a restart the system is unlicensed until a new key is installed.

The usual reason is moving a retail licence to another computer. Our guide to transferring a Windows licence to a new PC covers the full process, including when removal is optional.

Advanced nuance: /cpky only clears the stored copy of the key so that malicious software cannot read it. Microsoft recommends it for retail installations that deploy keys and notes that MAK and KMS host keys are already cleared by default.

How do you activate Windows by phone with slmgr /dti and /atp?

For phone or offline activation, run slmgr /dti to display the installation ID, give that ID to Microsoft's automated phone system, then enter the confirmation ID you receive with slmgr /atp, a route that helps when online activation fails because the PC has no internet access or a firewall blocks the activation servers.

  1. Run slmgr /dti and note the installation ID.
  2. Call the Microsoft activation number shown for your country, or type SLUI 04 in the taskbar search, which Microsoft lists as the way to start phone activation.
  3. Enter the installation ID when asked and write down the confirmation ID.
  4. Run slmgr /atp <ConfirmationID>, then check the result with slmgr /dli.

For Office rather than Windows, see our guide to activating Microsoft Office by phone.

When should you not use slmgr /rearm or /skms?

You should not use slmgr /rearm or slmgr /skms on a personal PC with a retail or OEM licence, because /rearm only resets activation timers for system imaging and /skms points Windows to a corporate KMS host, so neither command activates a home PC, and an unknown KMS server address is a common sign of piracy tools.

  • /rearm is called by sysprep /generalize when IT teams prepare a master image. It does not extend a trial into a licence.
  • /skms and /ckms set or clear the KMS host address on volume-licensed PCs that use an organisation's own KMS server.
  • KMS activators abuse /skms to redirect activation to unauthorised servers. Our article on pre-activated Windows ISOs explains the security risks.

What we commonly see: a second-hand PC shows a KMS host in /dlv output and stops activating some months later. The fix is slmgr /ckms to clear the host, then slmgr /ipk and slmgr /ato with a genuine key.

Frequently asked questions

Do I need administrator rights to run slmgr?

Not for every command. Microsoft states that /dli, /dlv and /xpr do not need elevation, so any user can check licence status. Commands that change the licence, such as /ipk, /upk, /cpky, /rearm and /skms, need an administrator Command Prompt, and online activation with /ato also needs elevation in most configurations.

Why does slmgr /dli show only part of my product key?

slmgr /dli shows only a partial product key, which is enough to match it against the key in your order email without exposing the full key to anyone looking at the screen. Keep your purchase email somewhere safe, because you may need the complete key to reinstall later.

Does slmgr work for Microsoft Office?

No, slmgr manages Windows licences. Office volume and retail licences use a separate script, ospp.vbs, found in the Office installation folder, or the Account page inside any Office app. Our guide on checking whether Office is activated explains the ospp.vbs commands and how to read their output.

Does slmgr work on Windows Server?

Yes, slmgr.vbs is built into Windows Server as well as Windows 10 and 11, and Microsoft's Slmgr.vbs options page is published in the Windows Server documentation. The same /dli, /ipk and /ato commands apply. Server editions also use the KMS host and Active Directory-based activation options, which are meant for administrators.

Is slmgr /rearm a way to activate Windows for free?

No, slmgr /rearm only resets activation timers and is intended for IT teams preparing system images with Sysprep. It does not license Windows, and Microsoft does not document it as a way to extend use indefinitely. A genuine product key is still required to activate Windows legally.

Related guides

Command line, Licensing, Slmgr, Troubleshooting, Windows activation