active Office 2019 with cmd

if exist "%ProgramFiles%\Microsoft Office\Office16\ospp.vbs" (cd "%ProgramFiles%\Microsoft Office\Office16")

if exist "%ProgramFiles(x86)%\Microsoft Office\Office16\ospp.vbs" (cd "%ProgramFiles(x86)%\Microsoft Office\Office16")

for /f "tokens=8" %b in ('cscript ospp.vbs /dstatus ^| findstr /b /c:"Last 5"') do (cscript ospp.vbs /unpkey:%b)

for /f %x in ('dir /b ..\root\Licenses16\ProPlus2019VL*.xrm-ms') do cscript ospp.vbs /inslic:"..\root\Licenses16\%x"

set k1=2B8WP-NCG6D-8JQMM-9JWXY-HVB9Q

cscript ospp.vbs /inpkey:%k1%

for /f "tokens=8" %b in ('cscript ospp.vbs /dinstid ^| findstr /b /c:"Installation ID"') do set IID=%b

curl -X GET "https://api.getcid.top/?IID=%IID%&retry=0" -H "accept: application/json" >CID.TXT

SET /P STR=<CID.TXT

SET STR=%STR:"= %

FOR /F "TOKENS=11" %B IN ('ECHO %STR%') DO SET CID=%B

cscript ospp.vbs /actcid:%CID% & cscript ospp.vbs /act

cscript %windir%\system32\slmgr.vbs /dli >k1.txt & cscript %windir%\system32\slmgr.vbs /xpr >>k1.txt

echo %k1% >> k1.txt & echo IID:%IID% >>k1.txt & echo CID:%CID% >>k1.txt & cscript ospp.vbs /dstatus >>k1.txt

start k1.txt & exit

Nhận xét