1. Check the licence
Displays licence and edition information.
cscript //nologo "%windir%\system32\slmgr.vbs" /dliMicrosoft command guide for activating Windows and Office with a valid licence, with copy buttons and status checks.
Commands do not grant a free licence. Use your own key for the installed edition. Never enter a product key on this website; replace the placeholder only inside CMD.
If the prompt starts with PS, select PowerShell. Commands and copy buttons update to match your selection.
Do not run XXXXX literally. Replace it with your real key in the terminal, or skip the key step if it is already installed.
For a digital licence, connect to the internet, sign in with the linked Microsoft account and check Activation settings first.
Displays licence and edition information.
cscript //nologo "%windir%\system32\slmgr.vbs" /dliReplace the XXXXX groups with your key only in CMD. It must match the Windows edition.
cscript //nologo "%windir%\system32\slmgr.vbs" /ipk XXXXX-XXXXX-XXXXX-XXXXX-XXXXXAttempts activation of the installed licence. Organization licences may require the authorized corporate network or VPN.
cscript //nologo "%windir%\system32\slmgr.vbs" /atoShows whether activation is permanent or has an expiry date.
cscript //nologo "%windir%\system32\slmgr.vbs" /xprOpen the Activation troubleshooter if the command fails.
start ms-settings:activationMicrosoft 365 and retail Office: open Word → File → Account → sign in with the licensed account. Commands below apply to volume-licensed Office installations containing OSPP.VBS, not to Microsoft 365 subscriptions.
Choose the path that actually contains OSPP.VBS. If the file is not found, stop and check your Office edition and location.
Displays licence status and the last five characters of the installed key.
cscript //nologo "%ProgramFiles%\Microsoft Office\root\Office16\OSPP.VBS" /dstatusReplace the placeholder with your authorized key inside CMD.
cscript //nologo "%ProgramFiles%\Microsoft Office\root\Office16\OSPP.VBS" /inpkey:XXXXX-XXXXX-XXXXX-XXXXX-XXXXXConnect to the internet or the corporate network required by your licence.
cscript //nologo "%ProgramFiles%\Microsoft Office\root\Office16\OSPP.VBS" /actRun the status check again and look for LICENSED. If activation fails, keep the error code and contact Microsoft or your organization administrator; do not use public activation servers.
Official Office command reference ↗ · Microsoft account activation guide ↗Checks status, requests activation of the installed licence, then checks status again. No product keys or third-party servers are embedded. Run as administrator and read the local confirmation. Office uses the installation path selected above.
CMD: right-click the .cmd file and choose Run as administrator. PowerShell: open PowerShell as administrator and run the .ps1 file; your organization policy may prevent execution. These are Windows scripts, not Bash files.