From 3d16fc6a07952723cc7528f7b636927666d27659 Mon Sep 17 00:00:00 2001 From: WindowsAddict Date: Tue, 16 Jul 2024 17:01:13 +0530 Subject: Improve/Fix error messages when key is not found --- .../Activators/HWID_Activation.cmd | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) (limited to 'MAS/Separate-Files-Version/Activators/HWID_Activation.cmd') diff --git a/MAS/Separate-Files-Version/Activators/HWID_Activation.cmd b/MAS/Separate-Files-Version/Activators/HWID_Activation.cmd index c683c7f..0d49786 100644 --- a/MAS/Separate-Files-Version/Activators/HWID_Activation.cmd +++ b/MAS/Separate-Files-Version/Activators/HWID_Activation.cmd @@ -428,7 +428,6 @@ call :dk_errorcheck set key= set altkey= -set skufound= set changekey= set altapplist= set altedition= @@ -453,14 +452,17 @@ call :dk_color %Red% "Checking Alternate Edition For HWID [%altedition% Acti if not defined key ( %eline% echo [%winos% ^| %winbuild% ^| SKU:%osSKU%] -if not defined skufound ( -echo Unable to find this product in the supported product list. -) else ( -echo Required License files not found in %SysPath%\spp\tokens\skus\ -) +if not defined skunotfound ( +echo This product does not support HWID Activation. +echo Try KMS38 Activation option. echo Make sure you are using updated version of the script. set fixes=%fixes% %mas% echo %mas% +) else ( +echo Required License files not found in %SysPath%\spp\tokens\skus\ +set fixes=%fixes% %mas%troubleshoot +call :dk_color2 %Blue% "Help - " %_Yellow% " %mas%troubleshoot" +) echo: goto dk_done ) @@ -1242,23 +1244,24 @@ call :dk_color2 %Blue% "Help - " %_Yellow% " %mas%evaluation-editions" ) -set osedition= +set osedition=0 for /f "skip=2 tokens=3" %%a in ('reg query "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion" /v EditionID %nul6%') do set "osedition=%%a" :: Workaround for an issue in builds between 1607 and 1709 where ProfessionalEducation is shown as Professional -if defined osedition ( +if not %osedition%==0 ( if "%osSKU%"=="164" set osedition=ProfessionalEducation if "%osSKU%"=="165" set osedition=ProfessionalEducationN ) if not defined officeact ( -if not defined osedition ( +if %osedition%==0 ( call :dk_color %Red% "Checking Edition Name [Not Found In Registry]" ) else ( if not exist "%SysPath%\spp\tokens\skus\%osedition%\%osedition%*.xrm-ms" if not exist "%SysPath%\spp\tokens\skus\Security-SPP-Component-SKU-%osedition%\*-%osedition%-*.xrm-ms" ( set error=1 +set skunotfound=1 call :dk_color %Red% "Checking License Files [Not Found] [%osedition%]" ) @@ -1628,7 +1631,6 @@ for /f "tokens=1-9 delims=_" %%A in ("%%#") do ( REM Detect key if %1==key if %osSKU%==%%C if not defined key ( -set skufound=1 echo "!allapps! !altapplist!" | find /i "%%A" %nul1% && ( if %%F==1 set notworking=1 set key=%%B -- cgit v1.2.3