Checking Office activation from the command line with ospp.vbs
Everyone knows slmgr for Windows activation, but fewer people know Office has its own equivalent. It's called ospp.vbs and it's been sitting in the Office folder this whole time. I use it constantly when someone tells me Word says "Unlicensed Product" and the File, Account page isn't giving any useful detail. Where it lives For a normal 64-bit Office install (Office 2016 and later all use the…
Windows Office activation can be managed through the command line using ospp.vbs, a lesser-known utility present in the Office folder. This tool provides more detailed information about installed licenses compared to the standard slmgr for Windows activation.
To access ospp.vbs, navigate to the Office folder: 'cd C:\Program Files\Microsoft Office\Office16' for 64-bit Office installations, or 'cd C:\Program Files (x86)\Microsoft Office\Office16' for 32-bit Office on 64-bit Windows. Run the utility from an admin prompt using 'cscript' to display the output in the console.
The '/dstatus' command lists all installed Office licenses, including their names, status, and the last five characters of each key. A crucial observation is the presence of multiple license blocks, which often occurs when a Microsoft 365 trial is installed alongside a permanent Office version. This leads to conflicts that cause the 'Unlicensed Product' error.
Another important piece of information is the LICENSE NAME line, which indicates whether the license is a retail or volume license. This distinction is essential for proper activation.
To activate a licensed version of Office, use '/inpkey' followed by the 25-character product key, and then '/act' to activate it. If '/act' fails, an error code will be displayed, which can help identify the issue. To remove an unwanted or expired license, use '/unpkey' followed by the last five characters of the license key. It's important to remove the incorrect license before activating the desired one, otherwise Office may continue to check the wrong license.
However, ospp.vbs is primarily useful for volume and standalone retail installations. Microsoft 365 subscriptions are licensed through the user's account sign-in, so issues with these licenses are typically addressed on the File, Account page rather than through ospp.vbs.
The recommended process is to start with '/dstatus' to view all installed licenses, remove any unnecessary or expired licenses using '/unpkey', and then use 'inpkey' and 'act' for the license you intend to activate. This straightforward approach transforms the vague 'Unlicensed Product' banner into a manageable situation.
Written by urgent.news from Dev.to's reporting — not their text. Machine-written — may contain errors; check the original before relying on it.