How to remove KMS License Key in Microsoft Office

Removing a KMS (Key Management Service) key from Microsoft Office involves using command-line tools to change the product key and then removing the KMS configuration. Below are the step-by-step instructions for removing a KMS key from Microsoft Office.

Step-by-Step Instructions to Remove KMS Key from Microsoft Office

Step 1: Open Command Prompt as Administrator
  1. Press Windows + R to open the Run dialog box.
  2. Type cmd and press Ctrl + Shift + Enter to run the Command Prompt as an administrator.
  3. Click Yes if prompted by User Account Control (UAC) to allow changes.
Step 2: Navigate to the Office Installation Directory

The location of the Office installation directory may vary depending on the version and installation type. Here are common paths for Office 2016, Office 2019, and Office 2021:

  • For 32-bit Office on 64-bit Windows:
    cd "C:\Program Files (x86)\Microsoft Office\OfficeXX"
  • For 64-bit Office on 64-bit Windows:
    cd "C:\Program Files\Microsoft Office\OfficeXX"

Replace OfficeXX with the appropriate version number (e.g., Office16 for Office 2016, Office17 for Office 2019, and Office21 for Office 2021).

Step 3: Remove the KMS Key
  1. Use the ospp.vbs script to remove the KMS key. The ospp.vbs script is a Visual Basic script used for managing Office product keys and activation.
  2. Run the following command:
    cscript ospp.vbs /unpkey:<last 5 characters of the product key>

    Replace <last 5 characters of the product key> with the actual last 5 characters of the KMS key you want to remove.

For example:

cscript ospp.vbs /unpkey:XXXXX
Step 4: Check the License Status

After removing the KMS key, you should check the license status to ensure the key has been removed successfully.

  1. Run the following command:
    cscript ospp.vbs /dstatus

    This will display the current activation status and licensing details for Office.

Step 5: Configure a New Product Key (Optional)

If you want to enter a new product key (such as a MAK key) after removing the KMS key, use the following command:

  1. Run the following command to enter the new product key:

    cscript ospp.vbs /inpkey:XXXXX-XXXXX-XXXXX-XXXXX-XXXXX

    Replace XXXXX-XXXXX-XXXXX-XXXXX-XXXXX with your new product key.

  2. Activate the new product key by running:

    cscript ospp.vbs /act


By following these steps, you can successfully remove a KMS key from Microsoft Office and, if necessary, configure a new product key. This process ensures that your Office installation is properly licensed and activated according to your needs.