This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@echo off | |
:: Source: https://medium.com/wireless-bidet/how-to-activate-windows-10-using-command-prompt-9c5d248f3420 | |
:: The Win10Lite Team condemns piracy in all forms. Only run this script if you know what it does. | |
:: BatchGotAdmin below | |
:————————————- | |
title Administrator rights required | |
IF «%PROCESSOR_ARCHITECTURE%« EQU «amd64« ( | |
>nul 2>&1 «%SYSTEMROOT%\SysWOW64\cacls.exe« «%SYSTEMROOT%\SysWOW64\config\system« | |
) ELSE ( | |
>nul 2>&1 «%SYSTEMROOT%\system32\cacls.exe« «%SYSTEMROOT%\system32\config\system« | |
) | |
if ‘%errorlevel%‘ NEQ ‘0’ ( | |
goto UACPrompt | |
) else ( goto gotAdmin ) | |
:UACPrompt | |
echo Set UAC = CreateObject^(«Shell.Application«^) > «%temp%\getadmin.vbs« | |
set params= %* | |
echo UAC.ShellExecute «cmd.exe«, «/c ««%~s0«« %params:«=«»%«, ««, «runas«, 1 >> «%temp%\getadmin.vbs« | |
«%temp%\getadmin.vbs« | |
del «%temp%\getadmin.vbs« | |
exit /B | |
:gotAdmin | |
pushd «%CD%« | |
CD /D «%~dp0« | |
:————————————— | |
title Win10Lite Activation Service | |
echo Source: https://medium.com/wireless-bidet/how-to-activate-windows-10-using-command-prompt-9c5d248f3420 | |
echo The Win10Lite Team condemns piracy in all forms. Only run this script if you know what it does. | |
echo Please close all applications before running the script. | |
timeout /t 10 /nobreak | |
slmgr /ipk TX9XD-98N7V-6WMQ6-BX7FG-H8Q99 | |
slmgr /skms kms8.msguides.com | |
slmgr /ato | |
cls | |
echo Restarting now… | |
shutdown /r /t 0 |
Общие сведения
SLMGR – это сценарий VBS для управления лицензированием программного обеспечения Windows, а команда, запускаемая через консоль, предназначена для локального или удаленного компьютера. Сам сценарий хранится по следующему адресу: %SystemRoot\system32\slmgr\
в файле «slmgr.ini».
С помощью данного средства управления можно вводить и удалять лицензионные ключи, активировать систему, сбросить счетчик активации и выполнять другие действия, которые связаны с лицензированием.
Синтаксис команды slmgr
довольно обширный – существует огромное количество комбинаций, которые могут потребоваться в той или иной ситуации. Разберем наиболее часто используемые:
slmgr /xpr
– команда предназначена для просмотра активации Windows 10, в том числе и даты окончания лицензии, если используется не постоянная;slmgr /dli
– просмотр текущей информации о лицензии продукта;slmgr /dlv
– данный запрос позволяет узнать намного больше информации о лицензии, чем предыдущие две: номер версии, идентификатор активации, расширенный идентификатор PID и другие параметры;slmgr /rearm
– сброс таймеров активации, который позволяет повторно активировать Windows 10, например после истечения 30-дневного пробного периода;slmgr /cpky
– удаление ключа из системного реестра операционки, то есть выполнение данной команды не деактивирует Windows, а не позволит получить ключ программам для поиска ключей и различным вредоносным утилитам;slmgr /ato
– активация онлайн, которая сможет пригодиться, если со стандартной активацией возникли проблемы;slmgr /ipk 12345-12345-12345-12345-12345
– изменение ключа путем ввода реальной комбинации после запроса «ipk», но важно, чтобы она прописывалась через тире, а после нужна перезагрузка компьютера;slmgr /upk
– удаление ключа продукта, то есть деактивация лицензии – новые параметры вступят в силу после перезапуска Windows (отобразится соответствующее уведомление об успешном удалении).
Существуют и другие параметры, предназначенные для корпоративного лицензирования (активация на основе токенов), управления лицензированием для определенных приложений, установленных на компьютер, но они чаще всего используются опытными пользователями. На официальном сайте Microsoft об этом есть более детальная информация, а мы разберем активацию Windows 10 с применением средства SLMGR ниже.
Применение на практике
Чтобы применить активацию SLMGR, потребуется использовать встроенную консоль – «Командную строку». Для просмотра сведений и различной информации о лицензии достаточно запустить ее в обычном режиме. В случае если придется вносить различные изменения на системном уровне, в том числе при выполнении активации продукта, открывать «Командную строку» нужно с расширенными правами.
- Запустите консоль от имени администратора. В этом может помочь строка системного поиска – введите соответствующий запрос, затем выберите соответствующий запуск.
Также у нас на сайте есть дополнительные методы запуска консоли с расширенными правами.
Подробнее: Открытие командной строки в Windows 10
- Для активации продукта сначала введите команду
slmgr.vbs /ipk XXXXX-XXXXX-XXXXX-XXXXX-XXXXX
, где под символами «X» подразумевается ключ продукта. Чтобы ее выполнить, нажмите клавишу «Enter». Эти действия установят ключ в операционную систему. - Далее потребуется выполнить еще одну команду, которая непосредственно активирует систему, —
slmgr.vbs /ato
. По итогу должно появиться системное окно с информацией о выполнении операции. - После этого перезагрузите компьютер, чтобы настройки были применены. Также в этом случае можно использовать еще одну команду —
slmgr.vbs /dli
в «Командной строке». Она позволит узнать базовую информацию о лицензии.
При необходимости можете использовать и другие параметры, чтобы посмотреть текущее состояния активации продукта. Например,
slmgr.vbs /dlv
– для отображения более подробных сведений.
Наша группа в TelegramПолезные советы и помощь
What to Know
- Open Command Prompt and enter the desired slmgr command.
- Check activation status: slmgr /xpr. View license info: slmgr /dlv. Reset timers: slmgr /rearm.
- Several other slmgr commands also exist. Use a similar format for those.
This article explains how to enter slmgr commands in Windows to turn on advanced Windows activation tasks.
Where to Enter Slmgr Commands
While Slmgr.vbs is stored in the System32 and SysWOW64 folders, commands that interface with the file need to be entered into Command Prompt.
Slmgr Command Examples
After opening Command Prompt, enter the desired slmgr command like you see in these examples:
Check Activation Status
slmgr /xpr
Use this slmgr command to see if Windows is activated. You’ll see a message that says Windows is activated if it is, or be given a date if it’s not permanently activated, or see an error if no product key has been provided.
View Current License Info
slmgr /dli
This command shows part of the product key and an indication of whether the license is active. Other details might be included here, too, like the Key Management Services (KMS) machine IP address, activation renewal interval, and other KMS information.
View Detailed License Info
slmgr /dlv
This command for slmgr.vbs reveals a lot more information about your computer. It starts off with the Windows version number and follows with the activation ID, extended PID, installation ID, remaining Windows rearm and SKU count, and a few other details on top of what the /dli option shows.
Reset Activation Timers
slmgr /rearm
The rearm command resets activation timers, which essentially lets you use Windows without activating it by extending the trial. For example, if you’re using Windows on a 30-day trial, this one-month limitation can be reset back to the beginning after entering this slmgr command.
A restart of your computer is required to complete this command.
There’s a limit to how many times you can rearm the Windows activation files. Check the rearm count with the /dlv command above to see how many cycles are left.
Remove Windows Product Key
slmgr /cpky
This command removes the product key from Windows Registry. Doing this will not delete the key from your computer or un-activate Windows, but it will prevent key finder programs and malicious tools from being able to retrieve the key.
Activate Windows Online
slmgr /ato
This command forces Windows to try online activation, which is useful if you attempted normal activation steps (not using Slmgr.vbs) but received a connection problem or similar error.
Change Windows Product Key
slmgr /ipk 12345-12345-12345-12345-12345
Change the Windows product key with this slmgr command. Replace those numbers with the real product key, but be sure to include the dashes. Restart the computer to fully apply the new key.
If the key isn’t correct, you’ll see a message that The Software Licensing Service reported that the product key is invalid.
Change Remote Product Key
slmgr /ipk mattpc Matt P@ssw0rd 12345-12345-12345-12345-12345
This is the exact same as the slmgr /ipk command shown above, but instead of executing the change product key request on the local computer, it’s performed on the machine named mattpc with the Matt admin users’ login credentials.
Deactivate Windows
slmgr /upk
A fitting last example, this slmgr command will uninstall the product key from the local computer. Just reboot your computer after you see the Uninstalled product key successfully message.
Slmgr Commands
The above examples are fairly basic and should be the only ones most people need to use. However, if you require more advanced options, take a look at the slmgr command syntax and the other supported options:
slmgr [MachineName [username [password]]] [option]
Slmgr Command Options | |
---|---|
Item | Explanation |
MachineName | The machine to administer. Defaults to the local machine if omitted. |
username | The username of an administrator account on the remote machine. |
password | The password for username. |
/ato | Activate Windows license and product key against Microsoft’s server. |
/atp Confirmation_ID | Activate the product with a user-provided Confirmation_ID. |
/cdns | Disable DNS publishing by the KMS host. |
/ckhc | Disable KMS host caching. |
/ckms | Clear the name of KMS server used to default and port to default. |
/cpky | Delete the Windows product key from Windows Registry. |
/cpri | Set the KMS priority to low. |
/dli | Display the current license information with activation status and partial product key. |
/dlv | Display additional license information. Similar to /dli but more detailed. |
/dti | Display Installation ID for offline activation. |
/ipk key | Change the Windows product key. Replaces the current product key if present. |
/ilc file | Install a license file. |
/lil | List installed token-based activation issuance licenses. |
/ril | Remove installed token-based activation issuance license. |
/rilc | Reinstall system license files. |
/rearm | Reset the evaluation period/licensing status and activation state of the computer. Use /rearm-app to specify an app, or /rearm-sku for a specific sku. |
/skms | Set the Volume Licensing KMS server and/or the port used for KMS activation. |
/skhc | Enable KMS host caching (enabled by default). This blocks the use of DNS priority and weight after the initial discovery of a working KMS host. |
/sai interval | Sets the interval in minutes for unactivated clients to attempt KMS connection. |
/spri | Set the KMS priority to normal (default). |
/sprt port | Set the port on which the KMS host listens for client activation requests (default TCP port is 1688). |
/sdns | Enable DNS publishing by the KMS host (default). |
/upk | Uninstall the currently installed Windows product key and return the license status back to a trial state. |
/xpr | Show the expiry date of the current license or indicate whether activation is permanent. |
MachineName can’t be used across platforms. For example, you can’t manage Windows activation on a Windows 7 computer from a Windows Vista computer.
Slmgr Uses
Software Licensing Management Tool (slmgr) is a VBS file in Windows against which you can run commands to perform advanced Windows product activation tasks.
Slmgr.vbs is used only for the Windows operating system. Ospp.vbs manages volume licensing for other Microsoft products.
FAQ
-
To open the command prompt in Windows 11 or 10, go to Start, type cmd, and select Command Prompt from the list.
-
Go to Start and type cmd. Right-click Command Prompt > Run as administrator. If you see a User Account Control window, select Yes to give permission to continue.
-
To clear the Windows command prompt screen, type CLS > press Enter. This will clear the entire application screen. You can also close and reopen the command prompt to clear it.
Thanks for letting us know!
Get the Latest Tech News Delivered Every Day
Subscribe
-
Home
-
News
- How to Use Slmgr to Install, Activate, or Extend Windows License
By Nan |
Last Updated
Do you know what Slmgr is and what the purpose of it is? In this guide on MiniTool, we will explore how you can use Slmgr to install, activate, or extend Windows license. Let’s see more details.
The Slmgr command (Software Licensing Management Tool) is a powerful and indispensable utility in Windows that is used to manage the licensing and activation of the operating system. Whether you want to activate Windows, change product keys, or check the activation status, Slmgr provides the tools you need to complete these tasks.
How to Use the Slmgr command in Windows 10/11?
As we mentioned before, Slmgr is a tool related to Windows license management. That way, we can use it to manage Windows activation. Next, we you show you how to use Slmgr to install, activate, or extend Windows license.
Run Command Prompt as an Administrator
First, to access this tool, you need to open Command Prompt and run it as administrator since its location is in the System32 folder. Below are the steps.
Step 1: Type cmd in Windows search box, right-click the result, and choose Run as administrator.
Step 2: When the UAC window appears, click Yes to open the administrator Command Prompt window.
Use the Slmgr Command in Command Prompt
The following is a detailed description of how to use Slmgr in Windows.
1. Check Your Windows License Status
Run the following command and you can see some basic information about your operating system.
Type the slmgr.vbs /dli command into the Command Prompt window and hit Enter. Then it will display the basic Windows license and activation information, your Windows editions, and part of your product key. You can also check if the current system is activated.
Input the slmgr.vbs /dlv command. You can view more detailed license information such as installation ID, activation ID, extended PID, and other details.
Run the slmgr.vbs /xpr command to view the expiration date of the current license.
Note:
The third command only applies to Windows activated from an organization’s KMS server. Thus, if you have a retail license and multiple activation keys, then you have a permanent license that will not expire. In either case, if you have not provided a product key, you will receive an error message.
2. Install and Uninstall Windows Product Key
If you want to add a new license in Windows, then you have to uninstall your current product key.
Step 1: Use the slmgr /upk command to uninstall the old product key.
Step 2: Then run the slmgr /cpky command to remove the related registry entry.
Step 3: Finally, use the slmgr.vbs /ipk ####### command to activate your system and install your new license with the command given earlier.
Tips:
Replace ####### with the new product key.
Also read: Complete Guide: How to Find Windows 10 Product Key
3. Activate or Deactivate Windows License
Here’s how to activate the Windows system using the Slmgr tool.
Running the slmgr /ato command can activate Windows 11 online and the slmgr /dti one is for offline activation.
Then you need to activate the system by an activation ID. Simply call the Microsoft Product Activation Center and provide the installation ID you received above, and they will provide you with an activation ID. This way, you can run slmgr /atp Activation ID to activate the Windows system without an internet connection.
Typically, online activation is recommended if you face some troubles when activating the operating system from Windows Settings.
You can also run slmgr /upk to deactivate your Windows licese.
4. Extend Windows License
The Slmgr utility can also help you extend your Windows License.
Run the following commands in turn to extend the license.
slmgr -rearm
slmgr -dlv
slmgr -ato
Tips:
If you use Windows 10 or 11, you are not able to use an extended license since they can be used without the product key.
Bottom Line
In this article, we present the details that how to use Slmgr to install, activate, or extend Windows license.
Just in case, you may want to protect your important data. And the best way to that is to back up them. Here we recommend choosing MiniTool ShadowMaker which is a reliable backup software.
About The Author
Position: Columnist
Nan is always interested in writing and exploring new things. Her enthusiasm for writing leads her to become an English editor. She likes to share helpful information about kinds of Android issues with readers and focuses on PC backup and restore. She also loves to read books and watch documentaries in her spare time.
Slmgr, which stands for Software Licensing Manager, is a Windows command-line tool used to manage Windows activation and licensing tasks. You can use the slmgr
command to check license status, activate Windows, and install or uninstall license keys.
- Command Options.
- View Your Windows License Information.
- Check Your Windows License Expiration Date.
- Extend the Evaluation Period for Windows.
- Manually Activate Windows with /ato.
- Adding and Removing Windows Keys.
- Managing KMS Activation.
Command Options
/dli |
Display the information on the current license with activation status. |
/dlv |
Work like /dli but provide more information about the license. |
/rearm |
Extends the trial period of Windows. |
/xpr |
Display the expiration date of the Windows license. |
/ato |
Attempts to activate the Windows using the product key that is currently installed on the system. |
/ipk <product_key> |
Installs a new product key. |
/upk |
Uninstall the product key. |
/cpky |
Removes the product key from the Windows registry. |
/skms <ServerName> |
Specifies the KMS server that your computer will contact for activation. |
/skmsport <PortNumber> |
Specifies the port number that your computer will use to connect to the KMS server. The default port is 1688. |
/ckms |
Removes details of the previously configured KMS Server and sets the port to default. |
When you run the slmgr
command without any parameters, it displays the command syntax and available options.
Examples
This section provides examples of the slmgr
commands. Open a Command Prompt or PowerShell with administrative privileges and then run the commands according to your requirements. Improper use of these commands can lead to licensing problems.
How to View Your Windows License Information
You can use the following command to display the current license information, including activation status and a partial product key:
slmgr /dli
Your Windows license information will be displayed through a dedicated window.
Enter the following command to display more detailed information about the current license:
slmgr /dlv
How to Use slmgr to Check Windows License Expiration
You can find the expiration date of your current Windows license by entering the following command:
slmgr /xpr
Running the command on my Windows 10 PC resulted in the following message, indicating that Windows is permanently activated.
The expiration date was displayed on a Windows Server 2022 machine using an evaluation license.
Extend the Evaluation Period for Windows
If your Windows trial period ends, you can use the /rearm
command to extend the trial:
slmgr /rearm
Normally, the Windows Server trial period lasts 180 days for Standard and Datacenter editions. Rearming it for the first time adds another 180 days. Subsequent rearms add 90 days each, allowing for a total trial period of up to 540 days (this may vary depending on the Windows version).
Manually Activate Windows with /ato
If your product key is not activated, you can run the following command to activate it:
slmgr /ato
Windows usually activates automatically during installation or when a valid product key is entered. However, if activation fails for some reason, you can use the /ato
command to manually attempt activation with the current product key.
Adding and Removing Windows License Keys
Use the /ipk
option to enter a new product key or update the existing one. In the following example, ABCDEF-12345-ABCDEF-12345-ABCDEF
is the product key being entered:
slmgr /ipk ABCDEF-12345-ABCDEF-12345-ABCDEF
To remove a product key, run the following two commands:
slmgr /upk
slmgr /cpky
The first command uninstalls the product key, while the second command clears the registry of any remaining key information.
Managing KMS Activation with slmgr Commands
By default, Windows clients automatically attempt to discover KMS servers on a Windows network. However, using the /skms
option overrides this behavior and forces the client to connect to a specific KMS host.
The following example sets the KMS host server to kms.example.local
and specifies the port as 1688
(the port number is optional, with 1688
being the default port):
slmgr /skms kms.example.local:1688
To clear the configured KMS server and port settings, enter the following command:
slmgr /ckms
That brings us to the end of this article on using the slmgr
command to manage Windows licensing and activation. We’ve covered everything from viewing license information to installing keys using various command options.