Open Command Prompt as Administrator and run the commands in sequence:
:: Step 1 – Install correct GVLK for your edition (examples)
slmgr /ipk W269N-WFGWX-YVC9B-4J6C9-T83GX REM Windows 10/11 Pro
:: slmgr /ipk NPPR9-FWDCX-D2C8J-H872K-2YT43 REM Windows 10/11 Enterprise
:: slmgr /ipk M7XTQ-FN8P6-TTKYV-9D4CC-J462D REM Windows 10/11 Enterprise LTSC 2021
:: slmgr /ipk XGVPP-NMH47-7TTHJ-W3FW7-8HV2C REM Windows 10/11 Enterprise LTSC 2024
:: Step 2 – Point to this KMS server
slmgr /skms kms-windows.net
:: Step 3 – Activate
slmgr /ato
:: Optional – Check status
slmgr /dlv
slmgr /xpr
Change directory to your Office folder (usually Office16 for 2019–2024 versions), then run as Administrator:
cd "C:\Program Files\Microsoft Office\Office16"
:: Step 1 – Install GVLK (examples)
cscript ospp.vbs /inpkey:XJ2XN-FW8RK-P4HMP-DKDBV-GCVGB REM LTSC 2024 ProPlus
:: cscript ospp.vbs /inpkey:FXYTK-NJJ8C-GB6DW-3DYQT-6F7TH REM Office 2021 ProPlus
:: cscript ospp.vbs /inpkey:NMMKJ-6RK4F-KMJVX-8D9MJ-6MWKP REM Office 2019 ProPlus
:: Step 2 – Set KMS host (default port 1688)
cscript ospp.vbs /sethst:kms-windows.net
:: Step 3 – Activate
cscript ospp.vbs /act
:: Check status
cscript ospp.vbs /dstatus
/setprt.