Bạn tham khảo code sau (code này đc chia sẻ trên diễn đàn mình):
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 %i in ('dir /b ..\root\Licenses16\ProPlus2021VL_MAK*.xrm-ms') do cscript ospp.vbs /inslic:"..\root\Licenses16\%i"
for /f %i in ('dir /b ..\root\Licenses16\ProPlus2019VL_MAK*.xrm-ms') do cscript ospp.vbs /inslic:"..\root\Licenses16\%i"
for /f %i in ('dir /b ..\root\Licenses16\ProPlusVL_MAK*.xrm-ms') do cscript ospp.vbs /inslic:"..\root\Licenses16\%i"
exit
slmgr /skms kms.digiboy.ir
cd "%SystemRoot%\System32"
cscript slmgr.vbs /ilc "C:\Program Files\Microsoft Office\root\Licenses16\ProPlus2021VL_KMS_Client_AE-ppd.xrm-ms"
cscript slmgr.vbs /ilc "C:\Program Files\Microsoft Office\root\Licenses16\ProPlus2021VL_KMS_Client_AE-ul.xrm-ms"
cscript slmgr.vbs /ilc "C:\Program Files\Microsoft Office\root\Licenses16\ProPlus2021VL_KMS_Client_AE-ul-oob.xrm-ms"
cscript slmgr.vbs /ilc "C:\Program Files\Microsoft Office\root\Licenses16\ProPlus2021VL_MAK_AE1-pl.xrm-ms"
cscript slmgr.vbs /ilc "C:\Program Files\Microsoft Office\root\Licenses16\ProPlus2021VL_MAK_AE1-ppd.xrm-ms"
cscript slmgr.vbs /ilc "C:\Program Files\Microsoft Office\root\Licenses16\ProPlus2021VL_MAK_AE1-ul-oob.xrm-ms"
cscript slmgr.vbs /ilc "C:\Program Files\Microsoft Office\root\Licenses16\ProPlus2021VL_MAK_AE1-ul-phn.xrm-ms"
cscript slmgr.vbs /ilc "C:\Program Files\Microsoft Office\root\Licenses16\ProPlus2021VL_MAK_AE2-pl.xrm-ms"
cscript slmgr.vbs /ilc "C:\Program Files\Microsoft Office\root\Licenses16\ProPlus2021VL_MAK_AE2-ppd.xrm-ms"
cscript slmgr.vbs /ilc "C:\Program Files\Microsoft Office\root\Licenses16\ProPlus2021VL_MAK_AE2-ul-oob.xrm-ms"
cscript slmgr.vbs /ilc "C:\Program Files\Microsoft Office\root\Licenses16\ProPlus2021VL_MAK_AE2-ul-phn.xrm-ms"
cscript slmgr.vbs /ilc "C:\Program Files\Microsoft Office\root\Licenses16\ProjectPro2021VL_KMS_Client_AE-ppd.xrm-ms"
cscript slmgr.vbs /ilc "C:\Program Files\Microsoft Office\root\Licenses16\ProjectPro2021VL_KMS_Client_AE-ul-oob.xrm-ms"
cscript slmgr.vbs /ilc "C:\Program Files\Microsoft Office\root\Licenses16\ProjectPro2021VL_KMS_Client_AE-ul.xrm-ms"
cscript slmgr.vbs /ilc "C:\Program Files\Microsoft Office\root\Licenses16\ProjectPro2021VL_MAK_AE1-pl.xrm-ms"
cscript slmgr.vbs /ilc "C:\Program Files\Microsoft Office\root\Licenses16\ProjectPro2021VL_MAK_AE1-ppd.xrm-ms"
cscript slmgr.vbs /ilc "C:\Program Files\Microsoft Office\root\Licenses16\ProjectPro2021VL_MAK_AE1-ul-oob.xrm-ms"
cscript slmgr.vbs /ilc "C:\Program Files\Microsoft Office\root\Licenses16\ProjectPro2021VL_MAK_AE1-ul-phn.xrm-ms"
cscript slmgr.vbs /ilc "C:\Program Files\Microsoft Office\root\Licenses16\ProjectPro2021VL_MAK_AE2-pl.xrm-ms"
cscript slmgr.vbs /ilc "C:\Program Files\Microsoft Office\root\Licenses16\ProjectPro2021VL_MAK_AE2-ppd.xrm-ms"
cscript slmgr.vbs /ilc "C:\Program Files\Microsoft Office\root\Licenses16\ProjectPro2021VL_MAK_AE2-ul-oob.xrm-ms"
cscript slmgr.vbs /ilc "C:\Program Files\Microsoft Office\root\Licenses16\ProjectPro2021VL_MAK_AE2-ul-phn.xrm-ms"
cscript slmgr.vbs /ilc "C:\Program Files\Microsoft Office\root\Licenses16\VisioPro2021VL_KMS_Client_AE-ppd.xrm-ms"
cscript slmgr.vbs /ilc "C:\Program Files\Microsoft Office\root\Licenses16\VisioPro2021VL_KMS_Client_AE-ul-oob.xrm-ms"
cscript slmgr.vbs /ilc "C:\Program Files\Microsoft Office\root\Licenses16\VisioPro2021VL_KMS_Client_AE-ul.xrm-ms"
cscript slmgr.vbs /ilc "C:\Program Files\Microsoft Office\root\Licenses16\VisioPro2021VL_MAK_AE-pl.xrm-ms"
cscript slmgr.vbs /ilc "C:\Program Files\Microsoft Office\root\Licenses16\VisioPro2021VL_MAK_AE-ppd.xrm-ms"
cscript slmgr.vbs /ilc "C:\Program Files\Microsoft Office\root\Licenses16\VisioPro2021VL_MAK_AE-ul-oob.xrm-ms"
cscript slmgr.vbs /ilc "C:\Program Files\Microsoft Office\root\Licenses16\VisioPro2021VL_MAK_AE-ul-phn.xrm-ms"
cscript slmgr.vbs /ilc "C:\Program Files\Microsoft Office\root\Licenses16\client-issuance-bridge-office.xrm-ms"
cscript slmgr.vbs /ilc "C:\Program Files\Microsoft Office\root\Licenses16\client-issuance-root.xrm-ms"
cscript slmgr.vbs /ilc "C:\Program Files\Microsoft Office\root\Licenses16\client-issuance-root-bridge-test.xrm-ms"
cscript slmgr.vbs /ilc "C:\Program Files\Microsoft Office\root\Licenses16\client-issuance-stil.xrm-ms"
cscript slmgr.vbs /ilc "C:\Program Files\Microsoft Office\root\Licenses16\client-issuance-ul.xrm-ms"
cscript slmgr.vbs /ilc "C:\Program Files\Microsoft Office\root\Licenses16\client-issuance-ul-oob.xrm-ms"
cscript slmgr.vbs /ilc "C:\Program Files\Microsoft Office\root\Licenses16\pkeyconfig-office.xrm-ms"
cd "C:\Program Files\Microsoft Office\Office16"
echo Office Professional Plus 2021 VL Key
cscript ospp.vbs /inpkey:FXYTK-NJJ8C-GB6DW-3DYQT-6F7TH
echo.
echo Project Professional 2021 VL Key
cscript ospp.vbs /inpkey:FTNWT-C6WBT-8HMGF-K9PRX-QV9H8
echo.
echo Visio Professional 2021 VL Key
cscript ospp.vbs /inpkey:KNH8D-FGHT4-T8RK3-CTDYJ-K2HT4
echo.
echo.
echo Now activating Office 2021 via your preferred KMS Solution.
echo.
pause
echo.
cscript ospp.vbs /act
echo.
echo Press Enter to Quit.
echo.
pause