diff options
| author | WindowsAddict | 2024-11-09 15:05:41 +0000 |
|---|---|---|
| committer | WindowsAddict | 2024-11-09 15:05:41 +0000 |
| commit | 873c4bc4d8fb735e100116782b63f4dd54c355f7 (patch) | |
| tree | ac521a441c30e8ae0dbbfb47bb1442f5e8c6ff7f /MAS/Separate-Files-Version/Activators/Ohook_Activation_AIO.cmd | |
| parent | 0b402d9afe04bc7d820b7337db28e62c1d2e15ad (diff) | |
| download | Microsoft-Activation-Scripts-873c4bc4d8fb735e100116782b63f4dd54c355f7.zip | |
Detect a potential script crash when user installs too many licenses for Office
Diffstat (limited to 'MAS/Separate-Files-Version/Activators/Ohook_Activation_AIO.cmd')
| -rw-r--r-- | MAS/Separate-Files-Version/Activators/Ohook_Activation_AIO.cmd | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/MAS/Separate-Files-Version/Activators/Ohook_Activation_AIO.cmd b/MAS/Separate-Files-Version/Activators/Ohook_Activation_AIO.cmd index d15ede9..da88ed9 100644 --- a/MAS/Separate-Files-Version/Activators/Ohook_Activation_AIO.cmd +++ b/MAS/Separate-Files-Version/Activators/Ohook_Activation_AIO.cmd @@ -1455,6 +1455,22 @@ set allapps= if %_wmic% EQU 1 set "chkapp=for /f "tokens=2 delims==" %%a in ('"wmic path %spp% where (ApplicationID='%1') get ID /VALUE" %nul6%')"
if %_wmic% EQU 0 set "chkapp=for /f "tokens=2 delims==" %%a in ('%psc% "(([WMISEARCHER]'SELECT ID FROM %spp% WHERE ApplicationID=''%1''').Get()).ID ^| %% {echo ('ID='+$_)}" %nul6%')"
%chkapp% do (if defined allapps (call set "allapps=!allapps! %%a") else (call set "allapps=%%a"))
+
+:: Check potential script crash issue when user manually installs way too many licenses for Office (length limit in variable)
+
+if defined allapps if %1==0ff1ce15-a989-479d-af46-f275c6370663 (
+set len=0
+echo:!allapps!> %SystemRoot%\Temp\chklen
+for %%A in (%SystemRoot%\Temp\chklen) do (set len=%%~zA)
+del %SystemRoot%\Temp\chklen %nul%
+
+if !len! GTR 6000 (
+%eline%
+echo Too many licenses are installed, the script may crash.
+call :dk_color %Blue% "%_fixmsg%"
+timeout /t 30
+)
+)
exit /b
:: Get installed products Activation IDs
|
