Cart0

Guide · 4 min read

Slmgr Commands: The Full List with Examples

Updated

Slmgr Commands: The Full List with Examples

Short answer: The slmgr commands manage Windows licensing from the command line. Five cover most needs: install a key, activate, show the license, show the expiry and remove the key. We'd run them in Command Prompt opened as administrator, because the switches that change something need those rights.

The slmgr commands are how Windows licensing is handled without clicking through Settings. One script, a few dozen switches. We’d say most people only ever need five of them. Command Prompt, as administrator, for most of them. Same script on Windows Server.

Job Line
Install a product key slmgr /ipk followed by the key
Activate online slmgr /ato
See the license in short slmgr /dli
See whether activation is permanent slmgr /xpr
Remove the key slmgr /upk

The full list below follows Microsoft’s own reference, sorted by what you want to get done.

What slmgr is

Its full name is slmgr.vbs, short for Software License Manager. It’s a script that ships with every edition of Windows, client and server.

Microsoft’s reference, Slmgr.vbs options for obtaining volume activation information, sums up its jobs. Keys, activation, status: those are the three.

Typed alone, the script answers in pop-up windows. Start it through the console script host and the answers stay in the Command Prompt window, where you can copy them.

cscript //nologo C:\Windows\System32\slmgr.vbs /dli

How to run slmgr commands

Most switches change the system, so they need an administrator window.

  1. Press Start and type cmd.
  2. Right-click Command Prompt and choose Run as administrator.
  3. Confirm the User Account Control prompt.
  4. Type the line and press Enter.
  5. Wait for the answer; some switches take a few seconds before the window appears.
  6. After changing a key, run the short license line to check what’s installed.
  7. Close the window when you’re done.
slmgr /ipk XXXXX-XXXXX-XXXXX-XXXXX-XXXXX
slmgr /ato
slmgr /dli
Drawn Start menu with Run as administrator highlighted for Command Prompt, above four steps to run slmgr commands
Illustration: open Command Prompt as administrator, type the slmgr line, wait for the answer and check it with slmgr /dli.

A line run in a normal window fails with “Access denied”. That’s 0x80070005, and the same line works once the window is opened as administrator.

Slmgr commands for keys and activation

Switch What it does Administrator needed
/ipk key Installs a product key; a key that’s already there is replaced without a question Yes
/ato Tries online activation; with a KMS client key it tries the organisation’s server Yes for online activation
/upk Uninstalls the product key of the current edition Yes
/cpky Removes the key from the registry, so other software can’t read it Yes
/rearm Resets the activation timers; the same step runs when an image is generalized Yes

The uninstall and clear switches are what you use to move a retail key. Old PC first, then the new one. We describe the whole move in transferring a Windows license to a new PC.

Slmgr commands for status and license information

Switch What it shows Administrator needed
/dli Edition, channel, last five characters of the key, license status No
/dlv The same in detail, with activation ID, remaining rearm count and, on volume systems, KMS details No
/xpr The expiry date of the activation; retail and MAK activations show as permanent No
/dlv all Details for every license installed, beyond the active edition No

Reading these answers takes some practice. We go through each line in how to check Windows activation status.

Table comparing what slmgr /dli and slmgr /dlv show, from edition and key characters to activation ID, rearm count and KMS details
Illustration: the short slmgr /dli view next to the detailed slmgr /dlv view.

How the rearm switch really works

Rearm doesn’t activate anything. It resets the licensing timer and restarts the grace period, and Windows asks for a restart afterwards.

The count is limited. The detailed view shows how many rearms are left, on the line about the remaining rearm count.

slmgr /rearm
slmgr /dlv

We use it for test machines and images before Sysprep. On a PC you keep, a genuine key is the only lasting fix.

Offline activation with slmgr

Switch What it does
/dti Displays the installation ID for offline activation
/atp confirmation ID Activates with the confirmation ID you got from Microsoft

These two are the script side of what Windows still calls phone activation. The steps in between are in activating Windows by phone.

Slmgr commands for KMS clients

These only matter on PCs that activate through an organisation’s server.

Switch What it does
/skms name and port Names the KMS host to contact and switches automatic discovery off
/skms-domain domain Sets the DNS domain in which the KMS records are searched
/ckms Removes the manual host and restores automatic discovery
/skhc Enables KMS host caching, the default
/ckhc Disables host caching, so DNS is asked at each attempt

On a home PC the one worth knowing is the clear switch. If a tool once pointed Windows at some server, that line undoes it.

KMS host switches in slmgr

For administrators who run the activation server.

Switch What it does
/sai minutes Sets how often unactivated clients retry; the default is two hours
/sri minutes Sets how often activated clients renew; the default is 10,080 minutes, seven days
/sprt port Sets the port the host listens on; the default is TCP 1688
/sdns Enables DNS publishing by the host, the default
/cdns Disables DNS publishing
/spri Sets the KMS priority to normal, the default
/cpri Sets the KMS priority to low
/act-type number Limits volume activation to one type: 1 Active Directory, 2 KMS, 3 token, 0 any

Microsoft’s reference also lists switches for token-based and Active Directory-based activation. They’re used in large organisations and are documented on the page linked above.

Running slmgr on other computers

The script accepts a computer name, a user and a password before the switch.

slmgr.vbs PC-NAME USER PASSWORD /dli

Microsoft’s own advice for remote work is its Volume Activation Management Tool, and it warns that the script isn’t meant to work across different Windows generations.

Lines that go together

Task Sequence
Activate with a new key /ipk, /ato, /dli
Free a key before moving it /upk, /cpky
Replace a volume key on a home PC /ckms, /ipk, /ato
Activate offline /dti, then /atp
Check a KMS client /dlv, /xpr

When a line answers with an error number, the number is the next thing to look up. We keep a page for each in our list of Windows 11 activation errors, from 0xC004F050 to 0xC004F074.

Need a key to install? Ours are genuine and arrive instant to email: Windows 11 Pro and Windows 10 Pro. For the Settings route, we’d open how to activate Windows 11.

Listing every switch, and the future of the script

The script prints its own help. Run it with a question mark to page through every switch it accepts.

slmgr /?
slmgr /dlv all

The second line shows the detailed view for every license installed on the PC, not only the active one.

One thing to plan for. Microsoft is phasing out VBScript, the language this script is written in. It still ships with Windows 11 today, so the lines on this page work.

Error 0x80041008 after the November 2026 update

Microsoft confirmed that its November 2026 security updates broke some slmgr commands. They fail with 0x80041008, an invalid-parameter error, mostly in deployment scripts. PCs that were already activated stayed activated.

The fix came as an out-of-band update in mid-November. It sits in the Microsoft Update Catalog rather than in WSUS, so admins pick the package for their Windows version by hand. We’d install it before rerunning the script.

Where these lines apply

System Notes
Windows 11 and Windows 10 All switches; home users need the first two tables
Windows Server All switches; see our Windows Server 2022 activation guide
Office Office has its own script with other switches
Work devices Reading the status is fine; changing keys is IT’s job

Common mistakes with slmgr commands

  • Running the lines in a normal window.
  • Typing the uninstall switch on a PC whose key isn’t written down anywhere.
  • Using the rearm switch as if it were activation.
  • Pasting a key with a long dash where a hyphen belongs.
  • Pointing a private PC at a KMS server found online.
  • Expecting the short view to show the full key.

Terms used on this page

Term Meaning
Switch The part after the slash that tells the script what to do
Activation ID The identifier of one installed license, shown in the detailed view
Installation ID The number Windows shows for offline activation
Confirmation ID The number Microsoft returns for it
KMS Key Management Service, activation through an organisation’s own server
Rearm A reset of the activation timers

FAQ

What is slmgr?

A script that ships with Windows, with the full name slmgr.vbs. It installs and removes product keys, starts activation and shows the license status. We'd think of it as the Activation page in command form.

How do I activate Windows with slmgr?

Open Command Prompt as administrator. Install the key with the ipk switch, then run the ato switch to activate online. The dli switch shows the result. Those three lines are the usual sequence.

What is the difference between slmgr /dli and /dlv?

Both show license information. The first gives the short version: edition, channel, partial key and status. The second adds details such as the activation ID and the remaining rearm count.

What does slmgr /xpr show?

The expiry of the current activation. For retail and MAK activations it reports that the machine is permanently activated. Per Microsoft, the date matters mainly for KMS clients, which renew regularly.

Do slmgr commands need administrator rights?

The ones that change something do: installing or removing a key and online activation. The information switches run without them, according to Microsoft's reference. We'd open an administrator window anyway.

How do I remove a product key with slmgr?

Run the upk switch, then the cpky switch, in an administrator window. The first uninstalls the key, the second clears it from the registry. Write the key down before, because Windows won't show it afterwards.

Why does slmgr open pop-up windows?

By default the script runs in the windowed script host. Start it through the console script host, and the answers appear as text in the Command Prompt window. We find that easier to read and copy.