From d31e4ab0cb813c59f55c3aff55b5118fec7d82bb Mon Sep 17 00:00:00 2001 From: WindowsAddict Date: Fri, 17 Jan 2025 21:58:29 +0530 Subject: [PATCH] Remove error variable from non-critical errors --- MAS/All-In-One-Version-KL/MAS_AIO.cmd | 7 +++---- MAS/Separate-Files-Version/Activators/HWID_Activation.cmd | 7 +++---- MAS/Separate-Files-Version/Activators/KMS38_Activation.cmd | 7 +++---- .../Activators/Ohook_Activation_AIO.cmd | 7 +++---- .../Activators/Online_KMS_Activation.cmd | 7 +++---- 5 files changed, 15 insertions(+), 20 deletions(-) diff --git a/MAS/All-In-One-Version-KL/MAS_AIO.cmd b/MAS/All-In-One-Version-KL/MAS_AIO.cmd index 8c44c3a..9937b47 100644 --- a/MAS/All-In-One-Version-KL/MAS_AIO.cmd +++ b/MAS/All-In-One-Version-KL/MAS_AIO.cmd @@ -1536,7 +1536,6 @@ echo Checking WPA Registry Count [%wpainfo%] if not defined notwinact if exist "%SystemRoot%\Servicing\Packages\Microsoft-Windows-*EvalEdition~*.mum" ( reg query "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion" /v EditionID %nul2% | find /i "Eval" %nul1% || ( -set error=1 call :dk_color %Red% "Checking Eval Packages [Non-Eval Licenses are installed in Eval Windows]" set fixes=%fixes% %mas%evaluation_editions call :dk_color2 %Blue% "Help - " %_Yellow% " %mas%evaluation_editions" @@ -1564,13 +1563,11 @@ call :dk_color %Red% "Checking Edition Name [Not Found In Regi ) 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%]" ) if not exist "%SystemRoot%\Servicing\Packages\Microsoft-Windows-*-%osedition%-*.mum" ( -set error=1 call :dk_color %Red% "Checking Package Files [Not Found] [%osedition%]" ) ) @@ -1669,7 +1666,6 @@ for /f "skip=2 tokens=2*" %%a in ('reg query "HKLM\SOFTWARE\Microsoft\Windows NT reg add "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\SoftwareProtectionPlatform" /v "SkipRearm" /t REG_DWORD /d "0" /f %nul% call :dk_color %Red% "Checking SkipRearm [Default 0 Value Not Found. Changing To 0]" %psc% "Start-Job { Stop-Service sppsvc -force } | Wait-Job -Timeout 20 | Out-Null" -set error=1 ) @@ -1715,6 +1711,7 @@ set showfix=1 ) +if not defined notwinact ( call :dk_actid 55c92734-d682-4d71-983e-d6ec3f16059f if not defined apps ( %psc% "Start-Job { Stop-Service sppsvc -force } | Wait-Job -Timeout 20 | Out-Null; $sls = Get-WmiObject SoftwareLicensingService; $f=[io.file]::ReadAllText('!_batp!') -split ':xrm\:.*';iex ($f[1]); ReinstallLicenses" %nul% @@ -1729,6 +1726,7 @@ set "_notfoundids=Not found" call :dk_color %Red% "Checking Activation IDs [!_notfoundids!]" ) ) +) if exist "%tokenstore%\" if not exist "%tokenstore%\tokens.dat" ( @@ -1744,6 +1742,7 @@ reg delete "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Soft reg query "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Schedule\TaskCache\Tree\Microsoft\Windows\SoftwareProtectionPlatform\SvcRestartTask" %nul% || set taskinfo=Removed if "!taskinfo!"=="" set "taskinfo=Not Found" call :dk_color %Red% "Checking SvcRestartTask Status [!taskinfo!, System might deactivate later]" +if not defined error call :dk_color %Blue% "Reboot your machine using the restart option." ) ) diff --git a/MAS/Separate-Files-Version/Activators/HWID_Activation.cmd b/MAS/Separate-Files-Version/Activators/HWID_Activation.cmd index 00b545e..81b91e2 100644 --- a/MAS/Separate-Files-Version/Activators/HWID_Activation.cmd +++ b/MAS/Separate-Files-Version/Activators/HWID_Activation.cmd @@ -1283,7 +1283,6 @@ echo Checking WPA Registry Count [%wpainfo%] if not defined notwinact if exist "%SystemRoot%\Servicing\Packages\Microsoft-Windows-*EvalEdition~*.mum" ( reg query "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion" /v EditionID %nul2% | find /i "Eval" %nul1% || ( -set error=1 call :dk_color %Red% "Checking Eval Packages [Non-Eval Licenses are installed in Eval Windows]" set fixes=%fixes% %mas%evaluation_editions call :dk_color2 %Blue% "Help - " %_Yellow% " %mas%evaluation_editions" @@ -1311,13 +1310,11 @@ call :dk_color %Red% "Checking Edition Name [Not Found In Regi ) 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%]" ) if not exist "%SystemRoot%\Servicing\Packages\Microsoft-Windows-*-%osedition%-*.mum" ( -set error=1 call :dk_color %Red% "Checking Package Files [Not Found] [%osedition%]" ) ) @@ -1416,7 +1413,6 @@ for /f "skip=2 tokens=2*" %%a in ('reg query "HKLM\SOFTWARE\Microsoft\Windows NT reg add "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\SoftwareProtectionPlatform" /v "SkipRearm" /t REG_DWORD /d "0" /f %nul% call :dk_color %Red% "Checking SkipRearm [Default 0 Value Not Found. Changing To 0]" %psc% "Start-Job { Stop-Service sppsvc -force } | Wait-Job -Timeout 20 | Out-Null" -set error=1 ) @@ -1462,6 +1458,7 @@ set showfix=1 ) +if not defined notwinact ( call :dk_actid 55c92734-d682-4d71-983e-d6ec3f16059f if not defined apps ( %psc% "Start-Job { Stop-Service sppsvc -force } | Wait-Job -Timeout 20 | Out-Null; $sls = Get-WmiObject SoftwareLicensingService; $f=[io.file]::ReadAllText('!_batp!') -split ':xrm\:.*';iex ($f[1]); ReinstallLicenses" %nul% @@ -1476,6 +1473,7 @@ set "_notfoundids=Not found" call :dk_color %Red% "Checking Activation IDs [!_notfoundids!]" ) ) +) if exist "%tokenstore%\" if not exist "%tokenstore%\tokens.dat" ( @@ -1491,6 +1489,7 @@ reg delete "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Soft reg query "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Schedule\TaskCache\Tree\Microsoft\Windows\SoftwareProtectionPlatform\SvcRestartTask" %nul% || set taskinfo=Removed if "!taskinfo!"=="" set "taskinfo=Not Found" call :dk_color %Red% "Checking SvcRestartTask Status [!taskinfo!, System might deactivate later]" +if not defined error call :dk_color %Blue% "Reboot your machine using the restart option." ) ) diff --git a/MAS/Separate-Files-Version/Activators/KMS38_Activation.cmd b/MAS/Separate-Files-Version/Activators/KMS38_Activation.cmd index f64aa9f..0fc326b 100644 --- a/MAS/Separate-Files-Version/Activators/KMS38_Activation.cmd +++ b/MAS/Separate-Files-Version/Activators/KMS38_Activation.cmd @@ -1435,7 +1435,6 @@ echo Checking WPA Registry Count [%wpainfo%] if not defined notwinact if exist "%SystemRoot%\Servicing\Packages\Microsoft-Windows-*EvalEdition~*.mum" ( reg query "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion" /v EditionID %nul2% | find /i "Eval" %nul1% || ( -set error=1 call :dk_color %Red% "Checking Eval Packages [Non-Eval Licenses are installed in Eval Windows]" set fixes=%fixes% %mas%evaluation_editions call :dk_color2 %Blue% "Help - " %_Yellow% " %mas%evaluation_editions" @@ -1463,13 +1462,11 @@ call :dk_color %Red% "Checking Edition Name [Not Found In Regi ) 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%]" ) if not exist "%SystemRoot%\Servicing\Packages\Microsoft-Windows-*-%osedition%-*.mum" ( -set error=1 call :dk_color %Red% "Checking Package Files [Not Found] [%osedition%]" ) ) @@ -1568,7 +1565,6 @@ for /f "skip=2 tokens=2*" %%a in ('reg query "HKLM\SOFTWARE\Microsoft\Windows NT reg add "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\SoftwareProtectionPlatform" /v "SkipRearm" /t REG_DWORD /d "0" /f %nul% call :dk_color %Red% "Checking SkipRearm [Default 0 Value Not Found. Changing To 0]" %psc% "Start-Job { Stop-Service sppsvc -force } | Wait-Job -Timeout 20 | Out-Null" -set error=1 ) @@ -1614,6 +1610,7 @@ set showfix=1 ) +if not defined notwinact ( call :dk_actid 55c92734-d682-4d71-983e-d6ec3f16059f if not defined apps ( %psc% "Start-Job { Stop-Service sppsvc -force } | Wait-Job -Timeout 20 | Out-Null; $sls = Get-WmiObject SoftwareLicensingService; $f=[io.file]::ReadAllText('!_batp!') -split ':xrm\:.*';iex ($f[1]); ReinstallLicenses" %nul% @@ -1628,6 +1625,7 @@ set "_notfoundids=Not found" call :dk_color %Red% "Checking Activation IDs [!_notfoundids!]" ) ) +) if exist "%tokenstore%\" if not exist "%tokenstore%\tokens.dat" ( @@ -1643,6 +1641,7 @@ reg delete "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Soft reg query "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Schedule\TaskCache\Tree\Microsoft\Windows\SoftwareProtectionPlatform\SvcRestartTask" %nul% || set taskinfo=Removed if "!taskinfo!"=="" set "taskinfo=Not Found" call :dk_color %Red% "Checking SvcRestartTask Status [!taskinfo!, System might deactivate later]" +if not defined error call :dk_color %Blue% "Reboot your machine using the restart option." ) ) diff --git a/MAS/Separate-Files-Version/Activators/Ohook_Activation_AIO.cmd b/MAS/Separate-Files-Version/Activators/Ohook_Activation_AIO.cmd index 50a7b21..720f1f9 100644 --- a/MAS/Separate-Files-Version/Activators/Ohook_Activation_AIO.cmd +++ b/MAS/Separate-Files-Version/Activators/Ohook_Activation_AIO.cmd @@ -1706,7 +1706,6 @@ echo Checking WPA Registry Count [%wpainfo%] if not defined notwinact if exist "%SystemRoot%\Servicing\Packages\Microsoft-Windows-*EvalEdition~*.mum" ( reg query "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion" /v EditionID %nul2% | find /i "Eval" %nul1% || ( -set error=1 call :dk_color %Red% "Checking Eval Packages [Non-Eval Licenses are installed in Eval Windows]" set fixes=%fixes% %mas%evaluation_editions call :dk_color2 %Blue% "Help - " %_Yellow% " %mas%evaluation_editions" @@ -1734,13 +1733,11 @@ call :dk_color %Red% "Checking Edition Name [Not Found In Regi ) 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%]" ) if not exist "%SystemRoot%\Servicing\Packages\Microsoft-Windows-*-%osedition%-*.mum" ( -set error=1 call :dk_color %Red% "Checking Package Files [Not Found] [%osedition%]" ) ) @@ -1839,7 +1836,6 @@ for /f "skip=2 tokens=2*" %%a in ('reg query "HKLM\SOFTWARE\Microsoft\Windows NT reg add "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\SoftwareProtectionPlatform" /v "SkipRearm" /t REG_DWORD /d "0" /f %nul% call :dk_color %Red% "Checking SkipRearm [Default 0 Value Not Found. Changing To 0]" %psc% "Start-Job { Stop-Service sppsvc -force } | Wait-Job -Timeout 20 | Out-Null" -set error=1 ) @@ -1885,6 +1881,7 @@ set showfix=1 ) +if not defined notwinact ( call :dk_actid 55c92734-d682-4d71-983e-d6ec3f16059f if not defined apps ( %psc% "Start-Job { Stop-Service sppsvc -force } | Wait-Job -Timeout 20 | Out-Null; $sls = Get-WmiObject SoftwareLicensingService; $f=[io.file]::ReadAllText('!_batp!') -split ':xrm\:.*';iex ($f[1]); ReinstallLicenses" %nul% @@ -1899,6 +1896,7 @@ set "_notfoundids=Not found" call :dk_color %Red% "Checking Activation IDs [!_notfoundids!]" ) ) +) if exist "%tokenstore%\" if not exist "%tokenstore%\tokens.dat" ( @@ -1914,6 +1912,7 @@ reg delete "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Soft reg query "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Schedule\TaskCache\Tree\Microsoft\Windows\SoftwareProtectionPlatform\SvcRestartTask" %nul% || set taskinfo=Removed if "!taskinfo!"=="" set "taskinfo=Not Found" call :dk_color %Red% "Checking SvcRestartTask Status [!taskinfo!, System might deactivate later]" +if not defined error call :dk_color %Blue% "Reboot your machine using the restart option." ) ) diff --git a/MAS/Separate-Files-Version/Activators/Online_KMS_Activation.cmd b/MAS/Separate-Files-Version/Activators/Online_KMS_Activation.cmd index 24cb014..977b660 100644 --- a/MAS/Separate-Files-Version/Activators/Online_KMS_Activation.cmd +++ b/MAS/Separate-Files-Version/Activators/Online_KMS_Activation.cmd @@ -2863,7 +2863,6 @@ echo Checking WPA Registry Count [%wpainfo%] if not defined notwinact if exist "%SystemRoot%\Servicing\Packages\Microsoft-Windows-*EvalEdition~*.mum" ( reg query "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion" /v EditionID %nul2% | find /i "Eval" %nul1% || ( -set error=1 call :dk_color %Red% "Checking Eval Packages [Non-Eval Licenses are installed in Eval Windows]" set fixes=%fixes% %mas%evaluation_editions call :dk_color2 %Blue% "Help - " %_Yellow% " %mas%evaluation_editions" @@ -2891,13 +2890,11 @@ call :dk_color %Red% "Checking Edition Name [Not Found In Regi ) 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%]" ) if not exist "%SystemRoot%\Servicing\Packages\Microsoft-Windows-*-%osedition%-*.mum" ( -set error=1 call :dk_color %Red% "Checking Package Files [Not Found] [%osedition%]" ) ) @@ -2996,7 +2993,6 @@ for /f "skip=2 tokens=2*" %%a in ('reg query "HKLM\SOFTWARE\Microsoft\Windows NT reg add "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\SoftwareProtectionPlatform" /v "SkipRearm" /t REG_DWORD /d "0" /f %nul% call :dk_color %Red% "Checking SkipRearm [Default 0 Value Not Found. Changing To 0]" %psc% "Start-Job { Stop-Service sppsvc -force } | Wait-Job -Timeout 20 | Out-Null" -set error=1 ) @@ -3042,6 +3038,7 @@ set showfix=1 ) +if not defined notwinact ( call :dk_actid 55c92734-d682-4d71-983e-d6ec3f16059f if not defined apps ( %psc% "Start-Job { Stop-Service sppsvc -force } | Wait-Job -Timeout 20 | Out-Null; $sls = Get-WmiObject SoftwareLicensingService; $f=[io.file]::ReadAllText('!_batp!') -split ':xrm\:.*';iex ($f[1]); ReinstallLicenses" %nul% @@ -3056,6 +3053,7 @@ set "_notfoundids=Not found" call :dk_color %Red% "Checking Activation IDs [!_notfoundids!]" ) ) +) if exist "%tokenstore%\" if not exist "%tokenstore%\tokens.dat" ( @@ -3071,6 +3069,7 @@ reg delete "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Soft reg query "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Schedule\TaskCache\Tree\Microsoft\Windows\SoftwareProtectionPlatform\SvcRestartTask" %nul% || set taskinfo=Removed if "!taskinfo!"=="" set "taskinfo=Not Found" call :dk_color %Red% "Checking SvcRestartTask Status [!taskinfo!, System might deactivate later]" +if not defined error call :dk_color %Blue% "Reboot your machine using the restart option." ) )