Change, Activate, or Remove Microsoft Office Product Key
How to Change, Activate, or Remove Microsoft Office Product Key via CMD or PowerShell
You can manage your Microsoft Office product key using both Command Prompt and PowerShell. The Office Licensing Service (ospp.vbs) is the primary tool for this.
Here is a complete guide on how to change, activate, or remove your Office product key using both methods.
Step 1: Run Command Prompt/ Windows PowerShell as Administrator
-
Press
Win + S:typecmd, Right-click on “Command Prompt”; Or type “PowerShell”, right click on “Windows PowerShell” -
Then select Run as administrator.
Step 2: Navigate to the Office Program Files Directory
The path to the script depends on your version of Office (32-bit or 64-bit) and your Windows architecture.
For 64-bit Office or 32-bit Office on 32-bit Windows:
cd C:\Program Files\Microsoft Office\Office16
For 32-bit Office on 64-bit Windows:
cd C:\Program Files (x86)\Microsoft Office\Office16(Note: Office16 is the directory for Office 2021 & 2019 & 2016. (For Office 2010 , it’s Office14, for Office 2013, it’s Office15).
Step 3: Use the OSPP.VBS Commands:
1. View Current License Information
Before making changes, it’s good to see what’s installed.
cscript ospp.vbs /dstatus
This will list all installed product keys. Look for the Last 5 characters of the key you want to manage.
2. Remove a Product Key
cscript ospp.vbs /unpkey:XXXXX
3. Install a New Product Key
Replace XXXXX-XXXXX-XXXXX-XXXXX-XXXXX with your full 25-character product key.
cscript ospp.vbs /inpkey:XXXXX-XXXXX-XXXXX-XXXXX-XXXXXAfter installing a new key, you need to activate it.
cscript ospp.vbs /act
If you do not have a Office product Key, you can get it from Keyingo.com