From 76d7c11bd41bff87ed05a0084f5963d48cf20fad Mon Sep 17 00:00:00 2001 From: abbodi1406 <33669284+abbodi1406@users.noreply.github.com> Date: Tue, 20 Jul 2021 01:01:31 +0300 Subject: [PATCH] v14 Add support for Office 2021 Enhance detection for Office C2R on ARM64 Enhance detection for Office C2R vNext subscriptions Remove _O365asO2019 option --- C2R-R2V-AIO.cmd | 342 ++++++++++++++++++++++++++++++++++++------------ README.md | 58 ++++---- 2 files changed, 292 insertions(+), 108 deletions(-) diff --git a/C2R-R2V-AIO.cmd b/C2R-R2V-AIO.cmd index 9553464..5a13dbe 100644 --- a/C2R-R2V-AIO.cmd +++ b/C2R-R2V-AIO.cmd @@ -1,10 +1,6 @@ @setlocal DisableDelayedExpansion -@set uivr=v13 AIO +@set uivr=v14 AIO @echo off -:: Licenses used for converting Office 365 ProPlus: -:: set _O365asO2019=0 -> use Office 2016 Mondo (if you want some Office 365 features) -:: set _O365asO2019=1 -> use Office 2019 ProPlus (only for Windows 7 and 8.1) -set _O365asO2019=0 :: set to 1 to enable debug mode set _Debug=0 @@ -36,7 +32,7 @@ if /i "%PROCESSOR_ARCHITECTURE%"=="x86" if "%PROCESSOR_ARCHITEW6432%"=="" set "x if /i "%PROCESSOR_ARCHITEW6432%"=="amd64" set "xBit=x64" if /i "%PROCESSOR_ARCHITEW6432%"=="arm64" set "xBit=x86" -set "_psc=powershell -noprofile -c" +set "_psc=powershell -nop -c" if not exist "%SystemRoot%\System32\WindowsPowerShell\v1.0\powershell.exe" goto :E_PS if %_Cnvrt% NEQ 1 set _Debug=1 @@ -48,6 +44,7 @@ goto :TheEnd ) :Passed +set "_Local=%LocalAppData%" set "_batf=%~f0" set "_batp=%_batf:'=''%" set "_log=%~dpn0" @@ -95,6 +92,8 @@ set "_cscript=cscript //Nologo //B" ) else ( set "_cscript=cscript //Nologo" ) +set _LTSC=0 +set "_tag="&set "_ons= 2016" echo %_ln% echo Running C2R-R2V %uivr% @@ -128,7 +127,7 @@ for /f "skip=2 tokens=2*" %%a in ('"reg query HKLM\SOFTWARE\WOW6432Node\Microsof set _Office15=1 ) if %_Office16% EQU 0 if %_Office15% EQU 0 ( -set "msg=No installed Office 2013/2016/2019 product detected..." +set "msg=No installed Office 2013-2021 product detected..." goto :TheEnd ) @@ -158,19 +157,20 @@ set "_LicensesPath=%_InstallRoot%\Licenses16" set "_Integrator=%_InstallRoot%\integration\integrator.exe" for /f "skip=2 tokens=2*" %%a in ('"reg query %_PRIDs% /v ActiveConfiguration" %_Nul6%') do set "_PRIDs=%_PRIDs%\%%b" if "%_ProductIds%"=="" ( -set "msg=Could not detect Office 2016/2019 ProductIDs..." +set "msg=Could not detect Office 2016-2021 ProductIDs..." if %_Office15% EQU 0 (goto :TheEnd) else (goto :Reg15istry) ) if not exist "%_LicensesPath%\ProPlus*.xrm-ms" ( -set "msg=Could not detect Office 2016/2019 Licenses files..." +set "msg=Could not detect Office 2016-2021 Licenses files..." if %_Office15% EQU 0 (goto :TheEnd) else (goto :Reg15istry) ) if not exist "%_Integrator%" ( -set "msg=Could not detect Office 2016/2019 Licenses Integrator..." +set "msg=Could not detect Office 2016-2021 Licenses Integrator..." if %_Office15% EQU 0 (goto :TheEnd) else (goto :Reg15istry) ) -if %winbuild% GEQ 10240 set _O365asO2019=0 -if exist "%_LicensesPath%\Word2019VL_KMS_Client_AE*.xrm-ms" (set "_tag=2019"&set "_ons= 2019") else (set "_tag="&set "_ons= 2016") +if exist "%_LicensesPath%\Word2019VL_KMS_Client_AE*.xrm-ms" (set "_tag=2019"&set "_ons= 2019") +if exist "%_LicensesPath%\Word2021VL_KMS_Client_AE*.xrm-ms" (set _LTSC=1) +if %winbuild% LSS 10240 if !_LTSC! EQU 1 (set "_tag=2021"&set "_ons= 2021") if %_Office15% EQU 0 goto :CheckC2R :Reg15istry @@ -273,6 +273,25 @@ set "msg=No Conversion or Cleanup Required..." goto :TheEnd ) +set _Identity=0 +set _vNext=0 +set sub_O365=0 +set sub_proj=0 +set sub_vis=0 +dir /b /s /a:-d "!_Local!\Microsoft\Office\Licenses\*1*" %_Nul3% && set _Identity=1 +dir /b /s /a:-d "!ProgramData!\Microsoft\Office\Licenses\*1*" %_Nul3% && set _Identity=1 +set kNext=HKCU\SOFTWARE\Microsoft\Office\16.0\Common\Licensing\LicensingNext +if %_Identity% EQU 1 reg query %kNext% /v MigrationToV5Done %_Nul2% | find /i "0x1" %_Nul1% && set _vNext=1 +if %_vNext% EQU 1 ( +reg query %kNext% | findstr /i /r ".*retail" %_Nul2% | findstr /i /v "project visio" %_Nul2% | find /i "0x2" %_Nul1% && (set sub_O365=1) +reg query %kNext% | findstr /i /r ".*retail" %_Nul2% | findstr /i /v "project visio" %_Nul2% | find /i "0x3" %_Nul1% && (set sub_O365=1) +reg query %kNext% | findstr /i /r ".*volume" %_Nul2% | findstr /i /v "project visio" %_Nul2% | find /i "0x2" %_Nul1% && (set sub_O365=1) +reg query %kNext% | findstr /i /r ".*volume" %_Nul2% | findstr /i /v "project visio" %_Nul2% | find /i "0x3" %_Nul1% && (set sub_O365=1) +reg query %kNext% | findstr /i /r "project.*" %_Nul2% | find /i "0x2" %_Nul1% && set sub_proj=1 +reg query %kNext% | findstr /i /r "project.*" %_Nul2% | find /i "0x3" %_Nul1% && set sub_proj=1 +reg query %kNext% | findstr /i /r "visio.*" %_Nul2% | find /i "0x2" %_Nul1% && set sub_vis=1 +reg query %kNext% | findstr /i /r "visio.*" %_Nul2% | find /i "0x3" %_Nul1% && set sub_vis=1 +) set _Retail=0 wmic path %_spp% where "ApplicationID='%_oApp%' AND LicenseStatus='1' AND PartialProductKey<>NULL" get Description %_Nul2% |findstr /V /R "^$" >"!_temp!\crvRetail.txt" find /i "RETAIL channel" "!_temp!\crvRetail.txt" %_Nul1% && set _Retail=1 @@ -297,7 +316,7 @@ set xBit=x86 ) set _exeNum=1 if %xBit%==x64 set _exeNum=2 -if %_Cnvrt% EQU 1 if %_Retail% EQU 0 if %_OMSI% EQU 0 if defined _copp ( +if %_Cnvrt% EQU 1 if %_Identity% EQU 0 if %_Retail% EQU 0 if %_OMSI% EQU 0 if defined _copp ( echo. echo %_ln% echo Cleaning Current Office Licenses... @@ -315,23 +334,31 @@ popd ) echo. echo %_ln% -echo Installing Office Volume Licenses... +echo Checking installed Office Products... echo %_ln% echo. set _O16O365=0 +set _C16Msg=0 +set _C15Msg=0 if %_Retail% EQU 1 wmic path %_spp% where "ApplicationID='%_oApp%' AND LicenseStatus='1' AND PartialProductKey<>NULL" get LicenseFamily %_Nul2% |findstr /V /R "^$" >"!_temp!\crvRetail.txt" wmic path %_spp% where "ApplicationID='%_oApp%'" get LicenseFamily %_Nul2% |findstr /V /R "^$" >"!_temp!\crvVolume.txt" 2>&1 if %_Office16% EQU 0 goto :R15V +set _O21Ids=ProPlus2021,ProjectPro2021,VisioPro2021,Standard2021,ProjectStd2021,VisioStd2021,Access2021,SkypeforBusiness2021 set _O19Ids=ProPlus2019,ProjectPro2019,VisioPro2019,Standard2019,ProjectStd2019,VisioStd2019,Access2019,SkypeforBusiness2019 set _O16Ids=ProjectPro,VisioPro,Standard,ProjectStd,VisioStd,Access,SkypeforBusiness +set _A21Ids=Excel2021,Outlook2021,PowerPoint2021,Publisher2021,Word2021 set _A19Ids=Excel2019,Outlook2019,PowerPoint2019,Publisher2019,Word2019 set _A16Ids=Excel,Outlook,PowerPoint,Publisher,Word +set _V21Ids=%_O21Ids%,%_A21Ids% set _V19Ids=%_O19Ids%,%_A19Ids% set _V16Ids=Mondo,%_O16Ids%,%_A16Ids%,OneNote set _R16Ids=%_V16Ids%,Professional,HomeBusiness,HomeStudent,O365ProPlus,O365Business,O365SmallBusPrem,O365HomePrem,O365EduCloud -set _RetIds=%_V19Ids%,Professional2019,HomeBusiness2019,HomeStudent2019,%_R16Ids% +set _RetIds=%_V21Ids%,Professional2021,HomeBusiness2021,HomeStudent2021,%_V19Ids%,Professional2019,HomeBusiness2019,HomeStudent2019,%_R16Ids% +set _Suites=Mondo,O365ProPlus,O365Business,O365SmallBusPrem,O365HomePrem,O365EduCloud,ProPlus,Standard,Professional,HomeBusiness,HomeStudent,ProPlus2019,Standard2019,Professional2019,HomeBusiness2019,HomeStudent2019,ProPlus2021,Standard2021,Professional2021,HomeBusiness2021,HomeStudent2021 +set _PrjSKU=ProjectPro,ProjectStd,ProjectPro2019,ProjectStd2019,ProjectPro2021,ProjectStd2021 +set _VisSKU=VisioPro,VisioStd,VisioPro2019,VisioStd2019,VisioPro2021,VisioStd2021 echo %_ProductIds%>"!_temp!\crvProductIds.txt" for %%a in (%_RetIds%,ProPlus) do ( @@ -340,6 +367,14 @@ set _%%a=0 for %%a in (%_RetIds%) do ( findstr /I /C:"%%aRetail" "!_temp!\crvProductIds.txt" %_Nul1% && set _%%a=1 ) +if !_LTSC! EQU 0 for %%a in (%_V21Ids%) do ( +set _%%a=0 +) +if !_LTSC! EQU 1 for %%a in (%_V21Ids%) do ( +findstr /I /C:"%%aVolume" "!_temp!\crvProductIds.txt" %_Nul1% && ( + find /i "Office21%%aVL_KMS_Client" "!_temp!\crvVolume.txt" %_Nul1% && (set _%%a=0) || (set _%%a=1) + ) +) for %%a in (%_V19Ids%) do ( findstr /I /C:"%%aVolume" "!_temp!\crvProductIds.txt" %_Nul1% && ( find /i "Office19%%aVL_KMS_Client" "!_temp!\crvVolume.txt" %_Nul1% && (set _%%a=0) || (set _%%a=1) @@ -373,6 +408,10 @@ findstr /I /C:"%%aRetail" "!_temp!\crvProductIds.txt" %_Nul1% && ( find /i "Office19%%aR_OEM" "!_temp!\crvRetail.txt" %_Nul1% && set _%%a=0 find /i "Office19%%aMSDNR_" "!_temp!\crvRetail.txt" %_Nul1% && set _%%a=0 find /i "Office19%%aVL_MAK" "!_temp!\crvRetail.txt" %_Nul1% && set _%%a=0 + find /i "Office21%%aR_Retail" "!_temp!\crvRetail.txt" %_Nul1% && set _%%a=0 + find /i "Office21%%aR_OEM" "!_temp!\crvRetail.txt" %_Nul1% && set _%%a=0 + find /i "Office21%%aMSDNR_" "!_temp!\crvRetail.txt" %_Nul1% && set _%%a=0 + find /i "Office21%%aVL_MAK" "!_temp!\crvRetail.txt" %_Nul1% && set _%%a=0 ) ) if %_Retail% EQU 1 reg query %_PRIDs%\ProPlusRetail.16 %_Nul3% && ( @@ -386,31 +425,44 @@ wmic path %spp% where 'ApplicationID="%_oApp%" AND LicenseFamily like "Office16O for %%a in (O365ProPlus,O365Business,O365SmallBusPrem,O365HomePrem,O365EduCloud) do set _%%a=0 ) ) +if %sub_O365% EQU 1 ( + for %%a in (%_Suites%) do set _%%a=0 +echo Microsoft 365 product is activated with a subscription. +echo. +) +if %sub_proj% EQU 1 ( + for %%a in (%_PrjSKU%) do set _%%a=0 +echo Microsoft Project is activated with a subscription. +echo. +) +if %sub_vis% EQU 1 ( + for %%a in (%_VisSKU%) do set _%%a=0 +echo Microsoft Visio is activated with a subscription. +echo. +) if %_Cnvrt% NEQ 1 (if %_Office15% EQU 1 (goto :R15V) else (set "msg=Finished"&goto :TheEnd)) -set _C16Msg=0 for %%a in (%_RetIds%,ProPlus) do if !_%%a! EQU 1 ( set _C16Msg=1 ) +if %_C16Msg% EQU 1 ( +echo. +echo %_ln% +echo Installing Office Volume Licenses... +echo %_ln% +echo. +) if %_C16Msg% EQU 0 (if %_Office15% EQU 1 (goto :R15V) else (goto :GVLKC2R)) if !_Mondo! EQU 1 ( call :InsLic Mondo ) if !_O365ProPlus! EQU 1 ( - if !_O365asO2019! EQU 1 ( - if !_Mondo! EQU 0 ( - echo O365ProPlus 2016 Suite -^> ProPlus%_ons% Licenses - echo. - call :InsLic ProPlus%_tag% - ) - ) else ( - echo O365ProPlus 2016 Suite ^<-^> Mondo 2016 Licenses - echo. - call :InsLic O365ProPlus DRNV7-VGMM2-B3G9T-4BF84-VMFTK - if !_Mondo! EQU 0 call :InsLic Mondo - ) +echo O365ProPlus 2016 Suite ^<-^> Mondo 2016 Licenses +echo. +call :InsLic O365ProPlus DRNV7-VGMM2-B3G9T-4BF84-VMFTK +if !_Mondo! EQU 0 call :InsLic Mondo ) if !_O365Business! EQU 1 if !_O365ProPlus! EQU 0 ( set _O365ProPlus=1 @@ -447,102 +499,153 @@ echo. call :InsLic O365ProPlus DRNV7-VGMM2-B3G9T-4BF84-VMFTK if %_Office15% EQU 1 (goto :R15V) else (goto :GVLKC2R) ) -if !_ProPlus2019! EQU 1 if !_O365ProPlus! EQU 0 ( -echo ProPlus 2019 Suite +if !_ProPlus2021! EQU 1 if !_O365ProPlus! EQU 0 ( +echo ProPlus 2021 Suite +echo. +call :InsLic ProPlus2021 +) +if !_ProPlus2019! EQU 1 if !_O365ProPlus! EQU 0 if !_ProPlus2021! EQU 0 ( +echo ProPlus 2019 Suite -^> ProPlus%_ons% Licenses echo. call :InsLic ProPlus%_tag% ) -if !_ProPlus! EQU 1 if !_O365ProPlus! EQU 0 if !_ProPlus2019! EQU 0 ( +if !_ProPlus! EQU 1 if !_O365ProPlus! EQU 0 if !_ProPlus2021! EQU 0 if !_ProPlus2019! EQU 0 ( echo ProPlus 2016 Suite -^> ProPlus%_ons% Licenses echo. call :InsLic ProPlus%_tag% ) -if !_Professional2019! EQU 1 if !_O365ProPlus! EQU 0 if !_ProPlus2019! EQU 0 if !_ProPlus! EQU 0 ( +if !_Professional2021! EQU 1 if !_O365ProPlus! EQU 0 if !_ProPlus2021! EQU 0 if !_ProPlus2019! EQU 0 if !_ProPlus! EQU 0 ( +echo Professional 2021 Suite -^> ProPlus 2021 Licenses +echo. +call :InsLic ProPlus2021 +) +if !_Professional2019! EQU 1 if !_O365ProPlus! EQU 0 if !_ProPlus2021! EQU 0 if !_ProPlus2019! EQU 0 if !_ProPlus! EQU 0 if !_Professional2021! EQU 0 ( echo Professional 2019 Suite -^> ProPlus%_ons% Licenses echo. call :InsLic ProPlus%_tag% ) -if !_Professional! EQU 1 if !_O365ProPlus! EQU 0 if !_ProPlus2019! EQU 0 if !_ProPlus! EQU 0 if !_Professional2019! EQU 0 ( +if !_Professional! EQU 1 if !_O365ProPlus! EQU 0 if !_ProPlus2021! EQU 0 if !_ProPlus2019! EQU 0 if !_ProPlus! EQU 0 if !_Professional2021! EQU 0 if !_Professional2019! EQU 0 ( echo Professional 2016 Suite -^> ProPlus%_ons% Licenses echo. call :InsLic ProPlus%_tag% ) -if !_Standard2019! EQU 1 if !_O365ProPlus! EQU 0 if !_ProPlus2019! EQU 0 if !_ProPlus! EQU 0 if !_Professional2019! EQU 0 if !_Professional! EQU 0 ( -echo Standard 2019 Suite +if !_Standard2021! EQU 1 if !_O365ProPlus! EQU 0 if !_ProPlus2021! EQU 0 if !_ProPlus2019! EQU 0 if !_ProPlus! EQU 0 if !_Professional2021! EQU 0 if !_Professional2019! EQU 0 if !_Professional! EQU 0 ( +echo Standard 2021 Suite echo. -call :InsLic Standard2019 +call :InsLic Standard2021 ) -if !_Standard! EQU 1 if !_O365ProPlus! EQU 0 if !_ProPlus2019! EQU 0 if !_ProPlus! EQU 0 if !_Professional2019! EQU 0 if !_Professional! EQU 0 if !_Standard2019! EQU 0 ( +if !_Standard2019! EQU 1 if !_O365ProPlus! EQU 0 if !_ProPlus2021! EQU 0 if !_ProPlus2019! EQU 0 if !_ProPlus! EQU 0 if !_Professional2021! EQU 0 if !_Professional2019! EQU 0 if !_Professional! EQU 0 if !_Standard2021! EQU 0 ( +echo Standard 2019 Suite -^> Standard%_ons% Licenses +echo. +call :InsLic Standard%_tag% +) +if !_Standard! EQU 1 if !_O365ProPlus! EQU 0 if !_ProPlus2021! EQU 0 if !_ProPlus2019! EQU 0 if !_ProPlus! EQU 0 if !_Professional2021! EQU 0 if !_Professional2019! EQU 0 if !_Professional! EQU 0 if !_Standard2021! EQU 0 if !_Standard2019! EQU 0 ( echo Standard 2016 Suite -^> Standard%_ons% Licenses echo. call :InsLic Standard%_tag% ) +for %%a in (ProjectPro,VisioPro,ProjectStd,VisioStd) do if !_%%a2021! EQU 1 ( + echo %%a 2021 SKU + echo. + call :InsLic %%a2021 +) for %%a in (ProjectPro,VisioPro,ProjectStd,VisioStd) do if !_%%a2019! EQU 1 ( -echo %%a 2019 SKU -echo. -if defined _tag (call :InsLic %%a2019) else (call :InsLic %%a) +if !_%%a2021! EQU 0 ( + echo %%a 2019 SKU -^> %%a%_ons% Licenses + echo. + call :InsLic %%a%_tag% + ) ) for %%a in (ProjectPro,VisioPro,ProjectStd,VisioStd) do if !_%%a! EQU 1 ( -if !_%%a2019! EQU 0 ( +if !_%%a2021! EQU 0 if !_%%a2019! EQU 0 ( echo %%a 2016 SKU -^> %%a%_ons% Licenses echo. call :InsLic %%a%_tag% ) ) -for %%a in (HomeBusiness2019,HomeStudent2019) do if !_%%a! EQU 1 ( -if !_O365ProPlus! EQU 0 if !_ProPlus2019! EQU 0 if !_ProPlus! EQU 0 if !_Professional2019! EQU 0 if !_Professional! EQU 0 if !_Standard2019! EQU 0 if !_Standard! EQU 0 ( - set _Standard2019=1 - echo %%a Suite -^> Standard 2019 Licenses +for %%a in (HomeBusiness,HomeStudent) do if !_%%a2021! EQU 1 ( +if !_O365ProPlus! EQU 0 if !_ProPlus2021! EQU 0 if !_ProPlus2019! EQU 0 if !_ProPlus! EQU 0 if !_Professional2021! EQU 0 if !_Professional2019! EQU 0 if !_Professional! EQU 0 if !_Standard2021! EQU 0 if !_Standard2019! EQU 0 if !_Standard! EQU 0 ( + set _Standard2021=1 + echo %%a 2021 Suite -^> Standard 2021 Licenses echo. - call :InsLic Standard2019 + call :InsLic Standard2021 + ) +) +for %%a in (HomeBusiness,HomeStudent) do if !_%%a2019! EQU 1 ( +if !_O365ProPlus! EQU 0 if !_ProPlus2021! EQU 0 if !_ProPlus2019! EQU 0 if !_ProPlus! EQU 0 if !_Professional2021! EQU 0 if !_Professional2019! EQU 0 if !_Professional! EQU 0 if !_Standard2021! EQU 0 if !_Standard2019! EQU 0 if !_Standard! EQU 0 if !_%%a2021! EQU 0 ( + set _Standard2019=1 + echo %%a 2019 Suite -^> Standard%_ons% Licenses + echo. + call :InsLic Standard%_tag% ) ) for %%a in (HomeBusiness,HomeStudent) do if !_%%a! EQU 1 ( -if !_O365ProPlus! EQU 0 if !_ProPlus2019! EQU 0 if !_ProPlus! EQU 0 if !_Professional2019! EQU 0 if !_Professional! EQU 0 if !_Standard2019! EQU 0 if !_Standard! EQU 0 if !_%%a2019! EQU 0 ( - set _Standard2019=1 +if !_O365ProPlus! EQU 0 if !_ProPlus2021! EQU 0 if !_ProPlus2019! EQU 0 if !_ProPlus! EQU 0 if !_Professional2021! EQU 0 if !_Professional2019! EQU 0 if !_Professional! EQU 0 if !_Standard2021! EQU 0 if !_Standard2019! EQU 0 if !_Standard! EQU 0 if !_%%a2021! EQU 0 if !_%%a2019! EQU 0 ( + set _Standard=1 echo %%a 2016 Suite -^> Standard%_ons% Licenses echo. call :InsLic Standard%_tag% ) ) -for %%a in (%_A19Ids%,OneNote) do if !_%%a! EQU 1 ( -if !_O365ProPlus! EQU 0 if !_ProPlus2019! EQU 0 if !_ProPlus! EQU 0 if !_Professional2019! EQU 0 if !_Professional! EQU 0 if !_Standard2019! EQU 0 if !_Standard! EQU 0 ( +for %%a in (%_A21Ids%,OneNote) do if !_%%a! EQU 1 ( +if !_O365ProPlus! EQU 0 if !_ProPlus2021! EQU 0 if !_ProPlus2019! EQU 0 if !_ProPlus! EQU 0 if !_Professional2021! EQU 0 if !_Professional2019! EQU 0 if !_Professional! EQU 0 if !_Standard2021! EQU 0 if !_Standard2019! EQU 0 if !_Standard! EQU 0 ( echo %%a App echo. call :InsLic %%a ) ) +for %%a in (%_A16Ids%) do if !_%%a2019! EQU 1 ( +if !_O365ProPlus! EQU 0 if !_ProPlus2021! EQU 0 if !_ProPlus2019! EQU 0 if !_ProPlus! EQU 0 if !_Professional2021! EQU 0 if !_Professional2019! EQU 0 if !_Professional! EQU 0 if !_Standard2021! EQU 0 if !_Standard2019! EQU 0 if !_Standard! EQU 0 if !_%%a2021! EQU 0 ( + echo %%a 2019 App -^> %%a%_ons% Licenses + echo. + call :InsLic %%a%_tag% + ) +) for %%a in (%_A16Ids%) do if !_%%a! EQU 1 ( -if !_O365ProPlus! EQU 0 if !_ProPlus2019! EQU 0 if !_ProPlus! EQU 0 if !_Professional2019! EQU 0 if !_Professional! EQU 0 if !_Standard2019! EQU 0 if !_Standard! EQU 0 if !_%%a2019! EQU 0 ( - echo %%a 2016 App +if !_O365ProPlus! EQU 0 if !_ProPlus2021! EQU 0 if !_ProPlus2019! EQU 0 if !_ProPlus! EQU 0 if !_Professional2021! EQU 0 if !_Professional2019! EQU 0 if !_Professional! EQU 0 if !_Standard2021! EQU 0 if !_Standard2019! EQU 0 if !_Standard! EQU 0 if !_%%a2021! EQU 0 if !_%%a2019! EQU 0 ( + echo %%a 2016 App -^> %%a%_ons% Licenses echo. call :InsLic %%a%_tag% ) ) -for %%a in (Access2019) do if !_%%a! EQU 1 ( -if !_O365ProPlus! EQU 0 if !_ProPlus2019! EQU 0 if !_ProPlus! EQU 0 if !_Professional2019! EQU 0 if !_Professional! EQU 0 ( - echo %%a App +for %%a in (Access) do if !_%%a2021! EQU 1 ( +if !_O365ProPlus! EQU 0 if !_ProPlus2021! EQU 0 if !_ProPlus2019! EQU 0 if !_ProPlus! EQU 0 if !_Professional2021! EQU 0 if !_Professional2019! EQU 0 if !_Professional! EQU 0 ( + echo %%a 2021 App echo. - call :InsLic %%a + call :InsLic %%a2021 + ) +) +for %%a in (Access) do if !_%%a2019! EQU 1 ( +if !_O365ProPlus! EQU 0 if !_ProPlus2021! EQU 0 if !_ProPlus2019! EQU 0 if !_ProPlus! EQU 0 if !_Professional2021! EQU 0 if !_Professional2019! EQU 0 if !_Professional! EQU 0 if !_%%a2021! EQU 0 ( + echo %%a 2019 App -^> %%a%_ons% Licenses + echo. + call :InsLic %%a%_tag% ) ) for %%a in (Access) do if !_%%a! EQU 1 ( -if !_O365ProPlus! EQU 0 if !_ProPlus2019! EQU 0 if !_ProPlus! EQU 0 if !_Professional2019! EQU 0 if !_Professional! EQU 0 if !_%%a2019! EQU 0 ( - echo %%a 2016 App +if !_O365ProPlus! EQU 0 if !_ProPlus2021! EQU 0 if !_ProPlus2019! EQU 0 if !_ProPlus! EQU 0 if !_Professional2021! EQU 0 if !_Professional2019! EQU 0 if !_Professional! EQU 0 if !_%%a2021! EQU 0 if !_%%a2019! EQU 0 ( + echo %%a 2016 App -^> %%a%_ons% Licenses echo. call :InsLic %%a%_tag% ) ) -for %%a in (SkypeforBusiness2019) do if !_%%a! EQU 1 ( -if !_O365ProPlus! EQU 0 if !_ProPlus2019! EQU 0 if !_ProPlus! EQU 0 ( - echo %%a App +for %%a in (SkypeforBusiness) do if !_%%a2021! EQU 1 ( +if !_O365ProPlus! EQU 0 if !_ProPlus2021! EQU 0 if !_ProPlus2019! EQU 0 if !_ProPlus! EQU 0 ( + echo %%a 2021 App echo. - call :InsLic %%a + call :InsLic %%a2021 + ) +) +for %%a in (SkypeforBusiness) do if !_%%a2019! EQU 1 ( +if !_O365ProPlus! EQU 0 if !_ProPlus2021! EQU 0 if !_ProPlus2019! EQU 0 if !_ProPlus! EQU 0 if !_%%a2021! EQU 0 ( + echo %%a 2019 App -^> %%a%_ons% Licenses + echo. + call :InsLic %%a%_tag% ) ) for %%a in (SkypeforBusiness) do if !_%%a! EQU 1 ( -if !_O365ProPlus! EQU 0 if !_ProPlus2019! EQU 0 if !_ProPlus! EQU 0 if !_%%a2019! EQU 0 ( - echo %%a 2016 App +if !_O365ProPlus! EQU 0 if !_ProPlus2021! EQU 0 if !_ProPlus2019! EQU 0 if !_ProPlus! EQU 0 if !_%%a2021! EQU 0 if !_%%a2019! EQU 0 ( + echo %%a 2016 App -^> %%a%_ons% Licenses echo. call :InsLic %%a%_tag% ) @@ -606,10 +709,16 @@ wmic path %spp% where 'ApplicationID="%_oApp%" AND LicenseFamily like "OfficeO36 if %_Cnvrt% NEQ 1 (set "msg=Finished"&goto :TheEnd) -set _C15Msg=0 for %%a in (%_R15Ids%,ProPlus) do if !_%%a! EQU 1 ( set _C15Msg=1 ) +if %_C15Msg% EQU 1 if %_C16Msg% EQU 0 ( +echo. +echo %_ln% +echo Installing Office Volume Licenses... +echo %_ln% +echo. +) if %_C15Msg% EQU 0 goto :GVLKC2R if !_Mondo! EQU 1 ( @@ -743,14 +852,25 @@ for /f "skip=2 tokens=2*" %%a in ('reg query %_Con15fig% %_Nul6%') do reg add %_ exit /b :GVLKC2R +set _CtRMsg=0 +if %_C16Msg% EQU 1 set _CtRMsg=1 +if %_C15Msg% EQU 1 set _CtRMsg=1 +if %_CtRMsg% EQU 1 ( echo %_ln% echo Installing Missing KMS Client Keys... echo %_ln% echo. +) if %winbuild% GEQ 9200 wmic path %_sps% where version='%_wmi%' call RefreshLicenseStatus %_Nul3% -for %%# in (15,16,19) do call :C2RLoc %%# -for %%# in (15,16,19) do if !_Office%%#! EQU 0 call :C2Runi %%# -for %%# in (15,16,19) do if !_Office%%#! EQU 1 call :C2Rins %%# +for %%# in (15,16,19,21) do call :C2RLoc %%# +if %_Retail% EQU 0 if !_Loc15! EQU 0 call :C2Runi %%# +if %_Retail% EQU 0 if %sub_O365% EQU 0 if %sub_proj% EQU 0 if %sub_vis% EQU 0 ( +if !_Loc16! EQU 0 call :C2Runi %%# +if !_Loc19! EQU 0 call :C2Runi %%# +if !_Loc21! EQU 0 call :C2Runi %%# +) +if %_C16Msg% EQU 1 for %%# in (16,19,21) do if !_Loc%%#! EQU 1 call :C2Rins %%# +if %_C15Msg% EQU 1 for %%# in (15) do if !_Loc%%#! EQU 1 call :C2Rins %%# if %winbuild% GEQ 9200 wmic path %_sps% where version='%_wmi%' call RefreshLicenseStatus %_Nul3% if exist "%SysPath%\spp\store_test\2.0\tokens.dat" ( echo. @@ -772,36 +892,40 @@ for /f "tokens=2 delims==" %%# in ('"wmic path %_spp% where (Description like 'O exit /b :C2RLoc -set _Office%1=0 +set _Loc%1=0 if %1 EQU 19 ( -if defined _ProductIds reg query %_Config% /v ProductReleaseIds %_Nul2% | findstr 2019 %_Nul1% && set _Office%1=1 +if defined _ProductIds reg query %_Config% /v ProductReleaseIds %_Nul2% | findstr 2019 %_Nul1% && set _Loc%1=1 +exit /b +) +if %1 EQU 21 ( +if defined _ProductIds reg query %_Config% /v ProductReleaseIds %_Nul2% | findstr 2021 %_Nul1% && set _Loc%1=1 exit /b ) -for /f "skip=2 tokens=2*" %%a in ('"reg query HKLM\SOFTWARE\Microsoft\Office\%1.0\Common\InstallRoot /v Path" %_Nul6%') do if exist "%%b\OSPP.VBS" set _Office%1=1 -for /f "skip=2 tokens=2*" %%a in ('"reg query HKLM\SOFTWARE\Wow6432Node\Microsoft\Office\%1.0\Common\InstallRoot /v Path" %_Nul6%') do if exist "%%b\OSPP.VBS" set _Office%1=1 +for /f "skip=2 tokens=2*" %%a in ('"reg query HKLM\SOFTWARE\Microsoft\Office\%1.0\Common\InstallRoot /v Path" %_Nul6%') do if exist "%%b\OSPP.VBS" set _Loc%1=1 +for /f "skip=2 tokens=2*" %%a in ('"reg query HKLM\SOFTWARE\Wow6432Node\Microsoft\Office\%1.0\Common\InstallRoot /v Path" %_Nul6%') do if exist "%%b\OSPP.VBS" set _Loc%1=1 if %1 EQU 16 if defined _ProductIds ( for /f "skip=2 tokens=2*" %%a in ('reg query %_Config% /v ProductReleaseIds') do echo %%b>"!_temp!\crvO16.txt" for %%a in (%_R16Ids%) do ( - findstr /I /C:"%%aRetail" "!_temp!\crvO16.txt" %_Nul1% && set _Office%1=1 + findstr /I /C:"%%aRetail" "!_temp!\crvO16.txt" %_Nul1% && set _Loc%1=1 ) for %%a in (%_V16Ids%,ProjectProX,ProjectStdX,VisioProX,VisioStdX) do ( - findstr /I /C:"%%aVolume" "!_temp!\crvO16.txt" %_Nul1% && set _Office%1=1 + findstr /I /C:"%%aVolume" "!_temp!\crvO16.txt" %_Nul1% && set _Loc%1=1 ) -reg query %_PRIDs%\ProPlusRetail.16 %_Nul3% && set _Office%1=1 -reg query %_PRIDs%\ProPlusVolume.16 %_Nul3% && set _Office%1=1 +reg query %_PRIDs%\ProPlusRetail.16 %_Nul3% && set _Loc%1=1 +reg query %_PRIDs%\ProPlusVolume.16 %_Nul3% && set _Loc%1=1 exit /b ) if %1 EQU 15 if defined _Product15Ids ( -set _Office%1=1 +set _Loc%1=1 exit /b ) -if exist "%ProgramFiles%\Microsoft Office\Office%1\OSPP.VBS" set _Office%1=1 -if exist "%ProgramW6432%\Microsoft Office\Office%1\OSPP.VBS" set _Office%1=1 -if exist "%ProgramFiles(x86)%\Microsoft Office\Office%1\OSPP.VBS" set _Office%1=1 +if exist "%ProgramFiles%\Microsoft Office\Office%1\OSPP.VBS" set _Loc%1=1 +if exist "%ProgramW6432%\Microsoft Office\Office%1\OSPP.VBS" set _Loc%1=1 +if exist "%ProgramFiles(x86)%\Microsoft Office\Office%1\OSPP.VBS" set _Loc%1=1 exit /b :UniKey @@ -809,11 +933,14 @@ wmic path %_spp% where ID='%aID%' call UninstallProductKey %_Nul3% exit /b :InsKey +if /i '%aID%' EQU 'f3fb2d68-83dd-4c8b-8f09-08e0d950ac3b' exit /b +if /i '%aID%' EQU '76093b1b-7057-49d7-b970-638ebcbfd873' exit /b +if /i '%aID%' EQU 'a3b44174-2451-4cd6-b25f-66638bfb9046' exit /b if /i '%aID%' EQU '1dc00701-03af-4680-b2af-007ffc758a1f' exit /b -if /i '%aID%' EQU 'e914ea6e-a5fa-4439-a394-a9bb3293ca09' exit /b if /i '%aID%' EQU '0bc88885-718c-491d-921f-6f214349e79c' exit /b if /i '%aID%' EQU 'fc7c4d0c-2e85-4bb9-afd4-01ed1476b5e9' exit /b if /i '%aID%' EQU '500f6619-ef93-4b75-bcb4-82819998a3ca' exit /b +if /i '%aID%' EQU 'e914ea6e-a5fa-4439-a394-a9bb3293ca09' exit /b set "_key=" for /f "tokens=2 delims==" %%# in ('"wmic path %_spp% where ID='%aID%' get LicenseFamily /value"') do echo %%# call :keys %aID% @@ -831,6 +958,59 @@ exit /b if "%~1"=="" exit /b goto :%1 %_Nul2% +:: Office 2021 +:fbdb3e18-a8ef-4fb3-9183-dffd60bd0984 +set "_key=FXYTK-NJJ8C-GB6DW-3DYQT-6F7TH" &:: Professional Plus +exit /b + +:080a45c5-9f9f-49eb-b4b0-c3c610a5ebd3 +set "_key=KDX7X-BNVR8-TXXGX-4Q7Y8-78VT3" &:: Standard +exit /b + +:76881159-155c-43e0-9db7-2d70a9a3a4ca +set "_key=FTNWT-C6WBT-8HMGF-K9PRX-QV9H8" &:: Project Professional +exit /b + +:6dd72704-f752-4b71-94c7-11cec6bfc355 +set "_key=J2JDC-NJCYY-9RGQ4-YXWMH-T3D4T" &:: Project Standard +exit /b + +:fb61ac9a-1688-45d2-8f6b-0674dbffa33c +set "_key=KNH8D-FGHT4-T8RK3-CTDYJ-K2HT4" &:: Visio Professional +exit /b + +:72fce797-1884-48dd-a860-b2f6a5efd3ca +set "_key=MJVNY-BYWPY-CWV6J-2RKRT-4M8QG" &:: Visio Standard +exit /b + +:1fe429d8-3fa7-4a39-b6f0-03dded42fe14 +set "_key=WM8YG-YNGDD-4JHDC-PG3F4-FC4T4" &:: Access +exit /b + +:ea71effc-69f1-4925-9991-2f5e319bbc24 +set "_key=NWG3X-87C9K-TC7YY-BC2G7-G6RVC" &:: Excel +exit /b + +:a5799e4c-f83c-4c6e-9516-dfe9b696150b +set "_key=C9FM6-3N72F-HFJXB-TM3V9-T86R9" &:: Outlook +exit /b + +:6e166cc3-495d-438a-89e7-d7c9e6fd4dea +set "_key=TY7XF-NFRBR-KJ44C-G83KF-GX27K" &:: PowerPoint +exit /b + +:aa66521f-2370-4ad8-a2bb-c095e3e4338f +set "_key=2MW9D-N4BXM-9VBPG-Q7W6M-KFBGQ" &:: Publisher +exit /b + +:1f32a9af-1274-48bd-ba1e-1ab7508a23e8 +set "_key=HWCXN-K3WBT-WJBKY-R8BD9-XK29P" &:: Skype for Business +exit /b + +:abe28aea-625a-43b1-8e30-225eb8fbd9e5 +set "_key=TN8H9-M34D3-Y64V9-TR72V-X79KV" &:: Word +exit /b + :: Office 2019 :85dd8b5f-eaa4-4af3-a628-cce9e77c9a03 set "_key=NMMKJ-6RK4F-KMJVX-8D9MJ-6MWKP" &:: Professional Plus diff --git a/README.md b/README.md index 9f4a89e..d7b2cba 100644 --- a/README.md +++ b/README.md @@ -4,65 +4,69 @@ where cleanospp.exe is embedded in the script and get extracted upon execution using powershell, which makes it easier to move and distribute the script alone -* Convert already-installed Office ClickToRun licensing from Retail to Volume +- Convert already-installed Office ClickToRun licensing from Retail to Volume - This is not an activator, just a licensing converter -* Supports: Office 365, Office 2019, Office 2016, Office 2013 +- Supports: Office 365, Office 2021, Office 2019, Office 2016, Office 2013 - Activated Retail products will be skipped from conversion this include valid Office 365 subscriptions, or perpetual Office (MAK, OEM, MSDN, Retail..) -* Current Office licenses will be cleaned up (unless retail-activated Office detected) +- Current Office licenses will be cleaned up (unless retail-activated Office detected) then, proper Volume licenses will be installed based on the detected Product IDs - Office Mondo suite cover all products, if detected, only its licenses will be installed -* Office 365 products will be converted with Mondo licenses by default +- Microsoft Office 365 products will be converted with Mondo licenses by default also, corresponding Office 365 Retail Grace Key will be installed -- Office 2016 products will be converted with corresponding Office 2019 licenses +- Windows 10/11: Office 2016 products will be converted with corresponding Office 2019 licenses (if RTM detected) -* Office Professional suite will be converted with Office 2019 ProPlus licenses +- Windows 8.1: Office 2016/2019 products will be converted with corresponding Office 2021 licenses (if RTM detected) -- Office HomeBusiness/HomeStudent suites will be converted with Office 2019 Standard licenses +- Office Professional suite will be converted with Office Professional Plus licenses -* If Office 2019 RTM licenses are not detected, Office 2016 licenses will be used instead +- Office HomeBusiness/HomeStudent suites will be converted with Office Standard licenses - Office 2013 products follow the same logic, but handled separately -* If main products SKUs are detected, single apps licenses will not be installed to avoid duplication +- If main products Suites are detected, single apps licenses will not be installed to avoid duplication -- SKUs: +- Suites: O365ProPlus, O365Business, O365SmallBusPrem, O365HomePrem, O365EduCloud ProPlus, Professional, Standard, HomeBusiness, HomeStudent, Visio, Project -* Apps: +- Apps: Access, Excel, InfoPath, Onenote, Outlook, PowerPoint, Publisher, SkypeForBusiness, Word, Groove (OneDrive for Business) -- O365ProPlus, O365Business, O365SmallBusPrem, ProPlus cover all apps -Professional cover all apps except SkypeForBusiness -Standard cover all apps except Access, SkypeForBusiness +- Suites <> Apps relation: +O365ProPlus, O365Business, O365SmallBusPrem, ProPlus: all apps +O365HomePrem, Professional: all apps except SkypeForBusiness +Standard: all apps except Access, SkypeForBusiness +HomeBusiness: Excel, OneNote, PowerPoint, Word, Outlook +HomeStudent: Excel, OneNote, PowerPoint, Word ## Notice -* On Windows 7, Office 2016/2019 licensing service require Universal C Runtime to work correctly +- On Windows 7, Office C2R 16.0 licensing service require Universal C Runtime to work correctly - UCRT is available in the latest Monthly Rollup, or the separate update KB3118401 -* Additionally, Office programs themselves require recent Windows 7 updates to start properly +- Additionally, Office programs themselves require recent Windows 7 updates to start properly -## Office 2019 +- While Office 2021 can be installed on Windows 7, it will not function or work properly -* Office 2019 products are officially blocked on Windows 7 and 8.1 -to workaround that, follow these steps: +## Office 2019/2021 -- If you want Office Professional Plus 2019: -1) install O365ProPlusRetail SKU, then edit C2R-R2V.cmd and set _O365asO2019=1 -2) alternatively, install Office 16 ProPlusRetail SKU (no need to edit the script in this case) -3) run C2R-R2V.cmd +- Office 2019/2021 products are officially blocked on Windows 7 and 8.1 +to workaround that, use the following steps -* Additionally, if you want Project 2019 and/or Visio 2019: +- If you want Office Professional Plus: +1) install Office 2016 SKU ProPlusRetail +2) run C2R-R2V.cmd + +- Additionally, if you want Project and/or Visio: 1) install desired Office 2016 SKU: ProjectProRetail, ProjectStdRetail, VisioProRetail, VisioStdRetail 2) run C2R-R2V.cmd @@ -71,11 +75,11 @@ to workaround that, follow these steps: - To run the process in debug mode "with" conversion edit C2R-R2V.cmd and set _Debug=1 -* To run the process in debug mode "without" conversion +- To run the process in debug mode "without" conversion edit C2R-R2V.cmd and set _Cnvrt=0 ## Credits -* @Windows_Addict / Features suggestion, testing and co-enhancing +- @Windows_Addict / Features suggestion, testing and co-enhancing - @AveYo / [Compressed2TXT](https://github.com/AveYo/Compressed2TXT) -* @ratzlefatz / [OfficeRTool](https://forums.mydigitallife.net/posts/1125229/) +- @ratzlefatz / [OfficeRTool](https://forums.mydigitallife.net/posts/1125229/)