Installing a key from the command line. How to change, remove or renew your Windows license

Despite the fact that the topic has already been beaten many times, nevertheless, I am often approached with similar questions.

Microsoft vigilantly monitors the use of counterfeit products for its products and punishes the "guilty" in every possible way. Fortunately, we do not have America and no one will yet break into your house shouting “You are under arrest!”. However, a pirated version of Windows is much easier to "destroy" through updates on the Internet. Everything is quite simple there - on an unverified copy of Windows, the mechanism for removing a pirate key is launched, which requires subsequent activation.

The situation is doubly unpleasant for those who buy a computer in a store. A smiling seller will show you a workable product, say that he has installed Windows and go to count his money. Unfortunately, this is typical for both small shops and large ones. No, no, and there will be such a case when the “licensed” Windows refuses to start just because of the absence of this license. Simply, when buying a computer with Windows installed in the store, make sure that there is a sticker confirming the license. If it is not there, Windows is probably pirated (there are rare cases when an absent-minded seller forgets to put this sticker on).

However, Microsoft's insanity has reached the point where sometimes even licensed products do not pass the test on their server. I myself came across a situation where Microsoft blocked licensed Windows.

The situation is stupid and unpleasant, but you have to put up with it. In fact, in this case, you have only two options - to enter a new key and activate your seven (attention, one key can only be activated 10 times, Microsoft is closely monitoring this), or use a special script that reactivates your version of Windows. I do not consider the option in which you can restore a working Windows from a previously created image due to the fact that rarely anyone makes these images.

So, let's look at how you can reactivate your Windows 7. Run Win + R and type the command in the window that appears:

slmgr.vbs /rearm

Click Ok and wait for the script to execute. If Windows was previously activated, then the script will restore the functionality of your system. By the way, owners of pirated versions also use this script, for whom it returns activation again (again before the first update with Microsoft).

Windows is full of glitches and you have to put up with it. Activation can even crash as a result of a software failure of the file system. In this case, you will also need this method. However, rearm should not be abused - it can only be called three times. If, after using it, you again see an inscription that Windows has not passed the license check, you should think about purchasing a licensed product.


Sometimes slmgr.vbs and other VBS system errors can be related to problems in the Windows registry. Several programs can use the slmgr.vbs file, but when those programs are removed or changed, orphaned (invalid) VBS registry entries are sometimes left behind.

Basically, this means that while the actual path to the file may have been changed, its incorrect former location is still recorded in the Windows registry. When Windows tries looking up these incorrect file references (file locations on your PC), slmgr.vbs errors can occur. In addition, malware infection may have corrupted the registry entries associated with Windows. Thus, these invalid VBS registry entries need to be repaired in order to fix the root of the problem.

Manually editing the Windows registry to remove invalid slmgr.vbs keys is not recommended unless you are PC service professional. Mistakes made while editing the registry can render your PC unusable and cause irreparable damage to your operating system. In fact, even a single comma in the wrong place can prevent your computer from booting up!

Because of this risk, we highly recommend using a trusted registry cleaner such as WinThruster (Developed by Microsoft Gold Certified Partner) to scan and repair any slmgr.vbs-related registry problems. Using a registry cleaner automates the process of finding invalid registry entries, missing file references (like the one causing your slmgr.vbs error), and broken links within the registry. A backup copy is automatically created before each scan, allowing you to undo any changes with a single click and protecting you from possible damage to your computer. The best part is that fixing registry errors can drastically improve system speed and performance.


Warning: Unless you are an advanced PC user, we do NOT recommend editing the Windows Registry manually. Incorrect use of the Registry Editor can lead to serious problems and require you to reinstall Windows. We do not guarantee that problems resulting from misuse of Registry Editor can be corrected. You use the Registry Editor at your own risk.

Before manually restoring Windows registry, you need to create a backup by exporting a part of the registry related to slmgr.vbs (eg. Windows):

  1. Click on the button To begin.
  2. Enter " command" in search bar... DO NOT PRESS YET ENTER!
  3. Holding down the keys CTRL-Shift on the keyboard, press ENTER.
  4. An access dialog will be displayed.
  5. Click Yes.
  6. The black box opens with a blinking cursor.
  7. Enter " regedit" and press ENTER.
  8. In the Registry Editor, select the slmgr.vbs-related key (eg. Windows) you want to back up.
  9. On the menu File select Export.
  10. Listed Save to select the folder where you want to save the Windows key backup.
  11. In field File name enter a name for the backup file, such as "Windows Backup".
  12. Make sure the field Export range value selected Selected branch.
  13. Click Save.
  14. The file will be saved with .reg extension.
  15. You now have a backup of your slmgr.vbs-related registry entry.

The next steps for manually editing the registry will not be covered in this article, as they are likely to damage your system. If you would like more information on editing the registry manually, please see the links below.

Activation Windows 7, as well as Windows Vista, based on the mechanism Software Protection Platform (SPP).

By default, the duration of the operating system without activation is 30 days. However, you can reset the activation counter 4 times with the command slmgr.vbs /rearm. This allows you to work with the OS without activation for 120 days.


The main feature of this method of renewal of activation is that the system absolutely does not care where you got this copy of Windows 7 from. This trick should always work, but only 4 months in a row. To get the maximum, activate on the last day of the term.

Open the menu Start-> and enter the command cmd.exe(if there is no Run item in the menu, you can use the keyboard shortcut - Win+R)

In the window that opens, type the command:

A couple of seconds after pressing the Enter key, a message will appear on the successful execution of the command. Click OK, close the window and reboot.

After loading the OS, go back to My computer -> Properties and we observe the result - Windows activation is delayed for another 30 days! Have a nice work)

Basically the same method, only in profile, from (Valery Sidorov)

After the activation period has expired, launching the shell \Windows\explorer.exe will be prohibited.

A window will appear "Windows Activation" with a message "Activate Windows now. The activation period has expired, Windows no longer works. To use Windows, you must activate this copy of Windows".

The following options are available:

Activate Windows over the network;

Access with limited features (but you can purchase a product key online);

Re-enter product key.

***

How to reset the activation counter

Choose an option Disabled Access;

- a web browser will open;

- in the window "Web page not available offline" click Offline;

- in the address bar of the browser, enter C:\Windows\System32\cmd.exe(if operating system is not installed on the C:\ drive, enter the appropriate drive letter), click Enter;

- a window will appear "Downloading a file - security warning" with a message "Run or save this file? (Name: cmd.exe. Type: Application - 294 KB. From: C:\Windows\System32)", click Run;

- a window will appear « internet explorer- Security Warning" with a message "Unable to verify this publisher. Are you sure you want to run this program? Name: cmd.exe. Publisher: Unknown publisher. This file does not have a valid digital signature to verify its publisher. You should run programs received only from a trusted publisher", click Run;

- in the window command interpreter after system prompt C:\Users\username\Desktop> enter slmgr.vbs /rearm(or simply slmgr /rearm), press Enter;

- in the window that appears "Windows Script Host" with a message "Command completed successfully. Restart your computer for the changes to take effect" click OK;

- close the windows command interpreter , web browser, activation window Windows;

– restart the PC (if the activation window appears again after the reboot, turn off PCand turn it back on).

***

Activation mechanism settings Windows 7 stored in REG_DWORD-section settings Registry:

:

VLActivationInterval– determines the total period of work without activation (the default value is dword:00000078, i.e. 120 days);

SkipRearm– determines whether the activation counter will be allowed to be reset using the command slmgr.vbs /rearm after 4 resets (default value is dword:00000000);

:

ActivationInterval– defines the interval for displaying the operating system activation notification (the default value is dword:000dbba0);

NotificationDisabled– displaying a notification about the need to activate the operating system in the notification area Taskbars(default value is dword:00000000. If you set the value 1 , notifications will not be displayed).

Notes

1. Using a web browser, you can run any program Windows.

2. slmgr.vbs(script file VBScript; the disk address of the file is \Windows\System32\) is Licensing Management Tool software Windows 7 .

Usage: slmgr.vbs [ComputerName [User Password]] [

ComputerName– Remote computer name (default – local computer);

UserAccount with the required privileges on the remote computer;

Password– the password of the mentioned account.

Main file keys:

/ipk<Ключ продукта> – installing a product key (replacing an existing key);

/ato [Activation ID]– activation Windows;

/dli [Activation ID | All]– display information about the license (by default, the current license);

/dlv [Activation ID | All]– displaying detailed information about the license (by default, the current license);

/xpr [Activation ID]– expiration date for the current state of the license;

/cpky- deleting the product key from Registry (to prevent information leakage);

/ilc<Файл лицензии> – license installation;

/rilc– reinstallation of system license files;

/rearm– Reset the license state of the computer;

/upk- deleting the product key;

/dti [Activation ID]– display of installation ID for offline activation;

/atp<Идентификатор подтверждения>[Activation ID]– product activation with confirmation ID provided by the user.

3. Some antiviruses prohibit the execution of script files. For start slmgr.vbs you need to disable the script blocker.

- a fairly simple and understandable procedure (well, at least more or less) than what we are going to consider later in this article. What if you want to do something more advanced and complex with the license, such as how to remove/change the product key, perform online activation, or extend the activation time. It's not as simple as a simple activation that is done standard means OS with a user-friendly GUI, but also not that difficult. In this article, I will give you information on how and with what it can be done.

There is a tool command line, called Slmgr.vbs, which is part of Windows and provides features that are not available in the standard activation interface, which is located in the Update and Security window, which can be reached by opening the Start menu and selecting Settings.

First: open a command prompt with administrator privileges

This is required to use Slmgr.vbs. In Windows 10 or 8, right-click on the Start button (or the keyboard shortcut Win + X) and select "Command Prompt (Admin)". In Windows 7, find Command Prompt in the Start menu, under All Programs > System Tools. Right click on it and select "Run as administrator".

View activation/license information

To display basic license information and activation information, run the command below which will tell you which one you have Windows version, part of the product key so you can identify and will show you if the system is activated.

To get more detailed information about the license, including activation ID, installation ID, and other detailed information, enter the following command:

View license expiration date

To find out the current system activation period, use the command below. Since retail licenses for, say, home computers activate on a perpetual basis that will never expire, the command will be useful for commercial KMS organizations and servers. However, you can check the expiration date of your license to make sure it is permanent.

How to remove a product key

You can also use Slmgr.vbs to remove the product key of the current Windows system. After executing the command below, restart your computer and your operating system will not have a product key, which means Windows will become inactive - without a license.

This allows you to transfer the license to another computer if necessary. For example, if you want to donate old computer friend, but you want to keep the license for yourself. However, as you know, Windows activation will be “tied” to the hardware of the computer on which it is installed, so it will not work just like that, but it is still possible, but not about that now (it will be in future articles).

To remove a license key, enter the following command at the command prompt:

However, the command does not completely remove the activation. Windows also stores the product key in the registry because it is sometimes necessary for computer settings and to prevent malware from stealing the key from accessing the registry. In addition, the future owner of the computer (if he is more or less versed in computers) can easily pull the key out of the registry, so you must also remove it from the registry with the following command:

How to install or change a product key

With slmgr.vbs you can enter a new product key. If the Windows system is already activated, using the command below, you can replace the old key with a new one (instead of #####-#####-#####-#####-#####, enter a new key). After that, it is recommended that you restart your computer.

You can also do this from the activation settings screen in Computer Options, but the following command allows you to do this from the command line:

slmgr.vbs /ipk #####-#####-#####-#####-#####

Windows Activation

Windows activation online

The next command you can try to activate Windows via the Internet.

Windows offline activation

To get the Installation ID (ID) for offline activation, run the following command:

Now you need to receive the system activation confirmation code by phone. Go to the official Microsoft Windows Activation Help page. According to the instructions, call the Microsoft Product Activation Center (nothing to worry about, you will follow the instructions of the robot) and provide the installation ID obtained above and you will receive an activation code (if everything is successfully confirmed). This may help you activate Windows system without internet connection.

Instead of ACTIVATIONID, enter the activation ID. which you received:

slmgr.vbs /atpACTIVATIONID

After that, to make sure that your OS is activated, you can use the following commands:

slmgr.vbs /dli or slmgr.vbs /dlv

How to extend activation

Take Windows 7 for example, which has a 30-day trial period before it asks you for a product key. You can extend the trial period, i.e. reset this trial period back to 30 days by running the command below.

slmgr.vbs/Rearm

However, you cannot extend the trial period again and again and indefinitely - the command can only be used a few times. If you want to know how many times, enter the slmgr.vbs /dlv command. I don't remember exactly, but each version seems to have its own "number of times". On Windows 7, if I'm not mistaken, 3 times, and 5 times on Windows Server 2008 R2. With the exception of Windows 10, the option works in all earlier versions.

Applying Slmgr.vbs to Remote Computers

Normally, Slmgr runs on the current computer, but you have the ability to remotely administer computers on the network if you have access to them. For example, the first command below applies to the current computer, while the second command applies to a remote computer. You only need to know the Computer Name, Username and Password.

slmgr.vbs /option

slmgr.vbs computername username password /option

Other commands related to system activation can be used with the Slmgr.vbs command. See Slmgr.vbs Options for more information.

KMS. How to manually activate Windows

Microsoft offers two types of activation for its products - MAK (Multiple Activation Key) and KMS (Key Management Service / Key Management Service).

Sometimes, for various reasons, Windows does not want to activate on a network that has a running KMS server.

To activate manually, you must execute 3 commands in sequence in command line. command line launch on behalf of the administrator



Enabling normal access activation

Source:
https://technet.microsoft.com/en-us/library/bb490214.aspx

By default, activation requires administrator rights. However, in cases where users do not have local administrator access and automatic activation cannot be completed within the first 30 days of the grace period, customers can grant these operations to users with normal access.

To allow users, with normal access rights, install product keys, perform activation and retrofitting computers, registry entry value

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\SL\UserOperations (REG_DWORD)

Need to install equal to 1.

After you enable this registry setting, all product key installation, activation, and upgrade requests must be done through a script Slmgr.vbs.

Additionally

Also on Microsoft.com sites there is a lot of information on this topic, for example.

mob_info