View Activation, License, and Expiration Date Information
To display very basic license and activation information about the current system, run the following command. This command tells you the edition of Windows, part of the product key so you can identify it, and whether the system is activated.
slmgr.vbs /dliTo display more detailed license informationโincluding the activation ID, installation ID, and other detailsโrun the following command:
slmgr.vbs /dlv
View the License Expiration Date
To display the expiration date of the current license, run the following command. This is only useful for Windows system activated from an organizationโs KMS server, as retail licenses and multiple activation keys result in a perpetual license that wonโt expire. If you havenโt provided a product key at all, itโll give you an error message.
slmgr.vbs /xpr
Uninstall the Product Key
You can remove the product key from your current Windows system with Slmgr. After you run the below command and restart your computer, the Windows system wonโt have a product key and will be in an unactivated, unlicensed state.
If you installed Windows from a retail license and would like to use that license on another computer, this allows you to remove the license. It could also be useful if youโre giving that computer away to someone else. However, most Windows licenses are tied to the computer they came withโunless you purchased a boxed copy.
To remove uninstall the current product key, run the following command and then restart your computer:
slmgr.vbs /upk
Windows also stores the product key in the registry, as itโs sometimes necessary for the key to be in the registry when setting up the computer. If youโve uninstalled the product key, you should run the below command to ensure itโs removed from the registry as well. This will ensure people who use the computer in the future canโt grab the product key.
Running this command alone wonโt uninstall your product key. Itโll remove it from the registry so programs canโt access it from there, but your Windows system will remain licensed unless you run the above command to actually uninstall the product key. This option is really designed to prevent the key from being stolen by malware, if malware running on the current system gains access to the registry.
slmgr.vbs /cpky
Set or Change the Product Key
You can use slmgr.vbs to enter a new product key. If the Windows system already has a product key, using the below command will silently replace the old product key with the one you provide.
Run the following command to replace the product key, replacing #####-#####-#####-#####-##### with the product key. The command will check the product key you enter to ensure itโs valid before using it. Microsoft advises you restart the computer after running this command.
You can also change your product key from the Activation screen in the Settings app, but this command lets you do it from the command line.
slmgr.vbs /ipk #####-#####-#####-#####-#####
Activate Windows Online
To force Windows to attempt an online activation, run the following command. If youโre using a retail edition of Windows, this will force Windows to attempt online activation with Microsoftโs servers. If the system is set up to use a KMS activation server, it will instead attempt activation with the KMS server on the local network. This command can be useful if Windows didnโt activate due to a connection or server problem and you want to force it to retry.
slmgr.vbs /ato
Activate Windows Offline
Slmgr also allows you to perform an offline activation. To get an installation ID for offline activation, run the following command:
slmgr.vbs /dtiYouโll now need to get a a confirmation ID you can use to activate the system over the phone. Call the Microsoft Product Activation Center, provide the installation ID you received above, and youโll be given an activation ID if everything checks out. This allows you to activate Windows systems without Internet connections.
To enter the confirmation ID youโve received for offline activation, run the following command. Replace โACTIVATIONIDโ with the activation ID youโve received.
slmgr.vbs /atp ACTIVATIONIDOnce youโre done, you can use the slmgr.vbs /dli or slmgr.vbs /dlv commands to confirm youโre activated.
This can generally be done from the Activation screen in the Settings app if your PC isnโt activatedโyou donโt have to use the command if youโd rather use the graphical interface.














