How to Remove an Office Product Key
Step-by-step guide for safely uninstalling or clearing Microsoft Office license keys.
When should you remove an Office product key?
- When transferring Office to another computer
- To fix activation or licensing errors
- Before reinstalling or upgrading Office
Step 1 — Open Command Prompt as Administrator
Press Start → type "cmd" → right-click → Run as administrator.
Step 2 — Check which Office keys are installed
Navigate to your Office installation folder and run the following command:
cd C:\Program Files\Microsoft Office\Office16
cscript ospp.vbs /dstatus
If you're using the 32-bit version of Office on a 64-bit Windows, try this instead:
cd C:\Program Files (x86)\Microsoft Office\Office16
cscript ospp.vbs /dstatus
This will list all installed licenses and show the last 5 characters of each product key.
Step 3 — Remove a specific product key
Use the following command, replacing XXXXX with the last five characters of your key:
cscript ospp.vbs /unpkey:XXXXX
Example:
cscript ospp.vbs /unpkey:2WC00
If successful, you'll see: "Product key uninstall successful".
Step 4 — Verify removal
Run again:
cscript ospp.vbs /dstatus
Make sure the old key no longer appears.
Step 5 — Optional cleanup
- Remove any Office credentials from Control Panel → Credential Manager
- Sign out of your Microsoft account in Office and re-sign in with a new key or account
- Restart your computer
Notes & Tips
- Always run commands as Administrator.
- Removing a key will deactivate Office until you re-enter a valid license.
- If you're not sure about your license type, run
cscript ospp.vbs /dstatusto check the details.