Home > Windows, Windows 7, Windows Server 2008 R2 > Activate Windows Vista, Windows Server 2008R2, and Windows 7 From the Command Line

Activate Windows Vista, Windows Server 2008R2, and Windows 7 From the Command Line

Beginning with Windows Vista, Microsoft introduced a powerful command line tool to handle Windows activations. This tool is called ‘slmgr‘. Slmgr works under Windows Vista, Windows 7, and Windows Server 2008 R2. The most common options you may need to use are ‘/ipk‘ which installs a product key, and ‘/ato‘ which tells Windows to try and connect to Microsoft’s servers and activate. This tool can also be used to manage remote clients. I have included below some more advanced parameters and examples.

NOTE: All actions (other than displaying status) require elevated administrator privileges. Slmgr.vbs script is not intended to work across platforms i.e. between Vista and Windows 7

slmgr [MachineName [Username Password]] [Option]

machinename   The machine to administer, by default the current local machine.

username      An administrator equivalent user account for the remote computer.

password      The password for the user account on the remote computer.

/ato   Activate Windows license and product key against Microsoft’s server.

/atp Confirmation_ID   Activate Windows with user-provided Confirmation ID

/ckms  Clear the name of KMS server used to default and port to default.

/cpky  Clear product key from the registry (prevents disclosure attacks)

/dli   Display the current license information with activation
status and partial product key.

/dlv   Verbose, similar to -dli but with more information.

/dti   Display Installation ID for offline activation

/ipk Key  Enter a new product key supplied as xxxxx-xxxxx-xxxxx-xxxxx-xxxxx

/ilc License_file   Install license

/rilc               Re-install system license files

/rearm Reset the evaluation period/licensing status and activation state of the machine

/skms activationservername:port
Set the Volume Licensing KMS server and/or the port used for KMS activation
(where supported by your Windows edition)

/skhc  Enable KMS host caching (default), this blocks the use of DNS priority and
weight after the initial discovery of a working KMS host.
If the system can no longer contact the working KMS host, discovery will be attempted again.

/ckhc  Disable KMS host caching. This setting instructs the client to use DNS auto-discovery
each time it attempts KMS activation (recommended when using priority and weight)

/sai interval
Sets the interval in minutes for unactivated clients to attempt KMS connection.
The activation interval must be between 15 minutes and 30 days, although the default (2 hours)
is recommended.
The KMS client initially picks up this interval from the registry but switches to the KMS
setting after the first KMS response has been received.

/sri interval
Sets the renewal interval in minutes for activated clients to attempt KMS connection.
The renewal interval must be between 15 minutes and 30 days.
This option is set initially on both the KMS server and client sides.
The default is 10080 minutes (7 days).

/spri  Set the KMS priority to normal (default).
/cpri  Set the KMS priority to low.
Use this option to minimize contention from KMS in a co-hosted environment.
Note that this could lead to KMS starvation, depending on what other applications
or server roles are active. Use with care.

/sprt port
Sets the port on which the KMS host listens for client activation requests. The default TCP port is 1688.

/sdns  Enable DNS publishing by the KMS host (default).
/cdns  Disable DNS publishing by the KMS host.

/upk   Uninstall current installed product key and return license status back to trial state.

/xpr   Show the expiry date of current license (if not permanently activated)

Token-based activation:
/lil   List the installed token-based activation issuance licenses.

Remove an installed token-based activation issuance license.

/stao  Set the Token-based Activation Only flag, disabling automatic KMS activation.
/ctao  Clear the Token-based Activation Only flag (default), enabling automatic KMS activation.
/ltc   List valid token-based activation certificates that can activate installed software.
/fta Certificate Thumbprint [PIN]
Force token-based activation using the identified certificate.
The optional personal identification number (PIN) is provided to unlock the private
key without a PIN prompt when using certificates that are protected by hardware
(for example, smart cards).

C:\> cscript C:\windows\system32\slmgr.vbs wkstn64 administrator pa55w0rd1 -dli
C:\> cscript slmgr.vbs -skms
C:\> cscript slmgr.vbs -skms KMSServer:8090

  1. January 17, 2014 at 7:50 AM

    Unquestionably believe that which you said. Your favorite reason seemed to be on the internet the simplest thing to be aware of.
    I say to you, I definitely get irked while people
    think about worries that they plainly do not know about.
    You managed to hit the nail upon the top as well as defined out
    the whole thing without having side effect , people can take a signal.
    Will probably be back to get more. Thanks

  2. Pat
    June 4, 2014 at 6:28 PM

    Amazing blog! Do you have any tips and hints for aspiring writers?
    I’m planning to start my own blog soon but I’m a little lost on everything.
    Would you recommend starting with a free platform like WordPress or go for a paid
    option? There are so many choices out there that I’m completely
    overwhelmed .. Any tips? Many thanks!

  3. June 4, 2014 at 11:26 PM

    Superb,what a webpage it is! This blog provides helpful data to us, keep it up.

  4. February 9, 2016 at 1:31 PM

    Außerordentlich toller Artikel. Wie kann ich den Verfasser kontaktieren?

  1. No trackbacks yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: