Skip to content

Instantly share code, notes, and snippets.

@AneurysAdames
Forked from devomman/activate-office-windows-mac.md
Created September 4, 2024 12:01
Show Gist options
  • Save AneurysAdames/2bcbfc58707168a0bc87c2754f62014a to your computer and use it in GitHub Desktop.
Save AneurysAdames/2bcbfc58707168a0bc87c2754f62014a to your computer and use it in GitHub Desktop.
Office Activation Command by Omman

Office 2021

Method 1: Using my command line

Step 1.1: Open cmd program with administrator rights.

  • First, you need to open cmd in the admin mode, then run all commands below one by one.

Step 1.2: Get into the Office directory in cmd.

  • For x86 and x64
cd /d %ProgramFiles(x86)%\Microsoft Office\Office16
cd /d %ProgramFiles%\Microsoft Office\Office16
  • If you install your Office in the ProgramFiles folder, the Office directory depends on the architecture of your OS. If you are not sure of this issue, just run both of the commands above. One of them will be not executed and an error message will be printed on the screen.

Step 1.3: Install Office 2021 volume license.

for /f %x in ('dir /b ..\root\Licenses16\ProPlus2021VL_KMS*.xrm-ms') do cscript ospp.vbs /inslic:"..\root\Licenses16\%x"
  • This step is required. You can not install the KMS client product key of Office without a volume license.

Step 1.4: Activate your Office using the KMS key.

  • Make sure your device is connected to the internet, then run the following commands.
cscript ospp.vbs /setprt:1688
cscript ospp.vbs /unpkey:6F7TH >nul
cscript ospp.vbs /inpkey:FXYTK-NJJ8C-GB6DW-3DYQT-6F7TH
cscript ospp.vbs /sethst:e8.us.to
cscript ospp.vbs /act
  • If you see the error 0xC004F074, it means that your internet connection is unstable or the server is busy. Please make sure your device is online and try the command “act” again until you succeed.

Here is all the text you will get in the command prompt window

C:\Windows\system32>cd /d %ProgramFiles(x86)%\Microsoft Office\Office16
The system cannot find the path specified.

C:\Windows\system32>cd /d %ProgramFiles%\Microsoft Office\Office16

C:\Program Files\Microsoft Office\Office16>for /f %x in ('dir /b ..\root\Licenses16\ProPlus2021VL_KMS*.xrm-ms') do cscript ospp.vbs /inslic:"..\root\Licenses16\%x"

C:\Program Files\Microsoft Office\Office16>cscript ospp.vbs /inslic:"..\root\Licenses16\ProPlus2021VL_KMS_Client_AE-ppd.xrm-ms"
Microsoft (R) Windows Script Host Version 5.812
Copyright (C) Microsoft Corporation. All rights reserved.

---Processing--------------------------
---------------------------------------
Installing Office license: ..\root\licenses16\proplus2021vl_kms_client_ae-ppd.xrm-ms
Office license installed successfully.
---------------------------------------
---Exiting-----------------------------

C:\Program Files\Microsoft Office\Office16>cscript ospp.vbs /inslic:"..\root\Licenses16\ProPlus2021VL_KMS_Client_AE-ul-oob.xrm-ms"
Microsoft (R) Windows Script Host Version 5.812
Copyright (C) Microsoft Corporation. All rights reserved.

---Processing--------------------------
---------------------------------------
Installing Office license: ..\root\licenses16\proplus2021vl_kms_client_ae-ul-oob.xrm-ms
Office license installed successfully.
---------------------------------------
---Exiting-----------------------------

C:\Program Files\Microsoft Office\Office16>cscript ospp.vbs /inslic:"..\root\Licenses16\ProPlus2021VL_KMS_Client_AE-ul.xrm-ms"
Microsoft (R) Windows Script Host Version 5.812
Copyright (C) Microsoft Corporation. All rights reserved.

---Processing--------------------------
---------------------------------------
Installing Office license: ..\root\licenses16\proplus2021vl_kms_client_ae-ul.xrm-ms
Office license installed successfully.
---------------------------------------
---Exiting-----------------------------

C:\Program Files\Microsoft Office\Office16>cscript ospp.vbs /setprt:1688
Microsoft (R) Windows Script Host Version 5.812
Copyright (C) Microsoft Corporation. All rights reserved.

---Processing--------------------------
---------------------------------------
Successfully applied setting.
---------------------------------------
---Exiting-----------------------------

C:\Program Files\Microsoft Office\Office16>cscript ospp.vbs /unpkey:6F7TH >nul

C:\Program Files\Microsoft Office\Office16>cscript ospp.vbs /inpkey:FXYTK-NJJ8C-GB6DW-3DYQT-6F7TH
Microsoft (R) Windows Script Host Version 5.812
Copyright (C) Microsoft Corporation. All rights reserved.

---Processing--------------------------
---------------------------------------
<Product key installation successful>
---------------------------------------
---Exiting-----------------------------

C:\Program Files\Microsoft Office\Office16>cscript ospp.vbs /sethst:e8.us.to
Microsoft (R) Windows Script Host Version 5.812
Copyright (C) Microsoft Corporation. All rights reserved.

---Processing--------------------------
---------------------------------------
Successfully applied setting.
---------------------------------------
---Exiting-----------------------------

C:\Program Files\Microsoft Office\Office16>cscript ospp.vbs /act
Microsoft (R) Windows Script Host Version 5.812
Copyright (C) Microsoft Corporation. All rights reserved.

---Processing--------------------------
---------------------------------------
Installed product key detected - attempting to activate the following product:
SKU ID: cd18ecc0-466a-45d4-8d2e-8c4fa48ae591
LICENSE NAME: Office 21, Office21ProPlus2021R_Grace edition
LICENSE DESCRIPTION: Office 21, RETAIL(Grace) channel
Last 5 characters of installed product key: PG343
ERROR CODE: 0xC004F017
ERROR DESCRIPTION: The Software Licensing Service reported that the license is not installed.
---------------------------------------
Installed product key detected - attempting to activate the following product:
SKU ID: fbdb3e18-a8ef-4fb3-9183-dffd60bd0984
LICENSE NAME: Office 21, Office21ProPlus2021VL_KMS_Client_AE edition
LICENSE DESCRIPTION: Office 21, VOLUME_KMSCLIENT channel
Last 5 characters of installed product key: 6F7TH
<Product activation successful>
---------------------------------------
---------------------------------------
---Exiting-----------------------------

C:\Program Files\Microsoft Office\Office16>

Congratulations! The activation was completed successfully.

==========================================

Method 2: Using my pre-written batch script

Step 2.1: Copy the script code below into a new text document.

@echo off
title Activate Microsoft Office 2021 (ALL versions) for FREE - office.com&cls&echo =====================================================================================&echo #Project: Activating Microsoft software products for FREE without additional software&echo =====================================================================================&echo.&echo #Supported products:&echo - Microsoft Office Standard 2021&echo - Microsoft Office Professional Plus 2021&echo.&echo.&(if exist "%ProgramFiles%\Microsoft Office\Office16\ospp.vbs" cd /d "%ProgramFiles%\Microsoft Office\Office16")&(if exist "%ProgramFiles(x86)%\Microsoft Office\Office16\ospp.vbs" cd /d "%ProgramFiles(x86)%\Microsoft Office\Office16")&(for /f %%x in ('dir /b ..\root\Licenses16\ProPlus2021VL_KMS*.xrm-ms') do cscript ospp.vbs /inslic:"..\root\Licenses16\%%x" >nul)&echo.&echo =====================================================================================&echo Activating your product...&cscript //nologo slmgr.vbs /ckms >nul&cscript //nologo ospp.vbs /setprt:1688 >nul&cscript //nologo ospp.vbs /unpkey:6F7TH >nul&set i=1&cscript //nologo ospp.vbs /inpkey:FXYTK-NJJ8C-GB6DW-3DYQT-6F7TH >nul||goto notsupported
:skms
if %i% GTR 10 goto busy
if %i% EQU 1 set KMS=kms7.office.com
if %i% EQU 2 set KMS=e8.us.to
if %i% EQU 3 set KMS=e9.us.to
if %i% GTR 3 goto ato
cscript //nologo ospp.vbs /sethst:%KMS% >nul
:ato
echo =====================================================================================&echo.&echo.&cscript //nologo ospp.vbs /act | find /i "successful" && (echo.&echo =====================================================================================&echo.&echo #Please consider supporting this project: donate to my paypal "devomman@gmail" &echo #Your support is helping me keep my servers running 24/7!&echo.&echo =====================================================================================&choice /n /c YN /m "Would you like to visit my blog [Y,N]?" & if errorlevel 2 exit) || (echo The connection to my KMS server failed! Trying to connect to another one... & echo Please wait... & echo. & echo. & set /a i+=1 & goto skms)
explorer "https://www.office.com/"&goto halt
:notsupported
echo =====================================================================================&echo.&echo Sorry, your version is not supported.&echo.&goto halt
:busy
echo =====================================================================================&echo.&echo Sorry, the server is busy and can't respond to your request. Please try again.&echo.
:halt
pause >nul

Step 2.2: Save this text file as a cmd file. (Eg. office.cmd).

Step 2.3: Run the cmd file in admin mode.

Step 2.4: Check the activation status again.

Done! Your product is activated successfully now.

More information:

  • Here is the KMS client key of Office 2021: FXYTK-NJJ8C-GB6DW-3DYQT-6F7TH.

  • The Office 2021 KMS license is valid for 180 days only but it can be renewed automatically so you needn’t worry so much about the period.

  • If you would have any questions or concerns, please leave your comments. I would be glad to explain in more details. Thank you so much for all your feedback and support!

@amouche-2023
Copy link

Methode working very well but i still recommend to buy an activation key, cheaper, safer and easier .

I got one in this website https://rb.gy/pug44h they were so supportive and their client service was amazing.

@Nyzuky
Copy link

Nyzuky commented Feb 8, 2025

I followed all the steps but why is it saying this? Or am i just missing something?
image

@cosmoqwe
Copy link

idk what about a safety but it works

@DD12da
Copy link

DD12da commented Feb 28, 2025

I have created the account just to leave a comment that this actually works <3

@MarieSterner
Copy link

I bought genuine Microsoft Office 2021 pro lifetime license key in very reasonable. You can also see here

Thanks. I Take a Office 2021 pro from the website with big discount. instantly delivered and worked without any problem .There key is global, I activate from USA I trust the website because I noticed the company registered the UK. you can also see here

https://find-and-update.company-information.service.gov.uk/company/15123928

Thanks, I was looking for Office 2024 professional. And i got office 2024 pro global key from that website very low price and worked.

@Kivice
Copy link

Kivice commented Mar 19, 2025

wow it works

@shorkarjakir
Copy link

Great, it works bro..

@gvattoz
Copy link

gvattoz commented Mar 31, 2025

hi
how can i deal with this
Publication1

@umbravaen
Copy link

The first method worked for me and even though the error did occur it didnt stop the activation. Thanks man :)

@BillCY3721
Copy link

Millions of thanks for your guidance and great help. It really works!

@MichPreStew
Copy link

All that came from msguides.com . You can get kms activation for windows , office , windows server , project , visio , office 365 , all versions . They even give you the cmd command lines to do it your self. Just remember to go into windows fire wall and allow app through , changing settings for KMS if you dont it wont let it work . i have had it actually remove my KMS files before i learned that.

@rapadeyeye
Copy link

Both method gave an error. Please assist.
1st method gave an error code while running the last command. I restarted the system thinking it will resolve the issue but didnt work. Please see the output below:

C:\Program Files\Microsoft Office\Office16>cscript ospp.vbs /unpkey:6F7TH >nul

C:\Program Files\Microsoft Office\Office16>cscript ospp.vbs /inpkey:FXYTK-NJJ8C-GB6DW-3DYQT-6F7TH
Microsoft (R) Windows Script Host Version 5.812
Copyright (C) Microsoft Corporation. All rights reserved.

---Processing--------------------------

--------------------------------------- ---Exiting-----------------------------

C:\Program Files\Microsoft Office\Office16>cscript ospp.vbs /sethst:e8.us.to
Microsoft (R) Windows Script Host Version 5.812
Copyright (C) Microsoft Corporation. All rights reserved.

---Processing--------------------------

Successfully applied setting.

---Exiting-----------------------------

C:\Program Files\Microsoft Office\Office16>cscript ospp.vbs /act
Microsoft (R) Windows Script Host Version 5.812
Copyright (C) Microsoft Corporation. All rights reserved.

---Processing--------------------------

Installed product key detected - attempting to activate the following product:
SKU ID: fbdb3e18-a8ef-4fb3-9183-dffd60bd0984
LICENSE NAME: Office 21, Office21ProPlus2021VL_KMS_Client_AE edition
LICENSE DESCRIPTION: Office 21, VOLUME_KMSCLIENT channel
Last 5 characters of installed product key: 6F7TH
ERROR CODE: 0x80080005
ERROR DESCRIPTION: Run the following: cscript ospp.vbs /ddescr:0x80080005


---Exiting-----------------------------

The 2nd method gave the error below:

=====================================================================================
#Project: Activating Microsoft software products for FREE without additional software

#Supported products:

  • Microsoft Office Standard 2021
  • Microsoft Office Professional Plus 2021

=====================================================================================
Activating your product...

The connection to my KMS server failed! Trying to connect to another one...
Please wait...

=====================================================================================

The connection to my KMS server failed! Trying to connect to another one...
Please wait...

=====================================================================================

@AbdelazizEl7or
Copy link

Thank you very much

@MichPreStew
Copy link

Look at that CMD command lines. You will see the main command is SLMGR/ this is your door way into windows back door. Then the path to what you want to do, IPK install product key. ATO activate windows. If you want the command list just type from the cmd line slmgr/ Then enter it will show you the command list and its long. Now things change a little when you Type slmgr.vbs /dlv all and press Enter. This will display detailed information about the current Windows activation, including the product key and license. Type slmgr.vbs /upk and press Enter. This will remove the current product key. Type slmgr.vbs /ipk xxxxx-xxxxx-xxxxx-xxxxx and press Enter, replacing the xxxxx placeholders with your new product key, .Type slmgr.vbs /ato and press Enter. This will attempt to activate Windows using the newly installed product key ,Type slmgr.vbs /cpky and press Enter. This will remove the product key from the system registry. Always look at you command lines so you now whats going on dont just compile lines into .cmd .and run then. ( note. command lines in note pad are saved as ANSI ???.CMD)

@MichPreStew
Copy link

The connection to my KMS server failed! Trying to connect to another one...
Please wait... This is because your windows fire wall wont let it go thru . Change fire wall settings to let or ok KMS to work.

@AbdelazizEl7or
Copy link

The connection to my KMS server failed! Trying to connect to another one... Please wait... This is because your windows fire wall wont let it go thru . Change fire wall settings to let or ok KMS to work.

Try run CMD as administrator

@borito915
Copy link

THANK YOU BROOOOOOOOOOOOOO you are a great man, thanks soooo much, the 2nd method worked perfectly

@bhola72
Copy link

bhola72 commented May 4, 2025

buy Microsoft windows and office products, very low price, dm on telegram @macman3 . Best price guarantee

@KennethOdoh
Copy link

This really worked! Thank you!

@motivationturf
Copy link

I used the pre-written batch script and worked with so much ease. Best thing created after slice bread. Than k you!

@NAUM1981
Copy link

NAUM1981 commented May 23, 2025

Thanks for recommendation bro, this work!!

This is work for me https://shorturl.at/DXF5U

Windows 11 pro key retail, and they partnered with microsoft

Thanks you, got office ltsc 2024 pro plus here + windows 10 pro

Both key really retail, and they give me all certification for my keys.

@Subinmhrzn
Copy link

Thankyou so much for the help
It worked completly fine in my machine
As a student it helped a lot thankyou so much

@wanbuadev
Copy link

It still works excellently well. Thanks a bunch.

@wanbuadev
Copy link

wanbuadev commented Jun 6, 2025

@gvattoz
@Nyzuky
Were you able to work around this? I would love to help if you or anyone else is still experiencing this error.

@elitemedicaltraining
Copy link

Thank you . This worked . I actived office with your process. I get the product key from here

@wanbuadev
Copy link

wanbuadev commented Jun 13, 2025 via email

@Shoronbasak
Copy link

thank you brother this really worked , i tried both the methods 1st method did't worked for me , the 2nd one did

@wanbuadev
Copy link

wanbuadev commented Jun 27, 2025 via email

@AhmedMetwaly0
Copy link

How brilliant,
Much appreciated!

@Ciao-Matthew
Copy link

I recently purchased a Microsoft 365 license key from MSKeyDeals, and the experience was smooth and reliable. The activation process was quick, and the key worked without any issues. Definitely a great option if you're looking for genuine software at a reasonable price. Hope this helps anyone considering it!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment