Help Center, Troubleshooting

How to Completely Remove Old Office License Keys Using ospp.vbs

How to completely remove old Office license keys and cached credentials using ospp.vbs script
DOCS Documentation: Technical Guide
Index (66)
Documentation Directory
Docs Hub →
Diagnostic Tools
Check Expiration:
slmgr.vbs /xpr
Verify Retail Channel:
slmgr.vbs /dli
Force Re-Activation:
slmgr.vbs /ato
Windows Client OS
Licensing & Activation
Microsoft Office Suite
Microsoft 365 Cloud
Windows Server & CALs
Developer & Diagnostics
Genuine Microsoft Retail
Need a Lifetime Key?

Instant delivery with official Microsoft server activation.

Browse License Keys →

When upgrading from an older version of Microsoft Office or transitioning away from an expired Microsoft 365 subscription, the Windows Software Protection Platform often retains obsolete cryptographic product key tokens in the background. This results in persistent “Unlicensed Product” banners and activation collisions even after entering a new, genuine product key. To completely remove old Office license keys, you must use Microsoft’s native Office Software Protection Platform script (ospp.vbs). By executing cscript ospp.vbs /dstatus in an elevated Command Prompt, you can identify the last five characters of the conflicting key and immediately uninstall it using cscript ospp.vbs /unpkey:XXXXX.

✅ Why ospp.vbs is Essential: Standard Control Panel uninstalls do NOT delete installed license keys from the Windows registry. ospp.vbs directly interfaces with the local license repository to purge ghost activations.

1. Where is ospp.vbs Located on Windows?

The location of ospp.vbs depends on whether you have the 32-bit or 64-bit version of Office 2024, 2021, or 2019 installed:

  • 64-bit Office on 64-bit Windows:
    C:\Program Files\Microsoft Office\Office16
  • 32-bit Office on 64-bit Windows:
    C:\Program Files (x86)\Microsoft Office\Office16

2. Step 1: Query Installed Product Keys (/dstatus)

Open Command Prompt as administrator and change directory to the Office folder, then display all active license blocks:

// Navigate to 64-bit directory (or x86 if applicable)
cd “C:\Program Files\Microsoft Office\Office16”

// Display all installed licenses
cscript ospp.vbs /dstatus

Review the output. If you see multiple licenses (such as an expired Office 16, Office16ProPlusMSDNR_Retail alongside your new Office 2024 Home & Business), take note of the Last 5 characters of installed product key for the old license.

3. Step 2: Uninstall the Conflicting Key (/unpkey)

Run the uninstall command, replacing XXXXX with the 5 characters extracted from Step 1:

// Uninstall the ghost license key
cscript ospp.vbs /unpkey:XXXXX

Command Prompt will confirm: <Product key uninstall successful>. If you had multiple old licenses listed in /dstatus, repeat the command for each obsolete key until only your current license remains.

4. Step 3: Clear Cached Credentials & Reactivate

Once the conflicting keys are purged, trigger immediate online activation for your legitimate license:

// Force immediate online activation
cscript ospp.vbs /act

For more details on resolving unlicensed warnings, read our full guide on How to Fix Microsoft Office Unlicensed Product Error.

Get a Lifetime Genuine Office Retail License

Eliminate licensing clashes forever. SortedKeys provides 100% genuine retail licenses for Microsoft Office 2024 and 2021.

View Genuine Office 2024 Keys →

5. Frequently Asked Questions

What happens if I accidentally uninstall my active product key?

Don’t panic! You can reinstall your key anytime using cscript ospp.vbs /inpkey:XXXXX-XXXXX-XXXXX-XXXXX-XXXXX followed by cscript ospp.vbs /act.

author-avatar

About Sorted Keys Team

The Sorted Keys Team is the official voice of Sorted Keys LLC, a verified Microsoft Partner based in the US. We are dedicated to providing legitimate software licenses, industry news, and enterprise deployment solutions to our B2B and retail clients worldwide.

Leave a Reply

Your email address will not be published. Required fields are marked *