1
0
mirror of https://github.com/massgravel/Microsoft-Activation-Scripts.git synced 2024-11-26 16:06:51 +00:00

Compare commits

..

4 Commits

Author SHA1 Message Date
WindowsAddict
6efb5d50fe Suppress error output when screen size is smaller than the cmd window size 2024-10-22 03:36:28 +05:30
WindowsAddict
b2831795a4 Show wlms service in red 2024-10-22 03:09:33 +05:30
WindowsAddict
4e8ebecd3d Fix a bug where excluded apps name needs to be in lowercase 2024-10-22 02:59:36 +05:30
WindowsAddict
d929cd8fa0 Add a separate option for add/remove apps 2024-10-22 02:56:17 +05:30
8 changed files with 230 additions and 66 deletions

@ -1583,7 +1583,11 @@ call :dk_color2 %Red% "Checking ClipSVC " %Blue% "[System
if exist "%SysPath%\wlms\wlms.exe" (
sc query wlms | find /i "RUNNING" %nul% && (
if %winbuild% LSS 9200 (
echo Checking Eval WLMS Service [Found]
) else (
call :dk_color %Red% "Checking Eval WLMS Service [Found]"
)
)
)
@ -2052,7 +2056,7 @@ cls
if not defined terminal (
mode 130, 32
if exist "%SysPath%\spp\store_test\" mode 134, 32
%psc% "&{$W=$Host.UI.RawUI.WindowSize;$B=$Host.UI.RawUI.BufferSize;$W.Height=32;$B.Height=300;$Host.UI.RawUI.WindowSize=$W;$Host.UI.RawUI.BufferSize=$B;}"
%psc% "&{$W=$Host.UI.RawUI.WindowSize;$B=$Host.UI.RawUI.BufferSize;$W.Height=32;$B.Height=300;$Host.UI.RawUI.WindowSize=$W;$Host.UI.RawUI.BufferSize=$B;}" %nul%
)
title Ohook Activation %masver%
@ -4431,7 +4435,7 @@ cls
if not defined terminal (
mode 115, 32
if exist "%SysPath%\spp\store_test\" mode 135, 32
%psc% "&{$W=$Host.UI.RawUI.WindowSize;$B=$Host.UI.RawUI.BufferSize;$W.Height=32;$B.Height=300;$Host.UI.RawUI.WindowSize=$W;$Host.UI.RawUI.BufferSize=$B;}"
%psc% "&{$W=$Host.UI.RawUI.WindowSize;$B=$Host.UI.RawUI.BufferSize;$W.Height=32;$B.Height=300;$Host.UI.RawUI.WindowSize=$W;$Host.UI.RawUI.BufferSize=$B;}" %nul%
)
title Online %KS% Activation %masver%
@ -6398,8 +6402,8 @@ exit /b
cls
if not defined terminal (
mode 100, 32
%psc% "&{$W=$Host.UI.RawUI.WindowSize;$B=$Host.UI.RawUI.BufferSize;$W.Height=31;$B.Height=300;$Host.UI.RawUI.WindowSize=$W;$Host.UI.RawUI.BufferSize=$B;}"
mode 100, 36
%psc% "&{$W=$Host.UI.RawUI.WindowSize;$B=$Host.UI.RawUI.BufferSize;$W.Height=35;$B.Height=300;$Host.UI.RawUI.WindowSize=$W;$Host.UI.RawUI.BufferSize=$B;}" %nul%
)
%psc% "$f=[IO.File]::ReadAllText('!_batp!') -split ':sppmgr\:.*';iex ($f[1])"
@ -7579,7 +7583,7 @@ goto :at_back
cls
if not defined terminal (
mode 125, 32
%psc% "&{$W=$Host.UI.RawUI.WindowSize;$B=$Host.UI.RawUI.BufferSize;$W.Height=31;$B.Height=200;$Host.UI.RawUI.WindowSize=$W;$Host.UI.RawUI.BufferSize=$B;}"
%psc% "&{$W=$Host.UI.RawUI.WindowSize;$B=$Host.UI.RawUI.BufferSize;$W.Height=31;$B.Height=200;$Host.UI.RawUI.WindowSize=$W;$Host.UI.RawUI.BufferSize=$B;}" %nul%
)
title Fix Licensing ^(ClipSVC ^+ SPP ^+ OSPP^)
@ -8792,7 +8796,7 @@ goto dk_done
cls
if not defined terminal (
mode con cols=105 lines=32
%psc% "&{$W=$Host.UI.RawUI.WindowSize;$B=$Host.UI.RawUI.BufferSize;$W.Height=31;$B.Height=200;$Host.UI.RawUI.WindowSize=$W;$Host.UI.RawUI.BufferSize=$B;}"
%psc% "&{$W=$Host.UI.RawUI.WindowSize;$B=$Host.UI.RawUI.BufferSize;$W.Height=31;$B.Height=200;$Host.UI.RawUI.WindowSize=$W;$Host.UI.RawUI.BufferSize=$B;}" %nul%
)
call :ced_rebootflag
@ -8829,7 +8833,7 @@ goto dk_done
cls
if not defined terminal (
mode con cols=105 lines=32
%psc% "&{$W=$Host.UI.RawUI.WindowSize;$B=$Host.UI.RawUI.BufferSize;$W.Height=31;$B.Height=200;$Host.UI.RawUI.WindowSize=$W;$Host.UI.RawUI.BufferSize=$B;}"
%psc% "&{$W=$Host.UI.RawUI.WindowSize;$B=$Host.UI.RawUI.BufferSize;$W.Height=31;$B.Height=200;$Host.UI.RawUI.WindowSize=$W;$Host.UI.RawUI.BufferSize=$B;}" %nul%
)
set key=
@ -9466,20 +9470,23 @@ echo:
echo:
echo ____________________________________________________________
echo:
echo [1] Change - Office Edition
echo [2] Add - Office Edition
echo [3] Remove - Office Edition
echo [1] Change all editions
echo [2] Add edition
echo [3] Remove edition
echo:
echo [4] Add/Remove apps
echo ____________________________________________
echo:
echo [4] Change Office Update Channel
echo [5] Change Office Update Channel
echo [0] %_exitmsg%
echo ____________________________________________________________
echo:
call :dk_color2 %_White% " " %_Green% "Choose a menu option using your keyboard [1,2,3,4,0]"
choice /C:12340 /N
call :dk_color2 %_White% " " %_Green% "Choose a menu option using your keyboard [1,2,3,4,5,0]"
choice /C:123450 /N
set _el=!errorlevel!
if !_el!==5 exit /b
if !_el!==4 goto :oe_changeupdchnl
if !_el!==6 exit /b
if !_el!==5 goto :oe_changeupdchnl
if !_el!==4 goto :oe_editedition
if !_el!==3 goto :oe_removeedition
if !_el!==2 set change=0& goto :oe_edition
if !_el!==1 set change=1& goto :oe_edition
@ -9497,7 +9504,12 @@ goto :oe_goback
cls
if not defined terminal mode 76, 25
title Change Office Edition %masver%
if %change%==1 (
title Change all editions %masver%
) else (
title Add edition %masver%
)
echo:
echo:
echo:
@ -9589,6 +9601,8 @@ if %verified%==0 goto :oe_editionchange
:: Set app exclusions
:oe_excludeappspre
cls
set suites=
echo %list% | find /i "Suites" %nul1% && (
@ -9660,7 +9674,7 @@ echo:
call :dk_color %_Green% "Choose a menu option using your keyboard:"
choice /C:AENOPJRVWLDT10 /N
set _el=!errorlevel!
if !_el!==14 goto :oe_editionchangepre
if !_el!==14 goto :oemenu
if !_el!==13 call :excludelist & goto :oe_editionchangefinal
if !_el!==12 if defined Teams_st (if "%Teams_st%"=="Off" (set Teams_st=ON) else (set Teams_st=Off))
if !_el!==11 if defined OneDrive_st (if "%OneDrive_st%"=="Off" (set OneDrive_st=ON) else (set OneDrive_st=Off))
@ -9680,18 +9694,18 @@ goto :oe_excludeapps
set excludelist=
for %%# in (
Access
Excel
OneNote
Outlook
PowerPoint
Project
Publisher
Visio
Word
Lync
OneDrive
Teams
access
excel
onenote
outlook
powerpoint
project
publisher
visio
word
lync
onedrive
teams
) do (
if /i "!%%#_st!"=="Off" if defined excludelist (set excludelist=!excludelist!,%%#) else (set excludelist=,%%#)
)
@ -9762,7 +9776,7 @@ goto :oe_goback
:: OfficeClickToRun.exe with productstoadd method is used here to add editions
:: It uses delta updates, meaning that since it's using same installed build, it will consume very less Internet
set "c2rcommand="%_c2rExe%" platform=%_oArch% culture=%_lang% productstoadd=%targetedition%.16_%_lang%_x-none cdnbaseurl.16=http://officecdn.microsoft.com/pr/%_updch% baseurl.16=http://officecdn.microsoft.com/pr/%_updch% version.16=%_version% mediatype.16=CDN sourcetype.16=CDN deliverymechanism=%_updch% %targetedition%.excludedapps.16=Groove%excludelist% flt.useteamsaddon=disabled flt.usebingaddononinstall=disabled flt.usebingaddononupdate=disabled"
set "c2rcommand="%_c2rExe%" platform=%_oArch% culture=%_lang% productstoadd=%targetedition%.16_%_lang%_x-none cdnbaseurl.16=http://officecdn.microsoft.com/pr/%_updch% baseurl.16=http://officecdn.microsoft.com/pr/%_updch% version.16=%_version% mediatype.16=CDN sourcetype.16=CDN deliverymechanism=%_updch% %targetedition%.excludedapps.16=groove%excludelist% flt.useteamsaddon=disabled flt.usebingaddononinstall=disabled flt.usebingaddononupdate=disabled"
if %change%==1 (
set "c2rcommand=!c2rcommand! productstoremove=AllProducts"
@ -9789,10 +9803,71 @@ goto :oe_goback
::========================================================================================================================================
:: Edit Office edition
:oe_editedition
cls
title Add/Remove Apps %masver%
call :oe_chkinternet
if not defined _int (
goto :oe_goback
)
set change=0
call :ch_getinfo
cls
if not defined terminal (
mode 98, 35
)
set inpt=
set counter=0
set verified=0
set targetedition=
%line%
echo:
call :dk_color %Gray% "You can edit [add/remove apps] one of the following Office editions."
%line%
echo:
for %%A in (%_oIds%) do (
set /a counter+=1
echo [!counter!] %%A
set targetedition!counter!=%%A
)
%line%
echo:
echo [0] Go Back
echo:
call :dk_color %_Green% "Enter an option number using your keyboard and press Enter to confirm:"
set /p inpt=
if "%inpt%"=="" goto :oe_editedition
if "%inpt%"=="0" goto :oemenu
for /l %%i in (1,1,%counter%) do (if "%inpt%"=="%%i" set verified=1)
set targetedition=!targetedition%inpt%!
if %verified%==0 goto :oe_editedition
::===============
cls
if not defined terminal mode 98, 32
echo %targetedition% | findstr /i "Access Excel OneNote Outlook PowerPoint Project Publisher Skype Visio Word" %nul% && (set list=SingleApps) || (set list=Suites)
goto :oe_excludeappspre
::========================================================================================================================================
:: Remove Office editions
:oe_removeedition
title Remove Office editions %masver%
call :ch_getinfo
cls
@ -9874,6 +9949,7 @@ goto :oe_goback
:oe_changeupdchnl
title Change Office update channel %masver%
call :ch_getinfo
cls
@ -9930,10 +10006,10 @@ for /f "tokens=1-2 delims=_" %%A in ("%%~#") do (
set supported=
if %winbuild% LSS 10240 (echo %%B | findstr /i "LTSC DevMain" %nul% || set supported=1) else (set supported=1)
if %winbuild% GEQ 10240 (
if defined ltsc19 echo %%A | findstr /i "2019 VL" %nul% || set supported=
if defined ltsc21 echo %%A | findstr /i "2021 VL" %nul% || set supported=
if defined ltsc24 echo %%A | findstr /i "2024 VL" %nul% || set supported=
if not defined ltscfound echo %%B | findstr /i "LTSC" %nul% && set supported=
if defined ltsc19 echo %%B | find /i "2019 VL" %nul% || set supported=
if defined ltsc21 echo %%B | find /i "2021 VL" %nul% || set supported=
if defined ltsc24 echo %%B | find /i "2024 VL" %nul% || set supported=
if not defined ltscfound echo %%B | find /i "LTSC" %nul% && set supported=
)
if defined supported (
set /a counter+=1

@ -1346,7 +1346,11 @@ call :dk_color2 %Red% "Checking ClipSVC " %Blue% "[System
if exist "%SysPath%\wlms\wlms.exe" (
sc query wlms | find /i "RUNNING" %nul% && (
if %winbuild% LSS 9200 (
echo Checking Eval WLMS Service [Found]
) else (
call :dk_color %Red% "Checking Eval WLMS Service [Found]"
)
)
)

@ -1500,7 +1500,11 @@ call :dk_color2 %Red% "Checking ClipSVC " %Blue% "[System
if exist "%SysPath%\wlms\wlms.exe" (
sc query wlms | find /i "RUNNING" %nul% && (
if %winbuild% LSS 9200 (
echo Checking Eval WLMS Service [Found]
) else (
call :dk_color %Red% "Checking Eval WLMS Service [Found]"
)
)
)

@ -350,7 +350,7 @@ cls
if not defined terminal (
mode 130, 32
if exist "%SysPath%\spp\store_test\" mode 134, 32
%psc% "&{$W=$Host.UI.RawUI.WindowSize;$B=$Host.UI.RawUI.BufferSize;$W.Height=32;$B.Height=300;$Host.UI.RawUI.WindowSize=$W;$Host.UI.RawUI.BufferSize=$B;}"
%psc% "&{$W=$Host.UI.RawUI.WindowSize;$B=$Host.UI.RawUI.BufferSize;$W.Height=32;$B.Height=300;$Host.UI.RawUI.WindowSize=$W;$Host.UI.RawUI.BufferSize=$B;}" %nul%
)
title Ohook Activation %masver%
@ -1800,7 +1800,11 @@ call :dk_color2 %Red% "Checking ClipSVC " %Blue% "[System
if exist "%SysPath%\wlms\wlms.exe" (
sc query wlms | find /i "RUNNING" %nul% && (
if %winbuild% LSS 9200 (
echo Checking Eval WLMS Service [Found]
) else (
call :dk_color %Red% "Checking Eval WLMS Service [Found]"
)
)
)

@ -410,7 +410,7 @@ cls
if not defined terminal (
mode 115, 32
if exist "%SysPath%\spp\store_test\" mode 135, 32
%psc% "&{$W=$Host.UI.RawUI.WindowSize;$B=$Host.UI.RawUI.BufferSize;$W.Height=32;$B.Height=300;$Host.UI.RawUI.WindowSize=$W;$Host.UI.RawUI.BufferSize=$B;}"
%psc% "&{$W=$Host.UI.RawUI.WindowSize;$B=$Host.UI.RawUI.BufferSize;$W.Height=32;$B.Height=300;$Host.UI.RawUI.WindowSize=$W;$Host.UI.RawUI.BufferSize=$B;}" %nul%
)
title Online %KS% Activation %masver%
@ -2849,7 +2849,11 @@ call :dk_color2 %Red% "Checking ClipSVC " %Blue% "[System
if exist "%SysPath%\wlms\wlms.exe" (
sc query wlms | find /i "RUNNING" %nul% && (
if %winbuild% LSS 9200 (
echo Checking Eval WLMS Service [Found]
) else (
call :dk_color %Red% "Checking Eval WLMS Service [Found]"
)
)
)

@ -421,20 +421,23 @@ echo:
echo:
echo ____________________________________________________________
echo:
echo [1] Change - Office Edition
echo [2] Add - Office Edition
echo [3] Remove - Office Edition
echo [1] Change all editions
echo [2] Add edition
echo [3] Remove edition
echo:
echo [4] Add/Remove apps
echo ____________________________________________
echo:
echo [4] Change Office Update Channel
echo [5] Change Office Update Channel
echo [0] %_exitmsg%
echo ____________________________________________________________
echo:
call :dk_color2 %_White% " " %_Green% "Choose a menu option using your keyboard [1,2,3,4,0]"
choice /C:12340 /N
call :dk_color2 %_White% " " %_Green% "Choose a menu option using your keyboard [1,2,3,4,5,0]"
choice /C:123450 /N
set _el=!errorlevel!
if !_el!==5 exit /b
if !_el!==4 goto :oe_changeupdchnl
if !_el!==6 exit /b
if !_el!==5 goto :oe_changeupdchnl
if !_el!==4 goto :oe_editedition
if !_el!==3 goto :oe_removeedition
if !_el!==2 set change=0& goto :oe_edition
if !_el!==1 set change=1& goto :oe_edition
@ -452,7 +455,12 @@ goto :oe_goback
cls
if not defined terminal mode 76, 25
title Change Office Edition %masver%
if %change%==1 (
title Change all editions %masver%
) else (
title Add edition %masver%
)
echo:
echo:
echo:
@ -544,6 +552,8 @@ if %verified%==0 goto :oe_editionchange
:: Set app exclusions
:oe_excludeappspre
cls
set suites=
echo %list% | find /i "Suites" %nul1% && (
@ -615,7 +625,7 @@ echo:
call :dk_color %_Green% "Choose a menu option using your keyboard:"
choice /C:AENOPJRVWLDT10 /N
set _el=!errorlevel!
if !_el!==14 goto :oe_editionchangepre
if !_el!==14 goto :oemenu
if !_el!==13 call :excludelist & goto :oe_editionchangefinal
if !_el!==12 if defined Teams_st (if "%Teams_st%"=="Off" (set Teams_st=ON) else (set Teams_st=Off))
if !_el!==11 if defined OneDrive_st (if "%OneDrive_st%"=="Off" (set OneDrive_st=ON) else (set OneDrive_st=Off))
@ -635,18 +645,18 @@ goto :oe_excludeapps
set excludelist=
for %%# in (
Access
Excel
OneNote
Outlook
PowerPoint
Project
Publisher
Visio
Word
Lync
OneDrive
Teams
access
excel
onenote
outlook
powerpoint
project
publisher
visio
word
lync
onedrive
teams
) do (
if /i "!%%#_st!"=="Off" if defined excludelist (set excludelist=!excludelist!,%%#) else (set excludelist=,%%#)
)
@ -717,7 +727,7 @@ goto :oe_goback
:: OfficeClickToRun.exe with productstoadd method is used here to add editions
:: It uses delta updates, meaning that since it's using same installed build, it will consume very less Internet
set "c2rcommand="%_c2rExe%" platform=%_oArch% culture=%_lang% productstoadd=%targetedition%.16_%_lang%_x-none cdnbaseurl.16=http://officecdn.microsoft.com/pr/%_updch% baseurl.16=http://officecdn.microsoft.com/pr/%_updch% version.16=%_version% mediatype.16=CDN sourcetype.16=CDN deliverymechanism=%_updch% %targetedition%.excludedapps.16=Groove%excludelist% flt.useteamsaddon=disabled flt.usebingaddononinstall=disabled flt.usebingaddononupdate=disabled"
set "c2rcommand="%_c2rExe%" platform=%_oArch% culture=%_lang% productstoadd=%targetedition%.16_%_lang%_x-none cdnbaseurl.16=http://officecdn.microsoft.com/pr/%_updch% baseurl.16=http://officecdn.microsoft.com/pr/%_updch% version.16=%_version% mediatype.16=CDN sourcetype.16=CDN deliverymechanism=%_updch% %targetedition%.excludedapps.16=groove%excludelist% flt.useteamsaddon=disabled flt.usebingaddononinstall=disabled flt.usebingaddononupdate=disabled"
if %change%==1 (
set "c2rcommand=!c2rcommand! productstoremove=AllProducts"
@ -744,10 +754,71 @@ goto :oe_goback
::========================================================================================================================================
:: Edit Office edition
:oe_editedition
cls
title Add/Remove Apps %masver%
call :oe_chkinternet
if not defined _int (
goto :oe_goback
)
set change=0
call :ch_getinfo
cls
if not defined terminal (
mode 98, 35
)
set inpt=
set counter=0
set verified=0
set targetedition=
%line%
echo:
call :dk_color %Gray% "You can edit [add/remove apps] one of the following Office editions."
%line%
echo:
for %%A in (%_oIds%) do (
set /a counter+=1
echo [!counter!] %%A
set targetedition!counter!=%%A
)
%line%
echo:
echo [0] Go Back
echo:
call :dk_color %_Green% "Enter an option number using your keyboard and press Enter to confirm:"
set /p inpt=
if "%inpt%"=="" goto :oe_editedition
if "%inpt%"=="0" goto :oemenu
for /l %%i in (1,1,%counter%) do (if "%inpt%"=="%%i" set verified=1)
set targetedition=!targetedition%inpt%!
if %verified%==0 goto :oe_editedition
::===============
cls
if not defined terminal mode 98, 32
echo %targetedition% | findstr /i "Access Excel OneNote Outlook PowerPoint Project Publisher Skype Visio Word" %nul% && (set list=SingleApps) || (set list=Suites)
goto :oe_excludeappspre
::========================================================================================================================================
:: Remove Office editions
:oe_removeedition
title Remove Office editions %masver%
call :ch_getinfo
cls
@ -829,6 +900,7 @@ goto :oe_goback
:oe_changeupdchnl
title Change Office update channel %masver%
call :ch_getinfo
cls
@ -885,10 +957,10 @@ for /f "tokens=1-2 delims=_" %%A in ("%%~#") do (
set supported=
if %winbuild% LSS 10240 (echo %%B | findstr /i "LTSC DevMain" %nul% || set supported=1) else (set supported=1)
if %winbuild% GEQ 10240 (
if defined ltsc19 echo %%A | findstr /i "2019 VL" %nul% || set supported=
if defined ltsc21 echo %%A | findstr /i "2021 VL" %nul% || set supported=
if defined ltsc24 echo %%A | findstr /i "2024 VL" %nul% || set supported=
if not defined ltscfound echo %%B | findstr /i "LTSC" %nul% && set supported=
if defined ltsc19 echo %%B | find /i "2019 VL" %nul% || set supported=
if defined ltsc21 echo %%B | find /i "2021 VL" %nul% || set supported=
if defined ltsc24 echo %%B | find /i "2024 VL" %nul% || set supported=
if not defined ltscfound echo %%B | find /i "LTSC" %nul% && set supported=
)
if defined supported (
set /a counter+=1

@ -605,7 +605,7 @@ goto dk_done
cls
if not defined terminal (
mode con cols=105 lines=32
%psc% "&{$W=$Host.UI.RawUI.WindowSize;$B=$Host.UI.RawUI.BufferSize;$W.Height=31;$B.Height=200;$Host.UI.RawUI.WindowSize=$W;$Host.UI.RawUI.BufferSize=$B;}"
%psc% "&{$W=$Host.UI.RawUI.WindowSize;$B=$Host.UI.RawUI.BufferSize;$W.Height=31;$B.Height=200;$Host.UI.RawUI.WindowSize=$W;$Host.UI.RawUI.BufferSize=$B;}" %nul%
)
call :ced_rebootflag
@ -642,7 +642,7 @@ goto dk_done
cls
if not defined terminal (
mode con cols=105 lines=32
%psc% "&{$W=$Host.UI.RawUI.WindowSize;$B=$Host.UI.RawUI.BufferSize;$W.Height=31;$B.Height=200;$Host.UI.RawUI.WindowSize=$W;$Host.UI.RawUI.BufferSize=$B;}"
%psc% "&{$W=$Host.UI.RawUI.WindowSize;$B=$Host.UI.RawUI.BufferSize;$W.Height=31;$B.Height=200;$Host.UI.RawUI.WindowSize=$W;$Host.UI.RawUI.BufferSize=$B;}" %nul%
)
set key=

@ -461,7 +461,7 @@ goto :at_back
cls
if not defined terminal (
mode 125, 32
%psc% "&{$W=$Host.UI.RawUI.WindowSize;$B=$Host.UI.RawUI.BufferSize;$W.Height=31;$B.Height=200;$Host.UI.RawUI.WindowSize=$W;$Host.UI.RawUI.BufferSize=$B;}"
%psc% "&{$W=$Host.UI.RawUI.WindowSize;$B=$Host.UI.RawUI.BufferSize;$W.Height=31;$B.Height=200;$Host.UI.RawUI.WindowSize=$W;$Host.UI.RawUI.BufferSize=$B;}" %nul%
)
title Fix Licensing ^(ClipSVC ^+ SPP ^+ OSPP^)