How to Remove an Old Microsoft Office Product Key Before Installing Office 2024
Question details
The user needs to clear out an old Microsoft Office product key that is interfering with the activation or installation of a new Office 2024 setup.

- Product
- Microsoft Office
- Device & OS
- Windows
- Scenario
- Preparing to install and activate Office 2024 on a system that previously had an older version of Office installed.
- Observed behavior
- Older Office product keys remain installed on the system and interfere with the activation of a newly installed Office 2024.
Ensure you are logged into your Windows computer with an administrator account, as you will need elevated privileges to run commands that modify Office licensing.
Use the OSPP.VBS Script via Command Prompt
Use the built-in Microsoft Office licensing script to locate the last five characters of your old key and uninstall it from your system.
The OSPP.VBS script is a command-line tool provided by Microsoft to manage volume activation of Office products. Running this script allows you to view currently installed keys and safely remove them.
Click the Start menu, type 'cmd' or 'Command Prompt', right-click the application, and select 'Run as administrator'.
In the Command Prompt window, type the following command and press Enter: cscript "C:\Program Files\Microsoft Office\Office16\OSPP.VBS" /dstatus
Review the output text to find the line that reads 'Last 5 characters of installed product key'. Note down these five characters.
Type the removal command, replacing XXXXX with the five characters you just noted: cscript "C:\Program Files\Microsoft Office\Office16\OSPP.VBS" /unpkey:XXXXX

Avoid Activation Hassles with WPS Office
If you want to avoid dealing with complex product keys and command-line scripts, consider switching to WPS Office. It provides a lightweight, free, and highly compatible alternative to Microsoft Office that is ready to use immediately.
- 1. Download the Installer: Visit the official WPS Office website and download the free installer for your operating system.
- 2. Install the Software: Run the setup file and follow the straightforward on-screen prompts to complete the installation in seconds.
- 3. Start Creating: Open WPS Office and immediately begin working on your documents, spreadsheets, and presentations.

Frequently Asked Questions
Why is my new Office 2024 failing to activate?
Activation failures can occur if an older Office product key is still registered on your system, creating a conflict. Using the OSPP.VBS script to remove the lingering key usually resolves this issue.
Where is the OSPP.VBS script located?
For newer versions of Office, the script is typically found in 'C:\Program Files\Microsoft Office\Office16'. If you installed a 32-bit version of Office on a 64-bit Windows system, look in the 'Program Files (x86)' directory.
Will removing the product key uninstall my Microsoft Office applications?
No. Running the /unpkey command only removes the activation license from your system. Your applications and local files remain untouched, allowing you to enter a new product key when ready.




