Command Prompt showing ospp.vbs commands to activate Office 2024 using Command Prompt

Activate Office 2024 Using Command Prompt (ospp.vbs Guide)

Last updated: 25 October 2026 · Applies to Office LTSC Professional Plus 2024, Office LTSC Standard 2024 and Office 2024 retail editions on Windows 10 and 11

In short

To activate Office 2024 from Command Prompt, open Command Prompt as administrator, go to the Office folder with cd "C:\Program Files\Microsoft Office\Office16", install your key with cscript ospp.vbs /inpkey:XXXXX-XXXXX-XXXXX-XXXXX-XXXXX, then run cscript ospp.vbs /act. Check the result with cscript ospp.vbs /dstatus: it should say LICENSE STATUS: —LICENSED—. No internet on the PC? Use /dinstid and /actcid instead of /act.

Key takeaways
+ospp.vbs is Microsoft’s own activation script. It installs with Office 2024, so there’s nothing to download.
+Three commands activate Office 2024: /inpkey (install the key), /act (activate) and /dstatus (check).
+It works for Office LTSC 2024 volume licences and Office 2024 retail keys. It doesn’t work for Microsoft 365, which activates by signing in.
+You can activate without internet using an Installation ID and Microsoft’s online Product Activation Portal on another device.
+Every command must run in an administrator Command Prompt, or it fails with an access denied error.

Activating Office 2024 normally takes one click: open Word, enter your key, done. But that doesn’t always work. The activation wizard might not appear, Office might stay stuck on Unlicensed Product, the PC might be offline, or you might be an IT admin activating dozens of machines at once.

That’s when the command line comes in. This guide shows you exactly how to activate Office 2024 using Command Prompt and ospp.vbs, step by step: online, offline and with KMS. It explains how to read the results, lists every useful ospp.vbs command, and gives fixes for the error codes you’re most likely to see.

Office editionUse ospp.vbs?Notes
Office LTSC Professional Plus 2024YesVolume licence (MAK or KMS). This is what ospp.vbs was built for.
Office LTSC Standard 2024YesVolume licence, same commands as Professional Plus.
Office Home 2024 / Home & Business 2024SometimesWorks if the copy uses a product key. Most are linked to a Microsoft account instead.
Project 2024 and Visio 2024 (volume)YesEach has its own key. Install and activate it the same way.
Microsoft 365 appsNoActivated by signing in. Microsoft says to use vnextdiag.ps1 for diagnostics instead.
Which editions of Office 2024 you can activate with ospp.vbs. Source: Microsoft Learn.

What Is ospp.vbs?

ospp.vbs stands for Office Software Protection Platform script. It’s a small Visual Basic script that Microsoft includes with every desktop version of Office, from Office 2010 to Office 2024. It talks directly to the licensing service on your PC, so it can install keys, activate, show licence status and set up KMS without opening a single Office app.

It’s the Office equivalent of slmgr.vbs for Windows. According to Microsoft’s documentation, it only changes Office licences; Windows activation is untouched. It runs through cscript.exe, which is built into Windows.

Before You Start

Office 2024 installed
The desktop apps must already be installed. ospp.vbs activates; it doesn’t install.
A matching product key
A retail key for retail Office, or a volume (MAK) key for Office LTSC 2024.
Administrator rights
Your Windows account must be in the local Administrators group.
Internet, for online activation
Not needed for the offline method, which uses a second device.
Office apps closed
Close Word, Excel and Outlook so they pick up the new licence when reopened.
About five minutes
Online activation usually completes in under a minute.
What to have ready before activating Office 2024 from the command line.

Find where ospp.vbs is on your PC

Office 2024 keeps ospp.vbs in the Office16 folder, the same as Office 2016, 2019 and 2021. Which Program Files folder depends on whether Office is 64-bit or 32-bit:

Your Office 2024Folder containing ospp.vbs
64-bit Office 2024 (the default)C:\Program Files\Microsoft Office\Office16
32-bit Office 2024 on 64-bit WindowsC:\Program Files (x86)\Microsoft Office\Office16
If neither worksC:\Program Files\Microsoft Office\root\Office16
Where to find ospp.vbs for Office 2024. A wrong path just shows an error, so it’s safe to try each one.

Not sure which you have? Open Word, go to File › Account › About Word, and the first line ends with 64-bit or 32-bit.

Open Command Prompt as administrator

Select Start, type cmd, then right-click Command Prompt and choose Run as administrator. Select Yes when Windows asks for permission. The window title should start with Administrator:. If it doesn’t, every activation command will fail.

How to Activate Office 2024 Using Command Prompt (Online)

This is the standard method for a PC with internet. Run each command in order in your administrator Command Prompt.

Step 1: Go to the Office folder

cd "C:\Program Files\Microsoft Office\Office16"

Use the Program Files (x86) path from the table above if you have 32-bit Office. The prompt changes to show the folder you’re in.

Step 2: Check the current licence

cscript ospp.vbs /dstatus

This shows any key that’s already installed, its licence channel and its status. Note the last five characters of any key you’re replacing. If you see No installed product keys detected, go straight to Step 4.

Step 3: Remove an old or trial key (if there is one)

cscript ospp.vbs /unpkey:7H8Q9

Replace 7H8Q9 with the last five characters from your /dstatus output. This step matters when a PC came with a trial or a key that no longer works; otherwise Office may keep trying the old one. Our guide to changing the Office product key without reinstalling covers this in more detail.

Step 4: Install your Office 2024 product key

cscript ospp.vbs /inpkey:XXXXX-XXXXX-XXXXX-XXXXX-XXXXX

Type your 25-character key, including the dashes. You should see <Product key installation successful>.

Step 5: Activate Office 2024

cscript ospp.vbs /act

Office contacts Microsoft’s activation servers. After a few seconds you should see <Product activation successful>.

Administrator: Command Prompt
C:\Windows\system32> cd “C:\Program Files\Microsoft Office\Office16”1
C:\Program Files\Microsoft Office\Office16> cscript ospp.vbs /inpkey:NKGG6-WBPCR-J4XTP-8QR7M-HV7Q9
—Processing————————–
<Product key installation successful>2
—Exiting—————————–
C:\Program Files\Microsoft Office\Office16> cscript ospp.vbs /act
—Processing————————–
Installed product key detected – attempting to activate the following product:
LICENSE NAME: Office 24, Office24ProPlus2024VL_MAK_AE edition
<Product activation successful>3
1
Moving into the Office16 folder, where ospp.vbs lives.
2
The key is accepted. An error here usually means a typo or the wrong type of key.
3
Office 2024 is activated. Reopen any Office app to see Product Activated.
An illustration of a successful Office LTSC Professional Plus 2024 activation with ospp.vbs. The key shown is a placeholder.

Step 6: Confirm Office 2024 is activated

cscript ospp.vbs /dstatus

Look for LICENSE STATUS: —LICENSED— and the last five characters of your new key. You can also open Word and go to File › Account, which should now say Product Activated.

How to Activate Office 2024 Offline (No Internet)

If the PC can’t go online, activate it with an Installation ID and a Confirmation ID. Phone activation used to handle the middle step, but Microsoft replaced it with an online Product Activation Portal in December 2025, so you’ll need a phone or another device with internet. Microsoft explains the portal in its guide to activating perpetual products using the Product Activation Portal.

1
Install the key
Run cscript ospp.vbs /inpkey: followed by your key, as in the online method.
2
Show the Installation ID
Run cscript ospp.vbs /dinstid. Write down the long number shown for Office 24.
3
Get a Confirmation ID
On a phone or another PC, open the Product Activation Portal (aka.ms/aoh), sign in and enter the Installation ID.
4
Enter the Confirmation ID
Back on the offline PC, run cscript ospp.vbs /actcid: followed by the Confirmation ID, with no spaces or dashes.
5
Check the result
Run cscript ospp.vbs /dstatus and look for LICENSED.
Activating Office 2024 offline. Only Step 3 needs internet, on a separate device.
Administrator: Command Prompt
C:\Program Files\Microsoft Office\Office16> cscript ospp.vbs /dinstid
—Processing————————–
Installation ID for: Office 24, Office24ProPlus2024VL_MAK_AE edition:
1234567234567834567894567890567890167890127890123890123490123451
—Exiting—————————–
C:\Program Files\Microsoft Office\Office16> cscript ospp.vbs /actcid:1234562345673456784567895678906789017890128901232
<Product activation successful>
1
The Installation ID. Enter it in the Product Activation Portal on another device.
2
Paste the Confirmation ID the portal gives you into /actcid. It’s tied to this PC and key only.
An illustration of offline Office 2024 activation. Your Installation ID and Confirmation ID will be different.

The portal steps are the same whether you’re activating Office or Windows. Our guide to activating Windows Server without internet shows each portal screen in detail.

How to Activate Office LTSC 2024 With KMS

Businesses with volume licensing often activate Office LTSC 2024 against a KMS host on their own network instead of contacting Microsoft from every PC. Volume installs of Office LTSC 2024 come with a KMS client key (GVLK) already installed, so usually you only need to point Office at the host.

1
Install the KMS client key (if needed)
Only if a MAK or retail key was installed before. Microsoft publishes the Office LTSC 2024 GVLKs; install the one for your edition with /inpkey:.
2
Set the KMS host
Run cscript ospp.vbs /sethst:kms.yourcompany.local, using your KMS server’s name or IP address.
3
Set the port (optional)
Only if your host doesn’t use the default port 1688: cscript ospp.vbs /setprt:1688.
4
Activate
Run cscript ospp.vbs /act.
5
Check KMS history
Run cscript ospp.vbs /dhistorykms to see when the PC last contacted the host.
Activating Office LTSC 2024 against a KMS host on your network.

A few things to know about KMS: the KMS host must have the Office LTSC 2024 volume licence pack installed and activated, KMS activation lasts 180 days and renews automatically when the PC can reach the host, and a KMS host only starts activating Office once at least 5 clients have contacted it. On domain networks, Active Directory-based activation can replace KMS entirely.

One-Click Activation Script and Remote PCs

Activate Office 2024 with a batch file

If you activate Office often, save these lines in Notepad as activate-office-2024.bat, replace the X’s with your key, then right-click the file and select Run as administrator. It finds the right folder for 32-bit or 64-bit Office automatically:

@echo off
cd /d "%ProgramFiles%\Microsoft Office\Office16" 2>nul
if not exist ospp.vbs cd /d "%ProgramFiles(x86)%\Microsoft Office\Office16"
cscript //nologo ospp.vbs /inpkey:XXXXX-XXXXX-XXXXX-XXXXX-XXXXX
cscript //nologo ospp.vbs /act
cscript //nologo ospp.vbs /dstatus
pause

The //nologo switch hides the Windows Script Host banner so the results are easier to read, and pause keeps the window open so you can check for LICENSED.

Activate Office on another PC on your network

ospp.vbs can activate a remote computer by adding its name after the command. Microsoft’s example looks like this:

cscript ospp.vbs /inpkey:XXXXX-XXXXX-XXXXX-XXXXX-XXXXX PC-NAME
cscript ospp.vbs /act PC-NAME

You need administrator rights on the remote PC, and Windows Firewall on it must allow WMI traffic. Add a username and password after the computer name if your current account isn’t an administrator there.

How to Read the ospp.vbs /dstatus Output

The /dstatus output looks technical, but only four lines matter:

Administrator: Command Prompt
C:\Program Files\Microsoft Office\Office16> cscript ospp.vbs /dstatus
—Processing————————–
PRODUCT ID: 00000-00000-00000-AA000
LICENSE NAME: Office 24, Office24ProPlus2024VL_MAK_AE edition1
LICENSE DESCRIPTION: Office 24, VOLUME_MAK channel2
LICENSE STATUS: —LICENSED—3
Last 5 characters of installed product key: HV7Q94
—Exiting—————————–
1
The product. Office 24 and 2024 confirm it’s Office 2024; ProPlus or Standard shows the edition.
2
The channel: RETAIL, VOLUME_MAK or VOLUME_KMSCLIENT. Your key must match it.
3
The status. LICENSED means activated.
4
The end of the installed key. Use it with /unpkey to remove the key.
An illustration of /dstatus for an activated copy of Office LTSC Professional Plus 2024.
—LICENSED—
Activated
Office 2024 is fully activated. Nothing more to do.
—OOB_GRACE—
Not activated yet
Office is in its first grace period. Run /act or enter a key.
—NOTIFICATIONS—
Activation failed
Office runs with limited features. Check the ERROR CODE line.
—OOT_GRACE—
KMS out of contact
A KMS client hasn’t reached its host. Check /sethst and your network.
—UNLICENSED—
No valid licence
Install a key with /inpkey, then run /act.
No installed product keys detected
Account-based licence
Usually Microsoft 365 or a retail copy linked to an account. ospp.vbs can’t manage it.
What each LICENSE STATUS value means in the ospp.vbs /dstatus output.

ospp.vbs Command Reference

These are the ospp.vbs options you’re most likely to need for Office 2024. Every one starts with cscript ospp.vbs. The full list is in Microsoft’s volume activation tools documentation, or run cscript ospp.vbs /?.

CommandWhat it does
/actActivate the installed Office product keys online.
/inpkey:keyInstall a product key, replacing any existing key for that product.
/unpkey:XXXXXRemove a product key, using its last five characters from /dstatus.
/dstatusShow licence information for installed product keys.
/dstatusallShow licence information for every installed licence.
/dinstidShow the Installation ID for offline activation.
/actcid:IDActivate offline with a Confirmation ID.
/dhistoryacterrShow the failure history for retail and MAK activation.
/ddescr:codeExplain an error code, for example /ddescr:0xC004F074.
/rearmReset the licensing status for all installed Office products.
/sethst:hostSet the KMS host name or IP address.
/setprt:portSet the KMS port (default 1688).
/remhstRemove the KMS host name and reset the port.
/dhistorykmsShow the KMS client activation history.
/dcmidShow the PC’s KMS client machine ID (CMID).
ospp.vbs options for activating and managing Office 2024. Source: Microsoft Learn.

Office 2024 ospp.vbs Error Codes and Fixes

When activation fails, ospp.vbs shows an ERROR CODE and an error description. Run cscript ospp.vbs /ddescr: followed by the code for Microsoft’s explanation. These are the ones that come up most with Office 2024:

“Input Error: Can not find script file”
You’re not in the folder that contains ospp.vbs.
Fix:Try the Program Files (x86) or root\Office16 path, or use cscript .\ospp.vbs in PowerShell.
Error 0x80070005: Access denied
Command Prompt isn’t running as administrator.
Fix:Close it and reopen with Run as administrator.
Error 0xC004F050
The product key is invalid or was mistyped.
Fix:Check each character. Office keys never contain the letters A, E, I, L, O, S, U or Z, or the digits 0, 1 or 5.
Error 0xC004F069
The key doesn’t match the installed edition, for example a retail key on LTSC.
Fix:Check the channel in /dstatus. See fixing a retail and volume mismatch.
Error 0xC004C008
The key has reached its activation limit.
Error 0xC004F074
A KMS client can’t reach a KMS host.
Fix:Check the host name with /sethst, confirm port 1688 is open, or install a MAK key instead.
Error 0xC004F038
The KMS host doesn’t have enough clients yet.
Fix:A KMS host needs at least 5 Office clients before it activates any of them.
Error 0x4004F00C
Office is in its grace period and not yet activated.
Fix:Run /act again, or follow our 0x4004F00C guide.
Common ospp.vbs errors when activating Office 2024, and how to fix each one.

Activation succeeds but Word still says Unlicensed Product? Close every Office app, including Outlook running in the system tray, and reopen them. If it persists, our guide to Office 2024 key not working covers more fixes.

Need an Office 2024 Product Key?

Noxkeys delivers genuine Office 2024 Professional Plus keys instantly by email, ready to activate with the ospp.vbs commands in this guide or through the normal setup screen. Not sure whether you need Office 2024 or a subscription? Our Office 2024 vs Microsoft 365 vs LibreOffice comparison helps you decide.

Microsoft Office 2024 Professional Plus
Latest version · one-time purchase
Office 2024 Professional Plus
Word, Excel, PowerPoint, Outlook, Access and more.
View Office 2024
Microsoft Office 2021 Professional Plus
Proven · lower price
Office 2021 Professional Plus
The same activation commands work for 2021.
View Office 2021

Browse all Microsoft Office licences, read our FAQ, or contact support with a screenshot of your /dstatus output if activation fails.

Frequently Asked Questions

How do I activate Office 2024 using Command Prompt?

Open Command Prompt as administrator, run cd “C:\Program Files\Microsoft Office\Office16”, then cscript ospp.vbs /inpkey: followed by your product key, and cscript ospp.vbs /act. Check with cscript ospp.vbs /dstatus that the licence status is LICENSED.

Where is ospp.vbs in Office 2024?

In C:\Program Files\Microsoft Office\Office16 for 64-bit Office, or C:\Program Files (x86)\Microsoft Office\Office16 for 32-bit Office on 64-bit Windows. Some installs use C:\Program Files\Microsoft Office\root\Office16.

Does ospp.vbs work for Office 2024 Home and Home & Business?

Only if the copy was activated with a product key. Most consumer copies of Office 2024 are linked to a Microsoft account; for those, /dstatus shows no installed keys and you activate by signing in.

Can I activate Microsoft 365 with ospp.vbs?

No. Microsoft 365 apps activate by signing in with a Microsoft account, and Microsoft says ospp.vbs doesn’t work for them.

How do I activate Office 2024 without internet?

Install the key with /inpkey, run cscript ospp.vbs /dinstid to show the Installation ID, enter it in Microsoft’s Product Activation Portal on another device, then run cscript ospp.vbs /actcid: followed by the Confirmation ID.

Is activating Office 2024 with ospp.vbs legal?

Yes, when you use a genuine product key. ospp.vbs is Microsoft’s own tool and is documented by Microsoft. Using it with unlicensed KMS servers or activator scripts is not legitimate.

Why does ospp.vbs say Input Error: Can not find script file?

You’re not in the folder that contains ospp.vbs, or you’re in PowerShell without .\ before the script name. Move to the correct Office16 folder or run cscript .\ospp.vbs.

How do I check if Office 2024 is activated from Command Prompt?

Run cscript ospp.vbs /dstatus from the Office16 folder. LICENSE STATUS: —LICENSED— means Office 2024 is activated.

What does error 0xC004F074 mean in Office 2024?

The PC couldn’t reach a KMS host. Check the host name with /sethst, make sure port 1688 is open, or install a MAK or retail key and run /act instead.

Can I use the same commands for Office 2021 and 2019?

Yes. Office 2016, 2019, 2021 and 2024 all keep ospp.vbs in the Office16 folder and use the same commands.

Leave a Reply

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


Instant Delivery

Get instant delivery by email

Secure Payments

100% protected transactions

Replacement or Refund

Key doesn’t work? We’ll replace it or refund you

Free activation support

Help with installing & activating