From 9765e7d05f585fc2966547d75550841b17f52248 Mon Sep 17 00:00:00 2001 From: WindowsAddict Date: Thu, 13 Feb 2025 23:17:18 +0530 Subject: [PATCH 01/79] Revert-export-ignore --- .gitattributes | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.gitattributes b/.gitattributes index de5bd3d..8749e12 100644 --- a/.gitattributes +++ b/.gitattributes @@ -1,4 +1,4 @@ -MAS export-ignore -LICENSE export-ignore -README.md export-ignore +# MAS export-ignore +# LICENSE export-ignore +# README.md export-ignore .gitattributes export-ignore From 6c8732dd06e8ea604232b8fbd17218526c6f9552 Mon Sep 17 00:00:00 2001 From: WindowsAddict Date: Tue, 18 Feb 2025 03:35:32 +0530 Subject: [PATCH 02/79] Correct the chart link in readme --- MAS/Separate-Files-Version/Activators/_ReadMe.txt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/MAS/Separate-Files-Version/Activators/_ReadMe.txt b/MAS/Separate-Files-Version/Activators/_ReadMe.txt index 2473884..058a628 100644 --- a/MAS/Separate-Files-Version/Activators/_ReadMe.txt +++ b/MAS/Separate-Files-Version/Activators/_ReadMe.txt @@ -10,4 +10,5 @@ Online KMS - Windows / Office - 180 Days. Lifetime With Renewal -------------------------------------------------------------------------------------- -For more details, check https://massgrave.dev/activations_comparison \ No newline at end of file +Check the below link for more details: +https://massgrave.dev/chart \ No newline at end of file From 6adb247334ed7cff17cc7ce2089fd2d4e77771bf Mon Sep 17 00:00:00 2001 From: WindowsAddict Date: Tue, 18 Feb 2025 03:42:42 +0530 Subject: [PATCH 03/79] Update W10 ESU editions list as per 19045.5552 --- MAS/All-In-One-Version-KL/MAS_AIO.cmd | 8 ++++---- .../Activators/TSforge_Activation.cmd | 8 ++++---- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/MAS/All-In-One-Version-KL/MAS_AIO.cmd b/MAS/All-In-One-Version-KL/MAS_AIO.cmd index dfb8b2f..f67809e 100644 --- a/MAS/All-In-One-Version-KL/MAS_AIO.cmd +++ b/MAS/All-In-One-Version-KL/MAS_AIO.cmd @@ -4037,10 +4037,10 @@ REM Windows8.1 REM WindowsServer2012/2012R2 55b1dd2d-2209-4ea0-a805-06298bad25b3_Server-ESU-Year3[1-3y]_-ServerDatacenter-ServerDatacenterCore-ServerDatacenterV-ServerDatacenterVCore-ServerStandard-ServerStandardCore-ServerStandardV-ServerStandardVCore- REM Windows10 -83d49986-add3-41d7-ba33-87c7bfb5c0fb_Client-ESU-Year3[1-3y]_-Education-EducationN-Enterprise-EnterpriseN-Professional-ProfessionalEducation-ProfessionalEducationN-ProfessionalN-ProfessionalWorkstation-ProfessionalWorkstationN- -0b533b5e-08b6-44f9-b885-c2de291ba456_Client-ESU-Year6[4-6y]_-Education-EducationN-Enterprise-EnterpriseN-Professional-ProfessionalEducation-ProfessionalEducationN-ProfessionalN-ProfessionalWorkstation-ProfessionalWorkstationN- -4dac5a0c-5709-4595-a32c-14a56a4a6b31_Client-IoT-ESU-Year3[1-3y]_-IoTEnterprise- REM Removed IoTEnterpriseS because it already has longer support -f69e2d51-3bbd-4ddf-8da7-a145e9dca597_Client-IoT-ESU-Year6[4-6y]_-IoTEnterprise- REM Removed IoTEnterpriseS because it already has longer support +83d49986-add3-41d7-ba33-87c7bfb5c0fb_Client-ESU-Year3[1-3y]_-Education-EducationN-Enterprise-EnterpriseN-Professional-ProfessionalEducation-ProfessionalEducationN-ProfessionalN-ProfessionalWorkstation-ProfessionalWorkstationN-ServerRdsh- +0b533b5e-08b6-44f9-b885-c2de291ba456_Client-ESU-Year6[4-6y]_-Education-EducationN-Enterprise-EnterpriseN-Professional-ProfessionalEducation-ProfessionalEducationN-ProfessionalN-ProfessionalWorkstation-ProfessionalWorkstationN-ServerRdsh- +4dac5a0c-5709-4595-a32c-14a56a4a6b31_Client-IoT-ESU-Year3[1-3y]_-IoTEnterprise- +f69e2d51-3bbd-4ddf-8da7-a145e9dca597_Client-IoT-ESU-Year6[4-6y]_-IoTEnterprise- ) do ( for /f "tokens=1-3 delims=_" %%A in ("%%#") do ( echo "%allapps%" | find /i "%%A" %nul1% && ( diff --git a/MAS/Separate-Files-Version/Activators/TSforge_Activation.cmd b/MAS/Separate-Files-Version/Activators/TSforge_Activation.cmd index 030e406..23b88b4 100644 --- a/MAS/Separate-Files-Version/Activators/TSforge_Activation.cmd +++ b/MAS/Separate-Files-Version/Activators/TSforge_Activation.cmd @@ -735,10 +735,10 @@ REM Windows8.1 REM WindowsServer2012/2012R2 55b1dd2d-2209-4ea0-a805-06298bad25b3_Server-ESU-Year3[1-3y]_-ServerDatacenter-ServerDatacenterCore-ServerDatacenterV-ServerDatacenterVCore-ServerStandard-ServerStandardCore-ServerStandardV-ServerStandardVCore- REM Windows10 -83d49986-add3-41d7-ba33-87c7bfb5c0fb_Client-ESU-Year3[1-3y]_-Education-EducationN-Enterprise-EnterpriseN-Professional-ProfessionalEducation-ProfessionalEducationN-ProfessionalN-ProfessionalWorkstation-ProfessionalWorkstationN- -0b533b5e-08b6-44f9-b885-c2de291ba456_Client-ESU-Year6[4-6y]_-Education-EducationN-Enterprise-EnterpriseN-Professional-ProfessionalEducation-ProfessionalEducationN-ProfessionalN-ProfessionalWorkstation-ProfessionalWorkstationN- -4dac5a0c-5709-4595-a32c-14a56a4a6b31_Client-IoT-ESU-Year3[1-3y]_-IoTEnterprise- REM Removed IoTEnterpriseS because it already has longer support -f69e2d51-3bbd-4ddf-8da7-a145e9dca597_Client-IoT-ESU-Year6[4-6y]_-IoTEnterprise- REM Removed IoTEnterpriseS because it already has longer support +83d49986-add3-41d7-ba33-87c7bfb5c0fb_Client-ESU-Year3[1-3y]_-Education-EducationN-Enterprise-EnterpriseN-Professional-ProfessionalEducation-ProfessionalEducationN-ProfessionalN-ProfessionalWorkstation-ProfessionalWorkstationN-ServerRdsh- +0b533b5e-08b6-44f9-b885-c2de291ba456_Client-ESU-Year6[4-6y]_-Education-EducationN-Enterprise-EnterpriseN-Professional-ProfessionalEducation-ProfessionalEducationN-ProfessionalN-ProfessionalWorkstation-ProfessionalWorkstationN-ServerRdsh- +4dac5a0c-5709-4595-a32c-14a56a4a6b31_Client-IoT-ESU-Year3[1-3y]_-IoTEnterprise- +f69e2d51-3bbd-4ddf-8da7-a145e9dca597_Client-IoT-ESU-Year6[4-6y]_-IoTEnterprise- ) do ( for /f "tokens=1-3 delims=_" %%A in ("%%#") do ( echo "%allapps%" | find /i "%%A" %nul1% && ( From 8d67d62c1590a0e6808557ff32c5325462a16879 Mon Sep 17 00:00:00 2001 From: WindowsAddict Date: Tue, 18 Feb 2025 04:44:35 +0530 Subject: [PATCH 04/79] Update esu info --- MAS/All-In-One-Version-KL/MAS_AIO.cmd | 4 ++-- MAS/Separate-Files-Version/Activators/TSforge_Activation.cmd | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/MAS/All-In-One-Version-KL/MAS_AIO.cmd b/MAS/All-In-One-Version-KL/MAS_AIO.cmd index f67809e..a2c8dee 100644 --- a/MAS/All-In-One-Version-KL/MAS_AIO.cmd +++ b/MAS/All-In-One-Version-KL/MAS_AIO.cmd @@ -4699,13 +4699,13 @@ set fixes=%fixes% %mas%troubleshoot call :dk_color2 %Blue% "Help - " %_Yellow% " %mas%troubleshoot" ) else ( echo "%tsids%" | find /i "7e94be23-b161-4956-a682-146ab291774c" %nul1% && ( -call :dk_color %Gray% "Windows Update can receive 1-3 years of ESU. 4-6 year ESU is not officially supported, but you can manually install updates." +call :dk_color %Gray% "Windows Update can receive 1-3 years of ESU. 4-6 years ESU is not officially supported, but you can manually install updates." ) echo "%tsids%" | findstr /i "4afc620f-12a4-48ad-8015-2aebfbd6e47c 11be7019-a309-4763-9a09-091d1722ffe3" %nul1% && ( call :dk_color %Gray% "ESU is not officially supported on Windows 8.1, but you can manually install updates until Jan-2024." ) echo "%tsids%" | findstr /i "0b533b5e-08b6-44f9-b885-c2de291ba456 f69e2d51-3bbd-4ddf-8da7-a145e9dca597" %nul1% && ( -call :dk_color %Gray% "Windows Update can receive 1-3 years of ESU. 4-6 year ESU license is added just as a placeholder." +call :dk_color %Gray% "Windows Update can receive 1-3 years of ESU. 4-6 years ESU is not officially supported, but it might be useful." ) ) diff --git a/MAS/Separate-Files-Version/Activators/TSforge_Activation.cmd b/MAS/Separate-Files-Version/Activators/TSforge_Activation.cmd index 23b88b4..03fddba 100644 --- a/MAS/Separate-Files-Version/Activators/TSforge_Activation.cmd +++ b/MAS/Separate-Files-Version/Activators/TSforge_Activation.cmd @@ -1397,13 +1397,13 @@ set fixes=%fixes% %mas%troubleshoot call :dk_color2 %Blue% "Help - " %_Yellow% " %mas%troubleshoot" ) else ( echo "%tsids%" | find /i "7e94be23-b161-4956-a682-146ab291774c" %nul1% && ( -call :dk_color %Gray% "Windows Update can receive 1-3 years of ESU. 4-6 year ESU is not officially supported, but you can manually install updates." +call :dk_color %Gray% "Windows Update can receive 1-3 years of ESU. 4-6 years ESU is not officially supported, but you can manually install updates." ) echo "%tsids%" | findstr /i "4afc620f-12a4-48ad-8015-2aebfbd6e47c 11be7019-a309-4763-9a09-091d1722ffe3" %nul1% && ( call :dk_color %Gray% "ESU is not officially supported on Windows 8.1, but you can manually install updates until Jan-2024." ) echo "%tsids%" | findstr /i "0b533b5e-08b6-44f9-b885-c2de291ba456 f69e2d51-3bbd-4ddf-8da7-a145e9dca597" %nul1% && ( -call :dk_color %Gray% "Windows Update can receive 1-3 years of ESU. 4-6 year ESU license is added just as a placeholder." +call :dk_color %Gray% "Windows Update can receive 1-3 years of ESU. 4-6 years ESU is not officially supported, but it might be useful." ) ) From a5bcfdd3e66db80694b44f323e1f7e40e30364a4 Mon Sep 17 00:00:00 2001 From: WindowsAddict Date: Sat, 22 Feb 2025 19:50:37 +0530 Subject: [PATCH 05/79] Update info in tsforge uninstall section --- MAS/All-In-One-Version-KL/MAS_AIO.cmd | 3 +-- MAS/Separate-Files-Version/Activators/TSforge_Activation.cmd | 3 +-- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/MAS/All-In-One-Version-KL/MAS_AIO.cmd b/MAS/All-In-One-Version-KL/MAS_AIO.cmd index a2c8dee..6ad1a46 100644 --- a/MAS/All-In-One-Version-KL/MAS_AIO.cmd +++ b/MAS/All-In-One-Version-KL/MAS_AIO.cmd @@ -4740,8 +4740,7 @@ mode 100, 30 title Remove TSforge Activation %masver% echo: -echo TSforge activation doesn't modify any Windows component. -echo TSforge activation doesn't install any new file in the system. +echo TSforge activation doesn't modify any Windows components and doesn't install any new files. echo: echo Instead, it appends data to one of data files used by Software Protection Platform. echo: diff --git a/MAS/Separate-Files-Version/Activators/TSforge_Activation.cmd b/MAS/Separate-Files-Version/Activators/TSforge_Activation.cmd index 03fddba..be410b2 100644 --- a/MAS/Separate-Files-Version/Activators/TSforge_Activation.cmd +++ b/MAS/Separate-Files-Version/Activators/TSforge_Activation.cmd @@ -1438,8 +1438,7 @@ mode 100, 30 title Remove TSforge Activation %masver% echo: -echo TSforge activation doesn't modify any Windows component. -echo TSforge activation doesn't install any new file in the system. +echo TSforge activation doesn't modify any Windows components and doesn't install any new files. echo: echo Instead, it appends data to one of data files used by Software Protection Platform. echo: From a9eda8f572653ae1459757018f8a9691411635ef Mon Sep 17 00:00:00 2001 From: WindowsAddict Date: Sat, 22 Feb 2025 20:13:09 +0530 Subject: [PATCH 06/79] Select 1 and 2Y ESU as well instead of only 3Y, just to be sure --- MAS/All-In-One-Version-KL/MAS_AIO.cmd | 8 ++++++-- .../Activators/TSforge_Activation.cmd | 8 ++++++-- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/MAS/All-In-One-Version-KL/MAS_AIO.cmd b/MAS/All-In-One-Version-KL/MAS_AIO.cmd index 6ad1a46..45bd294 100644 --- a/MAS/All-In-One-Version-KL/MAS_AIO.cmd +++ b/MAS/All-In-One-Version-KL/MAS_AIO.cmd @@ -4037,9 +4037,13 @@ REM Windows8.1 REM WindowsServer2012/2012R2 55b1dd2d-2209-4ea0-a805-06298bad25b3_Server-ESU-Year3[1-3y]_-ServerDatacenter-ServerDatacenterCore-ServerDatacenterV-ServerDatacenterVCore-ServerStandard-ServerStandardCore-ServerStandardV-ServerStandardVCore- REM Windows10 -83d49986-add3-41d7-ba33-87c7bfb5c0fb_Client-ESU-Year3[1-3y]_-Education-EducationN-Enterprise-EnterpriseN-Professional-ProfessionalEducation-ProfessionalEducationN-ProfessionalN-ProfessionalWorkstation-ProfessionalWorkstationN-ServerRdsh- +f520e45e-7413-4a34-a497-d2765967d094_Client-ESU-Year1_-Education-EducationN-Enterprise-EnterpriseN-Professional-ProfessionalEducation-ProfessionalEducationN-ProfessionalN-ProfessionalWorkstation-ProfessionalWorkstationN-ServerRdsh- +1043add5-23b1-4afb-9a0f-64343c8f3f8d_Client-ESU-Year2_-Education-EducationN-Enterprise-EnterpriseN-Professional-ProfessionalEducation-ProfessionalEducationN-ProfessionalN-ProfessionalWorkstation-ProfessionalWorkstationN-ServerRdsh- +83d49986-add3-41d7-ba33-87c7bfb5c0fb_Client-ESU-Year3_-Education-EducationN-Enterprise-EnterpriseN-Professional-ProfessionalEducation-ProfessionalEducationN-ProfessionalN-ProfessionalWorkstation-ProfessionalWorkstationN-ServerRdsh- 0b533b5e-08b6-44f9-b885-c2de291ba456_Client-ESU-Year6[4-6y]_-Education-EducationN-Enterprise-EnterpriseN-Professional-ProfessionalEducation-ProfessionalEducationN-ProfessionalN-ProfessionalWorkstation-ProfessionalWorkstationN-ServerRdsh- -4dac5a0c-5709-4595-a32c-14a56a4a6b31_Client-IoT-ESU-Year3[1-3y]_-IoTEnterprise- +b8527af1-5389-447c-9a88-2d1691ea33d3_Client-IoT-ESU-Year1_-IoTEnterprise- +7b76ee02-0a75-4f08-85d5-bd0feadad0c0_Client-IoT-ESU-Year2_-IoTEnterprise- +4dac5a0c-5709-4595-a32c-14a56a4a6b31_Client-IoT-ESU-Year3_-IoTEnterprise- f69e2d51-3bbd-4ddf-8da7-a145e9dca597_Client-IoT-ESU-Year6[4-6y]_-IoTEnterprise- ) do ( for /f "tokens=1-3 delims=_" %%A in ("%%#") do ( diff --git a/MAS/Separate-Files-Version/Activators/TSforge_Activation.cmd b/MAS/Separate-Files-Version/Activators/TSforge_Activation.cmd index be410b2..e04677d 100644 --- a/MAS/Separate-Files-Version/Activators/TSforge_Activation.cmd +++ b/MAS/Separate-Files-Version/Activators/TSforge_Activation.cmd @@ -735,9 +735,13 @@ REM Windows8.1 REM WindowsServer2012/2012R2 55b1dd2d-2209-4ea0-a805-06298bad25b3_Server-ESU-Year3[1-3y]_-ServerDatacenter-ServerDatacenterCore-ServerDatacenterV-ServerDatacenterVCore-ServerStandard-ServerStandardCore-ServerStandardV-ServerStandardVCore- REM Windows10 -83d49986-add3-41d7-ba33-87c7bfb5c0fb_Client-ESU-Year3[1-3y]_-Education-EducationN-Enterprise-EnterpriseN-Professional-ProfessionalEducation-ProfessionalEducationN-ProfessionalN-ProfessionalWorkstation-ProfessionalWorkstationN-ServerRdsh- +f520e45e-7413-4a34-a497-d2765967d094_Client-ESU-Year1_-Education-EducationN-Enterprise-EnterpriseN-Professional-ProfessionalEducation-ProfessionalEducationN-ProfessionalN-ProfessionalWorkstation-ProfessionalWorkstationN-ServerRdsh- +1043add5-23b1-4afb-9a0f-64343c8f3f8d_Client-ESU-Year2_-Education-EducationN-Enterprise-EnterpriseN-Professional-ProfessionalEducation-ProfessionalEducationN-ProfessionalN-ProfessionalWorkstation-ProfessionalWorkstationN-ServerRdsh- +83d49986-add3-41d7-ba33-87c7bfb5c0fb_Client-ESU-Year3_-Education-EducationN-Enterprise-EnterpriseN-Professional-ProfessionalEducation-ProfessionalEducationN-ProfessionalN-ProfessionalWorkstation-ProfessionalWorkstationN-ServerRdsh- 0b533b5e-08b6-44f9-b885-c2de291ba456_Client-ESU-Year6[4-6y]_-Education-EducationN-Enterprise-EnterpriseN-Professional-ProfessionalEducation-ProfessionalEducationN-ProfessionalN-ProfessionalWorkstation-ProfessionalWorkstationN-ServerRdsh- -4dac5a0c-5709-4595-a32c-14a56a4a6b31_Client-IoT-ESU-Year3[1-3y]_-IoTEnterprise- +b8527af1-5389-447c-9a88-2d1691ea33d3_Client-IoT-ESU-Year1_-IoTEnterprise- +7b76ee02-0a75-4f08-85d5-bd0feadad0c0_Client-IoT-ESU-Year2_-IoTEnterprise- +4dac5a0c-5709-4595-a32c-14a56a4a6b31_Client-IoT-ESU-Year3_-IoTEnterprise- f69e2d51-3bbd-4ddf-8da7-a145e9dca597_Client-IoT-ESU-Year6[4-6y]_-IoTEnterprise- ) do ( for /f "tokens=1-3 delims=_" %%A in ("%%#") do ( From 5e7e42a44655993b4975e9616b20ff2b8c8d0b59 Mon Sep 17 00:00:00 2001 From: WindowsAddict Date: Sat, 22 Feb 2025 20:52:26 +0530 Subject: [PATCH 07/79] Add a backup url in update check --- MAS/All-In-One-Version-KL/MAS_AIO.cmd | 14 ++++++++++---- .../Activators/HWID_Activation.cmd | 14 ++++++++++---- .../Activators/KMS38_Activation.cmd | 14 ++++++++++---- .../Activators/Ohook_Activation_AIO.cmd | 14 ++++++++++---- .../Activators/Online_KMS_Activation.cmd | 14 ++++++++++---- .../Activators/TSforge_Activation.cmd | 14 ++++++++++---- .../Change_Office_Edition.cmd | 14 ++++++++++---- .../Change_Windows_Edition.cmd | 14 ++++++++++---- MAS/Separate-Files-Version/Extract_OEM_Folder.cmd | 14 ++++++++++---- MAS/Separate-Files-Version/Troubleshoot.cmd | 14 ++++++++++---- 10 files changed, 100 insertions(+), 40 deletions(-) diff --git a/MAS/All-In-One-Version-KL/MAS_AIO.cmd b/MAS/All-In-One-Version-KL/MAS_AIO.cmd index 45bd294..a043b38 100644 --- a/MAS/All-In-One-Version-KL/MAS_AIO.cmd +++ b/MAS/All-In-One-Version-KL/MAS_AIO.cmd @@ -265,12 +265,18 @@ set "d4=$k=$t.CreateType(); $b=$k::SetConsoleMode($k::GetStdHandle(-10), 0x0080) set -= set old= +set pingp= set upver=%masver:.=% -for /f "delims=[] tokens=2" %%# in ('ping -4 -n 1 activ%-%ated.win') do ( -if not "%%#"=="" set old=1 -for /f "delims=[] tokens=2" %%# in ('ping -4 -n 1 updatecheck%upver%.activ%-%ated.win') do ( -if not "%%#"=="" set old= +for %%A in ( +activ%-%ated.win +mass%-%grave.dev +) do if not defined pingp ( +for /f "delims=[] tokens=2" %%B in ('ping -n 1 %%A') do ( +if not "%%B"=="" (set old=1& set pingp=1) +for /f "delims=[] tokens=2" %%C in ('ping -n 1 updatecheck%upver%.%%A') do ( +if not "%%C"=="" set old= +) ) ) diff --git a/MAS/Separate-Files-Version/Activators/HWID_Activation.cmd b/MAS/Separate-Files-Version/Activators/HWID_Activation.cmd index 6b960f8..1989d51 100644 --- a/MAS/Separate-Files-Version/Activators/HWID_Activation.cmd +++ b/MAS/Separate-Files-Version/Activators/HWID_Activation.cmd @@ -304,12 +304,18 @@ set "d4=$k=$t.CreateType(); $b=$k::SetConsoleMode($k::GetStdHandle(-10), 0x0080) set -= set old= +set pingp= set upver=%masver:.=% -for /f "delims=[] tokens=2" %%# in ('ping -4 -n 1 activ%-%ated.win') do ( -if not "%%#"=="" set old=1 -for /f "delims=[] tokens=2" %%# in ('ping -4 -n 1 updatecheck%upver%.activ%-%ated.win') do ( -if not "%%#"=="" set old= +for %%A in ( +activ%-%ated.win +mass%-%grave.dev +) do if not defined pingp ( +for /f "delims=[] tokens=2" %%B in ('ping -n 1 %%A') do ( +if not "%%B"=="" (set old=1& set pingp=1) +for /f "delims=[] tokens=2" %%C in ('ping -n 1 updatecheck%upver%.%%A') do ( +if not "%%C"=="" set old= +) ) ) diff --git a/MAS/Separate-Files-Version/Activators/KMS38_Activation.cmd b/MAS/Separate-Files-Version/Activators/KMS38_Activation.cmd index 7ae669d..17fae23 100644 --- a/MAS/Separate-Files-Version/Activators/KMS38_Activation.cmd +++ b/MAS/Separate-Files-Version/Activators/KMS38_Activation.cmd @@ -307,12 +307,18 @@ set "d4=$k=$t.CreateType(); $b=$k::SetConsoleMode($k::GetStdHandle(-10), 0x0080) set -= set old= +set pingp= set upver=%masver:.=% -for /f "delims=[] tokens=2" %%# in ('ping -4 -n 1 activ%-%ated.win') do ( -if not "%%#"=="" set old=1 -for /f "delims=[] tokens=2" %%# in ('ping -4 -n 1 updatecheck%upver%.activ%-%ated.win') do ( -if not "%%#"=="" set old= +for %%A in ( +activ%-%ated.win +mass%-%grave.dev +) do if not defined pingp ( +for /f "delims=[] tokens=2" %%B in ('ping -n 1 %%A') do ( +if not "%%B"=="" (set old=1& set pingp=1) +for /f "delims=[] tokens=2" %%C in ('ping -n 1 updatecheck%upver%.%%A') do ( +if not "%%C"=="" set old= +) ) ) diff --git a/MAS/Separate-Files-Version/Activators/Ohook_Activation_AIO.cmd b/MAS/Separate-Files-Version/Activators/Ohook_Activation_AIO.cmd index 454644c..980cb50 100644 --- a/MAS/Separate-Files-Version/Activators/Ohook_Activation_AIO.cmd +++ b/MAS/Separate-Files-Version/Activators/Ohook_Activation_AIO.cmd @@ -297,12 +297,18 @@ set "d4=$k=$t.CreateType(); $b=$k::SetConsoleMode($k::GetStdHandle(-10), 0x0080) set -= set old= +set pingp= set upver=%masver:.=% -for /f "delims=[] tokens=2" %%# in ('ping -4 -n 1 activ%-%ated.win') do ( -if not "%%#"=="" set old=1 -for /f "delims=[] tokens=2" %%# in ('ping -4 -n 1 updatecheck%upver%.activ%-%ated.win') do ( -if not "%%#"=="" set old= +for %%A in ( +activ%-%ated.win +mass%-%grave.dev +) do if not defined pingp ( +for /f "delims=[] tokens=2" %%B in ('ping -n 1 %%A') do ( +if not "%%B"=="" (set old=1& set pingp=1) +for /f "delims=[] tokens=2" %%C in ('ping -n 1 updatecheck%upver%.%%A') do ( +if not "%%C"=="" set old= +) ) ) diff --git a/MAS/Separate-Files-Version/Activators/Online_KMS_Activation.cmd b/MAS/Separate-Files-Version/Activators/Online_KMS_Activation.cmd index 519c1bd..70632ce 100644 --- a/MAS/Separate-Files-Version/Activators/Online_KMS_Activation.cmd +++ b/MAS/Separate-Files-Version/Activators/Online_KMS_Activation.cmd @@ -326,12 +326,18 @@ set "d4=$k=$t.CreateType(); $b=$k::SetConsoleMode($k::GetStdHandle(-10), 0x0080) set -= set old= +set pingp= set upver=%masver:.=% -for /f "delims=[] tokens=2" %%# in ('ping -4 -n 1 activ%-%ated.win') do ( -if not "%%#"=="" set old=1 -for /f "delims=[] tokens=2" %%# in ('ping -4 -n 1 updatecheck%upver%.activ%-%ated.win') do ( -if not "%%#"=="" set old= +for %%A in ( +activ%-%ated.win +mass%-%grave.dev +) do if not defined pingp ( +for /f "delims=[] tokens=2" %%B in ('ping -n 1 %%A') do ( +if not "%%B"=="" (set old=1& set pingp=1) +for /f "delims=[] tokens=2" %%C in ('ping -n 1 updatecheck%upver%.%%A') do ( +if not "%%C"=="" set old= +) ) ) diff --git a/MAS/Separate-Files-Version/Activators/TSforge_Activation.cmd b/MAS/Separate-Files-Version/Activators/TSforge_Activation.cmd index e04677d..1af9408 100644 --- a/MAS/Separate-Files-Version/Activators/TSforge_Activation.cmd +++ b/MAS/Separate-Files-Version/Activators/TSforge_Activation.cmd @@ -332,12 +332,18 @@ set "d4=$k=$t.CreateType(); $b=$k::SetConsoleMode($k::GetStdHandle(-10), 0x0080) set -= set old= +set pingp= set upver=%masver:.=% -for /f "delims=[] tokens=2" %%# in ('ping -4 -n 1 activ%-%ated.win') do ( -if not "%%#"=="" set old=1 -for /f "delims=[] tokens=2" %%# in ('ping -4 -n 1 updatecheck%upver%.activ%-%ated.win') do ( -if not "%%#"=="" set old= +for %%A in ( +activ%-%ated.win +mass%-%grave.dev +) do if not defined pingp ( +for /f "delims=[] tokens=2" %%B in ('ping -n 1 %%A') do ( +if not "%%B"=="" (set old=1& set pingp=1) +for /f "delims=[] tokens=2" %%C in ('ping -n 1 updatecheck%upver%.%%A') do ( +if not "%%C"=="" set old= +) ) ) diff --git a/MAS/Separate-Files-Version/Change_Office_Edition.cmd b/MAS/Separate-Files-Version/Change_Office_Edition.cmd index 05d4410..29fec81 100644 --- a/MAS/Separate-Files-Version/Change_Office_Edition.cmd +++ b/MAS/Separate-Files-Version/Change_Office_Edition.cmd @@ -257,12 +257,18 @@ set "d4=$k=$t.CreateType(); $b=$k::SetConsoleMode($k::GetStdHandle(-10), 0x0080) set -= set old= +set pingp= set upver=%masver:.=% -for /f "delims=[] tokens=2" %%# in ('ping -4 -n 1 activ%-%ated.win') do ( -if not "%%#"=="" set old=1 -for /f "delims=[] tokens=2" %%# in ('ping -4 -n 1 updatecheck%upver%.activ%-%ated.win') do ( -if not "%%#"=="" set old= +for %%A in ( +activ%-%ated.win +mass%-%grave.dev +) do if not defined pingp ( +for /f "delims=[] tokens=2" %%B in ('ping -n 1 %%A') do ( +if not "%%B"=="" (set old=1& set pingp=1) +for /f "delims=[] tokens=2" %%C in ('ping -n 1 updatecheck%upver%.%%A') do ( +if not "%%C"=="" set old= +) ) ) diff --git a/MAS/Separate-Files-Version/Change_Windows_Edition.cmd b/MAS/Separate-Files-Version/Change_Windows_Edition.cmd index fa4f62f..3c954d7 100644 --- a/MAS/Separate-Files-Version/Change_Windows_Edition.cmd +++ b/MAS/Separate-Files-Version/Change_Windows_Edition.cmd @@ -262,12 +262,18 @@ set "d4=$k=$t.CreateType(); $b=$k::SetConsoleMode($k::GetStdHandle(-10), 0x0080) set -= set old= +set pingp= set upver=%masver:.=% -for /f "delims=[] tokens=2" %%# in ('ping -4 -n 1 activ%-%ated.win') do ( -if not "%%#"=="" set old=1 -for /f "delims=[] tokens=2" %%# in ('ping -4 -n 1 updatecheck%upver%.activ%-%ated.win') do ( -if not "%%#"=="" set old= +for %%A in ( +activ%-%ated.win +mass%-%grave.dev +) do if not defined pingp ( +for /f "delims=[] tokens=2" %%B in ('ping -n 1 %%A') do ( +if not "%%B"=="" (set old=1& set pingp=1) +for /f "delims=[] tokens=2" %%C in ('ping -n 1 updatecheck%upver%.%%A') do ( +if not "%%C"=="" set old= +) ) ) diff --git a/MAS/Separate-Files-Version/Extract_OEM_Folder.cmd b/MAS/Separate-Files-Version/Extract_OEM_Folder.cmd index bae7818..2b70d33 100644 --- a/MAS/Separate-Files-Version/Extract_OEM_Folder.cmd +++ b/MAS/Separate-Files-Version/Extract_OEM_Folder.cmd @@ -256,12 +256,18 @@ set "d4=$k=$t.CreateType(); $b=$k::SetConsoleMode($k::GetStdHandle(-10), 0x0080) set -= set old= +set pingp= set upver=%masver:.=% -for /f "delims=[] tokens=2" %%# in ('ping -4 -n 1 activ%-%ated.win') do ( -if not "%%#"=="" set old=1 -for /f "delims=[] tokens=2" %%# in ('ping -4 -n 1 updatecheck%upver%.activ%-%ated.win') do ( -if not "%%#"=="" set old= +for %%A in ( +activ%-%ated.win +mass%-%grave.dev +) do if not defined pingp ( +for /f "delims=[] tokens=2" %%B in ('ping -n 1 %%A') do ( +if not "%%B"=="" (set old=1& set pingp=1) +for /f "delims=[] tokens=2" %%C in ('ping -n 1 updatecheck%upver%.%%A') do ( +if not "%%C"=="" set old= +) ) ) diff --git a/MAS/Separate-Files-Version/Troubleshoot.cmd b/MAS/Separate-Files-Version/Troubleshoot.cmd index fb32306..1884358 100644 --- a/MAS/Separate-Files-Version/Troubleshoot.cmd +++ b/MAS/Separate-Files-Version/Troubleshoot.cmd @@ -257,12 +257,18 @@ set "d4=$k=$t.CreateType(); $b=$k::SetConsoleMode($k::GetStdHandle(-10), 0x0080) set -= set old= +set pingp= set upver=%masver:.=% -for /f "delims=[] tokens=2" %%# in ('ping -4 -n 1 activ%-%ated.win') do ( -if not "%%#"=="" set old=1 -for /f "delims=[] tokens=2" %%# in ('ping -4 -n 1 updatecheck%upver%.activ%-%ated.win') do ( -if not "%%#"=="" set old= +for %%A in ( +activ%-%ated.win +mass%-%grave.dev +) do if not defined pingp ( +for /f "delims=[] tokens=2" %%B in ('ping -n 1 %%A') do ( +if not "%%B"=="" (set old=1& set pingp=1) +for /f "delims=[] tokens=2" %%C in ('ping -n 1 updatecheck%upver%.%%A') do ( +if not "%%C"=="" set old= +) ) ) From 55afa30fcd9147fe54ad1a85193e9777df2bb63b Mon Sep 17 00:00:00 2001 From: WindowsAddict Date: Sun, 23 Feb 2025 20:36:55 +0530 Subject: [PATCH 08/79] Improve powershell test --- MAS/All-In-One-Version-KL/MAS_AIO.cmd | 57 ++++++++++--------- .../Activators/HWID_Activation.cmd | 57 ++++++++++--------- .../Activators/KMS38_Activation.cmd | 57 ++++++++++--------- .../Activators/Ohook_Activation_AIO.cmd | 57 ++++++++++--------- .../Activators/Online_KMS_Activation.cmd | 57 ++++++++++--------- .../Activators/TSforge_Activation.cmd | 57 ++++++++++--------- .../Change_Office_Edition.cmd | 57 ++++++++++--------- .../Change_Windows_Edition.cmd | 57 ++++++++++--------- .../Extract_OEM_Folder.cmd | 57 ++++++++++--------- MAS/Separate-Files-Version/Troubleshoot.cmd | 57 ++++++++++--------- 10 files changed, 300 insertions(+), 270 deletions(-) diff --git a/MAS/All-In-One-Version-KL/MAS_AIO.cmd b/MAS/All-In-One-Version-KL/MAS_AIO.cmd index a043b38..11b8ec9 100644 --- a/MAS/All-In-One-Version-KL/MAS_AIO.cmd +++ b/MAS/All-In-One-Version-KL/MAS_AIO.cmd @@ -180,33 +180,6 @@ goto dk_done ::======================================================================================================================================== -:: Check PowerShell - -REM :PStest: $ExecutionContext.SessionState.LanguageMode :PStest: - -cmd /c "%psc% "$f=[io.file]::ReadAllText('!_batp!') -split ':PStest:\s*';iex ($f[1])"" | find /i "FullLanguage" %nul1% || ( -%eline% -cmd /c "%psc% "$ExecutionContext.SessionState.LanguageMode"" -echo: -cmd /c "%psc% "$ExecutionContext.SessionState.LanguageMode"" | find /i "FullLanguage" %nul1% && ( -echo Failed to run Powershell command but Powershell is working. -echo: -cmd /c "%psc% ""$av = Get-WmiObject -Namespace root\SecurityCenter2 -Class AntiVirusProduct; $n = @(); foreach ($i in $av) { if ($i.displayName -notlike '*windows*') { $n += $i.displayName } }; if ($n) { Write-Host ('Installed 3rd party Antivirus might be blocking the script - ' + ($n -join ', ')) -ForegroundColor White -BackgroundColor Blue }""" -echo: -set fixes=%fixes% %mas%troubleshoot -call :dk_color2 %Blue% "Help - " %_Yellow% " %mas%troubleshoot" -) || ( -echo PowerShell is not working. Aborting... -echo If you have applied restrictions on Powershell then undo those changes. -echo: -set fixes=%fixes% %mas%fix_powershell -call :dk_color2 %Blue% "Help - " %_Yellow% " %mas%fix_powershell" -) -goto dk_done -) - -::======================================================================================================================================== - :: Elevate script as admin and pass arguments and preventing loop %nul1% fltmc || ( @@ -219,6 +192,36 @@ goto dk_done ::======================================================================================================================================== +:: Check PowerShell + +::pstst $ExecutionContext.SessionState.LanguageMode :pstst + +for /f "delims=" %%a in ('cmd /c "%psc% ""$f=[io.file]::ReadAllText('!_batp!') -split ':pstst';iex ($f[1])""" %nul6%') do (set tstresult=%%a) + +if /i "%tstresult%"=="ConstrainedLanguage" ( +%eline% +echo ConstrainedLanguage mode found in PowerShell. Aborting... +echo If you have applied restrictions on Powershell then undo those changes. +echo: +set fixes=%fixes% %mas%fix_powershell +call :dk_color2 %Blue% "Help - " %_Yellow% " %mas%fix_powershell" +goto dk_done +) + +if /i not "%tstresult%"=="FullLanguage" ( +%eline% +echo "%tstresult%" +cmd /c "%psc% "$ExecutionContext.SessionState.LanguageMode"" +echo PowerShell is not working properly. Aborting... +cmd /c "%psc% ""$av = Get-WmiObject -Namespace root\SecurityCenter2 -Class AntiVirusProduct; $n = @(); foreach ($i in $av) { if ($i.displayName -notlike '*windows*') { $n += $i.displayName } }; if ($n) { Write-Host ('Installed 3rd party Antivirus might be blocking the script - ' + ($n -join ', ')) -ForegroundColor White -BackgroundColor Blue }""" +echo: +set fixes=%fixes% %mas%troubleshoot +call :dk_color2 %Blue% "Help - " %_Yellow% " %mas%troubleshoot" +goto dk_done +) + +::======================================================================================================================================== + :: Disable QuickEdit and launch from conhost.exe to avoid Terminal app if %winbuild% GEQ 17763 ( diff --git a/MAS/Separate-Files-Version/Activators/HWID_Activation.cmd b/MAS/Separate-Files-Version/Activators/HWID_Activation.cmd index 1989d51..fa3786a 100644 --- a/MAS/Separate-Files-Version/Activators/HWID_Activation.cmd +++ b/MAS/Separate-Files-Version/Activators/HWID_Activation.cmd @@ -219,33 +219,6 @@ goto dk_done ::======================================================================================================================================== -:: Check PowerShell - -REM :PStest: $ExecutionContext.SessionState.LanguageMode :PStest: - -cmd /c "%psc% "$f=[io.file]::ReadAllText('!_batp!') -split ':PStest:\s*';iex ($f[1])"" | find /i "FullLanguage" %nul1% || ( -%eline% -cmd /c "%psc% "$ExecutionContext.SessionState.LanguageMode"" -echo: -cmd /c "%psc% "$ExecutionContext.SessionState.LanguageMode"" | find /i "FullLanguage" %nul1% && ( -echo Failed to run Powershell command but Powershell is working. -echo: -cmd /c "%psc% ""$av = Get-WmiObject -Namespace root\SecurityCenter2 -Class AntiVirusProduct; $n = @(); foreach ($i in $av) { if ($i.displayName -notlike '*windows*') { $n += $i.displayName } }; if ($n) { Write-Host ('Installed 3rd party Antivirus might be blocking the script - ' + ($n -join ', ')) -ForegroundColor White -BackgroundColor Blue }""" -echo: -set fixes=%fixes% %mas%troubleshoot -call :dk_color2 %Blue% "Help - " %_Yellow% " %mas%troubleshoot" -) || ( -echo PowerShell is not working. Aborting... -echo If you have applied restrictions on Powershell then undo those changes. -echo: -set fixes=%fixes% %mas%fix_powershell -call :dk_color2 %Blue% "Help - " %_Yellow% " %mas%fix_powershell" -) -goto dk_done -) - -::======================================================================================================================================== - :: Elevate script as admin and pass arguments and preventing loop %nul1% fltmc || ( @@ -258,6 +231,36 @@ goto dk_done ::======================================================================================================================================== +:: Check PowerShell + +::pstst $ExecutionContext.SessionState.LanguageMode :pstst + +for /f "delims=" %%a in ('cmd /c "%psc% ""$f=[io.file]::ReadAllText('!_batp!') -split ':pstst';iex ($f[1])""" %nul6%') do (set tstresult=%%a) + +if /i "%tstresult%"=="ConstrainedLanguage" ( +%eline% +echo ConstrainedLanguage mode found in PowerShell. Aborting... +echo If you have applied restrictions on Powershell then undo those changes. +echo: +set fixes=%fixes% %mas%fix_powershell +call :dk_color2 %Blue% "Help - " %_Yellow% " %mas%fix_powershell" +goto dk_done +) + +if /i not "%tstresult%"=="FullLanguage" ( +%eline% +echo "%tstresult%" +cmd /c "%psc% "$ExecutionContext.SessionState.LanguageMode"" +echo PowerShell is not working properly. Aborting... +cmd /c "%psc% ""$av = Get-WmiObject -Namespace root\SecurityCenter2 -Class AntiVirusProduct; $n = @(); foreach ($i in $av) { if ($i.displayName -notlike '*windows*') { $n += $i.displayName } }; if ($n) { Write-Host ('Installed 3rd party Antivirus might be blocking the script - ' + ($n -join ', ')) -ForegroundColor White -BackgroundColor Blue }""" +echo: +set fixes=%fixes% %mas%troubleshoot +call :dk_color2 %Blue% "Help - " %_Yellow% " %mas%troubleshoot" +goto dk_done +) + +::======================================================================================================================================== + :: Disable QuickEdit and launch from conhost.exe to avoid Terminal app if %winbuild% GEQ 17763 ( diff --git a/MAS/Separate-Files-Version/Activators/KMS38_Activation.cmd b/MAS/Separate-Files-Version/Activators/KMS38_Activation.cmd index 17fae23..eeee718 100644 --- a/MAS/Separate-Files-Version/Activators/KMS38_Activation.cmd +++ b/MAS/Separate-Files-Version/Activators/KMS38_Activation.cmd @@ -222,33 +222,6 @@ goto dk_done ::======================================================================================================================================== -:: Check PowerShell - -REM :PStest: $ExecutionContext.SessionState.LanguageMode :PStest: - -cmd /c "%psc% "$f=[io.file]::ReadAllText('!_batp!') -split ':PStest:\s*';iex ($f[1])"" | find /i "FullLanguage" %nul1% || ( -%eline% -cmd /c "%psc% "$ExecutionContext.SessionState.LanguageMode"" -echo: -cmd /c "%psc% "$ExecutionContext.SessionState.LanguageMode"" | find /i "FullLanguage" %nul1% && ( -echo Failed to run Powershell command but Powershell is working. -echo: -cmd /c "%psc% ""$av = Get-WmiObject -Namespace root\SecurityCenter2 -Class AntiVirusProduct; $n = @(); foreach ($i in $av) { if ($i.displayName -notlike '*windows*') { $n += $i.displayName } }; if ($n) { Write-Host ('Installed 3rd party Antivirus might be blocking the script - ' + ($n -join ', ')) -ForegroundColor White -BackgroundColor Blue }""" -echo: -set fixes=%fixes% %mas%troubleshoot -call :dk_color2 %Blue% "Help - " %_Yellow% " %mas%troubleshoot" -) || ( -echo PowerShell is not working. Aborting... -echo If you have applied restrictions on Powershell then undo those changes. -echo: -set fixes=%fixes% %mas%fix_powershell -call :dk_color2 %Blue% "Help - " %_Yellow% " %mas%fix_powershell" -) -goto dk_done -) - -::======================================================================================================================================== - :: Elevate script as admin and pass arguments and preventing loop %nul1% fltmc || ( @@ -261,6 +234,36 @@ goto dk_done ::======================================================================================================================================== +:: Check PowerShell + +::pstst $ExecutionContext.SessionState.LanguageMode :pstst + +for /f "delims=" %%a in ('cmd /c "%psc% ""$f=[io.file]::ReadAllText('!_batp!') -split ':pstst';iex ($f[1])""" %nul6%') do (set tstresult=%%a) + +if /i "%tstresult%"=="ConstrainedLanguage" ( +%eline% +echo ConstrainedLanguage mode found in PowerShell. Aborting... +echo If you have applied restrictions on Powershell then undo those changes. +echo: +set fixes=%fixes% %mas%fix_powershell +call :dk_color2 %Blue% "Help - " %_Yellow% " %mas%fix_powershell" +goto dk_done +) + +if /i not "%tstresult%"=="FullLanguage" ( +%eline% +echo "%tstresult%" +cmd /c "%psc% "$ExecutionContext.SessionState.LanguageMode"" +echo PowerShell is not working properly. Aborting... +cmd /c "%psc% ""$av = Get-WmiObject -Namespace root\SecurityCenter2 -Class AntiVirusProduct; $n = @(); foreach ($i in $av) { if ($i.displayName -notlike '*windows*') { $n += $i.displayName } }; if ($n) { Write-Host ('Installed 3rd party Antivirus might be blocking the script - ' + ($n -join ', ')) -ForegroundColor White -BackgroundColor Blue }""" +echo: +set fixes=%fixes% %mas%troubleshoot +call :dk_color2 %Blue% "Help - " %_Yellow% " %mas%troubleshoot" +goto dk_done +) + +::======================================================================================================================================== + :: Disable QuickEdit and launch from conhost.exe to avoid Terminal app if %winbuild% GEQ 17763 ( diff --git a/MAS/Separate-Files-Version/Activators/Ohook_Activation_AIO.cmd b/MAS/Separate-Files-Version/Activators/Ohook_Activation_AIO.cmd index 980cb50..a1679e1 100644 --- a/MAS/Separate-Files-Version/Activators/Ohook_Activation_AIO.cmd +++ b/MAS/Separate-Files-Version/Activators/Ohook_Activation_AIO.cmd @@ -212,33 +212,6 @@ goto dk_done ::======================================================================================================================================== -:: Check PowerShell - -REM :PStest: $ExecutionContext.SessionState.LanguageMode :PStest: - -cmd /c "%psc% "$f=[io.file]::ReadAllText('!_batp!') -split ':PStest:\s*';iex ($f[1])"" | find /i "FullLanguage" %nul1% || ( -%eline% -cmd /c "%psc% "$ExecutionContext.SessionState.LanguageMode"" -echo: -cmd /c "%psc% "$ExecutionContext.SessionState.LanguageMode"" | find /i "FullLanguage" %nul1% && ( -echo Failed to run Powershell command but Powershell is working. -echo: -cmd /c "%psc% ""$av = Get-WmiObject -Namespace root\SecurityCenter2 -Class AntiVirusProduct; $n = @(); foreach ($i in $av) { if ($i.displayName -notlike '*windows*') { $n += $i.displayName } }; if ($n) { Write-Host ('Installed 3rd party Antivirus might be blocking the script - ' + ($n -join ', ')) -ForegroundColor White -BackgroundColor Blue }""" -echo: -set fixes=%fixes% %mas%troubleshoot -call :dk_color2 %Blue% "Help - " %_Yellow% " %mas%troubleshoot" -) || ( -echo PowerShell is not working. Aborting... -echo If you have applied restrictions on Powershell then undo those changes. -echo: -set fixes=%fixes% %mas%fix_powershell -call :dk_color2 %Blue% "Help - " %_Yellow% " %mas%fix_powershell" -) -goto dk_done -) - -::======================================================================================================================================== - :: Elevate script as admin and pass arguments and preventing loop %nul1% fltmc || ( @@ -251,6 +224,36 @@ goto dk_done ::======================================================================================================================================== +:: Check PowerShell + +::pstst $ExecutionContext.SessionState.LanguageMode :pstst + +for /f "delims=" %%a in ('cmd /c "%psc% ""$f=[io.file]::ReadAllText('!_batp!') -split ':pstst';iex ($f[1])""" %nul6%') do (set tstresult=%%a) + +if /i "%tstresult%"=="ConstrainedLanguage" ( +%eline% +echo ConstrainedLanguage mode found in PowerShell. Aborting... +echo If you have applied restrictions on Powershell then undo those changes. +echo: +set fixes=%fixes% %mas%fix_powershell +call :dk_color2 %Blue% "Help - " %_Yellow% " %mas%fix_powershell" +goto dk_done +) + +if /i not "%tstresult%"=="FullLanguage" ( +%eline% +echo "%tstresult%" +cmd /c "%psc% "$ExecutionContext.SessionState.LanguageMode"" +echo PowerShell is not working properly. Aborting... +cmd /c "%psc% ""$av = Get-WmiObject -Namespace root\SecurityCenter2 -Class AntiVirusProduct; $n = @(); foreach ($i in $av) { if ($i.displayName -notlike '*windows*') { $n += $i.displayName } }; if ($n) { Write-Host ('Installed 3rd party Antivirus might be blocking the script - ' + ($n -join ', ')) -ForegroundColor White -BackgroundColor Blue }""" +echo: +set fixes=%fixes% %mas%troubleshoot +call :dk_color2 %Blue% "Help - " %_Yellow% " %mas%troubleshoot" +goto dk_done +) + +::======================================================================================================================================== + :: Disable QuickEdit and launch from conhost.exe to avoid Terminal app if %winbuild% GEQ 17763 ( diff --git a/MAS/Separate-Files-Version/Activators/Online_KMS_Activation.cmd b/MAS/Separate-Files-Version/Activators/Online_KMS_Activation.cmd index 70632ce..e14f24b 100644 --- a/MAS/Separate-Files-Version/Activators/Online_KMS_Activation.cmd +++ b/MAS/Separate-Files-Version/Activators/Online_KMS_Activation.cmd @@ -241,33 +241,6 @@ goto dk_done ::======================================================================================================================================== -:: Check PowerShell - -REM :PStest: $ExecutionContext.SessionState.LanguageMode :PStest: - -cmd /c "%psc% "$f=[io.file]::ReadAllText('!_batp!') -split ':PStest:\s*';iex ($f[1])"" | find /i "FullLanguage" %nul1% || ( -%eline% -cmd /c "%psc% "$ExecutionContext.SessionState.LanguageMode"" -echo: -cmd /c "%psc% "$ExecutionContext.SessionState.LanguageMode"" | find /i "FullLanguage" %nul1% && ( -echo Failed to run Powershell command but Powershell is working. -echo: -cmd /c "%psc% ""$av = Get-WmiObject -Namespace root\SecurityCenter2 -Class AntiVirusProduct; $n = @(); foreach ($i in $av) { if ($i.displayName -notlike '*windows*') { $n += $i.displayName } }; if ($n) { Write-Host ('Installed 3rd party Antivirus might be blocking the script - ' + ($n -join ', ')) -ForegroundColor White -BackgroundColor Blue }""" -echo: -set fixes=%fixes% %mas%troubleshoot -call :dk_color2 %Blue% "Help - " %_Yellow% " %mas%troubleshoot" -) || ( -echo PowerShell is not working. Aborting... -echo If you have applied restrictions on Powershell then undo those changes. -echo: -set fixes=%fixes% %mas%fix_powershell -call :dk_color2 %Blue% "Help - " %_Yellow% " %mas%fix_powershell" -) -goto dk_done -) - -::======================================================================================================================================== - :: Elevate script as admin and pass arguments and preventing loop %nul1% fltmc || ( @@ -280,6 +253,36 @@ goto dk_done ::======================================================================================================================================== +:: Check PowerShell + +::pstst $ExecutionContext.SessionState.LanguageMode :pstst + +for /f "delims=" %%a in ('cmd /c "%psc% ""$f=[io.file]::ReadAllText('!_batp!') -split ':pstst';iex ($f[1])""" %nul6%') do (set tstresult=%%a) + +if /i "%tstresult%"=="ConstrainedLanguage" ( +%eline% +echo ConstrainedLanguage mode found in PowerShell. Aborting... +echo If you have applied restrictions on Powershell then undo those changes. +echo: +set fixes=%fixes% %mas%fix_powershell +call :dk_color2 %Blue% "Help - " %_Yellow% " %mas%fix_powershell" +goto dk_done +) + +if /i not "%tstresult%"=="FullLanguage" ( +%eline% +echo "%tstresult%" +cmd /c "%psc% "$ExecutionContext.SessionState.LanguageMode"" +echo PowerShell is not working properly. Aborting... +cmd /c "%psc% ""$av = Get-WmiObject -Namespace root\SecurityCenter2 -Class AntiVirusProduct; $n = @(); foreach ($i in $av) { if ($i.displayName -notlike '*windows*') { $n += $i.displayName } }; if ($n) { Write-Host ('Installed 3rd party Antivirus might be blocking the script - ' + ($n -join ', ')) -ForegroundColor White -BackgroundColor Blue }""" +echo: +set fixes=%fixes% %mas%troubleshoot +call :dk_color2 %Blue% "Help - " %_Yellow% " %mas%troubleshoot" +goto dk_done +) + +::======================================================================================================================================== + :: Disable QuickEdit and launch from conhost.exe to avoid Terminal app if %winbuild% GEQ 17763 ( diff --git a/MAS/Separate-Files-Version/Activators/TSforge_Activation.cmd b/MAS/Separate-Files-Version/Activators/TSforge_Activation.cmd index 1af9408..96a273c 100644 --- a/MAS/Separate-Files-Version/Activators/TSforge_Activation.cmd +++ b/MAS/Separate-Files-Version/Activators/TSforge_Activation.cmd @@ -247,33 +247,6 @@ goto dk_done ::======================================================================================================================================== -:: Check PowerShell - -REM :PStest: $ExecutionContext.SessionState.LanguageMode :PStest: - -cmd /c "%psc% "$f=[io.file]::ReadAllText('!_batp!') -split ':PStest:\s*';iex ($f[1])"" | find /i "FullLanguage" %nul1% || ( -%eline% -cmd /c "%psc% "$ExecutionContext.SessionState.LanguageMode"" -echo: -cmd /c "%psc% "$ExecutionContext.SessionState.LanguageMode"" | find /i "FullLanguage" %nul1% && ( -echo Failed to run Powershell command but Powershell is working. -echo: -cmd /c "%psc% ""$av = Get-WmiObject -Namespace root\SecurityCenter2 -Class AntiVirusProduct; $n = @(); foreach ($i in $av) { if ($i.displayName -notlike '*windows*') { $n += $i.displayName } }; if ($n) { Write-Host ('Installed 3rd party Antivirus might be blocking the script - ' + ($n -join ', ')) -ForegroundColor White -BackgroundColor Blue }""" -echo: -set fixes=%fixes% %mas%troubleshoot -call :dk_color2 %Blue% "Help - " %_Yellow% " %mas%troubleshoot" -) || ( -echo PowerShell is not working. Aborting... -echo If you have applied restrictions on Powershell then undo those changes. -echo: -set fixes=%fixes% %mas%fix_powershell -call :dk_color2 %Blue% "Help - " %_Yellow% " %mas%fix_powershell" -) -goto dk_done -) - -::======================================================================================================================================== - :: Elevate script as admin and pass arguments and preventing loop %nul1% fltmc || ( @@ -286,6 +259,36 @@ goto dk_done ::======================================================================================================================================== +:: Check PowerShell + +::pstst $ExecutionContext.SessionState.LanguageMode :pstst + +for /f "delims=" %%a in ('cmd /c "%psc% ""$f=[io.file]::ReadAllText('!_batp!') -split ':pstst';iex ($f[1])""" %nul6%') do (set tstresult=%%a) + +if /i "%tstresult%"=="ConstrainedLanguage" ( +%eline% +echo ConstrainedLanguage mode found in PowerShell. Aborting... +echo If you have applied restrictions on Powershell then undo those changes. +echo: +set fixes=%fixes% %mas%fix_powershell +call :dk_color2 %Blue% "Help - " %_Yellow% " %mas%fix_powershell" +goto dk_done +) + +if /i not "%tstresult%"=="FullLanguage" ( +%eline% +echo "%tstresult%" +cmd /c "%psc% "$ExecutionContext.SessionState.LanguageMode"" +echo PowerShell is not working properly. Aborting... +cmd /c "%psc% ""$av = Get-WmiObject -Namespace root\SecurityCenter2 -Class AntiVirusProduct; $n = @(); foreach ($i in $av) { if ($i.displayName -notlike '*windows*') { $n += $i.displayName } }; if ($n) { Write-Host ('Installed 3rd party Antivirus might be blocking the script - ' + ($n -join ', ')) -ForegroundColor White -BackgroundColor Blue }""" +echo: +set fixes=%fixes% %mas%troubleshoot +call :dk_color2 %Blue% "Help - " %_Yellow% " %mas%troubleshoot" +goto dk_done +) + +::======================================================================================================================================== + :: Disable QuickEdit and launch from conhost.exe to avoid Terminal app if %winbuild% GEQ 17763 ( diff --git a/MAS/Separate-Files-Version/Change_Office_Edition.cmd b/MAS/Separate-Files-Version/Change_Office_Edition.cmd index 29fec81..6ec47b5 100644 --- a/MAS/Separate-Files-Version/Change_Office_Edition.cmd +++ b/MAS/Separate-Files-Version/Change_Office_Edition.cmd @@ -172,33 +172,6 @@ goto dk_done ::======================================================================================================================================== -:: Check PowerShell - -REM :PStest: $ExecutionContext.SessionState.LanguageMode :PStest: - -cmd /c "%psc% "$f=[io.file]::ReadAllText('!_batp!') -split ':PStest:\s*';iex ($f[1])"" | find /i "FullLanguage" %nul1% || ( -%eline% -cmd /c "%psc% "$ExecutionContext.SessionState.LanguageMode"" -echo: -cmd /c "%psc% "$ExecutionContext.SessionState.LanguageMode"" | find /i "FullLanguage" %nul1% && ( -echo Failed to run Powershell command but Powershell is working. -echo: -cmd /c "%psc% ""$av = Get-WmiObject -Namespace root\SecurityCenter2 -Class AntiVirusProduct; $n = @(); foreach ($i in $av) { if ($i.displayName -notlike '*windows*') { $n += $i.displayName } }; if ($n) { Write-Host ('Installed 3rd party Antivirus might be blocking the script - ' + ($n -join ', ')) -ForegroundColor White -BackgroundColor Blue }""" -echo: -set fixes=%fixes% %mas%troubleshoot -call :dk_color2 %Blue% "Help - " %_Yellow% " %mas%troubleshoot" -) || ( -echo PowerShell is not working. Aborting... -echo If you have applied restrictions on Powershell then undo those changes. -echo: -set fixes=%fixes% %mas%fix_powershell -call :dk_color2 %Blue% "Help - " %_Yellow% " %mas%fix_powershell" -) -goto dk_done -) - -::======================================================================================================================================== - :: Elevate script as admin and pass arguments and preventing loop %nul1% fltmc || ( @@ -211,6 +184,36 @@ goto dk_done ::======================================================================================================================================== +:: Check PowerShell + +::pstst $ExecutionContext.SessionState.LanguageMode :pstst + +for /f "delims=" %%a in ('cmd /c "%psc% ""$f=[io.file]::ReadAllText('!_batp!') -split ':pstst';iex ($f[1])""" %nul6%') do (set tstresult=%%a) + +if /i "%tstresult%"=="ConstrainedLanguage" ( +%eline% +echo ConstrainedLanguage mode found in PowerShell. Aborting... +echo If you have applied restrictions on Powershell then undo those changes. +echo: +set fixes=%fixes% %mas%fix_powershell +call :dk_color2 %Blue% "Help - " %_Yellow% " %mas%fix_powershell" +goto dk_done +) + +if /i not "%tstresult%"=="FullLanguage" ( +%eline% +echo "%tstresult%" +cmd /c "%psc% "$ExecutionContext.SessionState.LanguageMode"" +echo PowerShell is not working properly. Aborting... +cmd /c "%psc% ""$av = Get-WmiObject -Namespace root\SecurityCenter2 -Class AntiVirusProduct; $n = @(); foreach ($i in $av) { if ($i.displayName -notlike '*windows*') { $n += $i.displayName } }; if ($n) { Write-Host ('Installed 3rd party Antivirus might be blocking the script - ' + ($n -join ', ')) -ForegroundColor White -BackgroundColor Blue }""" +echo: +set fixes=%fixes% %mas%troubleshoot +call :dk_color2 %Blue% "Help - " %_Yellow% " %mas%troubleshoot" +goto dk_done +) + +::======================================================================================================================================== + :: Disable QuickEdit and launch from conhost.exe to avoid Terminal app if %winbuild% GEQ 17763 ( diff --git a/MAS/Separate-Files-Version/Change_Windows_Edition.cmd b/MAS/Separate-Files-Version/Change_Windows_Edition.cmd index 3c954d7..19c1c3a 100644 --- a/MAS/Separate-Files-Version/Change_Windows_Edition.cmd +++ b/MAS/Separate-Files-Version/Change_Windows_Edition.cmd @@ -177,33 +177,6 @@ goto dk_done ::======================================================================================================================================== -:: Check PowerShell - -REM :PStest: $ExecutionContext.SessionState.LanguageMode :PStest: - -cmd /c "%psc% "$f=[io.file]::ReadAllText('!_batp!') -split ':PStest:\s*';iex ($f[1])"" | find /i "FullLanguage" %nul1% || ( -%eline% -cmd /c "%psc% "$ExecutionContext.SessionState.LanguageMode"" -echo: -cmd /c "%psc% "$ExecutionContext.SessionState.LanguageMode"" | find /i "FullLanguage" %nul1% && ( -echo Failed to run Powershell command but Powershell is working. -echo: -cmd /c "%psc% ""$av = Get-WmiObject -Namespace root\SecurityCenter2 -Class AntiVirusProduct; $n = @(); foreach ($i in $av) { if ($i.displayName -notlike '*windows*') { $n += $i.displayName } }; if ($n) { Write-Host ('Installed 3rd party Antivirus might be blocking the script - ' + ($n -join ', ')) -ForegroundColor White -BackgroundColor Blue }""" -echo: -set fixes=%fixes% %mas%troubleshoot -call :dk_color2 %Blue% "Help - " %_Yellow% " %mas%troubleshoot" -) || ( -echo PowerShell is not working. Aborting... -echo If you have applied restrictions on Powershell then undo those changes. -echo: -set fixes=%fixes% %mas%fix_powershell -call :dk_color2 %Blue% "Help - " %_Yellow% " %mas%fix_powershell" -) -goto dk_done -) - -::======================================================================================================================================== - :: Elevate script as admin and pass arguments and preventing loop %nul1% fltmc || ( @@ -216,6 +189,36 @@ goto dk_done ::======================================================================================================================================== +:: Check PowerShell + +::pstst $ExecutionContext.SessionState.LanguageMode :pstst + +for /f "delims=" %%a in ('cmd /c "%psc% ""$f=[io.file]::ReadAllText('!_batp!') -split ':pstst';iex ($f[1])""" %nul6%') do (set tstresult=%%a) + +if /i "%tstresult%"=="ConstrainedLanguage" ( +%eline% +echo ConstrainedLanguage mode found in PowerShell. Aborting... +echo If you have applied restrictions on Powershell then undo those changes. +echo: +set fixes=%fixes% %mas%fix_powershell +call :dk_color2 %Blue% "Help - " %_Yellow% " %mas%fix_powershell" +goto dk_done +) + +if /i not "%tstresult%"=="FullLanguage" ( +%eline% +echo "%tstresult%" +cmd /c "%psc% "$ExecutionContext.SessionState.LanguageMode"" +echo PowerShell is not working properly. Aborting... +cmd /c "%psc% ""$av = Get-WmiObject -Namespace root\SecurityCenter2 -Class AntiVirusProduct; $n = @(); foreach ($i in $av) { if ($i.displayName -notlike '*windows*') { $n += $i.displayName } }; if ($n) { Write-Host ('Installed 3rd party Antivirus might be blocking the script - ' + ($n -join ', ')) -ForegroundColor White -BackgroundColor Blue }""" +echo: +set fixes=%fixes% %mas%troubleshoot +call :dk_color2 %Blue% "Help - " %_Yellow% " %mas%troubleshoot" +goto dk_done +) + +::======================================================================================================================================== + :: Disable QuickEdit and launch from conhost.exe to avoid Terminal app if %winbuild% GEQ 17763 ( diff --git a/MAS/Separate-Files-Version/Extract_OEM_Folder.cmd b/MAS/Separate-Files-Version/Extract_OEM_Folder.cmd index 2b70d33..c1b78c1 100644 --- a/MAS/Separate-Files-Version/Extract_OEM_Folder.cmd +++ b/MAS/Separate-Files-Version/Extract_OEM_Folder.cmd @@ -171,33 +171,6 @@ goto done2 ::======================================================================================================================================== -:: Check PowerShell - -REM :PStest: $ExecutionContext.SessionState.LanguageMode :PStest: - -cmd /c "%psc% "$f=[io.file]::ReadAllText('!_batp!') -split ':PStest:\s*';iex ($f[1])"" | find /i "FullLanguage" %nul1% || ( -%eline% -cmd /c "%psc% "$ExecutionContext.SessionState.LanguageMode"" -echo: -cmd /c "%psc% "$ExecutionContext.SessionState.LanguageMode"" | find /i "FullLanguage" %nul1% && ( -echo Failed to run Powershell command but Powershell is working. -echo: -cmd /c "%psc% ""$av = Get-WmiObject -Namespace root\SecurityCenter2 -Class AntiVirusProduct; $n = @(); foreach ($i in $av) { if ($i.displayName -notlike '*windows*') { $n += $i.displayName } }; if ($n) { Write-Host ('Installed 3rd party Antivirus might be blocking the script - ' + ($n -join ', ')) -ForegroundColor White -BackgroundColor Blue }""" -echo: -set fixes=%fixes% %mas%troubleshoot -call :dk_color2 %Blue% "Help - " %_Yellow% " %mas%troubleshoot" -) || ( -echo PowerShell is not working. Aborting... -echo If you have applied restrictions on Powershell then undo those changes. -echo: -set fixes=%fixes% %mas%fix_powershell -call :dk_color2 %Blue% "Help - " %_Yellow% " %mas%fix_powershell" -) -goto done2 -) - -::======================================================================================================================================== - :: Elevate script as admin and pass arguments and preventing loop %nul1% fltmc || ( @@ -210,6 +183,36 @@ goto done2 ::======================================================================================================================================== +:: Check PowerShell + +::pstst $ExecutionContext.SessionState.LanguageMode :pstst + +for /f "delims=" %%a in ('cmd /c "%psc% ""$f=[io.file]::ReadAllText('!_batp!') -split ':pstst';iex ($f[1])""" %nul6%') do (set tstresult=%%a) + +if /i "%tstresult%"=="ConstrainedLanguage" ( +%eline% +echo ConstrainedLanguage mode found in PowerShell. Aborting... +echo If you have applied restrictions on Powershell then undo those changes. +echo: +set fixes=%fixes% %mas%fix_powershell +call :dk_color2 %Blue% "Help - " %_Yellow% " %mas%fix_powershell" +goto done2 +) + +if /i not "%tstresult%"=="FullLanguage" ( +%eline% +echo "%tstresult%" +cmd /c "%psc% "$ExecutionContext.SessionState.LanguageMode"" +echo PowerShell is not working properly. Aborting... +cmd /c "%psc% ""$av = Get-WmiObject -Namespace root\SecurityCenter2 -Class AntiVirusProduct; $n = @(); foreach ($i in $av) { if ($i.displayName -notlike '*windows*') { $n += $i.displayName } }; if ($n) { Write-Host ('Installed 3rd party Antivirus might be blocking the script - ' + ($n -join ', ')) -ForegroundColor White -BackgroundColor Blue }""" +echo: +set fixes=%fixes% %mas%troubleshoot +call :dk_color2 %Blue% "Help - " %_Yellow% " %mas%troubleshoot" +goto done2 +) + +::======================================================================================================================================== + :: Disable QuickEdit and launch from conhost.exe to avoid Terminal app if %winbuild% GEQ 17763 ( diff --git a/MAS/Separate-Files-Version/Troubleshoot.cmd b/MAS/Separate-Files-Version/Troubleshoot.cmd index 1884358..73cb0c4 100644 --- a/MAS/Separate-Files-Version/Troubleshoot.cmd +++ b/MAS/Separate-Files-Version/Troubleshoot.cmd @@ -172,33 +172,6 @@ goto dk_done ::======================================================================================================================================== -:: Check PowerShell - -REM :PStest: $ExecutionContext.SessionState.LanguageMode :PStest: - -cmd /c "%psc% "$f=[io.file]::ReadAllText('!_batp!') -split ':PStest:\s*';iex ($f[1])"" | find /i "FullLanguage" %nul1% || ( -%eline% -cmd /c "%psc% "$ExecutionContext.SessionState.LanguageMode"" -echo: -cmd /c "%psc% "$ExecutionContext.SessionState.LanguageMode"" | find /i "FullLanguage" %nul1% && ( -echo Failed to run Powershell command but Powershell is working. -echo: -cmd /c "%psc% ""$av = Get-WmiObject -Namespace root\SecurityCenter2 -Class AntiVirusProduct; $n = @(); foreach ($i in $av) { if ($i.displayName -notlike '*windows*') { $n += $i.displayName } }; if ($n) { Write-Host ('Installed 3rd party Antivirus might be blocking the script - ' + ($n -join ', ')) -ForegroundColor White -BackgroundColor Blue }""" -echo: -set fixes=%fixes% %mas%troubleshoot -call :dk_color2 %Blue% "Help - " %_Yellow% " %mas%troubleshoot" -) || ( -echo PowerShell is not working. Aborting... -echo If you have applied restrictions on Powershell then undo those changes. -echo: -set fixes=%fixes% %mas%fix_powershell -call :dk_color2 %Blue% "Help - " %_Yellow% " %mas%fix_powershell" -) -goto dk_done -) - -::======================================================================================================================================== - :: Elevate script as admin and pass arguments and preventing loop %nul1% fltmc || ( @@ -211,6 +184,36 @@ goto dk_done ::======================================================================================================================================== +:: Check PowerShell + +::pstst $ExecutionContext.SessionState.LanguageMode :pstst + +for /f "delims=" %%a in ('cmd /c "%psc% ""$f=[io.file]::ReadAllText('!_batp!') -split ':pstst';iex ($f[1])""" %nul6%') do (set tstresult=%%a) + +if /i "%tstresult%"=="ConstrainedLanguage" ( +%eline% +echo ConstrainedLanguage mode found in PowerShell. Aborting... +echo If you have applied restrictions on Powershell then undo those changes. +echo: +set fixes=%fixes% %mas%fix_powershell +call :dk_color2 %Blue% "Help - " %_Yellow% " %mas%fix_powershell" +goto dk_done +) + +if /i not "%tstresult%"=="FullLanguage" ( +%eline% +echo "%tstresult%" +cmd /c "%psc% "$ExecutionContext.SessionState.LanguageMode"" +echo PowerShell is not working properly. Aborting... +cmd /c "%psc% ""$av = Get-WmiObject -Namespace root\SecurityCenter2 -Class AntiVirusProduct; $n = @(); foreach ($i in $av) { if ($i.displayName -notlike '*windows*') { $n += $i.displayName } }; if ($n) { Write-Host ('Installed 3rd party Antivirus might be blocking the script - ' + ($n -join ', ')) -ForegroundColor White -BackgroundColor Blue }""" +echo: +set fixes=%fixes% %mas%troubleshoot +call :dk_color2 %Blue% "Help - " %_Yellow% " %mas%troubleshoot" +goto dk_done +) + +::======================================================================================================================================== + :: Disable QuickEdit and launch from conhost.exe to avoid Terminal app if %winbuild% GEQ 17763 ( From ab0cd24f89f5b16a35cc7a685b59d5fe5460289d Mon Sep 17 00:00:00 2001 From: WindowsAddict Date: Mon, 24 Feb 2025 00:36:35 +0530 Subject: [PATCH 09/79] Add more checks for powershell --- MAS/All-In-One-Version-KL/MAS_AIO.cmd | 26 ++++++++++++++----- .../Activators/HWID_Activation.cmd | 26 ++++++++++++++----- .../Activators/KMS38_Activation.cmd | 26 ++++++++++++++----- .../Activators/Ohook_Activation_AIO.cmd | 26 ++++++++++++++----- .../Activators/Online_KMS_Activation.cmd | 26 ++++++++++++++----- .../Activators/TSforge_Activation.cmd | 26 ++++++++++++++----- .../Change_Office_Edition.cmd | 26 ++++++++++++++----- .../Change_Windows_Edition.cmd | 26 ++++++++++++++----- .../Extract_OEM_Folder.cmd | 26 ++++++++++++++----- MAS/Separate-Files-Version/Troubleshoot.cmd | 26 ++++++++++++++----- 10 files changed, 190 insertions(+), 70 deletions(-) diff --git a/MAS/All-In-One-Version-KL/MAS_AIO.cmd b/MAS/All-In-One-Version-KL/MAS_AIO.cmd index 11b8ec9..06e4d83 100644 --- a/MAS/All-In-One-Version-KL/MAS_AIO.cmd +++ b/MAS/All-In-One-Version-KL/MAS_AIO.cmd @@ -196,11 +196,18 @@ goto dk_done ::pstst $ExecutionContext.SessionState.LanguageMode :pstst -for /f "delims=" %%a in ('cmd /c "%psc% ""$f=[io.file]::ReadAllText('!_batp!') -split ':pstst';iex ($f[1])""" %nul6%') do (set tstresult=%%a) +for /f "delims=" %%a in ('cmd /c "%psc% ""if ($PSVersionTable.PSEdition -ne 'Core') {$f=[io.file]::ReadAllText('!_batp!') -split ':pstst';iex ($f[1])}""" %nul6%') do (set tstresult=%%a) -if /i "%tstresult%"=="ConstrainedLanguage" ( +if /i not "%tstresult%"=="FullLanguage" ( %eline% -echo ConstrainedLanguage mode found in PowerShell. Aborting... +echo %tstresult% +cmd /c "%psc% $ExecutionContext.SessionState.LanguageMode" + +REM check LanguageMode + +cmd /c "%psc% "$ExecutionContext.SessionState.LanguageMode"" | findstr /i "ConstrainedLanguage RestrictedLanguage NoLanguage" %nul1% && ( +%eline% +echo FullLanguage mode not found in PowerShell. Aborting... echo If you have applied restrictions on Powershell then undo those changes. echo: set fixes=%fixes% %mas%fix_powershell @@ -208,10 +215,15 @@ call :dk_color2 %Blue% "Help - " %_Yellow% " %mas%fix_powershell" goto dk_done ) -if /i not "%tstresult%"=="FullLanguage" ( -%eline% -echo "%tstresult%" -cmd /c "%psc% "$ExecutionContext.SessionState.LanguageMode"" +REM check Powershell core version + +cmd /c "%psc% "$PSVersionTable.PSEdition"" | find /i "Core" %nul1% && ( +echo Windows Powershell is needed for MAS but it seems to be replaced with Powershell core. Aborting... +goto dk_done +) + +REM check antivirus and other errors + echo PowerShell is not working properly. Aborting... cmd /c "%psc% ""$av = Get-WmiObject -Namespace root\SecurityCenter2 -Class AntiVirusProduct; $n = @(); foreach ($i in $av) { if ($i.displayName -notlike '*windows*') { $n += $i.displayName } }; if ($n) { Write-Host ('Installed 3rd party Antivirus might be blocking the script - ' + ($n -join ', ')) -ForegroundColor White -BackgroundColor Blue }""" echo: diff --git a/MAS/Separate-Files-Version/Activators/HWID_Activation.cmd b/MAS/Separate-Files-Version/Activators/HWID_Activation.cmd index fa3786a..2730ec6 100644 --- a/MAS/Separate-Files-Version/Activators/HWID_Activation.cmd +++ b/MAS/Separate-Files-Version/Activators/HWID_Activation.cmd @@ -235,11 +235,18 @@ goto dk_done ::pstst $ExecutionContext.SessionState.LanguageMode :pstst -for /f "delims=" %%a in ('cmd /c "%psc% ""$f=[io.file]::ReadAllText('!_batp!') -split ':pstst';iex ($f[1])""" %nul6%') do (set tstresult=%%a) +for /f "delims=" %%a in ('cmd /c "%psc% ""if ($PSVersionTable.PSEdition -ne 'Core') {$f=[io.file]::ReadAllText('!_batp!') -split ':pstst';iex ($f[1])}""" %nul6%') do (set tstresult=%%a) -if /i "%tstresult%"=="ConstrainedLanguage" ( +if /i not "%tstresult%"=="FullLanguage" ( %eline% -echo ConstrainedLanguage mode found in PowerShell. Aborting... +echo %tstresult% +cmd /c "%psc% $ExecutionContext.SessionState.LanguageMode" + +REM check LanguageMode + +cmd /c "%psc% "$ExecutionContext.SessionState.LanguageMode"" | findstr /i "ConstrainedLanguage RestrictedLanguage NoLanguage" %nul1% && ( +%eline% +echo FullLanguage mode not found in PowerShell. Aborting... echo If you have applied restrictions on Powershell then undo those changes. echo: set fixes=%fixes% %mas%fix_powershell @@ -247,10 +254,15 @@ call :dk_color2 %Blue% "Help - " %_Yellow% " %mas%fix_powershell" goto dk_done ) -if /i not "%tstresult%"=="FullLanguage" ( -%eline% -echo "%tstresult%" -cmd /c "%psc% "$ExecutionContext.SessionState.LanguageMode"" +REM check Powershell core version + +cmd /c "%psc% "$PSVersionTable.PSEdition"" | find /i "Core" %nul1% && ( +echo Windows Powershell is needed for MAS but it seems to be replaced with Powershell core. Aborting... +goto dk_done +) + +REM check antivirus and other errors + echo PowerShell is not working properly. Aborting... cmd /c "%psc% ""$av = Get-WmiObject -Namespace root\SecurityCenter2 -Class AntiVirusProduct; $n = @(); foreach ($i in $av) { if ($i.displayName -notlike '*windows*') { $n += $i.displayName } }; if ($n) { Write-Host ('Installed 3rd party Antivirus might be blocking the script - ' + ($n -join ', ')) -ForegroundColor White -BackgroundColor Blue }""" echo: diff --git a/MAS/Separate-Files-Version/Activators/KMS38_Activation.cmd b/MAS/Separate-Files-Version/Activators/KMS38_Activation.cmd index eeee718..19586c1 100644 --- a/MAS/Separate-Files-Version/Activators/KMS38_Activation.cmd +++ b/MAS/Separate-Files-Version/Activators/KMS38_Activation.cmd @@ -238,11 +238,18 @@ goto dk_done ::pstst $ExecutionContext.SessionState.LanguageMode :pstst -for /f "delims=" %%a in ('cmd /c "%psc% ""$f=[io.file]::ReadAllText('!_batp!') -split ':pstst';iex ($f[1])""" %nul6%') do (set tstresult=%%a) +for /f "delims=" %%a in ('cmd /c "%psc% ""if ($PSVersionTable.PSEdition -ne 'Core') {$f=[io.file]::ReadAllText('!_batp!') -split ':pstst';iex ($f[1])}""" %nul6%') do (set tstresult=%%a) -if /i "%tstresult%"=="ConstrainedLanguage" ( +if /i not "%tstresult%"=="FullLanguage" ( %eline% -echo ConstrainedLanguage mode found in PowerShell. Aborting... +echo %tstresult% +cmd /c "%psc% $ExecutionContext.SessionState.LanguageMode" + +REM check LanguageMode + +cmd /c "%psc% "$ExecutionContext.SessionState.LanguageMode"" | findstr /i "ConstrainedLanguage RestrictedLanguage NoLanguage" %nul1% && ( +%eline% +echo FullLanguage mode not found in PowerShell. Aborting... echo If you have applied restrictions on Powershell then undo those changes. echo: set fixes=%fixes% %mas%fix_powershell @@ -250,10 +257,15 @@ call :dk_color2 %Blue% "Help - " %_Yellow% " %mas%fix_powershell" goto dk_done ) -if /i not "%tstresult%"=="FullLanguage" ( -%eline% -echo "%tstresult%" -cmd /c "%psc% "$ExecutionContext.SessionState.LanguageMode"" +REM check Powershell core version + +cmd /c "%psc% "$PSVersionTable.PSEdition"" | find /i "Core" %nul1% && ( +echo Windows Powershell is needed for MAS but it seems to be replaced with Powershell core. Aborting... +goto dk_done +) + +REM check antivirus and other errors + echo PowerShell is not working properly. Aborting... cmd /c "%psc% ""$av = Get-WmiObject -Namespace root\SecurityCenter2 -Class AntiVirusProduct; $n = @(); foreach ($i in $av) { if ($i.displayName -notlike '*windows*') { $n += $i.displayName } }; if ($n) { Write-Host ('Installed 3rd party Antivirus might be blocking the script - ' + ($n -join ', ')) -ForegroundColor White -BackgroundColor Blue }""" echo: diff --git a/MAS/Separate-Files-Version/Activators/Ohook_Activation_AIO.cmd b/MAS/Separate-Files-Version/Activators/Ohook_Activation_AIO.cmd index a1679e1..53860bd 100644 --- a/MAS/Separate-Files-Version/Activators/Ohook_Activation_AIO.cmd +++ b/MAS/Separate-Files-Version/Activators/Ohook_Activation_AIO.cmd @@ -228,11 +228,18 @@ goto dk_done ::pstst $ExecutionContext.SessionState.LanguageMode :pstst -for /f "delims=" %%a in ('cmd /c "%psc% ""$f=[io.file]::ReadAllText('!_batp!') -split ':pstst';iex ($f[1])""" %nul6%') do (set tstresult=%%a) +for /f "delims=" %%a in ('cmd /c "%psc% ""if ($PSVersionTable.PSEdition -ne 'Core') {$f=[io.file]::ReadAllText('!_batp!') -split ':pstst';iex ($f[1])}""" %nul6%') do (set tstresult=%%a) -if /i "%tstresult%"=="ConstrainedLanguage" ( +if /i not "%tstresult%"=="FullLanguage" ( %eline% -echo ConstrainedLanguage mode found in PowerShell. Aborting... +echo %tstresult% +cmd /c "%psc% $ExecutionContext.SessionState.LanguageMode" + +REM check LanguageMode + +cmd /c "%psc% "$ExecutionContext.SessionState.LanguageMode"" | findstr /i "ConstrainedLanguage RestrictedLanguage NoLanguage" %nul1% && ( +%eline% +echo FullLanguage mode not found in PowerShell. Aborting... echo If you have applied restrictions on Powershell then undo those changes. echo: set fixes=%fixes% %mas%fix_powershell @@ -240,10 +247,15 @@ call :dk_color2 %Blue% "Help - " %_Yellow% " %mas%fix_powershell" goto dk_done ) -if /i not "%tstresult%"=="FullLanguage" ( -%eline% -echo "%tstresult%" -cmd /c "%psc% "$ExecutionContext.SessionState.LanguageMode"" +REM check Powershell core version + +cmd /c "%psc% "$PSVersionTable.PSEdition"" | find /i "Core" %nul1% && ( +echo Windows Powershell is needed for MAS but it seems to be replaced with Powershell core. Aborting... +goto dk_done +) + +REM check antivirus and other errors + echo PowerShell is not working properly. Aborting... cmd /c "%psc% ""$av = Get-WmiObject -Namespace root\SecurityCenter2 -Class AntiVirusProduct; $n = @(); foreach ($i in $av) { if ($i.displayName -notlike '*windows*') { $n += $i.displayName } }; if ($n) { Write-Host ('Installed 3rd party Antivirus might be blocking the script - ' + ($n -join ', ')) -ForegroundColor White -BackgroundColor Blue }""" echo: diff --git a/MAS/Separate-Files-Version/Activators/Online_KMS_Activation.cmd b/MAS/Separate-Files-Version/Activators/Online_KMS_Activation.cmd index e14f24b..2a15a50 100644 --- a/MAS/Separate-Files-Version/Activators/Online_KMS_Activation.cmd +++ b/MAS/Separate-Files-Version/Activators/Online_KMS_Activation.cmd @@ -257,11 +257,18 @@ goto dk_done ::pstst $ExecutionContext.SessionState.LanguageMode :pstst -for /f "delims=" %%a in ('cmd /c "%psc% ""$f=[io.file]::ReadAllText('!_batp!') -split ':pstst';iex ($f[1])""" %nul6%') do (set tstresult=%%a) +for /f "delims=" %%a in ('cmd /c "%psc% ""if ($PSVersionTable.PSEdition -ne 'Core') {$f=[io.file]::ReadAllText('!_batp!') -split ':pstst';iex ($f[1])}""" %nul6%') do (set tstresult=%%a) -if /i "%tstresult%"=="ConstrainedLanguage" ( +if /i not "%tstresult%"=="FullLanguage" ( %eline% -echo ConstrainedLanguage mode found in PowerShell. Aborting... +echo %tstresult% +cmd /c "%psc% $ExecutionContext.SessionState.LanguageMode" + +REM check LanguageMode + +cmd /c "%psc% "$ExecutionContext.SessionState.LanguageMode"" | findstr /i "ConstrainedLanguage RestrictedLanguage NoLanguage" %nul1% && ( +%eline% +echo FullLanguage mode not found in PowerShell. Aborting... echo If you have applied restrictions on Powershell then undo those changes. echo: set fixes=%fixes% %mas%fix_powershell @@ -269,10 +276,15 @@ call :dk_color2 %Blue% "Help - " %_Yellow% " %mas%fix_powershell" goto dk_done ) -if /i not "%tstresult%"=="FullLanguage" ( -%eline% -echo "%tstresult%" -cmd /c "%psc% "$ExecutionContext.SessionState.LanguageMode"" +REM check Powershell core version + +cmd /c "%psc% "$PSVersionTable.PSEdition"" | find /i "Core" %nul1% && ( +echo Windows Powershell is needed for MAS but it seems to be replaced with Powershell core. Aborting... +goto dk_done +) + +REM check antivirus and other errors + echo PowerShell is not working properly. Aborting... cmd /c "%psc% ""$av = Get-WmiObject -Namespace root\SecurityCenter2 -Class AntiVirusProduct; $n = @(); foreach ($i in $av) { if ($i.displayName -notlike '*windows*') { $n += $i.displayName } }; if ($n) { Write-Host ('Installed 3rd party Antivirus might be blocking the script - ' + ($n -join ', ')) -ForegroundColor White -BackgroundColor Blue }""" echo: diff --git a/MAS/Separate-Files-Version/Activators/TSforge_Activation.cmd b/MAS/Separate-Files-Version/Activators/TSforge_Activation.cmd index 96a273c..3067851 100644 --- a/MAS/Separate-Files-Version/Activators/TSforge_Activation.cmd +++ b/MAS/Separate-Files-Version/Activators/TSforge_Activation.cmd @@ -263,11 +263,18 @@ goto dk_done ::pstst $ExecutionContext.SessionState.LanguageMode :pstst -for /f "delims=" %%a in ('cmd /c "%psc% ""$f=[io.file]::ReadAllText('!_batp!') -split ':pstst';iex ($f[1])""" %nul6%') do (set tstresult=%%a) +for /f "delims=" %%a in ('cmd /c "%psc% ""if ($PSVersionTable.PSEdition -ne 'Core') {$f=[io.file]::ReadAllText('!_batp!') -split ':pstst';iex ($f[1])}""" %nul6%') do (set tstresult=%%a) -if /i "%tstresult%"=="ConstrainedLanguage" ( +if /i not "%tstresult%"=="FullLanguage" ( %eline% -echo ConstrainedLanguage mode found in PowerShell. Aborting... +echo %tstresult% +cmd /c "%psc% $ExecutionContext.SessionState.LanguageMode" + +REM check LanguageMode + +cmd /c "%psc% "$ExecutionContext.SessionState.LanguageMode"" | findstr /i "ConstrainedLanguage RestrictedLanguage NoLanguage" %nul1% && ( +%eline% +echo FullLanguage mode not found in PowerShell. Aborting... echo If you have applied restrictions on Powershell then undo those changes. echo: set fixes=%fixes% %mas%fix_powershell @@ -275,10 +282,15 @@ call :dk_color2 %Blue% "Help - " %_Yellow% " %mas%fix_powershell" goto dk_done ) -if /i not "%tstresult%"=="FullLanguage" ( -%eline% -echo "%tstresult%" -cmd /c "%psc% "$ExecutionContext.SessionState.LanguageMode"" +REM check Powershell core version + +cmd /c "%psc% "$PSVersionTable.PSEdition"" | find /i "Core" %nul1% && ( +echo Windows Powershell is needed for MAS but it seems to be replaced with Powershell core. Aborting... +goto dk_done +) + +REM check antivirus and other errors + echo PowerShell is not working properly. Aborting... cmd /c "%psc% ""$av = Get-WmiObject -Namespace root\SecurityCenter2 -Class AntiVirusProduct; $n = @(); foreach ($i in $av) { if ($i.displayName -notlike '*windows*') { $n += $i.displayName } }; if ($n) { Write-Host ('Installed 3rd party Antivirus might be blocking the script - ' + ($n -join ', ')) -ForegroundColor White -BackgroundColor Blue }""" echo: diff --git a/MAS/Separate-Files-Version/Change_Office_Edition.cmd b/MAS/Separate-Files-Version/Change_Office_Edition.cmd index 6ec47b5..95d4044 100644 --- a/MAS/Separate-Files-Version/Change_Office_Edition.cmd +++ b/MAS/Separate-Files-Version/Change_Office_Edition.cmd @@ -188,11 +188,18 @@ goto dk_done ::pstst $ExecutionContext.SessionState.LanguageMode :pstst -for /f "delims=" %%a in ('cmd /c "%psc% ""$f=[io.file]::ReadAllText('!_batp!') -split ':pstst';iex ($f[1])""" %nul6%') do (set tstresult=%%a) +for /f "delims=" %%a in ('cmd /c "%psc% ""if ($PSVersionTable.PSEdition -ne 'Core') {$f=[io.file]::ReadAllText('!_batp!') -split ':pstst';iex ($f[1])}""" %nul6%') do (set tstresult=%%a) -if /i "%tstresult%"=="ConstrainedLanguage" ( +if /i not "%tstresult%"=="FullLanguage" ( %eline% -echo ConstrainedLanguage mode found in PowerShell. Aborting... +echo %tstresult% +cmd /c "%psc% $ExecutionContext.SessionState.LanguageMode" + +REM check LanguageMode + +cmd /c "%psc% "$ExecutionContext.SessionState.LanguageMode"" | findstr /i "ConstrainedLanguage RestrictedLanguage NoLanguage" %nul1% && ( +%eline% +echo FullLanguage mode not found in PowerShell. Aborting... echo If you have applied restrictions on Powershell then undo those changes. echo: set fixes=%fixes% %mas%fix_powershell @@ -200,10 +207,15 @@ call :dk_color2 %Blue% "Help - " %_Yellow% " %mas%fix_powershell" goto dk_done ) -if /i not "%tstresult%"=="FullLanguage" ( -%eline% -echo "%tstresult%" -cmd /c "%psc% "$ExecutionContext.SessionState.LanguageMode"" +REM check Powershell core version + +cmd /c "%psc% "$PSVersionTable.PSEdition"" | find /i "Core" %nul1% && ( +echo Windows Powershell is needed for MAS but it seems to be replaced with Powershell core. Aborting... +goto dk_done +) + +REM check antivirus and other errors + echo PowerShell is not working properly. Aborting... cmd /c "%psc% ""$av = Get-WmiObject -Namespace root\SecurityCenter2 -Class AntiVirusProduct; $n = @(); foreach ($i in $av) { if ($i.displayName -notlike '*windows*') { $n += $i.displayName } }; if ($n) { Write-Host ('Installed 3rd party Antivirus might be blocking the script - ' + ($n -join ', ')) -ForegroundColor White -BackgroundColor Blue }""" echo: diff --git a/MAS/Separate-Files-Version/Change_Windows_Edition.cmd b/MAS/Separate-Files-Version/Change_Windows_Edition.cmd index 19c1c3a..10a1559 100644 --- a/MAS/Separate-Files-Version/Change_Windows_Edition.cmd +++ b/MAS/Separate-Files-Version/Change_Windows_Edition.cmd @@ -193,11 +193,18 @@ goto dk_done ::pstst $ExecutionContext.SessionState.LanguageMode :pstst -for /f "delims=" %%a in ('cmd /c "%psc% ""$f=[io.file]::ReadAllText('!_batp!') -split ':pstst';iex ($f[1])""" %nul6%') do (set tstresult=%%a) +for /f "delims=" %%a in ('cmd /c "%psc% ""if ($PSVersionTable.PSEdition -ne 'Core') {$f=[io.file]::ReadAllText('!_batp!') -split ':pstst';iex ($f[1])}""" %nul6%') do (set tstresult=%%a) -if /i "%tstresult%"=="ConstrainedLanguage" ( +if /i not "%tstresult%"=="FullLanguage" ( %eline% -echo ConstrainedLanguage mode found in PowerShell. Aborting... +echo %tstresult% +cmd /c "%psc% $ExecutionContext.SessionState.LanguageMode" + +REM check LanguageMode + +cmd /c "%psc% "$ExecutionContext.SessionState.LanguageMode"" | findstr /i "ConstrainedLanguage RestrictedLanguage NoLanguage" %nul1% && ( +%eline% +echo FullLanguage mode not found in PowerShell. Aborting... echo If you have applied restrictions on Powershell then undo those changes. echo: set fixes=%fixes% %mas%fix_powershell @@ -205,10 +212,15 @@ call :dk_color2 %Blue% "Help - " %_Yellow% " %mas%fix_powershell" goto dk_done ) -if /i not "%tstresult%"=="FullLanguage" ( -%eline% -echo "%tstresult%" -cmd /c "%psc% "$ExecutionContext.SessionState.LanguageMode"" +REM check Powershell core version + +cmd /c "%psc% "$PSVersionTable.PSEdition"" | find /i "Core" %nul1% && ( +echo Windows Powershell is needed for MAS but it seems to be replaced with Powershell core. Aborting... +goto dk_done +) + +REM check antivirus and other errors + echo PowerShell is not working properly. Aborting... cmd /c "%psc% ""$av = Get-WmiObject -Namespace root\SecurityCenter2 -Class AntiVirusProduct; $n = @(); foreach ($i in $av) { if ($i.displayName -notlike '*windows*') { $n += $i.displayName } }; if ($n) { Write-Host ('Installed 3rd party Antivirus might be blocking the script - ' + ($n -join ', ')) -ForegroundColor White -BackgroundColor Blue }""" echo: diff --git a/MAS/Separate-Files-Version/Extract_OEM_Folder.cmd b/MAS/Separate-Files-Version/Extract_OEM_Folder.cmd index c1b78c1..7c8c3d4 100644 --- a/MAS/Separate-Files-Version/Extract_OEM_Folder.cmd +++ b/MAS/Separate-Files-Version/Extract_OEM_Folder.cmd @@ -187,11 +187,18 @@ goto done2 ::pstst $ExecutionContext.SessionState.LanguageMode :pstst -for /f "delims=" %%a in ('cmd /c "%psc% ""$f=[io.file]::ReadAllText('!_batp!') -split ':pstst';iex ($f[1])""" %nul6%') do (set tstresult=%%a) +for /f "delims=" %%a in ('cmd /c "%psc% ""if ($PSVersionTable.PSEdition -ne 'Core') {$f=[io.file]::ReadAllText('!_batp!') -split ':pstst';iex ($f[1])}""" %nul6%') do (set tstresult=%%a) -if /i "%tstresult%"=="ConstrainedLanguage" ( +if /i not "%tstresult%"=="FullLanguage" ( %eline% -echo ConstrainedLanguage mode found in PowerShell. Aborting... +echo %tstresult% +cmd /c "%psc% $ExecutionContext.SessionState.LanguageMode" + +REM check LanguageMode + +cmd /c "%psc% "$ExecutionContext.SessionState.LanguageMode"" | findstr /i "ConstrainedLanguage RestrictedLanguage NoLanguage" %nul1% && ( +%eline% +echo FullLanguage mode not found in PowerShell. Aborting... echo If you have applied restrictions on Powershell then undo those changes. echo: set fixes=%fixes% %mas%fix_powershell @@ -199,10 +206,15 @@ call :dk_color2 %Blue% "Help - " %_Yellow% " %mas%fix_powershell" goto done2 ) -if /i not "%tstresult%"=="FullLanguage" ( -%eline% -echo "%tstresult%" -cmd /c "%psc% "$ExecutionContext.SessionState.LanguageMode"" +REM check Powershell core version + +cmd /c "%psc% "$PSVersionTable.PSEdition"" | find /i "Core" %nul1% && ( +echo Windows Powershell is needed for MAS but it seems to be replaced with Powershell core. Aborting... +goto done2 +) + +REM check antivirus and other errors + echo PowerShell is not working properly. Aborting... cmd /c "%psc% ""$av = Get-WmiObject -Namespace root\SecurityCenter2 -Class AntiVirusProduct; $n = @(); foreach ($i in $av) { if ($i.displayName -notlike '*windows*') { $n += $i.displayName } }; if ($n) { Write-Host ('Installed 3rd party Antivirus might be blocking the script - ' + ($n -join ', ')) -ForegroundColor White -BackgroundColor Blue }""" echo: diff --git a/MAS/Separate-Files-Version/Troubleshoot.cmd b/MAS/Separate-Files-Version/Troubleshoot.cmd index 73cb0c4..8ce62b7 100644 --- a/MAS/Separate-Files-Version/Troubleshoot.cmd +++ b/MAS/Separate-Files-Version/Troubleshoot.cmd @@ -188,11 +188,18 @@ goto dk_done ::pstst $ExecutionContext.SessionState.LanguageMode :pstst -for /f "delims=" %%a in ('cmd /c "%psc% ""$f=[io.file]::ReadAllText('!_batp!') -split ':pstst';iex ($f[1])""" %nul6%') do (set tstresult=%%a) +for /f "delims=" %%a in ('cmd /c "%psc% ""if ($PSVersionTable.PSEdition -ne 'Core') {$f=[io.file]::ReadAllText('!_batp!') -split ':pstst';iex ($f[1])}""" %nul6%') do (set tstresult=%%a) -if /i "%tstresult%"=="ConstrainedLanguage" ( +if /i not "%tstresult%"=="FullLanguage" ( %eline% -echo ConstrainedLanguage mode found in PowerShell. Aborting... +echo %tstresult% +cmd /c "%psc% $ExecutionContext.SessionState.LanguageMode" + +REM check LanguageMode + +cmd /c "%psc% "$ExecutionContext.SessionState.LanguageMode"" | findstr /i "ConstrainedLanguage RestrictedLanguage NoLanguage" %nul1% && ( +%eline% +echo FullLanguage mode not found in PowerShell. Aborting... echo If you have applied restrictions on Powershell then undo those changes. echo: set fixes=%fixes% %mas%fix_powershell @@ -200,10 +207,15 @@ call :dk_color2 %Blue% "Help - " %_Yellow% " %mas%fix_powershell" goto dk_done ) -if /i not "%tstresult%"=="FullLanguage" ( -%eline% -echo "%tstresult%" -cmd /c "%psc% "$ExecutionContext.SessionState.LanguageMode"" +REM check Powershell core version + +cmd /c "%psc% "$PSVersionTable.PSEdition"" | find /i "Core" %nul1% && ( +echo Windows Powershell is needed for MAS but it seems to be replaced with Powershell core. Aborting... +goto dk_done +) + +REM check antivirus and other errors + echo PowerShell is not working properly. Aborting... cmd /c "%psc% ""$av = Get-WmiObject -Namespace root\SecurityCenter2 -Class AntiVirusProduct; $n = @(); foreach ($i in $av) { if ($i.displayName -notlike '*windows*') { $n += $i.displayName } }; if ($n) { Write-Host ('Installed 3rd party Antivirus might be blocking the script - ' + ($n -join ', ')) -ForegroundColor White -BackgroundColor Blue }""" echo: From 69f1a206fb17d2d101954ed221094295d8dc5d59 Mon Sep 17 00:00:00 2001 From: WindowsAddict Date: Fri, 14 Mar 2025 15:27:57 +0530 Subject: [PATCH 10/79] Change file hash --- MAS/All-In-One-Version-KL/MAS_AIO.cmd | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/MAS/All-In-One-Version-KL/MAS_AIO.cmd b/MAS/All-In-One-Version-KL/MAS_AIO.cmd index 06e4d83..f8cda8c 100644 --- a/MAS/All-In-One-Version-KL/MAS_AIO.cmd +++ b/MAS/All-In-One-Version-KL/MAS_AIO.cmd @@ -1,4 +1,4 @@ -@::u78r-random +@::63489fhty3-random @set masver=3.0 @setlocal DisableDelayedExpansion @echo off From 313f240448953cd5fe3c5631f4e4de502f23fc9a Mon Sep 17 00:00:00 2001 From: WindowsAddict Date: Fri, 14 Mar 2025 15:27:57 +0530 Subject: [PATCH 11/79] Change file hash --- MAS/All-In-One-Version-KL/MAS_AIO.cmd | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/MAS/All-In-One-Version-KL/MAS_AIO.cmd b/MAS/All-In-One-Version-KL/MAS_AIO.cmd index dfb8b2f..9a9a90c 100644 --- a/MAS/All-In-One-Version-KL/MAS_AIO.cmd +++ b/MAS/All-In-One-Version-KL/MAS_AIO.cmd @@ -1,4 +1,4 @@ -@::u78r-random +@::63489fhty3-random @set masver=3.0 @setlocal DisableDelayedExpansion @echo off From c4f33e96c472484b89b81d6b29cb995ea8148bf1 Mon Sep 17 00:00:00 2001 From: WindowsAddict Date: Sun, 16 Mar 2025 02:34:10 +0530 Subject: [PATCH 12/79] Update WPA keys check code --- MAS/All-In-One-Version-KL/MAS_AIO.cmd | 6 +++--- MAS/Separate-Files-Version/Activators/HWID_Activation.cmd | 6 +++--- MAS/Separate-Files-Version/Activators/KMS38_Activation.cmd | 6 +++--- .../Activators/Ohook_Activation_AIO.cmd | 6 +++--- .../Activators/Online_KMS_Activation.cmd | 6 +++--- .../Activators/TSforge_Activation.cmd | 6 +++--- 6 files changed, 18 insertions(+), 18 deletions(-) diff --git a/MAS/All-In-One-Version-KL/MAS_AIO.cmd b/MAS/All-In-One-Version-KL/MAS_AIO.cmd index f8cda8c..bdcee26 100644 --- a/MAS/All-In-One-Version-KL/MAS_AIO.cmd +++ b/MAS/All-In-One-Version-KL/MAS_AIO.cmd @@ -1879,7 +1879,7 @@ exit /b $wpaKey = [Microsoft.Win32.RegistryKey]::OpenRemoteBaseKey('LocalMachine', $env:COMPUTERNAME).OpenSubKey("SYSTEM\\WPA") $count = 0 foreach ($subkeyName in $wpaKey.GetSubKeyNames()) { - if ($subkeyName -match '.*-.*-.*-.*-.*-') { + if ($subkeyName -match '8DEC0AF1-0341-4b93-85CD-72606C2DF94C.*') { $count++ } } @@ -1888,7 +1888,7 @@ $minBuildNumber = 14393 if ($osVersion.Build -ge $minBuildNumber) { $subkeyHashTable = @{} foreach ($subkeyName in $wpaKey.GetSubKeyNames()) { - if ($subkeyName -match '.*-.*-.*-.*-.*-') { + if ($subkeyName -match '8DEC0AF1-0341-4b93-85CD-72606C2DF94C.*') { $keyNumber = $subkeyName -replace '.*-', '' $subkeyHashTable[$keyNumber] = $true } @@ -1902,7 +1902,7 @@ if ($osVersion.Build -ge $minBuildNumber) { } } $wpaKey.GetSubKeyNames() | ForEach-Object { - if ($_ -match '.*-.*-.*-.*-.*-') { + if ($_ -match '8DEC0AF1-0341-4b93-85CD-72606C2DF94C.*') { if ($PSVersionTable.PSVersion.Major -lt 3) { cmd /c "reg query "HKLM\SYSTEM\WPA\$_" /ve /t REG_BINARY >nul 2>&1" if ($LASTEXITCODE -ne 0) { diff --git a/MAS/Separate-Files-Version/Activators/HWID_Activation.cmd b/MAS/Separate-Files-Version/Activators/HWID_Activation.cmd index 2730ec6..6a379f7 100644 --- a/MAS/Separate-Files-Version/Activators/HWID_Activation.cmd +++ b/MAS/Separate-Files-Version/Activators/HWID_Activation.cmd @@ -1594,7 +1594,7 @@ exit /b $wpaKey = [Microsoft.Win32.RegistryKey]::OpenRemoteBaseKey('LocalMachine', $env:COMPUTERNAME).OpenSubKey("SYSTEM\\WPA") $count = 0 foreach ($subkeyName in $wpaKey.GetSubKeyNames()) { - if ($subkeyName -match '.*-.*-.*-.*-.*-') { + if ($subkeyName -match '8DEC0AF1-0341-4b93-85CD-72606C2DF94C.*') { $count++ } } @@ -1603,7 +1603,7 @@ $minBuildNumber = 14393 if ($osVersion.Build -ge $minBuildNumber) { $subkeyHashTable = @{} foreach ($subkeyName in $wpaKey.GetSubKeyNames()) { - if ($subkeyName -match '.*-.*-.*-.*-.*-') { + if ($subkeyName -match '8DEC0AF1-0341-4b93-85CD-72606C2DF94C.*') { $keyNumber = $subkeyName -replace '.*-', '' $subkeyHashTable[$keyNumber] = $true } @@ -1617,7 +1617,7 @@ if ($osVersion.Build -ge $minBuildNumber) { } } $wpaKey.GetSubKeyNames() | ForEach-Object { - if ($_ -match '.*-.*-.*-.*-.*-') { + if ($_ -match '8DEC0AF1-0341-4b93-85CD-72606C2DF94C.*') { if ($PSVersionTable.PSVersion.Major -lt 3) { cmd /c "reg query "HKLM\SYSTEM\WPA\$_" /ve /t REG_BINARY >nul 2>&1" if ($LASTEXITCODE -ne 0) { diff --git a/MAS/Separate-Files-Version/Activators/KMS38_Activation.cmd b/MAS/Separate-Files-Version/Activators/KMS38_Activation.cmd index 19586c1..ff6e59d 100644 --- a/MAS/Separate-Files-Version/Activators/KMS38_Activation.cmd +++ b/MAS/Separate-Files-Version/Activators/KMS38_Activation.cmd @@ -1743,7 +1743,7 @@ exit /b $wpaKey = [Microsoft.Win32.RegistryKey]::OpenRemoteBaseKey('LocalMachine', $env:COMPUTERNAME).OpenSubKey("SYSTEM\\WPA") $count = 0 foreach ($subkeyName in $wpaKey.GetSubKeyNames()) { - if ($subkeyName -match '.*-.*-.*-.*-.*-') { + if ($subkeyName -match '8DEC0AF1-0341-4b93-85CD-72606C2DF94C.*') { $count++ } } @@ -1752,7 +1752,7 @@ $minBuildNumber = 14393 if ($osVersion.Build -ge $minBuildNumber) { $subkeyHashTable = @{} foreach ($subkeyName in $wpaKey.GetSubKeyNames()) { - if ($subkeyName -match '.*-.*-.*-.*-.*-') { + if ($subkeyName -match '8DEC0AF1-0341-4b93-85CD-72606C2DF94C.*') { $keyNumber = $subkeyName -replace '.*-', '' $subkeyHashTable[$keyNumber] = $true } @@ -1766,7 +1766,7 @@ if ($osVersion.Build -ge $minBuildNumber) { } } $wpaKey.GetSubKeyNames() | ForEach-Object { - if ($_ -match '.*-.*-.*-.*-.*-') { + if ($_ -match '8DEC0AF1-0341-4b93-85CD-72606C2DF94C.*') { if ($PSVersionTable.PSVersion.Major -lt 3) { cmd /c "reg query "HKLM\SYSTEM\WPA\$_" /ve /t REG_BINARY >nul 2>&1" if ($LASTEXITCODE -ne 0) { diff --git a/MAS/Separate-Files-Version/Activators/Ohook_Activation_AIO.cmd b/MAS/Separate-Files-Version/Activators/Ohook_Activation_AIO.cmd index 53860bd..ce9ad93 100644 --- a/MAS/Separate-Files-Version/Activators/Ohook_Activation_AIO.cmd +++ b/MAS/Separate-Files-Version/Activators/Ohook_Activation_AIO.cmd @@ -2013,7 +2013,7 @@ exit /b $wpaKey = [Microsoft.Win32.RegistryKey]::OpenRemoteBaseKey('LocalMachine', $env:COMPUTERNAME).OpenSubKey("SYSTEM\\WPA") $count = 0 foreach ($subkeyName in $wpaKey.GetSubKeyNames()) { - if ($subkeyName -match '.*-.*-.*-.*-.*-') { + if ($subkeyName -match '8DEC0AF1-0341-4b93-85CD-72606C2DF94C.*') { $count++ } } @@ -2022,7 +2022,7 @@ $minBuildNumber = 14393 if ($osVersion.Build -ge $minBuildNumber) { $subkeyHashTable = @{} foreach ($subkeyName in $wpaKey.GetSubKeyNames()) { - if ($subkeyName -match '.*-.*-.*-.*-.*-') { + if ($subkeyName -match '8DEC0AF1-0341-4b93-85CD-72606C2DF94C.*') { $keyNumber = $subkeyName -replace '.*-', '' $subkeyHashTable[$keyNumber] = $true } @@ -2036,7 +2036,7 @@ if ($osVersion.Build -ge $minBuildNumber) { } } $wpaKey.GetSubKeyNames() | ForEach-Object { - if ($_ -match '.*-.*-.*-.*-.*-') { + if ($_ -match '8DEC0AF1-0341-4b93-85CD-72606C2DF94C.*') { if ($PSVersionTable.PSVersion.Major -lt 3) { cmd /c "reg query "HKLM\SYSTEM\WPA\$_" /ve /t REG_BINARY >nul 2>&1" if ($LASTEXITCODE -ne 0) { diff --git a/MAS/Separate-Files-Version/Activators/Online_KMS_Activation.cmd b/MAS/Separate-Files-Version/Activators/Online_KMS_Activation.cmd index 2a15a50..f1576e0 100644 --- a/MAS/Separate-Files-Version/Activators/Online_KMS_Activation.cmd +++ b/MAS/Separate-Files-Version/Activators/Online_KMS_Activation.cmd @@ -3167,7 +3167,7 @@ exit /b $wpaKey = [Microsoft.Win32.RegistryKey]::OpenRemoteBaseKey('LocalMachine', $env:COMPUTERNAME).OpenSubKey("SYSTEM\\WPA") $count = 0 foreach ($subkeyName in $wpaKey.GetSubKeyNames()) { - if ($subkeyName -match '.*-.*-.*-.*-.*-') { + if ($subkeyName -match '8DEC0AF1-0341-4b93-85CD-72606C2DF94C.*') { $count++ } } @@ -3176,7 +3176,7 @@ $minBuildNumber = 14393 if ($osVersion.Build -ge $minBuildNumber) { $subkeyHashTable = @{} foreach ($subkeyName in $wpaKey.GetSubKeyNames()) { - if ($subkeyName -match '.*-.*-.*-.*-.*-') { + if ($subkeyName -match '8DEC0AF1-0341-4b93-85CD-72606C2DF94C.*') { $keyNumber = $subkeyName -replace '.*-', '' $subkeyHashTable[$keyNumber] = $true } @@ -3190,7 +3190,7 @@ if ($osVersion.Build -ge $minBuildNumber) { } } $wpaKey.GetSubKeyNames() | ForEach-Object { - if ($_ -match '.*-.*-.*-.*-.*-') { + if ($_ -match '8DEC0AF1-0341-4b93-85CD-72606C2DF94C.*') { if ($PSVersionTable.PSVersion.Major -lt 3) { cmd /c "reg query "HKLM\SYSTEM\WPA\$_" /ve /t REG_BINARY >nul 2>&1" if ($LASTEXITCODE -ne 0) { diff --git a/MAS/Separate-Files-Version/Activators/TSforge_Activation.cmd b/MAS/Separate-Files-Version/Activators/TSforge_Activation.cmd index 3067851..1cf85e9 100644 --- a/MAS/Separate-Files-Version/Activators/TSforge_Activation.cmd +++ b/MAS/Separate-Files-Version/Activators/TSforge_Activation.cmd @@ -2722,7 +2722,7 @@ exit /b $wpaKey = [Microsoft.Win32.RegistryKey]::OpenRemoteBaseKey('LocalMachine', $env:COMPUTERNAME).OpenSubKey("SYSTEM\\WPA") $count = 0 foreach ($subkeyName in $wpaKey.GetSubKeyNames()) { - if ($subkeyName -match '.*-.*-.*-.*-.*-') { + if ($subkeyName -match '8DEC0AF1-0341-4b93-85CD-72606C2DF94C.*') { $count++ } } @@ -2731,7 +2731,7 @@ $minBuildNumber = 14393 if ($osVersion.Build -ge $minBuildNumber) { $subkeyHashTable = @{} foreach ($subkeyName in $wpaKey.GetSubKeyNames()) { - if ($subkeyName -match '.*-.*-.*-.*-.*-') { + if ($subkeyName -match '8DEC0AF1-0341-4b93-85CD-72606C2DF94C.*') { $keyNumber = $subkeyName -replace '.*-', '' $subkeyHashTable[$keyNumber] = $true } @@ -2745,7 +2745,7 @@ if ($osVersion.Build -ge $minBuildNumber) { } } $wpaKey.GetSubKeyNames() | ForEach-Object { - if ($_ -match '.*-.*-.*-.*-.*-') { + if ($_ -match '8DEC0AF1-0341-4b93-85CD-72606C2DF94C.*') { if ($PSVersionTable.PSVersion.Major -lt 3) { cmd /c "reg query "HKLM\SYSTEM\WPA\$_" /ve /t REG_BINARY >nul 2>&1" if ($LASTEXITCODE -ne 0) { From fe001e6c39777cce8d059c0da35ea48a109ac929 Mon Sep 17 00:00:00 2001 From: WindowsAddict Date: Sun, 16 Mar 2025 03:04:40 +0530 Subject: [PATCH 13/79] Elaborate help message --- MAS/All-In-One-Version-KL/MAS_AIO.cmd | 120 +++++++++--------- .../Activators/HWID_Activation.cmd | 36 +++--- .../Activators/KMS38_Activation.cmd | 38 +++--- .../Activators/Ohook_Activation_AIO.cmd | 26 ++-- .../Activators/Online_KMS_Activation.cmd | 30 ++--- .../Activators/TSforge_Activation.cmd | 46 +++---- .../Change_Office_Edition.cmd | 30 ++--- .../Change_Windows_Edition.cmd | 26 ++-- .../Extract_OEM_Folder.cmd | 10 +- MAS/Separate-Files-Version/Troubleshoot.cmd | 10 +- 10 files changed, 186 insertions(+), 186 deletions(-) diff --git a/MAS/All-In-One-Version-KL/MAS_AIO.cmd b/MAS/All-In-One-Version-KL/MAS_AIO.cmd index bdcee26..6581baf 100644 --- a/MAS/All-In-One-Version-KL/MAS_AIO.cmd +++ b/MAS/All-In-One-Version-KL/MAS_AIO.cmd @@ -76,7 +76,7 @@ echo: echo Null service is not running, script may crash... echo: echo: -echo Help - %mas%fix_service +echo Check this webpage for help - %mas%fix_service echo: echo: ping 127.0.0.1 -n 20 @@ -91,7 +91,7 @@ echo: echo Error - Script either has LF line ending issue or an empty line at the end of the script is missing. echo: echo: -echo Help - %mas%troubleshoot +echo Check this webpage for help - %mas%troubleshoot echo: echo: ping 127.0.0.1 -n 20 >nul @@ -137,7 +137,7 @@ echo Failed to detect Windows build number. echo: setlocal EnableDelayedExpansion set fixes=%fixes% %mas%troubleshoot -call :dk_color2 %Blue% "Help - " %_Yellow% " %mas%troubleshoot" +call :dk_color2 %Blue% "Check this webpage for help - " %_Yellow% " %mas%troubleshoot" goto dk_done ) @@ -211,7 +211,7 @@ echo FullLanguage mode not found in PowerShell. Aborting... echo If you have applied restrictions on Powershell then undo those changes. echo: set fixes=%fixes% %mas%fix_powershell -call :dk_color2 %Blue% "Help - " %_Yellow% " %mas%fix_powershell" +call :dk_color2 %Blue% "Check this webpage for help - " %_Yellow% " %mas%fix_powershell" goto dk_done ) @@ -228,7 +228,7 @@ echo PowerShell is not working properly. Aborting... cmd /c "%psc% ""$av = Get-WmiObject -Namespace root\SecurityCenter2 -Class AntiVirusProduct; $n = @(); foreach ($i in $av) { if ($i.displayName -notlike '*windows*') { $n += $i.displayName } }; if ($n) { Write-Host ('Installed 3rd party Antivirus might be blocking the script - ' + ($n -join ', ')) -ForegroundColor White -BackgroundColor Blue }""" echo: set fixes=%fixes% %mas%troubleshoot -call :dk_color2 %Blue% "Help - " %_Yellow% " %mas%troubleshoot" +call :dk_color2 %Blue% "Check this webpage for help - " %_Yellow% " %mas%troubleshoot" goto dk_done ) @@ -642,7 +642,7 @@ if not exist %SysPath%\%%# ( echo [%SysPath%\%%#] file is missing, aborting... echo: set fixes=%fixes% %mas%troubleshoot -call :dk_color2 %Blue% "Help - " %_Yellow% " %mas%troubleshoot" +call :dk_color2 %Blue% "Check this webpage for help - " %_Yellow% " %mas%troubleshoot" goto dk_done ) ) @@ -688,7 +688,7 @@ echo Evaluation editions cannot be activated outside of their evaluation period. call :dk_color %Blue% "Use TSforge activation option from the main menu to reset evaluation period." echo: set fixes=%fixes% %mas%evaluation_editions -call :dk_color2 %Blue% "Help - " %_Yellow% " %mas%evaluation_editions" +call :dk_color2 %Blue% "Check this webpage for help - " %_Yellow% " %mas%evaluation_editions" goto dk_done ) ) @@ -775,7 +775,7 @@ 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" +call :dk_color2 %Blue% "Check this webpage for help - " %_Yellow% " %mas%troubleshoot" ) echo: goto dk_done @@ -954,7 +954,7 @@ findstr /i "%%#" "%SysPath%\drivers\etc\hosts" %nul1% && set "hosfail= [%%# Bloc ) call :dk_color %Red% "Checking Licensing Servers [Failed to Connect]!hosfail!" set fixes=%fixes% %mas%licensing-servers-issue -call :dk_color2 %Blue% "Help - " %_Yellow% " %mas%licensing-servers-issue" +call :dk_color2 %Blue% "Check this webpage for help - " %_Yellow% " %mas%licensing-servers-issue" ) ::========================================================================================================================================== @@ -991,7 +991,7 @@ call :dk_color %Red% "Checking Windows Update Registry [Corruption Found] if !wcount! GTR 2 ( call :dk_color %Red% "Windows seems to be infected with Mal%w%ware." set fixes=%fixes% %mas%remove_mal%w%ware -call :dk_color2 %Blue% "Help - " %_Yellow% " %mas%remove_mal%w%ware" +call :dk_color2 %Blue% "Check this webpage for help - " %_Yellow% " %mas%remove_mal%w%ware" ) else ( call :dk_color %Blue% "HWID activation needs working Windows updates, if you have used any tool to block updates, undo it." ) @@ -1016,7 +1016,7 @@ if not defined wucorrupt if not defined wublock if not defined wuerror if not de echo "%error_code%" | findstr /i "0x80072e 0x80072f 0x800704cf 0x87e10bcf 0x800705b4" %nul% && ( call :dk_color %Red% "Checking Internet Issues [Found] %error_code%" set fixes=%fixes% %mas%licensing-servers-issue -call :dk_color2 %Blue% "Help - " %_Yellow% " %mas%licensing-servers-issue" +call :dk_color2 %Blue% "Check this webpage for help - " %_Yellow% " %mas%licensing-servers-issue" ) ) ) @@ -1034,7 +1034,7 @@ call :dk_color %Blue% "Use TSforge activation option from the main menu instead. ) else ( if not defined error call :dk_color %Blue% "%_fixmsg%" set fixes=%fixes% %mas%troubleshoot -call :dk_color2 %Blue% "Help - " %_Yellow% " %mas%troubleshoot" +call :dk_color2 %Blue% "Check this webpage for help - " %_Yellow% " %mas%troubleshoot" ) ) @@ -1356,7 +1356,7 @@ echo sc start sppsvc [Error Code: %spperror%] ) echo: -%psc% "$job = Start-Job { (Get-WmiObject -Query 'SELECT * FROM %sps%').Version }; if (-not (Wait-Job $job -Timeout 30)) {write-host 'sppsvc is not working correctly. Help - %mas%troubleshoot'}" +%psc% "$job = Start-Job { (Get-WmiObject -Query 'SELECT * FROM %sps%').Version }; if (-not (Wait-Job $job -Timeout 30)) {write-host 'sppsvc is not working correctly. Check this webpage for help - %mas%troubleshoot'}" exit /b :: Get Product name (WMI/REG methods are not reliable in all conditions, hence winbrand.dll method is used) @@ -1432,7 +1432,7 @@ if defined pupfound call :dk_color %Gray% "Checking PUP Activators if defined results call :dk_color %Red% "Checking Probable Mal%w%ware Infection..." if defined results call :dk_color %Red% "%results%" set fixes=%fixes% %mas%remove_mal%w%ware -call :dk_color2 %Blue% "Help - " %_Yellow% " %mas%remove_mal%w%ware" +call :dk_color2 %Blue% "Check this webpage for help - " %_Yellow% " %mas%remove_mal%w%ware" echo: ) @@ -1552,7 +1552,7 @@ set showfix=1 ) echo %serv_e% | findstr /i "sppsvc-1060" %nul% && ( set fixes=%fixes% %mas%fix_service -call :dk_color2 %Blue% "Help - " %_Yellow% " %mas%fix_service" +call :dk_color2 %Blue% "Check this webpage for help - " %_Yellow% " %mas%fix_service" set showfix=1 ) ) @@ -1609,7 +1609,7 @@ if not defined notwinact if exist "%SystemRoot%\Servicing\Packages\Microsoft-Win reg query "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion" /v EditionID %nul2% | find /i "Eval" %nul1% || ( 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" +call :dk_color2 %Blue% "Check this webpage for help - " %_Yellow% " %mas%evaluation_editions" ) ) @@ -1739,7 +1739,7 @@ call :dk_color %Red% "Checking SkipRearm [Default 0 Value N reg query "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\SoftwareProtectionPlatform\Plugins\Objects\msft:rm/algorithm/hwid/4.0" /f ba02fed39662 /d %nul% || ( call :dk_color %Red% "Checking SPP Registry Key [Incorrect ModuleId Found]" set fixes=%fixes% %mas%issues_due_to_gaming_spoofers -call :dk_color2 %Blue% "Most likely caused by gaming spoofers. Help - " %_Yellow% " %mas%issues_due_to_gaming_spoofers" +call :dk_color2 %Blue% "Most likely caused by gaming spoofers. Check this webpage for help - " %_Yellow% " %mas%issues_due_to_gaming_spoofers" set error=1 set showfix=1 ) @@ -1754,7 +1754,7 @@ set error=1 set showfix=1 call :dk_color %Red% "Checking TokenStore Registry Key [Correct Path Not Found] [%tokenstore%]" set fixes=%fixes% %mas%troubleshoot -call :dk_color2 %Blue% "Help - " %_Yellow% " %mas%troubleshoot" +call :dk_color2 %Blue% "Check this webpage for help - " %_Yellow% " %mas%troubleshoot" ) @@ -2189,7 +2189,7 @@ if not exist %SysPath%\sppsvc.exe ( echo [%SysPath%\sppsvc.exe] file is missing, aborting... echo: set fixes=%fixes% %mas%troubleshoot -call :dk_color2 %Blue% "Help - " %_Yellow% " %mas%troubleshoot" +call :dk_color2 %Blue% "Check this webpage for help - " %_Yellow% " %mas%troubleshoot" goto dk_done ) @@ -2468,7 +2468,7 @@ call :dk_color %Red% "Some errors were detected." if not defined ierror if not defined showfix if not defined serv_cor if not defined serv_cste call :dk_color %Blue% "%_fixmsg%" echo: set fixes=%fixes% %mas%troubleshoot -call :dk_color2 %Blue% "Help - " %_Yellow% " %mas%troubleshoot" +call :dk_color2 %Blue% "Check this webpage for help - " %_Yellow% " %mas%troubleshoot" ) goto :dk_done @@ -3759,7 +3759,7 @@ if not exist %SysPath%\sppsvc.exe ( echo [%SysPath%\sppsvc.exe] file is missing, aborting... echo: set fixes=%fixes% %mas%troubleshoot -call :dk_color2 %Blue% "Help - " %_Yellow% " %mas%troubleshoot" +call :dk_color2 %Blue% "Check this webpage for help - " %_Yellow% " %mas%troubleshoot" goto dk_done ) @@ -3772,7 +3772,7 @@ echo Install .NET Framework 4.8 and Windows Management Framework 5.1 ) echo: set fixes=%fixes% %mas%troubleshoot -call :dk_color2 %Blue% "Help - " %_Yellow% " %mas%troubleshoot" +call :dk_color2 %Blue% "Check this webpage for help - " %_Yellow% " %mas%troubleshoot" goto dk_done ) ) @@ -3786,7 +3786,7 @@ echo Evaluation WLMS service is running, sppsvc service can not be stopped. Abor echo Install Non-Eval version for Windows build %winbuild%. echo: set fixes=%fixes% %mas%troubleshoot -call :dk_color2 %Blue% "Help - " %_Yellow% " %mas%troubleshoot" +call :dk_color2 %Blue% "Check this webpage for help - " %_Yellow% " %mas%troubleshoot" goto dk_done ) ) @@ -3825,7 +3825,7 @@ call :dk_errorcheck if defined error ( call :dk_color %Red% "Some errors were detected. Aborting the operation..." set fixes=%fixes% %mas%troubleshoot -call :dk_color2 %Blue% "Help - " %_Yellow% " %mas%troubleshoot" +call :dk_color2 %Blue% "Check this webpage for help - " %_Yellow% " %mas%troubleshoot" goto :dk_done ) @@ -3833,7 +3833,7 @@ call :ts_getedition if not defined tsedition ( call :dk_color %Red% "Checking Windows Edition ID [Not found in installed licenses, aborting...]" set fixes=%fixes% %mas%troubleshoot -call :dk_color2 %Blue% "Help - " %_Yellow% " %mas%troubleshoot" +call :dk_color2 %Blue% "Check this webpage for help - " %_Yellow% " %mas%troubleshoot" goto :dk_done ) @@ -4114,7 +4114,7 @@ if %winbuild% EQU 9600 set esuavail=1 if defined esuavail ( call :dk_color %Red% "Checking Activation ID [ESU license is not found, make sure Windows is fully updated]" set fixes=%fixes% %mas%tsforge#windows-esu -call :dk_color2 %Blue% "Help - " %_Yellow% " %mas%tsforge#windows-esu" +call :dk_color2 %Blue% "Check this webpage for help - " %_Yellow% " %mas%tsforge#windows-esu" ) else ( call :dk_color %Gray% "Checking Activation ID [ESU is not available for %winos%]" ) @@ -4478,7 +4478,7 @@ echo Checking Activation ID [%%A] [%%B] if not defined ohostexist ( call :dk_color %Gray% "Checking Activation ID [Not found for Office %KS% Host]" -call :dk_color2 %Blue% "Help - " %_Yellow% " %mas%tsforge#office-kms-host" +call :dk_color2 %Blue% "Check this webpage for help - " %_Yellow% " %mas%tsforge#office-kms-host" ) echo: @@ -4544,7 +4544,7 @@ set resetstuff=1 if %errorlevel%==3 ( call :dk_color %Red% "Reset Failed." set fixes=%fixes% %mas%troubleshoot -call :dk_color2 %Blue% "Help - " %_Yellow% " %mas%troubleshoot" +call :dk_color2 %Blue% "Check this webpage for help - " %_Yellow% " %mas%troubleshoot" ) else ( call :dk_color %Green% "Reset process has been successfully done." ) @@ -4708,7 +4708,7 @@ call :dk_color %Gray% "To activate, check your internet connection and ensure th call :dk_color %Blue% "This Windows version is known to not activate due to MS Windows/Server issues." ) set fixes=%fixes% %mas%troubleshoot -call :dk_color2 %Blue% "Help - " %_Yellow% " %mas%troubleshoot" +call :dk_color2 %Blue% "Check this webpage for help - " %_Yellow% " %mas%troubleshoot" ) ) @@ -4721,7 +4721,7 @@ echo: if !errorlevel!==3 ( if %_actman%==0 call :dk_color %Blue% "%_fixmsg%" set fixes=%fixes% %mas%troubleshoot -call :dk_color2 %Blue% "Help - " %_Yellow% " %mas%troubleshoot" +call :dk_color2 %Blue% "Check this webpage for help - " %_Yellow% " %mas%troubleshoot" ) else ( echo "%tsids%" | find /i "7e94be23-b161-4956-a682-146ab291774c" %nul1% && ( call :dk_color %Gray% "Windows Update can receive 1-3 years of ESU. 4-6 years ESU is not officially supported, but you can manually install updates." @@ -4749,7 +4749,7 @@ call :dk_reeval %nul% if not defined tsids if defined error if not defined showfix ( set fixes=%fixes% %mas%troubleshoot -call :dk_color2 %Blue% "Help - " %_Yellow% " %mas%troubleshoot" +call :dk_color2 %Blue% "Check this webpage for help - " %_Yellow% " %mas%troubleshoot" ) goto :dk_done @@ -4864,7 +4864,7 @@ call :dk_color %Red% "Checking Activation ID [Office %oVer%.0 ! set error=1 set showfix=1 set fixes=%fixes% %mas%troubleshoot -call :dk_color2 %Blue% "Help - " %_Yellow% " %mas%troubleshoot" +call :dk_color2 %Blue% "Check this webpage for help - " %_Yellow% " %mas%troubleshoot" ) echo %%# | find /i "2024" %nul% && ( @@ -9681,7 +9681,7 @@ if defined _fmiss ( echo [%_fmiss%] file is missing, aborting... echo: set fixes=%fixes% %mas%troubleshoot -call :dk_color2 %Blue% "Help - " %_Yellow% " %mas%troubleshoot" +call :dk_color2 %Blue% "Check this webpage for help - " %_Yellow% " %mas%troubleshoot" goto dk_done ) @@ -9738,7 +9738,7 @@ echo Evaluation editions cannot be activated outside of their evaluation period. call :dk_color %Blue% "Use TSforge activation option from the main menu to reset evaluation period." echo: set fixes=%fixes% %mas%evaluation_editions -call :dk_color2 %Blue% "Help - " %_Yellow% " %mas%evaluation_editions" +call :dk_color2 %Blue% "Check this webpage for help - " %_Yellow% " %mas%evaluation_editions" ) goto dk_done ) @@ -9754,7 +9754,7 @@ if not exist "!_work!\clipup.exe" ( echo clipup.exe doesn't exist in Server Cor/Acor [No GUI] versions. echo The file is required for KMS38 activation. echo Check the below page for instructions on how to activate it. -call :dk_color2 %Blue% "Help - " %_Yellow% " %mas%kms38" +call :dk_color2 %Blue% "Check this webpage for help - " %_Yellow% " %mas%kms38" goto dk_done ) ) @@ -9766,7 +9766,7 @@ if defined a_cor ( if !errorlevel!==3 ( %eline% echo Valid digital signature not found in clipup.exe file. -call :dk_color2 %Blue% "Help - " %_Yellow% " %mas%troubleshoot" +call :dk_color2 %Blue% "Check this webpage for help - " %_Yellow% " %mas%troubleshoot" goto dk_done ) ) @@ -9834,13 +9834,13 @@ if exist "%SysPath%\spp\tokens\skus\%osedition%\*GVLK*.xrm-ms" set sppks=1 if defined skunotfound ( call :dk_color %Red% "Required license files not found in %SysPath%\spp\tokens\skus\" set fixes=%fixes% %mas%troubleshoot -call :dk_color2 %Blue% "Help - " %_Yellow% " %mas%troubleshoot" +call :dk_color2 %Blue% "Check this webpage for help - " %_Yellow% " %mas%troubleshoot" ) if defined sppks ( call :dk_color %Red% "KMS38 activation is supported but failed to find the key." set fixes=%fixes% %mas%troubleshoot -call :dk_color2 %Blue% "Help - " %_Yellow% " %mas%troubleshoot" +call :dk_color2 %Blue% "Check this webpage for help - " %_Yellow% " %mas%troubleshoot" ) if not defined skunotfound if not defined sppks ( @@ -9890,7 +9890,7 @@ if %_wmic% EQU 0 for /f "tokens=2 delims==" %%a in ('%psc% "(([WMISEARCHER]'SELE if not defined app ( call :dk_color %Red% "Checking Installed GVLK Activation ID [Not Found] Aborting..." set fixes=%fixes% %mas%troubleshoot -call :dk_color2 %Blue% "Help - " %_Yellow% " %mas%troubleshoot" +call :dk_color2 %Blue% "Check this webpage for help - " %_Yellow% " %mas%troubleshoot" goto :dk_done ) @@ -10058,7 +10058,7 @@ goto :k_final call :dk_color %Red% "Activation Failed" if not defined error call :dk_color %Blue% "%_fixmsg%" set fixes=%fixes% %mas%troubleshoot -call :dk_color2 %Blue% "Help - " %_Yellow% " %mas%troubleshoot" +call :dk_color2 %Blue% "Check this webpage for help - " %_Yellow% " %mas%troubleshoot" ::======================================================================================================================================== @@ -10513,7 +10513,7 @@ if not exist %SysPath%\sppsvc.exe ( echo [%SysPath%\sppsvc.exe] file is missing, aborting... echo: set fixes=%fixes% %mas%troubleshoot -call :dk_color2 %Blue% "Help - " %_Yellow% " %mas%troubleshoot" +call :dk_color2 %Blue% "Check this webpage for help - " %_Yellow% " %mas%troubleshoot" goto dk_done ) @@ -10606,7 +10606,7 @@ call :dk_color %Blue% "Go back to main menu and use [Change Edition] option." ) else ( call :dk_color %Blue% "Use TSforge activation option from the main menu to reset evaluation period." set fixes=%fixes% %mas%evaluation_editions -call :dk_color2 %Blue% "Help - " %_Yellow% " %mas%evaluation_editions" +call :dk_color2 %Blue% "Check this webpage for help - " %_Yellow% " %mas%evaluation_editions" ) goto :ks_office @@ -10656,13 +10656,13 @@ if %winbuild% LSS 9200 if exist "%SysPath%\spp\tokens\skus\Security-SPP-Componen if defined skunotfound ( call :dk_color %Red% "Required license files not found in %SysPath%\spp\tokens\skus\" set fixes=%fixes% %mas%troubleshoot -call :dk_color2 %Blue% "Help - " %_Yellow% " %mas%troubleshoot" +call :dk_color2 %Blue% "Check this webpage for help - " %_Yellow% " %mas%troubleshoot" ) if defined sppks ( call :dk_color %Red% "%KS% activation is supported but failed to find the %KS% key." set fixes=%fixes% %mas%troubleshoot -call :dk_color2 %Blue% "Help - " %_Yellow% " %mas%troubleshoot" +call :dk_color2 %Blue% "Check this webpage for help - " %_Yellow% " %mas%troubleshoot" ) if not defined skunotfound if not defined sppks ( @@ -14728,7 +14728,7 @@ if not exist %SysPath%\%%# ( echo [%SysPath%\%%#] file is missing, aborting... echo: set fixes=%fixes% %mas%troubleshoot -call :dk_color2 %Blue% "Help - " %_Yellow% " %mas%troubleshoot" +call :dk_color2 %Blue% "Check this webpage for help - " %_Yellow% " %mas%troubleshoot" goto dk_done ) ) @@ -14761,7 +14761,7 @@ if not defined allapps ( echo Failed to find activation IDs. Aborting... echo: set fixes=%fixes% %mas%troubleshoot -call :dk_color2 %Blue% "Help - " %_Yellow% " %mas%troubleshoot" +call :dk_color2 %Blue% "Check this webpage for help - " %_Yellow% " %mas%troubleshoot" goto dk_done ) @@ -14784,7 +14784,7 @@ if not defined osedition ( echo Failed to detect OS edition, aborting... echo: set fixes=%fixes% %mas%troubleshoot -call :dk_color2 %Blue% "Help - " %_Yellow% " %mas%troubleshoot" +call :dk_color2 %Blue% "Check this webpage for help - " %_Yellow% " %mas%troubleshoot" goto dk_done ) @@ -14946,7 +14946,7 @@ echo [%targetedition% ^| %winbuild%] echo Failed to get product key from pkeyhelper.dll. echo: set fixes=%fixes% %mas%troubleshoot -call :dk_color2 %Blue% "Help - " %_Yellow% " %mas%troubleshoot" +call :dk_color2 %Blue% "Check this webpage for help - " %_Yellow% " %mas%troubleshoot" goto dk_done ) @@ -15001,7 +15001,7 @@ call :dk_color %Gray% "Reboot is required to fully change the edition." call :dk_color %Red% "[Unsuccessful] [Error Code: !keyerror!]" echo: set fixes=%fixes% %mas%troubleshoot -call :dk_color2 %Blue% "Help - " %_Yellow% " %mas%troubleshoot" +call :dk_color2 %Blue% "Check this webpage for help - " %_Yellow% " %mas%troubleshoot" ) ) @@ -15082,7 +15082,7 @@ echo [%targetedition% ^| %winbuild%] echo Failed to get product key from pkeyhelper.dll. echo: set fixes=%fixes% %mas%troubleshoot -call :dk_color2 %Blue% "Help - " %_Yellow% " %mas%troubleshoot" +call :dk_color2 %Blue% "Check this webpage for help - " %_Yellow% " %mas%troubleshoot" goto dk_done ) @@ -15158,7 +15158,7 @@ echo: call :dk_color %Blue% "In case there are errors, you should restart the system before trying again." echo: set fixes=%fixes% %mas%change_edition_issues -call :dk_color2 %Blue% "Help - " %_Yellow% " %mas%change_edition_issues" +call :dk_color2 %Blue% "Check this webpage for help - " %_Yellow% " %mas%change_edition_issues" exit /b ::======================================================================================================================================== @@ -15581,7 +15581,7 @@ if not exist %SysPath%\sppsvc.exe ( echo [%SysPath%\sppsvc.exe] file is missing. Aborting... echo: set fixes=%fixes% %mas%troubleshoot -call :dk_color2 %Blue% "Help - " %_Yellow% " %mas%troubleshoot" +call :dk_color2 %Blue% "Check this webpage for help - " %_Yellow% " %mas%troubleshoot" goto dk_done ) @@ -15619,7 +15619,7 @@ if %osedition%==0 ( echo Failed to detect OS Edition. Aborting... echo: set fixes=%fixes% %mas%troubleshoot -call :dk_color2 %Blue% "Help - " %_Yellow% " %mas%troubleshoot" +call :dk_color2 %Blue% "Check this webpage for help - " %_Yellow% " %mas%troubleshoot" goto dk_done ) @@ -15692,7 +15692,7 @@ echo which is not officially supported on your Windows build version %winbuild%. echo Aborting... echo: set fixes=%fixes% %mas%troubleshoot -call :dk_color2 %Blue% "Help - " %_Yellow% " %mas%troubleshoot" +call :dk_color2 %Blue% "Check this webpage for help - " %_Yellow% " %mas%troubleshoot" goto dk_done ) @@ -15706,7 +15706,7 @@ echo Unsupported Office %verchk% is installed on your Windows build version %win echo Aborting... echo: set fixes=%fixes% %mas%troubleshoot -call :dk_color2 %Blue% "Help - " %_Yellow% " %mas%troubleshoot" +call :dk_color2 %Blue% "Check this webpage for help - " %_Yellow% " %mas%troubleshoot" goto dk_done ) @@ -15812,7 +15812,7 @@ if not exist %SystemRoot%\Temp\%list%.txt ( echo Failed to generate available editions list. echo: set fixes=%fixes% %mas%troubleshoot -call :dk_color2 %Blue% "Help - " %_Yellow% " %mas%troubleshoot" +call :dk_color2 %Blue% "Check this webpage for help - " %_Yellow% " %mas%troubleshoot" goto :oe_goback ) @@ -15877,7 +15877,7 @@ if not exist %SystemRoot%\Temp\getAppIds.txt ( echo Failed to generate available apps list. echo: set fixes=%fixes% %mas%troubleshoot -call :dk_color2 %Blue% "Help - " %_Yellow% " %mas%troubleshoot" +call :dk_color2 %Blue% "Check this webpage for help - " %_Yellow% " %mas%troubleshoot" goto :oe_goback ) ) @@ -16059,7 +16059,7 @@ if %errorcode% EQU 0 ( call :dk_color %Gray% "Now run the Office activation option from the main menu." ) else ( set fixes=%fixes% %mas%troubleshoot -call :dk_color2 %Blue% "Help - " %_Yellow% " %mas%troubleshoot" +call :dk_color2 %Blue% "Check this webpage for help - " %_Yellow% " %mas%troubleshoot" ) call :oe_tempcleanup @@ -16202,7 +16202,7 @@ echo %c2rcommand% if %errorlevel% NEQ 0 ( echo: set fixes=%fixes% %mas%troubleshoot -call :dk_color2 %Blue% "Help - " %_Yellow% " %mas%troubleshoot" +call :dk_color2 %Blue% "Check this webpage for help - " %_Yellow% " %mas%troubleshoot" ) goto :oe_goback @@ -16350,7 +16350,7 @@ echo: echo %updcommand% %updcommand% echo: -echo Help - %mas%troubleshoot +echo Check this webpage for help - %mas%troubleshoot goto :oe_goback ::======================================================================================================================================== diff --git a/MAS/Separate-Files-Version/Activators/HWID_Activation.cmd b/MAS/Separate-Files-Version/Activators/HWID_Activation.cmd index 6a379f7..50512c5 100644 --- a/MAS/Separate-Files-Version/Activators/HWID_Activation.cmd +++ b/MAS/Separate-Files-Version/Activators/HWID_Activation.cmd @@ -109,7 +109,7 @@ echo: echo Null service is not running, script may crash... echo: echo: -echo Help - %mas%fix_service +echo Check this webpage for help - %mas%fix_service echo: echo: ping 127.0.0.1 -n 20 @@ -124,7 +124,7 @@ echo: echo Error - Script either has LF line ending issue or an empty line at the end of the script is missing. echo: echo: -echo Help - %mas%troubleshoot +echo Check this webpage for help - %mas%troubleshoot echo: echo: ping 127.0.0.1 -n 20 >nul @@ -167,7 +167,7 @@ echo Failed to detect Windows build number. echo: setlocal EnableDelayedExpansion set fixes=%fixes% %mas%troubleshoot -call :dk_color2 %Blue% "Help - " %_Yellow% " %mas%troubleshoot" +call :dk_color2 %Blue% "Check this webpage for help - " %_Yellow% " %mas%troubleshoot" goto dk_done ) @@ -250,7 +250,7 @@ echo FullLanguage mode not found in PowerShell. Aborting... echo If you have applied restrictions on Powershell then undo those changes. echo: set fixes=%fixes% %mas%fix_powershell -call :dk_color2 %Blue% "Help - " %_Yellow% " %mas%fix_powershell" +call :dk_color2 %Blue% "Check this webpage for help - " %_Yellow% " %mas%fix_powershell" goto dk_done ) @@ -267,7 +267,7 @@ echo PowerShell is not working properly. Aborting... cmd /c "%psc% ""$av = Get-WmiObject -Namespace root\SecurityCenter2 -Class AntiVirusProduct; $n = @(); foreach ($i in $av) { if ($i.displayName -notlike '*windows*') { $n += $i.displayName } }; if ($n) { Write-Host ('Installed 3rd party Antivirus might be blocking the script - ' + ($n -join ', ')) -ForegroundColor White -BackgroundColor Blue }""" echo: set fixes=%fixes% %mas%troubleshoot -call :dk_color2 %Blue% "Help - " %_Yellow% " %mas%troubleshoot" +call :dk_color2 %Blue% "Check this webpage for help - " %_Yellow% " %mas%troubleshoot" goto dk_done ) @@ -373,7 +373,7 @@ if not exist %SysPath%\%%# ( echo [%SysPath%\%%#] file is missing, aborting... echo: set fixes=%fixes% %mas%troubleshoot -call :dk_color2 %Blue% "Help - " %_Yellow% " %mas%troubleshoot" +call :dk_color2 %Blue% "Check this webpage for help - " %_Yellow% " %mas%troubleshoot" goto dk_done ) ) @@ -419,7 +419,7 @@ echo Evaluation editions cannot be activated outside of their evaluation period. call :dk_color %Blue% "Use TSforge activation option from the main menu to reset evaluation period." echo: set fixes=%fixes% %mas%evaluation_editions -call :dk_color2 %Blue% "Help - " %_Yellow% " %mas%evaluation_editions" +call :dk_color2 %Blue% "Check this webpage for help - " %_Yellow% " %mas%evaluation_editions" goto dk_done ) ) @@ -506,7 +506,7 @@ 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" +call :dk_color2 %Blue% "Check this webpage for help - " %_Yellow% " %mas%troubleshoot" ) echo: goto dk_done @@ -685,7 +685,7 @@ findstr /i "%%#" "%SysPath%\drivers\etc\hosts" %nul1% && set "hosfail= [%%# Bloc ) call :dk_color %Red% "Checking Licensing Servers [Failed to Connect]!hosfail!" set fixes=%fixes% %mas%licensing-servers-issue -call :dk_color2 %Blue% "Help - " %_Yellow% " %mas%licensing-servers-issue" +call :dk_color2 %Blue% "Check this webpage for help - " %_Yellow% " %mas%licensing-servers-issue" ) ::========================================================================================================================================== @@ -722,7 +722,7 @@ call :dk_color %Red% "Checking Windows Update Registry [Corruption Found] if !wcount! GTR 2 ( call :dk_color %Red% "Windows seems to be infected with Mal%w%ware." set fixes=%fixes% %mas%remove_mal%w%ware -call :dk_color2 %Blue% "Help - " %_Yellow% " %mas%remove_mal%w%ware" +call :dk_color2 %Blue% "Check this webpage for help - " %_Yellow% " %mas%remove_mal%w%ware" ) else ( call :dk_color %Blue% "HWID activation needs working Windows updates, if you have used any tool to block updates, undo it." ) @@ -747,7 +747,7 @@ if not defined wucorrupt if not defined wublock if not defined wuerror if not de echo "%error_code%" | findstr /i "0x80072e 0x80072f 0x800704cf 0x87e10bcf 0x800705b4" %nul% && ( call :dk_color %Red% "Checking Internet Issues [Found] %error_code%" set fixes=%fixes% %mas%licensing-servers-issue -call :dk_color2 %Blue% "Help - " %_Yellow% " %mas%licensing-servers-issue" +call :dk_color2 %Blue% "Check this webpage for help - " %_Yellow% " %mas%licensing-servers-issue" ) ) ) @@ -765,7 +765,7 @@ call :dk_color %Blue% "Use TSforge activation option from the main menu instead. ) else ( if not defined error call :dk_color %Blue% "%_fixmsg%" set fixes=%fixes% %mas%troubleshoot -call :dk_color2 %Blue% "Help - " %_Yellow% " %mas%troubleshoot" +call :dk_color2 %Blue% "Check this webpage for help - " %_Yellow% " %mas%troubleshoot" ) ) @@ -1071,7 +1071,7 @@ echo sc start sppsvc [Error Code: %spperror%] ) echo: -%psc% "$job = Start-Job { (Get-WmiObject -Query 'SELECT * FROM %sps%').Version }; if (-not (Wait-Job $job -Timeout 30)) {write-host 'sppsvc is not working correctly. Help - %mas%troubleshoot'}" +%psc% "$job = Start-Job { (Get-WmiObject -Query 'SELECT * FROM %sps%').Version }; if (-not (Wait-Job $job -Timeout 30)) {write-host 'sppsvc is not working correctly. Check this webpage for help - %mas%troubleshoot'}" exit /b :: Get Product name (WMI/REG methods are not reliable in all conditions, hence winbrand.dll method is used) @@ -1147,7 +1147,7 @@ if defined pupfound call :dk_color %Gray% "Checking PUP Activators if defined results call :dk_color %Red% "Checking Probable Mal%w%ware Infection..." if defined results call :dk_color %Red% "%results%" set fixes=%fixes% %mas%remove_mal%w%ware -call :dk_color2 %Blue% "Help - " %_Yellow% " %mas%remove_mal%w%ware" +call :dk_color2 %Blue% "Check this webpage for help - " %_Yellow% " %mas%remove_mal%w%ware" echo: ) @@ -1267,7 +1267,7 @@ set showfix=1 ) echo %serv_e% | findstr /i "sppsvc-1060" %nul% && ( set fixes=%fixes% %mas%fix_service -call :dk_color2 %Blue% "Help - " %_Yellow% " %mas%fix_service" +call :dk_color2 %Blue% "Check this webpage for help - " %_Yellow% " %mas%fix_service" set showfix=1 ) ) @@ -1324,7 +1324,7 @@ if not defined notwinact if exist "%SystemRoot%\Servicing\Packages\Microsoft-Win reg query "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion" /v EditionID %nul2% | find /i "Eval" %nul1% || ( 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" +call :dk_color2 %Blue% "Check this webpage for help - " %_Yellow% " %mas%evaluation_editions" ) ) @@ -1454,7 +1454,7 @@ call :dk_color %Red% "Checking SkipRearm [Default 0 Value N reg query "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\SoftwareProtectionPlatform\Plugins\Objects\msft:rm/algorithm/hwid/4.0" /f ba02fed39662 /d %nul% || ( call :dk_color %Red% "Checking SPP Registry Key [Incorrect ModuleId Found]" set fixes=%fixes% %mas%issues_due_to_gaming_spoofers -call :dk_color2 %Blue% "Most likely caused by gaming spoofers. Help - " %_Yellow% " %mas%issues_due_to_gaming_spoofers" +call :dk_color2 %Blue% "Most likely caused by gaming spoofers. Check this webpage for help - " %_Yellow% " %mas%issues_due_to_gaming_spoofers" set error=1 set showfix=1 ) @@ -1469,7 +1469,7 @@ set error=1 set showfix=1 call :dk_color %Red% "Checking TokenStore Registry Key [Correct Path Not Found] [%tokenstore%]" set fixes=%fixes% %mas%troubleshoot -call :dk_color2 %Blue% "Help - " %_Yellow% " %mas%troubleshoot" +call :dk_color2 %Blue% "Check this webpage for help - " %_Yellow% " %mas%troubleshoot" ) diff --git a/MAS/Separate-Files-Version/Activators/KMS38_Activation.cmd b/MAS/Separate-Files-Version/Activators/KMS38_Activation.cmd index ff6e59d..e5ed725 100644 --- a/MAS/Separate-Files-Version/Activators/KMS38_Activation.cmd +++ b/MAS/Separate-Files-Version/Activators/KMS38_Activation.cmd @@ -112,7 +112,7 @@ echo: echo Null service is not running, script may crash... echo: echo: -echo Help - %mas%fix_service +echo Check this webpage for help - %mas%fix_service echo: echo: ping 127.0.0.1 -n 20 @@ -127,7 +127,7 @@ echo: echo Error - Script either has LF line ending issue or an empty line at the end of the script is missing. echo: echo: -echo Help - %mas%troubleshoot +echo Check this webpage for help - %mas%troubleshoot echo: echo: ping 127.0.0.1 -n 20 >nul @@ -173,7 +173,7 @@ echo Failed to detect Windows build number. echo: setlocal EnableDelayedExpansion set fixes=%fixes% %mas%troubleshoot -call :dk_color2 %Blue% "Help - " %_Yellow% " %mas%troubleshoot" +call :dk_color2 %Blue% "Check this webpage for help - " %_Yellow% " %mas%troubleshoot" goto dk_done ) @@ -253,7 +253,7 @@ echo FullLanguage mode not found in PowerShell. Aborting... echo If you have applied restrictions on Powershell then undo those changes. echo: set fixes=%fixes% %mas%fix_powershell -call :dk_color2 %Blue% "Help - " %_Yellow% " %mas%fix_powershell" +call :dk_color2 %Blue% "Check this webpage for help - " %_Yellow% " %mas%fix_powershell" goto dk_done ) @@ -270,7 +270,7 @@ echo PowerShell is not working properly. Aborting... cmd /c "%psc% ""$av = Get-WmiObject -Namespace root\SecurityCenter2 -Class AntiVirusProduct; $n = @(); foreach ($i in $av) { if ($i.displayName -notlike '*windows*') { $n += $i.displayName } }; if ($n) { Write-Host ('Installed 3rd party Antivirus might be blocking the script - ' + ($n -join ', ')) -ForegroundColor White -BackgroundColor Blue }""" echo: set fixes=%fixes% %mas%troubleshoot -call :dk_color2 %Blue% "Help - " %_Yellow% " %mas%troubleshoot" +call :dk_color2 %Blue% "Check this webpage for help - " %_Yellow% " %mas%troubleshoot" goto dk_done ) @@ -413,7 +413,7 @@ if defined _fmiss ( echo [%_fmiss%] file is missing, aborting... echo: set fixes=%fixes% %mas%troubleshoot -call :dk_color2 %Blue% "Help - " %_Yellow% " %mas%troubleshoot" +call :dk_color2 %Blue% "Check this webpage for help - " %_Yellow% " %mas%troubleshoot" goto dk_done ) @@ -470,7 +470,7 @@ echo Evaluation editions cannot be activated outside of their evaluation period. call :dk_color %Blue% "Use TSforge activation option from the main menu to reset evaluation period." echo: set fixes=%fixes% %mas%evaluation_editions -call :dk_color2 %Blue% "Help - " %_Yellow% " %mas%evaluation_editions" +call :dk_color2 %Blue% "Check this webpage for help - " %_Yellow% " %mas%evaluation_editions" ) goto dk_done ) @@ -486,7 +486,7 @@ if not exist "!_work!\clipup.exe" ( echo clipup.exe doesn't exist in Server Cor/Acor [No GUI] versions. echo The file is required for KMS38 activation. echo Check the below page for instructions on how to activate it. -call :dk_color2 %Blue% "Help - " %_Yellow% " %mas%kms38" +call :dk_color2 %Blue% "Check this webpage for help - " %_Yellow% " %mas%kms38" goto dk_done ) ) @@ -498,7 +498,7 @@ if defined a_cor ( if !errorlevel!==3 ( %eline% echo Valid digital signature not found in clipup.exe file. -call :dk_color2 %Blue% "Help - " %_Yellow% " %mas%troubleshoot" +call :dk_color2 %Blue% "Check this webpage for help - " %_Yellow% " %mas%troubleshoot" goto dk_done ) ) @@ -566,13 +566,13 @@ if exist "%SysPath%\spp\tokens\skus\%osedition%\*GVLK*.xrm-ms" set sppks=1 if defined skunotfound ( call :dk_color %Red% "Required license files not found in %SysPath%\spp\tokens\skus\" set fixes=%fixes% %mas%troubleshoot -call :dk_color2 %Blue% "Help - " %_Yellow% " %mas%troubleshoot" +call :dk_color2 %Blue% "Check this webpage for help - " %_Yellow% " %mas%troubleshoot" ) if defined sppks ( call :dk_color %Red% "KMS38 activation is supported but failed to find the key." set fixes=%fixes% %mas%troubleshoot -call :dk_color2 %Blue% "Help - " %_Yellow% " %mas%troubleshoot" +call :dk_color2 %Blue% "Check this webpage for help - " %_Yellow% " %mas%troubleshoot" ) if not defined skunotfound if not defined sppks ( @@ -622,7 +622,7 @@ if %_wmic% EQU 0 for /f "tokens=2 delims==" %%a in ('%psc% "(([WMISEARCHER]'SELE if not defined app ( call :dk_color %Red% "Checking Installed GVLK Activation ID [Not Found] Aborting..." set fixes=%fixes% %mas%troubleshoot -call :dk_color2 %Blue% "Help - " %_Yellow% " %mas%troubleshoot" +call :dk_color2 %Blue% "Check this webpage for help - " %_Yellow% " %mas%troubleshoot" goto :dk_done ) @@ -790,7 +790,7 @@ goto :k_final call :dk_color %Red% "Activation Failed" if not defined error call :dk_color %Blue% "%_fixmsg%" set fixes=%fixes% %mas%troubleshoot -call :dk_color2 %Blue% "Help - " %_Yellow% " %mas%troubleshoot" +call :dk_color2 %Blue% "Check this webpage for help - " %_Yellow% " %mas%troubleshoot" ::======================================================================================================================================== @@ -1175,7 +1175,7 @@ echo sc start sppsvc [Error Code: %spperror%] ) echo: -%psc% "$job = Start-Job { (Get-WmiObject -Query 'SELECT * FROM %sps%').Version }; if (-not (Wait-Job $job -Timeout 30)) {write-host 'sppsvc is not working correctly. Help - %mas%troubleshoot'}" +%psc% "$job = Start-Job { (Get-WmiObject -Query 'SELECT * FROM %sps%').Version }; if (-not (Wait-Job $job -Timeout 30)) {write-host 'sppsvc is not working correctly. Check this webpage for help - %mas%troubleshoot'}" exit /b :: Get Product name (WMI/REG methods are not reliable in all conditions, hence winbrand.dll method is used) @@ -1296,7 +1296,7 @@ if defined pupfound call :dk_color %Gray% "Checking PUP Activators if defined results call :dk_color %Red% "Checking Probable Mal%w%ware Infection..." if defined results call :dk_color %Red% "%results%" set fixes=%fixes% %mas%remove_mal%w%ware -call :dk_color2 %Blue% "Help - " %_Yellow% " %mas%remove_mal%w%ware" +call :dk_color2 %Blue% "Check this webpage for help - " %_Yellow% " %mas%remove_mal%w%ware" echo: ) @@ -1416,7 +1416,7 @@ set showfix=1 ) echo %serv_e% | findstr /i "sppsvc-1060" %nul% && ( set fixes=%fixes% %mas%fix_service -call :dk_color2 %Blue% "Help - " %_Yellow% " %mas%fix_service" +call :dk_color2 %Blue% "Check this webpage for help - " %_Yellow% " %mas%fix_service" set showfix=1 ) ) @@ -1473,7 +1473,7 @@ if not defined notwinact if exist "%SystemRoot%\Servicing\Packages\Microsoft-Win reg query "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion" /v EditionID %nul2% | find /i "Eval" %nul1% || ( 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" +call :dk_color2 %Blue% "Check this webpage for help - " %_Yellow% " %mas%evaluation_editions" ) ) @@ -1603,7 +1603,7 @@ call :dk_color %Red% "Checking SkipRearm [Default 0 Value N reg query "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\SoftwareProtectionPlatform\Plugins\Objects\msft:rm/algorithm/hwid/4.0" /f ba02fed39662 /d %nul% || ( call :dk_color %Red% "Checking SPP Registry Key [Incorrect ModuleId Found]" set fixes=%fixes% %mas%issues_due_to_gaming_spoofers -call :dk_color2 %Blue% "Most likely caused by gaming spoofers. Help - " %_Yellow% " %mas%issues_due_to_gaming_spoofers" +call :dk_color2 %Blue% "Most likely caused by gaming spoofers. Check this webpage for help - " %_Yellow% " %mas%issues_due_to_gaming_spoofers" set error=1 set showfix=1 ) @@ -1618,7 +1618,7 @@ set error=1 set showfix=1 call :dk_color %Red% "Checking TokenStore Registry Key [Correct Path Not Found] [%tokenstore%]" set fixes=%fixes% %mas%troubleshoot -call :dk_color2 %Blue% "Help - " %_Yellow% " %mas%troubleshoot" +call :dk_color2 %Blue% "Check this webpage for help - " %_Yellow% " %mas%troubleshoot" ) diff --git a/MAS/Separate-Files-Version/Activators/Ohook_Activation_AIO.cmd b/MAS/Separate-Files-Version/Activators/Ohook_Activation_AIO.cmd index ce9ad93..2f41448 100644 --- a/MAS/Separate-Files-Version/Activators/Ohook_Activation_AIO.cmd +++ b/MAS/Separate-Files-Version/Activators/Ohook_Activation_AIO.cmd @@ -109,7 +109,7 @@ echo: echo Null service is not running, script may crash... echo: echo: -echo Help - %mas%fix_service +echo Check this webpage for help - %mas%fix_service echo: echo: ping 127.0.0.1 -n 20 @@ -124,7 +124,7 @@ echo: echo Error - Script either has LF line ending issue or an empty line at the end of the script is missing. echo: echo: -echo Help - %mas%troubleshoot +echo Check this webpage for help - %mas%troubleshoot echo: echo: ping 127.0.0.1 -n 20 >nul @@ -167,7 +167,7 @@ echo Failed to detect Windows build number. echo: setlocal EnableDelayedExpansion set fixes=%fixes% %mas%troubleshoot -call :dk_color2 %Blue% "Help - " %_Yellow% " %mas%troubleshoot" +call :dk_color2 %Blue% "Check this webpage for help - " %_Yellow% " %mas%troubleshoot" goto dk_done ) @@ -243,7 +243,7 @@ echo FullLanguage mode not found in PowerShell. Aborting... echo If you have applied restrictions on Powershell then undo those changes. echo: set fixes=%fixes% %mas%fix_powershell -call :dk_color2 %Blue% "Help - " %_Yellow% " %mas%fix_powershell" +call :dk_color2 %Blue% "Check this webpage for help - " %_Yellow% " %mas%fix_powershell" goto dk_done ) @@ -260,7 +260,7 @@ echo PowerShell is not working properly. Aborting... cmd /c "%psc% ""$av = Get-WmiObject -Namespace root\SecurityCenter2 -Class AntiVirusProduct; $n = @(); foreach ($i in $av) { if ($i.displayName -notlike '*windows*') { $n += $i.displayName } }; if ($n) { Write-Host ('Installed 3rd party Antivirus might be blocking the script - ' + ($n -join ', ')) -ForegroundColor White -BackgroundColor Blue }""" echo: set fixes=%fixes% %mas%troubleshoot -call :dk_color2 %Blue% "Help - " %_Yellow% " %mas%troubleshoot" +call :dk_color2 %Blue% "Check this webpage for help - " %_Yellow% " %mas%troubleshoot" goto dk_done ) @@ -404,7 +404,7 @@ if not exist %SysPath%\sppsvc.exe ( echo [%SysPath%\sppsvc.exe] file is missing, aborting... echo: set fixes=%fixes% %mas%troubleshoot -call :dk_color2 %Blue% "Help - " %_Yellow% " %mas%troubleshoot" +call :dk_color2 %Blue% "Check this webpage for help - " %_Yellow% " %mas%troubleshoot" goto dk_done ) @@ -683,7 +683,7 @@ call :dk_color %Red% "Some errors were detected." if not defined ierror if not defined showfix if not defined serv_cor if not defined serv_cste call :dk_color %Blue% "%_fixmsg%" echo: set fixes=%fixes% %mas%troubleshoot -call :dk_color2 %Blue% "Help - " %_Yellow% " %mas%troubleshoot" +call :dk_color2 %Blue% "Check this webpage for help - " %_Yellow% " %mas%troubleshoot" ) goto :dk_done @@ -1506,7 +1506,7 @@ echo sc start sppsvc [Error Code: %spperror%] ) echo: -%psc% "$job = Start-Job { (Get-WmiObject -Query 'SELECT * FROM %sps%').Version }; if (-not (Wait-Job $job -Timeout 30)) {write-host 'sppsvc is not working correctly. Help - %mas%troubleshoot'}" +%psc% "$job = Start-Job { (Get-WmiObject -Query 'SELECT * FROM %sps%').Version }; if (-not (Wait-Job $job -Timeout 30)) {write-host 'sppsvc is not working correctly. Check this webpage for help - %mas%troubleshoot'}" exit /b :: Get Product name (WMI/REG methods are not reliable in all conditions, hence winbrand.dll method is used) @@ -1566,7 +1566,7 @@ if defined pupfound call :dk_color %Gray% "Checking PUP Activators if defined results call :dk_color %Red% "Checking Probable Mal%w%ware Infection..." if defined results call :dk_color %Red% "%results%" set fixes=%fixes% %mas%remove_mal%w%ware -call :dk_color2 %Blue% "Help - " %_Yellow% " %mas%remove_mal%w%ware" +call :dk_color2 %Blue% "Check this webpage for help - " %_Yellow% " %mas%remove_mal%w%ware" echo: ) @@ -1686,7 +1686,7 @@ set showfix=1 ) echo %serv_e% | findstr /i "sppsvc-1060" %nul% && ( set fixes=%fixes% %mas%fix_service -call :dk_color2 %Blue% "Help - " %_Yellow% " %mas%fix_service" +call :dk_color2 %Blue% "Check this webpage for help - " %_Yellow% " %mas%fix_service" set showfix=1 ) ) @@ -1743,7 +1743,7 @@ if not defined notwinact if exist "%SystemRoot%\Servicing\Packages\Microsoft-Win reg query "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion" /v EditionID %nul2% | find /i "Eval" %nul1% || ( 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" +call :dk_color2 %Blue% "Check this webpage for help - " %_Yellow% " %mas%evaluation_editions" ) ) @@ -1873,7 +1873,7 @@ call :dk_color %Red% "Checking SkipRearm [Default 0 Value N reg query "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\SoftwareProtectionPlatform\Plugins\Objects\msft:rm/algorithm/hwid/4.0" /f ba02fed39662 /d %nul% || ( call :dk_color %Red% "Checking SPP Registry Key [Incorrect ModuleId Found]" set fixes=%fixes% %mas%issues_due_to_gaming_spoofers -call :dk_color2 %Blue% "Most likely caused by gaming spoofers. Help - " %_Yellow% " %mas%issues_due_to_gaming_spoofers" +call :dk_color2 %Blue% "Most likely caused by gaming spoofers. Check this webpage for help - " %_Yellow% " %mas%issues_due_to_gaming_spoofers" set error=1 set showfix=1 ) @@ -1888,7 +1888,7 @@ set error=1 set showfix=1 call :dk_color %Red% "Checking TokenStore Registry Key [Correct Path Not Found] [%tokenstore%]" set fixes=%fixes% %mas%troubleshoot -call :dk_color2 %Blue% "Help - " %_Yellow% " %mas%troubleshoot" +call :dk_color2 %Blue% "Check this webpage for help - " %_Yellow% " %mas%troubleshoot" ) diff --git a/MAS/Separate-Files-Version/Activators/Online_KMS_Activation.cmd b/MAS/Separate-Files-Version/Activators/Online_KMS_Activation.cmd index f1576e0..61d6f1c 100644 --- a/MAS/Separate-Files-Version/Activators/Online_KMS_Activation.cmd +++ b/MAS/Separate-Files-Version/Activators/Online_KMS_Activation.cmd @@ -134,7 +134,7 @@ echo: echo Null service is not running, script may crash... echo: echo: -echo Help - %mas%fix_service +echo Check this webpage for help - %mas%fix_service echo: echo: ping 127.0.0.1 -n 20 @@ -149,7 +149,7 @@ echo: echo Error - Script either has LF line ending issue or an empty line at the end of the script is missing. echo: echo: -echo Help - %mas%troubleshoot +echo Check this webpage for help - %mas%troubleshoot echo: echo: ping 127.0.0.1 -n 20 >nul @@ -198,7 +198,7 @@ echo Failed to detect Windows build number. echo: setlocal EnableDelayedExpansion set fixes=%fixes% %mas%troubleshoot -call :dk_color2 %Blue% "Help - " %_Yellow% " %mas%troubleshoot" +call :dk_color2 %Blue% "Check this webpage for help - " %_Yellow% " %mas%troubleshoot" goto dk_done ) @@ -272,7 +272,7 @@ echo FullLanguage mode not found in PowerShell. Aborting... echo If you have applied restrictions on Powershell then undo those changes. echo: set fixes=%fixes% %mas%fix_powershell -call :dk_color2 %Blue% "Help - " %_Yellow% " %mas%fix_powershell" +call :dk_color2 %Blue% "Check this webpage for help - " %_Yellow% " %mas%fix_powershell" goto dk_done ) @@ -289,7 +289,7 @@ echo PowerShell is not working properly. Aborting... cmd /c "%psc% ""$av = Get-WmiObject -Namespace root\SecurityCenter2 -Class AntiVirusProduct; $n = @(); foreach ($i in $av) { if ($i.displayName -notlike '*windows*') { $n += $i.displayName } }; if ($n) { Write-Host ('Installed 3rd party Antivirus might be blocking the script - ' + ($n -join ', ')) -ForegroundColor White -BackgroundColor Blue }""" echo: set fixes=%fixes% %mas%troubleshoot -call :dk_color2 %Blue% "Help - " %_Yellow% " %mas%troubleshoot" +call :dk_color2 %Blue% "Check this webpage for help - " %_Yellow% " %mas%troubleshoot" goto dk_done ) @@ -464,7 +464,7 @@ if not exist %SysPath%\sppsvc.exe ( echo [%SysPath%\sppsvc.exe] file is missing, aborting... echo: set fixes=%fixes% %mas%troubleshoot -call :dk_color2 %Blue% "Help - " %_Yellow% " %mas%troubleshoot" +call :dk_color2 %Blue% "Check this webpage for help - " %_Yellow% " %mas%troubleshoot" goto dk_done ) @@ -557,7 +557,7 @@ call :dk_color %Blue% "Go back to main menu and use [Change Edition] option." ) else ( call :dk_color %Blue% "Use TSforge activation option from the main menu to reset evaluation period." set fixes=%fixes% %mas%evaluation_editions -call :dk_color2 %Blue% "Help - " %_Yellow% " %mas%evaluation_editions" +call :dk_color2 %Blue% "Check this webpage for help - " %_Yellow% " %mas%evaluation_editions" ) goto :ks_office @@ -607,13 +607,13 @@ if %winbuild% LSS 9200 if exist "%SysPath%\spp\tokens\skus\Security-SPP-Componen if defined skunotfound ( call :dk_color %Red% "Required license files not found in %SysPath%\spp\tokens\skus\" set fixes=%fixes% %mas%troubleshoot -call :dk_color2 %Blue% "Help - " %_Yellow% " %mas%troubleshoot" +call :dk_color2 %Blue% "Check this webpage for help - " %_Yellow% " %mas%troubleshoot" ) if defined sppks ( call :dk_color %Red% "%KS% activation is supported but failed to find the %KS% key." set fixes=%fixes% %mas%troubleshoot -call :dk_color2 %Blue% "Help - " %_Yellow% " %mas%troubleshoot" +call :dk_color2 %Blue% "Check this webpage for help - " %_Yellow% " %mas%troubleshoot" ) if not defined skunotfound if not defined sppks ( @@ -2599,7 +2599,7 @@ echo sc start sppsvc [Error Code: %spperror%] ) echo: -%psc% "$job = Start-Job { (Get-WmiObject -Query 'SELECT * FROM %sps%').Version }; if (-not (Wait-Job $job -Timeout 30)) {write-host 'sppsvc is not working correctly. Help - %mas%troubleshoot'}" +%psc% "$job = Start-Job { (Get-WmiObject -Query 'SELECT * FROM %sps%').Version }; if (-not (Wait-Job $job -Timeout 30)) {write-host 'sppsvc is not working correctly. Check this webpage for help - %mas%troubleshoot'}" exit /b :: Get Product name (WMI/REG methods are not reliable in all conditions, hence winbrand.dll method is used) @@ -2720,7 +2720,7 @@ if defined pupfound call :dk_color %Gray% "Checking PUP Activators if defined results call :dk_color %Red% "Checking Probable Mal%w%ware Infection..." if defined results call :dk_color %Red% "%results%" set fixes=%fixes% %mas%remove_mal%w%ware -call :dk_color2 %Blue% "Help - " %_Yellow% " %mas%remove_mal%w%ware" +call :dk_color2 %Blue% "Check this webpage for help - " %_Yellow% " %mas%remove_mal%w%ware" echo: ) @@ -2840,7 +2840,7 @@ set showfix=1 ) echo %serv_e% | findstr /i "sppsvc-1060" %nul% && ( set fixes=%fixes% %mas%fix_service -call :dk_color2 %Blue% "Help - " %_Yellow% " %mas%fix_service" +call :dk_color2 %Blue% "Check this webpage for help - " %_Yellow% " %mas%fix_service" set showfix=1 ) ) @@ -2897,7 +2897,7 @@ if not defined notwinact if exist "%SystemRoot%\Servicing\Packages\Microsoft-Win reg query "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion" /v EditionID %nul2% | find /i "Eval" %nul1% || ( 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" +call :dk_color2 %Blue% "Check this webpage for help - " %_Yellow% " %mas%evaluation_editions" ) ) @@ -3027,7 +3027,7 @@ call :dk_color %Red% "Checking SkipRearm [Default 0 Value N reg query "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\SoftwareProtectionPlatform\Plugins\Objects\msft:rm/algorithm/hwid/4.0" /f ba02fed39662 /d %nul% || ( call :dk_color %Red% "Checking SPP Registry Key [Incorrect ModuleId Found]" set fixes=%fixes% %mas%issues_due_to_gaming_spoofers -call :dk_color2 %Blue% "Most likely caused by gaming spoofers. Help - " %_Yellow% " %mas%issues_due_to_gaming_spoofers" +call :dk_color2 %Blue% "Most likely caused by gaming spoofers. Check this webpage for help - " %_Yellow% " %mas%issues_due_to_gaming_spoofers" set error=1 set showfix=1 ) @@ -3042,7 +3042,7 @@ set error=1 set showfix=1 call :dk_color %Red% "Checking TokenStore Registry Key [Correct Path Not Found] [%tokenstore%]" set fixes=%fixes% %mas%troubleshoot -call :dk_color2 %Blue% "Help - " %_Yellow% " %mas%troubleshoot" +call :dk_color2 %Blue% "Check this webpage for help - " %_Yellow% " %mas%troubleshoot" ) diff --git a/MAS/Separate-Files-Version/Activators/TSforge_Activation.cmd b/MAS/Separate-Files-Version/Activators/TSforge_Activation.cmd index 1cf85e9..d6bfc9a 100644 --- a/MAS/Separate-Files-Version/Activators/TSforge_Activation.cmd +++ b/MAS/Separate-Files-Version/Activators/TSforge_Activation.cmd @@ -138,7 +138,7 @@ echo: echo Null service is not running, script may crash... echo: echo: -echo Help - %mas%fix_service +echo Check this webpage for help - %mas%fix_service echo: echo: ping 127.0.0.1 -n 20 @@ -153,7 +153,7 @@ echo: echo Error - Script either has LF line ending issue or an empty line at the end of the script is missing. echo: echo: -echo Help - %mas%troubleshoot +echo Check this webpage for help - %mas%troubleshoot echo: echo: ping 127.0.0.1 -n 20 >nul @@ -204,7 +204,7 @@ echo Failed to detect Windows build number. echo: setlocal EnableDelayedExpansion set fixes=%fixes% %mas%troubleshoot -call :dk_color2 %Blue% "Help - " %_Yellow% " %mas%troubleshoot" +call :dk_color2 %Blue% "Check this webpage for help - " %_Yellow% " %mas%troubleshoot" goto dk_done ) @@ -278,7 +278,7 @@ echo FullLanguage mode not found in PowerShell. Aborting... echo If you have applied restrictions on Powershell then undo those changes. echo: set fixes=%fixes% %mas%fix_powershell -call :dk_color2 %Blue% "Help - " %_Yellow% " %mas%fix_powershell" +call :dk_color2 %Blue% "Check this webpage for help - " %_Yellow% " %mas%fix_powershell" goto dk_done ) @@ -295,7 +295,7 @@ echo PowerShell is not working properly. Aborting... cmd /c "%psc% ""$av = Get-WmiObject -Namespace root\SecurityCenter2 -Class AntiVirusProduct; $n = @(); foreach ($i in $av) { if ($i.displayName -notlike '*windows*') { $n += $i.displayName } }; if ($n) { Write-Host ('Installed 3rd party Antivirus might be blocking the script - ' + ($n -join ', ')) -ForegroundColor White -BackgroundColor Blue }""" echo: set fixes=%fixes% %mas%troubleshoot -call :dk_color2 %Blue% "Help - " %_Yellow% " %mas%troubleshoot" +call :dk_color2 %Blue% "Check this webpage for help - " %_Yellow% " %mas%troubleshoot" goto dk_done ) @@ -457,7 +457,7 @@ if not exist %SysPath%\sppsvc.exe ( echo [%SysPath%\sppsvc.exe] file is missing, aborting... echo: set fixes=%fixes% %mas%troubleshoot -call :dk_color2 %Blue% "Help - " %_Yellow% " %mas%troubleshoot" +call :dk_color2 %Blue% "Check this webpage for help - " %_Yellow% " %mas%troubleshoot" goto dk_done ) @@ -470,7 +470,7 @@ echo Install .NET Framework 4.8 and Windows Management Framework 5.1 ) echo: set fixes=%fixes% %mas%troubleshoot -call :dk_color2 %Blue% "Help - " %_Yellow% " %mas%troubleshoot" +call :dk_color2 %Blue% "Check this webpage for help - " %_Yellow% " %mas%troubleshoot" goto dk_done ) ) @@ -484,7 +484,7 @@ echo Evaluation WLMS service is running, sppsvc service can not be stopped. Abor echo Install Non-Eval version for Windows build %winbuild%. echo: set fixes=%fixes% %mas%troubleshoot -call :dk_color2 %Blue% "Help - " %_Yellow% " %mas%troubleshoot" +call :dk_color2 %Blue% "Check this webpage for help - " %_Yellow% " %mas%troubleshoot" goto dk_done ) ) @@ -523,7 +523,7 @@ call :dk_errorcheck if defined error ( call :dk_color %Red% "Some errors were detected. Aborting the operation..." set fixes=%fixes% %mas%troubleshoot -call :dk_color2 %Blue% "Help - " %_Yellow% " %mas%troubleshoot" +call :dk_color2 %Blue% "Check this webpage for help - " %_Yellow% " %mas%troubleshoot" goto :dk_done ) @@ -531,7 +531,7 @@ call :ts_getedition if not defined tsedition ( call :dk_color %Red% "Checking Windows Edition ID [Not found in installed licenses, aborting...]" set fixes=%fixes% %mas%troubleshoot -call :dk_color2 %Blue% "Help - " %_Yellow% " %mas%troubleshoot" +call :dk_color2 %Blue% "Check this webpage for help - " %_Yellow% " %mas%troubleshoot" goto :dk_done ) @@ -812,7 +812,7 @@ if %winbuild% EQU 9600 set esuavail=1 if defined esuavail ( call :dk_color %Red% "Checking Activation ID [ESU license is not found, make sure Windows is fully updated]" set fixes=%fixes% %mas%tsforge#windows-esu -call :dk_color2 %Blue% "Help - " %_Yellow% " %mas%tsforge#windows-esu" +call :dk_color2 %Blue% "Check this webpage for help - " %_Yellow% " %mas%tsforge#windows-esu" ) else ( call :dk_color %Gray% "Checking Activation ID [ESU is not available for %winos%]" ) @@ -1176,7 +1176,7 @@ echo Checking Activation ID [%%A] [%%B] if not defined ohostexist ( call :dk_color %Gray% "Checking Activation ID [Not found for Office %KS% Host]" -call :dk_color2 %Blue% "Help - " %_Yellow% " %mas%tsforge#office-kms-host" +call :dk_color2 %Blue% "Check this webpage for help - " %_Yellow% " %mas%tsforge#office-kms-host" ) echo: @@ -1242,7 +1242,7 @@ set resetstuff=1 if %errorlevel%==3 ( call :dk_color %Red% "Reset Failed." set fixes=%fixes% %mas%troubleshoot -call :dk_color2 %Blue% "Help - " %_Yellow% " %mas%troubleshoot" +call :dk_color2 %Blue% "Check this webpage for help - " %_Yellow% " %mas%troubleshoot" ) else ( call :dk_color %Green% "Reset process has been successfully done." ) @@ -1406,7 +1406,7 @@ call :dk_color %Gray% "To activate, check your internet connection and ensure th call :dk_color %Blue% "This Windows version is known to not activate due to MS Windows/Server issues." ) set fixes=%fixes% %mas%troubleshoot -call :dk_color2 %Blue% "Help - " %_Yellow% " %mas%troubleshoot" +call :dk_color2 %Blue% "Check this webpage for help - " %_Yellow% " %mas%troubleshoot" ) ) @@ -1419,7 +1419,7 @@ echo: if !errorlevel!==3 ( if %_actman%==0 call :dk_color %Blue% "%_fixmsg%" set fixes=%fixes% %mas%troubleshoot -call :dk_color2 %Blue% "Help - " %_Yellow% " %mas%troubleshoot" +call :dk_color2 %Blue% "Check this webpage for help - " %_Yellow% " %mas%troubleshoot" ) else ( echo "%tsids%" | find /i "7e94be23-b161-4956-a682-146ab291774c" %nul1% && ( call :dk_color %Gray% "Windows Update can receive 1-3 years of ESU. 4-6 years ESU is not officially supported, but you can manually install updates." @@ -1447,7 +1447,7 @@ call :dk_reeval %nul% if not defined tsids if defined error if not defined showfix ( set fixes=%fixes% %mas%troubleshoot -call :dk_color2 %Blue% "Help - " %_Yellow% " %mas%troubleshoot" +call :dk_color2 %Blue% "Check this webpage for help - " %_Yellow% " %mas%troubleshoot" ) goto :dk_done @@ -1622,7 +1622,7 @@ call :dk_color %Red% "Checking Activation ID [Office %oVer%.0 ! set error=1 set showfix=1 set fixes=%fixes% %mas%troubleshoot -call :dk_color2 %Blue% "Help - " %_Yellow% " %mas%troubleshoot" +call :dk_color2 %Blue% "Check this webpage for help - " %_Yellow% " %mas%troubleshoot" ) echo %%# | find /i "2024" %nul% && ( @@ -2199,7 +2199,7 @@ echo sc start sppsvc [Error Code: %spperror%] ) echo: -%psc% "$job = Start-Job { (Get-WmiObject -Query 'SELECT * FROM %sps%').Version }; if (-not (Wait-Job $job -Timeout 30)) {write-host 'sppsvc is not working correctly. Help - %mas%troubleshoot'}" +%psc% "$job = Start-Job { (Get-WmiObject -Query 'SELECT * FROM %sps%').Version }; if (-not (Wait-Job $job -Timeout 30)) {write-host 'sppsvc is not working correctly. Check this webpage for help - %mas%troubleshoot'}" exit /b :: Get Product name (WMI/REG methods are not reliable in all conditions, hence winbrand.dll method is used) @@ -2275,7 +2275,7 @@ if defined pupfound call :dk_color %Gray% "Checking PUP Activators if defined results call :dk_color %Red% "Checking Probable Mal%w%ware Infection..." if defined results call :dk_color %Red% "%results%" set fixes=%fixes% %mas%remove_mal%w%ware -call :dk_color2 %Blue% "Help - " %_Yellow% " %mas%remove_mal%w%ware" +call :dk_color2 %Blue% "Check this webpage for help - " %_Yellow% " %mas%remove_mal%w%ware" echo: ) @@ -2395,7 +2395,7 @@ set showfix=1 ) echo %serv_e% | findstr /i "sppsvc-1060" %nul% && ( set fixes=%fixes% %mas%fix_service -call :dk_color2 %Blue% "Help - " %_Yellow% " %mas%fix_service" +call :dk_color2 %Blue% "Check this webpage for help - " %_Yellow% " %mas%fix_service" set showfix=1 ) ) @@ -2452,7 +2452,7 @@ if not defined notwinact if exist "%SystemRoot%\Servicing\Packages\Microsoft-Win reg query "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion" /v EditionID %nul2% | find /i "Eval" %nul1% || ( 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" +call :dk_color2 %Blue% "Check this webpage for help - " %_Yellow% " %mas%evaluation_editions" ) ) @@ -2582,7 +2582,7 @@ call :dk_color %Red% "Checking SkipRearm [Default 0 Value N reg query "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\SoftwareProtectionPlatform\Plugins\Objects\msft:rm/algorithm/hwid/4.0" /f ba02fed39662 /d %nul% || ( call :dk_color %Red% "Checking SPP Registry Key [Incorrect ModuleId Found]" set fixes=%fixes% %mas%issues_due_to_gaming_spoofers -call :dk_color2 %Blue% "Most likely caused by gaming spoofers. Help - " %_Yellow% " %mas%issues_due_to_gaming_spoofers" +call :dk_color2 %Blue% "Most likely caused by gaming spoofers. Check this webpage for help - " %_Yellow% " %mas%issues_due_to_gaming_spoofers" set error=1 set showfix=1 ) @@ -2597,7 +2597,7 @@ set error=1 set showfix=1 call :dk_color %Red% "Checking TokenStore Registry Key [Correct Path Not Found] [%tokenstore%]" set fixes=%fixes% %mas%troubleshoot -call :dk_color2 %Blue% "Help - " %_Yellow% " %mas%troubleshoot" +call :dk_color2 %Blue% "Check this webpage for help - " %_Yellow% " %mas%troubleshoot" ) diff --git a/MAS/Separate-Files-Version/Change_Office_Edition.cmd b/MAS/Separate-Files-Version/Change_Office_Edition.cmd index 95d4044..32a8727 100644 --- a/MAS/Separate-Files-Version/Change_Office_Edition.cmd +++ b/MAS/Separate-Files-Version/Change_Office_Edition.cmd @@ -69,7 +69,7 @@ echo: echo Null service is not running, script may crash... echo: echo: -echo Help - %mas%fix_service +echo Check this webpage for help - %mas%fix_service echo: echo: ping 127.0.0.1 -n 20 @@ -84,7 +84,7 @@ echo: echo Error - Script either has LF line ending issue or an empty line at the end of the script is missing. echo: echo: -echo Help - %mas%troubleshoot +echo Check this webpage for help - %mas%troubleshoot echo: echo: ping 127.0.0.1 -n 20 >nul @@ -129,7 +129,7 @@ echo Failed to detect Windows build number. echo: setlocal EnableDelayedExpansion set fixes=%fixes% %mas%troubleshoot -call :dk_color2 %Blue% "Help - " %_Yellow% " %mas%troubleshoot" +call :dk_color2 %Blue% "Check this webpage for help - " %_Yellow% " %mas%troubleshoot" goto dk_done ) @@ -203,7 +203,7 @@ echo FullLanguage mode not found in PowerShell. Aborting... echo If you have applied restrictions on Powershell then undo those changes. echo: set fixes=%fixes% %mas%fix_powershell -call :dk_color2 %Blue% "Help - " %_Yellow% " %mas%fix_powershell" +call :dk_color2 %Blue% "Check this webpage for help - " %_Yellow% " %mas%fix_powershell" goto dk_done ) @@ -220,7 +220,7 @@ echo PowerShell is not working properly. Aborting... cmd /c "%psc% ""$av = Get-WmiObject -Namespace root\SecurityCenter2 -Class AntiVirusProduct; $n = @(); foreach ($i in $av) { if ($i.displayName -notlike '*windows*') { $n += $i.displayName } }; if ($n) { Write-Host ('Installed 3rd party Antivirus might be blocking the script - ' + ($n -join ', ')) -ForegroundColor White -BackgroundColor Blue }""" echo: set fixes=%fixes% %mas%troubleshoot -call :dk_color2 %Blue% "Help - " %_Yellow% " %mas%troubleshoot" +call :dk_color2 %Blue% "Check this webpage for help - " %_Yellow% " %mas%troubleshoot" goto dk_done ) @@ -319,7 +319,7 @@ if not exist %SysPath%\sppsvc.exe ( echo [%SysPath%\sppsvc.exe] file is missing. Aborting... echo: set fixes=%fixes% %mas%troubleshoot -call :dk_color2 %Blue% "Help - " %_Yellow% " %mas%troubleshoot" +call :dk_color2 %Blue% "Check this webpage for help - " %_Yellow% " %mas%troubleshoot" goto dk_done ) @@ -357,7 +357,7 @@ if %osedition%==0 ( echo Failed to detect OS Edition. Aborting... echo: set fixes=%fixes% %mas%troubleshoot -call :dk_color2 %Blue% "Help - " %_Yellow% " %mas%troubleshoot" +call :dk_color2 %Blue% "Check this webpage for help - " %_Yellow% " %mas%troubleshoot" goto dk_done ) @@ -430,7 +430,7 @@ echo which is not officially supported on your Windows build version %winbuild%. echo Aborting... echo: set fixes=%fixes% %mas%troubleshoot -call :dk_color2 %Blue% "Help - " %_Yellow% " %mas%troubleshoot" +call :dk_color2 %Blue% "Check this webpage for help - " %_Yellow% " %mas%troubleshoot" goto dk_done ) @@ -444,7 +444,7 @@ echo Unsupported Office %verchk% is installed on your Windows build version %win echo Aborting... echo: set fixes=%fixes% %mas%troubleshoot -call :dk_color2 %Blue% "Help - " %_Yellow% " %mas%troubleshoot" +call :dk_color2 %Blue% "Check this webpage for help - " %_Yellow% " %mas%troubleshoot" goto dk_done ) @@ -550,7 +550,7 @@ if not exist %SystemRoot%\Temp\%list%.txt ( echo Failed to generate available editions list. echo: set fixes=%fixes% %mas%troubleshoot -call :dk_color2 %Blue% "Help - " %_Yellow% " %mas%troubleshoot" +call :dk_color2 %Blue% "Check this webpage for help - " %_Yellow% " %mas%troubleshoot" goto :oe_goback ) @@ -615,7 +615,7 @@ if not exist %SystemRoot%\Temp\getAppIds.txt ( echo Failed to generate available apps list. echo: set fixes=%fixes% %mas%troubleshoot -call :dk_color2 %Blue% "Help - " %_Yellow% " %mas%troubleshoot" +call :dk_color2 %Blue% "Check this webpage for help - " %_Yellow% " %mas%troubleshoot" goto :oe_goback ) ) @@ -797,7 +797,7 @@ if %errorcode% EQU 0 ( call :dk_color %Gray% "Now run the Office activation option from the main menu." ) else ( set fixes=%fixes% %mas%troubleshoot -call :dk_color2 %Blue% "Help - " %_Yellow% " %mas%troubleshoot" +call :dk_color2 %Blue% "Check this webpage for help - " %_Yellow% " %mas%troubleshoot" ) call :oe_tempcleanup @@ -940,7 +940,7 @@ echo %c2rcommand% if %errorlevel% NEQ 0 ( echo: set fixes=%fixes% %mas%troubleshoot -call :dk_color2 %Blue% "Help - " %_Yellow% " %mas%troubleshoot" +call :dk_color2 %Blue% "Check this webpage for help - " %_Yellow% " %mas%troubleshoot" ) goto :oe_goback @@ -1088,7 +1088,7 @@ echo: echo %updcommand% %updcommand% echo: -echo Help - %mas%troubleshoot +echo Check this webpage for help - %mas%troubleshoot goto :oe_goback ::======================================================================================================================================== @@ -1412,7 +1412,7 @@ echo sc start sppsvc [Error Code: %spperror%] ) echo: -%psc% "$job = Start-Job { (Get-WmiObject -Query 'SELECT * FROM %sps%').Version }; if (-not (Wait-Job $job -Timeout 30)) {write-host 'sppsvc is not working correctly. Help - %mas%troubleshoot'}" +%psc% "$job = Start-Job { (Get-WmiObject -Query 'SELECT * FROM %sps%').Version }; if (-not (Wait-Job $job -Timeout 30)) {write-host 'sppsvc is not working correctly. Check this webpage for help - %mas%troubleshoot'}" exit /b :: Common lines used in PowerShell reflection code diff --git a/MAS/Separate-Files-Version/Change_Windows_Edition.cmd b/MAS/Separate-Files-Version/Change_Windows_Edition.cmd index 10a1559..2c0dbb8 100644 --- a/MAS/Separate-Files-Version/Change_Windows_Edition.cmd +++ b/MAS/Separate-Files-Version/Change_Windows_Edition.cmd @@ -74,7 +74,7 @@ echo: echo Null service is not running, script may crash... echo: echo: -echo Help - %mas%fix_service +echo Check this webpage for help - %mas%fix_service echo: echo: ping 127.0.0.1 -n 20 @@ -89,7 +89,7 @@ echo: echo Error - Script either has LF line ending issue or an empty line at the end of the script is missing. echo: echo: -echo Help - %mas%troubleshoot +echo Check this webpage for help - %mas%troubleshoot echo: echo: ping 127.0.0.1 -n 20 >nul @@ -134,7 +134,7 @@ echo Failed to detect Windows build number. echo: setlocal EnableDelayedExpansion set fixes=%fixes% %mas%troubleshoot -call :dk_color2 %Blue% "Help - " %_Yellow% " %mas%troubleshoot" +call :dk_color2 %Blue% "Check this webpage for help - " %_Yellow% " %mas%troubleshoot" goto dk_done ) @@ -208,7 +208,7 @@ echo FullLanguage mode not found in PowerShell. Aborting... echo If you have applied restrictions on Powershell then undo those changes. echo: set fixes=%fixes% %mas%fix_powershell -call :dk_color2 %Blue% "Help - " %_Yellow% " %mas%fix_powershell" +call :dk_color2 %Blue% "Check this webpage for help - " %_Yellow% " %mas%fix_powershell" goto dk_done ) @@ -225,7 +225,7 @@ echo PowerShell is not working properly. Aborting... cmd /c "%psc% ""$av = Get-WmiObject -Namespace root\SecurityCenter2 -Class AntiVirusProduct; $n = @(); foreach ($i in $av) { if ($i.displayName -notlike '*windows*') { $n += $i.displayName } }; if ($n) { Write-Host ('Installed 3rd party Antivirus might be blocking the script - ' + ($n -join ', ')) -ForegroundColor White -BackgroundColor Blue }""" echo: set fixes=%fixes% %mas%troubleshoot -call :dk_color2 %Blue% "Help - " %_Yellow% " %mas%troubleshoot" +call :dk_color2 %Blue% "Check this webpage for help - " %_Yellow% " %mas%troubleshoot" goto dk_done ) @@ -346,7 +346,7 @@ if not exist %SysPath%\%%# ( echo [%SysPath%\%%#] file is missing, aborting... echo: set fixes=%fixes% %mas%troubleshoot -call :dk_color2 %Blue% "Help - " %_Yellow% " %mas%troubleshoot" +call :dk_color2 %Blue% "Check this webpage for help - " %_Yellow% " %mas%troubleshoot" goto dk_done ) ) @@ -379,7 +379,7 @@ if not defined allapps ( echo Failed to find activation IDs. Aborting... echo: set fixes=%fixes% %mas%troubleshoot -call :dk_color2 %Blue% "Help - " %_Yellow% " %mas%troubleshoot" +call :dk_color2 %Blue% "Check this webpage for help - " %_Yellow% " %mas%troubleshoot" goto dk_done ) @@ -402,7 +402,7 @@ if not defined osedition ( echo Failed to detect OS edition, aborting... echo: set fixes=%fixes% %mas%troubleshoot -call :dk_color2 %Blue% "Help - " %_Yellow% " %mas%troubleshoot" +call :dk_color2 %Blue% "Check this webpage for help - " %_Yellow% " %mas%troubleshoot" goto dk_done ) @@ -564,7 +564,7 @@ echo [%targetedition% ^| %winbuild%] echo Failed to get product key from pkeyhelper.dll. echo: set fixes=%fixes% %mas%troubleshoot -call :dk_color2 %Blue% "Help - " %_Yellow% " %mas%troubleshoot" +call :dk_color2 %Blue% "Check this webpage for help - " %_Yellow% " %mas%troubleshoot" goto dk_done ) @@ -619,7 +619,7 @@ call :dk_color %Gray% "Reboot is required to fully change the edition." call :dk_color %Red% "[Unsuccessful] [Error Code: !keyerror!]" echo: set fixes=%fixes% %mas%troubleshoot -call :dk_color2 %Blue% "Help - " %_Yellow% " %mas%troubleshoot" +call :dk_color2 %Blue% "Check this webpage for help - " %_Yellow% " %mas%troubleshoot" ) ) @@ -700,7 +700,7 @@ echo [%targetedition% ^| %winbuild%] echo Failed to get product key from pkeyhelper.dll. echo: set fixes=%fixes% %mas%troubleshoot -call :dk_color2 %Blue% "Help - " %_Yellow% " %mas%troubleshoot" +call :dk_color2 %Blue% "Check this webpage for help - " %_Yellow% " %mas%troubleshoot" goto dk_done ) @@ -776,7 +776,7 @@ echo: call :dk_color %Blue% "In case there are errors, you should restart the system before trying again." echo: set fixes=%fixes% %mas%change_edition_issues -call :dk_color2 %Blue% "Help - " %_Yellow% " %mas%change_edition_issues" +call :dk_color2 %Blue% "Check this webpage for help - " %_Yellow% " %mas%change_edition_issues" exit /b :compresslog @@ -911,7 +911,7 @@ echo sc start sppsvc [Error Code: %spperror%] ) echo: -%psc% "$job = Start-Job { (Get-WmiObject -Query 'SELECT * FROM %sps%').Version }; if (-not (Wait-Job $job -Timeout 30)) {write-host 'sppsvc is not working correctly. Help - %mas%troubleshoot'}" +%psc% "$job = Start-Job { (Get-WmiObject -Query 'SELECT * FROM %sps%').Version }; if (-not (Wait-Job $job -Timeout 30)) {write-host 'sppsvc is not working correctly. Check this webpage for help - %mas%troubleshoot'}" exit /b :: Common lines used in PowerShell reflection code diff --git a/MAS/Separate-Files-Version/Extract_OEM_Folder.cmd b/MAS/Separate-Files-Version/Extract_OEM_Folder.cmd index 7c8c3d4..735941d 100644 --- a/MAS/Separate-Files-Version/Extract_OEM_Folder.cmd +++ b/MAS/Separate-Files-Version/Extract_OEM_Folder.cmd @@ -69,7 +69,7 @@ echo: echo Null service is not running, script may crash... echo: echo: -echo Help - %mas%fix_service +echo Check this webpage for help - %mas%fix_service echo: echo: ping 127.0.0.1 -n 20 @@ -84,7 +84,7 @@ echo: echo Error - Script either has LF line ending issue or an empty line at the end of the script is missing. echo: echo: -echo Help - %mas%troubleshoot +echo Check this webpage for help - %mas%troubleshoot echo: echo: ping 127.0.0.1 -n 20 >nul @@ -128,7 +128,7 @@ echo Failed to detect Windows build number. echo: setlocal EnableDelayedExpansion set fixes=%fixes% %mas%troubleshoot -call :dk_color2 %Blue% "Help - " %_Yellow% " %mas%troubleshoot" +call :dk_color2 %Blue% "Check this webpage for help - " %_Yellow% " %mas%troubleshoot" goto dk_done ) @@ -202,7 +202,7 @@ echo FullLanguage mode not found in PowerShell. Aborting... echo If you have applied restrictions on Powershell then undo those changes. echo: set fixes=%fixes% %mas%fix_powershell -call :dk_color2 %Blue% "Help - " %_Yellow% " %mas%fix_powershell" +call :dk_color2 %Blue% "Check this webpage for help - " %_Yellow% " %mas%fix_powershell" goto done2 ) @@ -219,7 +219,7 @@ echo PowerShell is not working properly. Aborting... cmd /c "%psc% ""$av = Get-WmiObject -Namespace root\SecurityCenter2 -Class AntiVirusProduct; $n = @(); foreach ($i in $av) { if ($i.displayName -notlike '*windows*') { $n += $i.displayName } }; if ($n) { Write-Host ('Installed 3rd party Antivirus might be blocking the script - ' + ($n -join ', ')) -ForegroundColor White -BackgroundColor Blue }""" echo: set fixes=%fixes% %mas%troubleshoot -call :dk_color2 %Blue% "Help - " %_Yellow% " %mas%troubleshoot" +call :dk_color2 %Blue% "Check this webpage for help - " %_Yellow% " %mas%troubleshoot" goto done2 ) diff --git a/MAS/Separate-Files-Version/Troubleshoot.cmd b/MAS/Separate-Files-Version/Troubleshoot.cmd index 8ce62b7..1c12499 100644 --- a/MAS/Separate-Files-Version/Troubleshoot.cmd +++ b/MAS/Separate-Files-Version/Troubleshoot.cmd @@ -69,7 +69,7 @@ echo: echo Null service is not running, script may crash... echo: echo: -echo Help - %mas%fix_service +echo Check this webpage for help - %mas%fix_service echo: echo: ping 127.0.0.1 -n 20 @@ -84,7 +84,7 @@ echo: echo Error - Script either has LF line ending issue or an empty line at the end of the script is missing. echo: echo: -echo Help - %mas%troubleshoot +echo Check this webpage for help - %mas%troubleshoot echo: echo: ping 127.0.0.1 -n 20 >nul @@ -129,7 +129,7 @@ echo Failed to detect Windows build number. echo: setlocal EnableDelayedExpansion set fixes=%fixes% %mas%troubleshoot -call :dk_color2 %Blue% "Help - " %_Yellow% " %mas%troubleshoot" +call :dk_color2 %Blue% "Check this webpage for help - " %_Yellow% " %mas%troubleshoot" goto dk_done ) @@ -203,7 +203,7 @@ echo FullLanguage mode not found in PowerShell. Aborting... echo If you have applied restrictions on Powershell then undo those changes. echo: set fixes=%fixes% %mas%fix_powershell -call :dk_color2 %Blue% "Help - " %_Yellow% " %mas%fix_powershell" +call :dk_color2 %Blue% "Check this webpage for help - " %_Yellow% " %mas%fix_powershell" goto dk_done ) @@ -220,7 +220,7 @@ echo PowerShell is not working properly. Aborting... cmd /c "%psc% ""$av = Get-WmiObject -Namespace root\SecurityCenter2 -Class AntiVirusProduct; $n = @(); foreach ($i in $av) { if ($i.displayName -notlike '*windows*') { $n += $i.displayName } }; if ($n) { Write-Host ('Installed 3rd party Antivirus might be blocking the script - ' + ($n -join ', ')) -ForegroundColor White -BackgroundColor Blue }""" echo: set fixes=%fixes% %mas%troubleshoot -call :dk_color2 %Blue% "Help - " %_Yellow% " %mas%troubleshoot" +call :dk_color2 %Blue% "Check this webpage for help - " %_Yellow% " %mas%troubleshoot" goto dk_done ) From 1e3c0aaedfab33362007458996f38ba5de4c7192 Mon Sep 17 00:00:00 2001 From: WindowsAddict Date: Sat, 12 Apr 2025 19:00:48 +0530 Subject: [PATCH 14/79] Fix MSI Office detection for Visio and few other products --- MAS/All-In-One-Version-KL/MAS_AIO.cmd | 449 +++++++----------- .../Activators/Ohook_Activation_AIO.cmd | 146 +++++- .../Activators/Online_KMS_Activation.cmd | 293 +++++++----- .../Activators/TSforge_Activation.cmd | 234 ++++----- 4 files changed, 613 insertions(+), 509 deletions(-) diff --git a/MAS/All-In-One-Version-KL/MAS_AIO.cmd b/MAS/All-In-One-Version-KL/MAS_AIO.cmd index 6581baf..39f3b77 100644 --- a/MAS/All-In-One-Version-KL/MAS_AIO.cmd +++ b/MAS/All-In-One-Version-KL/MAS_AIO.cmd @@ -2856,7 +2856,7 @@ set "_common2=%CommonProgramFiles(x86)%" for /r "%_common%\Microsoft Shared\OFFICE%oVer%\" %%f in (BRANDING.XML) do if exist "%%f" set "_oBranding=%%f" if not defined _oBranding for /r "%_common2%\Microsoft Shared\OFFICE%oVer%\" %%f in (BRANDING.XML) do if exist "%%f" set "_oBranding=%%f" -call :ohookdata getmsiprod %2 +call :msiofficedata %2 echo: echo Activating Office... [MSI ^| %_version% ^| %_oArch%] @@ -3343,17 +3343,6 @@ if %oVer%==16 (echo "%%D" | find /i "Subscription" %nul% && set _sublic=1) ) ) -if %1==getmsiprod if %oVer%==%%A ( -for /f "tokens=*" %%x in ('findstr /i /c:"%%B" "%_oBranding%"') do set "prodId=%%x" -set prodId=!prodId:"/>=! -set prodId=!prodId:~-4! -reg query "%2\Registration\{%%B}" /v ProductCode %nul2% | find /i "-!prodId!-" %nul% && ( -reg query "%2\Common\InstalledPackages" %nul2% | find /i "-!prodId!-" %nul% && ( -if defined _oIds (set _oIds=!_oIds! %%E) else (set _oIds=%%E) -) -) -) - ) ) exit /b @@ -4921,7 +4910,7 @@ set "pkeypath=%_common%\Microsoft Shared\OFFICE%oVer%\Office Setup Controller\pk set "pkeypath=%_common2%\Microsoft Shared\OFFICE%oVer%\Office Setup Controller\pkeyconfig-office.xrm-ms" ) -call :ts_msiofficedata %2 +call :msiofficedata %2 echo: echo Processing Office... [MSI ^| %_version% ^| %_oArch%] @@ -9177,147 +9166,6 @@ Office-ActID -pkeypath "$env:pkeypath" -edition "$env:_License" -keytype "$env:k ::======================================================================================================================================== -:: 1st column = Office version number -:: 2nd column = Activation ID -:: 3rd column = Edition -:: Separator = "_" - -:ts_msiofficedata - -for %%# in ( -:: Office 2013 -15_ab4d047b-97cf-4126-a69f-34df08e2f254_AccessRetail -15_259de5be-492b-44b3-9d78-9645f848f7b0_AccessRuntimeRetail -15_4374022d-56b8-48c1-9bb7-d8f2fc726343_AccessVolume -15_1b1d9bd5-12ea-4063-964c-16e7e87d6e08_ExcelRetail -15_ac1ae7fd-b949-4e04-a330-849bc40638cf_ExcelVolume -15_cfaf5356-49e3-48a8-ab3c-e729ab791250_GrooveRetail -15_4825ac28-ce41-45a7-9e6e-1fed74057601_GrooveVolume -15_c02fb62e-1cd5-4e18-ba25-e0480467ffaa_HomeBusinessPipcRetail -15_a2b90e7a-a797-4713-af90-f0becf52a1dd_HomeBusinessRetail -15_1fdfb4e4-f9c9-41c4-b055-c80daf00697d_HomeStudentARMRetail -15_ebef9f05-5273-404a-9253-c5e252f50555_HomeStudentPlusARMRetail -15_f2de350d-3028-410a-bfae-283e00b44d0e_HomeStudentRetail -15_44984381-406e-4a35-b1c3-e54f499556e2_InfoPathRetail -15_9e016989-4007-42a6-8051-64eb97110cf2_InfoPathVolume -15_9103f3ce-1084-447a-827e-d6097f68c895_LyncAcademicRetail -15_ff693bf4-0276-4ddb-bb42-74ef1a0c9f4d_LyncEntryRetail -15_fada6658-bfc6-4c4e-825a-59a89822cda8_LyncRetail -15_e1264e10-afaf-4439-a98b-256df8bb156f_LyncVolume -15_69ec9152-153b-471a-bf35-77ec88683eae_MondoRetail -15_f33485a0-310b-4b72-9a0e-b1d605510dbd_MondoVolume -15_3391e125-f6e4-4b1e-899c-a25e6092d40d_OneNoteFreeRetail -15_8b524bcc-67ea-4876-a509-45e46f6347e8_OneNoteRetail -15_b067e965-7521-455b-b9f7-c740204578a2_OneNoteVolume -15_12004b48-e6c8-4ffa-ad5a-ac8d4467765a_OutlookRetail -15_8d577c50-ae5e-47fd-a240-24986f73d503_OutlookVolume -15_5aab8561-1686-43f7-9ff5-2c861da58d17_PersonalPipcRetail -15_17e9df2d-ed91-4382-904b-4fed6a12caf0_PersonalRetail -15_31743b82-bfbc-44b6-aa12-85d42e644d5b_PowerPointRetail -15_e40dcb44-1d5c-4085-8e8f-943f33c4f004_PowerPointVolume -15_064383fa-1538-491c-859b-0ecab169a0ab_ProPlusRetail -15_2b88c4f2-ea8f-43cd-805e-4d41346e18a7_ProPlusVolume -15_4e26cac1-e15a-4467-9069-cb47b67fe191_ProfessionalPipcRetail -15_44bc70e2-fb83-4b09-9082-e5557e0c2ede_ProfessionalRetail -15_2f72340c-b555-418d-8b46-355944fe66b8_ProjectProRetail -15_ed34dc89-1c27-4ecd-8b2f-63d0f4cedc32_ProjectProVolume -15_58d95b09-6af6-453d-a976-8ef0ae0316b1_ProjectStdRetail -15_2b9e4a37-6230-4b42-bee2-e25ce86c8c7a_ProjectStdVolume -15_c3a0814a-70a4-471f-af37-2313a6331111_PublisherRetail -15_38ea49f6-ad1d-43f1-9888-99a35d7c9409_PublisherVolume -15_ba3e3833-6a7e-445a-89d0-7802a9a68588_SPDRetail -15_32255c0a-16b4-4ce2-b388-8a4267e219eb_StandardRetail -15_a24cca51-3d54-4c41-8a76-4031f5338cb2_StandardVolume -15_a56a3b37-3a35-4bbb-a036-eee5f1898eee_VisioProRetail -15_3e4294dd-a765-49bc-8dbd-cf8b62a4bd3d_VisioProVolume -15_980f9e3e-f5a8-41c8-8596-61404addf677_VisioStdRetail -15_44a1f6ff-0876-4edb-9169-dbb43101ee89_VisioStdVolume -15_191509f2-6977-456f-ab30-cf0492b1e93a_WordRetail -15_9cedef15-be37-4ff0-a08a-13a045540641_WordVolume -:: Office 365 - 15.0 version -15_742178ed-6b28-42dd-b3d7-b7c0ea78741b_O365BusinessRetail -15_a96f8dae-da54-4fad-bdc6-108da592707a_O365HomePremRetail -15_e3dacc06-3bc2-4e13-8e59-8e05f3232325_O365ProPlusRetail -15_0bc1dae4-6158-4a1c-a893-807665b934b2_O365SmallBusPremRetail -:: Office 365 - 16.0 version -16_742178ed-6b28-42dd-b3d7-b7c0ea78741b_O365BusinessRetail -16_2f5c71b4-5b7a-4005-bb68-f9fac26f2ea3_O365EduCloudRetail -16_a96f8dae-da54-4fad-bdc6-108da592707a_O365HomePremRetail -16_e3dacc06-3bc2-4e13-8e59-8e05f3232325_O365ProPlusRetail -16_0bc1dae4-6158-4a1c-a893-807665b934b2_O365SmallBusPremRetail -:: Office 2016 -16_bfa358b0-98f1-4125-842e-585fa13032e6_AccessRetail -16_9d9faf9e-d345-4b49-afce-68cb0a539c7c_AccessRuntimeRetail -16_3b2fa33f-cd5a-43a5-bd95-f49f3f546b0b_AccessVolume -16_424d52ff-7ad2-4bc7-8ac6-748d767b455d_ExcelRetail -16_685062a7-6024-42e7-8c5f-6bb9e63e697f_ExcelVolume -16_c02fb62e-1cd5-4e18-ba25-e0480467ffaa_HomeBusinessPipcRetail -16_86834d00-7896-4a38-8fae-32f20b86fa2b_HomeBusinessRetail -16_090896a0-ea98-48ac-b545-ba5da0eb0c9c_HomeStudentARMRetail -16_6bbe2077-01a4-4269-bf15-5bf4d8efc0b2_HomeStudentPlusARMRetail -16_c28acdb8-d8b3-4199-baa4-024d09e97c99_HomeStudentRetail -16_e2127526-b60c-43e0-bed1-3c9dc3d5a468_HomeStudentVNextRetail -16_69ec9152-153b-471a-bf35-77ec88683eae_MondoRetail -16_2cd0ea7e-749f-4288-a05e-567c573b2a6c_MondoVolume -16_436366de-5579-4f24-96db-3893e4400030_OneNoteFreeRetail -16_83ac4dd9-1b93-40ed-aa55-ede25bb6af38_OneNoteRetail -16_23b672da-a456-4860-a8f3-e062a501d7e8_OneNoteVolume -16_5a670809-0983-4c2d-8aad-d3c2c5b7d5d1_OutlookRetail -16_50059979-ac6f-4458-9e79-710bcb41721a_OutlookVolume -16_5aab8561-1686-43f7-9ff5-2c861da58d17_PersonalPipcRetail -16_a9f645a1-0d6a-4978-926a-abcb363b72a6_PersonalRetail -16_f32d1284-0792-49da-9ac6-deb2bc9c80b6_PowerPointRetail -16_9b4060c9-a7f5-4a66-b732-faf248b7240f_PowerPointVolume -16_de52bd50-9564-4adc-8fcb-a345c17f84f9_ProPlusRetail -16_c47456e3-265d-47b6-8ca0-c30abbd0ca36_ProPlusVolume -16_4e26cac1-e15a-4467-9069-cb47b67fe191_ProfessionalPipcRetail -16_d64edc00-7453-4301-8428-197343fafb16_ProfessionalRetail -16_2f72340c-b555-418d-8b46-355944fe66b8_ProjectProRetail -16_82f502b5-b0b0-4349-bd2c-c560df85b248_ProjectProVolume -16_16728639-a9ab-4994-b6d8-f81051e69833_ProjectProXVolume -16_58d95b09-6af6-453d-a976-8ef0ae0316b1_ProjectStdRetail -16_82e6b314-2a62-4e51-9220-61358dd230e6_ProjectStdVolume -16_431058f0-c059-44c5-b9e7-ed2dd46b6789_ProjectStdXVolume -16_6e0c1d99-c72e-4968-bcb7-ab79e03e201e_PublisherRetail -16_fcc1757b-5d5f-486a-87cf-c4d6dedb6032_PublisherVolume -16_9103f3ce-1084-447a-827e-d6097f68c895_SkypeServiceBypassRetail -16_971cd368-f2e1-49c1-aedd-330909ce18b6_SkypeforBusinessEntryRetail -16_418d2b9f-b491-4d7f-84f1-49e27cc66597_SkypeforBusinessRetail -16_03ca3b9a-0869-4749-8988-3cbc9d9f51bb_SkypeforBusinessVolume -16_4a31c291-3a12-4c64-b8ab-cd79212be45e_StandardRetail -16_0ed94aac-2234-4309-ba29-74bdbb887083_StandardVolume -16_a56a3b37-3a35-4bbb-a036-eee5f1898eee_VisioProRetail -16_295b2c03-4b1c-4221-b292-1411f468bd02_VisioProVolume -16_0594dc12-8444-4912-936a-747ca742dbdb_VisioProXVolume -16_980f9e3e-f5a8-41c8-8596-61404addf677_VisioStdRetail -16_44151c2d-c398-471f-946f-7660542e3369_VisioStdVolume -16_1d1c6879-39a3-47a5-9a6d-aceefa6a289d_VisioStdXVolume -16_cacaa1bf-da53-4c3b-9700-11738ef1c2a5_WordRetail -16_c3000759-551f-4f4a-bcac-a4b42cbf1de2_WordVolume -) do ( -for /f "tokens=1-5 delims=_" %%A in ("%%#") do ( - -if "%oVer%"=="%%A" ( -for /f "tokens=*" %%x in ('findstr /i /c:"%%B" "%_oBranding%"') do set "prodId=%%x" -set prodId=!prodId:"/>=! -set prodId=!prodId:~-4! -if "%oVer%"=="14" ( -REM Exception case for Visio because wrong primary product ID is mentioned in Branding.xml -echo %%C | find /i "Visio" %nul% && set prodId=0057 -) -reg query "%1\Registration\{%%B}" /v ProductCode %nul2% | find /i "-!prodId!-" %nul% && ( -reg query "%1\Common\InstalledPackages" %nul2% | find /i "-!prodId!-" %nul% && ( -if defined _oIds (set _oIds=!_oIds! %%C) else (set _oIds=%%C) -) -) -) - -) -) -exit /b - -::======================================================================================================================================== - :ts_getedition set tsedition= @@ -11247,7 +11095,7 @@ for /r "%_common%\Microsoft Shared\OFFICE%oVer%\" %%f in (BRANDING.XML) do if ex if not defined _oBranding for /r "%_common2%\Microsoft Shared\OFFICE%oVer%\" %%f in (BRANDING.XML) do if exist "%%f" set "_oBranding=%%f" call :ksdata getmsiprod %2 -call :ks_msiretaildata getmsiret %2 +call :msiofficedata %2 getmsiret echo: echo Processing Office... [MSI ^| %_version% ^| %_oArch%] @@ -12097,132 +11945,195 @@ exit /b :: 1st column = Office version number :: 2nd column = Activation ID -:: 3rd column = Edition -:: 4th column = Other Edition IDs if they are part of the same primary product (For reference only) +:: 3rd column = Product ID from branding.xml +:: 4th column = Edition +:: 5th column = Other Edition IDs if they are part of the same primary product (For reference only) :: Separator = "_" -:ks_msiretaildata +:: EditionID Notes: +:: For Office 2013 and later, all Edition IDs are clearly defined, and each ID corresponds to its specific licensing. + +:: In Office 2010, the situation is a bit more complicated. +:: Products typically fall into two separate categories: Volume License (VL) and Non-VL. This is because a single installation cannot include both Retail and VL licensing types. +:: Some Edition IDs share the same primary product ID. For example, installing ProPlusVL also installs ProPlusAcadVL licenses, as both use 0011 as the primary product ID. +:: Therefore, in the script, we grouped VL and Non-VL versions by primary product ID and selected the highest Edition ID when multiple Edition IDs existed for the same primary product ID. + +:: There are a few exceptions to this 2010 rule: Visio (Premium, Pro, Standard) and OEM-SingleImage. + +:: For Visio, the issue is that branding.xml lists incorrect primary product IDs. The correct primary product ID for all three Visio variants is 0057. Based on the criteria above, we chose Visio-Premium as the representative Edition ID among the three. +:: For OEM-SingleImage, it installs multiple Edition IDs and uses 003D as the primary product ID. Following our method, we selected the highest available Edition ID—ProfessionalR in this case. + +:msiofficedata for %%# in ( -:: Office 2010 -14_4d463c2c-0505-4626-8cdb-a4da82e2d8ed_AccessR -14_745fb377-0a59-4ca9-b9a9-c359557a2c4e_AccessRuntimeR -14_4eaff0d0-c6cb-4187-94f3-c7656d49a0aa_ExcelR -14_7004b7f0-6407-4f45-8eac-966e5f868bde_GrooveR -14_7b7d1f17-fdcb-4820-9789-9bec6e377821_HomeBusinessR_[HomeBusinessDemoR] -14_19316117-30a8-4773-8fd9-7f7231f4e060_HomeBusinessSubR -14_09e2d37e-474b-4121-8626-58ad9be5776f_HomeStudentR_[HomeStudentDemoR] -14_c3ae020c-5a71-4cc5-a27a-2a97c2d46860_HSExcelR -14_25fe4611-b44d-49cc-ae87-2143d299194e_HSOneNoteR -14_d652ad8d-da5c-4358-b928-7fb1b4de7a7c_HSPowerPointR -14_a963d7ae-7a88-41a7-94da-8bb5635a8af9_HSWordR -14_ef1da464-01c8-43a6-91af-e4e5713744f9_InfoPathR -14_14f5946a-debc-4716-babc-7e2c240fec08_MondoR -14_c1ceda8b-c578-4d5d-a4aa-23626be4e234_OEM -14_3f7aa693-9a7e-44fc-9309-bb3d8e604925_OneNoteR -14_fbf4ac36-31c8-4340-8666-79873129cf40_OutlookR -14_acb51361-c0db-4895-9497-1831c41f31a6_PersonalR_[PersonalDemoR,PersonalPrepaidR] -14_133c8359-4e93-4241-8118-30bb18737ea0_PowerPointR -14_8b559c37-0117-413e-921b-b853aeb6e210_ProfessionalR_[ProfessionalAcadR,ProfessionalDemoR] -14_725714d7-d58f-4d12-9fa8-35873c6f7215_ProjectProR_[ProjectProMSDNR] -14_4d06f72e-fd50-4bc2-a24b-d448d7f17ef2_ProjectProSubR -14_688f6589-2bd9-424e-a152-b13f36aa6de1_ProjectStdR -14_71af7e84-93e6-4363-9b69-699e04e74071_ProPlusR_[ProPlusAcadR,ProPlusMSDNR,Sub4R] -14_e98ef0c0-71c4-42ce-8305-287d8721e26c_ProPlusSubR -14_98677603-a668-4fa4-9980-3f1f05f78f69_PublisherR -14_dbe3aee0-5183-4ff7-8142-66050173cb01_SmallBusBasicsR_[SmallBusBasicsMSDNR] -14_b78df69e-0966-40b1-ae85-30a5134dedd0_SPDR -14_d3422cfb-8d8b-4ead-99f9-eab0ccd990d7_StandardR -14_2745e581-565a-4670-ae90-6bf7c57ffe43_StarterR -14_66cad568-c2dc-459d-93ec-2f3cb967ee34_VisioSIR_Prem[Pro,Std] -14_db3bbc9c-ce52-41d1-a46f-1a1d68059119_WordR +14_4d463c2c-0505-4626-8cdb-a4da82e2d8ed_0015_AccessR +14_745fb377-0a59-4ca9-b9a9-c359557a2c4e_001C_AccessRuntimeR +14_95ab3ec8-4106-4f9d-b632-03c019d1d23f_0015_AccessVL +14_4eaff0d0-c6cb-4187-94f3-c7656d49a0aa_0016_ExcelR +14_71dc86ff-f056-40d0-8ffb-9592705c9b76_0016_ExcelVL +14_7004b7f0-6407-4f45-8eac-966e5f868bde_00BA_GrooveR +14_fdad0dfa-417d-4b4f-93e4-64ea8867b7fd_00BA_GrooveVL +14_7b7d1f17-fdcb-4820-9789-9bec6e377821_0013_HomeBusinessR_[HomeBusinessDemoR] +14_19316117-30a8-4773-8fd9-7f7231f4e060_011E_HomeBusinessSubR +14_09e2d37e-474b-4121-8626-58ad9be5776f_002F_HomeStudentR_[HomeStudentDemoR] +14_c3ae020c-5a71-4cc5-a27a-2a97c2d46860_0029_HSExcelR +14_25fe4611-b44d-49cc-ae87-2143d299194e_00A3_HSOneNoteR +14_d652ad8d-da5c-4358-b928-7fb1b4de7a7c_0037_HSPowerPointR +14_a963d7ae-7a88-41a7-94da-8bb5635a8af9_002B_HSWordR +14_ef1da464-01c8-43a6-91af-e4e5713744f9_0044_InfoPathR +14_85e22450-b741-430c-a172-a37962c938af_0044_InfoPathVL +14_14f5946a-debc-4716-babc-7e2c240fec08_000F_MondoR +14_533b656a-4425-480b-8e30-1a2358898350_000F_MondoVL +14_c1ceda8b-c578-4d5d-a4aa-23626be4e234_003D_ProfessionalR_[OEM-SingleImage]Exception +14_3f7aa693-9a7e-44fc-9309-bb3d8e604925_00A1_OneNoteR +14_6860b31f-6a67-48b8-84b9-e312b3485c4b_00A1_OneNoteVL +14_fbf4ac36-31c8-4340-8666-79873129cf40_001A_OutlookR +14_a9aeabd8-63b8-4079-a28e-f531807fd6b8_001A_OutlookVL +14_acb51361-c0db-4895-9497-1831c41f31a6_0033_PersonalR_[PersonalDemoR,PersonalPrepaidR] +14_133c8359-4e93-4241-8118-30bb18737ea0_0018_PowerPointR +14_38252940-718c-4aa6-81a4-135398e53851_0018_PowerPointVL +14_8b559c37-0117-413e-921b-b853aeb6e210_0014_ProfessionalR_[ProfessionalAcadR,ProfessionalDemoR] +14_725714d7-d58f-4d12-9fa8-35873c6f7215_003B_ProjectProR_[ProjectProMSDNR] +14_4d06f72e-fd50-4bc2-a24b-d448d7f17ef2_011F_ProjectProSubR +14_1cf57a59-c532-4e56-9a7d-ffa2fe94b474_003B_ProjectProVL +14_688f6589-2bd9-424e-a152-b13f36aa6de1_003A_ProjectStdR +14_11b39439-6b93-4642-9570-f2eb81be2238_003A_ProjectStdVL +14_71af7e84-93e6-4363-9b69-699e04e74071_0011_ProPlusR_[ProPlusAcadR,ProPlusMSDNR,Sub4R] +14_e98ef0c0-71c4-42ce-8305-287d8721e26c_011D_ProPlusSubR +14_fdf3ecb9-b56f-43b2-a9b8-1b48b6bae1a7_0011_ProPlusVL_[ProPlusAcadVL] +14_98677603-a668-4fa4-9980-3f1f05f78f69_0019_PublisherR +14_3d014759-b128-4466-9018-e80f6320d9d0_0019_PublisherVL +14_dbe3aee0-5183-4ff7-8142-66050173cb01_008B_SmallBusBasicsR_[SmallBusBasicsMSDNR] +14_8090771e-d41a-4482-929e-de87f1f47e46_008B_SmallBusBasicsVL +14_b78df69e-0966-40b1-ae85-30a5134dedd0_0017_SPDR +14_d3422cfb-8d8b-4ead-99f9-eab0ccd990d7_0012_StandardR +14_1f76e346-e0be-49bc-9954-70ec53a4fcfe_0012_StandardVL_[StandardAcadVL] +14_2745e581-565a-4670-ae90-6bf7c57ffe43_0066_StarterR +14_66cad568-c2dc-459d-93ec-2f3cb967ee34_0057_VisioSIR_Prem[Pro,Std]Exception +14_36756cb8-8e69-4d11-9522-68899507cd6a_0057_VisioSIVL_Prem[Pro,Std]Exception +14_db3bbc9c-ce52-41d1-a46f-1a1d68059119_001B_WordR +14_98d4050e-9c98-49bf-9be1-85e12eb3ab13_001B_WordVL :: Office 2013 -15_ab4d047b-97cf-4126-a69f-34df08e2f254_AccessRetail -15_259de5be-492b-44b3-9d78-9645f848f7b0_AccessRuntimeRetail -15_1b1d9bd5-12ea-4063-964c-16e7e87d6e08_ExcelRetail -15_cfaf5356-49e3-48a8-ab3c-e729ab791250_GrooveRetail -15_c02fb62e-1cd5-4e18-ba25-e0480467ffaa_HomeBusinessPipcRetail -15_a2b90e7a-a797-4713-af90-f0becf52a1dd_HomeBusinessRetail -15_1fdfb4e4-f9c9-41c4-b055-c80daf00697d_HomeStudentARMRetail -15_ebef9f05-5273-404a-9253-c5e252f50555_HomeStudentPlusARMRetail -15_f2de350d-3028-410a-bfae-283e00b44d0e_HomeStudentRetail -15_44984381-406e-4a35-b1c3-e54f499556e2_InfoPathRetail -15_9103f3ce-1084-447a-827e-d6097f68c895_LyncAcademicRetail -15_ff693bf4-0276-4ddb-bb42-74ef1a0c9f4d_LyncEntryRetail -15_fada6658-bfc6-4c4e-825a-59a89822cda8_LyncRetail -15_69ec9152-153b-471a-bf35-77ec88683eae_MondoRetail -15_3391e125-f6e4-4b1e-899c-a25e6092d40d_OneNoteFreeRetail -15_8b524bcc-67ea-4876-a509-45e46f6347e8_OneNoteRetail -15_12004b48-e6c8-4ffa-ad5a-ac8d4467765a_OutlookRetail -15_5aab8561-1686-43f7-9ff5-2c861da58d17_PersonalPipcRetail -15_17e9df2d-ed91-4382-904b-4fed6a12caf0_PersonalRetail -15_31743b82-bfbc-44b6-aa12-85d42e644d5b_PowerPointRetail -15_064383fa-1538-491c-859b-0ecab169a0ab_ProPlusRetail -15_4e26cac1-e15a-4467-9069-cb47b67fe191_ProfessionalPipcRetail -15_44bc70e2-fb83-4b09-9082-e5557e0c2ede_ProfessionalRetail -15_2f72340c-b555-418d-8b46-355944fe66b8_ProjectProRetail -15_58d95b09-6af6-453d-a976-8ef0ae0316b1_ProjectStdRetail -15_c3a0814a-70a4-471f-af37-2313a6331111_PublisherRetail -15_ba3e3833-6a7e-445a-89d0-7802a9a68588_SPDRetail -15_32255c0a-16b4-4ce2-b388-8a4267e219eb_StandardRetail -15_a56a3b37-3a35-4bbb-a036-eee5f1898eee_VisioProRetail -15_980f9e3e-f5a8-41c8-8596-61404addf677_VisioStdRetail -15_191509f2-6977-456f-ab30-cf0492b1e93a_WordRetail +15_ab4d047b-97cf-4126-a69f-34df08e2f254_0015_AccessRetail +15_259de5be-492b-44b3-9d78-9645f848f7b0_001C_AccessRuntimeRetail +15_4374022d-56b8-48c1-9bb7-d8f2fc726343_0015_AccessVolume +15_1b1d9bd5-12ea-4063-964c-16e7e87d6e08_0016_ExcelRetail +15_ac1ae7fd-b949-4e04-a330-849bc40638cf_0016_ExcelVolume +15_cfaf5356-49e3-48a8-ab3c-e729ab791250_00BA_GrooveRetail +15_4825ac28-ce41-45a7-9e6e-1fed74057601_00BA_GrooveVolume +15_c02fb62e-1cd5-4e18-ba25-e0480467ffaa_00E7_HomeBusinessPipcRetail +15_cd256150-a898-441f-aac0-9f8f33390e45_0013_HomeBusinessRetail +15_1fdfb4e4-f9c9-41c4-b055-c80daf00697d_00CE_HomeStudentARMRetail +15_ebef9f05-5273-404a-9253-c5e252f50555_00DA_HomeStudentPlusARMRetail +15_98685d21-78bd-4c62-bc4f-653344a63035_002F_HomeStudentRetail +15_44984381-406e-4a35-b1c3-e54f499556e2_0044_InfoPathRetail +15_9e016989-4007-42a6-8051-64eb97110cf2_0044_InfoPathVolume +15_9103f3ce-1084-447a-827e-d6097f68c895_00EA_LyncAcademicRetail +15_ff693bf4-0276-4ddb-bb42-74ef1a0c9f4d_012D_LyncEntryRetail +15_fada6658-bfc6-4c4e-825a-59a89822cda8_012C_LyncRetail +15_e1264e10-afaf-4439-a98b-256df8bb156f_012C_LyncVolume +15_3169c8df-f659-4f95-9cc6-3115e6596e83_000F_MondoRetail +15_f33485a0-310b-4b72-9a0e-b1d605510dbd_000F_MondoVolume +15_3391e125-f6e4-4b1e-899c-a25e6092d40d_00A1_OneNoteFreeRetail +15_8b524bcc-67ea-4876-a509-45e46f6347e8_00A1_OneNoteRetail +15_b067e965-7521-455b-b9f7-c740204578a2_00A1_OneNoteVolume +15_12004b48-e6c8-4ffa-ad5a-ac8d4467765a_001A_OutlookRetail +15_8d577c50-ae5e-47fd-a240-24986f73d503_001A_OutlookVolume +15_5aab8561-1686-43f7-9ff5-2c861da58d17_00E6_PersonalPipcRetail +15_17e9df2d-ed91-4382-904b-4fed6a12caf0_0033_PersonalRetail +15_31743b82-bfbc-44b6-aa12-85d42e644d5b_0018_PowerPointRetail +15_e40dcb44-1d5c-4085-8e8f-943f33c4f004_0018_PowerPointVolume +15_4e26cac1-e15a-4467-9069-cb47b67fe191_00E8_ProfessionalPipcRetail +15_44bc70e2-fb83-4b09-9082-e5557e0c2ede_0014_ProfessionalRetail +15_f2435de4-5fc0-4e5b-ac97-34f515ec5ee7_003B_ProjectProRetail +15_ed34dc89-1c27-4ecd-8b2f-63d0f4cedc32_003B_ProjectProVolume +15_5517e6a2-739b-4822-946f-7f0f1c5934b1_003A_ProjectStdRetail +15_2b9e4a37-6230-4b42-bee2-e25ce86c8c7a_003A_ProjectStdVolume +15_064383fa-1538-491c-859b-0ecab169a0ab_0011_ProPlusRetail +15_2b88c4f2-ea8f-43cd-805e-4d41346e18a7_0011_ProPlusVolume +15_c3a0814a-70a4-471f-af37-2313a6331111_0019_PublisherRetail +15_38ea49f6-ad1d-43f1-9888-99a35d7c9409_0019_PublisherVolume +15_ba3e3833-6a7e-445a-89d0-7802a9a68588_0017_SPDRetail +15_32255c0a-16b4-4ce2-b388-8a4267e219eb_0012_StandardRetail +15_a24cca51-3d54-4c41-8a76-4031f5338cb2_0012_StandardVolume +15_15d12ad4-622d-4257-976c-5eb3282fb93d_0051_VisioProRetail +15_3e4294dd-a765-49bc-8dbd-cf8b62a4bd3d_0051_VisioProVolume +15_dae597ce-5823-4c77-9580-7268b93a4b23_0053_VisioStdRetail +15_44a1f6ff-0876-4edb-9169-dbb43101ee89_0053_VisioStdVolume +15_191509f2-6977-456f-ab30-cf0492b1e93a_001B_WordRetail +15_9cedef15-be37-4ff0-a08a-13a045540641_001B_WordVolume :: Office 365 - 15.0 version -15_6337137e-7c07-4197-8986-bece6a76fc33_O365BusinessRetail -15_537ea5b5-7d50-4876-bd38-a53a77caca32_O365HomePremRetail -15_149dbce7-a48e-44db-8364-a53386cd4580_O365ProPlusRetail -15_bacd4614-5bef-4a5e-bafc-de4c788037a2_O365SmallBusPremRetail +15_befee371-a2f5-4648-85db-a2c55fdf324c_00E9_O365BusinessRetail +15_537ea5b5-7d50-4876-bd38-a53a77caca32_00D6_O365HomePremRetail +15_149dbce7-a48e-44db-8364-a53386cd4580_00D4_O365ProPlusRetail +15_bacd4614-5bef-4a5e-bafc-de4c788037a2_00D5_O365SmallBusPremRetail :: Office 365 - 16.0 version -16_6337137e-7c07-4197-8986-bece6a76fc33_O365BusinessRetail -16_2f5c71b4-5b7a-4005-bb68-f9fac26f2ea3_O365EduCloudRetail -16_537ea5b5-7d50-4876-bd38-a53a77caca32_O365HomePremRetail -16_149dbce7-a48e-44db-8364-a53386cd4580_O365ProPlusRetail -16_bacd4614-5bef-4a5e-bafc-de4c788037a2_O365SmallBusPremRetail +16_6337137e-7c07-4197-8986-bece6a76fc33_00E9_O365BusinessRetail +16_2f5c71b4-5b7a-4005-bb68-f9fac26f2ea3_00D6_O365EduCloudRetail +16_537ea5b5-7d50-4876-bd38-a53a77caca32_00D6_O365HomePremRetail +16_149dbce7-a48e-44db-8364-a53386cd4580_00D4_O365ProPlusRetail +16_bacd4614-5bef-4a5e-bafc-de4c788037a2_00D5_O365SmallBusPremRetail :: Office 2016 -16_bfa358b0-98f1-4125-842e-585fa13032e6_AccessRetail -16_9d9faf9e-d345-4b49-afce-68cb0a539c7c_AccessRuntimeRetail -16_424d52ff-7ad2-4bc7-8ac6-748d767b455d_ExcelRetail -16_c02fb62e-1cd5-4e18-ba25-e0480467ffaa_HomeBusinessPipcRetail -16_86834d00-7896-4a38-8fae-32f20b86fa2b_HomeBusinessRetail -16_c28acdb8-d8b3-4199-baa4-024d09e97c99_HomeStudentRetail -16_090896a0-ea98-48ac-b545-ba5da0eb0c9c_HomeStudentARMRetail -16_6bbe2077-01a4-4269-bf15-5bf4d8efc0b2_HomeStudentPlusARMRetail -16_e2127526-b60c-43e0-bed1-3c9dc3d5a468_HomeStudentVNextRetail -16_69ec9152-153b-471a-bf35-77ec88683eae_MondoRetail -16_436366de-5579-4f24-96db-3893e4400030_OneNoteFreeRetail -16_83ac4dd9-1b93-40ed-aa55-ede25bb6af38_OneNoteRetail -16_5a670809-0983-4c2d-8aad-d3c2c5b7d5d1_OutlookRetail -16_5aab8561-1686-43f7-9ff5-2c861da58d17_PersonalPipcRetail -16_a9f645a1-0d6a-4978-926a-abcb363b72a6_PersonalRetail -16_f32d1284-0792-49da-9ac6-deb2bc9c80b6_PowerPointRetail -16_de52bd50-9564-4adc-8fcb-a345c17f84f9_ProPlusRetail -16_4e26cac1-e15a-4467-9069-cb47b67fe191_ProfessionalPipcRetail -16_d64edc00-7453-4301-8428-197343fafb16_ProfessionalRetail -16_2f72340c-b555-418d-8b46-355944fe66b8_ProjectProRetail -16_58d95b09-6af6-453d-a976-8ef0ae0316b1_ProjectStdRetail -16_6e0c1d99-c72e-4968-bcb7-ab79e03e201e_PublisherRetail -16_9103f3ce-1084-447a-827e-d6097f68c895_SkypeServiceBypassRetail -16_971cd368-f2e1-49c1-aedd-330909ce18b6_SkypeforBusinessEntryRetail -16_418d2b9f-b491-4d7f-84f1-49e27cc66597_SkypeforBusinessRetail -16_4a31c291-3a12-4c64-b8ab-cd79212be45e_StandardRetail -16_a56a3b37-3a35-4bbb-a036-eee5f1898eee_VisioProRetail -16_980f9e3e-f5a8-41c8-8596-61404addf677_VisioStdRetail -16_cacaa1bf-da53-4c3b-9700-11738ef1c2a5_WordRetail +16_bfa358b0-98f1-4125-842e-585fa13032e6_0015_AccessRetail +16_9d9faf9e-d345-4b49-afce-68cb0a539c7c_001C_AccessRuntimeRetail +16_3b2fa33f-cd5a-43a5-bd95-f49f3f546b0b_0015_AccessVolume +16_424d52ff-7ad2-4bc7-8ac6-748d767b455d_0016_ExcelRetail +16_685062a7-6024-42e7-8c5f-6bb9e63e697f_0016_ExcelVolume +16_c02fb62e-1cd5-4e18-ba25-e0480467ffaa_00E7_HomeBusinessPipcRetail +16_86834d00-7896-4a38-8fae-32f20b86fa2b_0013_HomeBusinessRetail +16_090896a0-ea98-48ac-b545-ba5da0eb0c9c_00CE_HomeStudentARMRetail +16_6bbe2077-01a4-4269-bf15-5bf4d8efc0b2_00DA_HomeStudentPlusARMRetail +16_c28acdb8-d8b3-4199-baa4-024d09e97c99_002F_HomeStudentRetail +16_e2127526-b60c-43e0-bed1-3c9dc3d5a468_002F_HomeStudentVNextRetail +16_b21367df-9545-4f02-9f24-240691da0e58_000F_MondoRetail +16_2cd0ea7e-749f-4288-a05e-567c573b2a6c_000F_MondoVolume +16_436366de-5579-4f24-96db-3893e4400030_00A3_OneNoteFreeRetail +16_83ac4dd9-1b93-40ed-aa55-ede25bb6af38_00A1_OneNoteRetail +16_23b672da-a456-4860-a8f3-e062a501d7e8_00A1_OneNoteVolume +16_5a670809-0983-4c2d-8aad-d3c2c5b7d5d1_001A_OutlookRetail +16_50059979-ac6f-4458-9e79-710bcb41721a_001A_OutlookVolume +16_5aab8561-1686-43f7-9ff5-2c861da58d17_00E6_PersonalPipcRetail +16_a9f645a1-0d6a-4978-926a-abcb363b72a6_0033_PersonalRetail +16_f32d1284-0792-49da-9ac6-deb2bc9c80b6_0018_PowerPointRetail +16_9b4060c9-a7f5-4a66-b732-faf248b7240f_0018_PowerPointVolume +16_4e26cac1-e15a-4467-9069-cb47b67fe191_00E8_ProfessionalPipcRetail +16_d64edc00-7453-4301-8428-197343fafb16_0014_ProfessionalRetail +16_0f42f316-00b1-48c5-ada4-2f52b5720ad0_003B_ProjectProRetail +16_82f502b5-b0b0-4349-bd2c-c560df85b248_003B_ProjectProVolume +16_16728639-a9ab-4994-b6d8-f81051e69833_003B_ProjectProXVolume +16_e9f0b3fc-962f-4944-ad06-05c10b6bcd5e_003A_ProjectStdRetail +16_82e6b314-2a62-4e51-9220-61358dd230e6_003A_ProjectStdVolume +16_431058f0-c059-44c5-b9e7-ed2dd46b6789_003A_ProjectStdXVolume +16_de52bd50-9564-4adc-8fcb-a345c17f84f9_0011_ProPlusRetail +16_c47456e3-265d-47b6-8ca0-c30abbd0ca36_0011_ProPlusVolume +16_6e0c1d99-c72e-4968-bcb7-ab79e03e201e_0019_PublisherRetail +16_fcc1757b-5d5f-486a-87cf-c4d6dedb6032_0019_PublisherVolume +16_971cd368-f2e1-49c1-aedd-330909ce18b6_012D_SkypeforBusinessEntryRetail +16_418d2b9f-b491-4d7f-84f1-49e27cc66597_012C_SkypeforBusinessRetail +16_03ca3b9a-0869-4749-8988-3cbc9d9f51bb_012C_SkypeforBusinessVolume +16_9103f3ce-1084-447a-827e-d6097f68c895_012C_SkypeServiceBypassRetail +16_4a31c291-3a12-4c64-b8ab-cd79212be45e_0012_StandardRetail +16_0ed94aac-2234-4309-ba29-74bdbb887083_0012_StandardVolume +16_2dfe2075-2d04-4e43-816a-eb60bbb77574_0051_VisioProRetail +16_295b2c03-4b1c-4221-b292-1411f468bd02_0051_VisioProVolume +16_0594dc12-8444-4912-936a-747ca742dbdb_0051_VisioProXVolume +16_c76dbcbc-d71b-4f45-b5b3-b7494cb4e23e_0053_VisioStdRetail +16_44151c2d-c398-471f-946f-7660542e3369_0053_VisioStdVolume +16_1d1c6879-39a3-47a5-9a6d-aceefa6a289d_0053_VisioStdXVolume +16_cacaa1bf-da53-4c3b-9700-11738ef1c2a5_001B_WordRetail +16_c3000759-551f-4f4a-bcac-a4b42cbf1de2_001B_WordVolume ) do ( for /f "tokens=1-5 delims=_" %%A in ("%%#") do ( -if %1==getmsiret if "%oVer%"=="%%A" ( -for /f "tokens=*" %%x in ('findstr /i /c:"%%B" "%_oBranding%"') do set "prodId=%%x" -set prodId=!prodId:"/>=! -set prodId=!prodId:~-4! -if "%oVer%"=="14" ( -REM Exception case for Visio because wrong primary product ID is mentioned in Branding.xml -echo %%C | find /i "Visio" %nul% && set prodId=0057 +set getIds=1 +if "%oVer%"=="%%A" ( +if /i "%2"=="getmsiret" (echo %%D | findstr /i "Volume VL" %nul% && set getIds=) + +if defined getIds ( +reg query "%1\Registration\{%%B}" /v ProductCode %nul2% | find /i "-%%C-" %nul% && ( +reg query "%1\Common\InstalledPackages" %nul2% | find /i "-%%C-" %nul% && ( +if defined _oIds (set _oIds=!_oIds! %%D) else (set _oIds=%%D) ) -reg query "%2\Registration\{%%B}" /v ProductCode %nul2% | find /i "-!prodId!-" %nul% && ( -reg query "%2\Common\InstalledPackages" %nul2% | find /i "-!prodId!-" %nul% && ( -if defined _oIds (set _oIds=!_oIds! %%C) else (set _oIds=%%C) ) ) ) diff --git a/MAS/Separate-Files-Version/Activators/Ohook_Activation_AIO.cmd b/MAS/Separate-Files-Version/Activators/Ohook_Activation_AIO.cmd index 2f41448..8a3ccb0 100644 --- a/MAS/Separate-Files-Version/Activators/Ohook_Activation_AIO.cmd +++ b/MAS/Separate-Files-Version/Activators/Ohook_Activation_AIO.cmd @@ -1071,7 +1071,7 @@ set "_common2=%CommonProgramFiles(x86)%" for /r "%_common%\Microsoft Shared\OFFICE%oVer%\" %%f in (BRANDING.XML) do if exist "%%f" set "_oBranding=%%f" if not defined _oBranding for /r "%_common2%\Microsoft Shared\OFFICE%oVer%\" %%f in (BRANDING.XML) do if exist "%%f" set "_oBranding=%%f" -call :ohookdata getmsiprod %2 +call :msiofficedata %2 echo: echo Activating Office... [MSI ^| %_version% ^| %_oArch%] @@ -2338,13 +2338,143 @@ if %oVer%==16 (echo "%%D" | find /i "Subscription" %nul% && set _sublic=1) ) ) -if %1==getmsiprod if %oVer%==%%A ( -for /f "tokens=*" %%x in ('findstr /i /c:"%%B" "%_oBranding%"') do set "prodId=%%x" -set prodId=!prodId:"/>=! -set prodId=!prodId:~-4! -reg query "%2\Registration\{%%B}" /v ProductCode %nul2% | find /i "-!prodId!-" %nul% && ( -reg query "%2\Common\InstalledPackages" %nul2% | find /i "-!prodId!-" %nul% && ( -if defined _oIds (set _oIds=!_oIds! %%E) else (set _oIds=%%E) +) +) +exit /b + +::======================================================================================================================================== + +:: 1st column = Office version number +:: 2nd column = Activation ID +:: 3rd column = Product ID from branding.xml +:: 4th column = Edition +:: 5th column = Other Edition IDs if they are part of the same primary product (For reference only) +:: Separator = "_" + +:msiofficedata + +for %%# in ( +:: Office 2013 +15_ab4d047b-97cf-4126-a69f-34df08e2f254_0015_AccessRetail +15_259de5be-492b-44b3-9d78-9645f848f7b0_001C_AccessRuntimeRetail +15_4374022d-56b8-48c1-9bb7-d8f2fc726343_0015_AccessVolume +15_1b1d9bd5-12ea-4063-964c-16e7e87d6e08_0016_ExcelRetail +15_ac1ae7fd-b949-4e04-a330-849bc40638cf_0016_ExcelVolume +15_cfaf5356-49e3-48a8-ab3c-e729ab791250_00BA_GrooveRetail +15_4825ac28-ce41-45a7-9e6e-1fed74057601_00BA_GrooveVolume +15_c02fb62e-1cd5-4e18-ba25-e0480467ffaa_00E7_HomeBusinessPipcRetail +15_cd256150-a898-441f-aac0-9f8f33390e45_0013_HomeBusinessRetail +15_1fdfb4e4-f9c9-41c4-b055-c80daf00697d_00CE_HomeStudentARMRetail +15_ebef9f05-5273-404a-9253-c5e252f50555_00DA_HomeStudentPlusARMRetail +15_98685d21-78bd-4c62-bc4f-653344a63035_002F_HomeStudentRetail +15_44984381-406e-4a35-b1c3-e54f499556e2_0044_InfoPathRetail +15_9e016989-4007-42a6-8051-64eb97110cf2_0044_InfoPathVolume +15_9103f3ce-1084-447a-827e-d6097f68c895_00EA_LyncAcademicRetail +15_ff693bf4-0276-4ddb-bb42-74ef1a0c9f4d_012D_LyncEntryRetail +15_fada6658-bfc6-4c4e-825a-59a89822cda8_012C_LyncRetail +15_e1264e10-afaf-4439-a98b-256df8bb156f_012C_LyncVolume +15_3169c8df-f659-4f95-9cc6-3115e6596e83_000F_MondoRetail +15_f33485a0-310b-4b72-9a0e-b1d605510dbd_000F_MondoVolume +15_3391e125-f6e4-4b1e-899c-a25e6092d40d_00A1_OneNoteFreeRetail +15_8b524bcc-67ea-4876-a509-45e46f6347e8_00A1_OneNoteRetail +15_b067e965-7521-455b-b9f7-c740204578a2_00A1_OneNoteVolume +15_12004b48-e6c8-4ffa-ad5a-ac8d4467765a_001A_OutlookRetail +15_8d577c50-ae5e-47fd-a240-24986f73d503_001A_OutlookVolume +15_5aab8561-1686-43f7-9ff5-2c861da58d17_00E6_PersonalPipcRetail +15_17e9df2d-ed91-4382-904b-4fed6a12caf0_0033_PersonalRetail +15_31743b82-bfbc-44b6-aa12-85d42e644d5b_0018_PowerPointRetail +15_e40dcb44-1d5c-4085-8e8f-943f33c4f004_0018_PowerPointVolume +15_4e26cac1-e15a-4467-9069-cb47b67fe191_00E8_ProfessionalPipcRetail +15_44bc70e2-fb83-4b09-9082-e5557e0c2ede_0014_ProfessionalRetail +15_f2435de4-5fc0-4e5b-ac97-34f515ec5ee7_003B_ProjectProRetail +15_ed34dc89-1c27-4ecd-8b2f-63d0f4cedc32_003B_ProjectProVolume +15_5517e6a2-739b-4822-946f-7f0f1c5934b1_003A_ProjectStdRetail +15_2b9e4a37-6230-4b42-bee2-e25ce86c8c7a_003A_ProjectStdVolume +15_064383fa-1538-491c-859b-0ecab169a0ab_0011_ProPlusRetail +15_2b88c4f2-ea8f-43cd-805e-4d41346e18a7_0011_ProPlusVolume +15_c3a0814a-70a4-471f-af37-2313a6331111_0019_PublisherRetail +15_38ea49f6-ad1d-43f1-9888-99a35d7c9409_0019_PublisherVolume +15_ba3e3833-6a7e-445a-89d0-7802a9a68588_0017_SPDRetail +15_32255c0a-16b4-4ce2-b388-8a4267e219eb_0012_StandardRetail +15_a24cca51-3d54-4c41-8a76-4031f5338cb2_0012_StandardVolume +15_15d12ad4-622d-4257-976c-5eb3282fb93d_0051_VisioProRetail +15_3e4294dd-a765-49bc-8dbd-cf8b62a4bd3d_0051_VisioProVolume +15_dae597ce-5823-4c77-9580-7268b93a4b23_0053_VisioStdRetail +15_44a1f6ff-0876-4edb-9169-dbb43101ee89_0053_VisioStdVolume +15_191509f2-6977-456f-ab30-cf0492b1e93a_001B_WordRetail +15_9cedef15-be37-4ff0-a08a-13a045540641_001B_WordVolume +:: Office 365 - 15.0 version +15_befee371-a2f5-4648-85db-a2c55fdf324c_00E9_O365BusinessRetail +15_537ea5b5-7d50-4876-bd38-a53a77caca32_00D6_O365HomePremRetail +15_149dbce7-a48e-44db-8364-a53386cd4580_00D4_O365ProPlusRetail +15_bacd4614-5bef-4a5e-bafc-de4c788037a2_00D5_O365SmallBusPremRetail +:: Office 365 - 16.0 version +16_6337137e-7c07-4197-8986-bece6a76fc33_00E9_O365BusinessRetail +16_2f5c71b4-5b7a-4005-bb68-f9fac26f2ea3_00D6_O365EduCloudRetail +16_537ea5b5-7d50-4876-bd38-a53a77caca32_00D6_O365HomePremRetail +16_149dbce7-a48e-44db-8364-a53386cd4580_00D4_O365ProPlusRetail +16_bacd4614-5bef-4a5e-bafc-de4c788037a2_00D5_O365SmallBusPremRetail +:: Office 2016 +16_bfa358b0-98f1-4125-842e-585fa13032e6_0015_AccessRetail +16_9d9faf9e-d345-4b49-afce-68cb0a539c7c_001C_AccessRuntimeRetail +16_3b2fa33f-cd5a-43a5-bd95-f49f3f546b0b_0015_AccessVolume +16_424d52ff-7ad2-4bc7-8ac6-748d767b455d_0016_ExcelRetail +16_685062a7-6024-42e7-8c5f-6bb9e63e697f_0016_ExcelVolume +16_c02fb62e-1cd5-4e18-ba25-e0480467ffaa_00E7_HomeBusinessPipcRetail +16_86834d00-7896-4a38-8fae-32f20b86fa2b_0013_HomeBusinessRetail +16_090896a0-ea98-48ac-b545-ba5da0eb0c9c_00CE_HomeStudentARMRetail +16_6bbe2077-01a4-4269-bf15-5bf4d8efc0b2_00DA_HomeStudentPlusARMRetail +16_c28acdb8-d8b3-4199-baa4-024d09e97c99_002F_HomeStudentRetail +16_e2127526-b60c-43e0-bed1-3c9dc3d5a468_002F_HomeStudentVNextRetail +16_b21367df-9545-4f02-9f24-240691da0e58_000F_MondoRetail +16_2cd0ea7e-749f-4288-a05e-567c573b2a6c_000F_MondoVolume +16_436366de-5579-4f24-96db-3893e4400030_00A3_OneNoteFreeRetail +16_83ac4dd9-1b93-40ed-aa55-ede25bb6af38_00A1_OneNoteRetail +16_23b672da-a456-4860-a8f3-e062a501d7e8_00A1_OneNoteVolume +16_5a670809-0983-4c2d-8aad-d3c2c5b7d5d1_001A_OutlookRetail +16_50059979-ac6f-4458-9e79-710bcb41721a_001A_OutlookVolume +16_5aab8561-1686-43f7-9ff5-2c861da58d17_00E6_PersonalPipcRetail +16_a9f645a1-0d6a-4978-926a-abcb363b72a6_0033_PersonalRetail +16_f32d1284-0792-49da-9ac6-deb2bc9c80b6_0018_PowerPointRetail +16_9b4060c9-a7f5-4a66-b732-faf248b7240f_0018_PowerPointVolume +16_4e26cac1-e15a-4467-9069-cb47b67fe191_00E8_ProfessionalPipcRetail +16_d64edc00-7453-4301-8428-197343fafb16_0014_ProfessionalRetail +16_0f42f316-00b1-48c5-ada4-2f52b5720ad0_003B_ProjectProRetail +16_82f502b5-b0b0-4349-bd2c-c560df85b248_003B_ProjectProVolume +16_16728639-a9ab-4994-b6d8-f81051e69833_003B_ProjectProXVolume +16_e9f0b3fc-962f-4944-ad06-05c10b6bcd5e_003A_ProjectStdRetail +16_82e6b314-2a62-4e51-9220-61358dd230e6_003A_ProjectStdVolume +16_431058f0-c059-44c5-b9e7-ed2dd46b6789_003A_ProjectStdXVolume +16_de52bd50-9564-4adc-8fcb-a345c17f84f9_0011_ProPlusRetail +16_c47456e3-265d-47b6-8ca0-c30abbd0ca36_0011_ProPlusVolume +16_6e0c1d99-c72e-4968-bcb7-ab79e03e201e_0019_PublisherRetail +16_fcc1757b-5d5f-486a-87cf-c4d6dedb6032_0019_PublisherVolume +16_971cd368-f2e1-49c1-aedd-330909ce18b6_012D_SkypeforBusinessEntryRetail +16_418d2b9f-b491-4d7f-84f1-49e27cc66597_012C_SkypeforBusinessRetail +16_03ca3b9a-0869-4749-8988-3cbc9d9f51bb_012C_SkypeforBusinessVolume +16_9103f3ce-1084-447a-827e-d6097f68c895_012C_SkypeServiceBypassRetail +16_4a31c291-3a12-4c64-b8ab-cd79212be45e_0012_StandardRetail +16_0ed94aac-2234-4309-ba29-74bdbb887083_0012_StandardVolume +16_2dfe2075-2d04-4e43-816a-eb60bbb77574_0051_VisioProRetail +16_295b2c03-4b1c-4221-b292-1411f468bd02_0051_VisioProVolume +16_0594dc12-8444-4912-936a-747ca742dbdb_0051_VisioProXVolume +16_c76dbcbc-d71b-4f45-b5b3-b7494cb4e23e_0053_VisioStdRetail +16_44151c2d-c398-471f-946f-7660542e3369_0053_VisioStdVolume +16_1d1c6879-39a3-47a5-9a6d-aceefa6a289d_0053_VisioStdXVolume +16_cacaa1bf-da53-4c3b-9700-11738ef1c2a5_001B_WordRetail +16_c3000759-551f-4f4a-bcac-a4b42cbf1de2_001B_WordVolume +) do ( +for /f "tokens=1-5 delims=_" %%A in ("%%#") do ( + +set getIds=1 +if "%oVer%"=="%%A" ( +if /i "%2"=="getmsiret" (echo %%D | findstr /i "Volume VL" %nul% && set getIds=) + +if defined getIds ( +reg query "%1\Registration\{%%B}" /v ProductCode %nul2% | find /i "-%%C-" %nul% && ( +reg query "%1\Common\InstalledPackages" %nul2% | find /i "-%%C-" %nul% && ( +if defined _oIds (set _oIds=!_oIds! %%D) else (set _oIds=%%D) +) ) ) ) diff --git a/MAS/Separate-Files-Version/Activators/Online_KMS_Activation.cmd b/MAS/Separate-Files-Version/Activators/Online_KMS_Activation.cmd index 61d6f1c..8dd961b 100644 --- a/MAS/Separate-Files-Version/Activators/Online_KMS_Activation.cmd +++ b/MAS/Separate-Files-Version/Activators/Online_KMS_Activation.cmd @@ -1230,7 +1230,7 @@ for /r "%_common%\Microsoft Shared\OFFICE%oVer%\" %%f in (BRANDING.XML) do if ex if not defined _oBranding for /r "%_common2%\Microsoft Shared\OFFICE%oVer%\" %%f in (BRANDING.XML) do if exist "%%f" set "_oBranding=%%f" call :ksdata getmsiprod %2 -call :ks_msiretaildata getmsiret %2 +call :msiofficedata %2 getmsiret echo: echo Processing Office... [MSI ^| %_version% ^| %_oArch%] @@ -3261,132 +3261,195 @@ exit /b :: 1st column = Office version number :: 2nd column = Activation ID -:: 3rd column = Edition -:: 4th column = Other Edition IDs if they are part of the same primary product (For reference only) +:: 3rd column = Product ID from branding.xml +:: 4th column = Edition +:: 5th column = Other Edition IDs if they are part of the same primary product (For reference only) :: Separator = "_" -:ks_msiretaildata +:: EditionID Notes: +:: For Office 2013 and later, all Edition IDs are clearly defined, and each ID corresponds to its specific licensing. + +:: In Office 2010, the situation is a bit more complicated. +:: Products typically fall into two separate categories: Volume License (VL) and Non-VL. This is because a single installation cannot include both Retail and VL licensing types. +:: Some Edition IDs share the same primary product ID. For example, installing ProPlusVL also installs ProPlusAcadVL licenses, as both use 0011 as the primary product ID. +:: Therefore, in the script, we grouped VL and Non-VL versions by primary product ID and selected the highest Edition ID when multiple Edition IDs existed for the same primary product ID. + +:: There are a few exceptions to this 2010 rule: Visio (Premium, Pro, Standard) and OEM-SingleImage. + +:: For Visio, the issue is that branding.xml lists incorrect primary product IDs. The correct primary product ID for all three Visio variants is 0057. Based on the criteria above, we chose Visio-Premium as the representative Edition ID among the three. +:: For OEM-SingleImage, it installs multiple Edition IDs and uses 003D as the primary product ID. Following our method, we selected the highest available Edition ID—ProfessionalR in this case. + +:msiofficedata for %%# in ( -:: Office 2010 -14_4d463c2c-0505-4626-8cdb-a4da82e2d8ed_AccessR -14_745fb377-0a59-4ca9-b9a9-c359557a2c4e_AccessRuntimeR -14_4eaff0d0-c6cb-4187-94f3-c7656d49a0aa_ExcelR -14_7004b7f0-6407-4f45-8eac-966e5f868bde_GrooveR -14_7b7d1f17-fdcb-4820-9789-9bec6e377821_HomeBusinessR_[HomeBusinessDemoR] -14_19316117-30a8-4773-8fd9-7f7231f4e060_HomeBusinessSubR -14_09e2d37e-474b-4121-8626-58ad9be5776f_HomeStudentR_[HomeStudentDemoR] -14_c3ae020c-5a71-4cc5-a27a-2a97c2d46860_HSExcelR -14_25fe4611-b44d-49cc-ae87-2143d299194e_HSOneNoteR -14_d652ad8d-da5c-4358-b928-7fb1b4de7a7c_HSPowerPointR -14_a963d7ae-7a88-41a7-94da-8bb5635a8af9_HSWordR -14_ef1da464-01c8-43a6-91af-e4e5713744f9_InfoPathR -14_14f5946a-debc-4716-babc-7e2c240fec08_MondoR -14_c1ceda8b-c578-4d5d-a4aa-23626be4e234_OEM -14_3f7aa693-9a7e-44fc-9309-bb3d8e604925_OneNoteR -14_fbf4ac36-31c8-4340-8666-79873129cf40_OutlookR -14_acb51361-c0db-4895-9497-1831c41f31a6_PersonalR_[PersonalDemoR,PersonalPrepaidR] -14_133c8359-4e93-4241-8118-30bb18737ea0_PowerPointR -14_8b559c37-0117-413e-921b-b853aeb6e210_ProfessionalR_[ProfessionalAcadR,ProfessionalDemoR] -14_725714d7-d58f-4d12-9fa8-35873c6f7215_ProjectProR_[ProjectProMSDNR] -14_4d06f72e-fd50-4bc2-a24b-d448d7f17ef2_ProjectProSubR -14_688f6589-2bd9-424e-a152-b13f36aa6de1_ProjectStdR -14_71af7e84-93e6-4363-9b69-699e04e74071_ProPlusR_[ProPlusAcadR,ProPlusMSDNR,Sub4R] -14_e98ef0c0-71c4-42ce-8305-287d8721e26c_ProPlusSubR -14_98677603-a668-4fa4-9980-3f1f05f78f69_PublisherR -14_dbe3aee0-5183-4ff7-8142-66050173cb01_SmallBusBasicsR_[SmallBusBasicsMSDNR] -14_b78df69e-0966-40b1-ae85-30a5134dedd0_SPDR -14_d3422cfb-8d8b-4ead-99f9-eab0ccd990d7_StandardR -14_2745e581-565a-4670-ae90-6bf7c57ffe43_StarterR -14_66cad568-c2dc-459d-93ec-2f3cb967ee34_VisioSIR_Prem[Pro,Std] -14_db3bbc9c-ce52-41d1-a46f-1a1d68059119_WordR +14_4d463c2c-0505-4626-8cdb-a4da82e2d8ed_0015_AccessR +14_745fb377-0a59-4ca9-b9a9-c359557a2c4e_001C_AccessRuntimeR +14_95ab3ec8-4106-4f9d-b632-03c019d1d23f_0015_AccessVL +14_4eaff0d0-c6cb-4187-94f3-c7656d49a0aa_0016_ExcelR +14_71dc86ff-f056-40d0-8ffb-9592705c9b76_0016_ExcelVL +14_7004b7f0-6407-4f45-8eac-966e5f868bde_00BA_GrooveR +14_fdad0dfa-417d-4b4f-93e4-64ea8867b7fd_00BA_GrooveVL +14_7b7d1f17-fdcb-4820-9789-9bec6e377821_0013_HomeBusinessR_[HomeBusinessDemoR] +14_19316117-30a8-4773-8fd9-7f7231f4e060_011E_HomeBusinessSubR +14_09e2d37e-474b-4121-8626-58ad9be5776f_002F_HomeStudentR_[HomeStudentDemoR] +14_c3ae020c-5a71-4cc5-a27a-2a97c2d46860_0029_HSExcelR +14_25fe4611-b44d-49cc-ae87-2143d299194e_00A3_HSOneNoteR +14_d652ad8d-da5c-4358-b928-7fb1b4de7a7c_0037_HSPowerPointR +14_a963d7ae-7a88-41a7-94da-8bb5635a8af9_002B_HSWordR +14_ef1da464-01c8-43a6-91af-e4e5713744f9_0044_InfoPathR +14_85e22450-b741-430c-a172-a37962c938af_0044_InfoPathVL +14_14f5946a-debc-4716-babc-7e2c240fec08_000F_MondoR +14_533b656a-4425-480b-8e30-1a2358898350_000F_MondoVL +14_c1ceda8b-c578-4d5d-a4aa-23626be4e234_003D_ProfessionalR_[OEM-SingleImage]Exception +14_3f7aa693-9a7e-44fc-9309-bb3d8e604925_00A1_OneNoteR +14_6860b31f-6a67-48b8-84b9-e312b3485c4b_00A1_OneNoteVL +14_fbf4ac36-31c8-4340-8666-79873129cf40_001A_OutlookR +14_a9aeabd8-63b8-4079-a28e-f531807fd6b8_001A_OutlookVL +14_acb51361-c0db-4895-9497-1831c41f31a6_0033_PersonalR_[PersonalDemoR,PersonalPrepaidR] +14_133c8359-4e93-4241-8118-30bb18737ea0_0018_PowerPointR +14_38252940-718c-4aa6-81a4-135398e53851_0018_PowerPointVL +14_8b559c37-0117-413e-921b-b853aeb6e210_0014_ProfessionalR_[ProfessionalAcadR,ProfessionalDemoR] +14_725714d7-d58f-4d12-9fa8-35873c6f7215_003B_ProjectProR_[ProjectProMSDNR] +14_4d06f72e-fd50-4bc2-a24b-d448d7f17ef2_011F_ProjectProSubR +14_1cf57a59-c532-4e56-9a7d-ffa2fe94b474_003B_ProjectProVL +14_688f6589-2bd9-424e-a152-b13f36aa6de1_003A_ProjectStdR +14_11b39439-6b93-4642-9570-f2eb81be2238_003A_ProjectStdVL +14_71af7e84-93e6-4363-9b69-699e04e74071_0011_ProPlusR_[ProPlusAcadR,ProPlusMSDNR,Sub4R] +14_e98ef0c0-71c4-42ce-8305-287d8721e26c_011D_ProPlusSubR +14_fdf3ecb9-b56f-43b2-a9b8-1b48b6bae1a7_0011_ProPlusVL_[ProPlusAcadVL] +14_98677603-a668-4fa4-9980-3f1f05f78f69_0019_PublisherR +14_3d014759-b128-4466-9018-e80f6320d9d0_0019_PublisherVL +14_dbe3aee0-5183-4ff7-8142-66050173cb01_008B_SmallBusBasicsR_[SmallBusBasicsMSDNR] +14_8090771e-d41a-4482-929e-de87f1f47e46_008B_SmallBusBasicsVL +14_b78df69e-0966-40b1-ae85-30a5134dedd0_0017_SPDR +14_d3422cfb-8d8b-4ead-99f9-eab0ccd990d7_0012_StandardR +14_1f76e346-e0be-49bc-9954-70ec53a4fcfe_0012_StandardVL_[StandardAcadVL] +14_2745e581-565a-4670-ae90-6bf7c57ffe43_0066_StarterR +14_66cad568-c2dc-459d-93ec-2f3cb967ee34_0057_VisioSIR_Prem[Pro,Std]Exception +14_36756cb8-8e69-4d11-9522-68899507cd6a_0057_VisioSIVL_Prem[Pro,Std]Exception +14_db3bbc9c-ce52-41d1-a46f-1a1d68059119_001B_WordR +14_98d4050e-9c98-49bf-9be1-85e12eb3ab13_001B_WordVL :: Office 2013 -15_ab4d047b-97cf-4126-a69f-34df08e2f254_AccessRetail -15_259de5be-492b-44b3-9d78-9645f848f7b0_AccessRuntimeRetail -15_1b1d9bd5-12ea-4063-964c-16e7e87d6e08_ExcelRetail -15_cfaf5356-49e3-48a8-ab3c-e729ab791250_GrooveRetail -15_c02fb62e-1cd5-4e18-ba25-e0480467ffaa_HomeBusinessPipcRetail -15_a2b90e7a-a797-4713-af90-f0becf52a1dd_HomeBusinessRetail -15_1fdfb4e4-f9c9-41c4-b055-c80daf00697d_HomeStudentARMRetail -15_ebef9f05-5273-404a-9253-c5e252f50555_HomeStudentPlusARMRetail -15_f2de350d-3028-410a-bfae-283e00b44d0e_HomeStudentRetail -15_44984381-406e-4a35-b1c3-e54f499556e2_InfoPathRetail -15_9103f3ce-1084-447a-827e-d6097f68c895_LyncAcademicRetail -15_ff693bf4-0276-4ddb-bb42-74ef1a0c9f4d_LyncEntryRetail -15_fada6658-bfc6-4c4e-825a-59a89822cda8_LyncRetail -15_69ec9152-153b-471a-bf35-77ec88683eae_MondoRetail -15_3391e125-f6e4-4b1e-899c-a25e6092d40d_OneNoteFreeRetail -15_8b524bcc-67ea-4876-a509-45e46f6347e8_OneNoteRetail -15_12004b48-e6c8-4ffa-ad5a-ac8d4467765a_OutlookRetail -15_5aab8561-1686-43f7-9ff5-2c861da58d17_PersonalPipcRetail -15_17e9df2d-ed91-4382-904b-4fed6a12caf0_PersonalRetail -15_31743b82-bfbc-44b6-aa12-85d42e644d5b_PowerPointRetail -15_064383fa-1538-491c-859b-0ecab169a0ab_ProPlusRetail -15_4e26cac1-e15a-4467-9069-cb47b67fe191_ProfessionalPipcRetail -15_44bc70e2-fb83-4b09-9082-e5557e0c2ede_ProfessionalRetail -15_2f72340c-b555-418d-8b46-355944fe66b8_ProjectProRetail -15_58d95b09-6af6-453d-a976-8ef0ae0316b1_ProjectStdRetail -15_c3a0814a-70a4-471f-af37-2313a6331111_PublisherRetail -15_ba3e3833-6a7e-445a-89d0-7802a9a68588_SPDRetail -15_32255c0a-16b4-4ce2-b388-8a4267e219eb_StandardRetail -15_a56a3b37-3a35-4bbb-a036-eee5f1898eee_VisioProRetail -15_980f9e3e-f5a8-41c8-8596-61404addf677_VisioStdRetail -15_191509f2-6977-456f-ab30-cf0492b1e93a_WordRetail +15_ab4d047b-97cf-4126-a69f-34df08e2f254_0015_AccessRetail +15_259de5be-492b-44b3-9d78-9645f848f7b0_001C_AccessRuntimeRetail +15_4374022d-56b8-48c1-9bb7-d8f2fc726343_0015_AccessVolume +15_1b1d9bd5-12ea-4063-964c-16e7e87d6e08_0016_ExcelRetail +15_ac1ae7fd-b949-4e04-a330-849bc40638cf_0016_ExcelVolume +15_cfaf5356-49e3-48a8-ab3c-e729ab791250_00BA_GrooveRetail +15_4825ac28-ce41-45a7-9e6e-1fed74057601_00BA_GrooveVolume +15_c02fb62e-1cd5-4e18-ba25-e0480467ffaa_00E7_HomeBusinessPipcRetail +15_cd256150-a898-441f-aac0-9f8f33390e45_0013_HomeBusinessRetail +15_1fdfb4e4-f9c9-41c4-b055-c80daf00697d_00CE_HomeStudentARMRetail +15_ebef9f05-5273-404a-9253-c5e252f50555_00DA_HomeStudentPlusARMRetail +15_98685d21-78bd-4c62-bc4f-653344a63035_002F_HomeStudentRetail +15_44984381-406e-4a35-b1c3-e54f499556e2_0044_InfoPathRetail +15_9e016989-4007-42a6-8051-64eb97110cf2_0044_InfoPathVolume +15_9103f3ce-1084-447a-827e-d6097f68c895_00EA_LyncAcademicRetail +15_ff693bf4-0276-4ddb-bb42-74ef1a0c9f4d_012D_LyncEntryRetail +15_fada6658-bfc6-4c4e-825a-59a89822cda8_012C_LyncRetail +15_e1264e10-afaf-4439-a98b-256df8bb156f_012C_LyncVolume +15_3169c8df-f659-4f95-9cc6-3115e6596e83_000F_MondoRetail +15_f33485a0-310b-4b72-9a0e-b1d605510dbd_000F_MondoVolume +15_3391e125-f6e4-4b1e-899c-a25e6092d40d_00A1_OneNoteFreeRetail +15_8b524bcc-67ea-4876-a509-45e46f6347e8_00A1_OneNoteRetail +15_b067e965-7521-455b-b9f7-c740204578a2_00A1_OneNoteVolume +15_12004b48-e6c8-4ffa-ad5a-ac8d4467765a_001A_OutlookRetail +15_8d577c50-ae5e-47fd-a240-24986f73d503_001A_OutlookVolume +15_5aab8561-1686-43f7-9ff5-2c861da58d17_00E6_PersonalPipcRetail +15_17e9df2d-ed91-4382-904b-4fed6a12caf0_0033_PersonalRetail +15_31743b82-bfbc-44b6-aa12-85d42e644d5b_0018_PowerPointRetail +15_e40dcb44-1d5c-4085-8e8f-943f33c4f004_0018_PowerPointVolume +15_4e26cac1-e15a-4467-9069-cb47b67fe191_00E8_ProfessionalPipcRetail +15_44bc70e2-fb83-4b09-9082-e5557e0c2ede_0014_ProfessionalRetail +15_f2435de4-5fc0-4e5b-ac97-34f515ec5ee7_003B_ProjectProRetail +15_ed34dc89-1c27-4ecd-8b2f-63d0f4cedc32_003B_ProjectProVolume +15_5517e6a2-739b-4822-946f-7f0f1c5934b1_003A_ProjectStdRetail +15_2b9e4a37-6230-4b42-bee2-e25ce86c8c7a_003A_ProjectStdVolume +15_064383fa-1538-491c-859b-0ecab169a0ab_0011_ProPlusRetail +15_2b88c4f2-ea8f-43cd-805e-4d41346e18a7_0011_ProPlusVolume +15_c3a0814a-70a4-471f-af37-2313a6331111_0019_PublisherRetail +15_38ea49f6-ad1d-43f1-9888-99a35d7c9409_0019_PublisherVolume +15_ba3e3833-6a7e-445a-89d0-7802a9a68588_0017_SPDRetail +15_32255c0a-16b4-4ce2-b388-8a4267e219eb_0012_StandardRetail +15_a24cca51-3d54-4c41-8a76-4031f5338cb2_0012_StandardVolume +15_15d12ad4-622d-4257-976c-5eb3282fb93d_0051_VisioProRetail +15_3e4294dd-a765-49bc-8dbd-cf8b62a4bd3d_0051_VisioProVolume +15_dae597ce-5823-4c77-9580-7268b93a4b23_0053_VisioStdRetail +15_44a1f6ff-0876-4edb-9169-dbb43101ee89_0053_VisioStdVolume +15_191509f2-6977-456f-ab30-cf0492b1e93a_001B_WordRetail +15_9cedef15-be37-4ff0-a08a-13a045540641_001B_WordVolume :: Office 365 - 15.0 version -15_6337137e-7c07-4197-8986-bece6a76fc33_O365BusinessRetail -15_537ea5b5-7d50-4876-bd38-a53a77caca32_O365HomePremRetail -15_149dbce7-a48e-44db-8364-a53386cd4580_O365ProPlusRetail -15_bacd4614-5bef-4a5e-bafc-de4c788037a2_O365SmallBusPremRetail +15_befee371-a2f5-4648-85db-a2c55fdf324c_00E9_O365BusinessRetail +15_537ea5b5-7d50-4876-bd38-a53a77caca32_00D6_O365HomePremRetail +15_149dbce7-a48e-44db-8364-a53386cd4580_00D4_O365ProPlusRetail +15_bacd4614-5bef-4a5e-bafc-de4c788037a2_00D5_O365SmallBusPremRetail :: Office 365 - 16.0 version -16_6337137e-7c07-4197-8986-bece6a76fc33_O365BusinessRetail -16_2f5c71b4-5b7a-4005-bb68-f9fac26f2ea3_O365EduCloudRetail -16_537ea5b5-7d50-4876-bd38-a53a77caca32_O365HomePremRetail -16_149dbce7-a48e-44db-8364-a53386cd4580_O365ProPlusRetail -16_bacd4614-5bef-4a5e-bafc-de4c788037a2_O365SmallBusPremRetail +16_6337137e-7c07-4197-8986-bece6a76fc33_00E9_O365BusinessRetail +16_2f5c71b4-5b7a-4005-bb68-f9fac26f2ea3_00D6_O365EduCloudRetail +16_537ea5b5-7d50-4876-bd38-a53a77caca32_00D6_O365HomePremRetail +16_149dbce7-a48e-44db-8364-a53386cd4580_00D4_O365ProPlusRetail +16_bacd4614-5bef-4a5e-bafc-de4c788037a2_00D5_O365SmallBusPremRetail :: Office 2016 -16_bfa358b0-98f1-4125-842e-585fa13032e6_AccessRetail -16_9d9faf9e-d345-4b49-afce-68cb0a539c7c_AccessRuntimeRetail -16_424d52ff-7ad2-4bc7-8ac6-748d767b455d_ExcelRetail -16_c02fb62e-1cd5-4e18-ba25-e0480467ffaa_HomeBusinessPipcRetail -16_86834d00-7896-4a38-8fae-32f20b86fa2b_HomeBusinessRetail -16_c28acdb8-d8b3-4199-baa4-024d09e97c99_HomeStudentRetail -16_090896a0-ea98-48ac-b545-ba5da0eb0c9c_HomeStudentARMRetail -16_6bbe2077-01a4-4269-bf15-5bf4d8efc0b2_HomeStudentPlusARMRetail -16_e2127526-b60c-43e0-bed1-3c9dc3d5a468_HomeStudentVNextRetail -16_69ec9152-153b-471a-bf35-77ec88683eae_MondoRetail -16_436366de-5579-4f24-96db-3893e4400030_OneNoteFreeRetail -16_83ac4dd9-1b93-40ed-aa55-ede25bb6af38_OneNoteRetail -16_5a670809-0983-4c2d-8aad-d3c2c5b7d5d1_OutlookRetail -16_5aab8561-1686-43f7-9ff5-2c861da58d17_PersonalPipcRetail -16_a9f645a1-0d6a-4978-926a-abcb363b72a6_PersonalRetail -16_f32d1284-0792-49da-9ac6-deb2bc9c80b6_PowerPointRetail -16_de52bd50-9564-4adc-8fcb-a345c17f84f9_ProPlusRetail -16_4e26cac1-e15a-4467-9069-cb47b67fe191_ProfessionalPipcRetail -16_d64edc00-7453-4301-8428-197343fafb16_ProfessionalRetail -16_2f72340c-b555-418d-8b46-355944fe66b8_ProjectProRetail -16_58d95b09-6af6-453d-a976-8ef0ae0316b1_ProjectStdRetail -16_6e0c1d99-c72e-4968-bcb7-ab79e03e201e_PublisherRetail -16_9103f3ce-1084-447a-827e-d6097f68c895_SkypeServiceBypassRetail -16_971cd368-f2e1-49c1-aedd-330909ce18b6_SkypeforBusinessEntryRetail -16_418d2b9f-b491-4d7f-84f1-49e27cc66597_SkypeforBusinessRetail -16_4a31c291-3a12-4c64-b8ab-cd79212be45e_StandardRetail -16_a56a3b37-3a35-4bbb-a036-eee5f1898eee_VisioProRetail -16_980f9e3e-f5a8-41c8-8596-61404addf677_VisioStdRetail -16_cacaa1bf-da53-4c3b-9700-11738ef1c2a5_WordRetail +16_bfa358b0-98f1-4125-842e-585fa13032e6_0015_AccessRetail +16_9d9faf9e-d345-4b49-afce-68cb0a539c7c_001C_AccessRuntimeRetail +16_3b2fa33f-cd5a-43a5-bd95-f49f3f546b0b_0015_AccessVolume +16_424d52ff-7ad2-4bc7-8ac6-748d767b455d_0016_ExcelRetail +16_685062a7-6024-42e7-8c5f-6bb9e63e697f_0016_ExcelVolume +16_c02fb62e-1cd5-4e18-ba25-e0480467ffaa_00E7_HomeBusinessPipcRetail +16_86834d00-7896-4a38-8fae-32f20b86fa2b_0013_HomeBusinessRetail +16_090896a0-ea98-48ac-b545-ba5da0eb0c9c_00CE_HomeStudentARMRetail +16_6bbe2077-01a4-4269-bf15-5bf4d8efc0b2_00DA_HomeStudentPlusARMRetail +16_c28acdb8-d8b3-4199-baa4-024d09e97c99_002F_HomeStudentRetail +16_e2127526-b60c-43e0-bed1-3c9dc3d5a468_002F_HomeStudentVNextRetail +16_b21367df-9545-4f02-9f24-240691da0e58_000F_MondoRetail +16_2cd0ea7e-749f-4288-a05e-567c573b2a6c_000F_MondoVolume +16_436366de-5579-4f24-96db-3893e4400030_00A3_OneNoteFreeRetail +16_83ac4dd9-1b93-40ed-aa55-ede25bb6af38_00A1_OneNoteRetail +16_23b672da-a456-4860-a8f3-e062a501d7e8_00A1_OneNoteVolume +16_5a670809-0983-4c2d-8aad-d3c2c5b7d5d1_001A_OutlookRetail +16_50059979-ac6f-4458-9e79-710bcb41721a_001A_OutlookVolume +16_5aab8561-1686-43f7-9ff5-2c861da58d17_00E6_PersonalPipcRetail +16_a9f645a1-0d6a-4978-926a-abcb363b72a6_0033_PersonalRetail +16_f32d1284-0792-49da-9ac6-deb2bc9c80b6_0018_PowerPointRetail +16_9b4060c9-a7f5-4a66-b732-faf248b7240f_0018_PowerPointVolume +16_4e26cac1-e15a-4467-9069-cb47b67fe191_00E8_ProfessionalPipcRetail +16_d64edc00-7453-4301-8428-197343fafb16_0014_ProfessionalRetail +16_0f42f316-00b1-48c5-ada4-2f52b5720ad0_003B_ProjectProRetail +16_82f502b5-b0b0-4349-bd2c-c560df85b248_003B_ProjectProVolume +16_16728639-a9ab-4994-b6d8-f81051e69833_003B_ProjectProXVolume +16_e9f0b3fc-962f-4944-ad06-05c10b6bcd5e_003A_ProjectStdRetail +16_82e6b314-2a62-4e51-9220-61358dd230e6_003A_ProjectStdVolume +16_431058f0-c059-44c5-b9e7-ed2dd46b6789_003A_ProjectStdXVolume +16_de52bd50-9564-4adc-8fcb-a345c17f84f9_0011_ProPlusRetail +16_c47456e3-265d-47b6-8ca0-c30abbd0ca36_0011_ProPlusVolume +16_6e0c1d99-c72e-4968-bcb7-ab79e03e201e_0019_PublisherRetail +16_fcc1757b-5d5f-486a-87cf-c4d6dedb6032_0019_PublisherVolume +16_971cd368-f2e1-49c1-aedd-330909ce18b6_012D_SkypeforBusinessEntryRetail +16_418d2b9f-b491-4d7f-84f1-49e27cc66597_012C_SkypeforBusinessRetail +16_03ca3b9a-0869-4749-8988-3cbc9d9f51bb_012C_SkypeforBusinessVolume +16_9103f3ce-1084-447a-827e-d6097f68c895_012C_SkypeServiceBypassRetail +16_4a31c291-3a12-4c64-b8ab-cd79212be45e_0012_StandardRetail +16_0ed94aac-2234-4309-ba29-74bdbb887083_0012_StandardVolume +16_2dfe2075-2d04-4e43-816a-eb60bbb77574_0051_VisioProRetail +16_295b2c03-4b1c-4221-b292-1411f468bd02_0051_VisioProVolume +16_0594dc12-8444-4912-936a-747ca742dbdb_0051_VisioProXVolume +16_c76dbcbc-d71b-4f45-b5b3-b7494cb4e23e_0053_VisioStdRetail +16_44151c2d-c398-471f-946f-7660542e3369_0053_VisioStdVolume +16_1d1c6879-39a3-47a5-9a6d-aceefa6a289d_0053_VisioStdXVolume +16_cacaa1bf-da53-4c3b-9700-11738ef1c2a5_001B_WordRetail +16_c3000759-551f-4f4a-bcac-a4b42cbf1de2_001B_WordVolume ) do ( for /f "tokens=1-5 delims=_" %%A in ("%%#") do ( -if %1==getmsiret if "%oVer%"=="%%A" ( -for /f "tokens=*" %%x in ('findstr /i /c:"%%B" "%_oBranding%"') do set "prodId=%%x" -set prodId=!prodId:"/>=! -set prodId=!prodId:~-4! -if "%oVer%"=="14" ( -REM Exception case for Visio because wrong primary product ID is mentioned in Branding.xml -echo %%C | find /i "Visio" %nul% && set prodId=0057 +set getIds=1 +if "%oVer%"=="%%A" ( +if /i "%2"=="getmsiret" (echo %%D | findstr /i "Volume VL" %nul% && set getIds=) + +if defined getIds ( +reg query "%1\Registration\{%%B}" /v ProductCode %nul2% | find /i "-%%C-" %nul% && ( +reg query "%1\Common\InstalledPackages" %nul2% | find /i "-%%C-" %nul% && ( +if defined _oIds (set _oIds=!_oIds! %%D) else (set _oIds=%%D) ) -reg query "%2\Registration\{%%B}" /v ProductCode %nul2% | find /i "-!prodId!-" %nul% && ( -reg query "%2\Common\InstalledPackages" %nul2% | find /i "-!prodId!-" %nul% && ( -if defined _oIds (set _oIds=!_oIds! %%C) else (set _oIds=%%C) ) ) ) diff --git a/MAS/Separate-Files-Version/Activators/TSforge_Activation.cmd b/MAS/Separate-Files-Version/Activators/TSforge_Activation.cmd index d6bfc9a..3c62eb3 100644 --- a/MAS/Separate-Files-Version/Activators/TSforge_Activation.cmd +++ b/MAS/Separate-Files-Version/Activators/TSforge_Activation.cmd @@ -1679,7 +1679,7 @@ set "pkeypath=%_common%\Microsoft Shared\OFFICE%oVer%\Office Setup Controller\pk set "pkeypath=%_common2%\Microsoft Shared\OFFICE%oVer%\Office Setup Controller\pkeyconfig-office.xrm-ms" ) -call :ts_msiofficedata %2 +call :msiofficedata %2 echo: echo Processing Office... [MSI ^| %_version% ^| %_oArch%] @@ -7041,135 +7041,135 @@ Office-ActID -pkeypath "$env:pkeypath" -edition "$env:_License" -keytype "$env:k :: 1st column = Office version number :: 2nd column = Activation ID -:: 3rd column = Edition +:: 3rd column = Product ID from branding.xml +:: 4th column = Edition +:: 5th column = Other Edition IDs if they are part of the same primary product (For reference only) :: Separator = "_" -:ts_msiofficedata +:msiofficedata for %%# in ( :: Office 2013 -15_ab4d047b-97cf-4126-a69f-34df08e2f254_AccessRetail -15_259de5be-492b-44b3-9d78-9645f848f7b0_AccessRuntimeRetail -15_4374022d-56b8-48c1-9bb7-d8f2fc726343_AccessVolume -15_1b1d9bd5-12ea-4063-964c-16e7e87d6e08_ExcelRetail -15_ac1ae7fd-b949-4e04-a330-849bc40638cf_ExcelVolume -15_cfaf5356-49e3-48a8-ab3c-e729ab791250_GrooveRetail -15_4825ac28-ce41-45a7-9e6e-1fed74057601_GrooveVolume -15_c02fb62e-1cd5-4e18-ba25-e0480467ffaa_HomeBusinessPipcRetail -15_a2b90e7a-a797-4713-af90-f0becf52a1dd_HomeBusinessRetail -15_1fdfb4e4-f9c9-41c4-b055-c80daf00697d_HomeStudentARMRetail -15_ebef9f05-5273-404a-9253-c5e252f50555_HomeStudentPlusARMRetail -15_f2de350d-3028-410a-bfae-283e00b44d0e_HomeStudentRetail -15_44984381-406e-4a35-b1c3-e54f499556e2_InfoPathRetail -15_9e016989-4007-42a6-8051-64eb97110cf2_InfoPathVolume -15_9103f3ce-1084-447a-827e-d6097f68c895_LyncAcademicRetail -15_ff693bf4-0276-4ddb-bb42-74ef1a0c9f4d_LyncEntryRetail -15_fada6658-bfc6-4c4e-825a-59a89822cda8_LyncRetail -15_e1264e10-afaf-4439-a98b-256df8bb156f_LyncVolume -15_69ec9152-153b-471a-bf35-77ec88683eae_MondoRetail -15_f33485a0-310b-4b72-9a0e-b1d605510dbd_MondoVolume -15_3391e125-f6e4-4b1e-899c-a25e6092d40d_OneNoteFreeRetail -15_8b524bcc-67ea-4876-a509-45e46f6347e8_OneNoteRetail -15_b067e965-7521-455b-b9f7-c740204578a2_OneNoteVolume -15_12004b48-e6c8-4ffa-ad5a-ac8d4467765a_OutlookRetail -15_8d577c50-ae5e-47fd-a240-24986f73d503_OutlookVolume -15_5aab8561-1686-43f7-9ff5-2c861da58d17_PersonalPipcRetail -15_17e9df2d-ed91-4382-904b-4fed6a12caf0_PersonalRetail -15_31743b82-bfbc-44b6-aa12-85d42e644d5b_PowerPointRetail -15_e40dcb44-1d5c-4085-8e8f-943f33c4f004_PowerPointVolume -15_064383fa-1538-491c-859b-0ecab169a0ab_ProPlusRetail -15_2b88c4f2-ea8f-43cd-805e-4d41346e18a7_ProPlusVolume -15_4e26cac1-e15a-4467-9069-cb47b67fe191_ProfessionalPipcRetail -15_44bc70e2-fb83-4b09-9082-e5557e0c2ede_ProfessionalRetail -15_2f72340c-b555-418d-8b46-355944fe66b8_ProjectProRetail -15_ed34dc89-1c27-4ecd-8b2f-63d0f4cedc32_ProjectProVolume -15_58d95b09-6af6-453d-a976-8ef0ae0316b1_ProjectStdRetail -15_2b9e4a37-6230-4b42-bee2-e25ce86c8c7a_ProjectStdVolume -15_c3a0814a-70a4-471f-af37-2313a6331111_PublisherRetail -15_38ea49f6-ad1d-43f1-9888-99a35d7c9409_PublisherVolume -15_ba3e3833-6a7e-445a-89d0-7802a9a68588_SPDRetail -15_32255c0a-16b4-4ce2-b388-8a4267e219eb_StandardRetail -15_a24cca51-3d54-4c41-8a76-4031f5338cb2_StandardVolume -15_a56a3b37-3a35-4bbb-a036-eee5f1898eee_VisioProRetail -15_3e4294dd-a765-49bc-8dbd-cf8b62a4bd3d_VisioProVolume -15_980f9e3e-f5a8-41c8-8596-61404addf677_VisioStdRetail -15_44a1f6ff-0876-4edb-9169-dbb43101ee89_VisioStdVolume -15_191509f2-6977-456f-ab30-cf0492b1e93a_WordRetail -15_9cedef15-be37-4ff0-a08a-13a045540641_WordVolume +15_ab4d047b-97cf-4126-a69f-34df08e2f254_0015_AccessRetail +15_259de5be-492b-44b3-9d78-9645f848f7b0_001C_AccessRuntimeRetail +15_4374022d-56b8-48c1-9bb7-d8f2fc726343_0015_AccessVolume +15_1b1d9bd5-12ea-4063-964c-16e7e87d6e08_0016_ExcelRetail +15_ac1ae7fd-b949-4e04-a330-849bc40638cf_0016_ExcelVolume +15_cfaf5356-49e3-48a8-ab3c-e729ab791250_00BA_GrooveRetail +15_4825ac28-ce41-45a7-9e6e-1fed74057601_00BA_GrooveVolume +15_c02fb62e-1cd5-4e18-ba25-e0480467ffaa_00E7_HomeBusinessPipcRetail +15_cd256150-a898-441f-aac0-9f8f33390e45_0013_HomeBusinessRetail +15_1fdfb4e4-f9c9-41c4-b055-c80daf00697d_00CE_HomeStudentARMRetail +15_ebef9f05-5273-404a-9253-c5e252f50555_00DA_HomeStudentPlusARMRetail +15_98685d21-78bd-4c62-bc4f-653344a63035_002F_HomeStudentRetail +15_44984381-406e-4a35-b1c3-e54f499556e2_0044_InfoPathRetail +15_9e016989-4007-42a6-8051-64eb97110cf2_0044_InfoPathVolume +15_9103f3ce-1084-447a-827e-d6097f68c895_00EA_LyncAcademicRetail +15_ff693bf4-0276-4ddb-bb42-74ef1a0c9f4d_012D_LyncEntryRetail +15_fada6658-bfc6-4c4e-825a-59a89822cda8_012C_LyncRetail +15_e1264e10-afaf-4439-a98b-256df8bb156f_012C_LyncVolume +15_3169c8df-f659-4f95-9cc6-3115e6596e83_000F_MondoRetail +15_f33485a0-310b-4b72-9a0e-b1d605510dbd_000F_MondoVolume +15_3391e125-f6e4-4b1e-899c-a25e6092d40d_00A1_OneNoteFreeRetail +15_8b524bcc-67ea-4876-a509-45e46f6347e8_00A1_OneNoteRetail +15_b067e965-7521-455b-b9f7-c740204578a2_00A1_OneNoteVolume +15_12004b48-e6c8-4ffa-ad5a-ac8d4467765a_001A_OutlookRetail +15_8d577c50-ae5e-47fd-a240-24986f73d503_001A_OutlookVolume +15_5aab8561-1686-43f7-9ff5-2c861da58d17_00E6_PersonalPipcRetail +15_17e9df2d-ed91-4382-904b-4fed6a12caf0_0033_PersonalRetail +15_31743b82-bfbc-44b6-aa12-85d42e644d5b_0018_PowerPointRetail +15_e40dcb44-1d5c-4085-8e8f-943f33c4f004_0018_PowerPointVolume +15_4e26cac1-e15a-4467-9069-cb47b67fe191_00E8_ProfessionalPipcRetail +15_44bc70e2-fb83-4b09-9082-e5557e0c2ede_0014_ProfessionalRetail +15_f2435de4-5fc0-4e5b-ac97-34f515ec5ee7_003B_ProjectProRetail +15_ed34dc89-1c27-4ecd-8b2f-63d0f4cedc32_003B_ProjectProVolume +15_5517e6a2-739b-4822-946f-7f0f1c5934b1_003A_ProjectStdRetail +15_2b9e4a37-6230-4b42-bee2-e25ce86c8c7a_003A_ProjectStdVolume +15_064383fa-1538-491c-859b-0ecab169a0ab_0011_ProPlusRetail +15_2b88c4f2-ea8f-43cd-805e-4d41346e18a7_0011_ProPlusVolume +15_c3a0814a-70a4-471f-af37-2313a6331111_0019_PublisherRetail +15_38ea49f6-ad1d-43f1-9888-99a35d7c9409_0019_PublisherVolume +15_ba3e3833-6a7e-445a-89d0-7802a9a68588_0017_SPDRetail +15_32255c0a-16b4-4ce2-b388-8a4267e219eb_0012_StandardRetail +15_a24cca51-3d54-4c41-8a76-4031f5338cb2_0012_StandardVolume +15_15d12ad4-622d-4257-976c-5eb3282fb93d_0051_VisioProRetail +15_3e4294dd-a765-49bc-8dbd-cf8b62a4bd3d_0051_VisioProVolume +15_dae597ce-5823-4c77-9580-7268b93a4b23_0053_VisioStdRetail +15_44a1f6ff-0876-4edb-9169-dbb43101ee89_0053_VisioStdVolume +15_191509f2-6977-456f-ab30-cf0492b1e93a_001B_WordRetail +15_9cedef15-be37-4ff0-a08a-13a045540641_001B_WordVolume :: Office 365 - 15.0 version -15_742178ed-6b28-42dd-b3d7-b7c0ea78741b_O365BusinessRetail -15_a96f8dae-da54-4fad-bdc6-108da592707a_O365HomePremRetail -15_e3dacc06-3bc2-4e13-8e59-8e05f3232325_O365ProPlusRetail -15_0bc1dae4-6158-4a1c-a893-807665b934b2_O365SmallBusPremRetail +15_befee371-a2f5-4648-85db-a2c55fdf324c_00E9_O365BusinessRetail +15_537ea5b5-7d50-4876-bd38-a53a77caca32_00D6_O365HomePremRetail +15_149dbce7-a48e-44db-8364-a53386cd4580_00D4_O365ProPlusRetail +15_bacd4614-5bef-4a5e-bafc-de4c788037a2_00D5_O365SmallBusPremRetail :: Office 365 - 16.0 version -16_742178ed-6b28-42dd-b3d7-b7c0ea78741b_O365BusinessRetail -16_2f5c71b4-5b7a-4005-bb68-f9fac26f2ea3_O365EduCloudRetail -16_a96f8dae-da54-4fad-bdc6-108da592707a_O365HomePremRetail -16_e3dacc06-3bc2-4e13-8e59-8e05f3232325_O365ProPlusRetail -16_0bc1dae4-6158-4a1c-a893-807665b934b2_O365SmallBusPremRetail +16_6337137e-7c07-4197-8986-bece6a76fc33_00E9_O365BusinessRetail +16_2f5c71b4-5b7a-4005-bb68-f9fac26f2ea3_00D6_O365EduCloudRetail +16_537ea5b5-7d50-4876-bd38-a53a77caca32_00D6_O365HomePremRetail +16_149dbce7-a48e-44db-8364-a53386cd4580_00D4_O365ProPlusRetail +16_bacd4614-5bef-4a5e-bafc-de4c788037a2_00D5_O365SmallBusPremRetail :: Office 2016 -16_bfa358b0-98f1-4125-842e-585fa13032e6_AccessRetail -16_9d9faf9e-d345-4b49-afce-68cb0a539c7c_AccessRuntimeRetail -16_3b2fa33f-cd5a-43a5-bd95-f49f3f546b0b_AccessVolume -16_424d52ff-7ad2-4bc7-8ac6-748d767b455d_ExcelRetail -16_685062a7-6024-42e7-8c5f-6bb9e63e697f_ExcelVolume -16_c02fb62e-1cd5-4e18-ba25-e0480467ffaa_HomeBusinessPipcRetail -16_86834d00-7896-4a38-8fae-32f20b86fa2b_HomeBusinessRetail -16_090896a0-ea98-48ac-b545-ba5da0eb0c9c_HomeStudentARMRetail -16_6bbe2077-01a4-4269-bf15-5bf4d8efc0b2_HomeStudentPlusARMRetail -16_c28acdb8-d8b3-4199-baa4-024d09e97c99_HomeStudentRetail -16_e2127526-b60c-43e0-bed1-3c9dc3d5a468_HomeStudentVNextRetail -16_69ec9152-153b-471a-bf35-77ec88683eae_MondoRetail -16_2cd0ea7e-749f-4288-a05e-567c573b2a6c_MondoVolume -16_436366de-5579-4f24-96db-3893e4400030_OneNoteFreeRetail -16_83ac4dd9-1b93-40ed-aa55-ede25bb6af38_OneNoteRetail -16_23b672da-a456-4860-a8f3-e062a501d7e8_OneNoteVolume -16_5a670809-0983-4c2d-8aad-d3c2c5b7d5d1_OutlookRetail -16_50059979-ac6f-4458-9e79-710bcb41721a_OutlookVolume -16_5aab8561-1686-43f7-9ff5-2c861da58d17_PersonalPipcRetail -16_a9f645a1-0d6a-4978-926a-abcb363b72a6_PersonalRetail -16_f32d1284-0792-49da-9ac6-deb2bc9c80b6_PowerPointRetail -16_9b4060c9-a7f5-4a66-b732-faf248b7240f_PowerPointVolume -16_de52bd50-9564-4adc-8fcb-a345c17f84f9_ProPlusRetail -16_c47456e3-265d-47b6-8ca0-c30abbd0ca36_ProPlusVolume -16_4e26cac1-e15a-4467-9069-cb47b67fe191_ProfessionalPipcRetail -16_d64edc00-7453-4301-8428-197343fafb16_ProfessionalRetail -16_2f72340c-b555-418d-8b46-355944fe66b8_ProjectProRetail -16_82f502b5-b0b0-4349-bd2c-c560df85b248_ProjectProVolume -16_16728639-a9ab-4994-b6d8-f81051e69833_ProjectProXVolume -16_58d95b09-6af6-453d-a976-8ef0ae0316b1_ProjectStdRetail -16_82e6b314-2a62-4e51-9220-61358dd230e6_ProjectStdVolume -16_431058f0-c059-44c5-b9e7-ed2dd46b6789_ProjectStdXVolume -16_6e0c1d99-c72e-4968-bcb7-ab79e03e201e_PublisherRetail -16_fcc1757b-5d5f-486a-87cf-c4d6dedb6032_PublisherVolume -16_9103f3ce-1084-447a-827e-d6097f68c895_SkypeServiceBypassRetail -16_971cd368-f2e1-49c1-aedd-330909ce18b6_SkypeforBusinessEntryRetail -16_418d2b9f-b491-4d7f-84f1-49e27cc66597_SkypeforBusinessRetail -16_03ca3b9a-0869-4749-8988-3cbc9d9f51bb_SkypeforBusinessVolume -16_4a31c291-3a12-4c64-b8ab-cd79212be45e_StandardRetail -16_0ed94aac-2234-4309-ba29-74bdbb887083_StandardVolume -16_a56a3b37-3a35-4bbb-a036-eee5f1898eee_VisioProRetail -16_295b2c03-4b1c-4221-b292-1411f468bd02_VisioProVolume -16_0594dc12-8444-4912-936a-747ca742dbdb_VisioProXVolume -16_980f9e3e-f5a8-41c8-8596-61404addf677_VisioStdRetail -16_44151c2d-c398-471f-946f-7660542e3369_VisioStdVolume -16_1d1c6879-39a3-47a5-9a6d-aceefa6a289d_VisioStdXVolume -16_cacaa1bf-da53-4c3b-9700-11738ef1c2a5_WordRetail -16_c3000759-551f-4f4a-bcac-a4b42cbf1de2_WordVolume +16_bfa358b0-98f1-4125-842e-585fa13032e6_0015_AccessRetail +16_9d9faf9e-d345-4b49-afce-68cb0a539c7c_001C_AccessRuntimeRetail +16_3b2fa33f-cd5a-43a5-bd95-f49f3f546b0b_0015_AccessVolume +16_424d52ff-7ad2-4bc7-8ac6-748d767b455d_0016_ExcelRetail +16_685062a7-6024-42e7-8c5f-6bb9e63e697f_0016_ExcelVolume +16_c02fb62e-1cd5-4e18-ba25-e0480467ffaa_00E7_HomeBusinessPipcRetail +16_86834d00-7896-4a38-8fae-32f20b86fa2b_0013_HomeBusinessRetail +16_090896a0-ea98-48ac-b545-ba5da0eb0c9c_00CE_HomeStudentARMRetail +16_6bbe2077-01a4-4269-bf15-5bf4d8efc0b2_00DA_HomeStudentPlusARMRetail +16_c28acdb8-d8b3-4199-baa4-024d09e97c99_002F_HomeStudentRetail +16_e2127526-b60c-43e0-bed1-3c9dc3d5a468_002F_HomeStudentVNextRetail +16_b21367df-9545-4f02-9f24-240691da0e58_000F_MondoRetail +16_2cd0ea7e-749f-4288-a05e-567c573b2a6c_000F_MondoVolume +16_436366de-5579-4f24-96db-3893e4400030_00A3_OneNoteFreeRetail +16_83ac4dd9-1b93-40ed-aa55-ede25bb6af38_00A1_OneNoteRetail +16_23b672da-a456-4860-a8f3-e062a501d7e8_00A1_OneNoteVolume +16_5a670809-0983-4c2d-8aad-d3c2c5b7d5d1_001A_OutlookRetail +16_50059979-ac6f-4458-9e79-710bcb41721a_001A_OutlookVolume +16_5aab8561-1686-43f7-9ff5-2c861da58d17_00E6_PersonalPipcRetail +16_a9f645a1-0d6a-4978-926a-abcb363b72a6_0033_PersonalRetail +16_f32d1284-0792-49da-9ac6-deb2bc9c80b6_0018_PowerPointRetail +16_9b4060c9-a7f5-4a66-b732-faf248b7240f_0018_PowerPointVolume +16_4e26cac1-e15a-4467-9069-cb47b67fe191_00E8_ProfessionalPipcRetail +16_d64edc00-7453-4301-8428-197343fafb16_0014_ProfessionalRetail +16_0f42f316-00b1-48c5-ada4-2f52b5720ad0_003B_ProjectProRetail +16_82f502b5-b0b0-4349-bd2c-c560df85b248_003B_ProjectProVolume +16_16728639-a9ab-4994-b6d8-f81051e69833_003B_ProjectProXVolume +16_e9f0b3fc-962f-4944-ad06-05c10b6bcd5e_003A_ProjectStdRetail +16_82e6b314-2a62-4e51-9220-61358dd230e6_003A_ProjectStdVolume +16_431058f0-c059-44c5-b9e7-ed2dd46b6789_003A_ProjectStdXVolume +16_de52bd50-9564-4adc-8fcb-a345c17f84f9_0011_ProPlusRetail +16_c47456e3-265d-47b6-8ca0-c30abbd0ca36_0011_ProPlusVolume +16_6e0c1d99-c72e-4968-bcb7-ab79e03e201e_0019_PublisherRetail +16_fcc1757b-5d5f-486a-87cf-c4d6dedb6032_0019_PublisherVolume +16_971cd368-f2e1-49c1-aedd-330909ce18b6_012D_SkypeforBusinessEntryRetail +16_418d2b9f-b491-4d7f-84f1-49e27cc66597_012C_SkypeforBusinessRetail +16_03ca3b9a-0869-4749-8988-3cbc9d9f51bb_012C_SkypeforBusinessVolume +16_9103f3ce-1084-447a-827e-d6097f68c895_012C_SkypeServiceBypassRetail +16_4a31c291-3a12-4c64-b8ab-cd79212be45e_0012_StandardRetail +16_0ed94aac-2234-4309-ba29-74bdbb887083_0012_StandardVolume +16_2dfe2075-2d04-4e43-816a-eb60bbb77574_0051_VisioProRetail +16_295b2c03-4b1c-4221-b292-1411f468bd02_0051_VisioProVolume +16_0594dc12-8444-4912-936a-747ca742dbdb_0051_VisioProXVolume +16_c76dbcbc-d71b-4f45-b5b3-b7494cb4e23e_0053_VisioStdRetail +16_44151c2d-c398-471f-946f-7660542e3369_0053_VisioStdVolume +16_1d1c6879-39a3-47a5-9a6d-aceefa6a289d_0053_VisioStdXVolume +16_cacaa1bf-da53-4c3b-9700-11738ef1c2a5_001B_WordRetail +16_c3000759-551f-4f4a-bcac-a4b42cbf1de2_001B_WordVolume ) do ( for /f "tokens=1-5 delims=_" %%A in ("%%#") do ( +set getIds=1 if "%oVer%"=="%%A" ( -for /f "tokens=*" %%x in ('findstr /i /c:"%%B" "%_oBranding%"') do set "prodId=%%x" -set prodId=!prodId:"/>=! -set prodId=!prodId:~-4! -if "%oVer%"=="14" ( -REM Exception case for Visio because wrong primary product ID is mentioned in Branding.xml -echo %%C | find /i "Visio" %nul% && set prodId=0057 +if /i "%2"=="getmsiret" (echo %%D | findstr /i "Volume VL" %nul% && set getIds=) + +if defined getIds ( +reg query "%1\Registration\{%%B}" /v ProductCode %nul2% | find /i "-%%C-" %nul% && ( +reg query "%1\Common\InstalledPackages" %nul2% | find /i "-%%C-" %nul% && ( +if defined _oIds (set _oIds=!_oIds! %%D) else (set _oIds=%%D) ) -reg query "%1\Registration\{%%B}" /v ProductCode %nul2% | find /i "-!prodId!-" %nul% && ( -reg query "%1\Common\InstalledPackages" %nul2% | find /i "-!prodId!-" %nul% && ( -if defined _oIds (set _oIds=!_oIds! %%C) else (set _oIds=%%C) ) ) ) From 60dd549a4982c39f972271b638f3af2ab98c776e Mon Sep 17 00:00:00 2001 From: WindowsAddict Date: Sat, 12 Apr 2025 20:07:24 +0530 Subject: [PATCH 15/79] Don't add SharedComputerLicensing registry on Server for old Office versions --- MAS/All-In-One-Version-KL/MAS_AIO.cmd | 4 ++-- .../Activators/Ohook_Activation_AIO.cmd | 2 +- MAS/Separate-Files-Version/Activators/TSforge_Activation.cmd | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/MAS/All-In-One-Version-KL/MAS_AIO.cmd b/MAS/All-In-One-Version-KL/MAS_AIO.cmd index 39f3b77..b630bcd 100644 --- a/MAS/All-In-One-Version-KL/MAS_AIO.cmd +++ b/MAS/All-In-One-Version-KL/MAS_AIO.cmd @@ -2812,7 +2812,7 @@ call :dk_color %_Yellow% "%mas%" :: Add SharedComputerLicensing registry key if Retail Office C2R is installed on Windows Server :: https://learn.microsoft.com/en-us/office/troubleshoot/office-suite-issues/click-to-run-office-on-terminal-server -if defined winserver if defined _config ( +if defined winserver if defined _config if exist "%_oLPath%\Word2019VL_KMS_Client_AE*.xrm-ms" ( echo %_oIds% | find /i "Retail" %nul1% && ( set scaIsNeeded=1 reg add %_config% /v SharedComputerLicensing /t REG_SZ /d "1" /f %nul1% @@ -4869,7 +4869,7 @@ echo "!allapps!" | find /i "!_actid!" %nul1% || call :oh_installlic :: Add SharedComputerLicensing registry key if Retail Office C2R is installed on Windows Server :: https://learn.microsoft.com/en-us/office/troubleshoot/office-suite-issues/click-to-run-office-on-terminal-server -if defined winserver if defined _config ( +if defined winserver if defined _config if exist "%_oLPath%\Word2019VL_KMS_Client_AE*.xrm-ms" ( echo %_oIds% | find /i "Retail" %nul1% && ( set scaIsNeeded=1 reg add %_config% /v SharedComputerLicensing /t REG_SZ /d "1" /f %nul1% diff --git a/MAS/Separate-Files-Version/Activators/Ohook_Activation_AIO.cmd b/MAS/Separate-Files-Version/Activators/Ohook_Activation_AIO.cmd index 8a3ccb0..b037146 100644 --- a/MAS/Separate-Files-Version/Activators/Ohook_Activation_AIO.cmd +++ b/MAS/Separate-Files-Version/Activators/Ohook_Activation_AIO.cmd @@ -1027,7 +1027,7 @@ call :dk_color %_Yellow% "%mas%" :: Add SharedComputerLicensing registry key if Retail Office C2R is installed on Windows Server :: https://learn.microsoft.com/en-us/office/troubleshoot/office-suite-issues/click-to-run-office-on-terminal-server -if defined winserver if defined _config ( +if defined winserver if defined _config if exist "%_oLPath%\Word2019VL_KMS_Client_AE*.xrm-ms" ( echo %_oIds% | find /i "Retail" %nul1% && ( set scaIsNeeded=1 reg add %_config% /v SharedComputerLicensing /t REG_SZ /d "1" /f %nul1% diff --git a/MAS/Separate-Files-Version/Activators/TSforge_Activation.cmd b/MAS/Separate-Files-Version/Activators/TSforge_Activation.cmd index 3c62eb3..37b6232 100644 --- a/MAS/Separate-Files-Version/Activators/TSforge_Activation.cmd +++ b/MAS/Separate-Files-Version/Activators/TSforge_Activation.cmd @@ -1638,7 +1638,7 @@ echo "!allapps!" | find /i "!_actid!" %nul1% || call :oh_installlic :: Add SharedComputerLicensing registry key if Retail Office C2R is installed on Windows Server :: https://learn.microsoft.com/en-us/office/troubleshoot/office-suite-issues/click-to-run-office-on-terminal-server -if defined winserver if defined _config ( +if defined winserver if defined _config if exist "%_oLPath%\Word2019VL_KMS_Client_AE*.xrm-ms" ( echo %_oIds% | find /i "Retail" %nul1% && ( set scaIsNeeded=1 reg add %_config% /v SharedComputerLicensing /t REG_SZ /d "1" /f %nul1% From 8673fbbfdabf9fdf34823c4e276ed3a4ef4095ba Mon Sep 17 00:00:00 2001 From: WindowsAddict Date: Sun, 13 Apr 2025 03:45:34 +0530 Subject: [PATCH 16/79] Add -nop -c with Powershell --- MAS/All-In-One-Version-KL/MAS_AIO.cmd | 6 +++--- MAS/Separate-Files-Version/Activators/HWID_Activation.cmd | 4 ++-- MAS/Separate-Files-Version/Activators/KMS38_Activation.cmd | 4 ++-- .../Activators/Ohook_Activation_AIO.cmd | 4 ++-- .../Activators/Online_KMS_Activation.cmd | 6 +++--- .../Activators/TSforge_Activation.cmd | 4 ++-- MAS/Separate-Files-Version/Change_Office_Edition.cmd | 4 ++-- MAS/Separate-Files-Version/Change_Windows_Edition.cmd | 4 ++-- MAS/Separate-Files-Version/Extract_OEM_Folder.cmd | 4 ++-- MAS/Separate-Files-Version/Troubleshoot.cmd | 4 ++-- 10 files changed, 22 insertions(+), 22 deletions(-) diff --git a/MAS/All-In-One-Version-KL/MAS_AIO.cmd b/MAS/All-In-One-Version-KL/MAS_AIO.cmd index b630bcd..0effebc 100644 --- a/MAS/All-In-One-Version-KL/MAS_AIO.cmd +++ b/MAS/All-In-One-Version-KL/MAS_AIO.cmd @@ -200,7 +200,7 @@ for /f "delims=" %%a in ('cmd /c "%psc% ""if ($PSVersionTable.PSEdition -ne 'Cor if /i not "%tstresult%"=="FullLanguage" ( %eline% -echo %tstresult% +echo: %tstresult% cmd /c "%psc% $ExecutionContext.SessionState.LanguageMode" REM check LanguageMode @@ -1068,7 +1068,7 @@ goto :dk_done :dk_setvar -set psc=powershell.exe +set psc=powershell.exe -nop -c set winbuild=1 for /f "tokens=6 delims=[]. " %%G in ('ver') do set winbuild=%%G @@ -11261,7 +11261,7 @@ set _tserror= set winbuild=1 set "nul=>nul 2>&1" for /f "tokens=6 delims=[]. " %%G in ('ver') do set winbuild=%%G -set psc=powershell.exe +set psc=powershell.exe -nop -c set run_once= set t_name=Renewal Task diff --git a/MAS/Separate-Files-Version/Activators/HWID_Activation.cmd b/MAS/Separate-Files-Version/Activators/HWID_Activation.cmd index 50512c5..8e8f039 100644 --- a/MAS/Separate-Files-Version/Activators/HWID_Activation.cmd +++ b/MAS/Separate-Files-Version/Activators/HWID_Activation.cmd @@ -239,7 +239,7 @@ for /f "delims=" %%a in ('cmd /c "%psc% ""if ($PSVersionTable.PSEdition -ne 'Cor if /i not "%tstresult%"=="FullLanguage" ( %eline% -echo %tstresult% +echo: %tstresult% cmd /c "%psc% $ExecutionContext.SessionState.LanguageMode" REM check LanguageMode @@ -799,7 +799,7 @@ goto :dk_done :dk_setvar -set psc=powershell.exe +set psc=powershell.exe -nop -c set winbuild=1 for /f "tokens=6 delims=[]. " %%G in ('ver') do set winbuild=%%G diff --git a/MAS/Separate-Files-Version/Activators/KMS38_Activation.cmd b/MAS/Separate-Files-Version/Activators/KMS38_Activation.cmd index e5ed725..f352fc1 100644 --- a/MAS/Separate-Files-Version/Activators/KMS38_Activation.cmd +++ b/MAS/Separate-Files-Version/Activators/KMS38_Activation.cmd @@ -242,7 +242,7 @@ for /f "delims=" %%a in ('cmd /c "%psc% ""if ($PSVersionTable.PSEdition -ne 'Cor if /i not "%tstresult%"=="FullLanguage" ( %eline% -echo %tstresult% +echo: %tstresult% cmd /c "%psc% $ExecutionContext.SessionState.LanguageMode" REM check LanguageMode @@ -905,7 +905,7 @@ $key.SetAccessControl($acl) :dk_setvar -set psc=powershell.exe +set psc=powershell.exe -nop -c set winbuild=1 for /f "tokens=6 delims=[]. " %%G in ('ver') do set winbuild=%%G diff --git a/MAS/Separate-Files-Version/Activators/Ohook_Activation_AIO.cmd b/MAS/Separate-Files-Version/Activators/Ohook_Activation_AIO.cmd index b037146..602e142 100644 --- a/MAS/Separate-Files-Version/Activators/Ohook_Activation_AIO.cmd +++ b/MAS/Separate-Files-Version/Activators/Ohook_Activation_AIO.cmd @@ -232,7 +232,7 @@ for /f "delims=" %%a in ('cmd /c "%psc% ""if ($PSVersionTable.PSEdition -ne 'Cor if /i not "%tstresult%"=="FullLanguage" ( %eline% -echo %tstresult% +echo: %tstresult% cmd /c "%psc% $ExecutionContext.SessionState.LanguageMode" REM check LanguageMode @@ -1327,7 +1327,7 @@ exit /b :dk_setvar -set psc=powershell.exe +set psc=powershell.exe -nop -c set winbuild=1 for /f "tokens=6 delims=[]. " %%G in ('ver') do set winbuild=%%G diff --git a/MAS/Separate-Files-Version/Activators/Online_KMS_Activation.cmd b/MAS/Separate-Files-Version/Activators/Online_KMS_Activation.cmd index 8dd961b..fe3370a 100644 --- a/MAS/Separate-Files-Version/Activators/Online_KMS_Activation.cmd +++ b/MAS/Separate-Files-Version/Activators/Online_KMS_Activation.cmd @@ -261,7 +261,7 @@ for /f "delims=" %%a in ('cmd /c "%psc% ""if ($PSVersionTable.PSEdition -ne 'Cor if /i not "%tstresult%"=="FullLanguage" ( %eline% -echo %tstresult% +echo: %tstresult% cmd /c "%psc% $ExecutionContext.SessionState.LanguageMode" REM check LanguageMode @@ -1646,7 +1646,7 @@ set _tserror= set winbuild=1 set "nul=>nul 2>&1" for /f "tokens=6 delims=[]. " %%G in ('ver') do set winbuild=%%G -set psc=powershell.exe +set psc=powershell.exe -nop -c set run_once= set t_name=Renewal Task @@ -2332,7 +2332,7 @@ exit /b :dk_setvar -set psc=powershell.exe +set psc=powershell.exe -nop -c set winbuild=1 for /f "tokens=6 delims=[]. " %%G in ('ver') do set winbuild=%%G diff --git a/MAS/Separate-Files-Version/Activators/TSforge_Activation.cmd b/MAS/Separate-Files-Version/Activators/TSforge_Activation.cmd index 37b6232..24077db 100644 --- a/MAS/Separate-Files-Version/Activators/TSforge_Activation.cmd +++ b/MAS/Separate-Files-Version/Activators/TSforge_Activation.cmd @@ -267,7 +267,7 @@ for /f "delims=" %%a in ('cmd /c "%psc% ""if ($PSVersionTable.PSEdition -ne 'Cor if /i not "%tstresult%"=="FullLanguage" ( %eline% -echo %tstresult% +echo: %tstresult% cmd /c "%psc% $ExecutionContext.SessionState.LanguageMode" REM check LanguageMode @@ -1955,7 +1955,7 @@ exit /b :dk_setvar -set psc=powershell.exe +set psc=powershell.exe -nop -c set winbuild=1 for /f "tokens=6 delims=[]. " %%G in ('ver') do set winbuild=%%G diff --git a/MAS/Separate-Files-Version/Change_Office_Edition.cmd b/MAS/Separate-Files-Version/Change_Office_Edition.cmd index 32a8727..05f0639 100644 --- a/MAS/Separate-Files-Version/Change_Office_Edition.cmd +++ b/MAS/Separate-Files-Version/Change_Office_Edition.cmd @@ -192,7 +192,7 @@ for /f "delims=" %%a in ('cmd /c "%psc% ""if ($PSVersionTable.PSEdition -ne 'Cor if /i not "%tstresult%"=="FullLanguage" ( %eline% -echo %tstresult% +echo: %tstresult% cmd /c "%psc% $ExecutionContext.SessionState.LanguageMode" REM check LanguageMode @@ -1343,7 +1343,7 @@ if ($appIdsList.Count -gt 0) { :dk_setvar -set psc=powershell.exe +set psc=powershell.exe -nop -c set winbuild=1 for /f "tokens=6 delims=[]. " %%G in ('ver') do set winbuild=%%G diff --git a/MAS/Separate-Files-Version/Change_Windows_Edition.cmd b/MAS/Separate-Files-Version/Change_Windows_Edition.cmd index 2c0dbb8..7524407 100644 --- a/MAS/Separate-Files-Version/Change_Windows_Edition.cmd +++ b/MAS/Separate-Files-Version/Change_Windows_Edition.cmd @@ -197,7 +197,7 @@ for /f "delims=" %%a in ('cmd /c "%psc% ""if ($PSVersionTable.PSEdition -ne 'Cor if /i not "%tstresult%"=="FullLanguage" ( %eline% -echo %tstresult% +echo: %tstresult% cmd /c "%psc% $ExecutionContext.SessionState.LanguageMode" REM check LanguageMode @@ -815,7 +815,7 @@ exit /b :dk_setvar -set psc=powershell.exe +set psc=powershell.exe -nop -c set winbuild=1 for /f "tokens=6 delims=[]. " %%G in ('ver') do set winbuild=%%G diff --git a/MAS/Separate-Files-Version/Extract_OEM_Folder.cmd b/MAS/Separate-Files-Version/Extract_OEM_Folder.cmd index 735941d..d5db12e 100644 --- a/MAS/Separate-Files-Version/Extract_OEM_Folder.cmd +++ b/MAS/Separate-Files-Version/Extract_OEM_Folder.cmd @@ -191,7 +191,7 @@ for /f "delims=" %%a in ('cmd /c "%psc% ""if ($PSVersionTable.PSEdition -ne 'Cor if /i not "%tstresult%"=="FullLanguage" ( %eline% -echo %tstresult% +echo: %tstresult% cmd /c "%psc% $ExecutionContext.SessionState.LanguageMode" REM check LanguageMode @@ -723,7 +723,7 @@ exit /b :dk_setvar -set psc=powershell.exe +set psc=powershell.exe -nop -c set winbuild=1 for /f "tokens=6 delims=[]. " %%G in ('ver') do set winbuild=%%G diff --git a/MAS/Separate-Files-Version/Troubleshoot.cmd b/MAS/Separate-Files-Version/Troubleshoot.cmd index 1c12499..a3d3b8b 100644 --- a/MAS/Separate-Files-Version/Troubleshoot.cmd +++ b/MAS/Separate-Files-Version/Troubleshoot.cmd @@ -192,7 +192,7 @@ for /f "delims=" %%a in ('cmd /c "%psc% ""if ($PSVersionTable.PSEdition -ne 'Cor if /i not "%tstresult%"=="FullLanguage" ( %eline% -echo %tstresult% +echo: %tstresult% cmd /c "%psc% $ExecutionContext.SessionState.LanguageMode" REM check LanguageMode @@ -1460,7 +1460,7 @@ exit /b :dk_setvar -set psc=powershell.exe +set psc=powershell.exe -nop -c set winbuild=1 for /f "tokens=6 delims=[]. " %%G in ('ver') do set winbuild=%%G From 3b739d7e2bac5ac01c0dac87855ca1fb72c6b54b Mon Sep 17 00:00:00 2001 From: WindowsAddict Date: Sun, 13 Apr 2025 04:25:10 +0530 Subject: [PATCH 17/79] Add malware check in Powershell test --- MAS/All-In-One-Version-KL/MAS_AIO.cmd | 12 +++++++++++- .../Activators/HWID_Activation.cmd | 12 +++++++++++- .../Activators/KMS38_Activation.cmd | 12 +++++++++++- .../Activators/Ohook_Activation_AIO.cmd | 12 +++++++++++- .../Activators/Online_KMS_Activation.cmd | 12 +++++++++++- .../Activators/TSforge_Activation.cmd | 12 +++++++++++- MAS/Separate-Files-Version/Change_Office_Edition.cmd | 12 +++++++++++- .../Change_Windows_Edition.cmd | 12 +++++++++++- MAS/Separate-Files-Version/Extract_OEM_Folder.cmd | 12 +++++++++++- MAS/Separate-Files-Version/Troubleshoot.cmd | 12 +++++++++++- 10 files changed, 110 insertions(+), 10 deletions(-) diff --git a/MAS/All-In-One-Version-KL/MAS_AIO.cmd b/MAS/All-In-One-Version-KL/MAS_AIO.cmd index 0effebc..d7a91d5 100644 --- a/MAS/All-In-One-Version-KL/MAS_AIO.cmd +++ b/MAS/All-In-One-Version-KL/MAS_AIO.cmd @@ -206,7 +206,6 @@ cmd /c "%psc% $ExecutionContext.SessionState.LanguageMode" REM check LanguageMode cmd /c "%psc% "$ExecutionContext.SessionState.LanguageMode"" | findstr /i "ConstrainedLanguage RestrictedLanguage NoLanguage" %nul1% && ( -%eline% echo FullLanguage mode not found in PowerShell. Aborting... echo If you have applied restrictions on Powershell then undo those changes. echo: @@ -222,6 +221,17 @@ echo Windows Powershell is needed for MAS but it seems to be replaced with Power goto dk_done ) +REM check for Mal-ware that may cause issues with Powershell + +for /r "%ProgramFiles%\" %%f in (secureboot.exe) do if exist "%%f" ( +echo "%%f" +echo Mal%blank%ware found, PowerShell is not working properly. +echo: +set fixes=%fixes% %mas%remove_mal%w%ware +call :dk_color2 %Blue% "Check this webpage for help - " %_Yellow% " %mas%remove_mal%w%ware" +goto dk_done +) + REM check antivirus and other errors echo PowerShell is not working properly. Aborting... diff --git a/MAS/Separate-Files-Version/Activators/HWID_Activation.cmd b/MAS/Separate-Files-Version/Activators/HWID_Activation.cmd index 8e8f039..61515a9 100644 --- a/MAS/Separate-Files-Version/Activators/HWID_Activation.cmd +++ b/MAS/Separate-Files-Version/Activators/HWID_Activation.cmd @@ -245,7 +245,6 @@ cmd /c "%psc% $ExecutionContext.SessionState.LanguageMode" REM check LanguageMode cmd /c "%psc% "$ExecutionContext.SessionState.LanguageMode"" | findstr /i "ConstrainedLanguage RestrictedLanguage NoLanguage" %nul1% && ( -%eline% echo FullLanguage mode not found in PowerShell. Aborting... echo If you have applied restrictions on Powershell then undo those changes. echo: @@ -261,6 +260,17 @@ echo Windows Powershell is needed for MAS but it seems to be replaced with Power goto dk_done ) +REM check for Mal-ware that may cause issues with Powershell + +for /r "%ProgramFiles%\" %%f in (secureboot.exe) do if exist "%%f" ( +echo "%%f" +echo Mal%blank%ware found, PowerShell is not working properly. +echo: +set fixes=%fixes% %mas%remove_mal%w%ware +call :dk_color2 %Blue% "Check this webpage for help - " %_Yellow% " %mas%remove_mal%w%ware" +goto dk_done +) + REM check antivirus and other errors echo PowerShell is not working properly. Aborting... diff --git a/MAS/Separate-Files-Version/Activators/KMS38_Activation.cmd b/MAS/Separate-Files-Version/Activators/KMS38_Activation.cmd index f352fc1..31e5bb0 100644 --- a/MAS/Separate-Files-Version/Activators/KMS38_Activation.cmd +++ b/MAS/Separate-Files-Version/Activators/KMS38_Activation.cmd @@ -248,7 +248,6 @@ cmd /c "%psc% $ExecutionContext.SessionState.LanguageMode" REM check LanguageMode cmd /c "%psc% "$ExecutionContext.SessionState.LanguageMode"" | findstr /i "ConstrainedLanguage RestrictedLanguage NoLanguage" %nul1% && ( -%eline% echo FullLanguage mode not found in PowerShell. Aborting... echo If you have applied restrictions on Powershell then undo those changes. echo: @@ -264,6 +263,17 @@ echo Windows Powershell is needed for MAS but it seems to be replaced with Power goto dk_done ) +REM check for Mal-ware that may cause issues with Powershell + +for /r "%ProgramFiles%\" %%f in (secureboot.exe) do if exist "%%f" ( +echo "%%f" +echo Mal%blank%ware found, PowerShell is not working properly. +echo: +set fixes=%fixes% %mas%remove_mal%w%ware +call :dk_color2 %Blue% "Check this webpage for help - " %_Yellow% " %mas%remove_mal%w%ware" +goto dk_done +) + REM check antivirus and other errors echo PowerShell is not working properly. Aborting... diff --git a/MAS/Separate-Files-Version/Activators/Ohook_Activation_AIO.cmd b/MAS/Separate-Files-Version/Activators/Ohook_Activation_AIO.cmd index 602e142..186365e 100644 --- a/MAS/Separate-Files-Version/Activators/Ohook_Activation_AIO.cmd +++ b/MAS/Separate-Files-Version/Activators/Ohook_Activation_AIO.cmd @@ -238,7 +238,6 @@ cmd /c "%psc% $ExecutionContext.SessionState.LanguageMode" REM check LanguageMode cmd /c "%psc% "$ExecutionContext.SessionState.LanguageMode"" | findstr /i "ConstrainedLanguage RestrictedLanguage NoLanguage" %nul1% && ( -%eline% echo FullLanguage mode not found in PowerShell. Aborting... echo If you have applied restrictions on Powershell then undo those changes. echo: @@ -254,6 +253,17 @@ echo Windows Powershell is needed for MAS but it seems to be replaced with Power goto dk_done ) +REM check for Mal-ware that may cause issues with Powershell + +for /r "%ProgramFiles%\" %%f in (secureboot.exe) do if exist "%%f" ( +echo "%%f" +echo Mal%blank%ware found, PowerShell is not working properly. +echo: +set fixes=%fixes% %mas%remove_mal%w%ware +call :dk_color2 %Blue% "Check this webpage for help - " %_Yellow% " %mas%remove_mal%w%ware" +goto dk_done +) + REM check antivirus and other errors echo PowerShell is not working properly. Aborting... diff --git a/MAS/Separate-Files-Version/Activators/Online_KMS_Activation.cmd b/MAS/Separate-Files-Version/Activators/Online_KMS_Activation.cmd index fe3370a..e1e40b3 100644 --- a/MAS/Separate-Files-Version/Activators/Online_KMS_Activation.cmd +++ b/MAS/Separate-Files-Version/Activators/Online_KMS_Activation.cmd @@ -267,7 +267,6 @@ cmd /c "%psc% $ExecutionContext.SessionState.LanguageMode" REM check LanguageMode cmd /c "%psc% "$ExecutionContext.SessionState.LanguageMode"" | findstr /i "ConstrainedLanguage RestrictedLanguage NoLanguage" %nul1% && ( -%eline% echo FullLanguage mode not found in PowerShell. Aborting... echo If you have applied restrictions on Powershell then undo those changes. echo: @@ -283,6 +282,17 @@ echo Windows Powershell is needed for MAS but it seems to be replaced with Power goto dk_done ) +REM check for Mal-ware that may cause issues with Powershell + +for /r "%ProgramFiles%\" %%f in (secureboot.exe) do if exist "%%f" ( +echo "%%f" +echo Mal%blank%ware found, PowerShell is not working properly. +echo: +set fixes=%fixes% %mas%remove_mal%w%ware +call :dk_color2 %Blue% "Check this webpage for help - " %_Yellow% " %mas%remove_mal%w%ware" +goto dk_done +) + REM check antivirus and other errors echo PowerShell is not working properly. Aborting... diff --git a/MAS/Separate-Files-Version/Activators/TSforge_Activation.cmd b/MAS/Separate-Files-Version/Activators/TSforge_Activation.cmd index 24077db..d3559ee 100644 --- a/MAS/Separate-Files-Version/Activators/TSforge_Activation.cmd +++ b/MAS/Separate-Files-Version/Activators/TSforge_Activation.cmd @@ -273,7 +273,6 @@ cmd /c "%psc% $ExecutionContext.SessionState.LanguageMode" REM check LanguageMode cmd /c "%psc% "$ExecutionContext.SessionState.LanguageMode"" | findstr /i "ConstrainedLanguage RestrictedLanguage NoLanguage" %nul1% && ( -%eline% echo FullLanguage mode not found in PowerShell. Aborting... echo If you have applied restrictions on Powershell then undo those changes. echo: @@ -289,6 +288,17 @@ echo Windows Powershell is needed for MAS but it seems to be replaced with Power goto dk_done ) +REM check for Mal-ware that may cause issues with Powershell + +for /r "%ProgramFiles%\" %%f in (secureboot.exe) do if exist "%%f" ( +echo "%%f" +echo Mal%blank%ware found, PowerShell is not working properly. +echo: +set fixes=%fixes% %mas%remove_mal%w%ware +call :dk_color2 %Blue% "Check this webpage for help - " %_Yellow% " %mas%remove_mal%w%ware" +goto dk_done +) + REM check antivirus and other errors echo PowerShell is not working properly. Aborting... diff --git a/MAS/Separate-Files-Version/Change_Office_Edition.cmd b/MAS/Separate-Files-Version/Change_Office_Edition.cmd index 05f0639..0e71bb4 100644 --- a/MAS/Separate-Files-Version/Change_Office_Edition.cmd +++ b/MAS/Separate-Files-Version/Change_Office_Edition.cmd @@ -198,7 +198,6 @@ cmd /c "%psc% $ExecutionContext.SessionState.LanguageMode" REM check LanguageMode cmd /c "%psc% "$ExecutionContext.SessionState.LanguageMode"" | findstr /i "ConstrainedLanguage RestrictedLanguage NoLanguage" %nul1% && ( -%eline% echo FullLanguage mode not found in PowerShell. Aborting... echo If you have applied restrictions on Powershell then undo those changes. echo: @@ -214,6 +213,17 @@ echo Windows Powershell is needed for MAS but it seems to be replaced with Power goto dk_done ) +REM check for Mal-ware that may cause issues with Powershell + +for /r "%ProgramFiles%\" %%f in (secureboot.exe) do if exist "%%f" ( +echo "%%f" +echo Mal%blank%ware found, PowerShell is not working properly. +echo: +set fixes=%fixes% %mas%remove_mal%w%ware +call :dk_color2 %Blue% "Check this webpage for help - " %_Yellow% " %mas%remove_mal%w%ware" +goto dk_done +) + REM check antivirus and other errors echo PowerShell is not working properly. Aborting... diff --git a/MAS/Separate-Files-Version/Change_Windows_Edition.cmd b/MAS/Separate-Files-Version/Change_Windows_Edition.cmd index 7524407..c9a5155 100644 --- a/MAS/Separate-Files-Version/Change_Windows_Edition.cmd +++ b/MAS/Separate-Files-Version/Change_Windows_Edition.cmd @@ -203,7 +203,6 @@ cmd /c "%psc% $ExecutionContext.SessionState.LanguageMode" REM check LanguageMode cmd /c "%psc% "$ExecutionContext.SessionState.LanguageMode"" | findstr /i "ConstrainedLanguage RestrictedLanguage NoLanguage" %nul1% && ( -%eline% echo FullLanguage mode not found in PowerShell. Aborting... echo If you have applied restrictions on Powershell then undo those changes. echo: @@ -219,6 +218,17 @@ echo Windows Powershell is needed for MAS but it seems to be replaced with Power goto dk_done ) +REM check for Mal-ware that may cause issues with Powershell + +for /r "%ProgramFiles%\" %%f in (secureboot.exe) do if exist "%%f" ( +echo "%%f" +echo Mal%blank%ware found, PowerShell is not working properly. +echo: +set fixes=%fixes% %mas%remove_mal%w%ware +call :dk_color2 %Blue% "Check this webpage for help - " %_Yellow% " %mas%remove_mal%w%ware" +goto dk_done +) + REM check antivirus and other errors echo PowerShell is not working properly. Aborting... diff --git a/MAS/Separate-Files-Version/Extract_OEM_Folder.cmd b/MAS/Separate-Files-Version/Extract_OEM_Folder.cmd index d5db12e..e9db519 100644 --- a/MAS/Separate-Files-Version/Extract_OEM_Folder.cmd +++ b/MAS/Separate-Files-Version/Extract_OEM_Folder.cmd @@ -197,7 +197,6 @@ cmd /c "%psc% $ExecutionContext.SessionState.LanguageMode" REM check LanguageMode cmd /c "%psc% "$ExecutionContext.SessionState.LanguageMode"" | findstr /i "ConstrainedLanguage RestrictedLanguage NoLanguage" %nul1% && ( -%eline% echo FullLanguage mode not found in PowerShell. Aborting... echo If you have applied restrictions on Powershell then undo those changes. echo: @@ -213,6 +212,17 @@ echo Windows Powershell is needed for MAS but it seems to be replaced with Power goto done2 ) +REM check for Mal-ware that may cause issues with Powershell + +for /r "%ProgramFiles%\" %%f in (secureboot.exe) do if exist "%%f" ( +echo "%%f" +echo Mal%blank%ware found, PowerShell is not working properly. +echo: +set fixes=%fixes% %mas%remove_mal%w%ware +call :dk_color2 %Blue% "Check this webpage for help - " %_Yellow% " %mas%remove_mal%w%ware" +goto done2 +) + REM check antivirus and other errors echo PowerShell is not working properly. Aborting... diff --git a/MAS/Separate-Files-Version/Troubleshoot.cmd b/MAS/Separate-Files-Version/Troubleshoot.cmd index a3d3b8b..818091f 100644 --- a/MAS/Separate-Files-Version/Troubleshoot.cmd +++ b/MAS/Separate-Files-Version/Troubleshoot.cmd @@ -198,7 +198,6 @@ cmd /c "%psc% $ExecutionContext.SessionState.LanguageMode" REM check LanguageMode cmd /c "%psc% "$ExecutionContext.SessionState.LanguageMode"" | findstr /i "ConstrainedLanguage RestrictedLanguage NoLanguage" %nul1% && ( -%eline% echo FullLanguage mode not found in PowerShell. Aborting... echo If you have applied restrictions on Powershell then undo those changes. echo: @@ -214,6 +213,17 @@ echo Windows Powershell is needed for MAS but it seems to be replaced with Power goto dk_done ) +REM check for Mal-ware that may cause issues with Powershell + +for /r "%ProgramFiles%\" %%f in (secureboot.exe) do if exist "%%f" ( +echo "%%f" +echo Mal%blank%ware found, PowerShell is not working properly. +echo: +set fixes=%fixes% %mas%remove_mal%w%ware +call :dk_color2 %Blue% "Check this webpage for help - " %_Yellow% " %mas%remove_mal%w%ware" +goto dk_done +) + REM check antivirus and other errors echo PowerShell is not working properly. Aborting... From c316b42e5cd166aa5c10a54d03ca0c5e5d63f4cd Mon Sep 17 00:00:00 2001 From: WindowsAddict Date: Mon, 14 Apr 2025 04:10:58 +0530 Subject: [PATCH 18/79] Simplify the code related to "disable quickedit and avoid Terminal app" --- MAS/All-In-One-Version-KL/MAS_AIO.cmd | 37 +++++++++---------- .../Activators/HWID_Activation.cmd | 37 +++++++++---------- .../Activators/KMS38_Activation.cmd | 37 +++++++++---------- .../Activators/Ohook_Activation_AIO.cmd | 37 +++++++++---------- .../Activators/Online_KMS_Activation.cmd | 37 +++++++++---------- .../Activators/TSforge_Activation.cmd | 37 +++++++++---------- .../Change_Office_Edition.cmd | 37 +++++++++---------- .../Change_Windows_Edition.cmd | 37 +++++++++---------- .../Extract_OEM_Folder.cmd | 37 +++++++++---------- MAS/Separate-Files-Version/Troubleshoot.cmd | 37 +++++++++---------- 10 files changed, 180 insertions(+), 190 deletions(-) diff --git a/MAS/All-In-One-Version-KL/MAS_AIO.cmd b/MAS/All-In-One-Version-KL/MAS_AIO.cmd index d7a91d5..2a42c2b 100644 --- a/MAS/All-In-One-Version-KL/MAS_AIO.cmd +++ b/MAS/All-In-One-Version-KL/MAS_AIO.cmd @@ -254,34 +254,33 @@ set terminal= :: Check if script is running in Terminal app -set r1=$TB = [AppDomain]::CurrentDomain.DefineDynamicAssembly(4, 1).DefineDynamicModule(2, $False).DefineType(0); -set r2=%r1% [void]$TB.DefinePInvokeMethod('GetConsoleWindow', 'kernel32.dll', 22, 1, [IntPtr], @(), 1, 3).SetImplementationFlags(128); -set r3=%r2% [void]$TB.DefinePInvokeMethod('SendMessageW', 'user32.dll', 22, 1, [IntPtr], @([IntPtr], [UInt32], [IntPtr], [IntPtr]), 1, 3).SetImplementationFlags(128); -set d1=%r3% $hIcon = $TB.CreateType(); $hWnd = $hIcon::GetConsoleWindow(); -set d2=%d1% echo $($hIcon::SendMessageW($hWnd, 127, 0, 0) -ne [IntPtr]::Zero); - if defined terminal ( -%psc% "%d2%" %nul2% | find /i "True" %nul1% && set terminal= +set lines=0 +for /f "skip=2 tokens=2 delims=: " %%A in ('mode con') do if "!lines!"=="0" set lines=%%A +if !lines! GEQ 100 set terminal= ) -if defined ps32onArm goto :skipQE if %_unattended%==1 goto :skipQE for %%# in (%_args%) do (if /i "%%#"=="-qedit" goto :skipQE) +:: Relaunch to disable QuickEdit in the current session and use conhost.exe instead of the Terminal app +:: This code disables QuickEdit for the current cmd.exe session without making permanent registry changes +:: It is included because clicking on the script window can pause execution, causing confusion that the script has stopped due to an error + +set resetQE=1 +reg query HKCU\Console /v QuickEdit %nul2% | find /i "0x0" %nul1% && set resetQE=0 +reg add HKCU\Console /v QuickEdit /t REG_DWORD /d 0 /f %nul1% + if defined terminal ( -set "launchcmd=start conhost.exe %psc%" -) else ( -set "launchcmd=%psc%" +start conhost.exe "!_batf!" %_args% -qedit +start reg add HKCU\Console /v QuickEdit /t REG_DWORD /d %resetQE% /f %nul1% +exit /b +) else if %resetQE% EQU 1 ( +start cmd.exe /c ""!_batf!" %_args% -qedit" +start reg add HKCU\Console /v QuickEdit /t REG_DWORD /d %resetQE% /f %nul1% +exit /b ) -:: Disable QuickEdit in current session - -set "d1=$t=[AppDomain]::CurrentDomain.DefineDynamicAssembly(4, 1).DefineDynamicModule(2, $False).DefineType(0);" -set "d2=$t.DefinePInvokeMethod('GetStdHandle', 'kernel32.dll', 22, 1, [IntPtr], @([Int32]), 1, 3).SetImplementationFlags(128);" -set "d3=$t.DefinePInvokeMethod('SetConsoleMode', 'kernel32.dll', 22, 1, [Boolean], @([IntPtr], [Int32]), 1, 3).SetImplementationFlags(128);" -set "d4=$k=$t.CreateType(); $b=$k::SetConsoleMode($k::GetStdHandle(-10), 0x0080);" - -%launchcmd% "%d1% %d2% %d3% %d4% & cmd.exe '/c' '!_PSarg! -qedit'" && (exit /b) || (set terminal=1) :skipQE ::======================================================================================================================================== diff --git a/MAS/Separate-Files-Version/Activators/HWID_Activation.cmd b/MAS/Separate-Files-Version/Activators/HWID_Activation.cmd index 61515a9..8f65bbd 100644 --- a/MAS/Separate-Files-Version/Activators/HWID_Activation.cmd +++ b/MAS/Separate-Files-Version/Activators/HWID_Activation.cmd @@ -293,34 +293,33 @@ set terminal= :: Check if script is running in Terminal app -set r1=$TB = [AppDomain]::CurrentDomain.DefineDynamicAssembly(4, 1).DefineDynamicModule(2, $False).DefineType(0); -set r2=%r1% [void]$TB.DefinePInvokeMethod('GetConsoleWindow', 'kernel32.dll', 22, 1, [IntPtr], @(), 1, 3).SetImplementationFlags(128); -set r3=%r2% [void]$TB.DefinePInvokeMethod('SendMessageW', 'user32.dll', 22, 1, [IntPtr], @([IntPtr], [UInt32], [IntPtr], [IntPtr]), 1, 3).SetImplementationFlags(128); -set d1=%r3% $hIcon = $TB.CreateType(); $hWnd = $hIcon::GetConsoleWindow(); -set d2=%d1% echo $($hIcon::SendMessageW($hWnd, 127, 0, 0) -ne [IntPtr]::Zero); - if defined terminal ( -%psc% "%d2%" %nul2% | find /i "True" %nul1% && set terminal= +set lines=0 +for /f "skip=2 tokens=2 delims=: " %%A in ('mode con') do if "!lines!"=="0" set lines=%%A +if !lines! GEQ 100 set terminal= ) -if defined ps32onArm goto :skipQE if %_unattended%==1 goto :skipQE for %%# in (%_args%) do (if /i "%%#"=="-qedit" goto :skipQE) +:: Relaunch to disable QuickEdit in the current session and use conhost.exe instead of the Terminal app +:: This code disables QuickEdit for the current cmd.exe session without making permanent registry changes +:: It is included because clicking on the script window can pause execution, causing confusion that the script has stopped due to an error + +set resetQE=1 +reg query HKCU\Console /v QuickEdit %nul2% | find /i "0x0" %nul1% && set resetQE=0 +reg add HKCU\Console /v QuickEdit /t REG_DWORD /d 0 /f %nul1% + if defined terminal ( -set "launchcmd=start conhost.exe %psc%" -) else ( -set "launchcmd=%psc%" +start conhost.exe "!_batf!" %_args% -qedit +start reg add HKCU\Console /v QuickEdit /t REG_DWORD /d %resetQE% /f %nul1% +exit /b +) else if %resetQE% EQU 1 ( +start cmd.exe /c ""!_batf!" %_args% -qedit" +start reg add HKCU\Console /v QuickEdit /t REG_DWORD /d %resetQE% /f %nul1% +exit /b ) -:: Disable QuickEdit in current session - -set "d1=$t=[AppDomain]::CurrentDomain.DefineDynamicAssembly(4, 1).DefineDynamicModule(2, $False).DefineType(0);" -set "d2=$t.DefinePInvokeMethod('GetStdHandle', 'kernel32.dll', 22, 1, [IntPtr], @([Int32]), 1, 3).SetImplementationFlags(128);" -set "d3=$t.DefinePInvokeMethod('SetConsoleMode', 'kernel32.dll', 22, 1, [Boolean], @([IntPtr], [Int32]), 1, 3).SetImplementationFlags(128);" -set "d4=$k=$t.CreateType(); $b=$k::SetConsoleMode($k::GetStdHandle(-10), 0x0080);" - -%launchcmd% "%d1% %d2% %d3% %d4% & cmd.exe '/c' '!_PSarg! -qedit'" && (exit /b) || (set terminal=1) :skipQE ::======================================================================================================================================== diff --git a/MAS/Separate-Files-Version/Activators/KMS38_Activation.cmd b/MAS/Separate-Files-Version/Activators/KMS38_Activation.cmd index 31e5bb0..bcac266 100644 --- a/MAS/Separate-Files-Version/Activators/KMS38_Activation.cmd +++ b/MAS/Separate-Files-Version/Activators/KMS38_Activation.cmd @@ -296,34 +296,33 @@ set terminal= :: Check if script is running in Terminal app -set r1=$TB = [AppDomain]::CurrentDomain.DefineDynamicAssembly(4, 1).DefineDynamicModule(2, $False).DefineType(0); -set r2=%r1% [void]$TB.DefinePInvokeMethod('GetConsoleWindow', 'kernel32.dll', 22, 1, [IntPtr], @(), 1, 3).SetImplementationFlags(128); -set r3=%r2% [void]$TB.DefinePInvokeMethod('SendMessageW', 'user32.dll', 22, 1, [IntPtr], @([IntPtr], [UInt32], [IntPtr], [IntPtr]), 1, 3).SetImplementationFlags(128); -set d1=%r3% $hIcon = $TB.CreateType(); $hWnd = $hIcon::GetConsoleWindow(); -set d2=%d1% echo $($hIcon::SendMessageW($hWnd, 127, 0, 0) -ne [IntPtr]::Zero); - if defined terminal ( -%psc% "%d2%" %nul2% | find /i "True" %nul1% && set terminal= +set lines=0 +for /f "skip=2 tokens=2 delims=: " %%A in ('mode con') do if "!lines!"=="0" set lines=%%A +if !lines! GEQ 100 set terminal= ) -if defined ps32onArm goto :skipQE if %_unattended%==1 goto :skipQE for %%# in (%_args%) do (if /i "%%#"=="-qedit" goto :skipQE) +:: Relaunch to disable QuickEdit in the current session and use conhost.exe instead of the Terminal app +:: This code disables QuickEdit for the current cmd.exe session without making permanent registry changes +:: It is included because clicking on the script window can pause execution, causing confusion that the script has stopped due to an error + +set resetQE=1 +reg query HKCU\Console /v QuickEdit %nul2% | find /i "0x0" %nul1% && set resetQE=0 +reg add HKCU\Console /v QuickEdit /t REG_DWORD /d 0 /f %nul1% + if defined terminal ( -set "launchcmd=start conhost.exe %psc%" -) else ( -set "launchcmd=%psc%" +start conhost.exe "!_batf!" %_args% -qedit +start reg add HKCU\Console /v QuickEdit /t REG_DWORD /d %resetQE% /f %nul1% +exit /b +) else if %resetQE% EQU 1 ( +start cmd.exe /c ""!_batf!" %_args% -qedit" +start reg add HKCU\Console /v QuickEdit /t REG_DWORD /d %resetQE% /f %nul1% +exit /b ) -:: Disable QuickEdit in current session - -set "d1=$t=[AppDomain]::CurrentDomain.DefineDynamicAssembly(4, 1).DefineDynamicModule(2, $False).DefineType(0);" -set "d2=$t.DefinePInvokeMethod('GetStdHandle', 'kernel32.dll', 22, 1, [IntPtr], @([Int32]), 1, 3).SetImplementationFlags(128);" -set "d3=$t.DefinePInvokeMethod('SetConsoleMode', 'kernel32.dll', 22, 1, [Boolean], @([IntPtr], [Int32]), 1, 3).SetImplementationFlags(128);" -set "d4=$k=$t.CreateType(); $b=$k::SetConsoleMode($k::GetStdHandle(-10), 0x0080);" - -%launchcmd% "%d1% %d2% %d3% %d4% & cmd.exe '/c' '!_PSarg! -qedit'" && (exit /b) || (set terminal=1) :skipQE ::======================================================================================================================================== diff --git a/MAS/Separate-Files-Version/Activators/Ohook_Activation_AIO.cmd b/MAS/Separate-Files-Version/Activators/Ohook_Activation_AIO.cmd index 186365e..e97586c 100644 --- a/MAS/Separate-Files-Version/Activators/Ohook_Activation_AIO.cmd +++ b/MAS/Separate-Files-Version/Activators/Ohook_Activation_AIO.cmd @@ -286,34 +286,33 @@ set terminal= :: Check if script is running in Terminal app -set r1=$TB = [AppDomain]::CurrentDomain.DefineDynamicAssembly(4, 1).DefineDynamicModule(2, $False).DefineType(0); -set r2=%r1% [void]$TB.DefinePInvokeMethod('GetConsoleWindow', 'kernel32.dll', 22, 1, [IntPtr], @(), 1, 3).SetImplementationFlags(128); -set r3=%r2% [void]$TB.DefinePInvokeMethod('SendMessageW', 'user32.dll', 22, 1, [IntPtr], @([IntPtr], [UInt32], [IntPtr], [IntPtr]), 1, 3).SetImplementationFlags(128); -set d1=%r3% $hIcon = $TB.CreateType(); $hWnd = $hIcon::GetConsoleWindow(); -set d2=%d1% echo $($hIcon::SendMessageW($hWnd, 127, 0, 0) -ne [IntPtr]::Zero); - if defined terminal ( -%psc% "%d2%" %nul2% | find /i "True" %nul1% && set terminal= +set lines=0 +for /f "skip=2 tokens=2 delims=: " %%A in ('mode con') do if "!lines!"=="0" set lines=%%A +if !lines! GEQ 100 set terminal= ) -if defined ps32onArm goto :skipQE if %_unattended%==1 goto :skipQE for %%# in (%_args%) do (if /i "%%#"=="-qedit" goto :skipQE) +:: Relaunch to disable QuickEdit in the current session and use conhost.exe instead of the Terminal app +:: This code disables QuickEdit for the current cmd.exe session without making permanent registry changes +:: It is included because clicking on the script window can pause execution, causing confusion that the script has stopped due to an error + +set resetQE=1 +reg query HKCU\Console /v QuickEdit %nul2% | find /i "0x0" %nul1% && set resetQE=0 +reg add HKCU\Console /v QuickEdit /t REG_DWORD /d 0 /f %nul1% + if defined terminal ( -set "launchcmd=start conhost.exe %psc%" -) else ( -set "launchcmd=%psc%" +start conhost.exe "!_batf!" %_args% -qedit +start reg add HKCU\Console /v QuickEdit /t REG_DWORD /d %resetQE% /f %nul1% +exit /b +) else if %resetQE% EQU 1 ( +start cmd.exe /c ""!_batf!" %_args% -qedit" +start reg add HKCU\Console /v QuickEdit /t REG_DWORD /d %resetQE% /f %nul1% +exit /b ) -:: Disable QuickEdit in current session - -set "d1=$t=[AppDomain]::CurrentDomain.DefineDynamicAssembly(4, 1).DefineDynamicModule(2, $False).DefineType(0);" -set "d2=$t.DefinePInvokeMethod('GetStdHandle', 'kernel32.dll', 22, 1, [IntPtr], @([Int32]), 1, 3).SetImplementationFlags(128);" -set "d3=$t.DefinePInvokeMethod('SetConsoleMode', 'kernel32.dll', 22, 1, [Boolean], @([IntPtr], [Int32]), 1, 3).SetImplementationFlags(128);" -set "d4=$k=$t.CreateType(); $b=$k::SetConsoleMode($k::GetStdHandle(-10), 0x0080);" - -%launchcmd% "%d1% %d2% %d3% %d4% & cmd.exe '/c' '!_PSarg! -qedit'" && (exit /b) || (set terminal=1) :skipQE ::======================================================================================================================================== diff --git a/MAS/Separate-Files-Version/Activators/Online_KMS_Activation.cmd b/MAS/Separate-Files-Version/Activators/Online_KMS_Activation.cmd index e1e40b3..6c652a2 100644 --- a/MAS/Separate-Files-Version/Activators/Online_KMS_Activation.cmd +++ b/MAS/Separate-Files-Version/Activators/Online_KMS_Activation.cmd @@ -315,34 +315,33 @@ set terminal= :: Check if script is running in Terminal app -set r1=$TB = [AppDomain]::CurrentDomain.DefineDynamicAssembly(4, 1).DefineDynamicModule(2, $False).DefineType(0); -set r2=%r1% [void]$TB.DefinePInvokeMethod('GetConsoleWindow', 'kernel32.dll', 22, 1, [IntPtr], @(), 1, 3).SetImplementationFlags(128); -set r3=%r2% [void]$TB.DefinePInvokeMethod('SendMessageW', 'user32.dll', 22, 1, [IntPtr], @([IntPtr], [UInt32], [IntPtr], [IntPtr]), 1, 3).SetImplementationFlags(128); -set d1=%r3% $hIcon = $TB.CreateType(); $hWnd = $hIcon::GetConsoleWindow(); -set d2=%d1% echo $($hIcon::SendMessageW($hWnd, 127, 0, 0) -ne [IntPtr]::Zero); - if defined terminal ( -%psc% "%d2%" %nul2% | find /i "True" %nul1% && set terminal= +set lines=0 +for /f "skip=2 tokens=2 delims=: " %%A in ('mode con') do if "!lines!"=="0" set lines=%%A +if !lines! GEQ 100 set terminal= ) -if defined ps32onArm goto :skipQE if %_unattended%==1 goto :skipQE for %%# in (%_args%) do (if /i "%%#"=="-qedit" goto :skipQE) +:: Relaunch to disable QuickEdit in the current session and use conhost.exe instead of the Terminal app +:: This code disables QuickEdit for the current cmd.exe session without making permanent registry changes +:: It is included because clicking on the script window can pause execution, causing confusion that the script has stopped due to an error + +set resetQE=1 +reg query HKCU\Console /v QuickEdit %nul2% | find /i "0x0" %nul1% && set resetQE=0 +reg add HKCU\Console /v QuickEdit /t REG_DWORD /d 0 /f %nul1% + if defined terminal ( -set "launchcmd=start conhost.exe %psc%" -) else ( -set "launchcmd=%psc%" +start conhost.exe "!_batf!" %_args% -qedit +start reg add HKCU\Console /v QuickEdit /t REG_DWORD /d %resetQE% /f %nul1% +exit /b +) else if %resetQE% EQU 1 ( +start cmd.exe /c ""!_batf!" %_args% -qedit" +start reg add HKCU\Console /v QuickEdit /t REG_DWORD /d %resetQE% /f %nul1% +exit /b ) -:: Disable QuickEdit in current session - -set "d1=$t=[AppDomain]::CurrentDomain.DefineDynamicAssembly(4, 1).DefineDynamicModule(2, $False).DefineType(0);" -set "d2=$t.DefinePInvokeMethod('GetStdHandle', 'kernel32.dll', 22, 1, [IntPtr], @([Int32]), 1, 3).SetImplementationFlags(128);" -set "d3=$t.DefinePInvokeMethod('SetConsoleMode', 'kernel32.dll', 22, 1, [Boolean], @([IntPtr], [Int32]), 1, 3).SetImplementationFlags(128);" -set "d4=$k=$t.CreateType(); $b=$k::SetConsoleMode($k::GetStdHandle(-10), 0x0080);" - -%launchcmd% "%d1% %d2% %d3% %d4% & cmd.exe '/c' '!_PSarg! -qedit'" && (exit /b) || (set terminal=1) :skipQE ::======================================================================================================================================== diff --git a/MAS/Separate-Files-Version/Activators/TSforge_Activation.cmd b/MAS/Separate-Files-Version/Activators/TSforge_Activation.cmd index d3559ee..4a9af9c 100644 --- a/MAS/Separate-Files-Version/Activators/TSforge_Activation.cmd +++ b/MAS/Separate-Files-Version/Activators/TSforge_Activation.cmd @@ -321,34 +321,33 @@ set terminal= :: Check if script is running in Terminal app -set r1=$TB = [AppDomain]::CurrentDomain.DefineDynamicAssembly(4, 1).DefineDynamicModule(2, $False).DefineType(0); -set r2=%r1% [void]$TB.DefinePInvokeMethod('GetConsoleWindow', 'kernel32.dll', 22, 1, [IntPtr], @(), 1, 3).SetImplementationFlags(128); -set r3=%r2% [void]$TB.DefinePInvokeMethod('SendMessageW', 'user32.dll', 22, 1, [IntPtr], @([IntPtr], [UInt32], [IntPtr], [IntPtr]), 1, 3).SetImplementationFlags(128); -set d1=%r3% $hIcon = $TB.CreateType(); $hWnd = $hIcon::GetConsoleWindow(); -set d2=%d1% echo $($hIcon::SendMessageW($hWnd, 127, 0, 0) -ne [IntPtr]::Zero); - if defined terminal ( -%psc% "%d2%" %nul2% | find /i "True" %nul1% && set terminal= +set lines=0 +for /f "skip=2 tokens=2 delims=: " %%A in ('mode con') do if "!lines!"=="0" set lines=%%A +if !lines! GEQ 100 set terminal= ) -if defined ps32onArm goto :skipQE if %_unattended%==1 goto :skipQE for %%# in (%_args%) do (if /i "%%#"=="-qedit" goto :skipQE) +:: Relaunch to disable QuickEdit in the current session and use conhost.exe instead of the Terminal app +:: This code disables QuickEdit for the current cmd.exe session without making permanent registry changes +:: It is included because clicking on the script window can pause execution, causing confusion that the script has stopped due to an error + +set resetQE=1 +reg query HKCU\Console /v QuickEdit %nul2% | find /i "0x0" %nul1% && set resetQE=0 +reg add HKCU\Console /v QuickEdit /t REG_DWORD /d 0 /f %nul1% + if defined terminal ( -set "launchcmd=start conhost.exe %psc%" -) else ( -set "launchcmd=%psc%" +start conhost.exe "!_batf!" %_args% -qedit +start reg add HKCU\Console /v QuickEdit /t REG_DWORD /d %resetQE% /f %nul1% +exit /b +) else if %resetQE% EQU 1 ( +start cmd.exe /c ""!_batf!" %_args% -qedit" +start reg add HKCU\Console /v QuickEdit /t REG_DWORD /d %resetQE% /f %nul1% +exit /b ) -:: Disable QuickEdit in current session - -set "d1=$t=[AppDomain]::CurrentDomain.DefineDynamicAssembly(4, 1).DefineDynamicModule(2, $False).DefineType(0);" -set "d2=$t.DefinePInvokeMethod('GetStdHandle', 'kernel32.dll', 22, 1, [IntPtr], @([Int32]), 1, 3).SetImplementationFlags(128);" -set "d3=$t.DefinePInvokeMethod('SetConsoleMode', 'kernel32.dll', 22, 1, [Boolean], @([IntPtr], [Int32]), 1, 3).SetImplementationFlags(128);" -set "d4=$k=$t.CreateType(); $b=$k::SetConsoleMode($k::GetStdHandle(-10), 0x0080);" - -%launchcmd% "%d1% %d2% %d3% %d4% & cmd.exe '/c' '!_PSarg! -qedit'" && (exit /b) || (set terminal=1) :skipQE ::======================================================================================================================================== diff --git a/MAS/Separate-Files-Version/Change_Office_Edition.cmd b/MAS/Separate-Files-Version/Change_Office_Edition.cmd index 0e71bb4..264a58e 100644 --- a/MAS/Separate-Files-Version/Change_Office_Edition.cmd +++ b/MAS/Separate-Files-Version/Change_Office_Edition.cmd @@ -246,34 +246,33 @@ set terminal= :: Check if script is running in Terminal app -set r1=$TB = [AppDomain]::CurrentDomain.DefineDynamicAssembly(4, 1).DefineDynamicModule(2, $False).DefineType(0); -set r2=%r1% [void]$TB.DefinePInvokeMethod('GetConsoleWindow', 'kernel32.dll', 22, 1, [IntPtr], @(), 1, 3).SetImplementationFlags(128); -set r3=%r2% [void]$TB.DefinePInvokeMethod('SendMessageW', 'user32.dll', 22, 1, [IntPtr], @([IntPtr], [UInt32], [IntPtr], [IntPtr]), 1, 3).SetImplementationFlags(128); -set d1=%r3% $hIcon = $TB.CreateType(); $hWnd = $hIcon::GetConsoleWindow(); -set d2=%d1% echo $($hIcon::SendMessageW($hWnd, 127, 0, 0) -ne [IntPtr]::Zero); - if defined terminal ( -%psc% "%d2%" %nul2% | find /i "True" %nul1% && set terminal= +set lines=0 +for /f "skip=2 tokens=2 delims=: " %%A in ('mode con') do if "!lines!"=="0" set lines=%%A +if !lines! GEQ 100 set terminal= ) -if defined ps32onArm goto :skipQE if %_unattended%==1 goto :skipQE for %%# in (%_args%) do (if /i "%%#"=="-qedit" goto :skipQE) +:: Relaunch to disable QuickEdit in the current session and use conhost.exe instead of the Terminal app +:: This code disables QuickEdit for the current cmd.exe session without making permanent registry changes +:: It is included because clicking on the script window can pause execution, causing confusion that the script has stopped due to an error + +set resetQE=1 +reg query HKCU\Console /v QuickEdit %nul2% | find /i "0x0" %nul1% && set resetQE=0 +reg add HKCU\Console /v QuickEdit /t REG_DWORD /d 0 /f %nul1% + if defined terminal ( -set "launchcmd=start conhost.exe %psc%" -) else ( -set "launchcmd=%psc%" +start conhost.exe "!_batf!" %_args% -qedit +start reg add HKCU\Console /v QuickEdit /t REG_DWORD /d %resetQE% /f %nul1% +exit /b +) else if %resetQE% EQU 1 ( +start cmd.exe /c ""!_batf!" %_args% -qedit" +start reg add HKCU\Console /v QuickEdit /t REG_DWORD /d %resetQE% /f %nul1% +exit /b ) -:: Disable QuickEdit in current session - -set "d1=$t=[AppDomain]::CurrentDomain.DefineDynamicAssembly(4, 1).DefineDynamicModule(2, $False).DefineType(0);" -set "d2=$t.DefinePInvokeMethod('GetStdHandle', 'kernel32.dll', 22, 1, [IntPtr], @([Int32]), 1, 3).SetImplementationFlags(128);" -set "d3=$t.DefinePInvokeMethod('SetConsoleMode', 'kernel32.dll', 22, 1, [Boolean], @([IntPtr], [Int32]), 1, 3).SetImplementationFlags(128);" -set "d4=$k=$t.CreateType(); $b=$k::SetConsoleMode($k::GetStdHandle(-10), 0x0080);" - -%launchcmd% "%d1% %d2% %d3% %d4% & cmd.exe '/c' '!_PSarg! -qedit'" && (exit /b) || (set terminal=1) :skipQE ::======================================================================================================================================== diff --git a/MAS/Separate-Files-Version/Change_Windows_Edition.cmd b/MAS/Separate-Files-Version/Change_Windows_Edition.cmd index c9a5155..37b02c1 100644 --- a/MAS/Separate-Files-Version/Change_Windows_Edition.cmd +++ b/MAS/Separate-Files-Version/Change_Windows_Edition.cmd @@ -251,34 +251,33 @@ set terminal= :: Check if script is running in Terminal app -set r1=$TB = [AppDomain]::CurrentDomain.DefineDynamicAssembly(4, 1).DefineDynamicModule(2, $False).DefineType(0); -set r2=%r1% [void]$TB.DefinePInvokeMethod('GetConsoleWindow', 'kernel32.dll', 22, 1, [IntPtr], @(), 1, 3).SetImplementationFlags(128); -set r3=%r2% [void]$TB.DefinePInvokeMethod('SendMessageW', 'user32.dll', 22, 1, [IntPtr], @([IntPtr], [UInt32], [IntPtr], [IntPtr]), 1, 3).SetImplementationFlags(128); -set d1=%r3% $hIcon = $TB.CreateType(); $hWnd = $hIcon::GetConsoleWindow(); -set d2=%d1% echo $($hIcon::SendMessageW($hWnd, 127, 0, 0) -ne [IntPtr]::Zero); - if defined terminal ( -%psc% "%d2%" %nul2% | find /i "True" %nul1% && set terminal= +set lines=0 +for /f "skip=2 tokens=2 delims=: " %%A in ('mode con') do if "!lines!"=="0" set lines=%%A +if !lines! GEQ 100 set terminal= ) -if defined ps32onArm goto :skipQE if %_unattended%==1 goto :skipQE for %%# in (%_args%) do (if /i "%%#"=="-qedit" goto :skipQE) +:: Relaunch to disable QuickEdit in the current session and use conhost.exe instead of the Terminal app +:: This code disables QuickEdit for the current cmd.exe session without making permanent registry changes +:: It is included because clicking on the script window can pause execution, causing confusion that the script has stopped due to an error + +set resetQE=1 +reg query HKCU\Console /v QuickEdit %nul2% | find /i "0x0" %nul1% && set resetQE=0 +reg add HKCU\Console /v QuickEdit /t REG_DWORD /d 0 /f %nul1% + if defined terminal ( -set "launchcmd=start conhost.exe %psc%" -) else ( -set "launchcmd=%psc%" +start conhost.exe "!_batf!" %_args% -qedit +start reg add HKCU\Console /v QuickEdit /t REG_DWORD /d %resetQE% /f %nul1% +exit /b +) else if %resetQE% EQU 1 ( +start cmd.exe /c ""!_batf!" %_args% -qedit" +start reg add HKCU\Console /v QuickEdit /t REG_DWORD /d %resetQE% /f %nul1% +exit /b ) -:: Disable QuickEdit in current session - -set "d1=$t=[AppDomain]::CurrentDomain.DefineDynamicAssembly(4, 1).DefineDynamicModule(2, $False).DefineType(0);" -set "d2=$t.DefinePInvokeMethod('GetStdHandle', 'kernel32.dll', 22, 1, [IntPtr], @([Int32]), 1, 3).SetImplementationFlags(128);" -set "d3=$t.DefinePInvokeMethod('SetConsoleMode', 'kernel32.dll', 22, 1, [Boolean], @([IntPtr], [Int32]), 1, 3).SetImplementationFlags(128);" -set "d4=$k=$t.CreateType(); $b=$k::SetConsoleMode($k::GetStdHandle(-10), 0x0080);" - -%launchcmd% "%d1% %d2% %d3% %d4% & cmd.exe '/c' '!_PSarg! -qedit'" && (exit /b) || (set terminal=1) :skipQE ::======================================================================================================================================== diff --git a/MAS/Separate-Files-Version/Extract_OEM_Folder.cmd b/MAS/Separate-Files-Version/Extract_OEM_Folder.cmd index e9db519..df142d4 100644 --- a/MAS/Separate-Files-Version/Extract_OEM_Folder.cmd +++ b/MAS/Separate-Files-Version/Extract_OEM_Folder.cmd @@ -245,34 +245,33 @@ set terminal= :: Check if script is running in Terminal app -set r1=$TB = [AppDomain]::CurrentDomain.DefineDynamicAssembly(4, 1).DefineDynamicModule(2, $False).DefineType(0); -set r2=%r1% [void]$TB.DefinePInvokeMethod('GetConsoleWindow', 'kernel32.dll', 22, 1, [IntPtr], @(), 1, 3).SetImplementationFlags(128); -set r3=%r2% [void]$TB.DefinePInvokeMethod('SendMessageW', 'user32.dll', 22, 1, [IntPtr], @([IntPtr], [UInt32], [IntPtr], [IntPtr]), 1, 3).SetImplementationFlags(128); -set d1=%r3% $hIcon = $TB.CreateType(); $hWnd = $hIcon::GetConsoleWindow(); -set d2=%d1% echo $($hIcon::SendMessageW($hWnd, 127, 0, 0) -ne [IntPtr]::Zero); - if defined terminal ( -%psc% "%d2%" %nul2% | find /i "True" %nul1% && set terminal= +set lines=0 +for /f "skip=2 tokens=2 delims=: " %%A in ('mode con') do if "!lines!"=="0" set lines=%%A +if !lines! GEQ 100 set terminal= ) -if defined ps32onArm goto :skipQE if %_unattended%==1 goto :skipQE for %%# in (%_args%) do (if /i "%%#"=="-qedit" goto :skipQE) +:: Relaunch to disable QuickEdit in the current session and use conhost.exe instead of the Terminal app +:: This code disables QuickEdit for the current cmd.exe session without making permanent registry changes +:: It is included because clicking on the script window can pause execution, causing confusion that the script has stopped due to an error + +set resetQE=1 +reg query HKCU\Console /v QuickEdit %nul2% | find /i "0x0" %nul1% && set resetQE=0 +reg add HKCU\Console /v QuickEdit /t REG_DWORD /d 0 /f %nul1% + if defined terminal ( -set "launchcmd=start conhost.exe %psc%" -) else ( -set "launchcmd=%psc%" +start conhost.exe "!_batf!" %_args% -qedit +start reg add HKCU\Console /v QuickEdit /t REG_DWORD /d %resetQE% /f %nul1% +exit /b +) else if %resetQE% EQU 1 ( +start cmd.exe /c ""!_batf!" %_args% -qedit" +start reg add HKCU\Console /v QuickEdit /t REG_DWORD /d %resetQE% /f %nul1% +exit /b ) -:: Disable QuickEdit in current session - -set "d1=$t=[AppDomain]::CurrentDomain.DefineDynamicAssembly(4, 1).DefineDynamicModule(2, $False).DefineType(0);" -set "d2=$t.DefinePInvokeMethod('GetStdHandle', 'kernel32.dll', 22, 1, [IntPtr], @([Int32]), 1, 3).SetImplementationFlags(128);" -set "d3=$t.DefinePInvokeMethod('SetConsoleMode', 'kernel32.dll', 22, 1, [Boolean], @([IntPtr], [Int32]), 1, 3).SetImplementationFlags(128);" -set "d4=$k=$t.CreateType(); $b=$k::SetConsoleMode($k::GetStdHandle(-10), 0x0080);" - -%launchcmd% "%d1% %d2% %d3% %d4% & cmd.exe '/c' '!_PSarg! -qedit'" && (exit /b) || (set terminal=1) :skipQE ::======================================================================================================================================== diff --git a/MAS/Separate-Files-Version/Troubleshoot.cmd b/MAS/Separate-Files-Version/Troubleshoot.cmd index 818091f..483f6da 100644 --- a/MAS/Separate-Files-Version/Troubleshoot.cmd +++ b/MAS/Separate-Files-Version/Troubleshoot.cmd @@ -246,34 +246,33 @@ set terminal= :: Check if script is running in Terminal app -set r1=$TB = [AppDomain]::CurrentDomain.DefineDynamicAssembly(4, 1).DefineDynamicModule(2, $False).DefineType(0); -set r2=%r1% [void]$TB.DefinePInvokeMethod('GetConsoleWindow', 'kernel32.dll', 22, 1, [IntPtr], @(), 1, 3).SetImplementationFlags(128); -set r3=%r2% [void]$TB.DefinePInvokeMethod('SendMessageW', 'user32.dll', 22, 1, [IntPtr], @([IntPtr], [UInt32], [IntPtr], [IntPtr]), 1, 3).SetImplementationFlags(128); -set d1=%r3% $hIcon = $TB.CreateType(); $hWnd = $hIcon::GetConsoleWindow(); -set d2=%d1% echo $($hIcon::SendMessageW($hWnd, 127, 0, 0) -ne [IntPtr]::Zero); - if defined terminal ( -%psc% "%d2%" %nul2% | find /i "True" %nul1% && set terminal= +set lines=0 +for /f "skip=2 tokens=2 delims=: " %%A in ('mode con') do if "!lines!"=="0" set lines=%%A +if !lines! GEQ 100 set terminal= ) -if defined ps32onArm goto :skipQE if %_unattended%==1 goto :skipQE for %%# in (%_args%) do (if /i "%%#"=="-qedit" goto :skipQE) +:: Relaunch to disable QuickEdit in the current session and use conhost.exe instead of the Terminal app +:: This code disables QuickEdit for the current cmd.exe session without making permanent registry changes +:: It is included because clicking on the script window can pause execution, causing confusion that the script has stopped due to an error + +set resetQE=1 +reg query HKCU\Console /v QuickEdit %nul2% | find /i "0x0" %nul1% && set resetQE=0 +reg add HKCU\Console /v QuickEdit /t REG_DWORD /d 0 /f %nul1% + if defined terminal ( -set "launchcmd=start conhost.exe %psc%" -) else ( -set "launchcmd=%psc%" +start conhost.exe "!_batf!" %_args% -qedit +start reg add HKCU\Console /v QuickEdit /t REG_DWORD /d %resetQE% /f %nul1% +exit /b +) else if %resetQE% EQU 1 ( +start cmd.exe /c ""!_batf!" %_args% -qedit" +start reg add HKCU\Console /v QuickEdit /t REG_DWORD /d %resetQE% /f %nul1% +exit /b ) -:: Disable QuickEdit in current session - -set "d1=$t=[AppDomain]::CurrentDomain.DefineDynamicAssembly(4, 1).DefineDynamicModule(2, $False).DefineType(0);" -set "d2=$t.DefinePInvokeMethod('GetStdHandle', 'kernel32.dll', 22, 1, [IntPtr], @([Int32]), 1, 3).SetImplementationFlags(128);" -set "d3=$t.DefinePInvokeMethod('SetConsoleMode', 'kernel32.dll', 22, 1, [Boolean], @([IntPtr], [Int32]), 1, 3).SetImplementationFlags(128);" -set "d4=$k=$t.CreateType(); $b=$k::SetConsoleMode($k::GetStdHandle(-10), 0x0080);" - -%launchcmd% "%d1% %d2% %d3% %d4% & cmd.exe '/c' '!_PSarg! -qedit'" && (exit /b) || (set terminal=1) :skipQE ::======================================================================================================================================== From 0d61475468de80b7f711038384e754331a14c7d8 Mon Sep 17 00:00:00 2001 From: WindowsAddict Date: Tue, 15 Apr 2025 07:02:19 +0530 Subject: [PATCH 19/79] Fix an issue where Office doesn't need activation but TSforge would show phone license missing error --- MAS/All-In-One-Version-KL/MAS_AIO.cmd | 25 +++++++++++++++++++ .../Activators/TSforge_Activation.cmd | 25 +++++++++++++++++++ 2 files changed, 50 insertions(+) diff --git a/MAS/All-In-One-Version-KL/MAS_AIO.cmd b/MAS/All-In-One-Version-KL/MAS_AIO.cmd index 2a42c2b..4410980 100644 --- a/MAS/All-In-One-Version-KL/MAS_AIO.cmd +++ b/MAS/All-In-One-Version-KL/MAS_AIO.cmd @@ -8874,6 +8874,24 @@ function Get-WmiInfo { } } +function slGetSkuInfo($SkuId) { + $t = [AppDomain]::CurrentDomain.DefineDynamicAssembly(4, 1).DefineDynamicModule(2, $False).DefineType(0) + $t.DefinePInvokeMethod('SLOpen', 'slc.dll', 22, 1, [Int32], @([IntPtr].MakeByRefType()), 1, 3).SetImplementationFlags(128) + $t.DefinePInvokeMethod('SLClose', 'slc.dll', 22, 1, [IntPtr], @([IntPtr]), 1, 3).SetImplementationFlags(128) + $t.DefinePInvokeMethod('SLGetProductSkuInformation', 'slc.dll', 22, 1, [Int32], @([IntPtr], [Guid].MakeByRefType(), [String], [UInt32].MakeByRefType(), [UInt32].MakeByRefType(), [IntPtr].MakeByRefType()), 1, 3).SetImplementationFlags(128) + $w = $t.CreateType() + $hSLC = 0 + try { + [void]$w::SLOpen([ref]$hSLC) + $c = 0; $b = 0 + $r = $w::SLGetProductSkuInformation($hSLC, [ref][Guid]$SkuId, "msft:sl/EUL/PHONE/PUBLIC", [ref]$null, [ref]$c, [ref]$b) + return ($r -eq 0) + } + finally { + [void]$w::SLClose($hSLC) + } +} + if ($env:resetstuff -eq $null) { foreach ($tsactid in $tsactids) { try { @@ -8884,6 +8902,13 @@ if ($env:resetstuff -eq $null) { $prodName = if ($nameParts.Count -gt 1) { ($nameParts[1].Trim() -split '[ ,]')[0] } else { $null } } [LibTSforge.Modifiers.GenPKeyInstall]::InstallGenPKey($ver, $prod, $tsactid) + if ($prodName -match 'Office' -and -not (slGetSkuInfo($tsactid))) { + $licenseStatus = Get-WmiInfo -tsactid $tsactid -property "LicenseStatus" + if ($licenseStatus -eq 1) { + Write-Host "[$prodName] is already permanently activated." -ForegroundColor White -BackgroundColor DarkGreen + continue + } + } [LibTSforge.Activators.ZeroCID]::Activate($ver, $prod, $tsactid) $licenseStatus = Get-WmiInfo -tsactid $tsactid -property "LicenseStatus" if ($licenseStatus -eq 1) { diff --git a/MAS/Separate-Files-Version/Activators/TSforge_Activation.cmd b/MAS/Separate-Files-Version/Activators/TSforge_Activation.cmd index 4a9af9c..3330a77 100644 --- a/MAS/Separate-Files-Version/Activators/TSforge_Activation.cmd +++ b/MAS/Separate-Files-Version/Activators/TSforge_Activation.cmd @@ -6747,6 +6747,24 @@ function Get-WmiInfo { } } +function slGetSkuInfo($SkuId) { + $t = [AppDomain]::CurrentDomain.DefineDynamicAssembly(4, 1).DefineDynamicModule(2, $False).DefineType(0) + $t.DefinePInvokeMethod('SLOpen', 'slc.dll', 22, 1, [Int32], @([IntPtr].MakeByRefType()), 1, 3).SetImplementationFlags(128) + $t.DefinePInvokeMethod('SLClose', 'slc.dll', 22, 1, [IntPtr], @([IntPtr]), 1, 3).SetImplementationFlags(128) + $t.DefinePInvokeMethod('SLGetProductSkuInformation', 'slc.dll', 22, 1, [Int32], @([IntPtr], [Guid].MakeByRefType(), [String], [UInt32].MakeByRefType(), [UInt32].MakeByRefType(), [IntPtr].MakeByRefType()), 1, 3).SetImplementationFlags(128) + $w = $t.CreateType() + $hSLC = 0 + try { + [void]$w::SLOpen([ref]$hSLC) + $c = 0; $b = 0 + $r = $w::SLGetProductSkuInformation($hSLC, [ref][Guid]$SkuId, "msft:sl/EUL/PHONE/PUBLIC", [ref]$null, [ref]$c, [ref]$b) + return ($r -eq 0) + } + finally { + [void]$w::SLClose($hSLC) + } +} + if ($env:resetstuff -eq $null) { foreach ($tsactid in $tsactids) { try { @@ -6757,6 +6775,13 @@ if ($env:resetstuff -eq $null) { $prodName = if ($nameParts.Count -gt 1) { ($nameParts[1].Trim() -split '[ ,]')[0] } else { $null } } [LibTSforge.Modifiers.GenPKeyInstall]::InstallGenPKey($ver, $prod, $tsactid) + if ($prodName -match 'Office' -and -not (slGetSkuInfo($tsactid))) { + $licenseStatus = Get-WmiInfo -tsactid $tsactid -property "LicenseStatus" + if ($licenseStatus -eq 1) { + Write-Host "[$prodName] is already permanently activated." -ForegroundColor White -BackgroundColor DarkGreen + continue + } + } [LibTSforge.Activators.ZeroCID]::Activate($ver, $prod, $tsactid) $licenseStatus = Get-WmiInfo -tsactid $tsactid -property "LicenseStatus" if ($licenseStatus -eq 1) { From f5a0a63165d9e6b57719f48322baac60e29a2e6a Mon Sep 17 00:00:00 2001 From: WindowsAddict Date: Tue, 15 Apr 2025 08:39:39 +0530 Subject: [PATCH 20/79] Cleanup leftover branding.xml related code --- MAS/All-In-One-Version-KL/MAS_AIO.cmd | 61 ++----------------- .../Activators/Ohook_Activation_AIO.cmd | 15 ----- .../Activators/Online_KMS_Activation.cmd | 41 ++----------- .../Activators/TSforge_Activation.cmd | 15 ----- 4 files changed, 12 insertions(+), 120 deletions(-) diff --git a/MAS/All-In-One-Version-KL/MAS_AIO.cmd b/MAS/All-In-One-Version-KL/MAS_AIO.cmd index 4410980..fc5db47 100644 --- a/MAS/All-In-One-Version-KL/MAS_AIO.cmd +++ b/MAS/All-In-One-Version-KL/MAS_AIO.cmd @@ -2608,7 +2608,6 @@ set _prids= set _config= set _version= set _License= -set _oBranding= exit /b ::======================================================================================================================================== @@ -2862,20 +2861,11 @@ set "_common=%CommonProgramFiles%" if defined PROCESSOR_ARCHITEW6432 set "_common=%CommonProgramW6432%" set "_common2=%CommonProgramFiles(x86)%" -for /r "%_common%\Microsoft Shared\OFFICE%oVer%\" %%f in (BRANDING.XML) do if exist "%%f" set "_oBranding=%%f" -if not defined _oBranding for /r "%_common2%\Microsoft Shared\OFFICE%oVer%\" %%f in (BRANDING.XML) do if exist "%%f" set "_oBranding=%%f" - call :msiofficedata %2 echo: echo Activating Office... [MSI ^| %_version% ^| %_oArch%] -if not defined _oBranding ( -set error=1 -call :dk_color %Red% "Checking BRANDING.XML [Not Found, aborting activation...]" -exit /b -) - if not defined _oIds ( set error=1 call :dk_color %Red% "Checking Installed Products [Product IDs not found, aborting activation...]" @@ -4790,7 +4780,6 @@ set _prids= set _config= set _version= set _License= -set _oBranding= exit /b ::======================================================================================================================================== @@ -4910,9 +4899,6 @@ set "_common=%CommonProgramFiles%" if defined PROCESSOR_ARCHITEW6432 set "_common=%CommonProgramW6432%" set "_common2=%CommonProgramFiles(x86)%" -for /r "%_common%\Microsoft Shared\OFFICE%oVer%\" %%f in (BRANDING.XML) do if exist "%%f" set "_oBranding=%%f" -if not defined _oBranding for /r "%_common2%\Microsoft Shared\OFFICE%oVer%\" %%f in (BRANDING.XML) do if exist "%%f" set "_oBranding=%%f" - if exist "%_common%\Microsoft Shared\OFFICE%oVer%\Office Setup Controller\pkeyconfig-office.xrm-ms" ( set "pkeypath=%_common%\Microsoft Shared\OFFICE%oVer%\Office Setup Controller\pkeyconfig-office.xrm-ms" ) else if exist "%_common2%\Microsoft Shared\OFFICE%oVer%\Office Setup Controller\pkeyconfig-office.xrm-ms" ( @@ -4924,12 +4910,6 @@ call :msiofficedata %2 echo: echo Processing Office... [MSI ^| %_version% ^| %_oArch%] -if not defined _oBranding ( -set error=1 -call :dk_color %Red% "Checking BRANDING.XML [Not Found. Aborting activation...]" -exit /b -) - if not defined _oIds ( set error=1 call :dk_color %Red% "Checking Installed Products [Product IDs not found. Aborting activation...]" @@ -10951,7 +10931,7 @@ set _prids= set _config= set _version= set _License= -set _oBranding= +set _oMSI= exit /b ::======================================================================================================================================== @@ -11033,7 +11013,7 @@ exit /b for %%# in (%_oIds%) do ( set skipprocess= -if %_NoEditionChange%==1 if not defined _oBranding ( +if %_NoEditionChange%==1 if not defined _oMSI ( set foundprod= call :ksdata chkprod %%# if not defined foundprod ( @@ -11082,7 +11062,7 @@ if not "!key!"=="" ( echo "!allapps!" | find /i "!_actid!" %nul1% || call :oh_installlic call :dk_inskey "[!key!] [!_prod!]" ) else ( -if not defined _oBranding ( +if not defined _oMSI ( set error=1 call :dk_color %Red% "Checking Product In Script [Office %oVer%.0 !_prod! not found in script]" call :dk_color %Blue% "Make sure you are using Latest MAS script." @@ -11105,6 +11085,7 @@ exit /b :: Process Office MSI Version call :ks_reset +set _oMSI=1 if "%1"=="14" ( call :dk_actids 59a52881-a989-479d-af46-f275c6370663 @@ -11125,21 +11106,11 @@ set "_common=%CommonProgramFiles%" if defined PROCESSOR_ARCHITEW6432 set "_common=%CommonProgramW6432%" set "_common2=%CommonProgramFiles(x86)%" -for /r "%_common%\Microsoft Shared\OFFICE%oVer%\" %%f in (BRANDING.XML) do if exist "%%f" set "_oBranding=%%f" -if not defined _oBranding for /r "%_common2%\Microsoft Shared\OFFICE%oVer%\" %%f in (BRANDING.XML) do if exist "%%f" set "_oBranding=%%f" - -call :ksdata getmsiprod %2 -call :msiofficedata %2 getmsiret +call :msiofficedata %2 echo: echo Processing Office... [MSI ^| %_version% ^| %_oArch%] -if not defined _oBranding ( -set error=1 -call :dk_color %Red% "Checking BRANDING.XML [Not Found. Aborting activation...]" -exit /b -) - if not defined _oIds ( set error=1 call :dk_color %Red% "Checking Installed Products [Product IDs not found. Aborting activation...]" @@ -12159,18 +12130,13 @@ for %%# in ( ) do ( for /f "tokens=1-5 delims=_" %%A in ("%%#") do ( -set getIds=1 if "%oVer%"=="%%A" ( -if /i "%2"=="getmsiret" (echo %%D | findstr /i "Volume VL" %nul% && set getIds=) - -if defined getIds ( reg query "%1\Registration\{%%B}" /v ProductCode %nul2% | find /i "-%%C-" %nul% && ( reg query "%1\Common\InstalledPackages" %nul2% | find /i "-%%C-" %nul% && ( if defined _oIds (set _oIds=!_oIds! %%D) else (set _oIds=%%D) ) ) ) -) ) ) @@ -12443,7 +12409,7 @@ if /i "%2"=="%%D" ( set key=%%B set _actid=%%A set _allactid=!_allactid! %%A -) else if not defined _oBranding if %_NoEditionChange%==0 ( +) else if not defined _oMSI if %_NoEditionChange%==0 ( echo: %%E | find /i "-%2-" %nul% && ( set key=%%B set _altoffid=%%D @@ -12453,21 +12419,6 @@ set _allactid=!_allactid! %%A ) ) -if %1==getmsiprod if "%oVer%"=="%%C" ( -for /f "tokens=*" %%x in ('findstr /i /c:"%%A" "%_oBranding%"') do set "prodId=%%x" -set prodId=!prodId:"/>=! -set prodId=!prodId:~-4! -if "%oVer%"=="14" ( -REM Exception case for Visio because wrong primary product ID is mentioned in Branding.xml -echo %%D | find /i "Visio" %nul% && set prodId=0057 -) -reg query "%2\Registration\{%%A}" /v ProductCode %nul2% | find /i "-!prodId!-" %nul% && ( -reg query "%2\Common\InstalledPackages" %nul2% | find /i "-!prodId!-" %nul% && ( -if defined _oIds (set _oIds=!_oIds! %%D) else (set _oIds=%%D) -) -) -) - ) ) exit /b diff --git a/MAS/Separate-Files-Version/Activators/Ohook_Activation_AIO.cmd b/MAS/Separate-Files-Version/Activators/Ohook_Activation_AIO.cmd index e97586c..04b78db 100644 --- a/MAS/Separate-Files-Version/Activators/Ohook_Activation_AIO.cmd +++ b/MAS/Separate-Files-Version/Activators/Ohook_Activation_AIO.cmd @@ -823,7 +823,6 @@ set _prids= set _config= set _version= set _License= -set _oBranding= exit /b ::======================================================================================================================================== @@ -1077,20 +1076,11 @@ set "_common=%CommonProgramFiles%" if defined PROCESSOR_ARCHITEW6432 set "_common=%CommonProgramW6432%" set "_common2=%CommonProgramFiles(x86)%" -for /r "%_common%\Microsoft Shared\OFFICE%oVer%\" %%f in (BRANDING.XML) do if exist "%%f" set "_oBranding=%%f" -if not defined _oBranding for /r "%_common2%\Microsoft Shared\OFFICE%oVer%\" %%f in (BRANDING.XML) do if exist "%%f" set "_oBranding=%%f" - call :msiofficedata %2 echo: echo Activating Office... [MSI ^| %_version% ^| %_oArch%] -if not defined _oBranding ( -set error=1 -call :dk_color %Red% "Checking BRANDING.XML [Not Found, aborting activation...]" -exit /b -) - if not defined _oIds ( set error=1 call :dk_color %Red% "Checking Installed Products [Product IDs not found, aborting activation...]" @@ -2475,18 +2465,13 @@ for %%# in ( ) do ( for /f "tokens=1-5 delims=_" %%A in ("%%#") do ( -set getIds=1 if "%oVer%"=="%%A" ( -if /i "%2"=="getmsiret" (echo %%D | findstr /i "Volume VL" %nul% && set getIds=) - -if defined getIds ( reg query "%1\Registration\{%%B}" /v ProductCode %nul2% | find /i "-%%C-" %nul% && ( reg query "%1\Common\InstalledPackages" %nul2% | find /i "-%%C-" %nul% && ( if defined _oIds (set _oIds=!_oIds! %%D) else (set _oIds=%%D) ) ) ) -) ) ) diff --git a/MAS/Separate-Files-Version/Activators/Online_KMS_Activation.cmd b/MAS/Separate-Files-Version/Activators/Online_KMS_Activation.cmd index 6c652a2..d8759e2 100644 --- a/MAS/Separate-Files-Version/Activators/Online_KMS_Activation.cmd +++ b/MAS/Separate-Files-Version/Activators/Online_KMS_Activation.cmd @@ -1029,7 +1029,7 @@ set _prids= set _config= set _version= set _License= -set _oBranding= +set _oMSI= exit /b ::======================================================================================================================================== @@ -1143,7 +1143,7 @@ exit /b for %%# in (%_oIds%) do ( set skipprocess= -if %_NoEditionChange%==1 if not defined _oBranding ( +if %_NoEditionChange%==1 if not defined _oMSI ( set foundprod= call :ksdata chkprod %%# if not defined foundprod ( @@ -1192,7 +1192,7 @@ if not "!key!"=="" ( echo "!allapps!" | find /i "!_actid!" %nul1% || call :oh_installlic call :dk_inskey "[!key!] [!_prod!]" ) else ( -if not defined _oBranding ( +if not defined _oMSI ( set error=1 call :dk_color %Red% "Checking Product In Script [Office %oVer%.0 !_prod! not found in script]" call :dk_color %Blue% "Make sure you are using Latest MAS script." @@ -1215,6 +1215,7 @@ exit /b :: Process Office MSI Version call :ks_reset +set _oMSI=1 if "%1"=="14" ( call :dk_actids 59a52881-a989-479d-af46-f275c6370663 @@ -1235,21 +1236,11 @@ set "_common=%CommonProgramFiles%" if defined PROCESSOR_ARCHITEW6432 set "_common=%CommonProgramW6432%" set "_common2=%CommonProgramFiles(x86)%" -for /r "%_common%\Microsoft Shared\OFFICE%oVer%\" %%f in (BRANDING.XML) do if exist "%%f" set "_oBranding=%%f" -if not defined _oBranding for /r "%_common2%\Microsoft Shared\OFFICE%oVer%\" %%f in (BRANDING.XML) do if exist "%%f" set "_oBranding=%%f" - -call :ksdata getmsiprod %2 -call :msiofficedata %2 getmsiret +call :msiofficedata %2 echo: echo Processing Office... [MSI ^| %_version% ^| %_oArch%] -if not defined _oBranding ( -set error=1 -call :dk_color %Red% "Checking BRANDING.XML [Not Found. Aborting activation...]" -exit /b -) - if not defined _oIds ( set error=1 call :dk_color %Red% "Checking Installed Products [Product IDs not found. Aborting activation...]" @@ -3450,18 +3441,13 @@ for %%# in ( ) do ( for /f "tokens=1-5 delims=_" %%A in ("%%#") do ( -set getIds=1 if "%oVer%"=="%%A" ( -if /i "%2"=="getmsiret" (echo %%D | findstr /i "Volume VL" %nul% && set getIds=) - -if defined getIds ( reg query "%1\Registration\{%%B}" /v ProductCode %nul2% | find /i "-%%C-" %nul% && ( reg query "%1\Common\InstalledPackages" %nul2% | find /i "-%%C-" %nul% && ( if defined _oIds (set _oIds=!_oIds! %%D) else (set _oIds=%%D) ) ) ) -) ) ) @@ -3734,7 +3720,7 @@ if /i "%2"=="%%D" ( set key=%%B set _actid=%%A set _allactid=!_allactid! %%A -) else if not defined _oBranding if %_NoEditionChange%==0 ( +) else if not defined _oMSI if %_NoEditionChange%==0 ( echo: %%E | find /i "-%2-" %nul% && ( set key=%%B set _altoffid=%%D @@ -3744,21 +3730,6 @@ set _allactid=!_allactid! %%A ) ) -if %1==getmsiprod if "%oVer%"=="%%C" ( -for /f "tokens=*" %%x in ('findstr /i /c:"%%A" "%_oBranding%"') do set "prodId=%%x" -set prodId=!prodId:"/>=! -set prodId=!prodId:~-4! -if "%oVer%"=="14" ( -REM Exception case for Visio because wrong primary product ID is mentioned in Branding.xml -echo %%D | find /i "Visio" %nul% && set prodId=0057 -) -reg query "%2\Registration\{%%A}" /v ProductCode %nul2% | find /i "-!prodId!-" %nul% && ( -reg query "%2\Common\InstalledPackages" %nul2% | find /i "-!prodId!-" %nul% && ( -if defined _oIds (set _oIds=!_oIds! %%D) else (set _oIds=%%D) -) -) -) - ) ) exit /b diff --git a/MAS/Separate-Files-Version/Activators/TSforge_Activation.cmd b/MAS/Separate-Files-Version/Activators/TSforge_Activation.cmd index 3330a77..7da980b 100644 --- a/MAS/Separate-Files-Version/Activators/TSforge_Activation.cmd +++ b/MAS/Separate-Files-Version/Activators/TSforge_Activation.cmd @@ -1499,7 +1499,6 @@ set _prids= set _config= set _version= set _License= -set _oBranding= exit /b ::======================================================================================================================================== @@ -1679,9 +1678,6 @@ set "_common=%CommonProgramFiles%" if defined PROCESSOR_ARCHITEW6432 set "_common=%CommonProgramW6432%" set "_common2=%CommonProgramFiles(x86)%" -for /r "%_common%\Microsoft Shared\OFFICE%oVer%\" %%f in (BRANDING.XML) do if exist "%%f" set "_oBranding=%%f" -if not defined _oBranding for /r "%_common2%\Microsoft Shared\OFFICE%oVer%\" %%f in (BRANDING.XML) do if exist "%%f" set "_oBranding=%%f" - if exist "%_common%\Microsoft Shared\OFFICE%oVer%\Office Setup Controller\pkeyconfig-office.xrm-ms" ( set "pkeypath=%_common%\Microsoft Shared\OFFICE%oVer%\Office Setup Controller\pkeyconfig-office.xrm-ms" ) else if exist "%_common2%\Microsoft Shared\OFFICE%oVer%\Office Setup Controller\pkeyconfig-office.xrm-ms" ( @@ -1693,12 +1689,6 @@ call :msiofficedata %2 echo: echo Processing Office... [MSI ^| %_version% ^| %_oArch%] -if not defined _oBranding ( -set error=1 -call :dk_color %Red% "Checking BRANDING.XML [Not Found. Aborting activation...]" -exit /b -) - if not defined _oIds ( set error=1 call :dk_color %Red% "Checking Installed Products [Product IDs not found. Aborting activation...]" @@ -7195,18 +7185,13 @@ for %%# in ( ) do ( for /f "tokens=1-5 delims=_" %%A in ("%%#") do ( -set getIds=1 if "%oVer%"=="%%A" ( -if /i "%2"=="getmsiret" (echo %%D | findstr /i "Volume VL" %nul% && set getIds=) - -if defined getIds ( reg query "%1\Registration\{%%B}" /v ProductCode %nul2% | find /i "-%%C-" %nul% && ( reg query "%1\Common\InstalledPackages" %nul2% | find /i "-%%C-" %nul% && ( if defined _oIds (set _oIds=!_oIds! %%D) else (set _oIds=%%D) ) ) ) -) ) ) From 294837dfe0eed177b177954e7ba8b5841af55264 Mon Sep 17 00:00:00 2001 From: WindowsAddict Date: Wed, 16 Apr 2025 03:47:15 +0530 Subject: [PATCH 21/79] Add the updated CAS by abbodi1406 --- MAS/All-In-One-Version-KL/MAS_AIO.cmd | 1013 ++++++++++++----- .../Check_Activation_Status.cmd | 1013 ++++++++++++----- 2 files changed, 1514 insertions(+), 512 deletions(-) diff --git a/MAS/All-In-One-Version-KL/MAS_AIO.cmd b/MAS/All-In-One-Version-KL/MAS_AIO.cmd index fc5db47..b5a94e7 100644 --- a/MAS/All-In-One-Version-KL/MAS_AIO.cmd +++ b/MAS/All-In-One-Version-KL/MAS_AIO.cmd @@ -12508,6 +12508,7 @@ $IID = $IID.IsPresent -Or $Dlv.IsPresent $NT6 = $winbuild -GE 6000 $NT7 = $winbuild -GE 7600 +$NT8 = $winbuild -GE 9200 $NT9 = $winbuild -GE 9600 $Admin = ([Security.Principal.WindowsPrincipal][Security.Principal.WindowsIdentity]::GetCurrent()).IsInRole([Security.Principal.WindowsBuiltInRole]::Administrator) @@ -12583,55 +12584,375 @@ function CheckOhook & $noAll } -#region WMI -function DetectID($strSLP, $strAppId) -{ - $ppk = (" AND PartialProductKey <> NULL)", ")")[$All.IsPresent] - $fltr = "SELECT ID FROM $strSLP WHERE (ApplicationID='$strAppId'" - $clause = $fltr + $ppk - $sWmi = [wmisearcher]$clause - $sWmi.Options.Rewindable = $false - return ($sWmi.Get().Count -GT 0) +#region SSSS +function BoolToWStr($bVal) { + ("TRUE", "FALSE")[!$bVal] } -function GetID($strSLP, $strAppId) -{ - $NT5 = ($strSLP -EQ $wslp -And $winbuild -LT 6001) - $IDs = [Collections.ArrayList]@() - $isAdd = (" AND LicenseDependsOn <> NULL)", ")")[$NT5] - $noAdd = " AND LicenseDependsOn IS NULL)" - $query = "SELECT ID FROM $strSLP WHERE (ApplicationID='$strAppId' AND PartialProductKey" +function InitializePInvoke($LaDll, $bOffice) { + $Marshal = [System.Runtime.InteropServices.Marshal] + $Module = [AppDomain]::CurrentDomain.DefineDynamicAssembly((Get-Random), 'Run').DefineDynamicModule((Get-Random), $False) + $SLApp = $NT7 -Or $bOffice -Or ($LaDll -EQ 'sppc.dll' -And [Diagnostics.FileVersionInfo]::GetVersionInfo("$SysPath\sppc.dll").FilePrivatePart -GE 16501) - if ($All.IsPresent) { - $fltr = $query + " IS NULL" - $clause = $fltr + $isAdd - $sWmi = [wmisearcher]$clause - $sWmi.Options.Rewindable = $false - try {$sWmi.Get() | select -Expand Properties -EA 0 | foreach {$IDs += $_.Value}} catch {} - if (-Not $NT5) { - $clause = $fltr + $noAdd - $sWmi = [wmisearcher]$clause - $sWmi.Options.Rewindable = $false - try {$sWmi.Get() | select -Expand Properties -EA 0 | foreach {$IDs += $_.Value}} catch {} + $Win32 = $null + $Class = $Module.DefineType((Get-Random), 'Public, Abstract, Sealed, BeforeFieldInit', [Object], 0) + $Class.DefinePInvokeMethod('SLClose', $LaDll, 22, 1, [Int32], @([IntPtr]), 1, 3).SetImplementationFlags(128) + $Class.DefinePInvokeMethod('SLOpen', $LaDll, 22, 1, [Int32], @([IntPtr].MakeByRefType()), 1, 3).SetImplementationFlags(128) + $Class.DefinePInvokeMethod('SLGenerateOfflineInstallationId', $LaDll, 22, 1, [Int32], @([IntPtr], [Guid].MakeByRefType(), [IntPtr].MakeByRefType()), 1, 3).SetImplementationFlags(128) + $Class.DefinePInvokeMethod('SLGetSLIDList', $LaDll, 22, 1, [Int32], @([IntPtr], [UInt32], [Guid].MakeByRefType(), [UInt32], [UInt32].MakeByRefType(), [IntPtr].MakeByRefType()), 1, 3).SetImplementationFlags(128) + $Class.DefinePInvokeMethod('SLGetLicensingStatusInformation', $LaDll, 22, 1, [Int32], @([IntPtr], [Guid].MakeByRefType(), [Guid].MakeByRefType(), [IntPtr], [UInt32].MakeByRefType(), [IntPtr].MakeByRefType()), 1, 3).SetImplementationFlags(128) + $Class.DefinePInvokeMethod('SLGetPKeyInformation', $LaDll, 22, 1, [Int32], @([IntPtr], [Guid].MakeByRefType(), [String], [UInt32].MakeByRefType(), [UInt32].MakeByRefType(), [IntPtr].MakeByRefType()), 1, 3).SetImplementationFlags(128) + $Class.DefinePInvokeMethod('SLGetProductSkuInformation', $LaDll, 22, 1, [Int32], @([IntPtr], [Guid].MakeByRefType(), [String], [UInt32].MakeByRefType(), [UInt32].MakeByRefType(), [IntPtr].MakeByRefType()), 1, 3).SetImplementationFlags(128) + $Class.DefinePInvokeMethod('SLGetServiceInformation', $LaDll, 22, 1, [Int32], @([IntPtr], [String], [UInt32].MakeByRefType(), [UInt32].MakeByRefType(), [IntPtr].MakeByRefType()), 1, 3).SetImplementationFlags(128) + if ($SLApp) { + $Class.DefinePInvokeMethod('SLGetApplicationInformation', $LaDll, 22, 1, [Int32], @([IntPtr], [Guid].MakeByRefType(), [String], [UInt32].MakeByRefType(), [UInt32].MakeByRefType(), [IntPtr].MakeByRefType()), 1, 3).SetImplementationFlags(128) + } + if ($bOffice) { + $Win32 = $Class.CreateType() + return + } + if ($NT6) { + $Class.DefinePInvokeMethod('SLGetWindowsInformation', 'slc.dll', 22, 1, [Int32], @([String], [UInt32].MakeByRefType(), [UInt32].MakeByRefType(), [IntPtr].MakeByRefType()), 1, 3).SetImplementationFlags(128) + $Class.DefinePInvokeMethod('SLGetWindowsInformationDWORD', 'slc.dll', 22, 1, [Int32], @([String], [UInt32].MakeByRefType()), 1, 3).SetImplementationFlags(128) + $Class.DefinePInvokeMethod('SLIsGenuineLocal', 'slwga.dll', 22, 1, [Int32], @([Guid].MakeByRefType(), [UInt32].MakeByRefType(), [IntPtr]), 1, 3).SetImplementationFlags(128) + } + if ($NT7) { + $Class.DefinePInvokeMethod('SLIsWindowsGenuineLocal', 'slc.dll', 'Public, Static', 'Standard', [Int32], @([UInt32].MakeByRefType()), 'Winapi', 'Unicode').SetImplementationFlags('PreserveSig') + } + + if ($DllSubscription) { + $Class.DefinePInvokeMethod('ClipGetSubscriptionStatus', 'Clipc.dll', 22, 1, [Int32], @([IntPtr].MakeByRefType()), 1, 3).SetImplementationFlags(128) + $Struct = $Class.DefineNestedType('SubStatus', 'NestedPublic, SequentialLayout, Sealed, BeforeFieldInit', [ValueType], 0) + [void]$Struct.DefineField('dwEnabled', [UInt32], 'Public') + [void]$Struct.DefineField('dwSku', [UInt32], 6) + [void]$Struct.DefineField('dwState', [UInt32], 6) + $SubStatus = $Struct.CreateType() + } + + $Win32 = $Class.CreateType() +} + +function SlGetInfoIID($SkuId) +{ + $bData = 0 + + if ($Win32::SLGenerateOfflineInstallationId( + $hSLC, + [ref][Guid]$SkuId, + [ref]$bData + )) + { + return $null + } + + $rData = $Marshal::PtrToStringUni($bData) + $Marshal::FreeHGlobal($bData) + return $rData +} + +function SlGetInfoSku($SkuId, $Value) +{ + $tData = 0 + $cData = 0 + $bData = 0 + + $ret = $Win32::SLGetProductSkuInformation( + $hSLC, + [ref][Guid]$SkuId, + $Value, + [ref]$tData, + [ref]$cData, + [ref]$bData + ) + + if ($ret -Or !$cData) + { + return $null + } + + if ($tData -EQ 1) + { + $rData = $Marshal::PtrToStringUni($bData) + } + elseif ($tData -EQ 4) + { + $rData = $Marshal::ReadInt32($bData) + } + elseif ($tData -EQ 3 -And $cData -EQ 8) + { + $rData = $Marshal::ReadInt64($bData) + } + else + { + $rData = $null + } + + $Marshal::FreeHGlobal($bData) + return $rData +} + +function SlGetInfoService($Value) +{ + $tData = 0 + $cData = 0 + $bData = 0 + + $ret = $Win32::SLGetServiceInformation( + $hSLC, + $Value, + [ref]$tData, + [ref]$cData, + [ref]$bData + ) + + if ($ret -Or !$cData) + { + return $null + } + + if ($tData -EQ 1) + { + $rData = $Marshal::PtrToStringUni($bData) + } + elseif ($tData -EQ 4) + { + $rData = $Marshal::ReadInt32($bData) + } + elseif ($tData -EQ 3 -And $cData -EQ 8) + { + $rData = $Marshal::ReadInt64($bData) + } + else + { + $rData = $null + } + + $Marshal::FreeHGlobal($bData) + return $rData +} + +function SlGetInfoApp($AppId, $Value) +{ + $tData = 0 + $cData = 0 + $bData = 0 + + $ret = $Win32::SLGetApplicationInformation( + $hSLC, + [ref][Guid]$AppId, + $Value, + [ref]$tData, + [ref]$cData, + [ref]$bData + ) + + if ($ret -Or !$cData) + { + return $null + } + + if ($tData -EQ 1) + { + $rData = $Marshal::PtrToStringUni($bData) + } + elseif ($tData -EQ 4) + { + $rData = $Marshal::ReadInt32($bData) + } + elseif ($tData -EQ 3 -And $cData -EQ 8) + { + $rData = $Marshal::ReadInt64($bData) + } + else + { + $rData = $null + } + + $Marshal::FreeHGlobal($bData) + return $rData +} + +function SlGetInfoSvcApp($strApp, $Value) +{ + if ($SLApp) + { + $rData = SlGetInfoApp $strApp $Value + } + else + { + $rData = SlGetInfoService $Value + } + return $rData +} + +function SlGetInfoPKey($PkeyId, $Value) +{ + $cData = 0 + $bData = 0 + + $ret = $Win32::SLGetPKeyInformation( + $hSLC, + [ref][Guid]$PKeyId, + $Value, + [ref]$null, + [ref]$cData, + [ref]$bData + ) + + if ($ret -Or !$cData) + { + return $null + } + + $rData = $Marshal::PtrToStringUni($bData) + $Marshal::FreeHGlobal($bData) + return $rData +} + +function SlGetInfoLicensing($AppId, $SkuId) +{ + $LicenseStatus = 0 + $GracePeriodRemaining = 0 + $hrReason = 0 + $EvaluationEndDate = 0 + + $cStatus = 0 + $pStatus = 0 + + $ret = $Win32::SLGetLicensingStatusInformation( + $hSLC, + [ref][Guid]$AppId, + [ref][Guid]$SkuId, + 0, + [ref]$cStatus, + [ref]$pStatus + ) + + if ($ret -Or !$cStatus) + { + return + } + + [IntPtr]$ppStatus = [Int64]$pStatus + [Int64]40 * ($cStatus - 1) + $eStatus = $Marshal::ReadInt32($ppStatus, 16) + $GracePeriodRemaining = $Marshal::ReadInt32($ppStatus, 20) + $hrReason = $Marshal::ReadInt32($ppStatus, 28) + $EvaluationEndDate = $Marshal::ReadInt64($ppStatus, 32) + + if ($eStatus -EQ 3) + { + $eStatus = 5 + } + if ($eStatus -EQ 2) + { + if ($hrReason -EQ 0x4004F00D) + { + $eStatus = 3 + } + elseif ($hrReason -EQ 0x4004F065) + { + $eStatus = 4 + } + elseif ($hrReason -EQ 0x4004FC06) + { + $eStatus = 6 } } + $LicenseStatus = $eStatus - $fltr = $query + " <> NULL" - $clause = $fltr + $isAdd - $sWmi = [wmisearcher]$clause - $sWmi.Options.Rewindable = $false - try {$sWmi.Get() | select -Expand Properties -EA 0 | foreach {$IDs += $_.Value}} catch {} - if (-Not $NT5) { - $clause = $fltr + $noAdd - $sWmi = [wmisearcher]$clause - $sWmi.Options.Rewindable = $false - try {$sWmi.Get() | select -Expand Properties -EA 0 | foreach {$IDs += $_.Value}} catch {} + $Marshal::FreeHGlobal($pStatus) + return +} + +function SlCheckInfo($SkuId, $Value) +{ + $cData = 0 + $bData = 0 + + $ret = $Win32::SLGetProductSkuInformation( + $hSLC, + [ref][Guid]$SkuId, + $Value, + [ref]$null, + [ref]$cData, + [ref]$bData + ) + + if ($ret -Or !$cData) + { + return $false } - return $IDs + if ($Value -EQ "pkeyId") + { + $rData = $Marshal::PtrToStringUni($bData) + } + else + { + $rData = $true + } + + $Marshal::FreeHGlobal($bData) + return $rData +} + +function SlGetInfoSLID($AppId) +{ + $cReturnIds = 0 + $pReturnIds = 0 + + $ret = $Win32::SLGetSLIDList( + $hSLC, + 0, + [ref][Guid]$AppId, + 1, + [ref]$cReturnIds, + [ref]$pReturnIds + ) + + if ($ret -Or !$cReturnIds) + { + return + } + + $a1List = @() + $a2List = @() + $a3List = @() + $a4List = @() + + foreach ($i in 0..($cReturnIds - 1)) + { + $bytes = New-Object byte[] 16 + $Marshal::Copy([Int64]$pReturnIds + [Int64]16 * $i, $bytes, 0, 16) + $actid = ([Guid]$bytes).Guid + $gPPK = SlCheckInfo $actid "pkeyId" + $gAdd = SlCheckInfo $actid "DependsOn" + if ($All.IsPresent) { + if (!$gPPK -And $gAdd) { $a1List += @{id = $actid; pk = $null; ex = $true} } + if (!$gPPK -And !$gAdd) { $a2List += @{id = $actid; pk = $null; ex = $false} } + } + if ($gPPK -And $gAdd) { $a3List += @{id = $actid; pk = $gPPK; ex = $true} } + if ($gPPK -And !$gAdd) { $a4List += @{id = $actid; pk = $gPPK; ex = $false} } + } + + $Marshal::FreeHGlobal($pReturnIds) + return ($a1List + $a2List + $a3List + $a4List) } function DetectSubscription { + try + { + $objSvc = New-Object PSObject + $wmiSvc = [wmisearcher]"SELECT SubscriptionType, SubscriptionStatus, SubscriptionEdition, SubscriptionExpiry FROM SoftwareLicensingService" + $wmiSvc.Options.Rewindable = $false + $wmiSvc.Get() | select -Expand Properties -EA 0 | foreach { $objSvc | Add-Member 8 $_.Name $_.Value } + $wmiSvc.Dispose() + } + catch + { + return + } + if ($null -EQ $objSvc.SubscriptionType -Or $objSvc.SubscriptionType -EQ 120) { return } @@ -12663,161 +12984,188 @@ function DetectSubscription { } CONOUT "`nSubscription information:" - CONOUT " Edition: $SubMsgEdition" CONOUT " Type : $SubMsgType" CONOUT " Status : $SubMsgStatus" + CONOUT " Edition: $SubMsgEdition" CONOUT " Expiry : $SubMsgExpiry" } function DetectAdbaClient { + $propADBA | foreach { set $_ (SlGetInfoSku $ID $_) } CONOUT "`nAD Activation client information:" CONOUT " Object Name: $ADActivationObjectName" CONOUT " Domain Name: $ADActivationObjectDN" - CONOUT " CSVLK Extended PID: $ADActivationCsvlkPid" - CONOUT " CSVLK Activation ID: $ADActivationCsvlkSkuId" + CONOUT " CSVLK Extended PID: $ADActivationCsvlkPID" + CONOUT " CSVLK Activation ID: $ADActivationCsvlkSkuID" } function DetectAvmClient { + $propAVMA | foreach { set $_ (SlGetInfoSku $ID $_) } CONOUT "`nAutomatic VM Activation client information:" - if (-Not [String]::IsNullOrEmpty($IAID)) { - CONOUT " Guest IAID: $IAID" + if (-Not [String]::IsNullOrEmpty($InheritedActivationId)) { + CONOUT " Guest IAID: $InheritedActivationId" } else { CONOUT " Guest IAID: Not Available" } - if (-Not [String]::IsNullOrEmpty($AutomaticVMActivationHostMachineName)) { - CONOUT " Host machine name: $AutomaticVMActivationHostMachineName" + if (-Not [String]::IsNullOrEmpty($InheritedActivationHostMachineName)) { + CONOUT " Host machine name: $InheritedActivationHostMachineName" } else { CONOUT " Host machine name: Not Available" } - if ($AutomaticVMActivationLastActivationTime.Substring(0,4) -NE "1601") { - $EED = [DateTime]::Parse([Management.ManagementDateTimeConverter]::ToDateTime($AutomaticVMActivationLastActivationTime),$null,48).ToString('yyyy-MM-dd hh:mm:ss tt') - CONOUT " Activation time: $EED UTC" - } else { - CONOUT " Activation time: Not Available" - } - if (-Not [String]::IsNullOrEmpty($AutomaticVMActivationHostDigitalPid2)) { - CONOUT " Host Digital PID2: $AutomaticVMActivationHostDigitalPid2" + if (-Not [String]::IsNullOrEmpty($InheritedActivationHostDigitalPid2)) { + CONOUT " Host Digital PID2: $InheritedActivationHostDigitalPid2" } else { CONOUT " Host Digital PID2: Not Available" } + if ($InheritedActivationActivationTime) { + $IAAT = [DateTime]::FromFileTime($InheritedActivationActivationTime).ToString('yyyy-MM-dd hh:mm:ss tt') + CONOUT " Activation time: $IAAT" + } else { + CONOUT " Activation time: Not Available" + } } function DetectKmsHost { + $IsKeyManagementService = SlGetInfoSvcApp $strApp 'IsKeyManagementService' + if (-Not $IsKeyManagementService) { + return + } + if ($null -NE $ExpireMsg) {CONOUT "`n $ExpireMsg"} + if ($Vista -Or $NT5) { - $KeyManagementServiceListeningPort = strGetRegistry $SLKeyPath "KeyManagementServiceListeningPort" - $KeyManagementServiceDnsPublishing = strGetRegistry $SLKeyPath "DisableDnsPublishing" - $KeyManagementServiceLowPriority = strGetRegistry $SLKeyPath "EnableKmsLowPriority" - if (-Not $KeyManagementServiceDnsPublishing) {$KeyManagementServiceDnsPublishing = "TRUE"} - if (-Not $KeyManagementServiceLowPriority) {$KeyManagementServiceLowPriority = "FALSE"} + $regk = $SLKeyPath + } elseif ($strSLP -EQ $oslp) { + $regk = $OPKeyPath } else { - $KeyManagementServiceListeningPort = $objSvc.KeyManagementServiceListeningPort - $KeyManagementServiceDnsPublishing = $objSvc.KeyManagementServiceDnsPublishing - $KeyManagementServiceLowPriority = $objSvc.KeyManagementServiceLowPriority + $regk = $SPKeyPath + } + $KMSListening = strGetRegistry $regk "KeyManagementServiceListeningPort" + $KMSPublishing = strGetRegistry $regk "DisableDnsPublishing" + $KMSPriority = strGetRegistry $regk "EnableKmsLowPriority" + + if (-Not $KMSListening) {$KMSListening = 1688} + if (-Not $KMSPublishing) {$KMSPublishing = "TRUE"} else {$KMSPublishing = BoolToWStr (!$KMSPublishing)} + if (-Not $KMSPriority) {$KMSPriority = "FALSE"} else {$KMSPriority = BoolToWStr $KMSPriority} + + if ($KMSPublishing -EQ "TRUE") {$KMSPublishing = "Enabled"} else {$KMSPublishing = "Disabled"} + if ($KMSPriority -EQ "TRUE") {$KMSPriority = "Low"} else {$KMSPriority = "Normal"} + + if ($SLApp) + { + $propKMSServer | foreach { set $_ (SlGetInfoApp $strApp $_) } + } + else + { + $propKMSServer | foreach { set $_ (SlGetInfoService $_) } } - if (-Not $KeyManagementServiceListeningPort) {$KeyManagementServiceListeningPort = 1688} - if ($KeyManagementServiceDnsPublishing -EQ "TRUE") { - $KeyManagementServiceDnsPublishing = "Enabled" - } else { - $KeyManagementServiceDnsPublishing = "Disabled" - } - if ($KeyManagementServiceLowPriority -EQ "TRUE") { - $KeyManagementServiceLowPriority = "Low" - } else { - $KeyManagementServiceLowPriority = "Normal" - } + $KMSRequests = $KeyManagementServiceTotalRequests + $NoRequests = ($null -EQ $KMSRequests) -Or ($KMSRequests -EQ -1) -Or ($KMSRequests -EQ 4294967295) CONOUT "`nKey Management Service host information:" CONOUT " Current count: $KeyManagementServiceCurrentCount" - CONOUT " Listening on Port: $KeyManagementServiceListeningPort" - CONOUT " DNS publishing: $KeyManagementServiceDnsPublishing" - CONOUT " KMS priority: $KeyManagementServiceLowPriority" - if (-Not [String]::IsNullOrEmpty($KeyManagementServiceTotalRequests)) { - CONOUT "`nKey Management Service cumulative requests received from clients:" - CONOUT " Total: $KeyManagementServiceTotalRequests" - CONOUT " Failed: $KeyManagementServiceFailedRequests" - CONOUT " Unlicensed: $KeyManagementServiceUnlicensedRequests" - CONOUT " Licensed: $KeyManagementServiceLicensedRequests" - CONOUT " Initial grace period: $KeyManagementServiceOOBGraceRequests" - CONOUT " Expired or Hardware out of tolerance: $KeyManagementServiceOOTGraceRequests" - CONOUT " Non-genuine grace period: $KeyManagementServiceNonGenuineGraceRequests" - if ($null -NE $KeyManagementServiceNotificationRequests) {CONOUT " Notification: $KeyManagementServiceNotificationRequests"} + CONOUT " Listening on Port: $KMSListening" + CONOUT " DNS publishing: $KMSPublishing" + CONOUT " KMS priority: $KMSPriority" + if ($NoRequests) { + return } + CONOUT "`nKey Management Service cumulative requests received from clients:" + CONOUT " Total: $KeyManagementServiceTotalRequests" + CONOUT " Failed: $KeyManagementServiceFailedRequests" + CONOUT " Unlicensed: $KeyManagementServiceUnlicensedRequests" + CONOUT " Licensed: $KeyManagementServiceLicensedRequests" + CONOUT " Initial grace period: $KeyManagementServiceOOBGraceRequests" + CONOUT " Expired or Hardware out of tolerance: $KeyManagementServiceOOTGraceRequests" + CONOUT " Non-genuine grace period: $KeyManagementServiceNonGenuineGraceRequests" + if ($null -NE $KeyManagementServiceNotificationRequests) {CONOUT " Notification: $KeyManagementServiceNotificationRequests"} } function DetectKmsClient { - if ($null -NE $VLActivationTypeEnabled) {CONOUT "Configured Activation Type: $($VLActTypes[$VLActivationTypeEnabled])"} + if ($strSLP -EQ $wslp -And $NT8) + { + $VLType = strGetRegistry ($SPKeyPath + '\' + $strApp + '\' + $ID) "VLActivationType" + if ($null -EQ $VLType) {$VLType = strGetRegistry ($SPKeyPath + '\' + $strApp) "VLActivationType"} + if ($null -EQ $VLType) {$VLType = strGetRegistry ($SPKeyPath) "VLActivationType"} + if ($null -EQ $VLType -Or $VLType -GT 3) {$VLType = 0} + } + if ($null -NE $VLType) {CONOUT "Configured Activation Type: $($VLActTypes[$VLType])"} + CONOUT "`r" if ($LicenseStatus -NE 1) { CONOUT "Please activate the product in order to update KMS client information values." return } - if ($Vista) { - $KeyManagementServicePort = strGetRegistry $SLKeyPath "KeyManagementServicePort" - $DiscoveredKeyManagementServiceMachineName = strGetRegistry $NSKeyPath "DiscoveredKeyManagementServiceName" - $DiscoveredKeyManagementServiceMachinePort = strGetRegistry $NSKeyPath "DiscoveredKeyManagementServicePort" + if ($NT7 -Or $strSLP -EQ $oslp) { + $propKMSClient | foreach { set $_ (SlGetInfoSku $ID $_) } + if ($strSLP -EQ $oslp) {$regk = $OPKeyPath} else {$regk = $SPKeyPath} + $KMSCaching = strGetRegistry $regk "DisableKeyManagementServiceHostCaching" + if (-Not $KMSCaching) {$KMSCaching = "TRUE"} else {$KMSCaching = BoolToWStr (!$KMSCaching)} } - if ([String]::IsNullOrEmpty($KeyManagementServiceMachine)) { + "ClientMachineID" | foreach { set $_ (SlGetInfoService $_) } + + if ($Vista) { + $propKMSVista | foreach { set $_ (SlGetInfoService $_) } + $KeyManagementServicePort = strGetRegistry $SLKeyPath "KeyManagementServicePort" + $DiscoveredKeyManagementServiceName = strGetRegistry $NSKeyPath "DiscoveredKeyManagementServiceName" + $DiscoveredKeyManagementServicePort = strGetRegistry $NSKeyPath "DiscoveredKeyManagementServicePort" + } + + if ([String]::IsNullOrEmpty($KeyManagementServiceName)) { $KmsReg = $null } else { if (-Not $KeyManagementServicePort) {$KeyManagementServicePort = 1688} - $KmsReg = "Registered KMS machine name: ${KeyManagementServiceMachine}:${KeyManagementServicePort}" + $KmsReg = "Registered KMS machine name: ${KeyManagementServiceName}:${KeyManagementServicePort}" } - if ([String]::IsNullOrEmpty($DiscoveredKeyManagementServiceMachineName)) { + if ([String]::IsNullOrEmpty($DiscoveredKeyManagementServiceName)) { $KmsDns = "DNS auto-discovery: KMS name not available" if ($Vista -And -Not $Admin) {$KmsDns = "DNS auto-discovery: Run the script as administrator to retrieve info"} } else { - if (-Not $DiscoveredKeyManagementServiceMachinePort) {$DiscoveredKeyManagementServiceMachinePort = 1688} - $KmsDns = "KMS machine name from DNS: ${DiscoveredKeyManagementServiceMachineName}:${DiscoveredKeyManagementServiceMachinePort}" + if (-Not $DiscoveredKeyManagementServicePort) {$DiscoveredKeyManagementServicePort = 1688} + $KmsDns = "KMS machine name from DNS: ${DiscoveredKeyManagementServiceName}:${DiscoveredKeyManagementServicePort}" } - if ($null -NE $objSvc.KeyManagementServiceHostCaching) { - if ($objSvc.KeyManagementServiceHostCaching -EQ "TRUE") { - $KeyManagementServiceHostCaching = "Enabled" - } else { - $KeyManagementServiceHostCaching = "Disabled" + if ($null -NE $KMSCaching) { + if ($KMSCaching -EQ "TRUE") {$KMSCaching = "Enabled"} else {$KMSCaching = "Disabled"} + } + + if ($strSLP -EQ $wslp -And $NT9) { + if ([String]::IsNullOrEmpty($DiscoveredKeyManagementServiceIpAddress)) { + $DiscoveredKeyManagementServiceIpAddress = "not available" } } CONOUT "Key Management Service client information:" - CONOUT " Client Machine ID (CMID): $($objSvc.ClientMachineID)" + CONOUT " Client Machine ID (CMID): $ClientMachineID" if ($null -EQ $KmsReg) { CONOUT " $KmsDns" CONOUT " Registered KMS machine name: KMS name not available" } else { CONOUT " $KmsReg" } - if ($null -NE $DiscoveredKeyManagementServiceMachineIpAddress) {CONOUT " KMS machine IP address: $DiscoveredKeyManagementServiceMachineIpAddress"} - CONOUT " KMS machine extended PID: $KeyManagementServiceProductKeyID" + if ($null -NE $DiscoveredKeyManagementServiceIpAddress) {CONOUT " KMS machine IP address: $DiscoveredKeyManagementServiceIpAddress"} + CONOUT " KMS machine extended PID: $CustomerPID" CONOUT " Activation interval: $VLActivationInterval minutes" CONOUT " Renewal interval: $VLRenewalInterval minutes" - if ($null -NE $KeyManagementServiceHostCaching) {CONOUT " KMS host caching: $KeyManagementServiceHostCaching"} + if ($null -NE $KMSCaching) {CONOUT " KMS host caching: $KMSCaching"} if (-Not [String]::IsNullOrEmpty($KeyManagementServiceLookupDomain)) {CONOUT " KMS SRV record lookup domain: $KeyManagementServiceLookupDomain"} } -function GetResult($strSLP, $strSLS, $strID) +function GetResult($strSLP, $strApp, $entry) { - try - { - $objPrd = [wmisearcher]"SELECT * FROM $strSLP WHERE ID='$strID'" - $objPrd.Options.Rewindable = $false - $objPrd.Get() | select -Expand Properties -EA 0 | foreach { if (-Not [String]::IsNullOrEmpty($_.Value)) {set $_.Name $_.Value} } - $objPrd.Dispose() - } - catch - { - return - } + $ID = $entry.id + $propPrd | foreach { set $_ (SlGetInfoSku $ID $_) } + . SlGetInfoLicensing $strApp $ID - $winID = ($ApplicationID -EQ $winApp) - $winPR = ($winID -And -Not $LicenseIsAddon) + $winID = ($strApp -EQ $winApp) + $winPR = ($winID -And -Not $entry.ex) $Vista = ($winID -And $NT6 -And -Not $NT7) $NT5 = ($strSLP -EQ $wslp -And $winbuild -LT 6001) $reapp = ("Windows", "App")[!$winID] @@ -12827,16 +13175,15 @@ function GetResult($strSLP, $strSLS, $strID) if ($Description | Select-String "TIMEBASED_") {$cTblClient = 1; $_mTag = "Timebased"} if ($Description | Select-String "VIRTUAL_MACHINE_ACTIVATION") {$cAvmClient = 1; $_mTag = "Automatic VM"} if ($null -EQ $cKmsClient) { - if ($Description | Select-String "VOLUME_KMS") {$cKmsHost = 1} + if ($Description | Select-String "VOLUME_KMS") {$cKmsServer = 1} } $_gpr = [Math]::Round($GracePeriodRemaining/1440) if ($_gpr -GT 0) { - $_xpr = [DateTime]::Now.addMinutes($GracePeriodRemaining).ToString('yyyy-MM-dd hh:mm:ss tt') + $_xpr = [DateTime]::Now.AddMinutes($GracePeriodRemaining).ToString('yyyy-MM-dd hh:mm:ss tt') } - if ($null -EQ $LicenseStatusReason) {$LicenseStatusReason = -1} - $LicenseReason = '0x{0:X}' -f $LicenseStatusReason + $LicenseReason = '0x{0:X}' -f $hrReason $LicenseMsg = "Time remaining: $GracePeriodRemaining minute(s) ($_gpr day(s))" if ($LicenseStatus -EQ 0) { $LicenseInf = "Unlicensed" @@ -12844,8 +13191,8 @@ function GetResult($strSLP, $strSLS, $strID) } if ($LicenseStatus -EQ 1) { $LicenseInf = "Licensed" - $LicenseMsg = $null if ($GracePeriodRemaining -EQ 0) { + $LicenseMsg = $null $ExpireMsg = "The $prmnt is permanently activated." } else { $LicenseMsg = "$_mTag activation expiration: $GracePeriodRemaining minute(s) ($_gpr day(s))" @@ -12880,24 +13227,54 @@ function GetResult($strSLP, $strSLS, $strID) if ($null -NE $_xpr) {$ExpireMsg = "Extended grace period ends $_xpr"} } - if ($winPR -And $PartialProductKey -And -Not $NT9) { - $dp4 = strGetRegistry "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion" "DigitalProductId4" - if ($null -NE $dp4) { - $ProductKeyChannel = ([System.Text.Encoding]::Unicode.GetString($dp4, 1016, 128)).Trim([char]$null) + $pkid = $entry.pk + if ($null -NE $pkid) { + $propPkey | foreach { set $_ (SlGetInfoPKey $pkid $_) } + } + + if ($winPR -And $null -NE $PartialProductKey -And -Not $NT8) { + $uxd = SlGetInfoSku $ID 'UXDifferentiator' + $script:primary += @{ + aid = $ID; + ppk = $PartialProductKey; + chn = $Channel; + lst = $LicenseStatus; + lcr = $hrReason; + ged = $GracePeriodRemaining; + evl = $EvaluationEndDate; + dff = $uxd } } - if ($winPR -And $Dlv -And $NT7 -And $null -EQ $RemainingAppReArmCount) { - try + if ($IID -And $null -NE $PartialProductKey) { + $OfflineInstallationId = SlGetInfoIID $ID + } + + if ($Dlv) { + if ($strSLP -EQ $wslp -And $NT8) { - $tmp = [wmisearcher]"SELECT RemainingWindowsReArmCount FROM $strSLS" - $tmp.Options.Rewindable = $false - $tmp.Get() | select -Expand Properties -EA 0 | foreach {set $_.Name $_.Value} - $tmp.Dispose() + $RemainingSkuReArmCount = SlGetInfoSku $ID 'RemainingRearmCount' + $RemainingAppReArmCount = SlGetInfoApp $strApp 'RemainingRearmCount' } - catch + else { + if (($winID -And $NT7) -Or $strSLP -EQ $oslp) + { + $RemainingSLReArmCount = SlGetInfoApp $strApp 'RemainingRearmCount' + } + else + { + $RemainingSLReArmCount = SlGetInfoService 'RearmCount' + } } + if ($null -EQ $TrustedTime) + { + $TrustedTime = SlGetInfoSvcApp $strApp 'TrustedTime' + } + } + + if ($Dlv -Or $All.IsPresent) { + $gPHN = SlCheckInfo $ID "msft:sl/EUL/PHONE/PUBLIC" } $add_on = $Name.IndexOf("add-on for", 5) @@ -12906,73 +13283,56 @@ function GetResult($strSLP, $strSLS, $strID) if ($add_on -EQ -1) {CONOUT "Name: $Name"} else {CONOUT "Name: $($Name.Substring(0, $add_on + 7))"} CONOUT "Description: $Description" CONOUT "Activation ID: $ID" - if ($null -NE $ProductKeyID) {CONOUT "Extended PID: $ProductKeyID"} - if ($null -NE $ProductKeyID2 -And $Dlv) {CONOUT "Product ID: $ProductKeyID2"} + if ($null -NE $DigitalPID) {CONOUT "Extended PID: $DigitalPID"} + if ($null -NE $DigitalPID2 -And $Dlv) {CONOUT "Product ID: $DigitalPID2"} if ($null -NE $OfflineInstallationId -And $IID) {CONOUT "Installation ID: $OfflineInstallationId"} - if ($null -NE $ProductKeyChannel) {CONOUT "Product Key Channel: $ProductKeyChannel"} + if ($null -NE $Channel) {CONOUT "Product Key Channel: $Channel"} if ($null -NE $PartialProductKey) {CONOUT "Partial Product Key: $PartialProductKey"} CONOUT "License Status: $LicenseInf" if ($null -NE $LicenseMsg) {CONOUT "$LicenseMsg"} - if ($LicenseStatus -NE 0 -And $EvaluationEndDate.Substring(0,4) -NE "1601") { - $EED = [DateTime]::Parse([Management.ManagementDateTimeConverter]::ToDateTime($EvaluationEndDate),$null,48).ToString('yyyy-MM-dd hh:mm:ss tt') + if ($LicenseStatus -NE 0 -And $EvaluationEndDate) { + $EED = [DateTime]::FromFileTimeUtc($EvaluationEndDate).ToString('yyyy-MM-dd hh:mm:ss tt') CONOUT "Evaluation End Date: $EED UTC" } + if ($LicenseStatus -NE 1 -And $null -NE $gPHN) { + $gPHN = $gPHN.ToString() + CONOUT "Phone activatable: $gPHN" + } if ($Dlv) { - if ($null -NE $RemainingWindowsReArmCount) { - CONOUT "Remaining Windows rearm count: $RemainingWindowsReArmCount" + if ($null -NE $RemainingSLReArmCount) { + CONOUT "Remaining $reapp rearm count: $RemainingSLReArmCount" } - if ($null -NE $RemainingSkuReArmCount -And $RemainingSkuReArmCount -NE 4294967295) { + if ($null -NE $RemainingSkuReArmCount) { CONOUT "Remaining $reapp rearm count: $RemainingAppReArmCount" CONOUT "Remaining SKU rearm count: $RemainingSkuReArmCount" } - if ($null -NE $TrustedTime -And $LicenseStatus -NE 0) { - $TTD = [DateTime]::Parse([Management.ManagementDateTimeConverter]::ToDateTime($TrustedTime),$null,32).ToString('yyyy-MM-dd hh:mm:ss tt') + if ($LicenseStatus -NE 0 -And $TrustedTime) { + $TTD = [DateTime]::FromFileTime($TrustedTime).ToString('yyyy-MM-dd hh:mm:ss tt') CONOUT "Trusted time: $TTD" } } - if ($LicenseStatus -EQ 0) { + if ($null -EQ $PartialProductKey) { return } - if ($strSLP -EQ $wslp -And $null -NE $PartialProductKey -And $null -NE $ADActivationObjectName -And $VLActivationType -EQ 1) { + if ($strSLP -EQ $wslp -And $NT8 -And $VLActivationType -EQ 1) { DetectAdbaClient } - if ($winID -And $null -NE $cAvmClient -And $null -NE $PartialProductKey) { + if ($winID -And $null -NE $cAvmClient) { DetectAvmClient } $chkSub = ($winPR -And $cSub) - $chkSLS = ($null -NE $PartialProductKey) -And ($null -NE $cKmsClient -Or $null -NE $cKmsHost -Or $chkSub) + $chkSLS = ($null -NE $cKmsClient -Or $null -NE $cKmsServer -Or $chkSub) if (!$chkSLS) { if ($null -NE $ExpireMsg) {CONOUT "`n $ExpireMsg"} return } - try - { - $objSvc = New-Object PSObject - $wmiSvc = [wmisearcher]"SELECT * FROM $strSLS" - $wmiSvc.Options.Rewindable = $false - $wmiSvc.Get() | select -Expand Properties -EA 0 | foreach { if (-Not [String]::IsNullOrEmpty($_.Value)) {$objSvc | Add-Member 8 $_.Name $_.Value} } - $wmiSvc.Dispose() - if ($null -EQ $IsKeyManagementServiceMachine) {$objSvc.PSObject.Properties | foreach {set $_.Name $_.Value}} - } - catch - { - return - } - - if ($strSLS -EQ $wsls -And $NT9) { - if ([String]::IsNullOrEmpty($DiscoveredKeyManagementServiceMachineIpAddress)) { - $DiscoveredKeyManagementServiceMachineIpAddress = "not available" - } - } - - if ($null -NE $cKmsHost -And $IsKeyManagementServiceMachine -GT 0) { - if ($null -NE $ExpireMsg) {CONOUT "`n $ExpireMsg"} + if ($null -NE $cKmsServer) { DetectKmsHost } @@ -12980,7 +13340,7 @@ function GetResult($strSLP, $strSLS, $strID) DetectKmsClient } - if ($null -EQ $cKmsHost) { + if ($null -EQ $cKmsServer) { if ($null -NE $ExpireMsg) {CONOUT "`n $ExpireMsg"} } @@ -12989,6 +13349,16 @@ function GetResult($strSLP, $strSLS, $strID) } } + +function ParseList($strSLP, $strApp, $arrList) +{ + foreach ($entry in $arrList) + { + GetResult $strSLP $strApp $entry + CONOUT "$line3" + & $noAll + } +} #endregion #region vNextDiag @@ -13207,31 +13577,6 @@ IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. #> -function BoolToWStr($bVal) { - ("TRUE", "FALSE")[!$bVal] -} - -function InitializePInvoke { - $Marshal = [System.Runtime.InteropServices.Marshal] - $Module = [AppDomain]::CurrentDomain.DefineDynamicAssembly((Get-Random), 'Run').DefineDynamicModule((Get-Random)) - - $Class = $Module.DefineType('NativeMethods', 'Public, Abstract, Sealed, BeforeFieldInit', [Object], 0) - $Class.DefinePInvokeMethod('SLIsWindowsGenuineLocal', 'slc.dll', 'Public, Static', 'Standard', [Int32], @([UInt32].MakeByRefType()), 'Winapi', 'Unicode').SetImplementationFlags('PreserveSig') - $Class.DefinePInvokeMethod('SLGetWindowsInformationDWORD', 'slc.dll', 22, 1, [Int32], @([String], [UInt32].MakeByRefType()), 1, 3).SetImplementationFlags(128) - $Class.DefinePInvokeMethod('SLGetWindowsInformation', 'slc.dll', 22, 1, [Int32], @([String], [UInt32].MakeByRefType(), [UInt32].MakeByRefType(), [IntPtr].MakeByRefType()), 1, 3).SetImplementationFlags(128) - - if ($DllSubscription) { - $Class.DefinePInvokeMethod('ClipGetSubscriptionStatus', 'Clipc.dll', 22, 1, [Int32], @([IntPtr].MakeByRefType()), 1, 3).SetImplementationFlags(128) - $Struct = $Class.DefineNestedType('SubStatus', 'NestedPublic, SequentialLayout, Sealed, BeforeFieldInit', [ValueType], 0) - [void]$Struct.DefineField('dwEnabled', [UInt32], 'Public') - [void]$Struct.DefineField('dwSku', [UInt32], 6) - [void]$Struct.DefineField('dwState', [UInt32], 6) - $SubStatus = $Struct.CreateType() - } - - $Win32 = $Class.CreateType() -} - function InitializeDigitalLicenseCheck { $CAB = [System.Reflection.Emit.CustomAttributeBuilder] @@ -13286,36 +13631,29 @@ function PrintLastActivationHResult { } function PrintLastActivationTime { - $pdwLastTime = 0 + $pqwLastTime = 0 $cbSize = 0 if ($Win32::SLGetWindowsInformation( "Security-SPP-LastWindowsActivationTime", [ref]$null, [ref]$cbSize, - [ref]$pdwLastTime + [ref]$pqwLastTime )) { return $FALSE } - $actTime = $Marshal::ReadInt64($pdwLastTime) + $actTime = $Marshal::ReadInt64($pqwLastTime) if ($actTime -ne 0) { CONOUT (" LastActivationTime={0}" -f [DateTime]::FromFileTimeUtc($actTime).ToString("yyyy/MM/dd:HH:mm:ss")) } - $Marshal::FreeHGlobal($pdwLastTime) + $Marshal::FreeHGlobal($pqwLastTime) return $TRUE } function PrintIsWindowsGenuine { $dwGenuine = 0 - $ppwszGenuineStates = @( - "SL_GEN_STATE_IS_GENUINE", - "SL_GEN_STATE_INVALID_LICENSE", - "SL_GEN_STATE_TAMPERED", - "SL_GEN_STATE_OFFLINE", - "SL_GEN_STATE_LAST" - ) if ($Win32::SLIsWindowsGenuineLocal([ref]$dwGenuine)) { return $FALSE @@ -13412,6 +13750,126 @@ function ClicRun } #endregion +#region clc +function clcGetExpireKrn +{ + $tData = 0 + $cData = 0 + $bData = 0 + + $ret = $Win32::SLGetWindowsInformation( + "Kernel-ExpirationDate", + [ref]$tData, + [ref]$cData, + [ref]$bData + ) + + if ($ret -Or !$cData -Or $tData -NE 3) + { + return $null + } + + $year = $Marshal::ReadInt16($bData, 0) + if ($year -EQ 0 -Or $year -EQ 1601) + { + $rData = $null + } + else + { + $rData = '{0}/{1}/{2}:{3}:{4}:{5}' -f $year, $Marshal::ReadInt16($bData, 2), $Marshal::ReadInt16($bData, 4), $Marshal::ReadInt16($bData, 6), $Marshal::ReadInt16($bData, 8), $Marshal::ReadInt16($bData, 10) + } + + $Marshal::FreeHGlobal($bData) + return $rData +} + +function clcGetExpireSys +{ + $kuser = $Marshal::ReadInt64((New-Object IntPtr(0x7FFE02C8))) + + if ($kuser -EQ 0) + { + return $null + } + + $rData = [DateTime]::FromFileTimeUTC($kuser).ToString('yyyy/MM/dd:HH:mm:ss') + return $rData +} + +function clcGetLicensingState($dwState) +{ + if ($dwState -EQ 5) { + $dwState = 3 + } elseif ($dwState -EQ 3 -Or $dwState -EQ 4 -Or $dwState -EQ 6) { + $dwState = 2 + } elseif ($dwState -GT 6) { + $dwState = 4 + } + + $rData = '{0}' -f $ppwszLicensingStates[$dwState] + return $rData +} + +function clcGetGenuineState($AppId) +{ + $dwGenuine = 0 + + if ($NT7) { + $ret = $Win32::SLIsWindowsGenuineLocal([ref]$dwGenuine) + } else { + $ret = $Win32::SLIsGenuineLocal([ref][Guid]$AppId, [ref]$dwGenuine, 0) + } + + if ($ret) + { + $dwGenuine = 4 + } + + if ($dwGenuine -LT 5) { + $rData = '{0}' -f $ppwszGenuineStates[$dwGenuine] + } else { + $rData = $dwGenuine + } + return $rData +} + +function ClcRun +{ + $prs = $script:primary[0] + if ($null -EQ $prs) { + return + } + + $lState = clcGetLicensingState $prs.lst + $uState = clcGetGenuineState $winApp + $TbbKrn = clcGetExpireKrn + $TbbSys = clcGetExpireSys + if ($null -NE $TbbKrn) { + $ked = $TbbKrn + } elseif ($null -NE $TbbSys) { + $ked = $TbbSys + } + + & $isAll + CONOUT "Client Licensing Check information:" + + CONOUT (" AppId={0}" -f $winApp) + if ($prs.ged) { CONOUT (" GraceEndDate={0}" -f ([DateTime]::UtcNow.AddMinutes($prs.ged).ToString('yyyy/MM/dd:HH:mm:ss'))) } + if ($null -NE $ked) { CONOUT (" KernelTimebombDate={0}" -f $ked) } + CONOUT (" LastConsumptionReason=0x{0:x8}" -f $prs.lcr) + if ($prs.evl) { CONOUT (" LicenseExpirationDate={0}" -f ([DateTime]::FromFileTimeUtc($prs.evl).ToString('yyyy/MM/dd:HH:mm:ss'))) } + CONOUT (" LicenseState={0}" -f $lState) + CONOUT (" PartialProductKey={0}" -f $prs.ppk) + CONOUT (" ProductKeyType={0}" -f $prs.chn) + CONOUT (" SkuId={0}" -f $prs.aid) + CONOUT (" uxDifferentiator={0}" -f $prs.dff) + CONOUT (" IsWindowsGenuine={0}" -f $uState) + + CONOUT "$line3" + & $noAll +} +#endregion + $Host.UI.RawUI.WindowTitle = "Check Activation Status" if ($All.IsPresent) { $B=$Host.UI.RawUI.BufferSize;$B.Height=3000;$Host.UI.RawUI.BufferSize=$B; @@ -13430,14 +13888,38 @@ $osls = "OfficeSoftwareProtectionService" $winApp = "55c92734-d682-4d71-983e-d6ec3f16059f" $o14App = "59a52881-a989-479d-af46-f275c6370663" $o15App = "0ff1ce15-a989-479d-af46-f275c6370663" -$cSub = ($winbuild -GE 19041) -And (Select-String -Path "$SysPath\wbem\sppwmi.mof" -Encoding unicode -Pattern "SubscriptionType") +$cSub = ($winbuild -GE 26000) -And (Select-String -Path "$SysPath\wbem\sppwmi.mof" -Encoding unicode -Pattern "SubscriptionType") $DllDigital = ($winbuild -GE 14393) -And (Test-Path "$SysPath\EditionUpgradeManagerObj.dll") $DllSubscription = ($winbuild -GE 14393) -And (Test-Path "$SysPath\Clipc.dll") $VLActTypes = @("All", "AD", "KMS", "Token") +$OPKeyPath = "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\OfficeSoftwareProtectionPlatform" +$SPKeyPath = "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\SoftwareProtectionPlatform" $SLKeyPath = "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\SL" $NSKeyPath = "HKEY_USERS\S-1-5-20\SOFTWARE\Microsoft\Windows NT\CurrentVersion\SL" +$propPrd = 'Name', 'Description', 'TrustedTime', 'VLActivationType' +$propPkey = 'PartialProductKey', 'Channel', 'DigitalPID', 'DigitalPID2' +$propKMSServer = 'KeyManagementServiceCurrentCount', 'KeyManagementServiceTotalRequests', 'KeyManagementServiceFailedRequests', 'KeyManagementServiceUnlicensedRequests', 'KeyManagementServiceLicensedRequests', 'KeyManagementServiceOOBGraceRequests', 'KeyManagementServiceOOTGraceRequests', 'KeyManagementServiceNonGenuineGraceRequests', 'KeyManagementServiceNotificationRequests' +$propKMSClient = 'CustomerPID', 'KeyManagementServiceName', 'KeyManagementServicePort', 'DiscoveredKeyManagementServiceName', 'DiscoveredKeyManagementServicePort', 'DiscoveredKeyManagementServiceIpAddress', 'VLActivationInterval', 'VLRenewalInterval', 'KeyManagementServiceLookupDomain' +$propKMSVista = 'CustomerPID', 'KeyManagementServiceName', 'VLActivationInterval', 'VLRenewalInterval' +$propADBA = 'ADActivationObjectName', 'ADActivationObjectDN', 'ADActivationCsvlkPID', 'ADActivationCsvlkSkuID' +$propAVMA = 'InheritedActivationId', 'InheritedActivationHostMachineName', 'InheritedActivationHostDigitalPid2', 'InheritedActivationActivationTime' +$primary = @() +$ppwszGenuineStates = @( + "SL_GEN_STATE_IS_GENUINE", + "SL_GEN_STATE_INVALID_LICENSE", + "SL_GEN_STATE_TAMPERED", + "SL_GEN_STATE_OFFLINE", + "SL_GEN_STATE_LAST" +) +$ppwszLicensingStates = @( + "SL_LICENSING_STATUS_UNLICENSED", + "SL_LICENSING_STATUS_LICENSED", + "SL_LICENSING_STATUS_IN_GRACE_PERIOD", + "SL_LICENSING_STATUS_NOTIFICATION", + "SL_LICENSING_STATUS_LAST" +) -'cW1nd0ws', 'c0ff1ce15', 'c0ff1ce14', 'ospp14', 'ospp15' | foreach {set $_ $false} +'cW1nd0ws', 'c0ff1ce15', 'c0ff1ce14', 'ospp14', 'ospp15' | foreach {set $_ @()} $offsvc = "osppsvc" if ($NT7 -Or -Not $NT6) {$winsvc = "sppsvc"} else {$winsvc = "slsvc"} @@ -13445,83 +13927,102 @@ if ($NT7 -Or -Not $NT6) {$winsvc = "sppsvc"} else {$winsvc = "slsvc"} try {gsv $winsvc -EA 1 | Out-Null; $WsppHook = 1} catch {$WsppHook = 0} try {gsv $offsvc -EA 1 | Out-Null; $OsppHook = 1} catch {$OsppHook = 0} -if ($WsppHook -NE 0) { - try {sasv $winsvc -EA 1} catch {} - $cW1nd0ws = DetectID $wslp $winApp - $c0ff1ce15 = DetectID $wslp $o15App - $c0ff1ce14 = DetectID $wslp $o14App +if (Test-Path "$SysPath\sppc.dll") { + $SLdll = 'sppc.dll' +} elseif (Test-Path "$SysPath\slc.dll") { + $SLdll = 'slc.dll' +} else { + $WsppHook = 0 } if ($OsppHook -NE 0) { - try {sasv $offsvc -EA 1} catch {} - $ospp15 = DetectID $oslp $o15App - $ospp14 = DetectID $oslp $o14App + $OLdll = (strGetRegistry $OPKeyPath "Path") + 'osppc.dll' + if (!(Test-Path "$OLdll")) {$OsppHook = 0} } -if ($cW1nd0ws) +if ($WsppHook -NE 0) { + if ($NT6 -And -Not $NT7 -And -Not $Admin) { + if ($null -EQ [Diagnostics.Process]::GetProcessesByName("$winsvc")[0].ProcessName) {$WsppHook = 0; CONOUT "`nError: failed to start $winsvc Service.`n"} + } else { + try {sasv $winsvc -EA 1} catch {$WsppHook = 0; CONOUT "`nError: failed to start $winsvc Service.`n"} + } +} + +if ($WsppHook -NE 0) { + . InitializePInvoke $SLdll $false + $hSLC = 0 + [void]$Win32::SLOpen([ref]$hSLC) + + $cW1nd0ws = SlGetInfoSLID $winApp + $c0ff1ce15 = SlGetInfoSLID $o15App + $c0ff1ce14 = SlGetInfoSLID $o14App +} + +if ($cW1nd0ws.Count -GT 0) { echoWindows - GetID $wslp $winApp | foreach -EA 1 { - GetResult $wslp $wsls $_ - CONOUT "$line3" - & $noAll - } + ParseList $wslp $winApp $cW1nd0ws } elseif ($NT6) { echoWindows - CONOUT "`nError: product key not found." + CONOUT "Error: product key not found.`n" } -if ($winbuild -GE 9200) { - . InitializePInvoke +if ($NT6 -And -Not $NT8) { + ClcRun +} + +if ($NT8) { ClicRun } -if ($c0ff1ce15 -Or $ospp15) { - CheckOhook -} - $doMSG = 1 -if ($c0ff1ce15) +if ($c0ff1ce15.Count -GT 0) { + CheckOhook echoOffice - GetID $wslp $o15App | foreach -EA 1 { - GetResult $wslp $wsls $_ - CONOUT "$line3" - & $noAll - } + ParseList $wslp $o15App $c0ff1ce15 } -if ($c0ff1ce14) +if ($c0ff1ce14.Count -GT 0) { echoOffice - GetID $wslp $o14App | foreach -EA 1 { - GetResult $wslp $wsls $_ - CONOUT "$line3" - & $noAll - } + ParseList $wslp $o14App $c0ff1ce14 } -if ($ospp15) -{ - echoOffice - GetID $oslp $o15App | foreach -EA 1 { - GetResult $oslp $osls $_ - CONOUT "$line3" - & $noAll - } +if ($hSLC) { + [void]$Win32::SLClose($hSLC) } -if ($ospp14) +if ($OsppHook -NE 0) { + try {sasv $offsvc -EA 1} catch {$OsppHook = 0; CONOUT "`nError: failed to start $offsvc Service.`n"} +} + +if ($OsppHook -NE 0) { + . InitializePInvoke "$OLdll" $true + $hSLC = 0 + [void]$Win32::SLOpen([ref]$hSLC) + + $ospp15 = SlGetInfoSLID $o15App + $ospp14 = SlGetInfoSLID $o14App +} + +if ($ospp15.Count -GT 0) { echoOffice - GetID $oslp $o14App | foreach -EA 1 { - GetResult $oslp $osls $_ - CONOUT "$line3" - & $noAll - } + ParseList $oslp $o15App $ospp15 +} + +if ($ospp14.Count -GT 0) +{ + echoOffice + ParseList $oslp $o14App $ospp14 +} + +if ($hSLC) { + [void]$Win32::SLClose($hSLC) } if ($NT7) { diff --git a/MAS/Separate-Files-Version/Check_Activation_Status.cmd b/MAS/Separate-Files-Version/Check_Activation_Status.cmd index f15f36e..fd72a3f 100644 --- a/MAS/Separate-Files-Version/Check_Activation_Status.cmd +++ b/MAS/Separate-Files-Version/Check_Activation_Status.cmd @@ -118,6 +118,7 @@ $IID = $IID.IsPresent -Or $Dlv.IsPresent $NT6 = $winbuild -GE 6000 $NT7 = $winbuild -GE 7600 +$NT8 = $winbuild -GE 9200 $NT9 = $winbuild -GE 9600 $Admin = ([Security.Principal.WindowsPrincipal][Security.Principal.WindowsIdentity]::GetCurrent()).IsInRole([Security.Principal.WindowsBuiltInRole]::Administrator) @@ -193,55 +194,375 @@ function CheckOhook & $noAll } -#region WMI -function DetectID($strSLP, $strAppId) -{ - $ppk = (" AND PartialProductKey <> NULL)", ")")[$All.IsPresent] - $fltr = "SELECT ID FROM $strSLP WHERE (ApplicationID='$strAppId'" - $clause = $fltr + $ppk - $sWmi = [wmisearcher]$clause - $sWmi.Options.Rewindable = $false - return ($sWmi.Get().Count -GT 0) +#region SSSS +function BoolToWStr($bVal) { + ("TRUE", "FALSE")[!$bVal] } -function GetID($strSLP, $strAppId) -{ - $NT5 = ($strSLP -EQ $wslp -And $winbuild -LT 6001) - $IDs = [Collections.ArrayList]@() - $isAdd = (" AND LicenseDependsOn <> NULL)", ")")[$NT5] - $noAdd = " AND LicenseDependsOn IS NULL)" - $query = "SELECT ID FROM $strSLP WHERE (ApplicationID='$strAppId' AND PartialProductKey" +function InitializePInvoke($LaDll, $bOffice) { + $Marshal = [System.Runtime.InteropServices.Marshal] + $Module = [AppDomain]::CurrentDomain.DefineDynamicAssembly((Get-Random), 'Run').DefineDynamicModule((Get-Random), $False) + $SLApp = $NT7 -Or $bOffice -Or ($LaDll -EQ 'sppc.dll' -And [Diagnostics.FileVersionInfo]::GetVersionInfo("$SysPath\sppc.dll").FilePrivatePart -GE 16501) - if ($All.IsPresent) { - $fltr = $query + " IS NULL" - $clause = $fltr + $isAdd - $sWmi = [wmisearcher]$clause - $sWmi.Options.Rewindable = $false - try {$sWmi.Get() | select -Expand Properties -EA 0 | foreach {$IDs += $_.Value}} catch {} - if (-Not $NT5) { - $clause = $fltr + $noAdd - $sWmi = [wmisearcher]$clause - $sWmi.Options.Rewindable = $false - try {$sWmi.Get() | select -Expand Properties -EA 0 | foreach {$IDs += $_.Value}} catch {} + $Win32 = $null + $Class = $Module.DefineType((Get-Random), 'Public, Abstract, Sealed, BeforeFieldInit', [Object], 0) + $Class.DefinePInvokeMethod('SLClose', $LaDll, 22, 1, [Int32], @([IntPtr]), 1, 3).SetImplementationFlags(128) + $Class.DefinePInvokeMethod('SLOpen', $LaDll, 22, 1, [Int32], @([IntPtr].MakeByRefType()), 1, 3).SetImplementationFlags(128) + $Class.DefinePInvokeMethod('SLGenerateOfflineInstallationId', $LaDll, 22, 1, [Int32], @([IntPtr], [Guid].MakeByRefType(), [IntPtr].MakeByRefType()), 1, 3).SetImplementationFlags(128) + $Class.DefinePInvokeMethod('SLGetSLIDList', $LaDll, 22, 1, [Int32], @([IntPtr], [UInt32], [Guid].MakeByRefType(), [UInt32], [UInt32].MakeByRefType(), [IntPtr].MakeByRefType()), 1, 3).SetImplementationFlags(128) + $Class.DefinePInvokeMethod('SLGetLicensingStatusInformation', $LaDll, 22, 1, [Int32], @([IntPtr], [Guid].MakeByRefType(), [Guid].MakeByRefType(), [IntPtr], [UInt32].MakeByRefType(), [IntPtr].MakeByRefType()), 1, 3).SetImplementationFlags(128) + $Class.DefinePInvokeMethod('SLGetPKeyInformation', $LaDll, 22, 1, [Int32], @([IntPtr], [Guid].MakeByRefType(), [String], [UInt32].MakeByRefType(), [UInt32].MakeByRefType(), [IntPtr].MakeByRefType()), 1, 3).SetImplementationFlags(128) + $Class.DefinePInvokeMethod('SLGetProductSkuInformation', $LaDll, 22, 1, [Int32], @([IntPtr], [Guid].MakeByRefType(), [String], [UInt32].MakeByRefType(), [UInt32].MakeByRefType(), [IntPtr].MakeByRefType()), 1, 3).SetImplementationFlags(128) + $Class.DefinePInvokeMethod('SLGetServiceInformation', $LaDll, 22, 1, [Int32], @([IntPtr], [String], [UInt32].MakeByRefType(), [UInt32].MakeByRefType(), [IntPtr].MakeByRefType()), 1, 3).SetImplementationFlags(128) + if ($SLApp) { + $Class.DefinePInvokeMethod('SLGetApplicationInformation', $LaDll, 22, 1, [Int32], @([IntPtr], [Guid].MakeByRefType(), [String], [UInt32].MakeByRefType(), [UInt32].MakeByRefType(), [IntPtr].MakeByRefType()), 1, 3).SetImplementationFlags(128) + } + if ($bOffice) { + $Win32 = $Class.CreateType() + return + } + if ($NT6) { + $Class.DefinePInvokeMethod('SLGetWindowsInformation', 'slc.dll', 22, 1, [Int32], @([String], [UInt32].MakeByRefType(), [UInt32].MakeByRefType(), [IntPtr].MakeByRefType()), 1, 3).SetImplementationFlags(128) + $Class.DefinePInvokeMethod('SLGetWindowsInformationDWORD', 'slc.dll', 22, 1, [Int32], @([String], [UInt32].MakeByRefType()), 1, 3).SetImplementationFlags(128) + $Class.DefinePInvokeMethod('SLIsGenuineLocal', 'slwga.dll', 22, 1, [Int32], @([Guid].MakeByRefType(), [UInt32].MakeByRefType(), [IntPtr]), 1, 3).SetImplementationFlags(128) + } + if ($NT7) { + $Class.DefinePInvokeMethod('SLIsWindowsGenuineLocal', 'slc.dll', 'Public, Static', 'Standard', [Int32], @([UInt32].MakeByRefType()), 'Winapi', 'Unicode').SetImplementationFlags('PreserveSig') + } + + if ($DllSubscription) { + $Class.DefinePInvokeMethod('ClipGetSubscriptionStatus', 'Clipc.dll', 22, 1, [Int32], @([IntPtr].MakeByRefType()), 1, 3).SetImplementationFlags(128) + $Struct = $Class.DefineNestedType('SubStatus', 'NestedPublic, SequentialLayout, Sealed, BeforeFieldInit', [ValueType], 0) + [void]$Struct.DefineField('dwEnabled', [UInt32], 'Public') + [void]$Struct.DefineField('dwSku', [UInt32], 6) + [void]$Struct.DefineField('dwState', [UInt32], 6) + $SubStatus = $Struct.CreateType() + } + + $Win32 = $Class.CreateType() +} + +function SlGetInfoIID($SkuId) +{ + $bData = 0 + + if ($Win32::SLGenerateOfflineInstallationId( + $hSLC, + [ref][Guid]$SkuId, + [ref]$bData + )) + { + return $null + } + + $rData = $Marshal::PtrToStringUni($bData) + $Marshal::FreeHGlobal($bData) + return $rData +} + +function SlGetInfoSku($SkuId, $Value) +{ + $tData = 0 + $cData = 0 + $bData = 0 + + $ret = $Win32::SLGetProductSkuInformation( + $hSLC, + [ref][Guid]$SkuId, + $Value, + [ref]$tData, + [ref]$cData, + [ref]$bData + ) + + if ($ret -Or !$cData) + { + return $null + } + + if ($tData -EQ 1) + { + $rData = $Marshal::PtrToStringUni($bData) + } + elseif ($tData -EQ 4) + { + $rData = $Marshal::ReadInt32($bData) + } + elseif ($tData -EQ 3 -And $cData -EQ 8) + { + $rData = $Marshal::ReadInt64($bData) + } + else + { + $rData = $null + } + + $Marshal::FreeHGlobal($bData) + return $rData +} + +function SlGetInfoService($Value) +{ + $tData = 0 + $cData = 0 + $bData = 0 + + $ret = $Win32::SLGetServiceInformation( + $hSLC, + $Value, + [ref]$tData, + [ref]$cData, + [ref]$bData + ) + + if ($ret -Or !$cData) + { + return $null + } + + if ($tData -EQ 1) + { + $rData = $Marshal::PtrToStringUni($bData) + } + elseif ($tData -EQ 4) + { + $rData = $Marshal::ReadInt32($bData) + } + elseif ($tData -EQ 3 -And $cData -EQ 8) + { + $rData = $Marshal::ReadInt64($bData) + } + else + { + $rData = $null + } + + $Marshal::FreeHGlobal($bData) + return $rData +} + +function SlGetInfoApp($AppId, $Value) +{ + $tData = 0 + $cData = 0 + $bData = 0 + + $ret = $Win32::SLGetApplicationInformation( + $hSLC, + [ref][Guid]$AppId, + $Value, + [ref]$tData, + [ref]$cData, + [ref]$bData + ) + + if ($ret -Or !$cData) + { + return $null + } + + if ($tData -EQ 1) + { + $rData = $Marshal::PtrToStringUni($bData) + } + elseif ($tData -EQ 4) + { + $rData = $Marshal::ReadInt32($bData) + } + elseif ($tData -EQ 3 -And $cData -EQ 8) + { + $rData = $Marshal::ReadInt64($bData) + } + else + { + $rData = $null + } + + $Marshal::FreeHGlobal($bData) + return $rData +} + +function SlGetInfoSvcApp($strApp, $Value) +{ + if ($SLApp) + { + $rData = SlGetInfoApp $strApp $Value + } + else + { + $rData = SlGetInfoService $Value + } + return $rData +} + +function SlGetInfoPKey($PkeyId, $Value) +{ + $cData = 0 + $bData = 0 + + $ret = $Win32::SLGetPKeyInformation( + $hSLC, + [ref][Guid]$PKeyId, + $Value, + [ref]$null, + [ref]$cData, + [ref]$bData + ) + + if ($ret -Or !$cData) + { + return $null + } + + $rData = $Marshal::PtrToStringUni($bData) + $Marshal::FreeHGlobal($bData) + return $rData +} + +function SlGetInfoLicensing($AppId, $SkuId) +{ + $LicenseStatus = 0 + $GracePeriodRemaining = 0 + $hrReason = 0 + $EvaluationEndDate = 0 + + $cStatus = 0 + $pStatus = 0 + + $ret = $Win32::SLGetLicensingStatusInformation( + $hSLC, + [ref][Guid]$AppId, + [ref][Guid]$SkuId, + 0, + [ref]$cStatus, + [ref]$pStatus + ) + + if ($ret -Or !$cStatus) + { + return + } + + [IntPtr]$ppStatus = [Int64]$pStatus + [Int64]40 * ($cStatus - 1) + $eStatus = $Marshal::ReadInt32($ppStatus, 16) + $GracePeriodRemaining = $Marshal::ReadInt32($ppStatus, 20) + $hrReason = $Marshal::ReadInt32($ppStatus, 28) + $EvaluationEndDate = $Marshal::ReadInt64($ppStatus, 32) + + if ($eStatus -EQ 3) + { + $eStatus = 5 + } + if ($eStatus -EQ 2) + { + if ($hrReason -EQ 0x4004F00D) + { + $eStatus = 3 + } + elseif ($hrReason -EQ 0x4004F065) + { + $eStatus = 4 + } + elseif ($hrReason -EQ 0x4004FC06) + { + $eStatus = 6 } } + $LicenseStatus = $eStatus - $fltr = $query + " <> NULL" - $clause = $fltr + $isAdd - $sWmi = [wmisearcher]$clause - $sWmi.Options.Rewindable = $false - try {$sWmi.Get() | select -Expand Properties -EA 0 | foreach {$IDs += $_.Value}} catch {} - if (-Not $NT5) { - $clause = $fltr + $noAdd - $sWmi = [wmisearcher]$clause - $sWmi.Options.Rewindable = $false - try {$sWmi.Get() | select -Expand Properties -EA 0 | foreach {$IDs += $_.Value}} catch {} + $Marshal::FreeHGlobal($pStatus) + return +} + +function SlCheckInfo($SkuId, $Value) +{ + $cData = 0 + $bData = 0 + + $ret = $Win32::SLGetProductSkuInformation( + $hSLC, + [ref][Guid]$SkuId, + $Value, + [ref]$null, + [ref]$cData, + [ref]$bData + ) + + if ($ret -Or !$cData) + { + return $false } - return $IDs + if ($Value -EQ "pkeyId") + { + $rData = $Marshal::PtrToStringUni($bData) + } + else + { + $rData = $true + } + + $Marshal::FreeHGlobal($bData) + return $rData +} + +function SlGetInfoSLID($AppId) +{ + $cReturnIds = 0 + $pReturnIds = 0 + + $ret = $Win32::SLGetSLIDList( + $hSLC, + 0, + [ref][Guid]$AppId, + 1, + [ref]$cReturnIds, + [ref]$pReturnIds + ) + + if ($ret -Or !$cReturnIds) + { + return + } + + $a1List = @() + $a2List = @() + $a3List = @() + $a4List = @() + + foreach ($i in 0..($cReturnIds - 1)) + { + $bytes = New-Object byte[] 16 + $Marshal::Copy([Int64]$pReturnIds + [Int64]16 * $i, $bytes, 0, 16) + $actid = ([Guid]$bytes).Guid + $gPPK = SlCheckInfo $actid "pkeyId" + $gAdd = SlCheckInfo $actid "DependsOn" + if ($All.IsPresent) { + if (!$gPPK -And $gAdd) { $a1List += @{id = $actid; pk = $null; ex = $true} } + if (!$gPPK -And !$gAdd) { $a2List += @{id = $actid; pk = $null; ex = $false} } + } + if ($gPPK -And $gAdd) { $a3List += @{id = $actid; pk = $gPPK; ex = $true} } + if ($gPPK -And !$gAdd) { $a4List += @{id = $actid; pk = $gPPK; ex = $false} } + } + + $Marshal::FreeHGlobal($pReturnIds) + return ($a1List + $a2List + $a3List + $a4List) } function DetectSubscription { + try + { + $objSvc = New-Object PSObject + $wmiSvc = [wmisearcher]"SELECT SubscriptionType, SubscriptionStatus, SubscriptionEdition, SubscriptionExpiry FROM SoftwareLicensingService" + $wmiSvc.Options.Rewindable = $false + $wmiSvc.Get() | select -Expand Properties -EA 0 | foreach { $objSvc | Add-Member 8 $_.Name $_.Value } + $wmiSvc.Dispose() + } + catch + { + return + } + if ($null -EQ $objSvc.SubscriptionType -Or $objSvc.SubscriptionType -EQ 120) { return } @@ -273,161 +594,188 @@ function DetectSubscription { } CONOUT "`nSubscription information:" - CONOUT " Edition: $SubMsgEdition" CONOUT " Type : $SubMsgType" CONOUT " Status : $SubMsgStatus" + CONOUT " Edition: $SubMsgEdition" CONOUT " Expiry : $SubMsgExpiry" } function DetectAdbaClient { + $propADBA | foreach { set $_ (SlGetInfoSku $ID $_) } CONOUT "`nAD Activation client information:" CONOUT " Object Name: $ADActivationObjectName" CONOUT " Domain Name: $ADActivationObjectDN" - CONOUT " CSVLK Extended PID: $ADActivationCsvlkPid" - CONOUT " CSVLK Activation ID: $ADActivationCsvlkSkuId" + CONOUT " CSVLK Extended PID: $ADActivationCsvlkPID" + CONOUT " CSVLK Activation ID: $ADActivationCsvlkSkuID" } function DetectAvmClient { + $propAVMA | foreach { set $_ (SlGetInfoSku $ID $_) } CONOUT "`nAutomatic VM Activation client information:" - if (-Not [String]::IsNullOrEmpty($IAID)) { - CONOUT " Guest IAID: $IAID" + if (-Not [String]::IsNullOrEmpty($InheritedActivationId)) { + CONOUT " Guest IAID: $InheritedActivationId" } else { CONOUT " Guest IAID: Not Available" } - if (-Not [String]::IsNullOrEmpty($AutomaticVMActivationHostMachineName)) { - CONOUT " Host machine name: $AutomaticVMActivationHostMachineName" + if (-Not [String]::IsNullOrEmpty($InheritedActivationHostMachineName)) { + CONOUT " Host machine name: $InheritedActivationHostMachineName" } else { CONOUT " Host machine name: Not Available" } - if ($AutomaticVMActivationLastActivationTime.Substring(0,4) -NE "1601") { - $EED = [DateTime]::Parse([Management.ManagementDateTimeConverter]::ToDateTime($AutomaticVMActivationLastActivationTime),$null,48).ToString('yyyy-MM-dd hh:mm:ss tt') - CONOUT " Activation time: $EED UTC" - } else { - CONOUT " Activation time: Not Available" - } - if (-Not [String]::IsNullOrEmpty($AutomaticVMActivationHostDigitalPid2)) { - CONOUT " Host Digital PID2: $AutomaticVMActivationHostDigitalPid2" + if (-Not [String]::IsNullOrEmpty($InheritedActivationHostDigitalPid2)) { + CONOUT " Host Digital PID2: $InheritedActivationHostDigitalPid2" } else { CONOUT " Host Digital PID2: Not Available" } + if ($InheritedActivationActivationTime) { + $IAAT = [DateTime]::FromFileTime($InheritedActivationActivationTime).ToString('yyyy-MM-dd hh:mm:ss tt') + CONOUT " Activation time: $IAAT" + } else { + CONOUT " Activation time: Not Available" + } } function DetectKmsHost { + $IsKeyManagementService = SlGetInfoSvcApp $strApp 'IsKeyManagementService' + if (-Not $IsKeyManagementService) { + return + } + if ($null -NE $ExpireMsg) {CONOUT "`n $ExpireMsg"} + if ($Vista -Or $NT5) { - $KeyManagementServiceListeningPort = strGetRegistry $SLKeyPath "KeyManagementServiceListeningPort" - $KeyManagementServiceDnsPublishing = strGetRegistry $SLKeyPath "DisableDnsPublishing" - $KeyManagementServiceLowPriority = strGetRegistry $SLKeyPath "EnableKmsLowPriority" - if (-Not $KeyManagementServiceDnsPublishing) {$KeyManagementServiceDnsPublishing = "TRUE"} - if (-Not $KeyManagementServiceLowPriority) {$KeyManagementServiceLowPriority = "FALSE"} + $regk = $SLKeyPath + } elseif ($strSLP -EQ $oslp) { + $regk = $OPKeyPath } else { - $KeyManagementServiceListeningPort = $objSvc.KeyManagementServiceListeningPort - $KeyManagementServiceDnsPublishing = $objSvc.KeyManagementServiceDnsPublishing - $KeyManagementServiceLowPriority = $objSvc.KeyManagementServiceLowPriority + $regk = $SPKeyPath + } + $KMSListening = strGetRegistry $regk "KeyManagementServiceListeningPort" + $KMSPublishing = strGetRegistry $regk "DisableDnsPublishing" + $KMSPriority = strGetRegistry $regk "EnableKmsLowPriority" + + if (-Not $KMSListening) {$KMSListening = 1688} + if (-Not $KMSPublishing) {$KMSPublishing = "TRUE"} else {$KMSPublishing = BoolToWStr (!$KMSPublishing)} + if (-Not $KMSPriority) {$KMSPriority = "FALSE"} else {$KMSPriority = BoolToWStr $KMSPriority} + + if ($KMSPublishing -EQ "TRUE") {$KMSPublishing = "Enabled"} else {$KMSPublishing = "Disabled"} + if ($KMSPriority -EQ "TRUE") {$KMSPriority = "Low"} else {$KMSPriority = "Normal"} + + if ($SLApp) + { + $propKMSServer | foreach { set $_ (SlGetInfoApp $strApp $_) } + } + else + { + $propKMSServer | foreach { set $_ (SlGetInfoService $_) } } - if (-Not $KeyManagementServiceListeningPort) {$KeyManagementServiceListeningPort = 1688} - if ($KeyManagementServiceDnsPublishing -EQ "TRUE") { - $KeyManagementServiceDnsPublishing = "Enabled" - } else { - $KeyManagementServiceDnsPublishing = "Disabled" - } - if ($KeyManagementServiceLowPriority -EQ "TRUE") { - $KeyManagementServiceLowPriority = "Low" - } else { - $KeyManagementServiceLowPriority = "Normal" - } + $KMSRequests = $KeyManagementServiceTotalRequests + $NoRequests = ($null -EQ $KMSRequests) -Or ($KMSRequests -EQ -1) -Or ($KMSRequests -EQ 4294967295) CONOUT "`nKey Management Service host information:" CONOUT " Current count: $KeyManagementServiceCurrentCount" - CONOUT " Listening on Port: $KeyManagementServiceListeningPort" - CONOUT " DNS publishing: $KeyManagementServiceDnsPublishing" - CONOUT " KMS priority: $KeyManagementServiceLowPriority" - if (-Not [String]::IsNullOrEmpty($KeyManagementServiceTotalRequests)) { - CONOUT "`nKey Management Service cumulative requests received from clients:" - CONOUT " Total: $KeyManagementServiceTotalRequests" - CONOUT " Failed: $KeyManagementServiceFailedRequests" - CONOUT " Unlicensed: $KeyManagementServiceUnlicensedRequests" - CONOUT " Licensed: $KeyManagementServiceLicensedRequests" - CONOUT " Initial grace period: $KeyManagementServiceOOBGraceRequests" - CONOUT " Expired or Hardware out of tolerance: $KeyManagementServiceOOTGraceRequests" - CONOUT " Non-genuine grace period: $KeyManagementServiceNonGenuineGraceRequests" - if ($null -NE $KeyManagementServiceNotificationRequests) {CONOUT " Notification: $KeyManagementServiceNotificationRequests"} + CONOUT " Listening on Port: $KMSListening" + CONOUT " DNS publishing: $KMSPublishing" + CONOUT " KMS priority: $KMSPriority" + if ($NoRequests) { + return } + CONOUT "`nKey Management Service cumulative requests received from clients:" + CONOUT " Total: $KeyManagementServiceTotalRequests" + CONOUT " Failed: $KeyManagementServiceFailedRequests" + CONOUT " Unlicensed: $KeyManagementServiceUnlicensedRequests" + CONOUT " Licensed: $KeyManagementServiceLicensedRequests" + CONOUT " Initial grace period: $KeyManagementServiceOOBGraceRequests" + CONOUT " Expired or Hardware out of tolerance: $KeyManagementServiceOOTGraceRequests" + CONOUT " Non-genuine grace period: $KeyManagementServiceNonGenuineGraceRequests" + if ($null -NE $KeyManagementServiceNotificationRequests) {CONOUT " Notification: $KeyManagementServiceNotificationRequests"} } function DetectKmsClient { - if ($null -NE $VLActivationTypeEnabled) {CONOUT "Configured Activation Type: $($VLActTypes[$VLActivationTypeEnabled])"} + if ($strSLP -EQ $wslp -And $NT8) + { + $VLType = strGetRegistry ($SPKeyPath + '\' + $strApp + '\' + $ID) "VLActivationType" + if ($null -EQ $VLType) {$VLType = strGetRegistry ($SPKeyPath + '\' + $strApp) "VLActivationType"} + if ($null -EQ $VLType) {$VLType = strGetRegistry ($SPKeyPath) "VLActivationType"} + if ($null -EQ $VLType -Or $VLType -GT 3) {$VLType = 0} + } + if ($null -NE $VLType) {CONOUT "Configured Activation Type: $($VLActTypes[$VLType])"} + CONOUT "`r" if ($LicenseStatus -NE 1) { CONOUT "Please activate the product in order to update KMS client information values." return } - if ($Vista) { - $KeyManagementServicePort = strGetRegistry $SLKeyPath "KeyManagementServicePort" - $DiscoveredKeyManagementServiceMachineName = strGetRegistry $NSKeyPath "DiscoveredKeyManagementServiceName" - $DiscoveredKeyManagementServiceMachinePort = strGetRegistry $NSKeyPath "DiscoveredKeyManagementServicePort" + if ($NT7 -Or $strSLP -EQ $oslp) { + $propKMSClient | foreach { set $_ (SlGetInfoSku $ID $_) } + if ($strSLP -EQ $oslp) {$regk = $OPKeyPath} else {$regk = $SPKeyPath} + $KMSCaching = strGetRegistry $regk "DisableKeyManagementServiceHostCaching" + if (-Not $KMSCaching) {$KMSCaching = "TRUE"} else {$KMSCaching = BoolToWStr (!$KMSCaching)} } - if ([String]::IsNullOrEmpty($KeyManagementServiceMachine)) { + "ClientMachineID" | foreach { set $_ (SlGetInfoService $_) } + + if ($Vista) { + $propKMSVista | foreach { set $_ (SlGetInfoService $_) } + $KeyManagementServicePort = strGetRegistry $SLKeyPath "KeyManagementServicePort" + $DiscoveredKeyManagementServiceName = strGetRegistry $NSKeyPath "DiscoveredKeyManagementServiceName" + $DiscoveredKeyManagementServicePort = strGetRegistry $NSKeyPath "DiscoveredKeyManagementServicePort" + } + + if ([String]::IsNullOrEmpty($KeyManagementServiceName)) { $KmsReg = $null } else { if (-Not $KeyManagementServicePort) {$KeyManagementServicePort = 1688} - $KmsReg = "Registered KMS machine name: ${KeyManagementServiceMachine}:${KeyManagementServicePort}" + $KmsReg = "Registered KMS machine name: ${KeyManagementServiceName}:${KeyManagementServicePort}" } - if ([String]::IsNullOrEmpty($DiscoveredKeyManagementServiceMachineName)) { + if ([String]::IsNullOrEmpty($DiscoveredKeyManagementServiceName)) { $KmsDns = "DNS auto-discovery: KMS name not available" if ($Vista -And -Not $Admin) {$KmsDns = "DNS auto-discovery: Run the script as administrator to retrieve info"} } else { - if (-Not $DiscoveredKeyManagementServiceMachinePort) {$DiscoveredKeyManagementServiceMachinePort = 1688} - $KmsDns = "KMS machine name from DNS: ${DiscoveredKeyManagementServiceMachineName}:${DiscoveredKeyManagementServiceMachinePort}" + if (-Not $DiscoveredKeyManagementServicePort) {$DiscoveredKeyManagementServicePort = 1688} + $KmsDns = "KMS machine name from DNS: ${DiscoveredKeyManagementServiceName}:${DiscoveredKeyManagementServicePort}" } - if ($null -NE $objSvc.KeyManagementServiceHostCaching) { - if ($objSvc.KeyManagementServiceHostCaching -EQ "TRUE") { - $KeyManagementServiceHostCaching = "Enabled" - } else { - $KeyManagementServiceHostCaching = "Disabled" + if ($null -NE $KMSCaching) { + if ($KMSCaching -EQ "TRUE") {$KMSCaching = "Enabled"} else {$KMSCaching = "Disabled"} + } + + if ($strSLP -EQ $wslp -And $NT9) { + if ([String]::IsNullOrEmpty($DiscoveredKeyManagementServiceIpAddress)) { + $DiscoveredKeyManagementServiceIpAddress = "not available" } } CONOUT "Key Management Service client information:" - CONOUT " Client Machine ID (CMID): $($objSvc.ClientMachineID)" + CONOUT " Client Machine ID (CMID): $ClientMachineID" if ($null -EQ $KmsReg) { CONOUT " $KmsDns" CONOUT " Registered KMS machine name: KMS name not available" } else { CONOUT " $KmsReg" } - if ($null -NE $DiscoveredKeyManagementServiceMachineIpAddress) {CONOUT " KMS machine IP address: $DiscoveredKeyManagementServiceMachineIpAddress"} - CONOUT " KMS machine extended PID: $KeyManagementServiceProductKeyID" + if ($null -NE $DiscoveredKeyManagementServiceIpAddress) {CONOUT " KMS machine IP address: $DiscoveredKeyManagementServiceIpAddress"} + CONOUT " KMS machine extended PID: $CustomerPID" CONOUT " Activation interval: $VLActivationInterval minutes" CONOUT " Renewal interval: $VLRenewalInterval minutes" - if ($null -NE $KeyManagementServiceHostCaching) {CONOUT " KMS host caching: $KeyManagementServiceHostCaching"} + if ($null -NE $KMSCaching) {CONOUT " KMS host caching: $KMSCaching"} if (-Not [String]::IsNullOrEmpty($KeyManagementServiceLookupDomain)) {CONOUT " KMS SRV record lookup domain: $KeyManagementServiceLookupDomain"} } -function GetResult($strSLP, $strSLS, $strID) +function GetResult($strSLP, $strApp, $entry) { - try - { - $objPrd = [wmisearcher]"SELECT * FROM $strSLP WHERE ID='$strID'" - $objPrd.Options.Rewindable = $false - $objPrd.Get() | select -Expand Properties -EA 0 | foreach { if (-Not [String]::IsNullOrEmpty($_.Value)) {set $_.Name $_.Value} } - $objPrd.Dispose() - } - catch - { - return - } + $ID = $entry.id + $propPrd | foreach { set $_ (SlGetInfoSku $ID $_) } + . SlGetInfoLicensing $strApp $ID - $winID = ($ApplicationID -EQ $winApp) - $winPR = ($winID -And -Not $LicenseIsAddon) + $winID = ($strApp -EQ $winApp) + $winPR = ($winID -And -Not $entry.ex) $Vista = ($winID -And $NT6 -And -Not $NT7) $NT5 = ($strSLP -EQ $wslp -And $winbuild -LT 6001) $reapp = ("Windows", "App")[!$winID] @@ -437,16 +785,15 @@ function GetResult($strSLP, $strSLS, $strID) if ($Description | Select-String "TIMEBASED_") {$cTblClient = 1; $_mTag = "Timebased"} if ($Description | Select-String "VIRTUAL_MACHINE_ACTIVATION") {$cAvmClient = 1; $_mTag = "Automatic VM"} if ($null -EQ $cKmsClient) { - if ($Description | Select-String "VOLUME_KMS") {$cKmsHost = 1} + if ($Description | Select-String "VOLUME_KMS") {$cKmsServer = 1} } $_gpr = [Math]::Round($GracePeriodRemaining/1440) if ($_gpr -GT 0) { - $_xpr = [DateTime]::Now.addMinutes($GracePeriodRemaining).ToString('yyyy-MM-dd hh:mm:ss tt') + $_xpr = [DateTime]::Now.AddMinutes($GracePeriodRemaining).ToString('yyyy-MM-dd hh:mm:ss tt') } - if ($null -EQ $LicenseStatusReason) {$LicenseStatusReason = -1} - $LicenseReason = '0x{0:X}' -f $LicenseStatusReason + $LicenseReason = '0x{0:X}' -f $hrReason $LicenseMsg = "Time remaining: $GracePeriodRemaining minute(s) ($_gpr day(s))" if ($LicenseStatus -EQ 0) { $LicenseInf = "Unlicensed" @@ -454,8 +801,8 @@ function GetResult($strSLP, $strSLS, $strID) } if ($LicenseStatus -EQ 1) { $LicenseInf = "Licensed" - $LicenseMsg = $null if ($GracePeriodRemaining -EQ 0) { + $LicenseMsg = $null $ExpireMsg = "The $prmnt is permanently activated." } else { $LicenseMsg = "$_mTag activation expiration: $GracePeriodRemaining minute(s) ($_gpr day(s))" @@ -490,24 +837,54 @@ function GetResult($strSLP, $strSLS, $strID) if ($null -NE $_xpr) {$ExpireMsg = "Extended grace period ends $_xpr"} } - if ($winPR -And $PartialProductKey -And -Not $NT9) { - $dp4 = strGetRegistry "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion" "DigitalProductId4" - if ($null -NE $dp4) { - $ProductKeyChannel = ([System.Text.Encoding]::Unicode.GetString($dp4, 1016, 128)).Trim([char]$null) + $pkid = $entry.pk + if ($null -NE $pkid) { + $propPkey | foreach { set $_ (SlGetInfoPKey $pkid $_) } + } + + if ($winPR -And $null -NE $PartialProductKey -And -Not $NT8) { + $uxd = SlGetInfoSku $ID 'UXDifferentiator' + $script:primary += @{ + aid = $ID; + ppk = $PartialProductKey; + chn = $Channel; + lst = $LicenseStatus; + lcr = $hrReason; + ged = $GracePeriodRemaining; + evl = $EvaluationEndDate; + dff = $uxd } } - if ($winPR -And $Dlv -And $NT7 -And $null -EQ $RemainingAppReArmCount) { - try + if ($IID -And $null -NE $PartialProductKey) { + $OfflineInstallationId = SlGetInfoIID $ID + } + + if ($Dlv) { + if ($strSLP -EQ $wslp -And $NT8) { - $tmp = [wmisearcher]"SELECT RemainingWindowsReArmCount FROM $strSLS" - $tmp.Options.Rewindable = $false - $tmp.Get() | select -Expand Properties -EA 0 | foreach {set $_.Name $_.Value} - $tmp.Dispose() + $RemainingSkuReArmCount = SlGetInfoSku $ID 'RemainingRearmCount' + $RemainingAppReArmCount = SlGetInfoApp $strApp 'RemainingRearmCount' } - catch + else { + if (($winID -And $NT7) -Or $strSLP -EQ $oslp) + { + $RemainingSLReArmCount = SlGetInfoApp $strApp 'RemainingRearmCount' + } + else + { + $RemainingSLReArmCount = SlGetInfoService 'RearmCount' + } } + if ($null -EQ $TrustedTime) + { + $TrustedTime = SlGetInfoSvcApp $strApp 'TrustedTime' + } + } + + if ($Dlv -Or $All.IsPresent) { + $gPHN = SlCheckInfo $ID "msft:sl/EUL/PHONE/PUBLIC" } $add_on = $Name.IndexOf("add-on for", 5) @@ -516,73 +893,56 @@ function GetResult($strSLP, $strSLS, $strID) if ($add_on -EQ -1) {CONOUT "Name: $Name"} else {CONOUT "Name: $($Name.Substring(0, $add_on + 7))"} CONOUT "Description: $Description" CONOUT "Activation ID: $ID" - if ($null -NE $ProductKeyID) {CONOUT "Extended PID: $ProductKeyID"} - if ($null -NE $ProductKeyID2 -And $Dlv) {CONOUT "Product ID: $ProductKeyID2"} + if ($null -NE $DigitalPID) {CONOUT "Extended PID: $DigitalPID"} + if ($null -NE $DigitalPID2 -And $Dlv) {CONOUT "Product ID: $DigitalPID2"} if ($null -NE $OfflineInstallationId -And $IID) {CONOUT "Installation ID: $OfflineInstallationId"} - if ($null -NE $ProductKeyChannel) {CONOUT "Product Key Channel: $ProductKeyChannel"} + if ($null -NE $Channel) {CONOUT "Product Key Channel: $Channel"} if ($null -NE $PartialProductKey) {CONOUT "Partial Product Key: $PartialProductKey"} CONOUT "License Status: $LicenseInf" if ($null -NE $LicenseMsg) {CONOUT "$LicenseMsg"} - if ($LicenseStatus -NE 0 -And $EvaluationEndDate.Substring(0,4) -NE "1601") { - $EED = [DateTime]::Parse([Management.ManagementDateTimeConverter]::ToDateTime($EvaluationEndDate),$null,48).ToString('yyyy-MM-dd hh:mm:ss tt') + if ($LicenseStatus -NE 0 -And $EvaluationEndDate) { + $EED = [DateTime]::FromFileTimeUtc($EvaluationEndDate).ToString('yyyy-MM-dd hh:mm:ss tt') CONOUT "Evaluation End Date: $EED UTC" } + if ($LicenseStatus -NE 1 -And $null -NE $gPHN) { + $gPHN = $gPHN.ToString() + CONOUT "Phone activatable: $gPHN" + } if ($Dlv) { - if ($null -NE $RemainingWindowsReArmCount) { - CONOUT "Remaining Windows rearm count: $RemainingWindowsReArmCount" + if ($null -NE $RemainingSLReArmCount) { + CONOUT "Remaining $reapp rearm count: $RemainingSLReArmCount" } - if ($null -NE $RemainingSkuReArmCount -And $RemainingSkuReArmCount -NE 4294967295) { + if ($null -NE $RemainingSkuReArmCount) { CONOUT "Remaining $reapp rearm count: $RemainingAppReArmCount" CONOUT "Remaining SKU rearm count: $RemainingSkuReArmCount" } - if ($null -NE $TrustedTime -And $LicenseStatus -NE 0) { - $TTD = [DateTime]::Parse([Management.ManagementDateTimeConverter]::ToDateTime($TrustedTime),$null,32).ToString('yyyy-MM-dd hh:mm:ss tt') + if ($LicenseStatus -NE 0 -And $TrustedTime) { + $TTD = [DateTime]::FromFileTime($TrustedTime).ToString('yyyy-MM-dd hh:mm:ss tt') CONOUT "Trusted time: $TTD" } } - if ($LicenseStatus -EQ 0) { + if ($null -EQ $PartialProductKey) { return } - if ($strSLP -EQ $wslp -And $null -NE $PartialProductKey -And $null -NE $ADActivationObjectName -And $VLActivationType -EQ 1) { + if ($strSLP -EQ $wslp -And $NT8 -And $VLActivationType -EQ 1) { DetectAdbaClient } - if ($winID -And $null -NE $cAvmClient -And $null -NE $PartialProductKey) { + if ($winID -And $null -NE $cAvmClient) { DetectAvmClient } $chkSub = ($winPR -And $cSub) - $chkSLS = ($null -NE $PartialProductKey) -And ($null -NE $cKmsClient -Or $null -NE $cKmsHost -Or $chkSub) + $chkSLS = ($null -NE $cKmsClient -Or $null -NE $cKmsServer -Or $chkSub) if (!$chkSLS) { if ($null -NE $ExpireMsg) {CONOUT "`n $ExpireMsg"} return } - try - { - $objSvc = New-Object PSObject - $wmiSvc = [wmisearcher]"SELECT * FROM $strSLS" - $wmiSvc.Options.Rewindable = $false - $wmiSvc.Get() | select -Expand Properties -EA 0 | foreach { if (-Not [String]::IsNullOrEmpty($_.Value)) {$objSvc | Add-Member 8 $_.Name $_.Value} } - $wmiSvc.Dispose() - if ($null -EQ $IsKeyManagementServiceMachine) {$objSvc.PSObject.Properties | foreach {set $_.Name $_.Value}} - } - catch - { - return - } - - if ($strSLS -EQ $wsls -And $NT9) { - if ([String]::IsNullOrEmpty($DiscoveredKeyManagementServiceMachineIpAddress)) { - $DiscoveredKeyManagementServiceMachineIpAddress = "not available" - } - } - - if ($null -NE $cKmsHost -And $IsKeyManagementServiceMachine -GT 0) { - if ($null -NE $ExpireMsg) {CONOUT "`n $ExpireMsg"} + if ($null -NE $cKmsServer) { DetectKmsHost } @@ -590,7 +950,7 @@ function GetResult($strSLP, $strSLS, $strID) DetectKmsClient } - if ($null -EQ $cKmsHost) { + if ($null -EQ $cKmsServer) { if ($null -NE $ExpireMsg) {CONOUT "`n $ExpireMsg"} } @@ -599,6 +959,16 @@ function GetResult($strSLP, $strSLS, $strID) } } + +function ParseList($strSLP, $strApp, $arrList) +{ + foreach ($entry in $arrList) + { + GetResult $strSLP $strApp $entry + CONOUT "$line3" + & $noAll + } +} #endregion #region vNextDiag @@ -817,31 +1187,6 @@ IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. #> -function BoolToWStr($bVal) { - ("TRUE", "FALSE")[!$bVal] -} - -function InitializePInvoke { - $Marshal = [System.Runtime.InteropServices.Marshal] - $Module = [AppDomain]::CurrentDomain.DefineDynamicAssembly((Get-Random), 'Run').DefineDynamicModule((Get-Random)) - - $Class = $Module.DefineType('NativeMethods', 'Public, Abstract, Sealed, BeforeFieldInit', [Object], 0) - $Class.DefinePInvokeMethod('SLIsWindowsGenuineLocal', 'slc.dll', 'Public, Static', 'Standard', [Int32], @([UInt32].MakeByRefType()), 'Winapi', 'Unicode').SetImplementationFlags('PreserveSig') - $Class.DefinePInvokeMethod('SLGetWindowsInformationDWORD', 'slc.dll', 22, 1, [Int32], @([String], [UInt32].MakeByRefType()), 1, 3).SetImplementationFlags(128) - $Class.DefinePInvokeMethod('SLGetWindowsInformation', 'slc.dll', 22, 1, [Int32], @([String], [UInt32].MakeByRefType(), [UInt32].MakeByRefType(), [IntPtr].MakeByRefType()), 1, 3).SetImplementationFlags(128) - - if ($DllSubscription) { - $Class.DefinePInvokeMethod('ClipGetSubscriptionStatus', 'Clipc.dll', 22, 1, [Int32], @([IntPtr].MakeByRefType()), 1, 3).SetImplementationFlags(128) - $Struct = $Class.DefineNestedType('SubStatus', 'NestedPublic, SequentialLayout, Sealed, BeforeFieldInit', [ValueType], 0) - [void]$Struct.DefineField('dwEnabled', [UInt32], 'Public') - [void]$Struct.DefineField('dwSku', [UInt32], 6) - [void]$Struct.DefineField('dwState', [UInt32], 6) - $SubStatus = $Struct.CreateType() - } - - $Win32 = $Class.CreateType() -} - function InitializeDigitalLicenseCheck { $CAB = [System.Reflection.Emit.CustomAttributeBuilder] @@ -896,36 +1241,29 @@ function PrintLastActivationHResult { } function PrintLastActivationTime { - $pdwLastTime = 0 + $pqwLastTime = 0 $cbSize = 0 if ($Win32::SLGetWindowsInformation( "Security-SPP-LastWindowsActivationTime", [ref]$null, [ref]$cbSize, - [ref]$pdwLastTime + [ref]$pqwLastTime )) { return $FALSE } - $actTime = $Marshal::ReadInt64($pdwLastTime) + $actTime = $Marshal::ReadInt64($pqwLastTime) if ($actTime -ne 0) { CONOUT (" LastActivationTime={0}" -f [DateTime]::FromFileTimeUtc($actTime).ToString("yyyy/MM/dd:HH:mm:ss")) } - $Marshal::FreeHGlobal($pdwLastTime) + $Marshal::FreeHGlobal($pqwLastTime) return $TRUE } function PrintIsWindowsGenuine { $dwGenuine = 0 - $ppwszGenuineStates = @( - "SL_GEN_STATE_IS_GENUINE", - "SL_GEN_STATE_INVALID_LICENSE", - "SL_GEN_STATE_TAMPERED", - "SL_GEN_STATE_OFFLINE", - "SL_GEN_STATE_LAST" - ) if ($Win32::SLIsWindowsGenuineLocal([ref]$dwGenuine)) { return $FALSE @@ -1022,6 +1360,126 @@ function ClicRun } #endregion +#region clc +function clcGetExpireKrn +{ + $tData = 0 + $cData = 0 + $bData = 0 + + $ret = $Win32::SLGetWindowsInformation( + "Kernel-ExpirationDate", + [ref]$tData, + [ref]$cData, + [ref]$bData + ) + + if ($ret -Or !$cData -Or $tData -NE 3) + { + return $null + } + + $year = $Marshal::ReadInt16($bData, 0) + if ($year -EQ 0 -Or $year -EQ 1601) + { + $rData = $null + } + else + { + $rData = '{0}/{1}/{2}:{3}:{4}:{5}' -f $year, $Marshal::ReadInt16($bData, 2), $Marshal::ReadInt16($bData, 4), $Marshal::ReadInt16($bData, 6), $Marshal::ReadInt16($bData, 8), $Marshal::ReadInt16($bData, 10) + } + + $Marshal::FreeHGlobal($bData) + return $rData +} + +function clcGetExpireSys +{ + $kuser = $Marshal::ReadInt64((New-Object IntPtr(0x7FFE02C8))) + + if ($kuser -EQ 0) + { + return $null + } + + $rData = [DateTime]::FromFileTimeUTC($kuser).ToString('yyyy/MM/dd:HH:mm:ss') + return $rData +} + +function clcGetLicensingState($dwState) +{ + if ($dwState -EQ 5) { + $dwState = 3 + } elseif ($dwState -EQ 3 -Or $dwState -EQ 4 -Or $dwState -EQ 6) { + $dwState = 2 + } elseif ($dwState -GT 6) { + $dwState = 4 + } + + $rData = '{0}' -f $ppwszLicensingStates[$dwState] + return $rData +} + +function clcGetGenuineState($AppId) +{ + $dwGenuine = 0 + + if ($NT7) { + $ret = $Win32::SLIsWindowsGenuineLocal([ref]$dwGenuine) + } else { + $ret = $Win32::SLIsGenuineLocal([ref][Guid]$AppId, [ref]$dwGenuine, 0) + } + + if ($ret) + { + $dwGenuine = 4 + } + + if ($dwGenuine -LT 5) { + $rData = '{0}' -f $ppwszGenuineStates[$dwGenuine] + } else { + $rData = $dwGenuine + } + return $rData +} + +function ClcRun +{ + $prs = $script:primary[0] + if ($null -EQ $prs) { + return + } + + $lState = clcGetLicensingState $prs.lst + $uState = clcGetGenuineState $winApp + $TbbKrn = clcGetExpireKrn + $TbbSys = clcGetExpireSys + if ($null -NE $TbbKrn) { + $ked = $TbbKrn + } elseif ($null -NE $TbbSys) { + $ked = $TbbSys + } + + & $isAll + CONOUT "Client Licensing Check information:" + + CONOUT (" AppId={0}" -f $winApp) + if ($prs.ged) { CONOUT (" GraceEndDate={0}" -f ([DateTime]::UtcNow.AddMinutes($prs.ged).ToString('yyyy/MM/dd:HH:mm:ss'))) } + if ($null -NE $ked) { CONOUT (" KernelTimebombDate={0}" -f $ked) } + CONOUT (" LastConsumptionReason=0x{0:x8}" -f $prs.lcr) + if ($prs.evl) { CONOUT (" LicenseExpirationDate={0}" -f ([DateTime]::FromFileTimeUtc($prs.evl).ToString('yyyy/MM/dd:HH:mm:ss'))) } + CONOUT (" LicenseState={0}" -f $lState) + CONOUT (" PartialProductKey={0}" -f $prs.ppk) + CONOUT (" ProductKeyType={0}" -f $prs.chn) + CONOUT (" SkuId={0}" -f $prs.aid) + CONOUT (" uxDifferentiator={0}" -f $prs.dff) + CONOUT (" IsWindowsGenuine={0}" -f $uState) + + CONOUT "$line3" + & $noAll +} +#endregion + $Host.UI.RawUI.WindowTitle = "Check Activation Status" if ($All.IsPresent) { $B=$Host.UI.RawUI.BufferSize;$B.Height=3000;$Host.UI.RawUI.BufferSize=$B; @@ -1040,14 +1498,38 @@ $osls = "OfficeSoftwareProtectionService" $winApp = "55c92734-d682-4d71-983e-d6ec3f16059f" $o14App = "59a52881-a989-479d-af46-f275c6370663" $o15App = "0ff1ce15-a989-479d-af46-f275c6370663" -$cSub = ($winbuild -GE 19041) -And (Select-String -Path "$SysPath\wbem\sppwmi.mof" -Encoding unicode -Pattern "SubscriptionType") +$cSub = ($winbuild -GE 26000) -And (Select-String -Path "$SysPath\wbem\sppwmi.mof" -Encoding unicode -Pattern "SubscriptionType") $DllDigital = ($winbuild -GE 14393) -And (Test-Path "$SysPath\EditionUpgradeManagerObj.dll") $DllSubscription = ($winbuild -GE 14393) -And (Test-Path "$SysPath\Clipc.dll") $VLActTypes = @("All", "AD", "KMS", "Token") +$OPKeyPath = "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\OfficeSoftwareProtectionPlatform" +$SPKeyPath = "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\SoftwareProtectionPlatform" $SLKeyPath = "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\SL" $NSKeyPath = "HKEY_USERS\S-1-5-20\SOFTWARE\Microsoft\Windows NT\CurrentVersion\SL" +$propPrd = 'Name', 'Description', 'TrustedTime', 'VLActivationType' +$propPkey = 'PartialProductKey', 'Channel', 'DigitalPID', 'DigitalPID2' +$propKMSServer = 'KeyManagementServiceCurrentCount', 'KeyManagementServiceTotalRequests', 'KeyManagementServiceFailedRequests', 'KeyManagementServiceUnlicensedRequests', 'KeyManagementServiceLicensedRequests', 'KeyManagementServiceOOBGraceRequests', 'KeyManagementServiceOOTGraceRequests', 'KeyManagementServiceNonGenuineGraceRequests', 'KeyManagementServiceNotificationRequests' +$propKMSClient = 'CustomerPID', 'KeyManagementServiceName', 'KeyManagementServicePort', 'DiscoveredKeyManagementServiceName', 'DiscoveredKeyManagementServicePort', 'DiscoveredKeyManagementServiceIpAddress', 'VLActivationInterval', 'VLRenewalInterval', 'KeyManagementServiceLookupDomain' +$propKMSVista = 'CustomerPID', 'KeyManagementServiceName', 'VLActivationInterval', 'VLRenewalInterval' +$propADBA = 'ADActivationObjectName', 'ADActivationObjectDN', 'ADActivationCsvlkPID', 'ADActivationCsvlkSkuID' +$propAVMA = 'InheritedActivationId', 'InheritedActivationHostMachineName', 'InheritedActivationHostDigitalPid2', 'InheritedActivationActivationTime' +$primary = @() +$ppwszGenuineStates = @( + "SL_GEN_STATE_IS_GENUINE", + "SL_GEN_STATE_INVALID_LICENSE", + "SL_GEN_STATE_TAMPERED", + "SL_GEN_STATE_OFFLINE", + "SL_GEN_STATE_LAST" +) +$ppwszLicensingStates = @( + "SL_LICENSING_STATUS_UNLICENSED", + "SL_LICENSING_STATUS_LICENSED", + "SL_LICENSING_STATUS_IN_GRACE_PERIOD", + "SL_LICENSING_STATUS_NOTIFICATION", + "SL_LICENSING_STATUS_LAST" +) -'cW1nd0ws', 'c0ff1ce15', 'c0ff1ce14', 'ospp14', 'ospp15' | foreach {set $_ $false} +'cW1nd0ws', 'c0ff1ce15', 'c0ff1ce14', 'ospp14', 'ospp15' | foreach {set $_ @()} $offsvc = "osppsvc" if ($NT7 -Or -Not $NT6) {$winsvc = "sppsvc"} else {$winsvc = "slsvc"} @@ -1055,83 +1537,102 @@ if ($NT7 -Or -Not $NT6) {$winsvc = "sppsvc"} else {$winsvc = "slsvc"} try {gsv $winsvc -EA 1 | Out-Null; $WsppHook = 1} catch {$WsppHook = 0} try {gsv $offsvc -EA 1 | Out-Null; $OsppHook = 1} catch {$OsppHook = 0} -if ($WsppHook -NE 0) { - try {sasv $winsvc -EA 1} catch {} - $cW1nd0ws = DetectID $wslp $winApp - $c0ff1ce15 = DetectID $wslp $o15App - $c0ff1ce14 = DetectID $wslp $o14App +if (Test-Path "$SysPath\sppc.dll") { + $SLdll = 'sppc.dll' +} elseif (Test-Path "$SysPath\slc.dll") { + $SLdll = 'slc.dll' +} else { + $WsppHook = 0 } if ($OsppHook -NE 0) { - try {sasv $offsvc -EA 1} catch {} - $ospp15 = DetectID $oslp $o15App - $ospp14 = DetectID $oslp $o14App + $OLdll = (strGetRegistry $OPKeyPath "Path") + 'osppc.dll' + if (!(Test-Path "$OLdll")) {$OsppHook = 0} } -if ($cW1nd0ws) +if ($WsppHook -NE 0) { + if ($NT6 -And -Not $NT7 -And -Not $Admin) { + if ($null -EQ [Diagnostics.Process]::GetProcessesByName("$winsvc")[0].ProcessName) {$WsppHook = 0; CONOUT "`nError: failed to start $winsvc Service.`n"} + } else { + try {sasv $winsvc -EA 1} catch {$WsppHook = 0; CONOUT "`nError: failed to start $winsvc Service.`n"} + } +} + +if ($WsppHook -NE 0) { + . InitializePInvoke $SLdll $false + $hSLC = 0 + [void]$Win32::SLOpen([ref]$hSLC) + + $cW1nd0ws = SlGetInfoSLID $winApp + $c0ff1ce15 = SlGetInfoSLID $o15App + $c0ff1ce14 = SlGetInfoSLID $o14App +} + +if ($cW1nd0ws.Count -GT 0) { echoWindows - GetID $wslp $winApp | foreach -EA 1 { - GetResult $wslp $wsls $_ - CONOUT "$line3" - & $noAll - } + ParseList $wslp $winApp $cW1nd0ws } elseif ($NT6) { echoWindows - CONOUT "`nError: product key not found." + CONOUT "Error: product key not found.`n" } -if ($winbuild -GE 9200) { - . InitializePInvoke +if ($NT6 -And -Not $NT8) { + ClcRun +} + +if ($NT8) { ClicRun } -if ($c0ff1ce15 -Or $ospp15) { - CheckOhook -} - $doMSG = 1 -if ($c0ff1ce15) +if ($c0ff1ce15.Count -GT 0) { + CheckOhook echoOffice - GetID $wslp $o15App | foreach -EA 1 { - GetResult $wslp $wsls $_ - CONOUT "$line3" - & $noAll - } + ParseList $wslp $o15App $c0ff1ce15 } -if ($c0ff1ce14) +if ($c0ff1ce14.Count -GT 0) { echoOffice - GetID $wslp $o14App | foreach -EA 1 { - GetResult $wslp $wsls $_ - CONOUT "$line3" - & $noAll - } + ParseList $wslp $o14App $c0ff1ce14 } -if ($ospp15) -{ - echoOffice - GetID $oslp $o15App | foreach -EA 1 { - GetResult $oslp $osls $_ - CONOUT "$line3" - & $noAll - } +if ($hSLC) { + [void]$Win32::SLClose($hSLC) } -if ($ospp14) +if ($OsppHook -NE 0) { + try {sasv $offsvc -EA 1} catch {$OsppHook = 0; CONOUT "`nError: failed to start $offsvc Service.`n"} +} + +if ($OsppHook -NE 0) { + . InitializePInvoke "$OLdll" $true + $hSLC = 0 + [void]$Win32::SLOpen([ref]$hSLC) + + $ospp15 = SlGetInfoSLID $o15App + $ospp14 = SlGetInfoSLID $o14App +} + +if ($ospp15.Count -GT 0) { echoOffice - GetID $oslp $o14App | foreach -EA 1 { - GetResult $oslp $osls $_ - CONOUT "$line3" - & $noAll - } + ParseList $oslp $o15App $ospp15 +} + +if ($ospp14.Count -GT 0) +{ + echoOffice + ParseList $oslp $o14App $ospp14 +} + +if ($hSLC) { + [void]$Win32::SLClose($hSLC) } if ($NT7) { From 70162c413026ec938f1049b1e4011ac64945e31e Mon Sep 17 00:00:00 2001 From: WindowsAddict Date: Wed, 16 Apr 2025 05:30:31 +0530 Subject: [PATCH 22/79] Add support for external LibTSforge.dll if found in BIN folder --- MAS/All-In-One-Version-KL/MAS_AIO.cmd | 28 +++++++++++++------ .../Activators/TSforge_Activation.cmd | 28 +++++++++++++------ 2 files changed, 38 insertions(+), 18 deletions(-) diff --git a/MAS/All-In-One-Version-KL/MAS_AIO.cmd b/MAS/All-In-One-Version-KL/MAS_AIO.cmd index b5a94e7..7f7bb7a 100644 --- a/MAS/All-In-One-Version-KL/MAS_AIO.cmd +++ b/MAS/All-In-One-Version-KL/MAS_AIO.cmd @@ -154,6 +154,7 @@ goto dk_done set "_work=%~dp0" if "%_work:~-1%"=="\" set "_work=%_work:~0,-1%" +set "_workp=%_work:'=''%" set "_batf=%~f0" set "_batp=%_batf:'=''%" @@ -8826,17 +8827,26 @@ namespace LibTSforge.PhysicalStore } '@ $ErrorActionPreference = 'Stop' -$cp = [CodeDom.Compiler.CompilerParameters] [string[]]@("System.dll", "System.Core.dll", "System.ServiceProcess.dll", "System.Xml.dll") -$cp.CompilerOptions = "/unsafe" -$lang = If ((Get-Host).Version.Major -gt 2) { "CSharp" } Else { "CSharpVersion3" } +$binPath = Join-Path -Path $env:_workp -ChildPath "BIN\LibTSforge.dll" -$ctemp = "$env:SystemRoot\Temp\" -if (-Not (Test-Path -Path $ctemp)) { New-Item -Path $ctemp -ItemType Directory > $null } -$env:TMP = $ctemp -$env:TEMP = $ctemp +if (Test-Path -Path $binPath) { + Write-Host "LibTSforge.dll found in BIN folder. Loading the DLL..." + Add-Type -Path $binPath +} +else { + $cp = [CodeDom.Compiler.CompilerParameters] [string[]]@("System.dll", "System.Core.dll", "System.ServiceProcess.dll", "System.Xml.dll") + $cp.CompilerOptions = "/unsafe" + $lang = If ((Get-Host).Version.Major -gt 2) { "CSharp" } Else { "CSharpVersion3" } + + $ctemp = "$env:SystemRoot\Temp\" + if (-Not (Test-Path -Path $ctemp)) { New-Item -Path $ctemp -ItemType Directory > $null } + $env:TMP = $ctemp + $env:TEMP = $ctemp + + $cp.GenerateInMemory = $true + Add-Type -Language $lang -TypeDefinition $src -CompilerParameters $cp +} -$cp.GenerateInMemory = $true -Add-Type -Language $lang -TypeDefinition $src -CompilerParameters $cp if ($env:_debug -eq '0') { [LibTSforge.Logger]::HideOutput = $true } diff --git a/MAS/Separate-Files-Version/Activators/TSforge_Activation.cmd b/MAS/Separate-Files-Version/Activators/TSforge_Activation.cmd index 7da980b..8d79784 100644 --- a/MAS/Separate-Files-Version/Activators/TSforge_Activation.cmd +++ b/MAS/Separate-Files-Version/Activators/TSforge_Activation.cmd @@ -221,6 +221,7 @@ goto dk_done set "_work=%~dp0" if "%_work:~-1%"=="\" set "_work=%_work:~0,-1%" +set "_workp=%_work:'=''%" set "_batf=%~f0" set "_batp=%_batf:'=''%" @@ -6709,17 +6710,26 @@ namespace LibTSforge.PhysicalStore } '@ $ErrorActionPreference = 'Stop' -$cp = [CodeDom.Compiler.CompilerParameters] [string[]]@("System.dll", "System.Core.dll", "System.ServiceProcess.dll", "System.Xml.dll") -$cp.CompilerOptions = "/unsafe" -$lang = If ((Get-Host).Version.Major -gt 2) { "CSharp" } Else { "CSharpVersion3" } +$binPath = Join-Path -Path $env:_workp -ChildPath "BIN\LibTSforge.dll" -$ctemp = "$env:SystemRoot\Temp\" -if (-Not (Test-Path -Path $ctemp)) { New-Item -Path $ctemp -ItemType Directory > $null } -$env:TMP = $ctemp -$env:TEMP = $ctemp +if (Test-Path -Path $binPath) { + Write-Host "LibTSforge.dll found in BIN folder. Loading the DLL..." + Add-Type -Path $binPath +} +else { + $cp = [CodeDom.Compiler.CompilerParameters] [string[]]@("System.dll", "System.Core.dll", "System.ServiceProcess.dll", "System.Xml.dll") + $cp.CompilerOptions = "/unsafe" + $lang = If ((Get-Host).Version.Major -gt 2) { "CSharp" } Else { "CSharpVersion3" } + + $ctemp = "$env:SystemRoot\Temp\" + if (-Not (Test-Path -Path $ctemp)) { New-Item -Path $ctemp -ItemType Directory > $null } + $env:TMP = $ctemp + $env:TEMP = $ctemp + + $cp.GenerateInMemory = $true + Add-Type -Language $lang -TypeDefinition $src -CompilerParameters $cp +} -$cp.GenerateInMemory = $true -Add-Type -Language $lang -TypeDefinition $src -CompilerParameters $cp if ($env:_debug -eq '0') { [LibTSforge.Logger]::HideOutput = $true } From e8bf344f745358e140b75dff677bb745e4a8cafa Mon Sep 17 00:00:00 2001 From: WindowsAddict Date: Wed, 16 Apr 2025 06:14:40 +0530 Subject: [PATCH 23/79] Add support for O365 15.0 in TSforge because phone license exist --- MAS/All-In-One-Version-KL/MAS_AIO.cmd | 6 +++++- .../Activators/TSforge_Activation.cmd | 6 +++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/MAS/All-In-One-Version-KL/MAS_AIO.cmd b/MAS/All-In-One-Version-KL/MAS_AIO.cmd index 7f7bb7a..c9946e9 100644 --- a/MAS/All-In-One-Version-KL/MAS_AIO.cmd +++ b/MAS/All-In-One-Version-KL/MAS_AIO.cmd @@ -4832,7 +4832,11 @@ call :dk_color %Gray% "Skipping Because Project/Visio Mode [%%#]" if not defined skipprocess ( -echo %%# | findstr /i "O365" %nul% && ( +set no365= +if "%oVer%"=="15" (echo %%# | findstr /i "O365HomePremRetail" %nul% && set no365=1) +if "%oVer%"=="16" (echo %%# | findstr /i "O365" %nul% && set no365=1) + +if defined no365 ( set _License=MondoRetail set _altoffid=MondoRetail call :ks_osppready diff --git a/MAS/Separate-Files-Version/Activators/TSforge_Activation.cmd b/MAS/Separate-Files-Version/Activators/TSforge_Activation.cmd index 8d79784..a4131f8 100644 --- a/MAS/Separate-Files-Version/Activators/TSforge_Activation.cmd +++ b/MAS/Separate-Files-Version/Activators/TSforge_Activation.cmd @@ -1611,7 +1611,11 @@ call :dk_color %Gray% "Skipping Because Project/Visio Mode [%%#]" if not defined skipprocess ( -echo %%# | findstr /i "O365" %nul% && ( +set no365= +if "%oVer%"=="15" (echo %%# | findstr /i "O365HomePremRetail" %nul% && set no365=1) +if "%oVer%"=="16" (echo %%# | findstr /i "O365" %nul% && set no365=1) + +if defined no365 ( set _License=MondoRetail set _altoffid=MondoRetail call :ks_osppready From a1614e128348a8e6953e318cc5f6522a1fa2621d Mon Sep 17 00:00:00 2001 From: WindowsAddict Date: Wed, 16 Apr 2025 08:03:58 +0530 Subject: [PATCH 24/79] Convert HomeStudentARM IDs to Mondo because phone license isn't available for them --- MAS/All-In-One-Version-KL/MAS_AIO.cmd | 11 +++++++++++ .../Activators/TSforge_Activation.cmd | 11 +++++++++++ 2 files changed, 22 insertions(+) diff --git a/MAS/All-In-One-Version-KL/MAS_AIO.cmd b/MAS/All-In-One-Version-KL/MAS_AIO.cmd index c9946e9..cce246a 100644 --- a/MAS/All-In-One-Version-KL/MAS_AIO.cmd +++ b/MAS/All-In-One-Version-KL/MAS_AIO.cmd @@ -4781,6 +4781,7 @@ set _prids= set _config= set _version= set _License= +set _oMSI= exit /b ::======================================================================================================================================== @@ -4843,6 +4844,15 @@ call :ks_osppready echo Converting Unsupported O365 Office [%%# To MondoRetail] ) +if not defined _oMSI ( +echo %%# | findstr /i "ARM" %nul% && ( +set _License=MondoRetail +set _altoffid=MondoRetail +call :ks_osppready +echo Converting Unsupported OEM-ARM Office [%%# To MondoRetail] +) +) + set keytype=zero for /f "delims=" %%a in ('%psc% "$f=[io.file]::ReadAllText('!_batp!') -split ':offtsid\:.*';iex ($f[1])" %nul6%') do ( echo "%%a" | findstr /r ".*-.*-.*-.*-.*" %nul1% && (set tsids=!tsids! %%a& set _actid=%%a) @@ -4891,6 +4901,7 @@ exit /b call :ts_reset call :dk_actids 0ff1ce15-a989-479d-af46-f275c6370663 +set _oMSI=1 set oVer=%1 for /f "skip=2 tokens=2*" %%a in ('"reg query %2\Common\InstallRoot /v Path" %nul6%') do (set "_oRoot=%%b") for /f "skip=2 tokens=2*" %%a in ('"reg query %2\Common\ProductVersion /v LastProduct" %nul6%') do (set "_version=%%b") diff --git a/MAS/Separate-Files-Version/Activators/TSforge_Activation.cmd b/MAS/Separate-Files-Version/Activators/TSforge_Activation.cmd index a4131f8..641f92d 100644 --- a/MAS/Separate-Files-Version/Activators/TSforge_Activation.cmd +++ b/MAS/Separate-Files-Version/Activators/TSforge_Activation.cmd @@ -1500,6 +1500,7 @@ set _prids= set _config= set _version= set _License= +set _oMSI= exit /b ::======================================================================================================================================== @@ -1622,6 +1623,15 @@ call :ks_osppready echo Converting Unsupported O365 Office [%%# To MondoRetail] ) +if not defined _oMSI ( +echo %%# | findstr /i "ARM" %nul% && ( +set _License=MondoRetail +set _altoffid=MondoRetail +call :ks_osppready +echo Converting Unsupported OEM-ARM Office [%%# To MondoRetail] +) +) + set keytype=zero for /f "delims=" %%a in ('%psc% "$f=[io.file]::ReadAllText('!_batp!') -split ':offtsid\:.*';iex ($f[1])" %nul6%') do ( echo "%%a" | findstr /r ".*-.*-.*-.*-.*" %nul1% && (set tsids=!tsids! %%a& set _actid=%%a) @@ -1670,6 +1680,7 @@ exit /b call :ts_reset call :dk_actids 0ff1ce15-a989-479d-af46-f275c6370663 +set _oMSI=1 set oVer=%1 for /f "skip=2 tokens=2*" %%a in ('"reg query %2\Common\InstallRoot /v Path" %nul6%') do (set "_oRoot=%%b") for /f "skip=2 tokens=2*" %%a in ('"reg query %2\Common\ProductVersion /v LastProduct" %nul6%') do (set "_version=%%b") From 372eb73a02260cf4bc6fd424bcc6216fa8a15be2 Mon Sep 17 00:00:00 2001 From: WindowsAddict Date: Thu, 17 Apr 2025 01:47:13 +0530 Subject: [PATCH 25/79] Add updated TSforge code --- MAS/All-In-One-Version-KL/MAS_AIO.cmd | 1953 ++++++++++++----- .../Activators/TSforge_Activation.cmd | 1953 ++++++++++++----- 2 files changed, 2844 insertions(+), 1062 deletions(-) diff --git a/MAS/All-In-One-Version-KL/MAS_AIO.cmd b/MAS/All-In-One-Version-KL/MAS_AIO.cmd index cce246a..f180db7 100644 --- a/MAS/All-In-One-Version-KL/MAS_AIO.cmd +++ b/MAS/All-In-One-Version-KL/MAS_AIO.cmd @@ -4951,23 +4951,16 @@ $src = @' // Common.cs namespace LibTSforge { - using Microsoft.Win32; using System; using System.IO; using System.Linq; using System.Runtime.InteropServices; - using System.ServiceProcess; using System.Text; - using LibTSforge.Crypto; - using LibTSforge.PhysicalStore; - using LibTSforge.SPP; - using LibTSforge.TokenStore; public enum PSVersion { Vista, Win7, - Win8Early, Win8, WinBlue, WinModern @@ -5038,8 +5031,8 @@ namespace LibTSforge 0x92, 0xA6, 0x56, 0x96 }; - // 2^31 - 1 minutes - public static ulong TimerMax = (ulong)TimeSpan.FromMinutes(2147483647).Ticks; + // 2^31 - 8 minutes + public static readonly ulong TimerMax = (ulong)TimeSpan.FromMinutes(2147483640).Ticks; public static readonly string ZeroCID = new string('0', 48); } @@ -5107,20 +5100,6 @@ namespace LibTSforge } return result; } - - public static T CastToStruct(this byte[] data) where T : struct - { - GCHandle handle = GCHandle.Alloc(data, GCHandleType.Pinned); - try - { - IntPtr ptr = handle.AddrOfPinnedObject(); - return (T)Marshal.PtrToStructure(ptr, typeof(T)); - } - finally - { - handle.Free(); - } - } } public static class FileStreamExt @@ -5141,6 +5120,12 @@ namespace LibTSforge public static class Utils { + [DllImport("kernel32.dll")] + public static extern uint GetSystemDefaultLCID(); + + [DllImport("kernel32.dll")] + public static extern bool Wow64EnableWow64FsRedirection(bool Wow64FsEnableRedirection); + public static string DecodeString(byte[] data) { return Encoding.Unicode.GetString(data).Trim('\0'); @@ -5151,9 +5136,6 @@ namespace LibTSforge return Encoding.Unicode.GetBytes(str + '\0'); } - [DllImport("kernel32.dll")] - public static extern uint GetSystemDefaultLCID(); - public static uint CRC32(byte[] data) { const uint polynomial = 0x04C11DB7; @@ -5177,157 +5159,6 @@ namespace LibTSforge return ~crc; } - public static void KillSPP() - { - ServiceController sc; - - try - { - sc = new ServiceController("sppsvc"); - - if (sc.Status == ServiceControllerStatus.Stopped) - return; - } - catch (InvalidOperationException ex) - { - throw new InvalidOperationException("Unable to access sppsvc: " + ex.Message); - } - - Logger.WriteLine("Stopping sppsvc..."); - - bool stopped = false; - - for (int i = 0; stopped == false && i < 60; i++) - { - try - { - if (sc.Status != ServiceControllerStatus.StopPending) - sc.Stop(); - - sc.WaitForStatus(ServiceControllerStatus.Stopped, TimeSpan.FromMilliseconds(500)); - } - catch (System.ServiceProcess.TimeoutException) - { - continue; - } - catch (InvalidOperationException) - { - System.Threading.Thread.Sleep(500); - continue; - } - - stopped = true; - } - - if (!stopped) - throw new System.TimeoutException("Failed to stop sppsvc"); - - Logger.WriteLine("sppsvc stopped successfully."); - } - - public static string GetPSPath(PSVersion version) - { - switch (version) - { - case PSVersion.Win7: - return Directory.GetFiles( - Environment.GetFolderPath(Environment.SpecialFolder.System), - "7B296FB0-376B-497e-B012-9C450E1B7327-*.C7483456-A289-439d-8115-601632D005A0") - .FirstOrDefault() ?? ""; - case PSVersion.Win8Early: - case PSVersion.WinBlue: - case PSVersion.Win8: - case PSVersion.WinModern: - return Path.Combine( - Environment.ExpandEnvironmentVariables( - (string)Registry.GetValue( - @"HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\SoftwareProtectionPlatform", - "TokenStore", - string.Empty - ) - ), - "data.dat" - ); - default: - return ""; - } - } - - public static string GetTokensPath(PSVersion version) - { - switch (version) - { - case PSVersion.Win7: - return Path.Combine( - Environment.ExpandEnvironmentVariables("%WINDIR%"), - @"ServiceProfiles\NetworkService\AppData\Roaming\Microsoft\SoftwareProtectionPlatform\tokens.dat" - ); - case PSVersion.Win8Early: - case PSVersion.WinBlue: - case PSVersion.Win8: - case PSVersion.WinModern: - return Path.Combine( - Environment.ExpandEnvironmentVariables( - (string)Registry.GetValue( - @"HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\SoftwareProtectionPlatform", - "TokenStore", - string.Empty - ) - ), - "tokens.dat" - ); - default: - return ""; - } - } - - public static IPhysicalStore GetStore(PSVersion version, bool production) - { - string psPath; - - try - { - psPath = GetPSPath(version); - } - catch - { - throw new FileNotFoundException("Failed to get path of physical store."); - } - - if (string.IsNullOrEmpty(psPath) || !File.Exists(psPath)) - { - throw new FileNotFoundException(string.Format("Physical store not found at expected path {0}.", psPath)); - } - - if (version == PSVersion.Vista) - { - throw new NotSupportedException("Physical store editing is not supported for Windows Vista."); - } - - return version == PSVersion.Win7 ? new PhysicalStoreWin7(psPath, production) : (IPhysicalStore)new PhysicalStoreModern(psPath, production, version); - } - - public static ITokenStore GetTokenStore(PSVersion version) - { - string tokPath; - - try - { - tokPath = GetTokensPath(version); - } - catch - { - throw new FileNotFoundException("Failed to get path of physical store."); - } - - if (string.IsNullOrEmpty(tokPath) || !File.Exists(tokPath)) - { - throw new FileNotFoundException(string.Format("Token store not found at expected path {0}.", tokPath)); - } - - return new TokenStoreModern(tokPath); - } - public static string GetArchitecture() { string arch = Environment.GetEnvironmentVariable("PROCESSOR_ARCHITECTURE", EnvironmentVariableTarget.Machine).ToUpperInvariant(); @@ -5343,65 +5174,7 @@ namespace LibTSforge if (build >= 7600 && build <= 7602) return PSVersion.Win7; if (build == 9200) return PSVersion.Win8; - throw new NotSupportedException("Unable to auto-detect version info, please specify one manually using the /ver argument."); - } - - public static bool DetectCurrentKey() - { - SLApi.RefreshLicenseStatus(); - - using (RegistryKey wpaKey = Registry.LocalMachine.OpenSubKey(@"SYSTEM\WPA")) - { - foreach (string subKey in wpaKey.GetSubKeyNames()) - { - if (subKey.StartsWith("8DEC0AF1") && subKey.EndsWith("-1")) - { - return subKey.Contains("P"); - } - } - } - - throw new FileNotFoundException("Failed to autodetect key type, specify physical store key with /prod or /test arguments."); - } - - public static void DumpStore(PSVersion version, bool production, string filePath, string encrFilePath) - { - if (encrFilePath == null) - { - encrFilePath = GetPSPath(version); - } - - if (string.IsNullOrEmpty(encrFilePath) || !File.Exists(encrFilePath)) - { - throw new FileNotFoundException("Store does not exist at expected path '" + encrFilePath + "'."); - } - - KillSPP(); - - using (FileStream fs = File.Open(encrFilePath, FileMode.OpenOrCreate, FileAccess.ReadWrite, FileShare.None)) - { - byte[] encrData = fs.ReadAllBytes(); - File.WriteAllBytes(filePath, PhysStoreCrypto.DecryptPhysicalStore(encrData, production)); - } - - Logger.WriteLine("Store dumped successfully to '" + filePath + "'."); - } - - public static void LoadStore(PSVersion version, bool production, string filePath) - { - if (string.IsNullOrEmpty(filePath) || !File.Exists(filePath)) - { - throw new FileNotFoundException("Store file '" + filePath + "' does not exist."); - } - - KillSPP(); - - using (IPhysicalStore store = GetStore(version, production)) - { - store.WriteRaw(File.ReadAllBytes(filePath)); - } - - Logger.WriteLine("Loaded store file succesfully."); + throw new NotSupportedException("Unable to auto-detect version info"); } } @@ -5494,8 +5267,8 @@ namespace LibTSforge.SPP public class PKeyConfig { - public Dictionary Products = new Dictionary(); - private List loadedPkeyConfigs = new List(); + public readonly Dictionary Products = new Dictionary(); + private readonly List loadedPkeyConfigs = new List(); public void LoadConfig(Guid actId) { @@ -5556,12 +5329,14 @@ namespace LibTSforge.SPP ranges[refActIdStr] = new List(); } - KeyRange keyRange = new KeyRange(); - keyRange.Start = int.Parse(rangeNode.SelectSingleNode("./p:Start", nsmgr).InnerText); - keyRange.End = int.Parse(rangeNode.SelectSingleNode("./p:End", nsmgr).InnerText); - keyRange.EulaType = rangeNode.SelectSingleNode("./p:EulaType", nsmgr).InnerText; - keyRange.PartNumber = rangeNode.SelectSingleNode("./p:PartNumber", nsmgr).InnerText; - keyRange.Valid = rangeNode.SelectSingleNode("./p:IsValid", nsmgr).InnerText.ToLower() == "true"; + KeyRange keyRange = new KeyRange + { + Start = int.Parse(rangeNode.SelectSingleNode("./p:Start", nsmgr).InnerText), + End = int.Parse(rangeNode.SelectSingleNode("./p:End", nsmgr).InnerText), + EulaType = rangeNode.SelectSingleNode("./p:EulaType", nsmgr).InnerText, + PartNumber = rangeNode.SelectSingleNode("./p:PartNumber", nsmgr).InnerText, + Valid = rangeNode.SelectSingleNode("./p:IsValid", nsmgr).InnerText.ToLower() == "true" + }; ranges[refActIdStr].Add(keyRange); } @@ -5575,15 +5350,17 @@ namespace LibTSforge.SPP if (keyRanges.Count > 0 && !Products.ContainsKey(refActId)) { - ProductConfig productConfig = new ProductConfig(); - productConfig.GroupId = group; - productConfig.Edition = configNode.SelectSingleNode("./p:EditionId", nsmgr).InnerText; - productConfig.Description = configNode.SelectSingleNode("./p:ProductDescription", nsmgr).InnerText; - productConfig.Channel = configNode.SelectSingleNode("./p:ProductKeyType", nsmgr).InnerText; - productConfig.Randomized = configNode.SelectSingleNode("./p:ProductKeyType", nsmgr).InnerText.ToLower() == "true"; - productConfig.Algorithm = algorithms[group]; - productConfig.Ranges = keyRanges; - productConfig.ActivationId = refActId; + ProductConfig productConfig = new ProductConfig + { + GroupId = group, + Edition = configNode.SelectSingleNode("./p:EditionId", nsmgr).InnerText, + Description = configNode.SelectSingleNode("./p:ProductDescription", nsmgr).InnerText, + Channel = configNode.SelectSingleNode("./p:ProductKeyType", nsmgr).InnerText, + Randomized = configNode.SelectSingleNode("./p:ProductKeyType", nsmgr).InnerText.ToLower() == "true", + Algorithm = algorithms[group], + Ranges = keyRanges, + ActivationId = refActId + }; Products[refActId] = productConfig; } @@ -5626,11 +5403,6 @@ namespace LibTSforge.SPP } } } - - public PKeyConfig() - { - - } } } @@ -5641,8 +5413,8 @@ namespace LibTSforge.SPP using System; using System.IO; using System.Linq; - using LibTSforge.Crypto; - using LibTSforge.PhysicalStore; + using Crypto; + using PhysicalStore; public class ProductKey { @@ -5656,11 +5428,11 @@ namespace LibTSforge.SPP public ulong Security; public bool Upgrade; public PKeyAlgorithm Algorithm; - public string EulaType; - public string PartNumber; - public string Edition; - public string Channel; - public Guid ActivationId; + public readonly string EulaType; + public readonly string PartNumber; + public readonly string Edition; + public readonly string Channel; + public readonly Guid ActivationId; private string mpc; private string pid2; @@ -5670,6 +5442,11 @@ namespace LibTSforge.SPP get { return BitConverter.GetBytes(klow).Concat(BitConverter.GetBytes(khigh)).ToArray(); } } + public ProductKey() + { + + } + public ProductKey(int serial, ulong security, bool upgrade, PKeyAlgorithm algorithm, ProductConfig config, KeyRange range) { Group = config.GroupId; @@ -5698,22 +5475,22 @@ namespace LibTSforge.SPP public Guid GetPkeyId() { - VariableBag pkb = new VariableBag(); - pkb.Blocks.AddRange(new CRCBlock[] + VariableBag pkb = new VariableBag(PSVersion.WinModern); + pkb.Blocks.AddRange(new[] { - new CRCBlock + new CRCBlockModern { DataType = CRCBlockType.STRING, KeyAsStr = "SppPkeyBindingProductKey", ValueAsStr = ToString() }, - new CRCBlock + new CRCBlockModern { DataType = CRCBlockType.BINARY, KeyAsStr = "SppPkeyBindingMiscData", Value = new byte[] { } }, - new CRCBlock + new CRCBlockModern { DataType = CRCBlockType.STRING, KeyAsStr = "SppPkeyBindingAlgorithm", @@ -5724,16 +5501,6 @@ namespace LibTSforge.SPP return new Guid(CryptoUtils.SHA256Hash(pkb.Serialize()).Take(16).ToArray()); } - public string GetDefaultMPC() - { - int build = Environment.OSVersion.Version.Build; - string defaultMPC = build >= 10240 ? "03612" : - build >= 9600 ? "06401" : - build >= 9200 ? "05426" : - "55041"; - return defaultMPC; - } - public string GetMPC() { if (mpc != null) @@ -5741,10 +5508,15 @@ namespace LibTSforge.SPP return mpc; } - mpc = GetDefaultMPC(); + int build = Environment.OSVersion.Version.Build; + + mpc = build >= 10240 ? "03612" : + build >= 9600 ? "06401" : + build >= 9200 ? "05426" : + "55041"; // setup.cfg doesn't exist in Windows 8+ - string setupcfg = string.Format("{0}\\oobe\\{1}", Environment.SystemDirectory, "setup.cfg"); + string setupcfg = string.Format(@"{0}\oobe\{1}", Environment.SystemDirectory, "setup.cfg"); if (!File.Exists(setupcfg) || Edition.Contains(";")) { @@ -5882,17 +5654,17 @@ namespace LibTSforge.SPP { if (version == PSVersion.Win7) { - Random rnd = new Random(Group * 1000000000 + Serial); - byte[] data = new byte[8]; - rnd.NextBytes(data); - return data; + ulong shortauth = ((ulong)Group << 41) | (Security << 31) | ((ulong)Serial << 1) | (Upgrade ? (ulong)1 : 0); + return BitConverter.GetBytes(shortauth); } int serialHigh = Serial / 1000000; int serialLow = Serial % 1000000; BinaryWriter writer = new BinaryWriter(new MemoryStream()); - writer.Write(new Guid("B8731595-A2F6-430B-A799-FBFFB81A8D73").ToByteArray()); + string algoId = Algorithm == PKeyAlgorithm.PKEY2005 ? "B8731595-A2F6-430B-A799-FBFFB81A8D73" : "660672EF-7809-4CFD-8D54-41B7FB738988"; + + writer.Write(new Guid(algoId).ToByteArray()); writer.Write(Group); writer.Write(serialHigh); writer.Write(serialLow); @@ -5998,40 +5770,40 @@ namespace LibTSforge.SPP public static readonly Guid WINDOWS_APP_ID = new Guid("55c92734-d682-4d71-983e-d6ec3f16059f"); - [DllImport("sppc.dll", CharSet = CharSet.Unicode, PreserveSig = false)] + [DllImport("slc.dll", CharSet = CharSet.Unicode, PreserveSig = false)] private static extern void SLOpen(out IntPtr hSLC); - [DllImport("sppc.dll", CharSet = CharSet.Unicode, PreserveSig = false)] + [DllImport("slc.dll", CharSet = CharSet.Unicode, PreserveSig = false)] private static extern void SLClose(IntPtr hSLC); [DllImport("slc.dll", CharSet = CharSet.Unicode)] private static extern uint SLGetWindowsInformationDWORD(string ValueName, ref int Value); - [DllImport("sppc.dll", CharSet = CharSet.Unicode)] + [DllImport("slc.dll", CharSet = CharSet.Unicode)] private static extern uint SLInstallProofOfPurchase(IntPtr hSLC, string pwszPKeyAlgorithm, string pwszPKeyString, uint cbPKeySpecificData, byte[] pbPKeySpecificData, ref Guid PKeyId); - [DllImport("sppc.dll", CharSet = CharSet.Unicode)] + [DllImport("slc.dll", CharSet = CharSet.Unicode)] private static extern uint SLUninstallProofOfPurchase(IntPtr hSLC, ref Guid PKeyId); - [DllImport("sppc.dll", CharSet = CharSet.Unicode)] + [DllImport("slc.dll", CharSet = CharSet.Unicode)] private static extern uint SLGetPKeyInformation(IntPtr hSLC, ref Guid pPKeyId, string pwszValueName, out SLDATATYPE peDataType, out uint pcbValue, out IntPtr ppbValue); - [DllImport("sppcext.dll", CharSet = CharSet.Unicode)] + [DllImport("slcext.dll", CharSet = CharSet.Unicode)] private static extern uint SLActivateProduct(IntPtr hSLC, ref Guid pProductSkuId, byte[] cbAppSpecificData, byte[] pvAppSpecificData, byte[] pActivationInfo, string pwszProxyServer, ushort wProxyPort); - [DllImport("sppc.dll", CharSet = CharSet.Unicode)] + [DllImport("slc.dll", CharSet = CharSet.Unicode)] private static extern uint SLGenerateOfflineInstallationId(IntPtr hSLC, ref Guid pProductSkuId, ref string ppwszInstallationId); - [DllImport("sppc.dll", CharSet = CharSet.Unicode)] + [DllImport("slc.dll", CharSet = CharSet.Unicode)] private static extern uint SLDepositOfflineConfirmationId(IntPtr hSLC, ref Guid pProductSkuId, string pwszInstallationId, string pwszConfirmationId); - [DllImport("sppc.dll", CharSet = CharSet.Unicode)] + [DllImport("slc.dll", CharSet = CharSet.Unicode)] private static extern uint SLGetSLIDList(IntPtr hSLC, SLIDTYPE eQueryIdType, ref Guid pQueryId, SLIDTYPE eReturnIdType, out uint pnReturnIds, out IntPtr ppReturnIds); - [DllImport("sppc.dll", CharSet = CharSet.Unicode, PreserveSig = false)] + [DllImport("slc.dll", CharSet = CharSet.Unicode, PreserveSig = false)] private static extern void SLGetLicensingStatusInformation(IntPtr hSLC, ref Guid pAppID, IntPtr pProductSkuId, string pwszRightName, out uint pnStatusCount, out IntPtr ppLicensingStatus); - [DllImport("sppc.dll", CharSet = CharSet.Unicode)] + [DllImport("slc.dll", CharSet = CharSet.Unicode)] private static extern uint SLGetInstalledProductKeyIds(IntPtr hSLC, ref Guid pProductSkuId, out uint pnProductKeyIds, out IntPtr ppProductKeyIds); [DllImport("slc.dll", CharSet = CharSet.Unicode)] @@ -6040,9 +5812,6 @@ namespace LibTSforge.SPP [DllImport("slc.dll", CharSet = CharSet.Unicode)] private static extern uint SLGetProductSkuInformation(IntPtr hSLC, ref Guid pProductSkuId, string pwszValueName, out SLDATATYPE peDataType, out uint pcbValue, out IntPtr ppbValue); - [DllImport("slc.dll", CharSet = CharSet.Unicode)] - private static extern uint SLGetProductSkuInformation(IntPtr hSLC, ref Guid pProductSkuId, string pwszValueName, IntPtr peDataType, out uint pcbValue, out IntPtr ppbValue); - [DllImport("slc.dll", CharSet = CharSet.Unicode)] private static extern uint SLGetLicense(IntPtr hSLC, ref Guid pLicenseFileId, out uint pcbLicenseFile, out IntPtr ppbLicenseFile); @@ -6052,7 +5821,7 @@ namespace LibTSforge.SPP [DllImport("slc.dll", CharSet = CharSet.Unicode)] private static extern uint SLFireEvent(IntPtr hSLC, string pwszEventId, ref Guid pApplicationId); - public class SLContext : IDisposable + private class SLContext : IDisposable { public readonly IntPtr Handle; @@ -6115,11 +5884,10 @@ namespace LibTSforge.SPP { using (SLContext sl = new SLContext()) { - uint status; uint count; IntPtr pProductKeyIds; - status = SLGetInstalledProductKeyIds(sl.Handle, ref actId, out count, out pProductKeyIds); + uint status = SLGetSLIDList(sl.Handle, SLIDTYPE.SL_ID_PRODUCT_SKU, ref actId, SLIDTYPE.SL_ID_PKEY, out count, out pProductKeyIds); if (status != 0 || count == 0) { @@ -6143,7 +5911,7 @@ namespace LibTSforge.SPP SLConsumeWindowsRight(0); } - public static bool RefreshTrustedTime(Guid actId) + public static void RefreshTrustedTime(Guid actId) { using (SLContext sl = new SLContext()) { @@ -6151,8 +5919,7 @@ namespace LibTSforge.SPP uint count; IntPtr ppbValue; - uint status = SLGetProductSkuInformation(sl.Handle, ref actId, "TrustedTime", out type, out count, out ppbValue); - return (int)status >= 0 && status != 0xC004F012; + SLGetProductSkuInformation(sl.Handle, ref actId, "TrustedTime", out type, out count, out ppbValue); } } @@ -6168,11 +5935,10 @@ namespace LibTSforge.SPP { using (SLContext sl = new SLContext()) { - uint status; uint count; IntPtr pAppIds; - status = SLGetSLIDList(sl.Handle, SLIDTYPE.SL_ID_PRODUCT_SKU, ref actId, SLIDTYPE.SL_ID_APPLICATION, out count, out pAppIds); + uint status = SLGetSLIDList(sl.Handle, SLIDTYPE.SL_ID_PRODUCT_SKU, ref actId, SLIDTYPE.SL_ID_APPLICATION, out count, out pAppIds); if (status != 0 || count == 0) { @@ -6200,11 +5966,10 @@ namespace LibTSforge.SPP { using (SLContext sl = new SLContext()) { - uint status; uint count; IntPtr ppReturnLics; - status = SLGetSLIDList(sl.Handle, SLIDTYPE.SL_ID_LICENSE, ref licId, SLIDTYPE.SL_ID_LICENSE_FILE, out count, out ppReturnLics); + uint status = SLGetSLIDList(sl.Handle, SLIDTYPE.SL_ID_LICENSE, ref licId, SLIDTYPE.SL_ID_LICENSE_FILE, out count, out ppReturnLics); if (status != 0 || count == 0) { @@ -6266,7 +6031,7 @@ namespace LibTSforge.SPP IntPtr ppbValue; uint status = SLGetProductSkuInformation(sl.Handle, ref actId, "msft:sl/EUL/PHONE/PUBLIC", out type, out count, out ppbValue); - return status >= 0 && status != 0xC004F012; + return status != 0xC004F012; } } @@ -6349,11 +6114,11 @@ namespace LibTSforge.SPP } } - public static uint UninstallProductKey(Guid pkeyId) + public static void UninstallProductKey(Guid pkeyId) { using (SLContext sl = new SLContext()) { - return SLUninstallProofOfPurchase(sl.Handle, ref pkeyId); + SLUninstallProofOfPurchase(sl.Handle, ref pkeyId); } } @@ -6371,6 +6136,390 @@ namespace LibTSforge.SPP } +// SPP/SPPUtils.cs +namespace LibTSforge.SPP +{ + using Microsoft.Win32; + using System; + using System.IO; + using System.Linq; + using System.ServiceProcess; + using Crypto; + using PhysicalStore; + using TokenStore; + + public static class SPPUtils + { + public static void KillSPP(PSVersion version) + { + ServiceController sc; + + string svcName = version == PSVersion.Vista ? "slsvc" : "sppsvc"; + + try + { + sc = new ServiceController(svcName); + + if (sc.Status == ServiceControllerStatus.Stopped) + return; + } + catch (InvalidOperationException ex) + { + throw new InvalidOperationException(string.Format("Unable to access {0}: ", svcName) + ex.Message); + } + + Logger.WriteLine(string.Format("Stopping {0}...", svcName)); + + bool stopped = false; + + for (int i = 0; stopped == false && i < 1080; i++) + { + try + { + if (sc.Status != ServiceControllerStatus.StopPending) + sc.Stop(); + + sc.WaitForStatus(ServiceControllerStatus.Stopped, TimeSpan.FromMilliseconds(500)); + } + catch (System.ServiceProcess.TimeoutException) + { + continue; + } + catch (InvalidOperationException ex) + { + Logger.WriteLine("Warning: Stopping sppsvc failed, retrying. Details: " + ex.Message); + System.Threading.Thread.Sleep(500); + continue; + } + + stopped = true; + } + + if (!stopped) + throw new System.TimeoutException(string.Format("Failed to stop {0}", svcName)); + + Logger.WriteLine(string.Format("{0} stopped successfully.", svcName)); + + if (version == PSVersion.Vista && SPSys.IsSpSysRunning()) + { + Logger.WriteLine("Unloading spsys..."); + + int status = SPSys.ControlSpSys(false); + + if (status < 0) + { + throw new IOException("Failed to unload spsys"); + } + + Logger.WriteLine("spsys unloaded successfully."); + } + } + + public static void RestartSPP(PSVersion version) + { + if (version == PSVersion.Vista) + { + ServiceController sc; + + try + { + sc = new ServiceController("slsvc"); + + if (sc.Status == ServiceControllerStatus.Running) + return; + } + catch (InvalidOperationException ex) + { + throw new InvalidOperationException("Unable to access slsvc: " + ex.Message); + } + + Logger.WriteLine("Starting slsvc..."); + + bool started = false; + + for (int i = 0; started == false && i < 360; i++) + { + try + { + if (sc.Status != ServiceControllerStatus.StartPending) + sc.Start(); + + sc.WaitForStatus(ServiceControllerStatus.Running, TimeSpan.FromMilliseconds(500)); + } + catch (System.ServiceProcess.TimeoutException) + { + continue; + } + catch (InvalidOperationException ex) + { + Logger.WriteLine("Warning: Starting slsvc failed, retrying. Details: " + ex.Message); + System.Threading.Thread.Sleep(500); + continue; + } + + started = true; + } + + if (!started) + throw new System.TimeoutException("Failed to start slsvc"); + + Logger.WriteLine("slsvc started successfully."); + } + + SLApi.RefreshLicenseStatus(); + } + + public static bool DetectCurrentKey() + { + SLApi.RefreshLicenseStatus(); + + using (RegistryKey wpaKey = Registry.LocalMachine.OpenSubKey(@"SYSTEM\WPA")) + { + foreach (string subKey in wpaKey.GetSubKeyNames()) + { + if (subKey.StartsWith("8DEC0AF1")) + { + return subKey.Contains("P"); + } + } + } + + throw new FileNotFoundException("Failed to autodetect key type, specify physical store key with /prod or /test arguments."); + } + + public static string GetPSPath(PSVersion version) + { + switch (version) + { + case PSVersion.Vista: + case PSVersion.Win7: + return Directory.GetFiles( + Environment.GetFolderPath(Environment.SpecialFolder.System), + "7B296FB0-376B-497e-B012-9C450E1B7327-*.C7483456-A289-439d-8115-601632D005A0") + .FirstOrDefault() ?? ""; + default: + string psDir = Environment.ExpandEnvironmentVariables( + (string)Registry.GetValue( + @"HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\SoftwareProtectionPlatform", + "TokenStore", + "" + ) + ); + string psPath = Path.Combine(psDir, "data.dat"); + + if (string.IsNullOrEmpty(psDir) || !File.Exists(psPath)) + { + string[] psDirs = + { + @"spp\store", + @"spp\store\2.0", + @"spp\store_test", + @"spp\store_test\2.0" + }; + + foreach (string dir in psDirs) + { + psPath = Path.Combine( + Path.Combine( + Environment.GetFolderPath(Environment.SpecialFolder.System), + dir + ), + "data.dat" + ); + + if (File.Exists(psPath)) return psPath; + } + } + else + { + return psPath; + } + + throw new FileNotFoundException("Failed to locate physical store."); + } + } + + public static string GetTokensPath(PSVersion version) + { + switch (version) + { + case PSVersion.Vista: + return Path.Combine( + Environment.ExpandEnvironmentVariables("%WINDIR%"), + @"ServiceProfiles\NetworkService\AppData\Roaming\Microsoft\SoftwareLicensing\tokens.dat" + ); + case PSVersion.Win7: + return Path.Combine( + Environment.ExpandEnvironmentVariables("%WINDIR%"), + @"ServiceProfiles\NetworkService\AppData\Roaming\Microsoft\SoftwareProtectionPlatform\tokens.dat" + ); + default: + string tokDir = Environment.ExpandEnvironmentVariables( + (string)Registry.GetValue( + @"HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\SoftwareProtectionPlatform", + "TokenStore", + "" + ) + ); + string tokPath = Path.Combine(tokDir, "tokens.dat"); + + if (string.IsNullOrEmpty(tokDir) || !File.Exists(tokPath)) + { + string[] tokDirs = + { + @"spp\store", + @"spp\store\2.0", + @"spp\store_test", + @"spp\store_test\2.0" + }; + + foreach (string dir in tokDirs) + { + tokPath = Path.Combine( + Path.Combine( + Environment.GetFolderPath(Environment.SpecialFolder.System), + dir + ), + "tokens.dat" + ); + + if (File.Exists(tokPath)) return tokPath; + } + } + else + { + return tokPath; + } + + throw new FileNotFoundException("Failed to locate token store."); + } + } + + public static IPhysicalStore GetStore(PSVersion version, bool production) + { + string psPath = GetPSPath(version); + + switch (version) + { + case PSVersion.Vista: + return new PhysicalStoreVista(psPath, production); + case PSVersion.Win7: + return new PhysicalStoreWin7(psPath, production); + default: + return new PhysicalStoreModern(psPath, production, version); + } + } + + public static ITokenStore GetTokenStore(PSVersion version) + { + string tokPath = GetTokensPath(version); + + return new TokenStoreModern(tokPath); + } + + public static void DumpStore(PSVersion version, bool production, string filePath, string encrFilePath) + { + bool manageSpp = false; + + if (encrFilePath == null) + { + encrFilePath = GetPSPath(version); + manageSpp = true; + KillSPP(version); + } + + if (string.IsNullOrEmpty(encrFilePath) || !File.Exists(encrFilePath)) + { + throw new FileNotFoundException("Store does not exist at expected path '" + encrFilePath + "'."); + } + + try + { + using (FileStream fs = File.Open(encrFilePath, FileMode.Open, FileAccess.Read, FileShare.Read)) + { + byte[] encrData = fs.ReadAllBytes(); + File.WriteAllBytes(filePath, PhysStoreCrypto.DecryptPhysicalStore(encrData, production, version)); + } + Logger.WriteLine("Store dumped successfully to '" + filePath + "'."); + } + finally + { + if (manageSpp) + { + RestartSPP(version); + } + } + } + + public static void LoadStore(PSVersion version, bool production, string filePath) + { + if (string.IsNullOrEmpty(filePath) || !File.Exists(filePath)) + { + throw new FileNotFoundException("Store file '" + filePath + "' does not exist."); + } + + KillSPP(version); + + using (IPhysicalStore store = GetStore(version, production)) + { + store.WriteRaw(File.ReadAllBytes(filePath)); + } + + RestartSPP(version); + + Logger.WriteLine("Loaded store file successfully."); + } + } +} + + +// SPP/SPSys.cs +namespace LibTSforge.SPP +{ + using Microsoft.Win32.SafeHandles; + using System; + using System.Runtime.InteropServices; + + public class SPSys + { + [DllImport("kernel32.dll", CharSet = CharSet.Auto, SetLastError = true)] + private static extern IntPtr CreateFile(string lpFileName, uint dwDesiredAccess, uint dwShareMode, IntPtr lpSecurityAttributes, uint dwCreationDisposition, uint dwFlagsAndAttributes, IntPtr hTemplateFile); + private static SafeFileHandle CreateFileSafe(string device) + { + return new SafeFileHandle(CreateFile(device, 0xC0000000, 0, IntPtr.Zero, 3, 0, IntPtr.Zero), true); + } + + [return: MarshalAs(UnmanagedType.Bool)] + [DllImport("kernel32.dll", CharSet = CharSet.Auto, SetLastError = true)] + private static extern bool DeviceIoControl([In] SafeFileHandle hDevice, [In] uint dwIoControlCode, [In] IntPtr lpInBuffer, [In] int nInBufferSize, [Out] IntPtr lpOutBuffer, [In] int nOutBufferSize, out int lpBytesReturned, [In] IntPtr lpOverlapped); + + public static bool IsSpSysRunning() + { + SafeFileHandle file = CreateFileSafe(@"\\.\SpDevice"); + IntPtr buffer = Marshal.AllocHGlobal(1); + int bytesReturned; + DeviceIoControl(file, 0x80006008, IntPtr.Zero, 0, buffer, 1, out bytesReturned, IntPtr.Zero); + bool running = Marshal.ReadByte(buffer) != 0; + Marshal.FreeHGlobal(buffer); + file.Close(); + return running; + } + + public static int ControlSpSys(bool start) + { + SafeFileHandle file = CreateFileSafe(@"\\.\SpDevice"); + IntPtr buffer = Marshal.AllocHGlobal(4); + int bytesReturned; + DeviceIoControl(file, start ? 0x8000a000 : 0x8000a004, IntPtr.Zero, 0, buffer, 4, out bytesReturned, IntPtr.Zero); + int result = Marshal.ReadInt32(buffer); + Marshal.FreeHGlobal(buffer); + file.Close(); + return result; + } + } +} + + // Crypto/CryptoUtils.cs namespace LibTSforge.Crypto { @@ -6480,10 +6629,21 @@ namespace LibTSforge.Crypto public static bool HMACVerify(byte[] key, byte[] data, byte[] signature) { - HMACSHA1 hmac = new HMACSHA1(key); return Enumerable.SequenceEqual(signature, HMACSign(key, data)); } + public static byte[] SaltSHASum(byte[] salt, byte[] data) + { + SHA1 sha1 = SHA1.Create(); + byte[] sha_data = salt.Concat(data).ToArray(); + return sha1.ComputeHash(sha_data); + } + + public static bool SaltSHAVerify(byte[] salt, byte[] data, byte[] checksum) + { + return Enumerable.SequenceEqual(checksum, SaltSHASum(salt, data)); + } + public static byte[] SHA256Hash(byte[] data) { using (SHA256 sha256 = SHA256.Create()) @@ -6596,7 +6756,7 @@ namespace LibTSforge.Crypto public static class PhysStoreCrypto { - public static byte[] DecryptPhysicalStore(byte[] data, bool production) + public static byte[] DecryptPhysicalStore(byte[] data, bool production, PSVersion version) { byte[] rsaKey = production ? Keys.PRODUCTION : Keys.TEST; BinaryReader br = new BinaryReader(new MemoryStream(data)); @@ -6604,29 +6764,40 @@ namespace LibTSforge.Crypto byte[] aesKeySig = br.ReadBytes(0x80); byte[] encAesKey = br.ReadBytes(0x80); - if (CryptoUtils.RSAVerifySignature(rsaKey, encAesKey, aesKeySig)) + if (!CryptoUtils.RSAVerifySignature(rsaKey, encAesKey, aesKeySig)) { - byte[] aesKey = CryptoUtils.RSADecrypt(rsaKey, encAesKey); - byte[] decData = CryptoUtils.AESDecrypt(br.ReadBytes((int)br.BaseStream.Length - 0x110), aesKey); - byte[] hmacKey = decData.Take(0x10).ToArray(); - byte[] hmacSig = decData.Skip(0x10).Take(0x14).ToArray(); - byte[] psData = decData.Skip(0x28).ToArray(); - - if (!CryptoUtils.HMACVerify(hmacKey, psData, hmacSig)) - { - Logger.WriteLine("Warning: Failed to verify HMAC. Physical store is either corrupt or in Vista format."); - } - - return psData; + throw new Exception("Failed to decrypt physical store."); } - throw new Exception("Failed to decrypt physical store."); + byte[] aesKey = CryptoUtils.RSADecrypt(rsaKey, encAesKey); + byte[] decData = CryptoUtils.AESDecrypt(br.ReadBytes((int)br.BaseStream.Length - 0x110), aesKey); + byte[] hmacKey = decData.Take(0x10).ToArray(); // SHA-1 salt on Vista + byte[] hmacSig = decData.Skip(0x10).Take(0x14).ToArray(); // SHA-1 hash on Vista + byte[] psData = decData.Skip(0x28).ToArray(); + + if (version != PSVersion.Vista) + { + if (!CryptoUtils.HMACVerify(hmacKey, psData, hmacSig)) + { + throw new InvalidDataException("Failed to verify HMAC. Physical store is corrupt."); + } + } + else + { + if (!CryptoUtils.SaltSHAVerify(hmacKey, psData, hmacSig)) + { + throw new InvalidDataException("Failed to verify checksum. Physical store is corrupt."); + } + } + + return psData; } public static byte[] EncryptPhysicalStore(byte[] data, bool production, PSVersion version) { Dictionary versionTable = new Dictionary { + {PSVersion.Vista, 2}, {PSVersion.Win7, 5}, {PSVersion.Win8, 1}, {PSVersion.WinBlue, 2}, @@ -6640,9 +6811,9 @@ namespace LibTSforge.Crypto byte[] encAesKey = CryptoUtils.RSAEncrypt(rsaKey, aesKey); byte[] aesKeySig = CryptoUtils.RSASign(rsaKey, encAesKey); - byte[] hmacSig = CryptoUtils.HMACSign(hmacKey, data); + byte[] hmacSig = version != PSVersion.Vista ? CryptoUtils.HMACSign(hmacKey, data) : CryptoUtils.SaltSHASum(hmacKey, data); - byte[] decData = new byte[] { }; + byte[] decData = { }; decData = decData.Concat(hmacKey).Concat(hmacSig).Concat(BitConverter.GetBytes(0)).Concat(data).ToArray(); byte[] encData = CryptoUtils.AESEncrypt(decData, aesKey); @@ -6665,9 +6836,9 @@ namespace LibTSforge.Modifiers using System; using System.IO; using Microsoft.Win32; - using LibTSforge.PhysicalStore; - using LibTSforge.SPP; - using LibTSforge.TokenStore; + using PhysicalStore; + using SPP; + using TokenStore; public static class GenPKeyInstall { @@ -6693,6 +6864,7 @@ namespace LibTSforge.Modifiers public static void InstallGenPKey(PSVersion version, bool production, Guid actId) { + if (version == PSVersion.Vista) throw new NotSupportedException("This feature is not supported on Windows Vista/Server 2008."); if (actId == Guid.Empty) throw new ArgumentException("Activation ID must be specified for generated product key install."); PKeyConfig pkc = new PKeyConfig(); @@ -6719,7 +6891,7 @@ namespace LibTSforge.Modifiers if (pkey.Algorithm == PKeyAlgorithm.PKEY2009) { uint status = SLApi.InstallProductKey(pkey); - Logger.WriteLine(string.Format("Installing generated product key {0} status {1:X}", pkey.ToString(), status)); + Logger.WriteLine(string.Format("Installing generated product key {0} status {1:X}", pkey, status)); if ((int)status < 0) { @@ -6734,57 +6906,57 @@ namespace LibTSforge.Modifiers if (pkey.Channel == "Volume:GVLK" && version == PSVersion.Win7) throw new NotSupportedException("Fake GVLK generation is not supported on Windows 7."); - VariableBag pkb = new VariableBag(); - pkb.Blocks.AddRange(new CRCBlock[] + VariableBag pkb = new VariableBag(version); + pkb.Blocks.AddRange(new[] { - new CRCBlock + new CRCBlockModern { DataType = CRCBlockType.STRING, KeyAsStr = "SppPkeyBindingProductKey", ValueAsStr = pkey.ToString() }, - new CRCBlock + new CRCBlockModern { DataType = CRCBlockType.STRING, KeyAsStr = "SppPkeyBindingMPC", ValueAsStr = pkey.GetMPC() }, - new CRCBlock { + new CRCBlockModern { DataType = CRCBlockType.BINARY, KeyAsStr = "SppPkeyBindingPid2", ValueAsStr = pkey.GetPid2() }, - new CRCBlock + new CRCBlockModern { DataType = CRCBlockType.BINARY, KeyAsStr = "SppPkeyBindingPid3", Value = pkey.GetPid3() }, - new CRCBlock + new CRCBlockModern { DataType = CRCBlockType.BINARY, KeyAsStr = "SppPkeyBindingPid4", Value = pkey.GetPid4() }, - new CRCBlock + new CRCBlockModern { DataType = CRCBlockType.STRING, KeyAsStr = "SppPkeyChannelId", ValueAsStr = pkey.Channel }, - new CRCBlock + new CRCBlockModern { DataType = CRCBlockType.STRING, KeyAsStr = "SppPkeyBindingEditionId", ValueAsStr = pkey.Edition }, - new CRCBlock + new CRCBlockModern { DataType = CRCBlockType.BINARY, KeyAsStr = (version == PSVersion.Win7) ? "SppPkeyShortAuthenticator" : "SppPkeyPhoneActivationData", Value = pkey.GetPhoneData(version) }, - new CRCBlock + new CRCBlockModern { DataType = CRCBlockType.BINARY, KeyAsStr = "SppPkeyBindingMiscData", @@ -6802,11 +6974,11 @@ namespace LibTSforge.Modifiers SLApi.UninstallAllProductKeys(appId); } - Utils.KillSPP(); + SPPUtils.KillSPP(version); - using (IPhysicalStore ps = Utils.GetStore(version, production)) + using (IPhysicalStore ps = SPPUtils.GetStore(version, production)) { - using (ITokenStore tks = Utils.GetTokenStore(version)) + using (ITokenStore tks = SPPUtils.GetTokenStore(version)) { Logger.WriteLine("Writing to physical store and token store..."); @@ -6830,7 +7002,7 @@ namespace LibTSforge.Modifiers uriMap.Data[pkeyId] = pkey.GetAlgoUri(); tks.SetEntry(uriMapName, "xml", uriMap.Serialize()); - string skuMetaName = actId.ToString() + metSuffix; + string skuMetaName = actId + metSuffix; TokenMeta skuMeta = tks.GetMetaEntry(skuMetaName); foreach (string k in skuMeta.Data.Keys) @@ -6857,7 +7029,7 @@ namespace LibTSforge.Modifiers Data = pkb.Serialize() }); - string cachePath = Utils.GetTokensPath(version).Replace("tokens.dat", @"cache\cache.dat"); + string cachePath = SPPUtils.GetTokensPath(version).Replace("tokens.dat", @"cache\cache.dat"); if (File.Exists(cachePath)) File.Delete(cachePath); } } @@ -6872,19 +7044,19 @@ namespace LibTSforge.Modifiers // Modifiers/GracePeriodReset.cs namespace LibTSforge.Modifiers { - using System; using System.Collections.Generic; using System.Linq; - using LibTSforge.PhysicalStore; + using PhysicalStore; + using SPP; public static class GracePeriodReset { public static void Reset(PSVersion version, bool production) { - Utils.KillSPP(); + SPPUtils.KillSPP(version); Logger.WriteLine("Writing TrustedStore data..."); - using (IPhysicalStore store = Utils.GetStore(version, production)) + using (IPhysicalStore store = SPPUtils.GetStore(version, production)) { string value = "msft:sl/timer"; List blocks = store.FindBlocks(value).ToList(); @@ -6895,6 +7067,7 @@ namespace LibTSforge.Modifiers } } + SPPUtils.RestartSPP(version); Logger.WriteLine("Successfully reset all grace and evaluation period timers."); } } @@ -6906,15 +7079,19 @@ namespace LibTSforge.Modifiers { using System.Collections.Generic; using System.Linq; - using LibTSforge.PhysicalStore; - using LibTSforge; + using PhysicalStore; + using SPP; + using System; + public static class KeyChangeLockDelete { public static void Delete(PSVersion version, bool production) { - Utils.KillSPP(); + if (version == PSVersion.Vista) throw new NotSupportedException("This feature is not supported on Windows Vista/Server 2008."); + + SPPUtils.KillSPP(version); Logger.WriteLine("Writing TrustedStore data..."); - using (IPhysicalStore store = Utils.GetStore(version, production)) + using (IPhysicalStore store = SPPUtils.GetStore(version, production)) { List values = new List { @@ -6942,12 +7119,12 @@ namespace LibTSforge.Modifiers { using System; using System.IO; - using LibTSforge.PhysicalStore; - using LibTSforge.SPP; + using PhysicalStore; + using SPP; public static class KMSHostCharge { - public static void Charge(PSVersion version, Guid actId, bool production) + public static void Charge(PSVersion version, bool production, Guid actId) { if (actId == Guid.Empty) { @@ -6971,76 +7148,113 @@ namespace LibTSforge.Modifiers string key = string.Format("SPPSVC\\{0}", appId); long ldapTimestamp = DateTime.Now.ToFileTime(); + byte[] cmidGuids = { }; + byte[] reqCounts = { }; + byte[] kmsChargeData = { }; + BinaryWriter writer = new BinaryWriter(new MemoryStream()); - for (int i = 0; i < currClients; i++) + if (version == PSVersion.Vista) { - writer.Write(ldapTimestamp - (10 * (i + 1))); - writer.Write(Guid.NewGuid().ToByteArray()); + writer.Write(new byte[44]); + writer.Seek(0, SeekOrigin.Begin); + + writer.Write(totalClients); + writer.Write(43200); + writer.Write(32); + + writer.Seek(20, SeekOrigin.Begin); + writer.Write((byte)currClients); + + writer.Seek(32, SeekOrigin.Begin); + writer.Write((byte)currClients); + + writer.Seek(0, SeekOrigin.End); + + for (int i = 0; i < currClients; i++) + { + writer.Write(Guid.NewGuid().ToByteArray()); + writer.Write(ldapTimestamp - (10 * (i + 1))); + } + + kmsChargeData = writer.GetBytes(); + } + else + { + for (int i = 0; i < currClients; i++) + { + writer.Write(ldapTimestamp - (10 * (i + 1))); + writer.Write(Guid.NewGuid().ToByteArray()); + } + + cmidGuids = writer.GetBytes(); + + writer = new BinaryWriter(new MemoryStream()); + + writer.Write(new byte[40]); + + writer.Seek(4, SeekOrigin.Begin); + writer.Write((byte)currClients); + + writer.Seek(24, SeekOrigin.Begin); + writer.Write((byte)currClients); + + reqCounts = writer.GetBytes(); } - byte[] cmidGuids = writer.GetBytes(); - - writer = new BinaryWriter(new MemoryStream()); - - writer.Write(new byte[40]); - - writer.Seek(4, SeekOrigin.Begin); - writer.Write((byte)currClients); - - writer.Seek(24, SeekOrigin.Begin); - writer.Write((byte)currClients); - byte[] reqCounts = writer.GetBytes(); - - Utils.KillSPP(); + SPPUtils.KillSPP(version); Logger.WriteLine("Writing TrustedStore data..."); - using (IPhysicalStore store = Utils.GetStore(version, production)) + using (IPhysicalStore store = SPPUtils.GetStore(version, production)) { - VariableBag kmsCountData = new VariableBag(); - kmsCountData.Blocks.AddRange(new CRCBlock[] + if (version != PSVersion.Vista) { - new CRCBlock + VariableBag kmsCountData = new VariableBag(version); + kmsCountData.Blocks.AddRange(new[] { - DataType = CRCBlockType.BINARY, - KeyAsStr = "SppBindingLicenseData", - Value = hwidBlock - }, - new CRCBlock - { - DataType = CRCBlockType.UINT, - Key = new byte[] { }, - ValueAsInt = (uint)totalClients - }, - new CRCBlock - { - DataType = CRCBlockType.UINT, - Key = new byte[] { }, - ValueAsInt = 1051200000 - }, - new CRCBlock - { - DataType = CRCBlockType.UINT, - Key = new byte[] { }, - ValueAsInt = (uint)currClients - }, - new CRCBlock - { - DataType = CRCBlockType.BINARY, - Key = new byte[] { }, - Value = cmidGuids - }, - new CRCBlock - { - DataType = CRCBlockType.BINARY, - Key = new byte[] { }, - Value = reqCounts - } - }); + new CRCBlockModern + { + DataType = CRCBlockType.BINARY, + KeyAsStr = "SppBindingLicenseData", + Value = hwidBlock + }, + new CRCBlockModern + { + DataType = CRCBlockType.UINT, + Key = new byte[] { }, + ValueAsInt = (uint)totalClients + }, + new CRCBlockModern + { + DataType = CRCBlockType.UINT, + Key = new byte[] { }, + ValueAsInt = 1051200000 + }, + new CRCBlockModern + { + DataType = CRCBlockType.UINT, + Key = new byte[] { }, + ValueAsInt = (uint)currClients + }, + new CRCBlockModern + { + DataType = CRCBlockType.BINARY, + Key = new byte[] { }, + Value = cmidGuids + }, + new CRCBlockModern + { + DataType = CRCBlockType.BINARY, + Key = new byte[] { }, + Value = reqCounts + } + }); - byte[] kmsChargeData = kmsCountData.Serialize(); - string countVal = string.Format("msft:spp/kms/host/2.0/store/counters/{0}", appId); + kmsChargeData = kmsCountData.Serialize(); + } + + string countVal = version == PSVersion.Vista ? "C8F6FFF1-79CE-404C-B150-F97991273DF1" : string.Format("msft:spp/kms/host/2.0/store/counters/{0}", appId); store.DeleteBlock(key, countVal); store.AddBlock(new PSBlock @@ -7054,6 +7268,8 @@ namespace LibTSforge.Modifiers Logger.WriteLine(string.Format("Set charge count to {0} successfully.", currClients)); } + + SPPUtils.RestartSPP(version); } } } @@ -7062,24 +7278,28 @@ namespace LibTSforge.Modifiers // Modifiers/RearmReset.cs namespace LibTSforge.Modifiers { - using System; using System.Collections.Generic; using System.Linq; - using LibTSforge.PhysicalStore; + using PhysicalStore; + using SPP; public static class RearmReset { public static void Reset(PSVersion version, bool production) { - Utils.KillSPP(); + SPPUtils.KillSPP(version); Logger.WriteLine("Writing TrustedStore data..."); - using (IPhysicalStore store = Utils.GetStore(version, production)) + using (IPhysicalStore store = SPPUtils.GetStore(version, production)) { List blocks; - if (version == PSVersion.Win7) + if (version == PSVersion.Vista) + { + blocks = store.FindBlocks("740D70D8-6448-4b2f-9063-4A7A463600C5").ToList(); + } + else if (version == PSVersion.Win7) { blocks = store.FindBlocks(0xA0000).ToList(); } @@ -7090,7 +7310,11 @@ namespace LibTSforge.Modifiers foreach (PSBlock block in blocks) { - if (version == PSVersion.Win7) + if (version == PSVersion.Vista) + { + store.DeleteBlock(block.KeyAsStr, block.ValueAsStr); + } + else if (version == PSVersion.Win7) { store.SetBlock(block.KeyAsStr, block.ValueAsInt, new byte[8]); } @@ -7107,38 +7331,110 @@ namespace LibTSforge.Modifiers } +// Modifiers/SetIIDParams.cs +namespace LibTSforge.Modifiers +{ + using PhysicalStore; + using SPP; + using System.IO; + using System; + + public static class SetIIDParams + { + public static void SetParams(PSVersion version, bool production, Guid actId, PKeyAlgorithm algorithm, int group, int serial, ulong security) + { + if (version == PSVersion.Vista) throw new NotSupportedException("This feature is not supported on Windows Vista/Server 2008."); + + Guid appId; + + if (actId == Guid.Empty) + { + appId = SLApi.WINDOWS_APP_ID; + actId = SLApi.GetDefaultActivationID(appId, true); + + if (actId == Guid.Empty) + { + throw new Exception("No applicable activation IDs found."); + } + } + else + { + appId = SLApi.GetAppId(actId); + } + + Guid pkeyId = SLApi.GetInstalledPkeyID(actId); + + SPPUtils.KillSPP(version); + + Logger.WriteLine("Writing TrustedStore data..."); + + using (IPhysicalStore store = SPPUtils.GetStore(version, production)) + { + string key = string.Format("SPPSVC\\{0}\\{1}", appId, actId); + PSBlock keyBlock = store.GetBlock(key, pkeyId.ToString()); + + if (keyBlock == null) + { + throw new InvalidDataException("Failed to get product key data for activation ID " + actId + "."); + } + + VariableBag pkb = new VariableBag(keyBlock.Data, version); + + ProductKey pkey = new ProductKey + { + Group = group, + Serial = serial, + Security = security, + Algorithm = algorithm, + Upgrade = false + }; + + string blockName = version == PSVersion.Win7 ? "SppPkeyShortAuthenticator" : "SppPkeyPhoneActivationData"; + pkb.SetBlock(blockName, pkey.GetPhoneData(version)); + store.SetBlock(key, pkeyId.ToString(), pkb.Serialize()); + } + + Logger.WriteLine("Successfully set IID parameters."); + } + } +} + + // Modifiers/TamperedFlagsDelete.cs namespace LibTSforge.Modifiers { - using System; using System.Linq; - using LibTSforge.PhysicalStore; + using PhysicalStore; + using SPP; public static class TamperedFlagsDelete { public static void DeleteTamperFlags(PSVersion version, bool production) { - Utils.KillSPP(); + SPPUtils.KillSPP(version); Logger.WriteLine("Writing TrustedStore data..."); - using (IPhysicalStore store = Utils.GetStore(version, production)) + using (IPhysicalStore store = SPPUtils.GetStore(version, production)) { - if (version != PSVersion.Win7) + if (version == PSVersion.Vista) { - string recreatedFlag = "__##USERSEP-RESERVED##__$$RECREATED-FLAG$$"; - string recoveredFlag = "__##USERSEP-RESERVED##__$$RECOVERED-FLAG$$"; - - DeleteFlag(store, recreatedFlag); - DeleteFlag(store, recoveredFlag); + DeleteFlag(store, "6BE8425B-E3CF-4e86-A6AF-5863E3DCB606"); + } + else if (version == PSVersion.Win7) + { + SetFlag(store, 0xA0001); } else { - SetFlag(store, 0xA0001); + DeleteFlag(store, "__##USERSEP-RESERVED##__$$RECREATED-FLAG$$"); + DeleteFlag(store, "__##USERSEP-RESERVED##__$$RECOVERED-FLAG$$"); } Logger.WriteLine("Successfully cleared the tamper state."); } + + SPPUtils.RestartSPP(version); } private static void DeleteFlag(IPhysicalStore store, string flag) @@ -7158,13 +7454,15 @@ namespace LibTSforge.Modifiers namespace LibTSforge.Modifiers { using System; - using LibTSforge.PhysicalStore; - using LibTSforge.SPP; + using PhysicalStore; + using SPP; public static class UniqueIdDelete { public static void DeleteUniqueId(PSVersion version, bool production, Guid actId) { + if (version == PSVersion.Vista) throw new NotSupportedException("This feature is not supported on Windows Vista/Server 2008."); + Guid appId; if (actId == Guid.Empty) @@ -7182,14 +7480,13 @@ namespace LibTSforge.Modifiers appId = SLApi.GetAppId(actId); } - string instId = SLApi.GetInstallationID(actId); Guid pkeyId = SLApi.GetInstalledPkeyID(actId); - Utils.KillSPP(); + SPPUtils.KillSPP(version); Logger.WriteLine("Writing TrustedStore data..."); - using (IPhysicalStore store = Utils.GetStore(version, production)) + using (IPhysicalStore store = SPPUtils.GetStore(version, production)) { string key = string.Format("SPPSVC\\{0}\\{1}", appId, actId); PSBlock keyBlock = store.GetBlock(key, pkeyId.ToString()); @@ -7199,7 +7496,7 @@ namespace LibTSforge.Modifiers throw new Exception("No product key found."); } - VariableBag pkb = new VariableBag(keyBlock.Data); + VariableBag pkb = new VariableBag(keyBlock.Data, version); pkb.DeleteBlock("SppPkeyUniqueIdToken"); @@ -7212,18 +7509,143 @@ namespace LibTSforge.Modifiers } +// Activators/AVMA4K.cs +namespace LibTSforge.Activators +{ + using System; + using PhysicalStore; + using SPP; + + public static class AVMA4k + { + public static void Activate(PSVersion version, bool production, Guid actId) + { + if (version != PSVersion.WinModern && version != PSVersion.WinBlue) + { + throw new NotSupportedException("AVMA licenses are not available for this product."); + } + + Guid appId; + if (actId == Guid.Empty) + { + appId = SLApi.WINDOWS_APP_ID; + actId = SLApi.GetDefaultActivationID(appId, false); + + if (actId == Guid.Empty) + { + throw new NotSupportedException("No applicable activation IDs found."); + } + } + else + { + appId = SLApi.GetAppId(actId); + } + + if (SLApi.GetPKeyChannel(SLApi.GetInstalledPkeyID(actId)) != "VT:IA") + { + throw new NotSupportedException("Non-VT:IA product key installed."); + } + + SPPUtils.KillSPP(version); + + Logger.WriteLine("Writing TrustedStore data..."); + + using (IPhysicalStore store = SPPUtils.GetStore(version, production)) + { + string key = string.Format("SPPSVC\\{0}\\{1}", appId, actId); + + long creationTime = BitConverter.ToInt64(store.GetBlock("__##USERSEP##\\$$_RESERVED_$$\\NAMESPACE__", "__##USERSEP-RESERVED##__$$GLOBAL-CREATION-TIME$$").Data, 0); + long tickCount = BitConverter.ToInt64(store.GetBlock("__##USERSEP##\\$$_RESERVED_$$\\NAMESPACE__", "__##USERSEP-RESERVED##__$$GLOBAL-TICKCOUNT-UPTIME$$").Data, 0); + long deltaTime = BitConverter.ToInt64(store.GetBlock(key, "__##USERSEP-RESERVED##__$$UP-TIME-DELTA$$").Data, 0); + + const ulong unknown = 0; + ulong time1 = (ulong)(creationTime + tickCount + deltaTime); + ulong crcBindTime = (ulong)DateTime.UtcNow.ToFileTime(); + ulong timerTime = crcBindTime / 10000; + ulong expiry = Constants.TimerMax / 10000; + + VariableBag avmaBinding = new VariableBag(version); + + avmaBinding.Blocks.AddRange(new[] + { + new CRCBlockModern + { + DataType = CRCBlockType.BINARY, + Key = new byte[] { }, + Value = BitConverter.GetBytes(crcBindTime), + }, + new CRCBlockModern + { + DataType = CRCBlockType.STRING, + Key = new byte[] { }, + ValueAsStr = "AVMA4K", + }, + new CRCBlockModern + { + DataType = CRCBlockType.STRING, + Key = new byte[] { }, + ValueAsStr = "00491-50000-00001-AA666", + } + }); + + byte[] avmaBindingData = avmaBinding.Serialize(); + + Timer avmaTimer = new Timer + { + Unknown = unknown, + Time1 = time1, + Time2 = timerTime, + Expiry = expiry + }; + + string storeVal = string.Format("msft:spp/ia/bind/1.0/store/{0}/{1}", appId, actId); + string timerVal = string.Format("msft:spp/ia/bind/1.0/timer/{0}/{1}", appId, actId); + + store.DeleteBlock(key, storeVal); + store.DeleteBlock(key, timerVal); + + store.AddBlocks(new[] + { + new PSBlock + { + Type = BlockType.NAMED, + Flags = 0x400, + KeyAsStr = key, + ValueAsStr = storeVal, + Data = avmaBindingData, + }, + new PSBlock + { + Type = BlockType.TIMER, + Flags = 0x4, + KeyAsStr = key, + ValueAsStr = timerVal, + Data = avmaTimer.CastToArray() + } + }); + } + + SLApi.RefreshLicenseStatus(); + SLApi.FireStateChangedEvent(appId); + Logger.WriteLine("Activated using AVMA4k successfully."); + } + } +} + + // Activators/ZeroCID.cs namespace LibTSforge.Activators { using System; using System.IO; - using LibTSforge.Crypto; - using LibTSforge.PhysicalStore; - using LibTSforge.SPP; + using System.Linq; + using Crypto; + using PhysicalStore; + using SPP; public static class ZeroCID { - public static void Deposit(Guid actId, string instId) + private static void Deposit(Guid actId, string instId) { uint status = SLApi.DepositConfirmationID(actId, instId, Constants.ZeroCID); Logger.WriteLine(string.Format("Depositing fake CID status {0:X}", status)); @@ -7261,16 +7683,16 @@ namespace LibTSforge.Activators string instId = SLApi.GetInstallationID(actId); Guid pkeyId = SLApi.GetInstalledPkeyID(actId); - if (version == PSVersion.Win7) + if (version == PSVersion.Vista || version == PSVersion.Win7) { Deposit(actId, instId); } - Utils.KillSPP(); + SPPUtils.KillSPP(version); Logger.WriteLine("Writing TrustedStore data..."); - using (IPhysicalStore store = Utils.GetStore(version, production)) + using (IPhysicalStore store = SPPUtils.GetStore(version, production)) { byte[] hwidBlock = Constants.UniversalHWIDBlock; @@ -7280,7 +7702,11 @@ namespace LibTSforge.Activators byte[] iidHash; - if (version == PSVersion.Win7) + if (version == PSVersion.Vista) + { + iidHash = CryptoUtils.SHA256Hash(Utils.EncodeString(instId)).Take(0x10).ToArray(); + } + else if (version == PSVersion.Win7) { iidHash = CryptoUtils.SHA256Hash(Utils.EncodeString(instId)); } @@ -7297,11 +7723,39 @@ namespace LibTSforge.Activators throw new InvalidDataException("Failed to get product key data for activation ID " + actId + "."); } - VariableBag pkb = new VariableBag(keyBlock.Data); + VariableBag pkb = new VariableBag(keyBlock.Data, version); byte[] pkeyData; - if (version == PSVersion.Win7) + if (version == PSVersion.Vista) + { + pkeyData = pkb.GetBlock("PKeyBasicInfo").Value; + string uniqueId = Utils.DecodeString(pkeyData.Skip(0x120).Take(0x80).ToArray()); + string extPid = Utils.DecodeString(pkeyData.Skip(0x1A0).Take(0x80).ToArray()); + + uint group; + uint.TryParse(extPid.Split('-')[1], out group); + + if (group == 0) + { + throw new FormatException("Extended PID has invalid format."); + } + + ulong shortauth; + + try + { + shortauth = BitConverter.ToUInt64(Convert.FromBase64String(uniqueId.Split('&')[1]), 0); + } + catch + { + throw new FormatException("Key Unique ID has invalid format."); + } + + shortauth |= (ulong)group << 41; + pkeyData = BitConverter.GetBytes(shortauth); + } + else if (version == PSVersion.Win7) { pkeyData = pkb.GetBlock("SppPkeyShortAuthenticator").Value; } @@ -7314,26 +7768,34 @@ namespace LibTSforge.Activators store.SetBlock(key, pkeyId.ToString(), pkb.Serialize()); BinaryWriter writer = new BinaryWriter(new MemoryStream()); - writer.Write(0x20); + writer.Write(iidHash.Length); writer.Write(iidHash); writer.Write(hwidBlock.Length); writer.Write(hwidBlock); byte[] tsHwidData = writer.GetBytes(); writer = new BinaryWriter(new MemoryStream()); - writer.Write(0x20); + writer.Write(iidHash.Length); writer.Write(iidHash); writer.Write(pkeyData.Length); writer.Write(pkeyData); byte[] tsPkeyInfoData = writer.GetBytes(); - store.AddBlocks(new PSBlock[] { + string phoneVersion = version == PSVersion.Vista ? "6.0" : "7.0"; + Guid indexSlid = version == PSVersion.Vista ? actId : pkeyId; + string hwidBlockName = string.Format("msft:Windows/{0}/Phone/Cached/HwidBlock/{1}", phoneVersion, indexSlid); + string pkeyInfoName = string.Format("msft:Windows/{0}/Phone/Cached/PKeyInfo/{1}", phoneVersion, indexSlid); + + store.DeleteBlock(key, hwidBlockName); + store.DeleteBlock(key, pkeyInfoName); + + store.AddBlocks(new[] { new PSBlock { Type = BlockType.NAMED, Flags = 0, KeyAsStr = key, - ValueAsStr = "msft:Windows/7.0/Phone/Cached/HwidBlock/" + pkeyId, + ValueAsStr = hwidBlockName, Data = tsHwidData }, new PSBlock @@ -7341,18 +7803,18 @@ namespace LibTSforge.Activators Type = BlockType.NAMED, Flags = 0, KeyAsStr = key, - ValueAsStr = "msft:Windows/7.0/Phone/Cached/PKeyInfo/" + pkeyId, + ValueAsStr = pkeyInfoName, Data = tsPkeyInfoData } }); } - if (version != PSVersion.Win7) + if (version != PSVersion.Vista && version != PSVersion.Win7) { Deposit(actId, instId); } - SLApi.RefreshLicenseStatus(); + SPPUtils.RestartSPP(version); SLApi.FireStateChangedEvent(appId); Logger.WriteLine("Activated using ZeroCID successfully."); } @@ -7377,7 +7839,7 @@ namespace LibTSforge.TokenStore public class TokenMeta { public string Name; - public Dictionary Data = new Dictionary(); + public readonly Dictionary Data = new Dictionary(); public byte[] Serialize() { @@ -7400,7 +7862,7 @@ namespace LibTSforge.TokenStore return writer.GetBytes(); } - public void Deserialize(byte[] data) + private void Deserialize(byte[] data) { BinaryReader reader = new BinaryReader(new MemoryStream(data)); reader.ReadInt32(); @@ -7457,7 +7919,7 @@ namespace LibTSforge.TokenStore using System.Collections.Generic; using System.IO; using System.Linq; - using LibTSforge.Crypto; + using Crypto; public class TokenStoreModern : ITokenStore { @@ -7471,29 +7933,29 @@ namespace LibTSforge.TokenStore private static readonly byte[] CONTS_FOOTER = Enumerable.Repeat((byte)0xAA, 0x20).ToArray(); private List Entries = new List(); - public FileStream TokensFile; + private readonly FileStream TokensFile; public void Deserialize() { if (TokensFile.Length < BLOCK_SIZE) return; TokensFile.Seek(0x24, SeekOrigin.Begin); - uint nextBlock = 0; + uint nextBlock; BinaryReader reader = new BinaryReader(TokensFile); do { - uint curOffset = reader.ReadUInt32(); + reader.ReadUInt32(); nextBlock = reader.ReadUInt32(); for (int i = 0; i < ENTRIES_PER_BLOCK; i++) { - curOffset = reader.ReadUInt32(); + uint curOffset = reader.ReadUInt32(); bool populated = reader.ReadUInt32() == 1; uint contentOffset = reader.ReadUInt32(); uint contentLength = reader.ReadUInt32(); uint allocLength = reader.ReadUInt32(); - byte[] contentData = new byte[] { }; + byte[] contentData = { }; if (populated) { @@ -7593,11 +8055,10 @@ namespace LibTSforge.TokenStore writer.WritePadding(BLOCK_PAD_SIZE); writer.BaseStream.Seek(curBlockOffset, SeekOrigin.Begin); - byte[] blockHash; byte[] blockData = new byte[BLOCK_SIZE - 0x20]; tokens.Read(blockData, 0, BLOCK_SIZE - 0x20); - blockHash = CryptoUtils.SHA256Hash(blockData); + byte[] blockHash = CryptoUtils.SHA256Hash(blockData); writer.BaseStream.Seek(curBlockOffset + BLOCK_SIZE - 0x20, SeekOrigin.Begin); writer.Write(blockHash); @@ -7728,11 +8189,6 @@ namespace LibTSforge.TokenStore Deserialize(); } - public TokenStoreModern() - { - - } - public void Dispose() { Serialize(); @@ -7763,6 +8219,13 @@ namespace LibTSforge.PhysicalStore public ulong Time2; public ulong Expiry; } + + [StructLayout(LayoutKind.Sequential, Pack = 1)] + public struct VistaTimer + { + public ulong Time; + public ulong Expiry; + } } @@ -7867,7 +8330,7 @@ namespace LibTSforge.PhysicalStore using System; using System.Collections.Generic; using System.IO; - using LibTSforge.Crypto; + using Crypto; public class ModernBlock { @@ -7957,7 +8420,7 @@ namespace LibTSforge.PhysicalStore public sealed class PhysicalStoreModern : IPhysicalStore { - private byte[] PreHeaderBytes = new byte[] { }; + private byte[] PreHeaderBytes = { }; private readonly Dictionary> Data = new Dictionary>(); private readonly FileStream TSFile; private readonly PSVersion Version; @@ -8145,46 +8608,50 @@ namespace LibTSforge.PhysicalStore public void DeleteBlock(string key, string value) { - if (Data.ContainsKey(key)) + if (!Data.ContainsKey(key)) { - List blocks = Data[key]; - - foreach (ModernBlock block in blocks) - { - if (block.ValueAsStr == value) - { - blocks.Remove(block); - break; - } - } - - Data[key] = blocks; + return; } + + List blocks = Data[key]; + + foreach (ModernBlock block in blocks) + { + if (block.ValueAsStr == value) + { + blocks.Remove(block); + break; + } + } + + Data[key] = blocks; } public void DeleteBlock(string key, uint value) { - if (Data.ContainsKey(key)) + if (!Data.ContainsKey(key)) { - List blocks = Data[key]; - - foreach (ModernBlock block in blocks) - { - if (block.ValueAsInt == value) - { - blocks.Remove(block); - break; - } - } - - Data[key] = blocks; + return; } + + List blocks = Data[key]; + + foreach (ModernBlock block in blocks) + { + if (block.ValueAsInt == value) + { + blocks.Remove(block); + break; + } + } + + Data[key] = blocks; } public PhysicalStoreModern(string tsPath, bool production, PSVersion version) { TSFile = File.Open(tsPath, FileMode.OpenOrCreate, FileAccess.ReadWrite, FileShare.None); - Deserialize(PhysStoreCrypto.DecryptPhysicalStore(TSFile.ReadAllBytes(), production)); + Deserialize(PhysStoreCrypto.DecryptPhysicalStore(TSFile.ReadAllBytes(), production, version)); TSFile.Seek(0, SeekOrigin.Begin); Version = version; Production = production; @@ -8204,7 +8671,7 @@ namespace LibTSforge.PhysicalStore public byte[] ReadRaw() { - byte[] data = PhysStoreCrypto.DecryptPhysicalStore(TSFile.ReadAllBytes(), Production); + byte[] data = PhysStoreCrypto.DecryptPhysicalStore(TSFile.ReadAllBytes(), Production, Version); TSFile.Seek(0, SeekOrigin.Begin); return data; } @@ -8275,13 +8742,372 @@ namespace LibTSforge.PhysicalStore } +// PhysicalStore/PhysicalStoreVista.cs +namespace LibTSforge.PhysicalStore +{ + using System; + using System.Collections.Generic; + using System.IO; + using Crypto; + + public class VistaBlock + { + public BlockType Type; + public uint Flags; + public byte[] Value; + public string ValueAsStr + { + get + { + return Utils.DecodeString(Value); + } + set + { + Value = Utils.EncodeString(value); + } + } + public uint ValueAsInt + { + get + { + return BitConverter.ToUInt32(Value, 0); + } + set + { + Value = BitConverter.GetBytes(value); + } + } + public byte[] Data; + public string DataAsStr + { + get + { + return Utils.DecodeString(Data); + } + set + { + Data = Utils.EncodeString(value); + } + } + public uint DataAsInt + { + get + { + return BitConverter.ToUInt32(Data, 0); + } + set + { + Data = BitConverter.GetBytes(value); + } + } + + internal void Encode(BinaryWriter writer) + { + writer.Write((uint)Type); + writer.Write(Flags); + writer.Write(Value.Length); + writer.Write(Data.Length); + writer.Write(Value); + writer.Write(Data); + } + + internal static VistaBlock Decode(BinaryReader reader) + { + uint type = reader.ReadUInt32(); + uint flags = reader.ReadUInt32(); + + int valueLen = reader.ReadInt32(); + int dataLen = reader.ReadInt32(); + + byte[] value = reader.ReadBytes(valueLen); + byte[] data = reader.ReadBytes(dataLen); + return new VistaBlock + { + Type = (BlockType)type, + Flags = flags, + Value = value, + Data = data, + }; + } + } + + public sealed class PhysicalStoreVista : IPhysicalStore + { + private byte[] PreHeaderBytes = { }; + private readonly List Blocks = new List(); + private readonly FileStream TSPrimary; + private readonly FileStream TSSecondary; + private readonly bool Production; + + public byte[] Serialize() + { + BinaryWriter writer = new BinaryWriter(new MemoryStream()); + writer.Write(PreHeaderBytes); + + foreach (VistaBlock block in Blocks) + { + block.Encode(writer); + writer.Align(4); + } + + return writer.GetBytes(); + } + + public void Deserialize(byte[] data) + { + int len = data.Length; + + BinaryReader reader = new BinaryReader(new MemoryStream(data)); + PreHeaderBytes = reader.ReadBytes(8); + + while (reader.BaseStream.Position < len - 0x14) + { + Blocks.Add(VistaBlock.Decode(reader)); + reader.Align(4); + } + } + + public void AddBlock(PSBlock block) + { + Blocks.Add(new VistaBlock + { + Type = block.Type, + Flags = block.Flags, + Value = block.Value, + Data = block.Data + }); + } + + public void AddBlocks(IEnumerable blocks) + { + foreach (PSBlock block in blocks) + { + AddBlock(block); + } + } + + public PSBlock GetBlock(string key, string value) + { + foreach (VistaBlock block in Blocks) + { + if (block.ValueAsStr == value) + { + return new PSBlock + { + Type = block.Type, + Flags = block.Flags, + Key = new byte[0], + Value = block.Value, + Data = block.Data + }; + } + } + + return null; + } + + public PSBlock GetBlock(string key, uint value) + { + foreach (VistaBlock block in Blocks) + { + if (block.ValueAsInt == value) + { + return new PSBlock + { + Type = block.Type, + Flags = block.Flags, + Key = new byte[0], + Value = block.Value, + Data = block.Data + }; + } + } + + return null; + } + + public void SetBlock(string key, string value, byte[] data) + { + for (int i = 0; i < Blocks.Count; i++) + { + VistaBlock block = Blocks[i]; + + if (block.ValueAsStr == value) + { + block.Data = data; + Blocks[i] = block; + break; + } + } + } + + public void SetBlock(string key, uint value, byte[] data) + { + for (int i = 0; i < Blocks.Count; i++) + { + VistaBlock block = Blocks[i]; + + if (block.ValueAsInt == value) + { + block.Data = data; + Blocks[i] = block; + break; + } + } + } + + public void SetBlock(string key, string value, string data) + { + SetBlock(key, value, Utils.EncodeString(data)); + } + + public void SetBlock(string key, string value, uint data) + { + SetBlock(key, value, BitConverter.GetBytes(data)); + } + + public void SetBlock(string key, uint value, string data) + { + SetBlock(key, value, Utils.EncodeString(data)); + } + + public void SetBlock(string key, uint value, uint data) + { + SetBlock(key, value, BitConverter.GetBytes(data)); + } + + public void DeleteBlock(string key, string value) + { + foreach (VistaBlock block in Blocks) + { + if (block.ValueAsStr == value) + { + Blocks.Remove(block); + return; + } + } + } + + public void DeleteBlock(string key, uint value) + { + foreach (VistaBlock block in Blocks) + { + if (block.ValueAsInt == value) + { + Blocks.Remove(block); + return; + } + } + } + + public PhysicalStoreVista(string primaryPath, bool production) + { + TSPrimary = File.Open(primaryPath, FileMode.OpenOrCreate, FileAccess.ReadWrite, FileShare.None); + TSSecondary = File.Open(primaryPath.Replace("-0.", "-1."), FileMode.OpenOrCreate, FileAccess.ReadWrite, FileShare.None); + Production = production; + + Deserialize(PhysStoreCrypto.DecryptPhysicalStore(TSPrimary.ReadAllBytes(), production, PSVersion.Vista)); + TSPrimary.Seek(0, SeekOrigin.Begin); + } + + public void Dispose() + { + if (TSPrimary.CanWrite && TSSecondary.CanWrite) + { + byte[] data = PhysStoreCrypto.EncryptPhysicalStore(Serialize(), Production, PSVersion.Vista); + + TSPrimary.SetLength(data.LongLength); + TSSecondary.SetLength(data.LongLength); + + TSPrimary.Seek(0, SeekOrigin.Begin); + TSSecondary.Seek(0, SeekOrigin.Begin); + + TSPrimary.WriteAllBytes(data); + TSSecondary.WriteAllBytes(data); + + TSPrimary.Close(); + TSSecondary.Close(); + } + } + + public byte[] ReadRaw() + { + byte[] data = PhysStoreCrypto.DecryptPhysicalStore(TSPrimary.ReadAllBytes(), Production, PSVersion.Vista); + TSPrimary.Seek(0, SeekOrigin.Begin); + return data; + } + + public void WriteRaw(byte[] data) + { + byte[] encrData = PhysStoreCrypto.EncryptPhysicalStore(data, Production, PSVersion.Vista); + + TSPrimary.SetLength(encrData.LongLength); + TSSecondary.SetLength(encrData.LongLength); + + TSPrimary.Seek(0, SeekOrigin.Begin); + TSSecondary.Seek(0, SeekOrigin.Begin); + + TSPrimary.WriteAllBytes(encrData); + TSSecondary.WriteAllBytes(encrData); + + TSPrimary.Close(); + TSSecondary.Close(); + } + + public IEnumerable FindBlocks(string valueSearch) + { + List results = new List(); + + foreach (VistaBlock block in Blocks) + { + if (block.ValueAsStr.Contains(valueSearch)) + { + results.Add(new PSBlock + { + Type = block.Type, + Flags = block.Flags, + Key = new byte[0], + Value = block.Value, + Data = block.Data + }); + } + } + + return results; + } + + public IEnumerable FindBlocks(uint valueSearch) + { + List results = new List(); + + foreach (VistaBlock block in Blocks) + { + if (block.ValueAsInt == valueSearch) + { + results.Add(new PSBlock + { + Type = block.Type, + Flags = block.Flags, + Key = new byte[0], + Value = block.Value, + Data = block.Data + }); + } + } + + return results; + } + } +} + + // PhysicalStore/PhysicalStoreWin7.cs namespace LibTSforge.PhysicalStore { using System; using System.Collections.Generic; using System.IO; - using LibTSforge.Crypto; + using Crypto; public class Win7Block { @@ -8383,7 +9209,7 @@ namespace LibTSforge.PhysicalStore public sealed class PhysicalStoreWin7 : IPhysicalStore { - private byte[] PreHeaderBytes = new byte[] { }; + private byte[] PreHeaderBytes = { }; private readonly List Blocks = new List(); private readonly FileStream TSPrimary; private readonly FileStream TSSecondary; @@ -8557,7 +9383,7 @@ namespace LibTSforge.PhysicalStore TSSecondary = File.Open(primaryPath.Replace("-0.", "-1."), FileMode.OpenOrCreate, FileAccess.ReadWrite, FileShare.None); Production = production; - Deserialize(PhysStoreCrypto.DecryptPhysicalStore(TSPrimary.ReadAllBytes(), production)); + Deserialize(PhysStoreCrypto.DecryptPhysicalStore(TSPrimary.ReadAllBytes(), production, PSVersion.Win7)); TSPrimary.Seek(0, SeekOrigin.Begin); } @@ -8583,7 +9409,7 @@ namespace LibTSforge.PhysicalStore public byte[] ReadRaw() { - byte[] data = PhysStoreCrypto.DecryptPhysicalStore(TSPrimary.ReadAllBytes(), Production); + byte[] data = PhysStoreCrypto.DecryptPhysicalStore(TSPrimary.ReadAllBytes(), Production, PSVersion.Win7); TSPrimary.Seek(0, SeekOrigin.Begin); return data; } @@ -8666,7 +9492,7 @@ namespace LibTSforge.PhysicalStore BINARY = 1 << 2 } - public class CRCBlock + public abstract class CRCBlock { public CRCBlockType DataType; public byte[] Key; @@ -8705,7 +9531,57 @@ namespace LibTSforge.PhysicalStore } } - public void Encode(BinaryWriter writer) + public abstract void Encode(BinaryWriter writer); + public abstract void Decode(BinaryReader reader); + public abstract uint CRC(); + } + + public class CRCBlockVista : CRCBlock + { + public override void Encode(BinaryWriter writer) + { + uint crc = CRC(); + writer.Write((uint)DataType); + writer.Write(0); + writer.Write(Key.Length); + writer.Write(Value.Length); + writer.Write(crc); + + writer.Write(Key); + + writer.Write(Value); + } + + public override void Decode(BinaryReader reader) + { + uint type = reader.ReadUInt32(); + reader.ReadUInt32(); + uint lenName = reader.ReadUInt32(); + uint lenVal = reader.ReadUInt32(); + uint crc = reader.ReadUInt32(); + + byte[] key = reader.ReadBytes((int)lenName); + byte[] value = reader.ReadBytes((int)lenVal); + + DataType = (CRCBlockType)type; + Key = key; + Value = value; + + if (CRC() != crc) + { + throw new InvalidDataException("Invalid CRC in variable bag."); + } + } + + public override uint CRC() + { + return Utils.CRC32(Value); + } + } + + public class CRCBlockModern : CRCBlock + { + public override void Encode(BinaryWriter writer) { uint crc = CRC(); writer.Write(crc); @@ -8720,7 +9596,7 @@ namespace LibTSforge.PhysicalStore writer.Align(8); } - public static CRCBlock Decode(BinaryReader reader) + public override void Decode(BinaryReader reader) { uint crc = reader.ReadUInt32(); uint type = reader.ReadUInt32(); @@ -8733,22 +9609,17 @@ namespace LibTSforge.PhysicalStore byte[] value = reader.ReadBytes((int)lenVal); reader.Align(8); - CRCBlock block = new CRCBlock - { - DataType = (CRCBlockType)type, - Key = key, - Value = value, - }; + DataType = (CRCBlockType)type; + Key = key; + Value = value; - if (block.CRC() != crc) + if (CRC() != crc) { throw new InvalidDataException("Invalid CRC in variable bag."); } - - return block; } - public uint CRC() + public override uint CRC() { BinaryWriter wtemp = new BinaryWriter(new MemoryStream()); wtemp.Write(0); @@ -8764,8 +9635,9 @@ namespace LibTSforge.PhysicalStore public class VariableBag { public List Blocks = new List(); + private readonly PSVersion Version; - public void Deserialize(byte[] data) + private void Deserialize(byte[] data) { int len = data.Length; @@ -8773,7 +9645,19 @@ namespace LibTSforge.PhysicalStore while (reader.BaseStream.Position < len - 0x10) { - Blocks.Add(CRCBlock.Decode(reader)); + CRCBlock block; + + if (Version == PSVersion.Vista) + { + block = new CRCBlockVista(); + } + else + { + block = new CRCBlockModern(); + } + + block.Decode(reader); + Blocks.Add(block); } } @@ -8783,7 +9667,13 @@ namespace LibTSforge.PhysicalStore foreach (CRCBlock block in Blocks) { - block.Encode(writer); + if (Version == PSVersion.Vista) + { + ((CRCBlockVista)block).Encode(writer); + } else + { + ((CRCBlockModern)block).Encode(writer); + } } return writer.GetBytes(); @@ -8829,14 +9719,15 @@ namespace LibTSforge.PhysicalStore } } - public VariableBag(byte[] data) + public VariableBag(byte[] data, PSVersion version) { + Version = version; Deserialize(data); } - public VariableBag() + public VariableBag(PSVersion version) { - + Version = version; } } } @@ -8866,7 +9757,7 @@ if ($env:_debug -eq '0') { [LibTSforge.Logger]::HideOutput = $true } $ver = [LibTSforge.Utils]::DetectVersion() -$prod = [LibTSforge.Utils]::DetectCurrentKey() +$prod = [LibTSforge.SPP.SPPUtils]::DetectCurrentKey() $tsactids = @($args) function Get-WmiInfo { @@ -8918,7 +9809,7 @@ if ($env:resetstuff -eq $null) { $licenseStatus = Get-WmiInfo -tsactid $tsactid -property "LicenseStatus" if ($licenseStatus -eq 1) { if ($prodDes -match 'KMS' -and $prodDes -notmatch 'CLIENT') { - [LibTSforge.Modifiers.KMSHostCharge]::Charge($ver, $tsactid, $prod) + [LibTSforge.Modifiers.KMSHostCharge]::Charge($ver, $prod, $tsactid) Write-Host "[$prodName] CSVLK is permanently activated with ZeroCID." -ForegroundColor White -BackgroundColor DarkGreen Write-Host "[$prodName] CSVLK is charged with 25 clients for 30 days." -ForegroundColor White -BackgroundColor DarkGreen } diff --git a/MAS/Separate-Files-Version/Activators/TSforge_Activation.cmd b/MAS/Separate-Files-Version/Activators/TSforge_Activation.cmd index 641f92d..350ae2a 100644 --- a/MAS/Separate-Files-Version/Activators/TSforge_Activation.cmd +++ b/MAS/Separate-Files-Version/Activators/TSforge_Activation.cmd @@ -2834,23 +2834,16 @@ $src = @' // Common.cs namespace LibTSforge { - using Microsoft.Win32; using System; using System.IO; using System.Linq; using System.Runtime.InteropServices; - using System.ServiceProcess; using System.Text; - using LibTSforge.Crypto; - using LibTSforge.PhysicalStore; - using LibTSforge.SPP; - using LibTSforge.TokenStore; public enum PSVersion { Vista, Win7, - Win8Early, Win8, WinBlue, WinModern @@ -2921,8 +2914,8 @@ namespace LibTSforge 0x92, 0xA6, 0x56, 0x96 }; - // 2^31 - 1 minutes - public static ulong TimerMax = (ulong)TimeSpan.FromMinutes(2147483647).Ticks; + // 2^31 - 8 minutes + public static readonly ulong TimerMax = (ulong)TimeSpan.FromMinutes(2147483640).Ticks; public static readonly string ZeroCID = new string('0', 48); } @@ -2990,20 +2983,6 @@ namespace LibTSforge } return result; } - - public static T CastToStruct(this byte[] data) where T : struct - { - GCHandle handle = GCHandle.Alloc(data, GCHandleType.Pinned); - try - { - IntPtr ptr = handle.AddrOfPinnedObject(); - return (T)Marshal.PtrToStructure(ptr, typeof(T)); - } - finally - { - handle.Free(); - } - } } public static class FileStreamExt @@ -3024,6 +3003,12 @@ namespace LibTSforge public static class Utils { + [DllImport("kernel32.dll")] + public static extern uint GetSystemDefaultLCID(); + + [DllImport("kernel32.dll")] + public static extern bool Wow64EnableWow64FsRedirection(bool Wow64FsEnableRedirection); + public static string DecodeString(byte[] data) { return Encoding.Unicode.GetString(data).Trim('\0'); @@ -3034,9 +3019,6 @@ namespace LibTSforge return Encoding.Unicode.GetBytes(str + '\0'); } - [DllImport("kernel32.dll")] - public static extern uint GetSystemDefaultLCID(); - public static uint CRC32(byte[] data) { const uint polynomial = 0x04C11DB7; @@ -3060,157 +3042,6 @@ namespace LibTSforge return ~crc; } - public static void KillSPP() - { - ServiceController sc; - - try - { - sc = new ServiceController("sppsvc"); - - if (sc.Status == ServiceControllerStatus.Stopped) - return; - } - catch (InvalidOperationException ex) - { - throw new InvalidOperationException("Unable to access sppsvc: " + ex.Message); - } - - Logger.WriteLine("Stopping sppsvc..."); - - bool stopped = false; - - for (int i = 0; stopped == false && i < 60; i++) - { - try - { - if (sc.Status != ServiceControllerStatus.StopPending) - sc.Stop(); - - sc.WaitForStatus(ServiceControllerStatus.Stopped, TimeSpan.FromMilliseconds(500)); - } - catch (System.ServiceProcess.TimeoutException) - { - continue; - } - catch (InvalidOperationException) - { - System.Threading.Thread.Sleep(500); - continue; - } - - stopped = true; - } - - if (!stopped) - throw new System.TimeoutException("Failed to stop sppsvc"); - - Logger.WriteLine("sppsvc stopped successfully."); - } - - public static string GetPSPath(PSVersion version) - { - switch (version) - { - case PSVersion.Win7: - return Directory.GetFiles( - Environment.GetFolderPath(Environment.SpecialFolder.System), - "7B296FB0-376B-497e-B012-9C450E1B7327-*.C7483456-A289-439d-8115-601632D005A0") - .FirstOrDefault() ?? ""; - case PSVersion.Win8Early: - case PSVersion.WinBlue: - case PSVersion.Win8: - case PSVersion.WinModern: - return Path.Combine( - Environment.ExpandEnvironmentVariables( - (string)Registry.GetValue( - @"HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\SoftwareProtectionPlatform", - "TokenStore", - string.Empty - ) - ), - "data.dat" - ); - default: - return ""; - } - } - - public static string GetTokensPath(PSVersion version) - { - switch (version) - { - case PSVersion.Win7: - return Path.Combine( - Environment.ExpandEnvironmentVariables("%WINDIR%"), - @"ServiceProfiles\NetworkService\AppData\Roaming\Microsoft\SoftwareProtectionPlatform\tokens.dat" - ); - case PSVersion.Win8Early: - case PSVersion.WinBlue: - case PSVersion.Win8: - case PSVersion.WinModern: - return Path.Combine( - Environment.ExpandEnvironmentVariables( - (string)Registry.GetValue( - @"HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\SoftwareProtectionPlatform", - "TokenStore", - string.Empty - ) - ), - "tokens.dat" - ); - default: - return ""; - } - } - - public static IPhysicalStore GetStore(PSVersion version, bool production) - { - string psPath; - - try - { - psPath = GetPSPath(version); - } - catch - { - throw new FileNotFoundException("Failed to get path of physical store."); - } - - if (string.IsNullOrEmpty(psPath) || !File.Exists(psPath)) - { - throw new FileNotFoundException(string.Format("Physical store not found at expected path {0}.", psPath)); - } - - if (version == PSVersion.Vista) - { - throw new NotSupportedException("Physical store editing is not supported for Windows Vista."); - } - - return version == PSVersion.Win7 ? new PhysicalStoreWin7(psPath, production) : (IPhysicalStore)new PhysicalStoreModern(psPath, production, version); - } - - public static ITokenStore GetTokenStore(PSVersion version) - { - string tokPath; - - try - { - tokPath = GetTokensPath(version); - } - catch - { - throw new FileNotFoundException("Failed to get path of physical store."); - } - - if (string.IsNullOrEmpty(tokPath) || !File.Exists(tokPath)) - { - throw new FileNotFoundException(string.Format("Token store not found at expected path {0}.", tokPath)); - } - - return new TokenStoreModern(tokPath); - } - public static string GetArchitecture() { string arch = Environment.GetEnvironmentVariable("PROCESSOR_ARCHITECTURE", EnvironmentVariableTarget.Machine).ToUpperInvariant(); @@ -3226,65 +3057,7 @@ namespace LibTSforge if (build >= 7600 && build <= 7602) return PSVersion.Win7; if (build == 9200) return PSVersion.Win8; - throw new NotSupportedException("Unable to auto-detect version info, please specify one manually using the /ver argument."); - } - - public static bool DetectCurrentKey() - { - SLApi.RefreshLicenseStatus(); - - using (RegistryKey wpaKey = Registry.LocalMachine.OpenSubKey(@"SYSTEM\WPA")) - { - foreach (string subKey in wpaKey.GetSubKeyNames()) - { - if (subKey.StartsWith("8DEC0AF1") && subKey.EndsWith("-1")) - { - return subKey.Contains("P"); - } - } - } - - throw new FileNotFoundException("Failed to autodetect key type, specify physical store key with /prod or /test arguments."); - } - - public static void DumpStore(PSVersion version, bool production, string filePath, string encrFilePath) - { - if (encrFilePath == null) - { - encrFilePath = GetPSPath(version); - } - - if (string.IsNullOrEmpty(encrFilePath) || !File.Exists(encrFilePath)) - { - throw new FileNotFoundException("Store does not exist at expected path '" + encrFilePath + "'."); - } - - KillSPP(); - - using (FileStream fs = File.Open(encrFilePath, FileMode.OpenOrCreate, FileAccess.ReadWrite, FileShare.None)) - { - byte[] encrData = fs.ReadAllBytes(); - File.WriteAllBytes(filePath, PhysStoreCrypto.DecryptPhysicalStore(encrData, production)); - } - - Logger.WriteLine("Store dumped successfully to '" + filePath + "'."); - } - - public static void LoadStore(PSVersion version, bool production, string filePath) - { - if (string.IsNullOrEmpty(filePath) || !File.Exists(filePath)) - { - throw new FileNotFoundException("Store file '" + filePath + "' does not exist."); - } - - KillSPP(); - - using (IPhysicalStore store = GetStore(version, production)) - { - store.WriteRaw(File.ReadAllBytes(filePath)); - } - - Logger.WriteLine("Loaded store file succesfully."); + throw new NotSupportedException("Unable to auto-detect version info"); } } @@ -3377,8 +3150,8 @@ namespace LibTSforge.SPP public class PKeyConfig { - public Dictionary Products = new Dictionary(); - private List loadedPkeyConfigs = new List(); + public readonly Dictionary Products = new Dictionary(); + private readonly List loadedPkeyConfigs = new List(); public void LoadConfig(Guid actId) { @@ -3439,12 +3212,14 @@ namespace LibTSforge.SPP ranges[refActIdStr] = new List(); } - KeyRange keyRange = new KeyRange(); - keyRange.Start = int.Parse(rangeNode.SelectSingleNode("./p:Start", nsmgr).InnerText); - keyRange.End = int.Parse(rangeNode.SelectSingleNode("./p:End", nsmgr).InnerText); - keyRange.EulaType = rangeNode.SelectSingleNode("./p:EulaType", nsmgr).InnerText; - keyRange.PartNumber = rangeNode.SelectSingleNode("./p:PartNumber", nsmgr).InnerText; - keyRange.Valid = rangeNode.SelectSingleNode("./p:IsValid", nsmgr).InnerText.ToLower() == "true"; + KeyRange keyRange = new KeyRange + { + Start = int.Parse(rangeNode.SelectSingleNode("./p:Start", nsmgr).InnerText), + End = int.Parse(rangeNode.SelectSingleNode("./p:End", nsmgr).InnerText), + EulaType = rangeNode.SelectSingleNode("./p:EulaType", nsmgr).InnerText, + PartNumber = rangeNode.SelectSingleNode("./p:PartNumber", nsmgr).InnerText, + Valid = rangeNode.SelectSingleNode("./p:IsValid", nsmgr).InnerText.ToLower() == "true" + }; ranges[refActIdStr].Add(keyRange); } @@ -3458,15 +3233,17 @@ namespace LibTSforge.SPP if (keyRanges.Count > 0 && !Products.ContainsKey(refActId)) { - ProductConfig productConfig = new ProductConfig(); - productConfig.GroupId = group; - productConfig.Edition = configNode.SelectSingleNode("./p:EditionId", nsmgr).InnerText; - productConfig.Description = configNode.SelectSingleNode("./p:ProductDescription", nsmgr).InnerText; - productConfig.Channel = configNode.SelectSingleNode("./p:ProductKeyType", nsmgr).InnerText; - productConfig.Randomized = configNode.SelectSingleNode("./p:ProductKeyType", nsmgr).InnerText.ToLower() == "true"; - productConfig.Algorithm = algorithms[group]; - productConfig.Ranges = keyRanges; - productConfig.ActivationId = refActId; + ProductConfig productConfig = new ProductConfig + { + GroupId = group, + Edition = configNode.SelectSingleNode("./p:EditionId", nsmgr).InnerText, + Description = configNode.SelectSingleNode("./p:ProductDescription", nsmgr).InnerText, + Channel = configNode.SelectSingleNode("./p:ProductKeyType", nsmgr).InnerText, + Randomized = configNode.SelectSingleNode("./p:ProductKeyType", nsmgr).InnerText.ToLower() == "true", + Algorithm = algorithms[group], + Ranges = keyRanges, + ActivationId = refActId + }; Products[refActId] = productConfig; } @@ -3509,11 +3286,6 @@ namespace LibTSforge.SPP } } } - - public PKeyConfig() - { - - } } } @@ -3524,8 +3296,8 @@ namespace LibTSforge.SPP using System; using System.IO; using System.Linq; - using LibTSforge.Crypto; - using LibTSforge.PhysicalStore; + using Crypto; + using PhysicalStore; public class ProductKey { @@ -3539,11 +3311,11 @@ namespace LibTSforge.SPP public ulong Security; public bool Upgrade; public PKeyAlgorithm Algorithm; - public string EulaType; - public string PartNumber; - public string Edition; - public string Channel; - public Guid ActivationId; + public readonly string EulaType; + public readonly string PartNumber; + public readonly string Edition; + public readonly string Channel; + public readonly Guid ActivationId; private string mpc; private string pid2; @@ -3553,6 +3325,11 @@ namespace LibTSforge.SPP get { return BitConverter.GetBytes(klow).Concat(BitConverter.GetBytes(khigh)).ToArray(); } } + public ProductKey() + { + + } + public ProductKey(int serial, ulong security, bool upgrade, PKeyAlgorithm algorithm, ProductConfig config, KeyRange range) { Group = config.GroupId; @@ -3581,22 +3358,22 @@ namespace LibTSforge.SPP public Guid GetPkeyId() { - VariableBag pkb = new VariableBag(); - pkb.Blocks.AddRange(new CRCBlock[] + VariableBag pkb = new VariableBag(PSVersion.WinModern); + pkb.Blocks.AddRange(new[] { - new CRCBlock + new CRCBlockModern { DataType = CRCBlockType.STRING, KeyAsStr = "SppPkeyBindingProductKey", ValueAsStr = ToString() }, - new CRCBlock + new CRCBlockModern { DataType = CRCBlockType.BINARY, KeyAsStr = "SppPkeyBindingMiscData", Value = new byte[] { } }, - new CRCBlock + new CRCBlockModern { DataType = CRCBlockType.STRING, KeyAsStr = "SppPkeyBindingAlgorithm", @@ -3607,16 +3384,6 @@ namespace LibTSforge.SPP return new Guid(CryptoUtils.SHA256Hash(pkb.Serialize()).Take(16).ToArray()); } - public string GetDefaultMPC() - { - int build = Environment.OSVersion.Version.Build; - string defaultMPC = build >= 10240 ? "03612" : - build >= 9600 ? "06401" : - build >= 9200 ? "05426" : - "55041"; - return defaultMPC; - } - public string GetMPC() { if (mpc != null) @@ -3624,10 +3391,15 @@ namespace LibTSforge.SPP return mpc; } - mpc = GetDefaultMPC(); + int build = Environment.OSVersion.Version.Build; + + mpc = build >= 10240 ? "03612" : + build >= 9600 ? "06401" : + build >= 9200 ? "05426" : + "55041"; // setup.cfg doesn't exist in Windows 8+ - string setupcfg = string.Format("{0}\\oobe\\{1}", Environment.SystemDirectory, "setup.cfg"); + string setupcfg = string.Format(@"{0}\oobe\{1}", Environment.SystemDirectory, "setup.cfg"); if (!File.Exists(setupcfg) || Edition.Contains(";")) { @@ -3765,17 +3537,17 @@ namespace LibTSforge.SPP { if (version == PSVersion.Win7) { - Random rnd = new Random(Group * 1000000000 + Serial); - byte[] data = new byte[8]; - rnd.NextBytes(data); - return data; + ulong shortauth = ((ulong)Group << 41) | (Security << 31) | ((ulong)Serial << 1) | (Upgrade ? (ulong)1 : 0); + return BitConverter.GetBytes(shortauth); } int serialHigh = Serial / 1000000; int serialLow = Serial % 1000000; BinaryWriter writer = new BinaryWriter(new MemoryStream()); - writer.Write(new Guid("B8731595-A2F6-430B-A799-FBFFB81A8D73").ToByteArray()); + string algoId = Algorithm == PKeyAlgorithm.PKEY2005 ? "B8731595-A2F6-430B-A799-FBFFB81A8D73" : "660672EF-7809-4CFD-8D54-41B7FB738988"; + + writer.Write(new Guid(algoId).ToByteArray()); writer.Write(Group); writer.Write(serialHigh); writer.Write(serialLow); @@ -3881,40 +3653,40 @@ namespace LibTSforge.SPP public static readonly Guid WINDOWS_APP_ID = new Guid("55c92734-d682-4d71-983e-d6ec3f16059f"); - [DllImport("sppc.dll", CharSet = CharSet.Unicode, PreserveSig = false)] + [DllImport("slc.dll", CharSet = CharSet.Unicode, PreserveSig = false)] private static extern void SLOpen(out IntPtr hSLC); - [DllImport("sppc.dll", CharSet = CharSet.Unicode, PreserveSig = false)] + [DllImport("slc.dll", CharSet = CharSet.Unicode, PreserveSig = false)] private static extern void SLClose(IntPtr hSLC); [DllImport("slc.dll", CharSet = CharSet.Unicode)] private static extern uint SLGetWindowsInformationDWORD(string ValueName, ref int Value); - [DllImport("sppc.dll", CharSet = CharSet.Unicode)] + [DllImport("slc.dll", CharSet = CharSet.Unicode)] private static extern uint SLInstallProofOfPurchase(IntPtr hSLC, string pwszPKeyAlgorithm, string pwszPKeyString, uint cbPKeySpecificData, byte[] pbPKeySpecificData, ref Guid PKeyId); - [DllImport("sppc.dll", CharSet = CharSet.Unicode)] + [DllImport("slc.dll", CharSet = CharSet.Unicode)] private static extern uint SLUninstallProofOfPurchase(IntPtr hSLC, ref Guid PKeyId); - [DllImport("sppc.dll", CharSet = CharSet.Unicode)] + [DllImport("slc.dll", CharSet = CharSet.Unicode)] private static extern uint SLGetPKeyInformation(IntPtr hSLC, ref Guid pPKeyId, string pwszValueName, out SLDATATYPE peDataType, out uint pcbValue, out IntPtr ppbValue); - [DllImport("sppcext.dll", CharSet = CharSet.Unicode)] + [DllImport("slcext.dll", CharSet = CharSet.Unicode)] private static extern uint SLActivateProduct(IntPtr hSLC, ref Guid pProductSkuId, byte[] cbAppSpecificData, byte[] pvAppSpecificData, byte[] pActivationInfo, string pwszProxyServer, ushort wProxyPort); - [DllImport("sppc.dll", CharSet = CharSet.Unicode)] + [DllImport("slc.dll", CharSet = CharSet.Unicode)] private static extern uint SLGenerateOfflineInstallationId(IntPtr hSLC, ref Guid pProductSkuId, ref string ppwszInstallationId); - [DllImport("sppc.dll", CharSet = CharSet.Unicode)] + [DllImport("slc.dll", CharSet = CharSet.Unicode)] private static extern uint SLDepositOfflineConfirmationId(IntPtr hSLC, ref Guid pProductSkuId, string pwszInstallationId, string pwszConfirmationId); - [DllImport("sppc.dll", CharSet = CharSet.Unicode)] + [DllImport("slc.dll", CharSet = CharSet.Unicode)] private static extern uint SLGetSLIDList(IntPtr hSLC, SLIDTYPE eQueryIdType, ref Guid pQueryId, SLIDTYPE eReturnIdType, out uint pnReturnIds, out IntPtr ppReturnIds); - [DllImport("sppc.dll", CharSet = CharSet.Unicode, PreserveSig = false)] + [DllImport("slc.dll", CharSet = CharSet.Unicode, PreserveSig = false)] private static extern void SLGetLicensingStatusInformation(IntPtr hSLC, ref Guid pAppID, IntPtr pProductSkuId, string pwszRightName, out uint pnStatusCount, out IntPtr ppLicensingStatus); - [DllImport("sppc.dll", CharSet = CharSet.Unicode)] + [DllImport("slc.dll", CharSet = CharSet.Unicode)] private static extern uint SLGetInstalledProductKeyIds(IntPtr hSLC, ref Guid pProductSkuId, out uint pnProductKeyIds, out IntPtr ppProductKeyIds); [DllImport("slc.dll", CharSet = CharSet.Unicode)] @@ -3923,9 +3695,6 @@ namespace LibTSforge.SPP [DllImport("slc.dll", CharSet = CharSet.Unicode)] private static extern uint SLGetProductSkuInformation(IntPtr hSLC, ref Guid pProductSkuId, string pwszValueName, out SLDATATYPE peDataType, out uint pcbValue, out IntPtr ppbValue); - [DllImport("slc.dll", CharSet = CharSet.Unicode)] - private static extern uint SLGetProductSkuInformation(IntPtr hSLC, ref Guid pProductSkuId, string pwszValueName, IntPtr peDataType, out uint pcbValue, out IntPtr ppbValue); - [DllImport("slc.dll", CharSet = CharSet.Unicode)] private static extern uint SLGetLicense(IntPtr hSLC, ref Guid pLicenseFileId, out uint pcbLicenseFile, out IntPtr ppbLicenseFile); @@ -3935,7 +3704,7 @@ namespace LibTSforge.SPP [DllImport("slc.dll", CharSet = CharSet.Unicode)] private static extern uint SLFireEvent(IntPtr hSLC, string pwszEventId, ref Guid pApplicationId); - public class SLContext : IDisposable + private class SLContext : IDisposable { public readonly IntPtr Handle; @@ -3998,11 +3767,10 @@ namespace LibTSforge.SPP { using (SLContext sl = new SLContext()) { - uint status; uint count; IntPtr pProductKeyIds; - status = SLGetInstalledProductKeyIds(sl.Handle, ref actId, out count, out pProductKeyIds); + uint status = SLGetSLIDList(sl.Handle, SLIDTYPE.SL_ID_PRODUCT_SKU, ref actId, SLIDTYPE.SL_ID_PKEY, out count, out pProductKeyIds); if (status != 0 || count == 0) { @@ -4026,7 +3794,7 @@ namespace LibTSforge.SPP SLConsumeWindowsRight(0); } - public static bool RefreshTrustedTime(Guid actId) + public static void RefreshTrustedTime(Guid actId) { using (SLContext sl = new SLContext()) { @@ -4034,8 +3802,7 @@ namespace LibTSforge.SPP uint count; IntPtr ppbValue; - uint status = SLGetProductSkuInformation(sl.Handle, ref actId, "TrustedTime", out type, out count, out ppbValue); - return (int)status >= 0 && status != 0xC004F012; + SLGetProductSkuInformation(sl.Handle, ref actId, "TrustedTime", out type, out count, out ppbValue); } } @@ -4051,11 +3818,10 @@ namespace LibTSforge.SPP { using (SLContext sl = new SLContext()) { - uint status; uint count; IntPtr pAppIds; - status = SLGetSLIDList(sl.Handle, SLIDTYPE.SL_ID_PRODUCT_SKU, ref actId, SLIDTYPE.SL_ID_APPLICATION, out count, out pAppIds); + uint status = SLGetSLIDList(sl.Handle, SLIDTYPE.SL_ID_PRODUCT_SKU, ref actId, SLIDTYPE.SL_ID_APPLICATION, out count, out pAppIds); if (status != 0 || count == 0) { @@ -4083,11 +3849,10 @@ namespace LibTSforge.SPP { using (SLContext sl = new SLContext()) { - uint status; uint count; IntPtr ppReturnLics; - status = SLGetSLIDList(sl.Handle, SLIDTYPE.SL_ID_LICENSE, ref licId, SLIDTYPE.SL_ID_LICENSE_FILE, out count, out ppReturnLics); + uint status = SLGetSLIDList(sl.Handle, SLIDTYPE.SL_ID_LICENSE, ref licId, SLIDTYPE.SL_ID_LICENSE_FILE, out count, out ppReturnLics); if (status != 0 || count == 0) { @@ -4149,7 +3914,7 @@ namespace LibTSforge.SPP IntPtr ppbValue; uint status = SLGetProductSkuInformation(sl.Handle, ref actId, "msft:sl/EUL/PHONE/PUBLIC", out type, out count, out ppbValue); - return status >= 0 && status != 0xC004F012; + return status != 0xC004F012; } } @@ -4232,11 +3997,11 @@ namespace LibTSforge.SPP } } - public static uint UninstallProductKey(Guid pkeyId) + public static void UninstallProductKey(Guid pkeyId) { using (SLContext sl = new SLContext()) { - return SLUninstallProofOfPurchase(sl.Handle, ref pkeyId); + SLUninstallProofOfPurchase(sl.Handle, ref pkeyId); } } @@ -4254,6 +4019,390 @@ namespace LibTSforge.SPP } +// SPP/SPPUtils.cs +namespace LibTSforge.SPP +{ + using Microsoft.Win32; + using System; + using System.IO; + using System.Linq; + using System.ServiceProcess; + using Crypto; + using PhysicalStore; + using TokenStore; + + public static class SPPUtils + { + public static void KillSPP(PSVersion version) + { + ServiceController sc; + + string svcName = version == PSVersion.Vista ? "slsvc" : "sppsvc"; + + try + { + sc = new ServiceController(svcName); + + if (sc.Status == ServiceControllerStatus.Stopped) + return; + } + catch (InvalidOperationException ex) + { + throw new InvalidOperationException(string.Format("Unable to access {0}: ", svcName) + ex.Message); + } + + Logger.WriteLine(string.Format("Stopping {0}...", svcName)); + + bool stopped = false; + + for (int i = 0; stopped == false && i < 1080; i++) + { + try + { + if (sc.Status != ServiceControllerStatus.StopPending) + sc.Stop(); + + sc.WaitForStatus(ServiceControllerStatus.Stopped, TimeSpan.FromMilliseconds(500)); + } + catch (System.ServiceProcess.TimeoutException) + { + continue; + } + catch (InvalidOperationException ex) + { + Logger.WriteLine("Warning: Stopping sppsvc failed, retrying. Details: " + ex.Message); + System.Threading.Thread.Sleep(500); + continue; + } + + stopped = true; + } + + if (!stopped) + throw new System.TimeoutException(string.Format("Failed to stop {0}", svcName)); + + Logger.WriteLine(string.Format("{0} stopped successfully.", svcName)); + + if (version == PSVersion.Vista && SPSys.IsSpSysRunning()) + { + Logger.WriteLine("Unloading spsys..."); + + int status = SPSys.ControlSpSys(false); + + if (status < 0) + { + throw new IOException("Failed to unload spsys"); + } + + Logger.WriteLine("spsys unloaded successfully."); + } + } + + public static void RestartSPP(PSVersion version) + { + if (version == PSVersion.Vista) + { + ServiceController sc; + + try + { + sc = new ServiceController("slsvc"); + + if (sc.Status == ServiceControllerStatus.Running) + return; + } + catch (InvalidOperationException ex) + { + throw new InvalidOperationException("Unable to access slsvc: " + ex.Message); + } + + Logger.WriteLine("Starting slsvc..."); + + bool started = false; + + for (int i = 0; started == false && i < 360; i++) + { + try + { + if (sc.Status != ServiceControllerStatus.StartPending) + sc.Start(); + + sc.WaitForStatus(ServiceControllerStatus.Running, TimeSpan.FromMilliseconds(500)); + } + catch (System.ServiceProcess.TimeoutException) + { + continue; + } + catch (InvalidOperationException ex) + { + Logger.WriteLine("Warning: Starting slsvc failed, retrying. Details: " + ex.Message); + System.Threading.Thread.Sleep(500); + continue; + } + + started = true; + } + + if (!started) + throw new System.TimeoutException("Failed to start slsvc"); + + Logger.WriteLine("slsvc started successfully."); + } + + SLApi.RefreshLicenseStatus(); + } + + public static bool DetectCurrentKey() + { + SLApi.RefreshLicenseStatus(); + + using (RegistryKey wpaKey = Registry.LocalMachine.OpenSubKey(@"SYSTEM\WPA")) + { + foreach (string subKey in wpaKey.GetSubKeyNames()) + { + if (subKey.StartsWith("8DEC0AF1")) + { + return subKey.Contains("P"); + } + } + } + + throw new FileNotFoundException("Failed to autodetect key type, specify physical store key with /prod or /test arguments."); + } + + public static string GetPSPath(PSVersion version) + { + switch (version) + { + case PSVersion.Vista: + case PSVersion.Win7: + return Directory.GetFiles( + Environment.GetFolderPath(Environment.SpecialFolder.System), + "7B296FB0-376B-497e-B012-9C450E1B7327-*.C7483456-A289-439d-8115-601632D005A0") + .FirstOrDefault() ?? ""; + default: + string psDir = Environment.ExpandEnvironmentVariables( + (string)Registry.GetValue( + @"HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\SoftwareProtectionPlatform", + "TokenStore", + "" + ) + ); + string psPath = Path.Combine(psDir, "data.dat"); + + if (string.IsNullOrEmpty(psDir) || !File.Exists(psPath)) + { + string[] psDirs = + { + @"spp\store", + @"spp\store\2.0", + @"spp\store_test", + @"spp\store_test\2.0" + }; + + foreach (string dir in psDirs) + { + psPath = Path.Combine( + Path.Combine( + Environment.GetFolderPath(Environment.SpecialFolder.System), + dir + ), + "data.dat" + ); + + if (File.Exists(psPath)) return psPath; + } + } + else + { + return psPath; + } + + throw new FileNotFoundException("Failed to locate physical store."); + } + } + + public static string GetTokensPath(PSVersion version) + { + switch (version) + { + case PSVersion.Vista: + return Path.Combine( + Environment.ExpandEnvironmentVariables("%WINDIR%"), + @"ServiceProfiles\NetworkService\AppData\Roaming\Microsoft\SoftwareLicensing\tokens.dat" + ); + case PSVersion.Win7: + return Path.Combine( + Environment.ExpandEnvironmentVariables("%WINDIR%"), + @"ServiceProfiles\NetworkService\AppData\Roaming\Microsoft\SoftwareProtectionPlatform\tokens.dat" + ); + default: + string tokDir = Environment.ExpandEnvironmentVariables( + (string)Registry.GetValue( + @"HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\SoftwareProtectionPlatform", + "TokenStore", + "" + ) + ); + string tokPath = Path.Combine(tokDir, "tokens.dat"); + + if (string.IsNullOrEmpty(tokDir) || !File.Exists(tokPath)) + { + string[] tokDirs = + { + @"spp\store", + @"spp\store\2.0", + @"spp\store_test", + @"spp\store_test\2.0" + }; + + foreach (string dir in tokDirs) + { + tokPath = Path.Combine( + Path.Combine( + Environment.GetFolderPath(Environment.SpecialFolder.System), + dir + ), + "tokens.dat" + ); + + if (File.Exists(tokPath)) return tokPath; + } + } + else + { + return tokPath; + } + + throw new FileNotFoundException("Failed to locate token store."); + } + } + + public static IPhysicalStore GetStore(PSVersion version, bool production) + { + string psPath = GetPSPath(version); + + switch (version) + { + case PSVersion.Vista: + return new PhysicalStoreVista(psPath, production); + case PSVersion.Win7: + return new PhysicalStoreWin7(psPath, production); + default: + return new PhysicalStoreModern(psPath, production, version); + } + } + + public static ITokenStore GetTokenStore(PSVersion version) + { + string tokPath = GetTokensPath(version); + + return new TokenStoreModern(tokPath); + } + + public static void DumpStore(PSVersion version, bool production, string filePath, string encrFilePath) + { + bool manageSpp = false; + + if (encrFilePath == null) + { + encrFilePath = GetPSPath(version); + manageSpp = true; + KillSPP(version); + } + + if (string.IsNullOrEmpty(encrFilePath) || !File.Exists(encrFilePath)) + { + throw new FileNotFoundException("Store does not exist at expected path '" + encrFilePath + "'."); + } + + try + { + using (FileStream fs = File.Open(encrFilePath, FileMode.Open, FileAccess.Read, FileShare.Read)) + { + byte[] encrData = fs.ReadAllBytes(); + File.WriteAllBytes(filePath, PhysStoreCrypto.DecryptPhysicalStore(encrData, production, version)); + } + Logger.WriteLine("Store dumped successfully to '" + filePath + "'."); + } + finally + { + if (manageSpp) + { + RestartSPP(version); + } + } + } + + public static void LoadStore(PSVersion version, bool production, string filePath) + { + if (string.IsNullOrEmpty(filePath) || !File.Exists(filePath)) + { + throw new FileNotFoundException("Store file '" + filePath + "' does not exist."); + } + + KillSPP(version); + + using (IPhysicalStore store = GetStore(version, production)) + { + store.WriteRaw(File.ReadAllBytes(filePath)); + } + + RestartSPP(version); + + Logger.WriteLine("Loaded store file successfully."); + } + } +} + + +// SPP/SPSys.cs +namespace LibTSforge.SPP +{ + using Microsoft.Win32.SafeHandles; + using System; + using System.Runtime.InteropServices; + + public class SPSys + { + [DllImport("kernel32.dll", CharSet = CharSet.Auto, SetLastError = true)] + private static extern IntPtr CreateFile(string lpFileName, uint dwDesiredAccess, uint dwShareMode, IntPtr lpSecurityAttributes, uint dwCreationDisposition, uint dwFlagsAndAttributes, IntPtr hTemplateFile); + private static SafeFileHandle CreateFileSafe(string device) + { + return new SafeFileHandle(CreateFile(device, 0xC0000000, 0, IntPtr.Zero, 3, 0, IntPtr.Zero), true); + } + + [return: MarshalAs(UnmanagedType.Bool)] + [DllImport("kernel32.dll", CharSet = CharSet.Auto, SetLastError = true)] + private static extern bool DeviceIoControl([In] SafeFileHandle hDevice, [In] uint dwIoControlCode, [In] IntPtr lpInBuffer, [In] int nInBufferSize, [Out] IntPtr lpOutBuffer, [In] int nOutBufferSize, out int lpBytesReturned, [In] IntPtr lpOverlapped); + + public static bool IsSpSysRunning() + { + SafeFileHandle file = CreateFileSafe(@"\\.\SpDevice"); + IntPtr buffer = Marshal.AllocHGlobal(1); + int bytesReturned; + DeviceIoControl(file, 0x80006008, IntPtr.Zero, 0, buffer, 1, out bytesReturned, IntPtr.Zero); + bool running = Marshal.ReadByte(buffer) != 0; + Marshal.FreeHGlobal(buffer); + file.Close(); + return running; + } + + public static int ControlSpSys(bool start) + { + SafeFileHandle file = CreateFileSafe(@"\\.\SpDevice"); + IntPtr buffer = Marshal.AllocHGlobal(4); + int bytesReturned; + DeviceIoControl(file, start ? 0x8000a000 : 0x8000a004, IntPtr.Zero, 0, buffer, 4, out bytesReturned, IntPtr.Zero); + int result = Marshal.ReadInt32(buffer); + Marshal.FreeHGlobal(buffer); + file.Close(); + return result; + } + } +} + + // Crypto/CryptoUtils.cs namespace LibTSforge.Crypto { @@ -4363,10 +4512,21 @@ namespace LibTSforge.Crypto public static bool HMACVerify(byte[] key, byte[] data, byte[] signature) { - HMACSHA1 hmac = new HMACSHA1(key); return Enumerable.SequenceEqual(signature, HMACSign(key, data)); } + public static byte[] SaltSHASum(byte[] salt, byte[] data) + { + SHA1 sha1 = SHA1.Create(); + byte[] sha_data = salt.Concat(data).ToArray(); + return sha1.ComputeHash(sha_data); + } + + public static bool SaltSHAVerify(byte[] salt, byte[] data, byte[] checksum) + { + return Enumerable.SequenceEqual(checksum, SaltSHASum(salt, data)); + } + public static byte[] SHA256Hash(byte[] data) { using (SHA256 sha256 = SHA256.Create()) @@ -4479,7 +4639,7 @@ namespace LibTSforge.Crypto public static class PhysStoreCrypto { - public static byte[] DecryptPhysicalStore(byte[] data, bool production) + public static byte[] DecryptPhysicalStore(byte[] data, bool production, PSVersion version) { byte[] rsaKey = production ? Keys.PRODUCTION : Keys.TEST; BinaryReader br = new BinaryReader(new MemoryStream(data)); @@ -4487,29 +4647,40 @@ namespace LibTSforge.Crypto byte[] aesKeySig = br.ReadBytes(0x80); byte[] encAesKey = br.ReadBytes(0x80); - if (CryptoUtils.RSAVerifySignature(rsaKey, encAesKey, aesKeySig)) + if (!CryptoUtils.RSAVerifySignature(rsaKey, encAesKey, aesKeySig)) { - byte[] aesKey = CryptoUtils.RSADecrypt(rsaKey, encAesKey); - byte[] decData = CryptoUtils.AESDecrypt(br.ReadBytes((int)br.BaseStream.Length - 0x110), aesKey); - byte[] hmacKey = decData.Take(0x10).ToArray(); - byte[] hmacSig = decData.Skip(0x10).Take(0x14).ToArray(); - byte[] psData = decData.Skip(0x28).ToArray(); - - if (!CryptoUtils.HMACVerify(hmacKey, psData, hmacSig)) - { - Logger.WriteLine("Warning: Failed to verify HMAC. Physical store is either corrupt or in Vista format."); - } - - return psData; + throw new Exception("Failed to decrypt physical store."); } - throw new Exception("Failed to decrypt physical store."); + byte[] aesKey = CryptoUtils.RSADecrypt(rsaKey, encAesKey); + byte[] decData = CryptoUtils.AESDecrypt(br.ReadBytes((int)br.BaseStream.Length - 0x110), aesKey); + byte[] hmacKey = decData.Take(0x10).ToArray(); // SHA-1 salt on Vista + byte[] hmacSig = decData.Skip(0x10).Take(0x14).ToArray(); // SHA-1 hash on Vista + byte[] psData = decData.Skip(0x28).ToArray(); + + if (version != PSVersion.Vista) + { + if (!CryptoUtils.HMACVerify(hmacKey, psData, hmacSig)) + { + throw new InvalidDataException("Failed to verify HMAC. Physical store is corrupt."); + } + } + else + { + if (!CryptoUtils.SaltSHAVerify(hmacKey, psData, hmacSig)) + { + throw new InvalidDataException("Failed to verify checksum. Physical store is corrupt."); + } + } + + return psData; } public static byte[] EncryptPhysicalStore(byte[] data, bool production, PSVersion version) { Dictionary versionTable = new Dictionary { + {PSVersion.Vista, 2}, {PSVersion.Win7, 5}, {PSVersion.Win8, 1}, {PSVersion.WinBlue, 2}, @@ -4523,9 +4694,9 @@ namespace LibTSforge.Crypto byte[] encAesKey = CryptoUtils.RSAEncrypt(rsaKey, aesKey); byte[] aesKeySig = CryptoUtils.RSASign(rsaKey, encAesKey); - byte[] hmacSig = CryptoUtils.HMACSign(hmacKey, data); + byte[] hmacSig = version != PSVersion.Vista ? CryptoUtils.HMACSign(hmacKey, data) : CryptoUtils.SaltSHASum(hmacKey, data); - byte[] decData = new byte[] { }; + byte[] decData = { }; decData = decData.Concat(hmacKey).Concat(hmacSig).Concat(BitConverter.GetBytes(0)).Concat(data).ToArray(); byte[] encData = CryptoUtils.AESEncrypt(decData, aesKey); @@ -4548,9 +4719,9 @@ namespace LibTSforge.Modifiers using System; using System.IO; using Microsoft.Win32; - using LibTSforge.PhysicalStore; - using LibTSforge.SPP; - using LibTSforge.TokenStore; + using PhysicalStore; + using SPP; + using TokenStore; public static class GenPKeyInstall { @@ -4576,6 +4747,7 @@ namespace LibTSforge.Modifiers public static void InstallGenPKey(PSVersion version, bool production, Guid actId) { + if (version == PSVersion.Vista) throw new NotSupportedException("This feature is not supported on Windows Vista/Server 2008."); if (actId == Guid.Empty) throw new ArgumentException("Activation ID must be specified for generated product key install."); PKeyConfig pkc = new PKeyConfig(); @@ -4602,7 +4774,7 @@ namespace LibTSforge.Modifiers if (pkey.Algorithm == PKeyAlgorithm.PKEY2009) { uint status = SLApi.InstallProductKey(pkey); - Logger.WriteLine(string.Format("Installing generated product key {0} status {1:X}", pkey.ToString(), status)); + Logger.WriteLine(string.Format("Installing generated product key {0} status {1:X}", pkey, status)); if ((int)status < 0) { @@ -4617,57 +4789,57 @@ namespace LibTSforge.Modifiers if (pkey.Channel == "Volume:GVLK" && version == PSVersion.Win7) throw new NotSupportedException("Fake GVLK generation is not supported on Windows 7."); - VariableBag pkb = new VariableBag(); - pkb.Blocks.AddRange(new CRCBlock[] + VariableBag pkb = new VariableBag(version); + pkb.Blocks.AddRange(new[] { - new CRCBlock + new CRCBlockModern { DataType = CRCBlockType.STRING, KeyAsStr = "SppPkeyBindingProductKey", ValueAsStr = pkey.ToString() }, - new CRCBlock + new CRCBlockModern { DataType = CRCBlockType.STRING, KeyAsStr = "SppPkeyBindingMPC", ValueAsStr = pkey.GetMPC() }, - new CRCBlock { + new CRCBlockModern { DataType = CRCBlockType.BINARY, KeyAsStr = "SppPkeyBindingPid2", ValueAsStr = pkey.GetPid2() }, - new CRCBlock + new CRCBlockModern { DataType = CRCBlockType.BINARY, KeyAsStr = "SppPkeyBindingPid3", Value = pkey.GetPid3() }, - new CRCBlock + new CRCBlockModern { DataType = CRCBlockType.BINARY, KeyAsStr = "SppPkeyBindingPid4", Value = pkey.GetPid4() }, - new CRCBlock + new CRCBlockModern { DataType = CRCBlockType.STRING, KeyAsStr = "SppPkeyChannelId", ValueAsStr = pkey.Channel }, - new CRCBlock + new CRCBlockModern { DataType = CRCBlockType.STRING, KeyAsStr = "SppPkeyBindingEditionId", ValueAsStr = pkey.Edition }, - new CRCBlock + new CRCBlockModern { DataType = CRCBlockType.BINARY, KeyAsStr = (version == PSVersion.Win7) ? "SppPkeyShortAuthenticator" : "SppPkeyPhoneActivationData", Value = pkey.GetPhoneData(version) }, - new CRCBlock + new CRCBlockModern { DataType = CRCBlockType.BINARY, KeyAsStr = "SppPkeyBindingMiscData", @@ -4685,11 +4857,11 @@ namespace LibTSforge.Modifiers SLApi.UninstallAllProductKeys(appId); } - Utils.KillSPP(); + SPPUtils.KillSPP(version); - using (IPhysicalStore ps = Utils.GetStore(version, production)) + using (IPhysicalStore ps = SPPUtils.GetStore(version, production)) { - using (ITokenStore tks = Utils.GetTokenStore(version)) + using (ITokenStore tks = SPPUtils.GetTokenStore(version)) { Logger.WriteLine("Writing to physical store and token store..."); @@ -4713,7 +4885,7 @@ namespace LibTSforge.Modifiers uriMap.Data[pkeyId] = pkey.GetAlgoUri(); tks.SetEntry(uriMapName, "xml", uriMap.Serialize()); - string skuMetaName = actId.ToString() + metSuffix; + string skuMetaName = actId + metSuffix; TokenMeta skuMeta = tks.GetMetaEntry(skuMetaName); foreach (string k in skuMeta.Data.Keys) @@ -4740,7 +4912,7 @@ namespace LibTSforge.Modifiers Data = pkb.Serialize() }); - string cachePath = Utils.GetTokensPath(version).Replace("tokens.dat", @"cache\cache.dat"); + string cachePath = SPPUtils.GetTokensPath(version).Replace("tokens.dat", @"cache\cache.dat"); if (File.Exists(cachePath)) File.Delete(cachePath); } } @@ -4755,19 +4927,19 @@ namespace LibTSforge.Modifiers // Modifiers/GracePeriodReset.cs namespace LibTSforge.Modifiers { - using System; using System.Collections.Generic; using System.Linq; - using LibTSforge.PhysicalStore; + using PhysicalStore; + using SPP; public static class GracePeriodReset { public static void Reset(PSVersion version, bool production) { - Utils.KillSPP(); + SPPUtils.KillSPP(version); Logger.WriteLine("Writing TrustedStore data..."); - using (IPhysicalStore store = Utils.GetStore(version, production)) + using (IPhysicalStore store = SPPUtils.GetStore(version, production)) { string value = "msft:sl/timer"; List blocks = store.FindBlocks(value).ToList(); @@ -4778,6 +4950,7 @@ namespace LibTSforge.Modifiers } } + SPPUtils.RestartSPP(version); Logger.WriteLine("Successfully reset all grace and evaluation period timers."); } } @@ -4789,15 +4962,19 @@ namespace LibTSforge.Modifiers { using System.Collections.Generic; using System.Linq; - using LibTSforge.PhysicalStore; - using LibTSforge; + using PhysicalStore; + using SPP; + using System; + public static class KeyChangeLockDelete { public static void Delete(PSVersion version, bool production) { - Utils.KillSPP(); + if (version == PSVersion.Vista) throw new NotSupportedException("This feature is not supported on Windows Vista/Server 2008."); + + SPPUtils.KillSPP(version); Logger.WriteLine("Writing TrustedStore data..."); - using (IPhysicalStore store = Utils.GetStore(version, production)) + using (IPhysicalStore store = SPPUtils.GetStore(version, production)) { List values = new List { @@ -4825,12 +5002,12 @@ namespace LibTSforge.Modifiers { using System; using System.IO; - using LibTSforge.PhysicalStore; - using LibTSforge.SPP; + using PhysicalStore; + using SPP; public static class KMSHostCharge { - public static void Charge(PSVersion version, Guid actId, bool production) + public static void Charge(PSVersion version, bool production, Guid actId) { if (actId == Guid.Empty) { @@ -4854,76 +5031,113 @@ namespace LibTSforge.Modifiers string key = string.Format("SPPSVC\\{0}", appId); long ldapTimestamp = DateTime.Now.ToFileTime(); + byte[] cmidGuids = { }; + byte[] reqCounts = { }; + byte[] kmsChargeData = { }; + BinaryWriter writer = new BinaryWriter(new MemoryStream()); - for (int i = 0; i < currClients; i++) + if (version == PSVersion.Vista) { - writer.Write(ldapTimestamp - (10 * (i + 1))); - writer.Write(Guid.NewGuid().ToByteArray()); + writer.Write(new byte[44]); + writer.Seek(0, SeekOrigin.Begin); + + writer.Write(totalClients); + writer.Write(43200); + writer.Write(32); + + writer.Seek(20, SeekOrigin.Begin); + writer.Write((byte)currClients); + + writer.Seek(32, SeekOrigin.Begin); + writer.Write((byte)currClients); + + writer.Seek(0, SeekOrigin.End); + + for (int i = 0; i < currClients; i++) + { + writer.Write(Guid.NewGuid().ToByteArray()); + writer.Write(ldapTimestamp - (10 * (i + 1))); + } + + kmsChargeData = writer.GetBytes(); + } + else + { + for (int i = 0; i < currClients; i++) + { + writer.Write(ldapTimestamp - (10 * (i + 1))); + writer.Write(Guid.NewGuid().ToByteArray()); + } + + cmidGuids = writer.GetBytes(); + + writer = new BinaryWriter(new MemoryStream()); + + writer.Write(new byte[40]); + + writer.Seek(4, SeekOrigin.Begin); + writer.Write((byte)currClients); + + writer.Seek(24, SeekOrigin.Begin); + writer.Write((byte)currClients); + + reqCounts = writer.GetBytes(); } - byte[] cmidGuids = writer.GetBytes(); - - writer = new BinaryWriter(new MemoryStream()); - - writer.Write(new byte[40]); - - writer.Seek(4, SeekOrigin.Begin); - writer.Write((byte)currClients); - - writer.Seek(24, SeekOrigin.Begin); - writer.Write((byte)currClients); - byte[] reqCounts = writer.GetBytes(); - - Utils.KillSPP(); + SPPUtils.KillSPP(version); Logger.WriteLine("Writing TrustedStore data..."); - using (IPhysicalStore store = Utils.GetStore(version, production)) + using (IPhysicalStore store = SPPUtils.GetStore(version, production)) { - VariableBag kmsCountData = new VariableBag(); - kmsCountData.Blocks.AddRange(new CRCBlock[] + if (version != PSVersion.Vista) { - new CRCBlock + VariableBag kmsCountData = new VariableBag(version); + kmsCountData.Blocks.AddRange(new[] { - DataType = CRCBlockType.BINARY, - KeyAsStr = "SppBindingLicenseData", - Value = hwidBlock - }, - new CRCBlock - { - DataType = CRCBlockType.UINT, - Key = new byte[] { }, - ValueAsInt = (uint)totalClients - }, - new CRCBlock - { - DataType = CRCBlockType.UINT, - Key = new byte[] { }, - ValueAsInt = 1051200000 - }, - new CRCBlock - { - DataType = CRCBlockType.UINT, - Key = new byte[] { }, - ValueAsInt = (uint)currClients - }, - new CRCBlock - { - DataType = CRCBlockType.BINARY, - Key = new byte[] { }, - Value = cmidGuids - }, - new CRCBlock - { - DataType = CRCBlockType.BINARY, - Key = new byte[] { }, - Value = reqCounts - } - }); + new CRCBlockModern + { + DataType = CRCBlockType.BINARY, + KeyAsStr = "SppBindingLicenseData", + Value = hwidBlock + }, + new CRCBlockModern + { + DataType = CRCBlockType.UINT, + Key = new byte[] { }, + ValueAsInt = (uint)totalClients + }, + new CRCBlockModern + { + DataType = CRCBlockType.UINT, + Key = new byte[] { }, + ValueAsInt = 1051200000 + }, + new CRCBlockModern + { + DataType = CRCBlockType.UINT, + Key = new byte[] { }, + ValueAsInt = (uint)currClients + }, + new CRCBlockModern + { + DataType = CRCBlockType.BINARY, + Key = new byte[] { }, + Value = cmidGuids + }, + new CRCBlockModern + { + DataType = CRCBlockType.BINARY, + Key = new byte[] { }, + Value = reqCounts + } + }); - byte[] kmsChargeData = kmsCountData.Serialize(); - string countVal = string.Format("msft:spp/kms/host/2.0/store/counters/{0}", appId); + kmsChargeData = kmsCountData.Serialize(); + } + + string countVal = version == PSVersion.Vista ? "C8F6FFF1-79CE-404C-B150-F97991273DF1" : string.Format("msft:spp/kms/host/2.0/store/counters/{0}", appId); store.DeleteBlock(key, countVal); store.AddBlock(new PSBlock @@ -4937,6 +5151,8 @@ namespace LibTSforge.Modifiers Logger.WriteLine(string.Format("Set charge count to {0} successfully.", currClients)); } + + SPPUtils.RestartSPP(version); } } } @@ -4945,24 +5161,28 @@ namespace LibTSforge.Modifiers // Modifiers/RearmReset.cs namespace LibTSforge.Modifiers { - using System; using System.Collections.Generic; using System.Linq; - using LibTSforge.PhysicalStore; + using PhysicalStore; + using SPP; public static class RearmReset { public static void Reset(PSVersion version, bool production) { - Utils.KillSPP(); + SPPUtils.KillSPP(version); Logger.WriteLine("Writing TrustedStore data..."); - using (IPhysicalStore store = Utils.GetStore(version, production)) + using (IPhysicalStore store = SPPUtils.GetStore(version, production)) { List blocks; - if (version == PSVersion.Win7) + if (version == PSVersion.Vista) + { + blocks = store.FindBlocks("740D70D8-6448-4b2f-9063-4A7A463600C5").ToList(); + } + else if (version == PSVersion.Win7) { blocks = store.FindBlocks(0xA0000).ToList(); } @@ -4973,7 +5193,11 @@ namespace LibTSforge.Modifiers foreach (PSBlock block in blocks) { - if (version == PSVersion.Win7) + if (version == PSVersion.Vista) + { + store.DeleteBlock(block.KeyAsStr, block.ValueAsStr); + } + else if (version == PSVersion.Win7) { store.SetBlock(block.KeyAsStr, block.ValueAsInt, new byte[8]); } @@ -4990,38 +5214,110 @@ namespace LibTSforge.Modifiers } +// Modifiers/SetIIDParams.cs +namespace LibTSforge.Modifiers +{ + using PhysicalStore; + using SPP; + using System.IO; + using System; + + public static class SetIIDParams + { + public static void SetParams(PSVersion version, bool production, Guid actId, PKeyAlgorithm algorithm, int group, int serial, ulong security) + { + if (version == PSVersion.Vista) throw new NotSupportedException("This feature is not supported on Windows Vista/Server 2008."); + + Guid appId; + + if (actId == Guid.Empty) + { + appId = SLApi.WINDOWS_APP_ID; + actId = SLApi.GetDefaultActivationID(appId, true); + + if (actId == Guid.Empty) + { + throw new Exception("No applicable activation IDs found."); + } + } + else + { + appId = SLApi.GetAppId(actId); + } + + Guid pkeyId = SLApi.GetInstalledPkeyID(actId); + + SPPUtils.KillSPP(version); + + Logger.WriteLine("Writing TrustedStore data..."); + + using (IPhysicalStore store = SPPUtils.GetStore(version, production)) + { + string key = string.Format("SPPSVC\\{0}\\{1}", appId, actId); + PSBlock keyBlock = store.GetBlock(key, pkeyId.ToString()); + + if (keyBlock == null) + { + throw new InvalidDataException("Failed to get product key data for activation ID " + actId + "."); + } + + VariableBag pkb = new VariableBag(keyBlock.Data, version); + + ProductKey pkey = new ProductKey + { + Group = group, + Serial = serial, + Security = security, + Algorithm = algorithm, + Upgrade = false + }; + + string blockName = version == PSVersion.Win7 ? "SppPkeyShortAuthenticator" : "SppPkeyPhoneActivationData"; + pkb.SetBlock(blockName, pkey.GetPhoneData(version)); + store.SetBlock(key, pkeyId.ToString(), pkb.Serialize()); + } + + Logger.WriteLine("Successfully set IID parameters."); + } + } +} + + // Modifiers/TamperedFlagsDelete.cs namespace LibTSforge.Modifiers { - using System; using System.Linq; - using LibTSforge.PhysicalStore; + using PhysicalStore; + using SPP; public static class TamperedFlagsDelete { public static void DeleteTamperFlags(PSVersion version, bool production) { - Utils.KillSPP(); + SPPUtils.KillSPP(version); Logger.WriteLine("Writing TrustedStore data..."); - using (IPhysicalStore store = Utils.GetStore(version, production)) + using (IPhysicalStore store = SPPUtils.GetStore(version, production)) { - if (version != PSVersion.Win7) + if (version == PSVersion.Vista) { - string recreatedFlag = "__##USERSEP-RESERVED##__$$RECREATED-FLAG$$"; - string recoveredFlag = "__##USERSEP-RESERVED##__$$RECOVERED-FLAG$$"; - - DeleteFlag(store, recreatedFlag); - DeleteFlag(store, recoveredFlag); + DeleteFlag(store, "6BE8425B-E3CF-4e86-A6AF-5863E3DCB606"); + } + else if (version == PSVersion.Win7) + { + SetFlag(store, 0xA0001); } else { - SetFlag(store, 0xA0001); + DeleteFlag(store, "__##USERSEP-RESERVED##__$$RECREATED-FLAG$$"); + DeleteFlag(store, "__##USERSEP-RESERVED##__$$RECOVERED-FLAG$$"); } Logger.WriteLine("Successfully cleared the tamper state."); } + + SPPUtils.RestartSPP(version); } private static void DeleteFlag(IPhysicalStore store, string flag) @@ -5041,13 +5337,15 @@ namespace LibTSforge.Modifiers namespace LibTSforge.Modifiers { using System; - using LibTSforge.PhysicalStore; - using LibTSforge.SPP; + using PhysicalStore; + using SPP; public static class UniqueIdDelete { public static void DeleteUniqueId(PSVersion version, bool production, Guid actId) { + if (version == PSVersion.Vista) throw new NotSupportedException("This feature is not supported on Windows Vista/Server 2008."); + Guid appId; if (actId == Guid.Empty) @@ -5065,14 +5363,13 @@ namespace LibTSforge.Modifiers appId = SLApi.GetAppId(actId); } - string instId = SLApi.GetInstallationID(actId); Guid pkeyId = SLApi.GetInstalledPkeyID(actId); - Utils.KillSPP(); + SPPUtils.KillSPP(version); Logger.WriteLine("Writing TrustedStore data..."); - using (IPhysicalStore store = Utils.GetStore(version, production)) + using (IPhysicalStore store = SPPUtils.GetStore(version, production)) { string key = string.Format("SPPSVC\\{0}\\{1}", appId, actId); PSBlock keyBlock = store.GetBlock(key, pkeyId.ToString()); @@ -5082,7 +5379,7 @@ namespace LibTSforge.Modifiers throw new Exception("No product key found."); } - VariableBag pkb = new VariableBag(keyBlock.Data); + VariableBag pkb = new VariableBag(keyBlock.Data, version); pkb.DeleteBlock("SppPkeyUniqueIdToken"); @@ -5095,18 +5392,143 @@ namespace LibTSforge.Modifiers } +// Activators/AVMA4K.cs +namespace LibTSforge.Activators +{ + using System; + using PhysicalStore; + using SPP; + + public static class AVMA4k + { + public static void Activate(PSVersion version, bool production, Guid actId) + { + if (version != PSVersion.WinModern && version != PSVersion.WinBlue) + { + throw new NotSupportedException("AVMA licenses are not available for this product."); + } + + Guid appId; + if (actId == Guid.Empty) + { + appId = SLApi.WINDOWS_APP_ID; + actId = SLApi.GetDefaultActivationID(appId, false); + + if (actId == Guid.Empty) + { + throw new NotSupportedException("No applicable activation IDs found."); + } + } + else + { + appId = SLApi.GetAppId(actId); + } + + if (SLApi.GetPKeyChannel(SLApi.GetInstalledPkeyID(actId)) != "VT:IA") + { + throw new NotSupportedException("Non-VT:IA product key installed."); + } + + SPPUtils.KillSPP(version); + + Logger.WriteLine("Writing TrustedStore data..."); + + using (IPhysicalStore store = SPPUtils.GetStore(version, production)) + { + string key = string.Format("SPPSVC\\{0}\\{1}", appId, actId); + + long creationTime = BitConverter.ToInt64(store.GetBlock("__##USERSEP##\\$$_RESERVED_$$\\NAMESPACE__", "__##USERSEP-RESERVED##__$$GLOBAL-CREATION-TIME$$").Data, 0); + long tickCount = BitConverter.ToInt64(store.GetBlock("__##USERSEP##\\$$_RESERVED_$$\\NAMESPACE__", "__##USERSEP-RESERVED##__$$GLOBAL-TICKCOUNT-UPTIME$$").Data, 0); + long deltaTime = BitConverter.ToInt64(store.GetBlock(key, "__##USERSEP-RESERVED##__$$UP-TIME-DELTA$$").Data, 0); + + const ulong unknown = 0; + ulong time1 = (ulong)(creationTime + tickCount + deltaTime); + ulong crcBindTime = (ulong)DateTime.UtcNow.ToFileTime(); + ulong timerTime = crcBindTime / 10000; + ulong expiry = Constants.TimerMax / 10000; + + VariableBag avmaBinding = new VariableBag(version); + + avmaBinding.Blocks.AddRange(new[] + { + new CRCBlockModern + { + DataType = CRCBlockType.BINARY, + Key = new byte[] { }, + Value = BitConverter.GetBytes(crcBindTime), + }, + new CRCBlockModern + { + DataType = CRCBlockType.STRING, + Key = new byte[] { }, + ValueAsStr = "AVMA4K", + }, + new CRCBlockModern + { + DataType = CRCBlockType.STRING, + Key = new byte[] { }, + ValueAsStr = "00491-50000-00001-AA666", + } + }); + + byte[] avmaBindingData = avmaBinding.Serialize(); + + Timer avmaTimer = new Timer + { + Unknown = unknown, + Time1 = time1, + Time2 = timerTime, + Expiry = expiry + }; + + string storeVal = string.Format("msft:spp/ia/bind/1.0/store/{0}/{1}", appId, actId); + string timerVal = string.Format("msft:spp/ia/bind/1.0/timer/{0}/{1}", appId, actId); + + store.DeleteBlock(key, storeVal); + store.DeleteBlock(key, timerVal); + + store.AddBlocks(new[] + { + new PSBlock + { + Type = BlockType.NAMED, + Flags = 0x400, + KeyAsStr = key, + ValueAsStr = storeVal, + Data = avmaBindingData, + }, + new PSBlock + { + Type = BlockType.TIMER, + Flags = 0x4, + KeyAsStr = key, + ValueAsStr = timerVal, + Data = avmaTimer.CastToArray() + } + }); + } + + SLApi.RefreshLicenseStatus(); + SLApi.FireStateChangedEvent(appId); + Logger.WriteLine("Activated using AVMA4k successfully."); + } + } +} + + // Activators/ZeroCID.cs namespace LibTSforge.Activators { using System; using System.IO; - using LibTSforge.Crypto; - using LibTSforge.PhysicalStore; - using LibTSforge.SPP; + using System.Linq; + using Crypto; + using PhysicalStore; + using SPP; public static class ZeroCID { - public static void Deposit(Guid actId, string instId) + private static void Deposit(Guid actId, string instId) { uint status = SLApi.DepositConfirmationID(actId, instId, Constants.ZeroCID); Logger.WriteLine(string.Format("Depositing fake CID status {0:X}", status)); @@ -5144,16 +5566,16 @@ namespace LibTSforge.Activators string instId = SLApi.GetInstallationID(actId); Guid pkeyId = SLApi.GetInstalledPkeyID(actId); - if (version == PSVersion.Win7) + if (version == PSVersion.Vista || version == PSVersion.Win7) { Deposit(actId, instId); } - Utils.KillSPP(); + SPPUtils.KillSPP(version); Logger.WriteLine("Writing TrustedStore data..."); - using (IPhysicalStore store = Utils.GetStore(version, production)) + using (IPhysicalStore store = SPPUtils.GetStore(version, production)) { byte[] hwidBlock = Constants.UniversalHWIDBlock; @@ -5163,7 +5585,11 @@ namespace LibTSforge.Activators byte[] iidHash; - if (version == PSVersion.Win7) + if (version == PSVersion.Vista) + { + iidHash = CryptoUtils.SHA256Hash(Utils.EncodeString(instId)).Take(0x10).ToArray(); + } + else if (version == PSVersion.Win7) { iidHash = CryptoUtils.SHA256Hash(Utils.EncodeString(instId)); } @@ -5180,11 +5606,39 @@ namespace LibTSforge.Activators throw new InvalidDataException("Failed to get product key data for activation ID " + actId + "."); } - VariableBag pkb = new VariableBag(keyBlock.Data); + VariableBag pkb = new VariableBag(keyBlock.Data, version); byte[] pkeyData; - if (version == PSVersion.Win7) + if (version == PSVersion.Vista) + { + pkeyData = pkb.GetBlock("PKeyBasicInfo").Value; + string uniqueId = Utils.DecodeString(pkeyData.Skip(0x120).Take(0x80).ToArray()); + string extPid = Utils.DecodeString(pkeyData.Skip(0x1A0).Take(0x80).ToArray()); + + uint group; + uint.TryParse(extPid.Split('-')[1], out group); + + if (group == 0) + { + throw new FormatException("Extended PID has invalid format."); + } + + ulong shortauth; + + try + { + shortauth = BitConverter.ToUInt64(Convert.FromBase64String(uniqueId.Split('&')[1]), 0); + } + catch + { + throw new FormatException("Key Unique ID has invalid format."); + } + + shortauth |= (ulong)group << 41; + pkeyData = BitConverter.GetBytes(shortauth); + } + else if (version == PSVersion.Win7) { pkeyData = pkb.GetBlock("SppPkeyShortAuthenticator").Value; } @@ -5197,26 +5651,34 @@ namespace LibTSforge.Activators store.SetBlock(key, pkeyId.ToString(), pkb.Serialize()); BinaryWriter writer = new BinaryWriter(new MemoryStream()); - writer.Write(0x20); + writer.Write(iidHash.Length); writer.Write(iidHash); writer.Write(hwidBlock.Length); writer.Write(hwidBlock); byte[] tsHwidData = writer.GetBytes(); writer = new BinaryWriter(new MemoryStream()); - writer.Write(0x20); + writer.Write(iidHash.Length); writer.Write(iidHash); writer.Write(pkeyData.Length); writer.Write(pkeyData); byte[] tsPkeyInfoData = writer.GetBytes(); - store.AddBlocks(new PSBlock[] { + string phoneVersion = version == PSVersion.Vista ? "6.0" : "7.0"; + Guid indexSlid = version == PSVersion.Vista ? actId : pkeyId; + string hwidBlockName = string.Format("msft:Windows/{0}/Phone/Cached/HwidBlock/{1}", phoneVersion, indexSlid); + string pkeyInfoName = string.Format("msft:Windows/{0}/Phone/Cached/PKeyInfo/{1}", phoneVersion, indexSlid); + + store.DeleteBlock(key, hwidBlockName); + store.DeleteBlock(key, pkeyInfoName); + + store.AddBlocks(new[] { new PSBlock { Type = BlockType.NAMED, Flags = 0, KeyAsStr = key, - ValueAsStr = "msft:Windows/7.0/Phone/Cached/HwidBlock/" + pkeyId, + ValueAsStr = hwidBlockName, Data = tsHwidData }, new PSBlock @@ -5224,18 +5686,18 @@ namespace LibTSforge.Activators Type = BlockType.NAMED, Flags = 0, KeyAsStr = key, - ValueAsStr = "msft:Windows/7.0/Phone/Cached/PKeyInfo/" + pkeyId, + ValueAsStr = pkeyInfoName, Data = tsPkeyInfoData } }); } - if (version != PSVersion.Win7) + if (version != PSVersion.Vista && version != PSVersion.Win7) { Deposit(actId, instId); } - SLApi.RefreshLicenseStatus(); + SPPUtils.RestartSPP(version); SLApi.FireStateChangedEvent(appId); Logger.WriteLine("Activated using ZeroCID successfully."); } @@ -5260,7 +5722,7 @@ namespace LibTSforge.TokenStore public class TokenMeta { public string Name; - public Dictionary Data = new Dictionary(); + public readonly Dictionary Data = new Dictionary(); public byte[] Serialize() { @@ -5283,7 +5745,7 @@ namespace LibTSforge.TokenStore return writer.GetBytes(); } - public void Deserialize(byte[] data) + private void Deserialize(byte[] data) { BinaryReader reader = new BinaryReader(new MemoryStream(data)); reader.ReadInt32(); @@ -5340,7 +5802,7 @@ namespace LibTSforge.TokenStore using System.Collections.Generic; using System.IO; using System.Linq; - using LibTSforge.Crypto; + using Crypto; public class TokenStoreModern : ITokenStore { @@ -5354,29 +5816,29 @@ namespace LibTSforge.TokenStore private static readonly byte[] CONTS_FOOTER = Enumerable.Repeat((byte)0xAA, 0x20).ToArray(); private List Entries = new List(); - public FileStream TokensFile; + private readonly FileStream TokensFile; public void Deserialize() { if (TokensFile.Length < BLOCK_SIZE) return; TokensFile.Seek(0x24, SeekOrigin.Begin); - uint nextBlock = 0; + uint nextBlock; BinaryReader reader = new BinaryReader(TokensFile); do { - uint curOffset = reader.ReadUInt32(); + reader.ReadUInt32(); nextBlock = reader.ReadUInt32(); for (int i = 0; i < ENTRIES_PER_BLOCK; i++) { - curOffset = reader.ReadUInt32(); + uint curOffset = reader.ReadUInt32(); bool populated = reader.ReadUInt32() == 1; uint contentOffset = reader.ReadUInt32(); uint contentLength = reader.ReadUInt32(); uint allocLength = reader.ReadUInt32(); - byte[] contentData = new byte[] { }; + byte[] contentData = { }; if (populated) { @@ -5476,11 +5938,10 @@ namespace LibTSforge.TokenStore writer.WritePadding(BLOCK_PAD_SIZE); writer.BaseStream.Seek(curBlockOffset, SeekOrigin.Begin); - byte[] blockHash; byte[] blockData = new byte[BLOCK_SIZE - 0x20]; tokens.Read(blockData, 0, BLOCK_SIZE - 0x20); - blockHash = CryptoUtils.SHA256Hash(blockData); + byte[] blockHash = CryptoUtils.SHA256Hash(blockData); writer.BaseStream.Seek(curBlockOffset + BLOCK_SIZE - 0x20, SeekOrigin.Begin); writer.Write(blockHash); @@ -5611,11 +6072,6 @@ namespace LibTSforge.TokenStore Deserialize(); } - public TokenStoreModern() - { - - } - public void Dispose() { Serialize(); @@ -5646,6 +6102,13 @@ namespace LibTSforge.PhysicalStore public ulong Time2; public ulong Expiry; } + + [StructLayout(LayoutKind.Sequential, Pack = 1)] + public struct VistaTimer + { + public ulong Time; + public ulong Expiry; + } } @@ -5750,7 +6213,7 @@ namespace LibTSforge.PhysicalStore using System; using System.Collections.Generic; using System.IO; - using LibTSforge.Crypto; + using Crypto; public class ModernBlock { @@ -5840,7 +6303,7 @@ namespace LibTSforge.PhysicalStore public sealed class PhysicalStoreModern : IPhysicalStore { - private byte[] PreHeaderBytes = new byte[] { }; + private byte[] PreHeaderBytes = { }; private readonly Dictionary> Data = new Dictionary>(); private readonly FileStream TSFile; private readonly PSVersion Version; @@ -6028,46 +6491,50 @@ namespace LibTSforge.PhysicalStore public void DeleteBlock(string key, string value) { - if (Data.ContainsKey(key)) + if (!Data.ContainsKey(key)) { - List blocks = Data[key]; - - foreach (ModernBlock block in blocks) - { - if (block.ValueAsStr == value) - { - blocks.Remove(block); - break; - } - } - - Data[key] = blocks; + return; } + + List blocks = Data[key]; + + foreach (ModernBlock block in blocks) + { + if (block.ValueAsStr == value) + { + blocks.Remove(block); + break; + } + } + + Data[key] = blocks; } public void DeleteBlock(string key, uint value) { - if (Data.ContainsKey(key)) + if (!Data.ContainsKey(key)) { - List blocks = Data[key]; - - foreach (ModernBlock block in blocks) - { - if (block.ValueAsInt == value) - { - blocks.Remove(block); - break; - } - } - - Data[key] = blocks; + return; } + + List blocks = Data[key]; + + foreach (ModernBlock block in blocks) + { + if (block.ValueAsInt == value) + { + blocks.Remove(block); + break; + } + } + + Data[key] = blocks; } public PhysicalStoreModern(string tsPath, bool production, PSVersion version) { TSFile = File.Open(tsPath, FileMode.OpenOrCreate, FileAccess.ReadWrite, FileShare.None); - Deserialize(PhysStoreCrypto.DecryptPhysicalStore(TSFile.ReadAllBytes(), production)); + Deserialize(PhysStoreCrypto.DecryptPhysicalStore(TSFile.ReadAllBytes(), production, version)); TSFile.Seek(0, SeekOrigin.Begin); Version = version; Production = production; @@ -6087,7 +6554,7 @@ namespace LibTSforge.PhysicalStore public byte[] ReadRaw() { - byte[] data = PhysStoreCrypto.DecryptPhysicalStore(TSFile.ReadAllBytes(), Production); + byte[] data = PhysStoreCrypto.DecryptPhysicalStore(TSFile.ReadAllBytes(), Production, Version); TSFile.Seek(0, SeekOrigin.Begin); return data; } @@ -6158,13 +6625,372 @@ namespace LibTSforge.PhysicalStore } +// PhysicalStore/PhysicalStoreVista.cs +namespace LibTSforge.PhysicalStore +{ + using System; + using System.Collections.Generic; + using System.IO; + using Crypto; + + public class VistaBlock + { + public BlockType Type; + public uint Flags; + public byte[] Value; + public string ValueAsStr + { + get + { + return Utils.DecodeString(Value); + } + set + { + Value = Utils.EncodeString(value); + } + } + public uint ValueAsInt + { + get + { + return BitConverter.ToUInt32(Value, 0); + } + set + { + Value = BitConverter.GetBytes(value); + } + } + public byte[] Data; + public string DataAsStr + { + get + { + return Utils.DecodeString(Data); + } + set + { + Data = Utils.EncodeString(value); + } + } + public uint DataAsInt + { + get + { + return BitConverter.ToUInt32(Data, 0); + } + set + { + Data = BitConverter.GetBytes(value); + } + } + + internal void Encode(BinaryWriter writer) + { + writer.Write((uint)Type); + writer.Write(Flags); + writer.Write(Value.Length); + writer.Write(Data.Length); + writer.Write(Value); + writer.Write(Data); + } + + internal static VistaBlock Decode(BinaryReader reader) + { + uint type = reader.ReadUInt32(); + uint flags = reader.ReadUInt32(); + + int valueLen = reader.ReadInt32(); + int dataLen = reader.ReadInt32(); + + byte[] value = reader.ReadBytes(valueLen); + byte[] data = reader.ReadBytes(dataLen); + return new VistaBlock + { + Type = (BlockType)type, + Flags = flags, + Value = value, + Data = data, + }; + } + } + + public sealed class PhysicalStoreVista : IPhysicalStore + { + private byte[] PreHeaderBytes = { }; + private readonly List Blocks = new List(); + private readonly FileStream TSPrimary; + private readonly FileStream TSSecondary; + private readonly bool Production; + + public byte[] Serialize() + { + BinaryWriter writer = new BinaryWriter(new MemoryStream()); + writer.Write(PreHeaderBytes); + + foreach (VistaBlock block in Blocks) + { + block.Encode(writer); + writer.Align(4); + } + + return writer.GetBytes(); + } + + public void Deserialize(byte[] data) + { + int len = data.Length; + + BinaryReader reader = new BinaryReader(new MemoryStream(data)); + PreHeaderBytes = reader.ReadBytes(8); + + while (reader.BaseStream.Position < len - 0x14) + { + Blocks.Add(VistaBlock.Decode(reader)); + reader.Align(4); + } + } + + public void AddBlock(PSBlock block) + { + Blocks.Add(new VistaBlock + { + Type = block.Type, + Flags = block.Flags, + Value = block.Value, + Data = block.Data + }); + } + + public void AddBlocks(IEnumerable blocks) + { + foreach (PSBlock block in blocks) + { + AddBlock(block); + } + } + + public PSBlock GetBlock(string key, string value) + { + foreach (VistaBlock block in Blocks) + { + if (block.ValueAsStr == value) + { + return new PSBlock + { + Type = block.Type, + Flags = block.Flags, + Key = new byte[0], + Value = block.Value, + Data = block.Data + }; + } + } + + return null; + } + + public PSBlock GetBlock(string key, uint value) + { + foreach (VistaBlock block in Blocks) + { + if (block.ValueAsInt == value) + { + return new PSBlock + { + Type = block.Type, + Flags = block.Flags, + Key = new byte[0], + Value = block.Value, + Data = block.Data + }; + } + } + + return null; + } + + public void SetBlock(string key, string value, byte[] data) + { + for (int i = 0; i < Blocks.Count; i++) + { + VistaBlock block = Blocks[i]; + + if (block.ValueAsStr == value) + { + block.Data = data; + Blocks[i] = block; + break; + } + } + } + + public void SetBlock(string key, uint value, byte[] data) + { + for (int i = 0; i < Blocks.Count; i++) + { + VistaBlock block = Blocks[i]; + + if (block.ValueAsInt == value) + { + block.Data = data; + Blocks[i] = block; + break; + } + } + } + + public void SetBlock(string key, string value, string data) + { + SetBlock(key, value, Utils.EncodeString(data)); + } + + public void SetBlock(string key, string value, uint data) + { + SetBlock(key, value, BitConverter.GetBytes(data)); + } + + public void SetBlock(string key, uint value, string data) + { + SetBlock(key, value, Utils.EncodeString(data)); + } + + public void SetBlock(string key, uint value, uint data) + { + SetBlock(key, value, BitConverter.GetBytes(data)); + } + + public void DeleteBlock(string key, string value) + { + foreach (VistaBlock block in Blocks) + { + if (block.ValueAsStr == value) + { + Blocks.Remove(block); + return; + } + } + } + + public void DeleteBlock(string key, uint value) + { + foreach (VistaBlock block in Blocks) + { + if (block.ValueAsInt == value) + { + Blocks.Remove(block); + return; + } + } + } + + public PhysicalStoreVista(string primaryPath, bool production) + { + TSPrimary = File.Open(primaryPath, FileMode.OpenOrCreate, FileAccess.ReadWrite, FileShare.None); + TSSecondary = File.Open(primaryPath.Replace("-0.", "-1."), FileMode.OpenOrCreate, FileAccess.ReadWrite, FileShare.None); + Production = production; + + Deserialize(PhysStoreCrypto.DecryptPhysicalStore(TSPrimary.ReadAllBytes(), production, PSVersion.Vista)); + TSPrimary.Seek(0, SeekOrigin.Begin); + } + + public void Dispose() + { + if (TSPrimary.CanWrite && TSSecondary.CanWrite) + { + byte[] data = PhysStoreCrypto.EncryptPhysicalStore(Serialize(), Production, PSVersion.Vista); + + TSPrimary.SetLength(data.LongLength); + TSSecondary.SetLength(data.LongLength); + + TSPrimary.Seek(0, SeekOrigin.Begin); + TSSecondary.Seek(0, SeekOrigin.Begin); + + TSPrimary.WriteAllBytes(data); + TSSecondary.WriteAllBytes(data); + + TSPrimary.Close(); + TSSecondary.Close(); + } + } + + public byte[] ReadRaw() + { + byte[] data = PhysStoreCrypto.DecryptPhysicalStore(TSPrimary.ReadAllBytes(), Production, PSVersion.Vista); + TSPrimary.Seek(0, SeekOrigin.Begin); + return data; + } + + public void WriteRaw(byte[] data) + { + byte[] encrData = PhysStoreCrypto.EncryptPhysicalStore(data, Production, PSVersion.Vista); + + TSPrimary.SetLength(encrData.LongLength); + TSSecondary.SetLength(encrData.LongLength); + + TSPrimary.Seek(0, SeekOrigin.Begin); + TSSecondary.Seek(0, SeekOrigin.Begin); + + TSPrimary.WriteAllBytes(encrData); + TSSecondary.WriteAllBytes(encrData); + + TSPrimary.Close(); + TSSecondary.Close(); + } + + public IEnumerable FindBlocks(string valueSearch) + { + List results = new List(); + + foreach (VistaBlock block in Blocks) + { + if (block.ValueAsStr.Contains(valueSearch)) + { + results.Add(new PSBlock + { + Type = block.Type, + Flags = block.Flags, + Key = new byte[0], + Value = block.Value, + Data = block.Data + }); + } + } + + return results; + } + + public IEnumerable FindBlocks(uint valueSearch) + { + List results = new List(); + + foreach (VistaBlock block in Blocks) + { + if (block.ValueAsInt == valueSearch) + { + results.Add(new PSBlock + { + Type = block.Type, + Flags = block.Flags, + Key = new byte[0], + Value = block.Value, + Data = block.Data + }); + } + } + + return results; + } + } +} + + // PhysicalStore/PhysicalStoreWin7.cs namespace LibTSforge.PhysicalStore { using System; using System.Collections.Generic; using System.IO; - using LibTSforge.Crypto; + using Crypto; public class Win7Block { @@ -6266,7 +7092,7 @@ namespace LibTSforge.PhysicalStore public sealed class PhysicalStoreWin7 : IPhysicalStore { - private byte[] PreHeaderBytes = new byte[] { }; + private byte[] PreHeaderBytes = { }; private readonly List Blocks = new List(); private readonly FileStream TSPrimary; private readonly FileStream TSSecondary; @@ -6440,7 +7266,7 @@ namespace LibTSforge.PhysicalStore TSSecondary = File.Open(primaryPath.Replace("-0.", "-1."), FileMode.OpenOrCreate, FileAccess.ReadWrite, FileShare.None); Production = production; - Deserialize(PhysStoreCrypto.DecryptPhysicalStore(TSPrimary.ReadAllBytes(), production)); + Deserialize(PhysStoreCrypto.DecryptPhysicalStore(TSPrimary.ReadAllBytes(), production, PSVersion.Win7)); TSPrimary.Seek(0, SeekOrigin.Begin); } @@ -6466,7 +7292,7 @@ namespace LibTSforge.PhysicalStore public byte[] ReadRaw() { - byte[] data = PhysStoreCrypto.DecryptPhysicalStore(TSPrimary.ReadAllBytes(), Production); + byte[] data = PhysStoreCrypto.DecryptPhysicalStore(TSPrimary.ReadAllBytes(), Production, PSVersion.Win7); TSPrimary.Seek(0, SeekOrigin.Begin); return data; } @@ -6549,7 +7375,7 @@ namespace LibTSforge.PhysicalStore BINARY = 1 << 2 } - public class CRCBlock + public abstract class CRCBlock { public CRCBlockType DataType; public byte[] Key; @@ -6588,7 +7414,57 @@ namespace LibTSforge.PhysicalStore } } - public void Encode(BinaryWriter writer) + public abstract void Encode(BinaryWriter writer); + public abstract void Decode(BinaryReader reader); + public abstract uint CRC(); + } + + public class CRCBlockVista : CRCBlock + { + public override void Encode(BinaryWriter writer) + { + uint crc = CRC(); + writer.Write((uint)DataType); + writer.Write(0); + writer.Write(Key.Length); + writer.Write(Value.Length); + writer.Write(crc); + + writer.Write(Key); + + writer.Write(Value); + } + + public override void Decode(BinaryReader reader) + { + uint type = reader.ReadUInt32(); + reader.ReadUInt32(); + uint lenName = reader.ReadUInt32(); + uint lenVal = reader.ReadUInt32(); + uint crc = reader.ReadUInt32(); + + byte[] key = reader.ReadBytes((int)lenName); + byte[] value = reader.ReadBytes((int)lenVal); + + DataType = (CRCBlockType)type; + Key = key; + Value = value; + + if (CRC() != crc) + { + throw new InvalidDataException("Invalid CRC in variable bag."); + } + } + + public override uint CRC() + { + return Utils.CRC32(Value); + } + } + + public class CRCBlockModern : CRCBlock + { + public override void Encode(BinaryWriter writer) { uint crc = CRC(); writer.Write(crc); @@ -6603,7 +7479,7 @@ namespace LibTSforge.PhysicalStore writer.Align(8); } - public static CRCBlock Decode(BinaryReader reader) + public override void Decode(BinaryReader reader) { uint crc = reader.ReadUInt32(); uint type = reader.ReadUInt32(); @@ -6616,22 +7492,17 @@ namespace LibTSforge.PhysicalStore byte[] value = reader.ReadBytes((int)lenVal); reader.Align(8); - CRCBlock block = new CRCBlock - { - DataType = (CRCBlockType)type, - Key = key, - Value = value, - }; + DataType = (CRCBlockType)type; + Key = key; + Value = value; - if (block.CRC() != crc) + if (CRC() != crc) { throw new InvalidDataException("Invalid CRC in variable bag."); } - - return block; } - public uint CRC() + public override uint CRC() { BinaryWriter wtemp = new BinaryWriter(new MemoryStream()); wtemp.Write(0); @@ -6647,8 +7518,9 @@ namespace LibTSforge.PhysicalStore public class VariableBag { public List Blocks = new List(); + private readonly PSVersion Version; - public void Deserialize(byte[] data) + private void Deserialize(byte[] data) { int len = data.Length; @@ -6656,7 +7528,19 @@ namespace LibTSforge.PhysicalStore while (reader.BaseStream.Position < len - 0x10) { - Blocks.Add(CRCBlock.Decode(reader)); + CRCBlock block; + + if (Version == PSVersion.Vista) + { + block = new CRCBlockVista(); + } + else + { + block = new CRCBlockModern(); + } + + block.Decode(reader); + Blocks.Add(block); } } @@ -6666,7 +7550,13 @@ namespace LibTSforge.PhysicalStore foreach (CRCBlock block in Blocks) { - block.Encode(writer); + if (Version == PSVersion.Vista) + { + ((CRCBlockVista)block).Encode(writer); + } else + { + ((CRCBlockModern)block).Encode(writer); + } } return writer.GetBytes(); @@ -6712,14 +7602,15 @@ namespace LibTSforge.PhysicalStore } } - public VariableBag(byte[] data) + public VariableBag(byte[] data, PSVersion version) { + Version = version; Deserialize(data); } - public VariableBag() + public VariableBag(PSVersion version) { - + Version = version; } } } @@ -6749,7 +7640,7 @@ if ($env:_debug -eq '0') { [LibTSforge.Logger]::HideOutput = $true } $ver = [LibTSforge.Utils]::DetectVersion() -$prod = [LibTSforge.Utils]::DetectCurrentKey() +$prod = [LibTSforge.SPP.SPPUtils]::DetectCurrentKey() $tsactids = @($args) function Get-WmiInfo { @@ -6801,7 +7692,7 @@ if ($env:resetstuff -eq $null) { $licenseStatus = Get-WmiInfo -tsactid $tsactid -property "LicenseStatus" if ($licenseStatus -eq 1) { if ($prodDes -match 'KMS' -and $prodDes -notmatch 'CLIENT') { - [LibTSforge.Modifiers.KMSHostCharge]::Charge($ver, $tsactid, $prod) + [LibTSforge.Modifiers.KMSHostCharge]::Charge($ver, $prod, $tsactid) Write-Host "[$prodName] CSVLK is permanently activated with ZeroCID." -ForegroundColor White -BackgroundColor DarkGreen Write-Host "[$prodName] CSVLK is charged with 25 clients for 30 days." -ForegroundColor White -BackgroundColor DarkGreen } From 172fd7b1c521e84d721653e4c57bec2e321493ad Mon Sep 17 00:00:00 2001 From: WindowsAddict Date: Thu, 17 Apr 2025 03:11:21 +0530 Subject: [PATCH 26/79] Fix crash issue when scripts are running under a path with special characters --- MAS/All-In-One-Version-KL/MAS_AIO.cmd | 7 +++---- MAS/Separate-Files-Version/Activators/HWID_Activation.cmd | 2 +- MAS/Separate-Files-Version/Activators/KMS38_Activation.cmd | 2 +- .../Activators/Ohook_Activation_AIO.cmd | 2 +- .../Activators/Online_KMS_Activation.cmd | 2 +- .../Activators/TSforge_Activation.cmd | 7 +++---- MAS/Separate-Files-Version/Change_Office_Edition.cmd | 2 +- MAS/Separate-Files-Version/Change_Windows_Edition.cmd | 2 +- MAS/Separate-Files-Version/Extract_OEM_Folder.cmd | 2 +- MAS/Separate-Files-Version/Troubleshoot.cmd | 2 +- 10 files changed, 14 insertions(+), 16 deletions(-) diff --git a/MAS/All-In-One-Version-KL/MAS_AIO.cmd b/MAS/All-In-One-Version-KL/MAS_AIO.cmd index f180db7..4eb0dce 100644 --- a/MAS/All-In-One-Version-KL/MAS_AIO.cmd +++ b/MAS/All-In-One-Version-KL/MAS_AIO.cmd @@ -154,7 +154,6 @@ goto dk_done set "_work=%~dp0" if "%_work:~-1%"=="\" set "_work=%_work:~0,-1%" -set "_workp=%_work:'=''%" set "_batf=%~f0" set "_batp=%_batf:'=''%" @@ -197,7 +196,7 @@ goto dk_done ::pstst $ExecutionContext.SessionState.LanguageMode :pstst -for /f "delims=" %%a in ('cmd /c "%psc% ""if ($PSVersionTable.PSEdition -ne 'Core') {$f=[io.file]::ReadAllText('!_batp!') -split ':pstst';iex ($f[1])}""" %nul6%') do (set tstresult=%%a) +for /f "delims=" %%a in ('%psc% "if ($PSVersionTable.PSEdition -ne 'Core') {$f=[io.file]::ReadAllText('!_batp!') -split ':pstst';iex ($f[1])}" %nul6%') do (set tstresult=%%a) if /i not "%tstresult%"=="FullLanguage" ( %eline% @@ -9733,9 +9732,9 @@ namespace LibTSforge.PhysicalStore } '@ $ErrorActionPreference = 'Stop' -$binPath = Join-Path -Path $env:_workp -ChildPath "BIN\LibTSforge.dll" +$binPath = "$env:_work\BIN\LibTSforge.dll" -if (Test-Path -Path $binPath) { +if (Test-Path -LiteralPath $binPath) { Write-Host "LibTSforge.dll found in BIN folder. Loading the DLL..." Add-Type -Path $binPath } diff --git a/MAS/Separate-Files-Version/Activators/HWID_Activation.cmd b/MAS/Separate-Files-Version/Activators/HWID_Activation.cmd index 8f65bbd..bb694f4 100644 --- a/MAS/Separate-Files-Version/Activators/HWID_Activation.cmd +++ b/MAS/Separate-Files-Version/Activators/HWID_Activation.cmd @@ -235,7 +235,7 @@ goto dk_done ::pstst $ExecutionContext.SessionState.LanguageMode :pstst -for /f "delims=" %%a in ('cmd /c "%psc% ""if ($PSVersionTable.PSEdition -ne 'Core') {$f=[io.file]::ReadAllText('!_batp!') -split ':pstst';iex ($f[1])}""" %nul6%') do (set tstresult=%%a) +for /f "delims=" %%a in ('%psc% "if ($PSVersionTable.PSEdition -ne 'Core') {$f=[io.file]::ReadAllText('!_batp!') -split ':pstst';iex ($f[1])}" %nul6%') do (set tstresult=%%a) if /i not "%tstresult%"=="FullLanguage" ( %eline% diff --git a/MAS/Separate-Files-Version/Activators/KMS38_Activation.cmd b/MAS/Separate-Files-Version/Activators/KMS38_Activation.cmd index bcac266..206ac83 100644 --- a/MAS/Separate-Files-Version/Activators/KMS38_Activation.cmd +++ b/MAS/Separate-Files-Version/Activators/KMS38_Activation.cmd @@ -238,7 +238,7 @@ goto dk_done ::pstst $ExecutionContext.SessionState.LanguageMode :pstst -for /f "delims=" %%a in ('cmd /c "%psc% ""if ($PSVersionTable.PSEdition -ne 'Core') {$f=[io.file]::ReadAllText('!_batp!') -split ':pstst';iex ($f[1])}""" %nul6%') do (set tstresult=%%a) +for /f "delims=" %%a in ('%psc% "if ($PSVersionTable.PSEdition -ne 'Core') {$f=[io.file]::ReadAllText('!_batp!') -split ':pstst';iex ($f[1])}" %nul6%') do (set tstresult=%%a) if /i not "%tstresult%"=="FullLanguage" ( %eline% diff --git a/MAS/Separate-Files-Version/Activators/Ohook_Activation_AIO.cmd b/MAS/Separate-Files-Version/Activators/Ohook_Activation_AIO.cmd index 04b78db..6de8e0c 100644 --- a/MAS/Separate-Files-Version/Activators/Ohook_Activation_AIO.cmd +++ b/MAS/Separate-Files-Version/Activators/Ohook_Activation_AIO.cmd @@ -228,7 +228,7 @@ goto dk_done ::pstst $ExecutionContext.SessionState.LanguageMode :pstst -for /f "delims=" %%a in ('cmd /c "%psc% ""if ($PSVersionTable.PSEdition -ne 'Core') {$f=[io.file]::ReadAllText('!_batp!') -split ':pstst';iex ($f[1])}""" %nul6%') do (set tstresult=%%a) +for /f "delims=" %%a in ('%psc% "if ($PSVersionTable.PSEdition -ne 'Core') {$f=[io.file]::ReadAllText('!_batp!') -split ':pstst';iex ($f[1])}" %nul6%') do (set tstresult=%%a) if /i not "%tstresult%"=="FullLanguage" ( %eline% diff --git a/MAS/Separate-Files-Version/Activators/Online_KMS_Activation.cmd b/MAS/Separate-Files-Version/Activators/Online_KMS_Activation.cmd index d8759e2..9f4bed2 100644 --- a/MAS/Separate-Files-Version/Activators/Online_KMS_Activation.cmd +++ b/MAS/Separate-Files-Version/Activators/Online_KMS_Activation.cmd @@ -257,7 +257,7 @@ goto dk_done ::pstst $ExecutionContext.SessionState.LanguageMode :pstst -for /f "delims=" %%a in ('cmd /c "%psc% ""if ($PSVersionTable.PSEdition -ne 'Core') {$f=[io.file]::ReadAllText('!_batp!') -split ':pstst';iex ($f[1])}""" %nul6%') do (set tstresult=%%a) +for /f "delims=" %%a in ('%psc% "if ($PSVersionTable.PSEdition -ne 'Core') {$f=[io.file]::ReadAllText('!_batp!') -split ':pstst';iex ($f[1])}" %nul6%') do (set tstresult=%%a) if /i not "%tstresult%"=="FullLanguage" ( %eline% diff --git a/MAS/Separate-Files-Version/Activators/TSforge_Activation.cmd b/MAS/Separate-Files-Version/Activators/TSforge_Activation.cmd index 350ae2a..ebc1399 100644 --- a/MAS/Separate-Files-Version/Activators/TSforge_Activation.cmd +++ b/MAS/Separate-Files-Version/Activators/TSforge_Activation.cmd @@ -221,7 +221,6 @@ goto dk_done set "_work=%~dp0" if "%_work:~-1%"=="\" set "_work=%_work:~0,-1%" -set "_workp=%_work:'=''%" set "_batf=%~f0" set "_batp=%_batf:'=''%" @@ -264,7 +263,7 @@ goto dk_done ::pstst $ExecutionContext.SessionState.LanguageMode :pstst -for /f "delims=" %%a in ('cmd /c "%psc% ""if ($PSVersionTable.PSEdition -ne 'Core') {$f=[io.file]::ReadAllText('!_batp!') -split ':pstst';iex ($f[1])}""" %nul6%') do (set tstresult=%%a) +for /f "delims=" %%a in ('%psc% "if ($PSVersionTable.PSEdition -ne 'Core') {$f=[io.file]::ReadAllText('!_batp!') -split ':pstst';iex ($f[1])}" %nul6%') do (set tstresult=%%a) if /i not "%tstresult%"=="FullLanguage" ( %eline% @@ -7616,9 +7615,9 @@ namespace LibTSforge.PhysicalStore } '@ $ErrorActionPreference = 'Stop' -$binPath = Join-Path -Path $env:_workp -ChildPath "BIN\LibTSforge.dll" +$binPath = "$env:_work\BIN\LibTSforge.dll" -if (Test-Path -Path $binPath) { +if (Test-Path -LiteralPath $binPath) { Write-Host "LibTSforge.dll found in BIN folder. Loading the DLL..." Add-Type -Path $binPath } diff --git a/MAS/Separate-Files-Version/Change_Office_Edition.cmd b/MAS/Separate-Files-Version/Change_Office_Edition.cmd index 264a58e..708689b 100644 --- a/MAS/Separate-Files-Version/Change_Office_Edition.cmd +++ b/MAS/Separate-Files-Version/Change_Office_Edition.cmd @@ -188,7 +188,7 @@ goto dk_done ::pstst $ExecutionContext.SessionState.LanguageMode :pstst -for /f "delims=" %%a in ('cmd /c "%psc% ""if ($PSVersionTable.PSEdition -ne 'Core') {$f=[io.file]::ReadAllText('!_batp!') -split ':pstst';iex ($f[1])}""" %nul6%') do (set tstresult=%%a) +for /f "delims=" %%a in ('%psc% "if ($PSVersionTable.PSEdition -ne 'Core') {$f=[io.file]::ReadAllText('!_batp!') -split ':pstst';iex ($f[1])}" %nul6%') do (set tstresult=%%a) if /i not "%tstresult%"=="FullLanguage" ( %eline% diff --git a/MAS/Separate-Files-Version/Change_Windows_Edition.cmd b/MAS/Separate-Files-Version/Change_Windows_Edition.cmd index 37b02c1..594f857 100644 --- a/MAS/Separate-Files-Version/Change_Windows_Edition.cmd +++ b/MAS/Separate-Files-Version/Change_Windows_Edition.cmd @@ -193,7 +193,7 @@ goto dk_done ::pstst $ExecutionContext.SessionState.LanguageMode :pstst -for /f "delims=" %%a in ('cmd /c "%psc% ""if ($PSVersionTable.PSEdition -ne 'Core') {$f=[io.file]::ReadAllText('!_batp!') -split ':pstst';iex ($f[1])}""" %nul6%') do (set tstresult=%%a) +for /f "delims=" %%a in ('%psc% "if ($PSVersionTable.PSEdition -ne 'Core') {$f=[io.file]::ReadAllText('!_batp!') -split ':pstst';iex ($f[1])}" %nul6%') do (set tstresult=%%a) if /i not "%tstresult%"=="FullLanguage" ( %eline% diff --git a/MAS/Separate-Files-Version/Extract_OEM_Folder.cmd b/MAS/Separate-Files-Version/Extract_OEM_Folder.cmd index df142d4..34ba8d0 100644 --- a/MAS/Separate-Files-Version/Extract_OEM_Folder.cmd +++ b/MAS/Separate-Files-Version/Extract_OEM_Folder.cmd @@ -187,7 +187,7 @@ goto done2 ::pstst $ExecutionContext.SessionState.LanguageMode :pstst -for /f "delims=" %%a in ('cmd /c "%psc% ""if ($PSVersionTable.PSEdition -ne 'Core') {$f=[io.file]::ReadAllText('!_batp!') -split ':pstst';iex ($f[1])}""" %nul6%') do (set tstresult=%%a) +for /f "delims=" %%a in ('%psc% "if ($PSVersionTable.PSEdition -ne 'Core') {$f=[io.file]::ReadAllText('!_batp!') -split ':pstst';iex ($f[1])}" %nul6%') do (set tstresult=%%a) if /i not "%tstresult%"=="FullLanguage" ( %eline% diff --git a/MAS/Separate-Files-Version/Troubleshoot.cmd b/MAS/Separate-Files-Version/Troubleshoot.cmd index 483f6da..487b496 100644 --- a/MAS/Separate-Files-Version/Troubleshoot.cmd +++ b/MAS/Separate-Files-Version/Troubleshoot.cmd @@ -188,7 +188,7 @@ goto dk_done ::pstst $ExecutionContext.SessionState.LanguageMode :pstst -for /f "delims=" %%a in ('cmd /c "%psc% ""if ($PSVersionTable.PSEdition -ne 'Core') {$f=[io.file]::ReadAllText('!_batp!') -split ':pstst';iex ($f[1])}""" %nul6%') do (set tstresult=%%a) +for /f "delims=" %%a in ('%psc% "if ($PSVersionTable.PSEdition -ne 'Core') {$f=[io.file]::ReadAllText('!_batp!') -split ':pstst';iex ($f[1])}" %nul6%') do (set tstresult=%%a) if /i not "%tstresult%"=="FullLanguage" ( %eline% From 98ef9db3ceffd5fdb49e3a4433be4a76a9a986ca Mon Sep 17 00:00:00 2001 From: WindowsAddict Date: Sun, 20 Apr 2025 19:35:53 +0530 Subject: [PATCH 27/79] Add TSforge and Online KMS support for Vista/Server2008 --- MAS/All-In-One-Version-KL/MAS_AIO.cmd | 529 +++++++++++++++--- .../Activators/HWID_Activation.cmd | 64 ++- .../Activators/KMS38_Activation.cmd | 64 ++- .../Activators/Ohook_Activation_AIO.cmd | 55 +- .../Activators/Online_KMS_Activation.cmd | 249 +++++++-- .../Activators/TSforge_Activation.cmd | 321 +++++++++-- .../Change_Office_Edition.cmd | 26 +- .../Change_Windows_Edition.cmd | 26 +- .../Check_Activation_Status.cmd | 5 +- .../Extract_OEM_Folder.cmd | 39 +- MAS/Separate-Files-Version/Troubleshoot.cmd | 114 ++-- 11 files changed, 1211 insertions(+), 281 deletions(-) diff --git a/MAS/All-In-One-Version-KL/MAS_AIO.cmd b/MAS/All-In-One-Version-KL/MAS_AIO.cmd index 4eb0dce..fd2f429 100644 --- a/MAS/All-In-One-Version-KL/MAS_AIO.cmd +++ b/MAS/All-In-One-Version-KL/MAS_AIO.cmd @@ -141,10 +141,27 @@ call :dk_color2 %Blue% "Check this webpage for help - " %_Yellow% " %mas%trouble goto dk_done ) -if %winbuild% LSS 7600 ( +if %winbuild% LSS 6001 ( %nceline% echo Unsupported OS version detected [%winbuild%]. -echo Project is supported only for Windows 7/8/8.1/10/11 and their Server equivalents. +echo MAS only supports Windows Vista/7/8/8.1/10/11 and their Server equivalents. +if %winbuild% EQU 6000 ( +echo: +echo Windows Vista RTM is not supported because Powershell cannot be installed. +echo Upgrade to Windows Vista SP1 or SP2. +) +goto dk_done +) + +if not exist %ps% ( +%nceline% +echo PowerShell is not installed in your system. +if %winbuild% LSS 7600 ( +echo Install PowerShell using the following URL. +echo: +echo https://www.catalog.update.microsoft.com/Search.aspx?q=KB968930 +start https://www.catalog.update.microsoft.com/Search.aspx?q=KB968930 +) goto dk_done ) @@ -1077,10 +1094,16 @@ goto :dk_done :dk_setvar -set psc=powershell.exe -nop -c +set ps=%SysPath%\WindowsPowerShell\v1.0\powershell.exe +set psc=%ps% -nop -c set winbuild=1 for /f "tokens=6 delims=[]. " %%G in ('ver') do set winbuild=%%G +set _slexe=sppsvc.exe& set _slser=sppsvc +if %winbuild% LEQ 6300 (set _slexe=SLsvc.exe& set _slser=SLsvc) +if %winbuild% LSS 7600 if exist "%SysPath%\SLsvc.exe" (set _slexe=SLsvc.exe& set _slser=SLsvc) +if %_slexe%==SLsvc.exe set _vis=1 + set _NCS=1 if %winbuild% LSS 10586 set _NCS=0 if %winbuild% GEQ 10586 reg query "HKCU\Console" /v ForceV2 %nul2% | find /i "0x0" %nul1% && (set _NCS=0) @@ -1287,6 +1310,8 @@ exit /b :dk_reeval +if %winbuild% LSS 7600 exit /b + :: This key is left by the system in rearm process and sppsvc sometimes fails to delete it, it causes issues in working of the Scheduled Tasks of SPP set "ruleskey=HKU\S-1-5-20\Software\Microsoft\Windows NT\CurrentVersion\SoftwareProtectionPlatform\PersistedSystemState" @@ -1332,13 +1357,13 @@ function InstallLicenseArr($Str) { ForEach ($x in $a) {InstallLicenseFile "$x"} } function InstallLicenseDir($Loc) { - dir $Loc *.xrm-ms -af -s | select -expand FullName | % {InstallLicenseFile "$_"} + Get-ChildItem $Loc -Recurse -Filter *.xrm-ms | ForEach-Object {InstallLicenseFile $_.FullName} } function ReinstallLicenses() { - $Oem = "$env:SysPath\oem" - $Spp = "$env:SysPath\spp\tokens" - InstallLicenseDir "$Spp" - If (Test-Path $Oem) {InstallLicenseDir "$Oem"} + $Paths = @("$env:SysPath\oem", "$env:SysPath\licensing", "$env:SysPath\spp\tokens") + foreach ($Path in $Paths) { + if (Test-Path $Path) { InstallLicenseDir "$Path" } + } } :xrm: @@ -1356,16 +1381,16 @@ exit /b :dk_sppissue -sc start sppsvc %nul% +sc start %_slser% %nul% set spperror=%errorlevel% if %spperror% NEQ 1056 if %spperror% NEQ 0 ( %eline% -echo sc start sppsvc [Error Code: %spperror%] +echo sc start %_slser% [Error Code: %spperror%] ) echo: -%psc% "$job = Start-Job { (Get-WmiObject -Query 'SELECT * FROM %sps%').Version }; if (-not (Wait-Job $job -Timeout 30)) {write-host 'sppsvc is not working correctly. Check this webpage for help - %mas%troubleshoot'}" +%psc% "$job = Start-Job { (Get-WmiObject -Query 'SELECT * FROM %sps%').Version }; if (-not (Wait-Job $job -Timeout 30)) {write-host '%_slser% is not working correctly. Check this webpage for help - %mas%troubleshoot'}" exit /b :: Get Product name (WMI/REG methods are not reliable in all conditions, hence winbrand.dll method is used) @@ -1383,6 +1408,10 @@ if %winbuild% GEQ 22000 ( set winos=!winos:Windows 10=Windows 11! ) ) +if %winbuild% LSS 7600 ( +set "winos=!winos:VistaT=Vista!" +set "winos=!winos:Serverr=Server!" +) if not defined winsub exit /b @@ -1429,11 +1458,11 @@ for %%# in (avira.com kaspersky.com virustotal.com mcafee.com) do ( find /i "%%#" %SysPath%\drivers\etc\hosts %nul% && set /a hcount+=1) if %hcount%==4 set "results=[Antivirus URLs are blocked in hosts]" -sc start sppsvc %nul% +sc start %_slser% %nul% echo "%errorlevel%" | findstr "577 225" %nul% && ( set "results=%results%[Likely File Infector]" ) || ( -if not exist %SysPath%\sppsvc.exe if not exist %SysPath%\alg.exe (set "results=%results%[Likely File Infector]") +if not exist %SysPath%\%_slexe% if not exist %SysPath%\alg.exe (set "results=%results%[Likely File Infector]") ) if not "%results%%pupfound%"=="" ( @@ -1513,6 +1542,7 @@ for %%# in (%serv_ste%) do ( if /i %%#==ClipSVC (reg add "HKLM\SYSTEM\CurrentControlSet\Services\%%#" /v "Start" /t REG_DWORD /d "3" /f %nul% & sc config %%# start= demand %nul%) if /i %%#==wlidsvc sc config %%# start= demand %nul% if /i %%#==sppsvc (reg add "HKLM\SYSTEM\CurrentControlSet\Services\%%#" /v "Start" /t REG_DWORD /d "2" /f %nul% & sc config %%# start= delayed-auto %nul%) +if /i %%#==SLsvc sc config %%# start= auto %nul% if /i %%#==KeyIso sc config %%# start= demand %nul% if /i %%#==LicenseManager sc config %%# start= demand %nul% if /i %%#==Winmgmt sc config %%# start= auto %nul% @@ -1642,7 +1672,7 @@ 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" ( +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" if not exist "%SysPath%\licensing\skus\Security-Licensing-SLC-Component-SKU-%osedition%\*-%osedition%-*.xrm-ms" ( set skunotfound=1 call :dk_color %Red% "Checking License Files [Not Found] [%osedition%]" ) @@ -1724,7 +1754,7 @@ call :dk_color2 %Blue% "In case of activation issues, do this - " %_Yellow% " %m ) -for %%# in (SppEx%w%tComObj.exe sppsvc.exe sppsvc.exe\PerfOptions) do ( +for %%# in (SppEx%w%tComObj.exe SLsvc.exe sppsvc.exe sppsvc.exe\PerfOptions) do ( reg query "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Ima%w%ge File Execu%w%tion Options\%%#" %nul% && (if defined _sppint (set "_sppint=!_sppint!, %%#") else (set "_sppint=%%#")) ) if defined _sppint ( @@ -1738,14 +1768,14 @@ echo Checking SPP In IFEO [%_sppint%] ) -for /f "skip=2 tokens=2*" %%a in ('reg query "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\SoftwareProtectionPlatform" /v "SkipRearm" %nul6%') do if /i %%b NEQ 0x0 ( +if %winbuild% GEQ 7600 for /f "skip=2 tokens=2*" %%a in ('reg query "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\SoftwareProtectionPlatform" /v "SkipRearm" %nul6%') do if /i %%b NEQ 0x0 ( 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" ) -reg query "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\SoftwareProtectionPlatform\Plugins\Objects\msft:rm/algorithm/hwid/4.0" /f ba02fed39662 /d %nul% || ( +if %winbuild% GEQ 7600 reg query "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\SoftwareProtectionPlatform\Plugins\Objects\msft:rm/algorithm/hwid/4.0" /f ba02fed39662 /d %nul% || ( call :dk_color %Red% "Checking SPP Registry Key [Incorrect ModuleId Found]" set fixes=%fixes% %mas%issues_due_to_gaming_spoofers call :dk_color2 %Blue% "Most likely caused by gaming spoofers. Check this webpage for help - " %_Yellow% " %mas%issues_due_to_gaming_spoofers" @@ -1755,21 +1785,22 @@ set showfix=1 set tokenstore= +if %winbuild% GEQ 7600 ( for /f "skip=2 tokens=2*" %%a in ('reg query "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\SoftwareProtectionPlatform" /v TokenStore %nul6%') do call set "tokenstore=%%b" if %winbuild% LSS 9200 set "tokenstore=%Systemdrive%\Windows\ServiceProfiles\NetworkService\AppData\Roaming\Microsoft\SoftwareProtectionPlatform" -if %winbuild% GEQ 9200 if /i not "%tokenstore%"=="%SysPath%\spp\store" if /i not "%tokenstore%"=="%SysPath%\spp\store\2.0" if /i not "%tokenstore%"=="%SysPath%\spp\store_test\2.0" ( +if %winbuild% GEQ 9200 if /i not "!tokenstore!"=="%SysPath%\spp\store" if /i not "!tokenstore!"=="%SysPath%\spp\store\2.0" if /i not "!tokenstore!"=="%SysPath%\spp\store_test\2.0" ( set toerr=1 set error=1 set showfix=1 -call :dk_color %Red% "Checking TokenStore Registry Key [Correct Path Not Found] [%tokenstore%]" +call :dk_color %Red% "Checking TokenStore Registry Key [Correct Path Not Found] [!tokenstore!]" set fixes=%fixes% %mas%troubleshoot call :dk_color2 %Blue% "Check this webpage for help - " %_Yellow% " %mas%troubleshoot" ) - +) :: This code creates token folder only if it's missing and sets default permission for it -if not defined toerr if not exist "%tokenstore%\" ( +if %winbuild% GEQ 7600 if not defined toerr if not exist "%tokenstore%\" ( mkdir "%tokenstore%" %nul% if %winbuild% LSS 9200 set "d=$sddl = 'O:NSG:NSD:AI(A;OICIID;FA;;;SY)(A;OICIID;FA;;;BA)(A;OICIID;FA;;;NS)';" if %winbuild% GEQ 9200 set "d=$sddl = 'O:BAG:BAD:PAI(A;OICI;FA;;;SY)(A;OICI;FA;;;BA)(A;OICIIO;GR;;;BU)(A;;FR;;;BU)(A;OICI;FA;;;S-1-5-80-123231216-2592883651-3715271367-3753151631-4175906628)';" @@ -1790,7 +1821,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% +%psc% "if (-not $env:_vis) {Start-Job { Stop-Service %_slser% -force } | Wait-Job -Timeout 20 | Out-Null}; $sls = Get-WmiObject SoftwareLicensingService; $f=[io.file]::ReadAllText('!_batp!') -split ':xrm\:.*';iex ($f[1]); ReinstallLicenses" %nul% call :dk_actid 55c92734-d682-4d71-983e-d6ec3f16059f if not defined apps ( set "_notfoundids=Key Not Installed / Act ID Not Found" @@ -1805,7 +1836,7 @@ call :dk_color %Red% "Checking Activation IDs [!_notfoundids!]" ) -if exist "%tokenstore%\" if not exist "%tokenstore%\tokens.dat" ( +if %winbuild% GEQ 7600 if exist "%tokenstore%\" if not exist "%tokenstore%\tokens.dat" ( set error=1 call :dk_color %Red% "Checking SPP tokens.dat [Not Found] [%tokenstore%\]" ) @@ -1940,8 +1971,10 @@ $wpaKey.Close() if %_NCS% EQU 1 ( echo %esc%[%~1%~2%esc%[0m -) else ( +) else if exist %ps% ( %psc% write-host -back '%1' -fore '%2' '%3' +) else if not exist %ps% ( +echo %~3 ) exit /b @@ -1949,8 +1982,10 @@ exit /b if %_NCS% EQU 1 ( echo %esc%[%~1%~2%esc%[%~3%~4%esc%[0m -) else ( +) else if exist %ps% ( %psc% write-host -back '%1' -fore '%2' '%3' -NoNewline; write-host -back '%4' -fore '%5' '%6' +) else if not exist %ps% ( +echo %~3 %~6 ) exit /b @@ -3669,6 +3704,18 @@ if /i "%%A"=="/Z-Reset" (set _resall=1) if not defined tsids set _actman=0 for %%A in (%_actwin% %_actesu% %_actoff% %_actprojvis% %_actwinesuoff% %_actwinhost% %_actoffhost% %_actappx% %_actman% %_resall%) do (if "%%A"=="1" set _unattended=1) +if %winbuild% LSS 7600 ( +reg query "HKLM\SOFTWARE\Microsoft\NET Framework Setup\NDP\v3.5" /v Install %nul2% | find /i "0x1" %nul1% || ( +%eline% +echo .NET 3.5 Framework is not installed in your system. +echo Install it using the following URL. +echo: +echo https://www.microsoft.com/download/details.aspx?id=25150 +start https://www.microsoft.com/download/details.aspx?id=25150 +goto dk_done +) +) + ::======================================================================================================================================== :ts_menu @@ -3696,7 +3743,11 @@ echo [A] Activate - Windows %KS% Host echo [B] Activate - Office %KS% Host echo [C] Activate - Windows 8/8.1 APPX Sideloading echo [D] Activate - Manually Select Products +if defined _vis ( +echo [E] Reset - Rearm/Timers +) else ( echo [E] Reset - Rearm/Timers/Tamper/Lock +) echo _______________________________________________ echo: echo [6] Remove TSforge Activation @@ -3742,9 +3793,9 @@ echo: echo Initializing... call :dk_chkmal -if not exist %SysPath%\sppsvc.exe ( +if not exist %SysPath%\%_slexe% ( %eline% -echo [%SysPath%\sppsvc.exe] file is missing, aborting... +echo [%SysPath%\%_slexe%] file is missing, aborting... echo: set fixes=%fixes% %mas%troubleshoot call :dk_color2 %Blue% "Check this webpage for help - " %_Yellow% " %mas%troubleshoot" @@ -3767,10 +3818,10 @@ goto dk_done if %winbuild% LSS 9200 if exist "%SysPath%\wlms\wlms.exe" ( sc query wlms | find /i "RUNNING" %nul% && ( -sc stop sppsvc %nul% +sc stop %_slser% %nul% if !errorlevel! EQU 1051 ( %eline% -echo Evaluation WLMS service is running, sppsvc service can not be stopped. Aborting... +echo Evaluation WLMS service is running, %_slser% service can not be stopped. Aborting... echo Install Non-Eval version for Windows build %winbuild%. echo: set fixes=%fixes% %mas%troubleshoot @@ -3803,7 +3854,7 @@ call :dk_showosinfo echo Initiating Diagnostic Tests... -set "_serv=sppsvc Winmgmt" +set "_serv=%_slser% Winmgmt" :: Software Protection :: Windows Management Instrumentation @@ -3852,6 +3903,8 @@ call :dk_color %Gray% "Checking OS Activation [Windows is alrea goto :ts_esu ) +if defined _vis goto :ts_winvista + set tempid= set keytype=zero for /f "delims=" %%a in ('%psc% "$f=[io.file]::ReadAllText('!_batp!') -split ':wintsid\:.*';iex ($f[1])" %nul6%') do ( @@ -3874,6 +3927,86 @@ goto :ts_esu ::======================================================================================================================================== +:ts_winvista + +:: Process Windows Vista + +:: 1st column = Activation ID +:: 2nd column = Generic key +:: 3rd column = Key channel +:: 4th column = Edition ID +:: Separator = _ + +:: Keys aren't available for these editions, but since these editions aren't publicly available, it doesn't matter +:: a797d61e-1475-470b-86c8-f737a72c188d StarterN +:: 5e9f548a-c8a9-44e6-a6c2-3f8d0a7a99dd ServerComputeClusterV + +set f= +set key= +set tempid= +if not defined allapps call :dk_actids 55c92734-d682-4d71-983e-d6ec3f16059f + +for %%# in ( +:: WindowsVista +9de9abe2-d01d-4538-af84-4498bdbc2ba3_4D2XH-PRBMM-8Q22B-K8BM3-MR%f%W4W_____Retail_Business +db442be4-81ed-4ab3-9d66-2417e8a5c81c_76884-QXFY2-6Q2WX-2QTQ8-QX%f%X44_____Retail_BusinessN +b51791c2-b562-4b73-97b0-735a0e4429a6_YQPQV-RW8R3-XMPFG-RXG9R-JG%f%TVF_____Retail_Enterprise +58c37517-42f8-4723-bb44-30b05791ff2a_Q7J9R-G63R4-BFMHF-FWM9R-RW%f%DMV_____Retail_EnterpriseN +95c6e80a-0ff8-4bd0-95f2-c4a39b79d09e_RCG7P-TX42D-HM8FM-TCFCW-3V%f%4VD_____Retail_HomeBasic +d0333dad-c14e-46f2-b62a-8b47a1b9768b_HY2VV-XC6FF-MD6WV-FPYBQ-GF%f%JBT_____Retail_HomeBasicN +9e042223-03bf-49ae-808f-ff37f128d40d_X9HTF-MKJQQ-XK376-TJ7T4-76%f%PKF_____Retail_HomePremium +92d8977c-d506-4e63-b500-6d39283b6cd5_KJ6TP-PF9W2-23T3Q-XTV7M-PX%f%DT2_____Retail_HomePremiumN +89e51a3c-76c0-4beb-a650-53d34c8f8186_X9PYV-YBQRV-9BXWV-TQDMK-QD%f%WK4_____Retail_Starter +30fab9cc-8614-4339-989f-7ce61fb7a5c4_VMCB9-FDRV6-6CDQM-RV23K-RP%f%8F7_____Retail_Ultimate +1eefed20-8ac0-478c-8774-70cd44782ea1_CVX38-P27B4-2X8BT-RXD4J-V7%f%CKX_____Retail_UltimateN +:: WindowsServer2008 +c9ad502b-ef48-41d1-a2a0-38a38e82fed0_24FV9-H7JW8-C8Q6X-BQKMK-K9%f%77J_____Retail_ServerComputeCluster +866e924e-c2a3-4872-aca1-6b48c13962d5_6QBHY-DXTPJ-T9W3P-DTJXX-4V%f%QMB_____Retail_ServerDatacenter +d020c729-07f0-4f8f-87ce-bf803275c786_83TWG-TD3TC-HRDP2-K93FJ-Y3%f%4YC_OEM:NONSLP_ServerDatacenterV +32b40e5e-0c6d-4c6f-ab12-a031933fd2c6_MRB7H-QJRHG-FXTBR-B2Q2M-8W%f%MTJ_____Retail_ServerEnterprise +256cc990-1692-4ea8-965c-2d423d5dd24e_H4VB6-QPRWH-VDCYM-996P8-MH%f%KFY_OEM:NONSLP_ServerEnterpriseIA64 +1ba5e036-e386-42c4-b7eb-16bdb4fa1945_H8H7M-HDPQT-PJHQF-M7B83-9C%f%VGV_____Retail_ServerEnterpriseV +8df04457-07c8-4301-bce9-d61eb76cb2d6_RGBMC-PQBVF-94Q9K-HD63B-VY%f%6MP_____Retail_ServerHomePremium +5bd23b19-aa71-4a5b-8b68-c8801c2baff6_6C8KR-MD3QK-9GWFW-44CY2-W9%f%CBM_____Retail_ServerHomeStandard +b86c7736-91ff-4de9-bfa9-b32b8a09acac_7XRBY-6MP2K-VQPT8-F37JV-YY%f%Q83_____Retail_ServerMediumBusinessManagement +d3f5642f-081d-40b2-a4b9-efd3054d4584_6PDTD-JK48J-662TF-8J2QV-R4%f%CRB_____Retail_ServerMediumBusinessMessaging +c6936a36-69f3-4994-9857-3069c7b9ec7a_D694V-CMWKH-PY92X-PFQKQ-JC%f%B69_____Retail_ServerMediumBusinessSecurity +cc4c2cf8-ef29-4d8e-b168-2b65a3db3309_MRDK3-YYQF3-88BQJ-D6FJG-69%f%YJY_____Retail_ServerSBSPremium +b3827b27-bd38-4284-98af-e4f4d1c051a0_2KB23-GJRBD-W3T9C-6CH2W-39%f%B7V_____Retail_ServerSBSPrime +5dad0eff-3f6f-4310-8844-422f9dc7c84b_H4XDD-B27GY-667P6-XWVV7-GY%f%G8J_____Retail_ServerSBSStandard +603504f9-109f-49f0-9271-8c66f7878f58_8YVM4-YQBDH-7WDQM-R27WR-WV%f%CWG_____Retail_ServerStandard +65ab7338-9ad0-43fe-af1b-190b577495e2_H9MW3-6V7GK-94P9G-7FTPJ-VK%f%CKF_____Retail_ServerStandardV +2be204da-24a0-4943-b66c-81e8464acd7e_2264C-TD9T8-P8HPW-CC9GH-MH%f%M2V_____Retail_ServerStorageEnterprise +60207eba-8b4a-486c-a013-023b4b742c2f_RCYMT-YX342-8T6YY-XYHYC-3D%f%D7X_____Retail_ServerStorageExpress +368856e9-43f7-4601-8358-e561f36c7dd8_FKFT2-WXYY9-WBPY7-6YMY4-X4%f%8JF_____Retail_ServerStorageStandard +4bf433fa-ab04-4c6c-b55b-00170e14b8cd_8X9J7-HCJ7J-3WDJT-QM7D8-46%f%4YH_____Retail_ServerStorageWorkgroup +a77a6806-f59e-4953-97d7-229317b8e6a6_BGT39-9FYH7-X2CYD-T628F-QP%f%QPW_____Retail_ServerWeb +f92f836d-4d3e-4e90-a08f-2d612d65e716_HPH76-FHFPP-DRW9D-7W2V4-HW%f%GKT_____Retail_ServerWinSB +3059a9fd-b068-4f0d-acaf-66324dca67ac_2V8G6-KRXYR-MMGXJ-6RWM3-GX%f%CCG_____Retail_ServerWinSBV +) do ( +for /f "tokens=1-4 delims=_" %%A in ("%%#") do if %tsedition%==%%D if not defined key ( +echo "%allapps%" | find /i "%%A" %nul1% && ( +set key=%%B +set tempid=%%A +) +) +) + +if not defined key ( +set error=1 +call :dk_color %Red% "Checking Activation ID [%tsedition% SKU-%osSKU% not found in the system]" +call :dk_color %Blue% "%_fixmsg%" +goto :ts_esu +) + +echo Checking Activation ID [%tempid%] [%tsedition%] + +call :ts_inskey "[%key%]" +if not defined error set tsids=%tsids% %tempid% +goto :ts_esu + +::======================================================================================================================================== + :ts_wineval call :dk_color %Gray% "Checking OS Edition [%tsedition%] [Evaluation edition found]" @@ -3990,19 +4123,7 @@ goto :ts_esu echo Resetting Rearm / GracePeriod [Successful] ) -%psc% "try { $null=(([WMISEARCHER]'SELECT Version FROM %sps%').Get()).InstallProductKey('%key%'); exit 0 } catch { exit $_.Exception.InnerException.HResult }" %nul% -set keyerror=%errorlevel% -cmd /c exit /b %keyerror% -if %keyerror% NEQ 0 set "keyerror=[0x%=ExitCode%]" - -if %keyerror% EQU 0 ( -call :dk_refresh -echo Installing Activable Evaluation Key [%key%] [Successful] -) else ( -set error=1 -call :dk_color %Red% "Installing Activable Evaluation Key [%key%] [Failed] %keyerror%" -call :dk_color %Blue% "%_fixmsg%" -) +call :ts_inskey "[%key%]" ::======================================================================================================================================== @@ -4038,7 +4159,7 @@ REM Windows7EmbeddedPOSReady7 4f1f646c-1e66-4908-acc7-d1606229b29e_POS-ESU-Year3[1-3y]_-Embedded[POS]- REM Windows7EmbeddedStandard 6aaf1c7d-527f-4ed5-b908-9fc039dfc654_WES-ESU-Year3[1-3y]_-Embedded[Standard]- -REM WindowsServer2008R2 +REM WindowsServer2008/WindowsServer2008R2 8e7bfb1e-acc1-4f56-abae-b80fce56cd4b_Server-ESU-PA[1-6y]_-ServerDatacenter-ServerDatacenterCore-ServerDatacenterV-ServerDatacenterVCore-ServerStandard-ServerStandardCore-ServerStandardV-ServerStandardVCore-ServerEnterprise-ServerEnterpriseCore-ServerEnterpriseV-ServerEnterpriseVCore- REM Windows8.1 4afc620f-12a4-48ad-8015-2aebfbd6e47c_Client-ESU-Year3[1-3y]_-Enterprise-EnterpriseN-Professional-ProfessionalN- @@ -4072,6 +4193,13 @@ set esuexistbutnosup=1 ) ) +if defined esuexistsup if defined _vis ( +set key=9FPV7-MWGT8-7XPDF-JC23W-WT7TW +REM This is a non-generic blocked MAK key for Server-ESU-PA +call :ts_inskey "[!key!]" +goto :ts_off +) + if defined esuexistsup ( echo "%tsids%" | find /i "4220f546-f522-46df-8202-4d07afd26454" %nul1% && ( echo "%tsids%" | find /i "7e94be23-b161-4956-a682-146ab291774c" %nul1% || ( @@ -4094,7 +4222,8 @@ goto :ts_off ) set esuavail= -if %winbuild% LEQ 7602 if not defined isThinpc set esuavail=1 +if defined _vis if defined isServer set esuavail=1 +if %winbuild% LEQ 7602 if not defined _vis if not defined isThinpc set esuavail=1 if %winbuild% GTR 7602 if %winbuild% LSS 10240 if defined isServer set esuavail=1 if %winbuild% GEQ 10240 if %winbuild% LEQ 19045 if not defined isServer set esuavail=1 if %winbuild% EQU 9600 set esuavail=1 @@ -4116,7 +4245,7 @@ if not %_actoff%==1 goto :ts_act if %winbuild% LSS 9200 ( echo: call :dk_color %Gray% "Checking Supported Office [TSforge for Office is supported on Windows 8 and later versions]" -call :dk_color %Blue% "On Windows 7 build, use Online %KS% activation option for Office instead." +call :dk_color %Blue% "On Windows Vista / 7, use Online %KS% activation option for Office instead." goto :ts_act ) @@ -4389,7 +4518,7 @@ echo: if %winbuild% GEQ 10586 ( call :dk_color %Gray% "With %KS% Host license, system may randomly change Windows Edition later. It is a Windows issue and can be safely ignored." ) -call :dk_color %Gray% "%KS% Host [Not to be confused with %KS% Client] license causes the sppsvc service to run continuously." +call :dk_color %Gray% "%KS% Host [Not to be confused with %KS% Client] license causes the %_slser% service to run continuously." call :dk_color %Blue% "Only use this activation when necessary, you can revert to normal activation from the previous menu." if %_unattended%==0 ( @@ -4403,6 +4532,8 @@ set _arr= set tempid= set keytype=kmshost +if defined _vis goto :ts_whost_vista + :: Install current edition csvlk license so that correct edition can reflect for csvlk if %winbuild% GEQ 10586 ( @@ -4434,6 +4565,53 @@ goto :ts_act ::======================================================================================================================================== +:ts_whost_vista + +:: Process Windows K-M-S host for Vista + +:: 1st column = Activation ID +:: 2nd column = CSVLK key +:: 3rd column = Edition IDs +:: Separator = _ + +set f= +set key= +set tempid= +if not defined allapps call :dk_actids 55c92734-d682-4d71-983e-d6ec3f16059f + +for %%# in ( +:: WindowsVista +212a64dc-43b1-4d3d-a30c-2fc69d2095c6_TWVG3-9Q4P8-W9XJF-Y76FJ-DW%f%Q4R_-Business-BusinessN-Enterprise-EnterpriseN- +:: WindowsServer2008 +c90d1b4e-8aa8-439e-8b9e-b6d6b6a6d975_BHC4Q-6D7B7-QMVH7-4MKQH-Y9%f%VK7_-ServerComputeCluster-ServerDatacenter-ServerDatacenterV-ServerEnterprise-ServerEnterpriseIA64-ServerEnterpriseV-ServerStandard-ServerStandardV-ServerWeb- +56df4151-1f9f-41bf-acaa-2941c071872b_PVGKG-2R7XQ-7WTFD-FXTJR-DQ%f%BQ3_-ServerComputeCluster-ServerEnterprise-ServerEnterpriseV-ServerStandard-ServerStandardV-ServerWeb- +c448fa06-49d1-44ec-82bb-0085545c3b51_KH4PC-KJFX6-XFVHQ-GDK2G-JC%f%JY9_-ServerComputeCluster-ServerWeb- +) do ( +for /f "tokens=1-3 delims=_" %%A in ("%%#") do if not defined key ( +echo "%allapps%" | find /i "%%A" %nul1% && ( +echo "%%C" | find /i "-%tsedition%-" %nul1% && ( +set key=%%B +set tempid=%%A +) +) +) +) + +if defined key ( +echo Checking Activation ID [%tempid%] [%tsedition%] +) else ( +call :dk_color %Red% "Checking Activation ID [Not Found] [%tsedition%] [%osSKU%]" +call :dk_color %Blue% "%KS% Host license is not found on your system. It is available for the below editions." +call :dk_color %Blue% "Business, BusinessN, Enterprise, EnterpriseN, and Server editions, etc." +goto :ts_act +) + +call :ts_inskey "[%key%]" +if not defined error set tsids=%tsids% %tempid% +goto :ts_act + +::======================================================================================================================================== + :ts_ohost :: Process Office K-M-S host @@ -4441,6 +4619,12 @@ goto :ts_act echo: echo Processing Office %KS% Host... +if defined _vis ( +echo: +call :dk_color %Blue% "Windows Vista and Server 2008 do not support the installation of Office KMS Host." +goto :ts_act +) + set ohostexist= call :dk_actids 0ff1ce15-a989-479d-af46-f275c6370663 set ohostids=%allapps% @@ -4523,7 +4707,11 @@ goto :ts_act :ts_resetall echo: +if defined _vis ( +echo Processing Reset of Rearm / Timers... +) else ( echo Processing Reset of Rearm / Timers / Tamper / Lock... +) echo: set resetstuff=1 @@ -4572,6 +4760,10 @@ goto :dk_done for /f "delims=" %%a in ('%psc% "$ids = Get-WmiObject -Query 'SELECT ID FROM SoftwareLicensingProduct' | Select-Object -ExpandProperty ID; $ids" %nul6%') do call set "allactids= %%a !allactids! " +if defined _vis ( +echo: +call :dk_color %Blue% "On Windows Vista and Server 2008, you must manually install the key before activating it." +) echo: call :dk_color %Gray% "Enter / Paste the Activation ID shown in first column in the opened text file, or just press Enter to return:" echo Add space after each Activation ID if you are adding multiple: @@ -4702,7 +4894,7 @@ call :dk_color2 %Blue% "Check this webpage for help - " %_Yellow% " %mas%trouble if defined tsids ( echo: -echo Installing Forged Product Key Data... +if not defined _vis Installing Forged Product Key Data... echo Depositing Zero Confirmation ID... echo: %psc% "$f=[io.file]::ReadAllText('!_batp!') -split ':tsforge\:.*';& ([ScriptBlock]::Create($f[1])) %tsids%" @@ -4940,7 +5132,28 @@ exit /b :ts_checkwinperm -%psc% "Get-WmiObject -Query 'SELECT Name, Description FROM SoftwareLicensingProduct WHERE LicenseStatus=''1'' AND GracePeriodRemaining=''0'' AND PartialProductKey IS NOT NULL AND LicenseDependsOn IS NULL' | Where-Object { $_.Description -notmatch 'KMS_' } | Select-Object -Property Name" %nul2% | findstr /i "Windows" %nul1% && set _perm=1||set _perm= +%psc% "Get-WmiObject -Query 'SELECT Name, Description FROM SoftwareLicensingProduct WHERE LicenseStatus=''1'' AND GracePeriodRemaining=''0'' AND PartialProductKey IS NOT NULL AND LicenseDependsOn IS NULL' | Where-Object { $_.Description -notmatch 'KMS' } | Select-Object -Property Name" %nul2% | findstr /i "Windows" %nul1% && set _perm=1||set _perm= +exit /b + +:: Install Key + +:ts_inskey + +if %_wmic% EQU 1 wmic path %sps% where __CLASS='%sps%' call InstallProductKey ProductKey="%key%" %nul% +if %_wmic% EQU 0 %psc% "try { $null=(([WMISEARCHER]'SELECT Version FROM %sps%').Get()).InstallProductKey('%key%'); exit 0 } catch { exit $_.Exception.InnerException.HResult }" %nul% +set keyerror=%errorlevel% +cmd /c exit /b %keyerror% +if %keyerror% NEQ 0 set "keyerror=[0x%=ExitCode%]" + +if %keyerror% EQU 0 ( +if %sps%==SoftwareLicensingService call :dk_refresh +echo Installing Product Key %~1 [Successful] +) else ( +set error=1 +call :dk_color %Red% "Installing Product Key %~1 [Failed] %keyerror%" +call :dk_color %Blue% "%_fixmsg%" +) + exit /b ::======================================================================================================================================== @@ -9787,7 +10000,7 @@ function slGetSkuInfo($SkuId) { } } -if ($env:resetstuff -eq $null) { +if (-not $env:resetstuff) { foreach ($tsactid in $tsactids) { try { $prodDes = Get-WmiInfo -tsactid $tsactid -property "Description" @@ -9796,7 +10009,9 @@ if ($env:resetstuff -eq $null) { $nameParts = $prodName -split ',', 2 $prodName = if ($nameParts.Count -gt 1) { ($nameParts[1].Trim() -split '[ ,]')[0] } else { $null } } + if (-not $env:_vis) { [LibTSforge.Modifiers.GenPKeyInstall]::InstallGenPKey($ver, $prod, $tsactid) + } if ($prodName -match 'Office' -and -not (slGetSkuInfo($tsactid))) { $licenseStatus = Get-WmiInfo -tsactid $tsactid -property "LicenseStatus" if ($licenseStatus -eq 1) { @@ -9829,13 +10044,13 @@ if ($env:resetstuff -eq $null) { } } -if ($env:resetstuff -eq '1') { +if ($env:resetstuff) { try { - [LibTSforge.Modifiers.TamperedFlagsDelete]::DeleteTamperFlags($ver, $prod) + if (-not $env:_vis) {[LibTSforge.Modifiers.TamperedFlagsDelete]::DeleteTamperFlags($ver, $prod)} [LibTSforge.SPP.SLApi]::RefreshLicenseStatus() [LibTSforge.Modifiers.RearmReset]::Reset($ver, $prod) [LibTSforge.Modifiers.GracePeriodReset]::Reset($ver, $prod) - [LibTSforge.Modifiers.KeyChangeLockDelete]::Delete($ver, $prod) + if (-not $env:_vis) {[LibTSforge.Modifiers.KeyChangeLockDelete]::Delete($ver, $prod)} } catch { $errcode = 3 @@ -11285,9 +11500,9 @@ echo: echo Initializing... call :dk_chkmal -if not exist %SysPath%\sppsvc.exe ( +if not exist %SysPath%\%_slexe% ( %eline% -echo [%SysPath%\sppsvc.exe] file is missing, aborting... +echo [%SysPath%\%_slexe%] file is missing, aborting... echo: set fixes=%fixes% %mas%troubleshoot call :dk_color2 %Blue% "Check this webpage for help - " %_Yellow% " %mas%troubleshoot" @@ -11339,7 +11554,7 @@ call :dk_color %Blue% "Internet is required for Online %KS% Activation." echo Initiating Diagnostic Tests... -set "_serv=sppsvc Winmgmt" +set "_serv=%_slser% Winmgmt" :: Software Protection :: Windows Management Instrumentation @@ -11429,9 +11644,11 @@ echo [%winos% ^| %winbuild% ^| SKU:%osSKU%] if %winbuild% GEQ 9200 if exist "%SysPath%\spp\tokens\skus\%osedition%\*GVLK*.xrm-ms" set sppks=1 if %winbuild% LSS 9200 if exist "%SysPath%\spp\tokens\skus\Security-SPP-Component-SKU-%osedition%\*VLKMS*.xrm-ms" set sppks=1 if %winbuild% LSS 9200 if exist "%SysPath%\spp\tokens\skus\Security-SPP-Component-SKU-%osedition%\*VL-BYPASS*.xrm-ms" set sppks=1 +if %winbuild% LSS 7600 if exist "%SysPath%\licensing\skus\Security-Licensing-SLC-Component-SKU-%osedition%\*KMS*.xrm-ms" set sppks=1 +if %winbuild% LSS 7600 if exist "%SysPath%\licensing\skus\Security-Licensing-SLC-Component-SKU-%osedition%\*VL-BYPASS*.xrm-ms" set sppks=1 if defined skunotfound ( -call :dk_color %Red% "Required license files not found in %SysPath%\spp\tokens\skus\" +call :dk_color %Red% "Required license files not found." set fixes=%fixes% %mas%troubleshoot call :dk_color2 %Blue% "Check this webpage for help - " %_Yellow% " %mas%troubleshoot" ) @@ -12183,6 +12400,11 @@ set "nul=>nul 2>&1" for /f "tokens=6 delims=[]. " %%G in ('ver') do set winbuild=%%G set psc=powershell.exe -nop -c +set _slexe=sppsvc.exe& set _slser=sppsvc +if %winbuild% LEQ 6300 (set _slexe=SLsvc.exe& set _slser=SLsvc) +if %winbuild% LSS 7600 if exist "%SysPath%\SLsvc.exe" (set _slexe=SLsvc.exe& set _slser=SLsvc) +if %_slexe%==SLsvc.exe set _vis=1 + set run_once= set t_name=Renewal Task reg query "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Schedule\taskcache\tasks" /f Path /s | find /i "\Activation-Run_Once" >nul && ( @@ -12246,7 +12468,7 @@ call :_taskclear-cache :: Check WMI and sppsvc Errors set applist= -net start sppsvc /y %nul% +net start %_slser% /y %nul% if %_wmic% EQU 1 set "chkapp=for /f "tokens=2 delims==" %%a in ('"wmic path %slp% where (ApplicationID='%_wApp%') get ID /VALUE" 2^>nul')" if %_wmic% EQU 0 set "chkapp=for /f "tokens=2 delims==" %%a in ('%psc% "(([WMISEARCHER]'SELECT ID FROM %slp% WHERE ApplicationID=''%_wApp%''').Get()).ID ^| %% {echo ('ID='+$_)}" 2^>nul')" %chkapp% do (if defined applist (call set "applist=!applist! %%a") else (call set "applist=%%a")) @@ -12548,12 +12770,20 @@ exit /b :_taskclear-cache set w= -for %%# in (SppE%w%xtComObj.exe sppsvc.exe) do ( +for %%# in (SppE%w%xtComObj.exe sppsvc.exe SLsvc.exe) do ( reg delete "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Ima%w%ge File Execu%w%tion Options\%%#" /f %nul% ) set "OPPk=SOFTWARE\Microsoft\OfficeSoftwareProtectionPlatform" + +if %winbuild% LSS 7600 ( +reg query "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\SL" %nul% && ( +set "SPPk=SOFTWARE\Microsoft\Windows NT\CurrentVersion\SL" +) +) +if not defined SPPk ( set "SPPk=SOFTWARE\Microsoft\Windows NT\CurrentVersion\SoftwareProtectionPlatform" +) set "slp=SoftwareLicensingProduct" set "ospp=OfficeSoftwareProtectionProduct" @@ -12669,10 +12899,11 @@ for /f %%G in ('%psc% "[Guid]::NewGuid().Guid"') do set "randguid=%%G" set "_temp=%SystemRoot%\Temp\%Random%%randguid%" set nil= +if %winbuild% LSS 7600 (set _vista=_vista) if exist "%_temp%\.*" rmdir /s /q "%_temp%\" %nul% md "%_temp%\" %nul% -call :ks_RenExport renewal "%_temp%\Renewal.xml" Unicode -if not defined _int (call :ks_RenExport run_once "%_temp%\Run_Once.xml" Unicode) +call :ks_RenExport renewal%_vista% "%_temp%\Renewal.xml" Unicode +if not defined _int (call :ks_RenExport run_once%_vista% "%_temp%\Run_Once.xml" Unicode) s%nil%cht%nil%asks /cre%nil%ate /tn "Activation-Renewal" /ru "SYS%nil%TEM" /xml "%_temp%\Renewal.xml" %nul% if not defined _int (s%nil%cht%nil%asks /cre%nil%ate /tn "Activation-Run_Once" /ru "SYS%nil%TEM" /xml "%_temp%\Run_Once.xml" %nul%) if exist "%_temp%\.*" rmdir /s /q "%_temp%\" %nul% @@ -12861,6 +13092,121 @@ exit /b :run_once: +:renewal_vista: + + + + 1999-01-01T12:00:00.34375 + WindowsAddict + Online K-M-S Activation-Renewal - Weekly Task + + + + 1999-01-01T12:00:00.34375 + true + + + + + 1 + + + + + + S-1-5-18 + HighestAvailable + + + + + PT10M + PT1H + true + false + + IgnoreNew + false + true + true + true + true + + true + true + false + false + false + PT10M + 7 + + PT5M + 3 + + + + + %ProgramFiles%\Activation-Renewal\Activation_task.cmd + Task + + + +:renewal_vista: + +:run_once_vista: + + + + 1999-01-01T12:00:00.34375 + WindowsAddict + Online K-M-S Activation Run Once - Run and Delete itself on first Internet Contact + + + + true + + + + + S-1-5-18 + HighestAvailable + + + + + PT10M + PT1H + true + false + + IgnoreNew + false + true + true + true + true + + true + true + false + false + false + PT10M + 7 + + PT5M + 3 + + + + + %ProgramFiles%\Activation-Renewal\Activation_task.cmd + Task + + + +:run_once_vista: + ::======================================================================================================================================== :: 1st column = Office version number @@ -13192,7 +13538,22 @@ a78b8bd9-8017-4df5-b86a-09f756affa7c_6TPJF-RBVHG-WBW2R-86QPH-6R%f%TM4__17_Server cda18cf3-c196-46ad-b289-60c072869994_TT8MH-CG224-D3D7Q-498W2-9Q%f%CTX__18_ServerHPC a78b8bd9-8017-4df5-b86a-09f756affa7c_6TPJF-RBVHG-WBW2R-86QPH-6R%f%TM4__29_ServerWebCore f772515c-0e87-48d5-a676-e6962c3e1195_736RG-XDKJK-V34PF-BHK87-J6%f%X3K__56_ServerEmbeddedSolution -::======================================================================================================================================== +:: Windows Vista +cfd8ff08-c0d7-452b-9f60-ef5c70c32094_VKK3X-68KWM-X2YGT-QR4M6-4B%f%WMV___4_Enterprise +4f3d1606-3fea-4c01-be3c-8d671c401e3b_YFKBB-PQJJV-G996G-VWGXY-2V%f%3X8___6_Business +2c682dc2-8b68-4f63-a165-ae291d4cf138_HMBQG-8H2RH-C77VX-27R82-VM%f%QBT__16_BusinessN +d4f54950-26f2-4fb4-ba21-ffab16afcade_VTC42-BM838-43QHV-84HX6-XJ%f%XKV__27_EnterpriseN +:: Windows Server 2008 +ad2542d4-9154-4c6d-8a44-30f11ee96989_TM24T-X9RMF-VWXK6-X8JC9-BF%f%GM2___7_ServerStandard +68b6e220-cf09-466b-92d3-45cd964b9509_7M67G-PC374-GR742-YH8V4-TC%f%BY3___8_ServerDatacenter +c1af4d90-d1bc-44ca-85d4-003ba33db3b9_YQGMW-MPWTJ-34KDK-48M3W-X4%f%Q6V__10_ServerEnterprise +01ef176b-3e0d-422a-b4f8-4ea880035e8f_4DWFP-JF3DJ-B7DTH-78FJB-PD%f%RHK__15_ServerEnterpriseIA64 +ddfa9f7c-f09e-40b9-8c1a-be877a9a7f4b_WYR28-R7TFJ-3X2YQ-YCY4H-M2%f%49D__17_ServerWeb +7afb1156-2c1d-40fc-b260-aab7442b62fe_RCTX3-KWVHP-BR6TB-RB6DM-6X%f%7HP__18_ServerComputeCluster +2401e3d0-c50a-4b58-87b2-7e794b7d2607_W7VD6-7JFBR-RX26B-YKQ3Y-6F%f%FFJ__36_ServerStandardV +fd09ef77-5647-4eff-809c-af2b64659a45_22XQ2-VRXRG-P8D42-K34TD-G3%f%QQC__37_ServerDatacenterV +8198490a-add0-47b2-b3ba-316b12d647b4_39BXF-X8Q23-P2WWT-38T2F-G3%f%FPG__38_ServerEnterpriseV +::======================================================================================================================================= :: Office 2010 8ce7e872-188c-4b98-9d90-f8f90b7aad02_V7Y44-9T38C-R2VJK-666HK-T7%f%DDX__14_AccessVL cee5d470-6e3b-4fcc-8c2b-d17428568a9f_H62QG-HXVKF-PP4HP-66KMR-CW%f%9BM__14_ExcelVL @@ -15134,6 +15495,13 @@ mode 125, 32 ) title Fix Licensing ^(ClipSVC ^+ SPP ^+ OSPP^) +if %winbuild% EQU 6001 ( +%eline% +echo This option is not supported on Windows Vista SP1. +echo Upgrade to Windows Vista SP2. +goto :at_back +) + echo: echo %line% echo: @@ -15150,7 +15518,7 @@ echo - Clear ClipSVC, SPP and OSPP licenses. echo - Fix permissions of SPP tokens folder and registries. echo - Trigger the repair option for Office. echo: -call :dk_color2 %_White% " - " %Red% "Apply this option only when it is necessary." +call :dk_color2 %_White% " - " %Blue% "Apply this option only when it is necessary." echo: echo %line% echo: @@ -15314,19 +15682,19 @@ echo [No Error Found] ) echo: -echo Stopping sppsvc service... -%psc% Stop-Service sppsvc -force %nul% +echo Stopping %_slser% service... +%psc% Stop-Service %_slser% -force %nul% set w= set _sppint= -for %%# in (SppEx%w%tComObj.exe sppsvc.exe) do (reg query "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Ima%w%ge File Execu%w%tion Options\%%#" %nul% && (set _sppint=1)) +for %%# in (SppEx%w%tComObj.exe %_slexe%) do (reg query "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Ima%w%ge File Execu%w%tion Options\%%#" %nul% && (set _sppint=1)) if defined _sppint ( echo: echo Removing SPP IFEO registry keys... -for %%# in (SppE%w%xtComObj.exe sppsvc.exe) do (reg delete "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Ima%w%ge File Execu%w%tion Options\%%#" /f %nul%) +for %%# in (SppE%w%xtComObj.exe %_slexe%) do (reg delete "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Ima%w%ge File Execu%w%tion Options\%%#" /f %nul%) ) -if %winbuild% LSS 9200 ( +if %winbuild% LSS 9200 if not defined _vis ( REM Fix issues caused by Update KB971033 in Windows 7 REM https://support.microsoft.com/help/4487266 echo: @@ -15345,6 +15713,7 @@ del /f /q %SysPath%\7B296FB0-376B-497e-B012-9C450E1B7327-*.C7483456-A289-439d-81 :: Delete registry keys that are not deleted by activation scripts +if not defined _vis ( echo: echo Cleaning some licensing-related registry keys... %nul% reg delete "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\SoftwareProtectionPlatform" /v "ServiceSessionId" /f @@ -15352,6 +15721,7 @@ echo Cleaning some licensing-related registry keys... %nul% reg delete "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\SoftwareProtectionPlatform" /v "PolicyValuesArray" /f %nul% reg delete "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\SoftwareProtectionPlatform" /v "actionlist" /f %nul% reg delete "HKLM\SOFTWARE\Microsoft\OfficeSoftwareProtectionPlatform\data" /f +) echo: call :scandat delete @@ -15363,9 +15733,13 @@ call :dk_color %Red% "Failed to delete .dat files." echo: ) +if defined _vis ( +%psc% Start-Service %_slser% %nul% +) + echo: echo Reinstalling system licenses... -%psc% "Stop-Service sppsvc -force; $sls = Get-WmiObject SoftwareLicensingService; $f=[io.file]::ReadAllText('!_batp!') -split ':xrm\:.*';iex ($f[1]); ReinstallLicenses" %nul% +%psc% "$sls = Get-WmiObject SoftwareLicensingService; $f=[io.file]::ReadAllText('!_batp!') -split ':xrm\:.*';iex ($f[1]); ReinstallLicenses" %nul% if %errorlevel% NEQ 0 %psc% "$sls = Get-WmiObject SoftwareLicensingService; $f=[io.file]::ReadAllText('!_batp!') -split ':xrm\:.*';iex ($f[1]); ReinstallLicenses" %nul% if %errorlevel% EQU 0 ( echo [Successful] @@ -15382,7 +15756,7 @@ call :dk_color %Red% "Failed to rebuild tokens.dat file." echo tokens.dat file was rebuilt successfully. ) -if %winbuild% LSS 9200 ( +if %winbuild% LSS 9200 if not defined _vis ( sc config sppuinotify start= demand ) @@ -15941,6 +16315,7 @@ for %%# in ( %SysPath%\spp\store\ %SysPath%\spp\store\2.0\ %Systemdrive%\Windows\ServiceProfiles\NetworkService\AppData\Roaming\Microsoft\SoftwareProtectionPlatform\ +%Systemdrive%\Windows\ServiceProfiles\NetworkService\AppData\Roaming\Microsoft\SoftwareLicensing\ ) do ( if %1==check ( @@ -16027,6 +16402,13 @@ cls if not defined terminal mode 98, 30 title Change Windows Edition %masver% +if %winbuild% LSS 7600 ( +%eline% +echo Unsupported OS version detected [%winbuild%]. +echo This option is supported only for Windows 7/8/8.1/10/11 and their Server equivalents. +goto dk_done +) + echo: echo Initializing... echo: @@ -16884,6 +17266,13 @@ cls if not defined terminal mode 98, 30 title Change Office Edition %masver% +if %winbuild% LSS 7600 ( +%eline% +echo Unsupported OS version detected [%winbuild%]. +echo This option is supported only for Windows 7/8/8.1/10/11 and their Server equivalents. +goto dk_done +) + echo: echo Initializing... echo: diff --git a/MAS/Separate-Files-Version/Activators/HWID_Activation.cmd b/MAS/Separate-Files-Version/Activators/HWID_Activation.cmd index bb694f4..006b184 100644 --- a/MAS/Separate-Files-Version/Activators/HWID_Activation.cmd +++ b/MAS/Separate-Files-Version/Activators/HWID_Activation.cmd @@ -808,10 +808,16 @@ goto :dk_done :dk_setvar -set psc=powershell.exe -nop -c +set ps=%SysPath%\WindowsPowerShell\v1.0\powershell.exe +set psc=%ps% -nop -c set winbuild=1 for /f "tokens=6 delims=[]. " %%G in ('ver') do set winbuild=%%G +set _slexe=sppsvc.exe& set _slser=sppsvc +if %winbuild% LEQ 6300 (set _slexe=SLsvc.exe& set _slser=SLsvc) +if %winbuild% LSS 7600 if exist "%SysPath%\SLsvc.exe" (set _slexe=SLsvc.exe& set _slser=SLsvc) +if %_slexe%==SLsvc.exe set _vis=1 + set _NCS=1 if %winbuild% LSS 10586 set _NCS=0 if %winbuild% GEQ 10586 reg query "HKCU\Console" /v ForceV2 %nul2% | find /i "0x0" %nul1% && (set _NCS=0) @@ -1002,6 +1008,8 @@ exit /b :dk_reeval +if %winbuild% LSS 7600 exit /b + :: This key is left by the system in rearm process and sppsvc sometimes fails to delete it, it causes issues in working of the Scheduled Tasks of SPP set "ruleskey=HKU\S-1-5-20\Software\Microsoft\Windows NT\CurrentVersion\SoftwareProtectionPlatform\PersistedSystemState" @@ -1047,13 +1055,13 @@ function InstallLicenseArr($Str) { ForEach ($x in $a) {InstallLicenseFile "$x"} } function InstallLicenseDir($Loc) { - dir $Loc *.xrm-ms -af -s | select -expand FullName | % {InstallLicenseFile "$_"} + Get-ChildItem $Loc -Recurse -Filter *.xrm-ms | ForEach-Object {InstallLicenseFile $_.FullName} } function ReinstallLicenses() { - $Oem = "$env:SysPath\oem" - $Spp = "$env:SysPath\spp\tokens" - InstallLicenseDir "$Spp" - If (Test-Path $Oem) {InstallLicenseDir "$Oem"} + $Paths = @("$env:SysPath\oem", "$env:SysPath\licensing", "$env:SysPath\spp\tokens") + foreach ($Path in $Paths) { + if (Test-Path $Path) { InstallLicenseDir "$Path" } + } } :xrm: @@ -1071,16 +1079,16 @@ exit /b :dk_sppissue -sc start sppsvc %nul% +sc start %_slser% %nul% set spperror=%errorlevel% if %spperror% NEQ 1056 if %spperror% NEQ 0 ( %eline% -echo sc start sppsvc [Error Code: %spperror%] +echo sc start %_slser% [Error Code: %spperror%] ) echo: -%psc% "$job = Start-Job { (Get-WmiObject -Query 'SELECT * FROM %sps%').Version }; if (-not (Wait-Job $job -Timeout 30)) {write-host 'sppsvc is not working correctly. Check this webpage for help - %mas%troubleshoot'}" +%psc% "$job = Start-Job { (Get-WmiObject -Query 'SELECT * FROM %sps%').Version }; if (-not (Wait-Job $job -Timeout 30)) {write-host '%_slser% is not working correctly. Check this webpage for help - %mas%troubleshoot'}" exit /b :: Get Product name (WMI/REG methods are not reliable in all conditions, hence winbrand.dll method is used) @@ -1098,6 +1106,10 @@ if %winbuild% GEQ 22000 ( set winos=!winos:Windows 10=Windows 11! ) ) +if %winbuild% LSS 7600 ( +set "winos=!winos:VistaT=Vista!" +set "winos=!winos:Serverr=Server!" +) if not defined winsub exit /b @@ -1144,11 +1156,11 @@ for %%# in (avira.com kaspersky.com virustotal.com mcafee.com) do ( find /i "%%#" %SysPath%\drivers\etc\hosts %nul% && set /a hcount+=1) if %hcount%==4 set "results=[Antivirus URLs are blocked in hosts]" -sc start sppsvc %nul% +sc start %_slser% %nul% echo "%errorlevel%" | findstr "577 225" %nul% && ( set "results=%results%[Likely File Infector]" ) || ( -if not exist %SysPath%\sppsvc.exe if not exist %SysPath%\alg.exe (set "results=%results%[Likely File Infector]") +if not exist %SysPath%\%_slexe% if not exist %SysPath%\alg.exe (set "results=%results%[Likely File Infector]") ) if not "%results%%pupfound%"=="" ( @@ -1228,6 +1240,7 @@ for %%# in (%serv_ste%) do ( if /i %%#==ClipSVC (reg add "HKLM\SYSTEM\CurrentControlSet\Services\%%#" /v "Start" /t REG_DWORD /d "3" /f %nul% & sc config %%# start= demand %nul%) if /i %%#==wlidsvc sc config %%# start= demand %nul% if /i %%#==sppsvc (reg add "HKLM\SYSTEM\CurrentControlSet\Services\%%#" /v "Start" /t REG_DWORD /d "2" /f %nul% & sc config %%# start= delayed-auto %nul%) +if /i %%#==SLsvc sc config %%# start= auto %nul% if /i %%#==KeyIso sc config %%# start= demand %nul% if /i %%#==LicenseManager sc config %%# start= demand %nul% if /i %%#==Winmgmt sc config %%# start= auto %nul% @@ -1357,7 +1370,7 @@ 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" ( +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" if not exist "%SysPath%\licensing\skus\Security-Licensing-SLC-Component-SKU-%osedition%\*-%osedition%-*.xrm-ms" ( set skunotfound=1 call :dk_color %Red% "Checking License Files [Not Found] [%osedition%]" ) @@ -1439,7 +1452,7 @@ call :dk_color2 %Blue% "In case of activation issues, do this - " %_Yellow% " %m ) -for %%# in (SppEx%w%tComObj.exe sppsvc.exe sppsvc.exe\PerfOptions) do ( +for %%# in (SppEx%w%tComObj.exe SLsvc.exe sppsvc.exe sppsvc.exe\PerfOptions) do ( reg query "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Ima%w%ge File Execu%w%tion Options\%%#" %nul% && (if defined _sppint (set "_sppint=!_sppint!, %%#") else (set "_sppint=%%#")) ) if defined _sppint ( @@ -1453,14 +1466,14 @@ echo Checking SPP In IFEO [%_sppint%] ) -for /f "skip=2 tokens=2*" %%a in ('reg query "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\SoftwareProtectionPlatform" /v "SkipRearm" %nul6%') do if /i %%b NEQ 0x0 ( +if %winbuild% GEQ 7600 for /f "skip=2 tokens=2*" %%a in ('reg query "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\SoftwareProtectionPlatform" /v "SkipRearm" %nul6%') do if /i %%b NEQ 0x0 ( 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" ) -reg query "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\SoftwareProtectionPlatform\Plugins\Objects\msft:rm/algorithm/hwid/4.0" /f ba02fed39662 /d %nul% || ( +if %winbuild% GEQ 7600 reg query "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\SoftwareProtectionPlatform\Plugins\Objects\msft:rm/algorithm/hwid/4.0" /f ba02fed39662 /d %nul% || ( call :dk_color %Red% "Checking SPP Registry Key [Incorrect ModuleId Found]" set fixes=%fixes% %mas%issues_due_to_gaming_spoofers call :dk_color2 %Blue% "Most likely caused by gaming spoofers. Check this webpage for help - " %_Yellow% " %mas%issues_due_to_gaming_spoofers" @@ -1470,21 +1483,22 @@ set showfix=1 set tokenstore= +if %winbuild% GEQ 7600 ( for /f "skip=2 tokens=2*" %%a in ('reg query "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\SoftwareProtectionPlatform" /v TokenStore %nul6%') do call set "tokenstore=%%b" if %winbuild% LSS 9200 set "tokenstore=%Systemdrive%\Windows\ServiceProfiles\NetworkService\AppData\Roaming\Microsoft\SoftwareProtectionPlatform" -if %winbuild% GEQ 9200 if /i not "%tokenstore%"=="%SysPath%\spp\store" if /i not "%tokenstore%"=="%SysPath%\spp\store\2.0" if /i not "%tokenstore%"=="%SysPath%\spp\store_test\2.0" ( +if %winbuild% GEQ 9200 if /i not "!tokenstore!"=="%SysPath%\spp\store" if /i not "!tokenstore!"=="%SysPath%\spp\store\2.0" if /i not "!tokenstore!"=="%SysPath%\spp\store_test\2.0" ( set toerr=1 set error=1 set showfix=1 -call :dk_color %Red% "Checking TokenStore Registry Key [Correct Path Not Found] [%tokenstore%]" +call :dk_color %Red% "Checking TokenStore Registry Key [Correct Path Not Found] [!tokenstore!]" set fixes=%fixes% %mas%troubleshoot call :dk_color2 %Blue% "Check this webpage for help - " %_Yellow% " %mas%troubleshoot" ) - +) :: This code creates token folder only if it's missing and sets default permission for it -if not defined toerr if not exist "%tokenstore%\" ( +if %winbuild% GEQ 7600 if not defined toerr if not exist "%tokenstore%\" ( mkdir "%tokenstore%" %nul% if %winbuild% LSS 9200 set "d=$sddl = 'O:NSG:NSD:AI(A;OICIID;FA;;;SY)(A;OICIID;FA;;;BA)(A;OICIID;FA;;;NS)';" if %winbuild% GEQ 9200 set "d=$sddl = 'O:BAG:BAD:PAI(A;OICI;FA;;;SY)(A;OICI;FA;;;BA)(A;OICIIO;GR;;;BU)(A;;FR;;;BU)(A;OICI;FA;;;S-1-5-80-123231216-2592883651-3715271367-3753151631-4175906628)';" @@ -1505,7 +1519,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% +%psc% "if (-not $env:_vis) {Start-Job { Stop-Service %_slser% -force } | Wait-Job -Timeout 20 | Out-Null}; $sls = Get-WmiObject SoftwareLicensingService; $f=[io.file]::ReadAllText('!_batp!') -split ':xrm\:.*';iex ($f[1]); ReinstallLicenses" %nul% call :dk_actid 55c92734-d682-4d71-983e-d6ec3f16059f if not defined apps ( set "_notfoundids=Key Not Installed / Act ID Not Found" @@ -1520,7 +1534,7 @@ call :dk_color %Red% "Checking Activation IDs [!_notfoundids!]" ) -if exist "%tokenstore%\" if not exist "%tokenstore%\tokens.dat" ( +if %winbuild% GEQ 7600 if exist "%tokenstore%\" if not exist "%tokenstore%\tokens.dat" ( set error=1 call :dk_color %Red% "Checking SPP tokens.dat [Not Found] [%tokenstore%\]" ) @@ -1655,8 +1669,10 @@ $wpaKey.Close() if %_NCS% EQU 1 ( echo %esc%[%~1%~2%esc%[0m -) else ( +) else if exist %ps% ( %psc% write-host -back '%1' -fore '%2' '%3' +) else if not exist %ps% ( +echo %~3 ) exit /b @@ -1664,8 +1680,10 @@ exit /b if %_NCS% EQU 1 ( echo %esc%[%~1%~2%esc%[%~3%~4%esc%[0m -) else ( +) else if exist %ps% ( %psc% write-host -back '%1' -fore '%2' '%3' -NoNewline; write-host -back '%4' -fore '%5' '%6' +) else if not exist %ps% ( +echo %~3 %~6 ) exit /b diff --git a/MAS/Separate-Files-Version/Activators/KMS38_Activation.cmd b/MAS/Separate-Files-Version/Activators/KMS38_Activation.cmd index 206ac83..4610158 100644 --- a/MAS/Separate-Files-Version/Activators/KMS38_Activation.cmd +++ b/MAS/Separate-Files-Version/Activators/KMS38_Activation.cmd @@ -914,10 +914,16 @@ $key.SetAccessControl($acl) :dk_setvar -set psc=powershell.exe -nop -c +set ps=%SysPath%\WindowsPowerShell\v1.0\powershell.exe +set psc=%ps% -nop -c set winbuild=1 for /f "tokens=6 delims=[]. " %%G in ('ver') do set winbuild=%%G +set _slexe=sppsvc.exe& set _slser=sppsvc +if %winbuild% LEQ 6300 (set _slexe=SLsvc.exe& set _slser=SLsvc) +if %winbuild% LSS 7600 if exist "%SysPath%\SLsvc.exe" (set _slexe=SLsvc.exe& set _slser=SLsvc) +if %_slexe%==SLsvc.exe set _vis=1 + set _NCS=1 if %winbuild% LSS 10586 set _NCS=0 if %winbuild% GEQ 10586 reg query "HKCU\Console" /v ForceV2 %nul2% | find /i "0x0" %nul1% && (set _NCS=0) @@ -1124,6 +1130,8 @@ exit /b :dk_reeval +if %winbuild% LSS 7600 exit /b + :: This key is left by the system in rearm process and sppsvc sometimes fails to delete it, it causes issues in working of the Scheduled Tasks of SPP set "ruleskey=HKU\S-1-5-20\Software\Microsoft\Windows NT\CurrentVersion\SoftwareProtectionPlatform\PersistedSystemState" @@ -1151,13 +1159,13 @@ function InstallLicenseArr($Str) { ForEach ($x in $a) {InstallLicenseFile "$x"} } function InstallLicenseDir($Loc) { - dir $Loc *.xrm-ms -af -s | select -expand FullName | % {InstallLicenseFile "$_"} + Get-ChildItem $Loc -Recurse -Filter *.xrm-ms | ForEach-Object {InstallLicenseFile $_.FullName} } function ReinstallLicenses() { - $Oem = "$env:SysPath\oem" - $Spp = "$env:SysPath\spp\tokens" - InstallLicenseDir "$Spp" - If (Test-Path $Oem) {InstallLicenseDir "$Oem"} + $Paths = @("$env:SysPath\oem", "$env:SysPath\licensing", "$env:SysPath\spp\tokens") + foreach ($Path in $Paths) { + if (Test-Path $Path) { InstallLicenseDir "$Path" } + } } :xrm: @@ -1175,16 +1183,16 @@ exit /b :dk_sppissue -sc start sppsvc %nul% +sc start %_slser% %nul% set spperror=%errorlevel% if %spperror% NEQ 1056 if %spperror% NEQ 0 ( %eline% -echo sc start sppsvc [Error Code: %spperror%] +echo sc start %_slser% [Error Code: %spperror%] ) echo: -%psc% "$job = Start-Job { (Get-WmiObject -Query 'SELECT * FROM %sps%').Version }; if (-not (Wait-Job $job -Timeout 30)) {write-host 'sppsvc is not working correctly. Check this webpage for help - %mas%troubleshoot'}" +%psc% "$job = Start-Job { (Get-WmiObject -Query 'SELECT * FROM %sps%').Version }; if (-not (Wait-Job $job -Timeout 30)) {write-host '%_slser% is not working correctly. Check this webpage for help - %mas%troubleshoot'}" exit /b :: Get Product name (WMI/REG methods are not reliable in all conditions, hence winbrand.dll method is used) @@ -1202,6 +1210,10 @@ if %winbuild% GEQ 22000 ( set winos=!winos:Windows 10=Windows 11! ) ) +if %winbuild% LSS 7600 ( +set "winos=!winos:VistaT=Vista!" +set "winos=!winos:Serverr=Server!" +) if not defined winsub exit /b @@ -1293,11 +1305,11 @@ for %%# in (avira.com kaspersky.com virustotal.com mcafee.com) do ( find /i "%%#" %SysPath%\drivers\etc\hosts %nul% && set /a hcount+=1) if %hcount%==4 set "results=[Antivirus URLs are blocked in hosts]" -sc start sppsvc %nul% +sc start %_slser% %nul% echo "%errorlevel%" | findstr "577 225" %nul% && ( set "results=%results%[Likely File Infector]" ) || ( -if not exist %SysPath%\sppsvc.exe if not exist %SysPath%\alg.exe (set "results=%results%[Likely File Infector]") +if not exist %SysPath%\%_slexe% if not exist %SysPath%\alg.exe (set "results=%results%[Likely File Infector]") ) if not "%results%%pupfound%"=="" ( @@ -1377,6 +1389,7 @@ for %%# in (%serv_ste%) do ( if /i %%#==ClipSVC (reg add "HKLM\SYSTEM\CurrentControlSet\Services\%%#" /v "Start" /t REG_DWORD /d "3" /f %nul% & sc config %%# start= demand %nul%) if /i %%#==wlidsvc sc config %%# start= demand %nul% if /i %%#==sppsvc (reg add "HKLM\SYSTEM\CurrentControlSet\Services\%%#" /v "Start" /t REG_DWORD /d "2" /f %nul% & sc config %%# start= delayed-auto %nul%) +if /i %%#==SLsvc sc config %%# start= auto %nul% if /i %%#==KeyIso sc config %%# start= demand %nul% if /i %%#==LicenseManager sc config %%# start= demand %nul% if /i %%#==Winmgmt sc config %%# start= auto %nul% @@ -1506,7 +1519,7 @@ 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" ( +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" if not exist "%SysPath%\licensing\skus\Security-Licensing-SLC-Component-SKU-%osedition%\*-%osedition%-*.xrm-ms" ( set skunotfound=1 call :dk_color %Red% "Checking License Files [Not Found] [%osedition%]" ) @@ -1588,7 +1601,7 @@ call :dk_color2 %Blue% "In case of activation issues, do this - " %_Yellow% " %m ) -for %%# in (SppEx%w%tComObj.exe sppsvc.exe sppsvc.exe\PerfOptions) do ( +for %%# in (SppEx%w%tComObj.exe SLsvc.exe sppsvc.exe sppsvc.exe\PerfOptions) do ( reg query "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Ima%w%ge File Execu%w%tion Options\%%#" %nul% && (if defined _sppint (set "_sppint=!_sppint!, %%#") else (set "_sppint=%%#")) ) if defined _sppint ( @@ -1602,14 +1615,14 @@ echo Checking SPP In IFEO [%_sppint%] ) -for /f "skip=2 tokens=2*" %%a in ('reg query "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\SoftwareProtectionPlatform" /v "SkipRearm" %nul6%') do if /i %%b NEQ 0x0 ( +if %winbuild% GEQ 7600 for /f "skip=2 tokens=2*" %%a in ('reg query "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\SoftwareProtectionPlatform" /v "SkipRearm" %nul6%') do if /i %%b NEQ 0x0 ( 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" ) -reg query "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\SoftwareProtectionPlatform\Plugins\Objects\msft:rm/algorithm/hwid/4.0" /f ba02fed39662 /d %nul% || ( +if %winbuild% GEQ 7600 reg query "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\SoftwareProtectionPlatform\Plugins\Objects\msft:rm/algorithm/hwid/4.0" /f ba02fed39662 /d %nul% || ( call :dk_color %Red% "Checking SPP Registry Key [Incorrect ModuleId Found]" set fixes=%fixes% %mas%issues_due_to_gaming_spoofers call :dk_color2 %Blue% "Most likely caused by gaming spoofers. Check this webpage for help - " %_Yellow% " %mas%issues_due_to_gaming_spoofers" @@ -1619,21 +1632,22 @@ set showfix=1 set tokenstore= +if %winbuild% GEQ 7600 ( for /f "skip=2 tokens=2*" %%a in ('reg query "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\SoftwareProtectionPlatform" /v TokenStore %nul6%') do call set "tokenstore=%%b" if %winbuild% LSS 9200 set "tokenstore=%Systemdrive%\Windows\ServiceProfiles\NetworkService\AppData\Roaming\Microsoft\SoftwareProtectionPlatform" -if %winbuild% GEQ 9200 if /i not "%tokenstore%"=="%SysPath%\spp\store" if /i not "%tokenstore%"=="%SysPath%\spp\store\2.0" if /i not "%tokenstore%"=="%SysPath%\spp\store_test\2.0" ( +if %winbuild% GEQ 9200 if /i not "!tokenstore!"=="%SysPath%\spp\store" if /i not "!tokenstore!"=="%SysPath%\spp\store\2.0" if /i not "!tokenstore!"=="%SysPath%\spp\store_test\2.0" ( set toerr=1 set error=1 set showfix=1 -call :dk_color %Red% "Checking TokenStore Registry Key [Correct Path Not Found] [%tokenstore%]" +call :dk_color %Red% "Checking TokenStore Registry Key [Correct Path Not Found] [!tokenstore!]" set fixes=%fixes% %mas%troubleshoot call :dk_color2 %Blue% "Check this webpage for help - " %_Yellow% " %mas%troubleshoot" ) - +) :: This code creates token folder only if it's missing and sets default permission for it -if not defined toerr if not exist "%tokenstore%\" ( +if %winbuild% GEQ 7600 if not defined toerr if not exist "%tokenstore%\" ( mkdir "%tokenstore%" %nul% if %winbuild% LSS 9200 set "d=$sddl = 'O:NSG:NSD:AI(A;OICIID;FA;;;SY)(A;OICIID;FA;;;BA)(A;OICIID;FA;;;NS)';" if %winbuild% GEQ 9200 set "d=$sddl = 'O:BAG:BAD:PAI(A;OICI;FA;;;SY)(A;OICI;FA;;;BA)(A;OICIIO;GR;;;BU)(A;;FR;;;BU)(A;OICI;FA;;;S-1-5-80-123231216-2592883651-3715271367-3753151631-4175906628)';" @@ -1654,7 +1668,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% +%psc% "if (-not $env:_vis) {Start-Job { Stop-Service %_slser% -force } | Wait-Job -Timeout 20 | Out-Null}; $sls = Get-WmiObject SoftwareLicensingService; $f=[io.file]::ReadAllText('!_batp!') -split ':xrm\:.*';iex ($f[1]); ReinstallLicenses" %nul% call :dk_actid 55c92734-d682-4d71-983e-d6ec3f16059f if not defined apps ( set "_notfoundids=Key Not Installed / Act ID Not Found" @@ -1669,7 +1683,7 @@ call :dk_color %Red% "Checking Activation IDs [!_notfoundids!]" ) -if exist "%tokenstore%\" if not exist "%tokenstore%\tokens.dat" ( +if %winbuild% GEQ 7600 if exist "%tokenstore%\" if not exist "%tokenstore%\tokens.dat" ( set error=1 call :dk_color %Red% "Checking SPP tokens.dat [Not Found] [%tokenstore%\]" ) @@ -1804,8 +1818,10 @@ $wpaKey.Close() if %_NCS% EQU 1 ( echo %esc%[%~1%~2%esc%[0m -) else ( +) else if exist %ps% ( %psc% write-host -back '%1' -fore '%2' '%3' +) else if not exist %ps% ( +echo %~3 ) exit /b @@ -1813,8 +1829,10 @@ exit /b if %_NCS% EQU 1 ( echo %esc%[%~1%~2%esc%[%~3%~4%esc%[0m -) else ( +) else if exist %ps% ( %psc% write-host -back '%1' -fore '%2' '%3' -NoNewline; write-host -back '%4' -fore '%5' '%6' +) else if not exist %ps% ( +echo %~3 %~6 ) exit /b diff --git a/MAS/Separate-Files-Version/Activators/Ohook_Activation_AIO.cmd b/MAS/Separate-Files-Version/Activators/Ohook_Activation_AIO.cmd index 6de8e0c..7fe95f3 100644 --- a/MAS/Separate-Files-Version/Activators/Ohook_Activation_AIO.cmd +++ b/MAS/Separate-Files-Version/Activators/Ohook_Activation_AIO.cmd @@ -1326,10 +1326,16 @@ exit /b :dk_setvar -set psc=powershell.exe -nop -c +set ps=%SysPath%\WindowsPowerShell\v1.0\powershell.exe +set psc=%ps% -nop -c set winbuild=1 for /f "tokens=6 delims=[]. " %%G in ('ver') do set winbuild=%%G +set _slexe=sppsvc.exe& set _slser=sppsvc +if %winbuild% LEQ 6300 (set _slexe=SLsvc.exe& set _slser=SLsvc) +if %winbuild% LSS 7600 if exist "%SysPath%\SLsvc.exe" (set _slexe=SLsvc.exe& set _slser=SLsvc) +if %_slexe%==SLsvc.exe set _vis=1 + set _NCS=1 if %winbuild% LSS 10586 set _NCS=0 if %winbuild% GEQ 10586 reg query "HKCU\Console" /v ForceV2 %nul2% | find /i "0x0" %nul1% && (set _NCS=0) @@ -1472,7 +1478,7 @@ function InstallLicenseArr($Str) { ForEach ($x in $a) {InstallLicenseFile "$x"} } function InstallLicenseDir($Loc) { - dir $Loc *.xrm-ms -af -s | select -expand FullName | % {InstallLicenseFile "$_"} + Get-ChildItem $Loc -Recurse -Filter *.xrm-ms | ForEach-Object {InstallLicenseFile $_.FullName} } function ReinstallLicenses() { $Oem = "$env:SysPath\oem" @@ -1496,16 +1502,16 @@ exit /b :dk_sppissue -sc start sppsvc %nul% +sc start %_slser% %nul% set spperror=%errorlevel% if %spperror% NEQ 1056 if %spperror% NEQ 0 ( %eline% -echo sc start sppsvc [Error Code: %spperror%] +echo sc start %_slser% [Error Code: %spperror%] ) echo: -%psc% "$job = Start-Job { (Get-WmiObject -Query 'SELECT * FROM %sps%').Version }; if (-not (Wait-Job $job -Timeout 30)) {write-host 'sppsvc is not working correctly. Check this webpage for help - %mas%troubleshoot'}" +%psc% "$job = Start-Job { (Get-WmiObject -Query 'SELECT * FROM %sps%').Version }; if (-not (Wait-Job $job -Timeout 30)) {write-host '%_slser% is not working correctly. Check this webpage for help - %mas%troubleshoot'}" exit /b :: Get Product name (WMI/REG methods are not reliable in all conditions, hence winbrand.dll method is used) @@ -1523,6 +1529,11 @@ if %winbuild% GEQ 22000 ( set winos=!winos:Windows 10=Windows 11! ) ) +if %winbuild% LSS 7600 ( +set "winos=!winos:VistaT=Vista!" +set "winos=!winos:Serverr=Server!" +) + exit /b :: Common lines used in PowerShell reflection code @@ -1553,11 +1564,11 @@ for %%# in (avira.com kaspersky.com virustotal.com mcafee.com) do ( find /i "%%#" %SysPath%\drivers\etc\hosts %nul% && set /a hcount+=1) if %hcount%==4 set "results=[Antivirus URLs are blocked in hosts]" -sc start sppsvc %nul% +sc start %_slser% %nul% echo "%errorlevel%" | findstr "577 225" %nul% && ( set "results=%results%[Likely File Infector]" ) || ( -if not exist %SysPath%\sppsvc.exe if not exist %SysPath%\alg.exe (set "results=%results%[Likely File Infector]") +if not exist %SysPath%\%_slexe% if not exist %SysPath%\alg.exe (set "results=%results%[Likely File Infector]") ) if not "%results%%pupfound%"=="" ( @@ -1637,6 +1648,7 @@ for %%# in (%serv_ste%) do ( if /i %%#==ClipSVC (reg add "HKLM\SYSTEM\CurrentControlSet\Services\%%#" /v "Start" /t REG_DWORD /d "3" /f %nul% & sc config %%# start= demand %nul%) if /i %%#==wlidsvc sc config %%# start= demand %nul% if /i %%#==sppsvc (reg add "HKLM\SYSTEM\CurrentControlSet\Services\%%#" /v "Start" /t REG_DWORD /d "2" /f %nul% & sc config %%# start= delayed-auto %nul%) +if /i %%#==SLsvc sc config %%# start= auto %nul% if /i %%#==KeyIso sc config %%# start= demand %nul% if /i %%#==LicenseManager sc config %%# start= demand %nul% if /i %%#==Winmgmt sc config %%# start= auto %nul% @@ -1766,7 +1778,7 @@ 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" ( +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" if not exist "%SysPath%\licensing\skus\Security-Licensing-SLC-Component-SKU-%osedition%\*-%osedition%-*.xrm-ms" ( set skunotfound=1 call :dk_color %Red% "Checking License Files [Not Found] [%osedition%]" ) @@ -1848,7 +1860,7 @@ call :dk_color2 %Blue% "In case of activation issues, do this - " %_Yellow% " %m ) -for %%# in (SppEx%w%tComObj.exe sppsvc.exe sppsvc.exe\PerfOptions) do ( +for %%# in (SppEx%w%tComObj.exe SLsvc.exe sppsvc.exe sppsvc.exe\PerfOptions) do ( reg query "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Ima%w%ge File Execu%w%tion Options\%%#" %nul% && (if defined _sppint (set "_sppint=!_sppint!, %%#") else (set "_sppint=%%#")) ) if defined _sppint ( @@ -1862,14 +1874,14 @@ echo Checking SPP In IFEO [%_sppint%] ) -for /f "skip=2 tokens=2*" %%a in ('reg query "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\SoftwareProtectionPlatform" /v "SkipRearm" %nul6%') do if /i %%b NEQ 0x0 ( +if %winbuild% GEQ 7600 for /f "skip=2 tokens=2*" %%a in ('reg query "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\SoftwareProtectionPlatform" /v "SkipRearm" %nul6%') do if /i %%b NEQ 0x0 ( 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" ) -reg query "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\SoftwareProtectionPlatform\Plugins\Objects\msft:rm/algorithm/hwid/4.0" /f ba02fed39662 /d %nul% || ( +if %winbuild% GEQ 7600 reg query "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\SoftwareProtectionPlatform\Plugins\Objects\msft:rm/algorithm/hwid/4.0" /f ba02fed39662 /d %nul% || ( call :dk_color %Red% "Checking SPP Registry Key [Incorrect ModuleId Found]" set fixes=%fixes% %mas%issues_due_to_gaming_spoofers call :dk_color2 %Blue% "Most likely caused by gaming spoofers. Check this webpage for help - " %_Yellow% " %mas%issues_due_to_gaming_spoofers" @@ -1879,21 +1891,22 @@ set showfix=1 set tokenstore= +if %winbuild% GEQ 7600 ( for /f "skip=2 tokens=2*" %%a in ('reg query "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\SoftwareProtectionPlatform" /v TokenStore %nul6%') do call set "tokenstore=%%b" if %winbuild% LSS 9200 set "tokenstore=%Systemdrive%\Windows\ServiceProfiles\NetworkService\AppData\Roaming\Microsoft\SoftwareProtectionPlatform" -if %winbuild% GEQ 9200 if /i not "%tokenstore%"=="%SysPath%\spp\store" if /i not "%tokenstore%"=="%SysPath%\spp\store\2.0" if /i not "%tokenstore%"=="%SysPath%\spp\store_test\2.0" ( +if %winbuild% GEQ 9200 if /i not "!tokenstore!"=="%SysPath%\spp\store" if /i not "!tokenstore!"=="%SysPath%\spp\store\2.0" if /i not "!tokenstore!"=="%SysPath%\spp\store_test\2.0" ( set toerr=1 set error=1 set showfix=1 -call :dk_color %Red% "Checking TokenStore Registry Key [Correct Path Not Found] [%tokenstore%]" +call :dk_color %Red% "Checking TokenStore Registry Key [Correct Path Not Found] [!tokenstore!]" set fixes=%fixes% %mas%troubleshoot call :dk_color2 %Blue% "Check this webpage for help - " %_Yellow% " %mas%troubleshoot" ) - +) :: This code creates token folder only if it's missing and sets default permission for it -if not defined toerr if not exist "%tokenstore%\" ( +if %winbuild% GEQ 7600 if not defined toerr if not exist "%tokenstore%\" ( mkdir "%tokenstore%" %nul% if %winbuild% LSS 9200 set "d=$sddl = 'O:NSG:NSD:AI(A;OICIID;FA;;;SY)(A;OICIID;FA;;;BA)(A;OICIID;FA;;;NS)';" if %winbuild% GEQ 9200 set "d=$sddl = 'O:BAG:BAD:PAI(A;OICI;FA;;;SY)(A;OICI;FA;;;BA)(A;OICIIO;GR;;;BU)(A;;FR;;;BU)(A;OICI;FA;;;S-1-5-80-123231216-2592883651-3715271367-3753151631-4175906628)';" @@ -1914,7 +1927,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% +%psc% "if (-not $env:_vis) {Start-Job { Stop-Service %_slser% -force } | Wait-Job -Timeout 20 | Out-Null}; $sls = Get-WmiObject SoftwareLicensingService; $f=[io.file]::ReadAllText('!_batp!') -split ':xrm\:.*';iex ($f[1]); ReinstallLicenses" %nul% call :dk_actid 55c92734-d682-4d71-983e-d6ec3f16059f if not defined apps ( set "_notfoundids=Key Not Installed / Act ID Not Found" @@ -1929,7 +1942,7 @@ call :dk_color %Red% "Checking Activation IDs [!_notfoundids!]" ) -if exist "%tokenstore%\" if not exist "%tokenstore%\tokens.dat" ( +if %winbuild% GEQ 7600 if exist "%tokenstore%\" if not exist "%tokenstore%\tokens.dat" ( set error=1 call :dk_color %Red% "Checking SPP tokens.dat [Not Found] [%tokenstore%\]" ) @@ -2064,8 +2077,10 @@ $wpaKey.Close() if %_NCS% EQU 1 ( echo %esc%[%~1%~2%esc%[0m -) else ( +) else if exist %ps% ( %psc% write-host -back '%1' -fore '%2' '%3' +) else if not exist %ps% ( +echo %~3 ) exit /b @@ -2073,8 +2088,10 @@ exit /b if %_NCS% EQU 1 ( echo %esc%[%~1%~2%esc%[%~3%~4%esc%[0m -) else ( +) else if exist %ps% ( %psc% write-host -back '%1' -fore '%2' '%3' -NoNewline; write-host -back '%4' -fore '%5' '%6' +) else if not exist %ps% ( +echo %~3 %~6 ) exit /b diff --git a/MAS/Separate-Files-Version/Activators/Online_KMS_Activation.cmd b/MAS/Separate-Files-Version/Activators/Online_KMS_Activation.cmd index 9f4bed2..940c217 100644 --- a/MAS/Separate-Files-Version/Activators/Online_KMS_Activation.cmd +++ b/MAS/Separate-Files-Version/Activators/Online_KMS_Activation.cmd @@ -202,10 +202,27 @@ call :dk_color2 %Blue% "Check this webpage for help - " %_Yellow% " %mas%trouble goto dk_done ) -if %winbuild% LSS 7600 ( +if %winbuild% LSS 6001 ( %nceline% echo Unsupported OS version detected [%winbuild%]. -echo MAS only supports Windows 7/8/8.1/10/11 and their Server equivalents. +echo MAS only supports Windows Vista/7/8/8.1/10/11 and their Server equivalents. +if %winbuild% EQU 6000 ( +echo: +echo Windows Vista RTM is not supported because Powershell cannot be installed. +echo Upgrade to Windows Vista SP1 or SP2. +) +goto dk_done +) + +if not exist %ps% ( +%nceline% +echo PowerShell is not installed in your system. +if %winbuild% LSS 7600 ( +echo Install PowerShell using the following URL. +echo: +echo https://www.catalog.update.microsoft.com/Search.aspx?q=KB968930 +start https://www.catalog.update.microsoft.com/Search.aspx?q=KB968930 +) goto dk_done ) @@ -468,9 +485,9 @@ echo: echo Initializing... call :dk_chkmal -if not exist %SysPath%\sppsvc.exe ( +if not exist %SysPath%\%_slexe% ( %eline% -echo [%SysPath%\sppsvc.exe] file is missing, aborting... +echo [%SysPath%\%_slexe%] file is missing, aborting... echo: set fixes=%fixes% %mas%troubleshoot call :dk_color2 %Blue% "Check this webpage for help - " %_Yellow% " %mas%troubleshoot" @@ -522,7 +539,7 @@ call :dk_color %Blue% "Internet is required for Online %KS% Activation." echo Initiating Diagnostic Tests... -set "_serv=sppsvc Winmgmt" +set "_serv=%_slser% Winmgmt" :: Software Protection :: Windows Management Instrumentation @@ -612,9 +629,11 @@ echo [%winos% ^| %winbuild% ^| SKU:%osSKU%] if %winbuild% GEQ 9200 if exist "%SysPath%\spp\tokens\skus\%osedition%\*GVLK*.xrm-ms" set sppks=1 if %winbuild% LSS 9200 if exist "%SysPath%\spp\tokens\skus\Security-SPP-Component-SKU-%osedition%\*VLKMS*.xrm-ms" set sppks=1 if %winbuild% LSS 9200 if exist "%SysPath%\spp\tokens\skus\Security-SPP-Component-SKU-%osedition%\*VL-BYPASS*.xrm-ms" set sppks=1 +if %winbuild% LSS 7600 if exist "%SysPath%\licensing\skus\Security-Licensing-SLC-Component-SKU-%osedition%\*KMS*.xrm-ms" set sppks=1 +if %winbuild% LSS 7600 if exist "%SysPath%\licensing\skus\Security-Licensing-SLC-Component-SKU-%osedition%\*VL-BYPASS*.xrm-ms" set sppks=1 if defined skunotfound ( -call :dk_color %Red% "Required license files not found in %SysPath%\spp\tokens\skus\" +call :dk_color %Red% "Required license files not found." set fixes=%fixes% %mas%troubleshoot call :dk_color2 %Blue% "Check this webpage for help - " %_Yellow% " %mas%troubleshoot" ) @@ -1648,6 +1667,11 @@ set "nul=>nul 2>&1" for /f "tokens=6 delims=[]. " %%G in ('ver') do set winbuild=%%G set psc=powershell.exe -nop -c +set _slexe=sppsvc.exe& set _slser=sppsvc +if %winbuild% LEQ 6300 (set _slexe=SLsvc.exe& set _slser=SLsvc) +if %winbuild% LSS 7600 if exist "%SysPath%\SLsvc.exe" (set _slexe=SLsvc.exe& set _slser=SLsvc) +if %_slexe%==SLsvc.exe set _vis=1 + set run_once= set t_name=Renewal Task reg query "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Schedule\taskcache\tasks" /f Path /s | find /i "\Activation-Run_Once" >nul && ( @@ -1711,7 +1735,7 @@ call :_taskclear-cache :: Check WMI and sppsvc Errors set applist= -net start sppsvc /y %nul% +net start %_slser% /y %nul% if %_wmic% EQU 1 set "chkapp=for /f "tokens=2 delims==" %%a in ('"wmic path %slp% where (ApplicationID='%_wApp%') get ID /VALUE" 2^>nul')" if %_wmic% EQU 0 set "chkapp=for /f "tokens=2 delims==" %%a in ('%psc% "(([WMISEARCHER]'SELECT ID FROM %slp% WHERE ApplicationID=''%_wApp%''').Get()).ID ^| %% {echo ('ID='+$_)}" 2^>nul')" %chkapp% do (if defined applist (call set "applist=!applist! %%a") else (call set "applist=%%a")) @@ -2013,12 +2037,20 @@ exit /b :_taskclear-cache set w= -for %%# in (SppE%w%xtComObj.exe sppsvc.exe) do ( +for %%# in (SppE%w%xtComObj.exe sppsvc.exe SLsvc.exe) do ( reg delete "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Ima%w%ge File Execu%w%tion Options\%%#" /f %nul% ) set "OPPk=SOFTWARE\Microsoft\OfficeSoftwareProtectionPlatform" + +if %winbuild% LSS 7600 ( +reg query "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\SL" %nul% && ( +set "SPPk=SOFTWARE\Microsoft\Windows NT\CurrentVersion\SL" +) +) +if not defined SPPk ( set "SPPk=SOFTWARE\Microsoft\Windows NT\CurrentVersion\SoftwareProtectionPlatform" +) set "slp=SoftwareLicensingProduct" set "ospp=OfficeSoftwareProtectionProduct" @@ -2134,10 +2166,11 @@ for /f %%G in ('%psc% "[Guid]::NewGuid().Guid"') do set "randguid=%%G" set "_temp=%SystemRoot%\Temp\%Random%%randguid%" set nil= +if %winbuild% LSS 7600 (set _vista=_vista) if exist "%_temp%\.*" rmdir /s /q "%_temp%\" %nul% md "%_temp%\" %nul% -call :ks_RenExport renewal "%_temp%\Renewal.xml" Unicode -if not defined _int (call :ks_RenExport run_once "%_temp%\Run_Once.xml" Unicode) +call :ks_RenExport renewal%_vista% "%_temp%\Renewal.xml" Unicode +if not defined _int (call :ks_RenExport run_once%_vista% "%_temp%\Run_Once.xml" Unicode) s%nil%cht%nil%asks /cre%nil%ate /tn "Activation-Renewal" /ru "SYS%nil%TEM" /xml "%_temp%\Renewal.xml" %nul% if not defined _int (s%nil%cht%nil%asks /cre%nil%ate /tn "Activation-Run_Once" /ru "SYS%nil%TEM" /xml "%_temp%\Run_Once.xml" %nul%) if exist "%_temp%\.*" rmdir /s /q "%_temp%\" %nul% @@ -2326,16 +2359,137 @@ exit /b :run_once: +:renewal_vista: + + + + 1999-01-01T12:00:00.34375 + WindowsAddict + Online K-M-S Activation-Renewal - Weekly Task + + + + 1999-01-01T12:00:00.34375 + true + + + + + 1 + + + + + + S-1-5-18 + HighestAvailable + + + + + PT10M + PT1H + true + false + + IgnoreNew + false + true + true + true + true + + true + true + false + false + false + PT10M + 7 + + PT5M + 3 + + + + + %ProgramFiles%\Activation-Renewal\Activation_task.cmd + Task + + + +:renewal_vista: + +:run_once_vista: + + + + 1999-01-01T12:00:00.34375 + WindowsAddict + Online K-M-S Activation Run Once - Run and Delete itself on first Internet Contact + + + + true + + + + + S-1-5-18 + HighestAvailable + + + + + PT10M + PT1H + true + false + + IgnoreNew + false + true + true + true + true + + true + true + false + false + false + PT10M + 7 + + PT5M + 3 + + + + + %ProgramFiles%\Activation-Renewal\Activation_task.cmd + Task + + + +:run_once_vista: + ::======================================================================================================================================== :: Set variables :dk_setvar -set psc=powershell.exe -nop -c +set ps=%SysPath%\WindowsPowerShell\v1.0\powershell.exe +set psc=%ps% -nop -c set winbuild=1 for /f "tokens=6 delims=[]. " %%G in ('ver') do set winbuild=%%G +set _slexe=sppsvc.exe& set _slser=sppsvc +if %winbuild% LEQ 6300 (set _slexe=SLsvc.exe& set _slser=SLsvc) +if %winbuild% LSS 7600 if exist "%SysPath%\SLsvc.exe" (set _slexe=SLsvc.exe& set _slser=SLsvc) +if %_slexe%==SLsvc.exe set _vis=1 + set _NCS=1 if %winbuild% LSS 10586 set _NCS=0 if %winbuild% GEQ 10586 reg query "HKCU\Console" /v ForceV2 %nul2% | find /i "0x0" %nul1% && (set _NCS=0) @@ -2539,6 +2693,8 @@ exit /b :dk_reeval +if %winbuild% LSS 7600 exit /b + :: This key is left by the system in rearm process and sppsvc sometimes fails to delete it, it causes issues in working of the Scheduled Tasks of SPP set "ruleskey=HKU\S-1-5-20\Software\Microsoft\Windows NT\CurrentVersion\SoftwareProtectionPlatform\PersistedSystemState" @@ -2566,13 +2722,13 @@ function InstallLicenseArr($Str) { ForEach ($x in $a) {InstallLicenseFile "$x"} } function InstallLicenseDir($Loc) { - dir $Loc *.xrm-ms -af -s | select -expand FullName | % {InstallLicenseFile "$_"} + Get-ChildItem $Loc -Recurse -Filter *.xrm-ms | ForEach-Object {InstallLicenseFile $_.FullName} } function ReinstallLicenses() { - $Oem = "$env:SysPath\oem" - $Spp = "$env:SysPath\spp\tokens" - InstallLicenseDir "$Spp" - If (Test-Path $Oem) {InstallLicenseDir "$Oem"} + $Paths = @("$env:SysPath\oem", "$env:SysPath\licensing", "$env:SysPath\spp\tokens") + foreach ($Path in $Paths) { + if (Test-Path $Path) { InstallLicenseDir "$Path" } + } } :xrm: @@ -2590,16 +2746,16 @@ exit /b :dk_sppissue -sc start sppsvc %nul% +sc start %_slser% %nul% set spperror=%errorlevel% if %spperror% NEQ 1056 if %spperror% NEQ 0 ( %eline% -echo sc start sppsvc [Error Code: %spperror%] +echo sc start %_slser% [Error Code: %spperror%] ) echo: -%psc% "$job = Start-Job { (Get-WmiObject -Query 'SELECT * FROM %sps%').Version }; if (-not (Wait-Job $job -Timeout 30)) {write-host 'sppsvc is not working correctly. Check this webpage for help - %mas%troubleshoot'}" +%psc% "$job = Start-Job { (Get-WmiObject -Query 'SELECT * FROM %sps%').Version }; if (-not (Wait-Job $job -Timeout 30)) {write-host '%_slser% is not working correctly. Check this webpage for help - %mas%troubleshoot'}" exit /b :: Get Product name (WMI/REG methods are not reliable in all conditions, hence winbrand.dll method is used) @@ -2617,6 +2773,10 @@ if %winbuild% GEQ 22000 ( set winos=!winos:Windows 10=Windows 11! ) ) +if %winbuild% LSS 7600 ( +set "winos=!winos:VistaT=Vista!" +set "winos=!winos:Serverr=Server!" +) if not defined winsub exit /b @@ -2708,11 +2868,11 @@ for %%# in (avira.com kaspersky.com virustotal.com mcafee.com) do ( find /i "%%#" %SysPath%\drivers\etc\hosts %nul% && set /a hcount+=1) if %hcount%==4 set "results=[Antivirus URLs are blocked in hosts]" -sc start sppsvc %nul% +sc start %_slser% %nul% echo "%errorlevel%" | findstr "577 225" %nul% && ( set "results=%results%[Likely File Infector]" ) || ( -if not exist %SysPath%\sppsvc.exe if not exist %SysPath%\alg.exe (set "results=%results%[Likely File Infector]") +if not exist %SysPath%\%_slexe% if not exist %SysPath%\alg.exe (set "results=%results%[Likely File Infector]") ) if not "%results%%pupfound%"=="" ( @@ -2792,6 +2952,7 @@ for %%# in (%serv_ste%) do ( if /i %%#==ClipSVC (reg add "HKLM\SYSTEM\CurrentControlSet\Services\%%#" /v "Start" /t REG_DWORD /d "3" /f %nul% & sc config %%# start= demand %nul%) if /i %%#==wlidsvc sc config %%# start= demand %nul% if /i %%#==sppsvc (reg add "HKLM\SYSTEM\CurrentControlSet\Services\%%#" /v "Start" /t REG_DWORD /d "2" /f %nul% & sc config %%# start= delayed-auto %nul%) +if /i %%#==SLsvc sc config %%# start= auto %nul% if /i %%#==KeyIso sc config %%# start= demand %nul% if /i %%#==LicenseManager sc config %%# start= demand %nul% if /i %%#==Winmgmt sc config %%# start= auto %nul% @@ -2921,7 +3082,7 @@ 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" ( +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" if not exist "%SysPath%\licensing\skus\Security-Licensing-SLC-Component-SKU-%osedition%\*-%osedition%-*.xrm-ms" ( set skunotfound=1 call :dk_color %Red% "Checking License Files [Not Found] [%osedition%]" ) @@ -3003,7 +3164,7 @@ call :dk_color2 %Blue% "In case of activation issues, do this - " %_Yellow% " %m ) -for %%# in (SppEx%w%tComObj.exe sppsvc.exe sppsvc.exe\PerfOptions) do ( +for %%# in (SppEx%w%tComObj.exe SLsvc.exe sppsvc.exe sppsvc.exe\PerfOptions) do ( reg query "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Ima%w%ge File Execu%w%tion Options\%%#" %nul% && (if defined _sppint (set "_sppint=!_sppint!, %%#") else (set "_sppint=%%#")) ) if defined _sppint ( @@ -3017,14 +3178,14 @@ echo Checking SPP In IFEO [%_sppint%] ) -for /f "skip=2 tokens=2*" %%a in ('reg query "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\SoftwareProtectionPlatform" /v "SkipRearm" %nul6%') do if /i %%b NEQ 0x0 ( +if %winbuild% GEQ 7600 for /f "skip=2 tokens=2*" %%a in ('reg query "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\SoftwareProtectionPlatform" /v "SkipRearm" %nul6%') do if /i %%b NEQ 0x0 ( 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" ) -reg query "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\SoftwareProtectionPlatform\Plugins\Objects\msft:rm/algorithm/hwid/4.0" /f ba02fed39662 /d %nul% || ( +if %winbuild% GEQ 7600 reg query "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\SoftwareProtectionPlatform\Plugins\Objects\msft:rm/algorithm/hwid/4.0" /f ba02fed39662 /d %nul% || ( call :dk_color %Red% "Checking SPP Registry Key [Incorrect ModuleId Found]" set fixes=%fixes% %mas%issues_due_to_gaming_spoofers call :dk_color2 %Blue% "Most likely caused by gaming spoofers. Check this webpage for help - " %_Yellow% " %mas%issues_due_to_gaming_spoofers" @@ -3034,21 +3195,22 @@ set showfix=1 set tokenstore= +if %winbuild% GEQ 7600 ( for /f "skip=2 tokens=2*" %%a in ('reg query "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\SoftwareProtectionPlatform" /v TokenStore %nul6%') do call set "tokenstore=%%b" if %winbuild% LSS 9200 set "tokenstore=%Systemdrive%\Windows\ServiceProfiles\NetworkService\AppData\Roaming\Microsoft\SoftwareProtectionPlatform" -if %winbuild% GEQ 9200 if /i not "%tokenstore%"=="%SysPath%\spp\store" if /i not "%tokenstore%"=="%SysPath%\spp\store\2.0" if /i not "%tokenstore%"=="%SysPath%\spp\store_test\2.0" ( +if %winbuild% GEQ 9200 if /i not "!tokenstore!"=="%SysPath%\spp\store" if /i not "!tokenstore!"=="%SysPath%\spp\store\2.0" if /i not "!tokenstore!"=="%SysPath%\spp\store_test\2.0" ( set toerr=1 set error=1 set showfix=1 -call :dk_color %Red% "Checking TokenStore Registry Key [Correct Path Not Found] [%tokenstore%]" +call :dk_color %Red% "Checking TokenStore Registry Key [Correct Path Not Found] [!tokenstore!]" set fixes=%fixes% %mas%troubleshoot call :dk_color2 %Blue% "Check this webpage for help - " %_Yellow% " %mas%troubleshoot" ) - +) :: This code creates token folder only if it's missing and sets default permission for it -if not defined toerr if not exist "%tokenstore%\" ( +if %winbuild% GEQ 7600 if not defined toerr if not exist "%tokenstore%\" ( mkdir "%tokenstore%" %nul% if %winbuild% LSS 9200 set "d=$sddl = 'O:NSG:NSD:AI(A;OICIID;FA;;;SY)(A;OICIID;FA;;;BA)(A;OICIID;FA;;;NS)';" if %winbuild% GEQ 9200 set "d=$sddl = 'O:BAG:BAD:PAI(A;OICI;FA;;;SY)(A;OICI;FA;;;BA)(A;OICIIO;GR;;;BU)(A;;FR;;;BU)(A;OICI;FA;;;S-1-5-80-123231216-2592883651-3715271367-3753151631-4175906628)';" @@ -3069,7 +3231,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% +%psc% "if (-not $env:_vis) {Start-Job { Stop-Service %_slser% -force } | Wait-Job -Timeout 20 | Out-Null}; $sls = Get-WmiObject SoftwareLicensingService; $f=[io.file]::ReadAllText('!_batp!') -split ':xrm\:.*';iex ($f[1]); ReinstallLicenses" %nul% call :dk_actid 55c92734-d682-4d71-983e-d6ec3f16059f if not defined apps ( set "_notfoundids=Key Not Installed / Act ID Not Found" @@ -3084,7 +3246,7 @@ call :dk_color %Red% "Checking Activation IDs [!_notfoundids!]" ) -if exist "%tokenstore%\" if not exist "%tokenstore%\tokens.dat" ( +if %winbuild% GEQ 7600 if exist "%tokenstore%\" if not exist "%tokenstore%\tokens.dat" ( set error=1 call :dk_color %Red% "Checking SPP tokens.dat [Not Found] [%tokenstore%\]" ) @@ -3219,8 +3381,10 @@ $wpaKey.Close() if %_NCS% EQU 1 ( echo %esc%[%~1%~2%esc%[0m -) else ( +) else if exist %ps% ( %psc% write-host -back '%1' -fore '%2' '%3' +) else if not exist %ps% ( +echo %~3 ) exit /b @@ -3228,8 +3392,10 @@ exit /b if %_NCS% EQU 1 ( echo %esc%[%~1%~2%esc%[%~3%~4%esc%[0m -) else ( +) else if exist %ps% ( %psc% write-host -back '%1' -fore '%2' '%3' -NoNewline; write-host -back '%4' -fore '%5' '%6' +) else if not exist %ps% ( +echo %~3 %~6 ) exit /b @@ -3588,7 +3754,22 @@ a78b8bd9-8017-4df5-b86a-09f756affa7c_6TPJF-RBVHG-WBW2R-86QPH-6R%f%TM4__17_Server cda18cf3-c196-46ad-b289-60c072869994_TT8MH-CG224-D3D7Q-498W2-9Q%f%CTX__18_ServerHPC a78b8bd9-8017-4df5-b86a-09f756affa7c_6TPJF-RBVHG-WBW2R-86QPH-6R%f%TM4__29_ServerWebCore f772515c-0e87-48d5-a676-e6962c3e1195_736RG-XDKJK-V34PF-BHK87-J6%f%X3K__56_ServerEmbeddedSolution -::======================================================================================================================================== +:: Windows Vista +cfd8ff08-c0d7-452b-9f60-ef5c70c32094_VKK3X-68KWM-X2YGT-QR4M6-4B%f%WMV___4_Enterprise +4f3d1606-3fea-4c01-be3c-8d671c401e3b_YFKBB-PQJJV-G996G-VWGXY-2V%f%3X8___6_Business +2c682dc2-8b68-4f63-a165-ae291d4cf138_HMBQG-8H2RH-C77VX-27R82-VM%f%QBT__16_BusinessN +d4f54950-26f2-4fb4-ba21-ffab16afcade_VTC42-BM838-43QHV-84HX6-XJ%f%XKV__27_EnterpriseN +:: Windows Server 2008 +ad2542d4-9154-4c6d-8a44-30f11ee96989_TM24T-X9RMF-VWXK6-X8JC9-BF%f%GM2___7_ServerStandard +68b6e220-cf09-466b-92d3-45cd964b9509_7M67G-PC374-GR742-YH8V4-TC%f%BY3___8_ServerDatacenter +c1af4d90-d1bc-44ca-85d4-003ba33db3b9_YQGMW-MPWTJ-34KDK-48M3W-X4%f%Q6V__10_ServerEnterprise +01ef176b-3e0d-422a-b4f8-4ea880035e8f_4DWFP-JF3DJ-B7DTH-78FJB-PD%f%RHK__15_ServerEnterpriseIA64 +ddfa9f7c-f09e-40b9-8c1a-be877a9a7f4b_WYR28-R7TFJ-3X2YQ-YCY4H-M2%f%49D__17_ServerWeb +7afb1156-2c1d-40fc-b260-aab7442b62fe_RCTX3-KWVHP-BR6TB-RB6DM-6X%f%7HP__18_ServerComputeCluster +2401e3d0-c50a-4b58-87b2-7e794b7d2607_W7VD6-7JFBR-RX26B-YKQ3Y-6F%f%FFJ__36_ServerStandardV +fd09ef77-5647-4eff-809c-af2b64659a45_22XQ2-VRXRG-P8D42-K34TD-G3%f%QQC__37_ServerDatacenterV +8198490a-add0-47b2-b3ba-316b12d647b4_39BXF-X8Q23-P2WWT-38T2F-G3%f%FPG__38_ServerEnterpriseV +::======================================================================================================================================= :: Office 2010 8ce7e872-188c-4b98-9d90-f8f90b7aad02_V7Y44-9T38C-R2VJK-666HK-T7%f%DDX__14_AccessVL cee5d470-6e3b-4fcc-8c2b-d17428568a9f_H62QG-HXVKF-PP4HP-66KMR-CW%f%9BM__14_ExcelVL diff --git a/MAS/Separate-Files-Version/Activators/TSforge_Activation.cmd b/MAS/Separate-Files-Version/Activators/TSforge_Activation.cmd index ebc1399..e5228bb 100644 --- a/MAS/Separate-Files-Version/Activators/TSforge_Activation.cmd +++ b/MAS/Separate-Files-Version/Activators/TSforge_Activation.cmd @@ -208,13 +208,42 @@ call :dk_color2 %Blue% "Check this webpage for help - " %_Yellow% " %mas%trouble goto dk_done ) -if %winbuild% LSS 7600 ( +if %winbuild% LSS 6001 ( %nceline% echo Unsupported OS version detected [%winbuild%]. -echo MAS only supports Windows 7/8/8.1/10/11 and their Server equivalents. +echo MAS only supports Windows Vista/7/8/8.1/10/11 and their Server equivalents. +if %winbuild% EQU 6000 ( +echo: +echo Windows Vista RTM is not supported because Powershell cannot be installed. +echo Upgrade to Windows Vista SP1 or SP2. +) goto dk_done ) +if not exist %ps% ( +%nceline% +echo PowerShell is not installed in your system. +if %winbuild% LSS 7600 ( +echo Install PowerShell using the following URL. +echo: +echo https://www.catalog.update.microsoft.com/Search.aspx?q=KB968930 +start https://www.catalog.update.microsoft.com/Search.aspx?q=KB968930 +) +goto dk_done +) + +if %winbuild% LSS 7600 ( +reg query "HKLM\SOFTWARE\Microsoft\NET Framework Setup\NDP\v3.5" /v Install %nul2% | find /i "0x1" %nul1% || ( +%eline% +echo .NET 3.5 Framework is not installed in your system. +echo Install it using the following URL. +echo: +echo https://www.microsoft.com/download/details.aspx?id=25150 +start https://www.microsoft.com/download/details.aspx?id=25150 +goto dk_done +) +) + ::======================================================================================================================================== :: Fix special character limitations in path name @@ -415,7 +444,11 @@ echo [A] Activate - Windows %KS% Host echo [B] Activate - Office %KS% Host echo [C] Activate - Windows 8/8.1 APPX Sideloading echo [D] Activate - Manually Select Products +if defined _vis ( +echo [E] Reset - Rearm/Timers +) else ( echo [E] Reset - Rearm/Timers/Tamper/Lock +) echo _______________________________________________ echo: echo [6] Remove TSforge Activation @@ -461,9 +494,9 @@ echo: echo Initializing... call :dk_chkmal -if not exist %SysPath%\sppsvc.exe ( +if not exist %SysPath%\%_slexe% ( %eline% -echo [%SysPath%\sppsvc.exe] file is missing, aborting... +echo [%SysPath%\%_slexe%] file is missing, aborting... echo: set fixes=%fixes% %mas%troubleshoot call :dk_color2 %Blue% "Check this webpage for help - " %_Yellow% " %mas%troubleshoot" @@ -486,10 +519,10 @@ goto dk_done if %winbuild% LSS 9200 if exist "%SysPath%\wlms\wlms.exe" ( sc query wlms | find /i "RUNNING" %nul% && ( -sc stop sppsvc %nul% +sc stop %_slser% %nul% if !errorlevel! EQU 1051 ( %eline% -echo Evaluation WLMS service is running, sppsvc service can not be stopped. Aborting... +echo Evaluation WLMS service is running, %_slser% service can not be stopped. Aborting... echo Install Non-Eval version for Windows build %winbuild%. echo: set fixes=%fixes% %mas%troubleshoot @@ -522,7 +555,7 @@ call :dk_showosinfo echo Initiating Diagnostic Tests... -set "_serv=sppsvc Winmgmt" +set "_serv=%_slser% Winmgmt" :: Software Protection :: Windows Management Instrumentation @@ -571,6 +604,8 @@ call :dk_color %Gray% "Checking OS Activation [Windows is alrea goto :ts_esu ) +if defined _vis goto :ts_winvista + set tempid= set keytype=zero for /f "delims=" %%a in ('%psc% "$f=[io.file]::ReadAllText('!_batp!') -split ':wintsid\:.*';iex ($f[1])" %nul6%') do ( @@ -593,6 +628,86 @@ goto :ts_esu ::======================================================================================================================================== +:ts_winvista + +:: Process Windows Vista + +:: 1st column = Activation ID +:: 2nd column = Generic key +:: 3rd column = Key channel +:: 4th column = Edition ID +:: Separator = _ + +:: Keys aren't available for these editions, but since these editions aren't publicly available, it doesn't matter +:: a797d61e-1475-470b-86c8-f737a72c188d StarterN +:: 5e9f548a-c8a9-44e6-a6c2-3f8d0a7a99dd ServerComputeClusterV + +set f= +set key= +set tempid= +if not defined allapps call :dk_actids 55c92734-d682-4d71-983e-d6ec3f16059f + +for %%# in ( +:: WindowsVista +9de9abe2-d01d-4538-af84-4498bdbc2ba3_4D2XH-PRBMM-8Q22B-K8BM3-MR%f%W4W_____Retail_Business +db442be4-81ed-4ab3-9d66-2417e8a5c81c_76884-QXFY2-6Q2WX-2QTQ8-QX%f%X44_____Retail_BusinessN +b51791c2-b562-4b73-97b0-735a0e4429a6_YQPQV-RW8R3-XMPFG-RXG9R-JG%f%TVF_____Retail_Enterprise +58c37517-42f8-4723-bb44-30b05791ff2a_Q7J9R-G63R4-BFMHF-FWM9R-RW%f%DMV_____Retail_EnterpriseN +95c6e80a-0ff8-4bd0-95f2-c4a39b79d09e_RCG7P-TX42D-HM8FM-TCFCW-3V%f%4VD_____Retail_HomeBasic +d0333dad-c14e-46f2-b62a-8b47a1b9768b_HY2VV-XC6FF-MD6WV-FPYBQ-GF%f%JBT_____Retail_HomeBasicN +9e042223-03bf-49ae-808f-ff37f128d40d_X9HTF-MKJQQ-XK376-TJ7T4-76%f%PKF_____Retail_HomePremium +92d8977c-d506-4e63-b500-6d39283b6cd5_KJ6TP-PF9W2-23T3Q-XTV7M-PX%f%DT2_____Retail_HomePremiumN +89e51a3c-76c0-4beb-a650-53d34c8f8186_X9PYV-YBQRV-9BXWV-TQDMK-QD%f%WK4_____Retail_Starter +30fab9cc-8614-4339-989f-7ce61fb7a5c4_VMCB9-FDRV6-6CDQM-RV23K-RP%f%8F7_____Retail_Ultimate +1eefed20-8ac0-478c-8774-70cd44782ea1_CVX38-P27B4-2X8BT-RXD4J-V7%f%CKX_____Retail_UltimateN +:: WindowsServer2008 +c9ad502b-ef48-41d1-a2a0-38a38e82fed0_24FV9-H7JW8-C8Q6X-BQKMK-K9%f%77J_____Retail_ServerComputeCluster +866e924e-c2a3-4872-aca1-6b48c13962d5_6QBHY-DXTPJ-T9W3P-DTJXX-4V%f%QMB_____Retail_ServerDatacenter +d020c729-07f0-4f8f-87ce-bf803275c786_83TWG-TD3TC-HRDP2-K93FJ-Y3%f%4YC_OEM:NONSLP_ServerDatacenterV +32b40e5e-0c6d-4c6f-ab12-a031933fd2c6_MRB7H-QJRHG-FXTBR-B2Q2M-8W%f%MTJ_____Retail_ServerEnterprise +256cc990-1692-4ea8-965c-2d423d5dd24e_H4VB6-QPRWH-VDCYM-996P8-MH%f%KFY_OEM:NONSLP_ServerEnterpriseIA64 +1ba5e036-e386-42c4-b7eb-16bdb4fa1945_H8H7M-HDPQT-PJHQF-M7B83-9C%f%VGV_____Retail_ServerEnterpriseV +8df04457-07c8-4301-bce9-d61eb76cb2d6_RGBMC-PQBVF-94Q9K-HD63B-VY%f%6MP_____Retail_ServerHomePremium +5bd23b19-aa71-4a5b-8b68-c8801c2baff6_6C8KR-MD3QK-9GWFW-44CY2-W9%f%CBM_____Retail_ServerHomeStandard +b86c7736-91ff-4de9-bfa9-b32b8a09acac_7XRBY-6MP2K-VQPT8-F37JV-YY%f%Q83_____Retail_ServerMediumBusinessManagement +d3f5642f-081d-40b2-a4b9-efd3054d4584_6PDTD-JK48J-662TF-8J2QV-R4%f%CRB_____Retail_ServerMediumBusinessMessaging +c6936a36-69f3-4994-9857-3069c7b9ec7a_D694V-CMWKH-PY92X-PFQKQ-JC%f%B69_____Retail_ServerMediumBusinessSecurity +cc4c2cf8-ef29-4d8e-b168-2b65a3db3309_MRDK3-YYQF3-88BQJ-D6FJG-69%f%YJY_____Retail_ServerSBSPremium +b3827b27-bd38-4284-98af-e4f4d1c051a0_2KB23-GJRBD-W3T9C-6CH2W-39%f%B7V_____Retail_ServerSBSPrime +5dad0eff-3f6f-4310-8844-422f9dc7c84b_H4XDD-B27GY-667P6-XWVV7-GY%f%G8J_____Retail_ServerSBSStandard +603504f9-109f-49f0-9271-8c66f7878f58_8YVM4-YQBDH-7WDQM-R27WR-WV%f%CWG_____Retail_ServerStandard +65ab7338-9ad0-43fe-af1b-190b577495e2_H9MW3-6V7GK-94P9G-7FTPJ-VK%f%CKF_____Retail_ServerStandardV +2be204da-24a0-4943-b66c-81e8464acd7e_2264C-TD9T8-P8HPW-CC9GH-MH%f%M2V_____Retail_ServerStorageEnterprise +60207eba-8b4a-486c-a013-023b4b742c2f_RCYMT-YX342-8T6YY-XYHYC-3D%f%D7X_____Retail_ServerStorageExpress +368856e9-43f7-4601-8358-e561f36c7dd8_FKFT2-WXYY9-WBPY7-6YMY4-X4%f%8JF_____Retail_ServerStorageStandard +4bf433fa-ab04-4c6c-b55b-00170e14b8cd_8X9J7-HCJ7J-3WDJT-QM7D8-46%f%4YH_____Retail_ServerStorageWorkgroup +a77a6806-f59e-4953-97d7-229317b8e6a6_BGT39-9FYH7-X2CYD-T628F-QP%f%QPW_____Retail_ServerWeb +f92f836d-4d3e-4e90-a08f-2d612d65e716_HPH76-FHFPP-DRW9D-7W2V4-HW%f%GKT_____Retail_ServerWinSB +3059a9fd-b068-4f0d-acaf-66324dca67ac_2V8G6-KRXYR-MMGXJ-6RWM3-GX%f%CCG_____Retail_ServerWinSBV +) do ( +for /f "tokens=1-4 delims=_" %%A in ("%%#") do if %tsedition%==%%D if not defined key ( +echo "%allapps%" | find /i "%%A" %nul1% && ( +set key=%%B +set tempid=%%A +) +) +) + +if not defined key ( +set error=1 +call :dk_color %Red% "Checking Activation ID [%tsedition% SKU-%osSKU% not found in the system]" +call :dk_color %Blue% "%_fixmsg%" +goto :ts_esu +) + +echo Checking Activation ID [%tempid%] [%tsedition%] + +call :ts_inskey "[%key%]" +if not defined error set tsids=%tsids% %tempid% +goto :ts_esu + +::======================================================================================================================================== + :ts_wineval call :dk_color %Gray% "Checking OS Edition [%tsedition%] [Evaluation edition found]" @@ -709,19 +824,7 @@ goto :ts_esu echo Resetting Rearm / GracePeriod [Successful] ) -%psc% "try { $null=(([WMISEARCHER]'SELECT Version FROM %sps%').Get()).InstallProductKey('%key%'); exit 0 } catch { exit $_.Exception.InnerException.HResult }" %nul% -set keyerror=%errorlevel% -cmd /c exit /b %keyerror% -if %keyerror% NEQ 0 set "keyerror=[0x%=ExitCode%]" - -if %keyerror% EQU 0 ( -call :dk_refresh -echo Installing Activable Evaluation Key [%key%] [Successful] -) else ( -set error=1 -call :dk_color %Red% "Installing Activable Evaluation Key [%key%] [Failed] %keyerror%" -call :dk_color %Blue% "%_fixmsg%" -) +call :ts_inskey "[%key%]" ::======================================================================================================================================== @@ -757,7 +860,7 @@ REM Windows7EmbeddedPOSReady7 4f1f646c-1e66-4908-acc7-d1606229b29e_POS-ESU-Year3[1-3y]_-Embedded[POS]- REM Windows7EmbeddedStandard 6aaf1c7d-527f-4ed5-b908-9fc039dfc654_WES-ESU-Year3[1-3y]_-Embedded[Standard]- -REM WindowsServer2008R2 +REM WindowsServer2008/WindowsServer2008R2 8e7bfb1e-acc1-4f56-abae-b80fce56cd4b_Server-ESU-PA[1-6y]_-ServerDatacenter-ServerDatacenterCore-ServerDatacenterV-ServerDatacenterVCore-ServerStandard-ServerStandardCore-ServerStandardV-ServerStandardVCore-ServerEnterprise-ServerEnterpriseCore-ServerEnterpriseV-ServerEnterpriseVCore- REM Windows8.1 4afc620f-12a4-48ad-8015-2aebfbd6e47c_Client-ESU-Year3[1-3y]_-Enterprise-EnterpriseN-Professional-ProfessionalN- @@ -791,6 +894,13 @@ set esuexistbutnosup=1 ) ) +if defined esuexistsup if defined _vis ( +set key=9FPV7-MWGT8-7XPDF-JC23W-WT7TW +REM This is a non-generic blocked MAK key for Server-ESU-PA +call :ts_inskey "[!key!]" +goto :ts_off +) + if defined esuexistsup ( echo "%tsids%" | find /i "4220f546-f522-46df-8202-4d07afd26454" %nul1% && ( echo "%tsids%" | find /i "7e94be23-b161-4956-a682-146ab291774c" %nul1% || ( @@ -813,7 +923,8 @@ goto :ts_off ) set esuavail= -if %winbuild% LEQ 7602 if not defined isThinpc set esuavail=1 +if defined _vis if defined isServer set esuavail=1 +if %winbuild% LEQ 7602 if not defined _vis if not defined isThinpc set esuavail=1 if %winbuild% GTR 7602 if %winbuild% LSS 10240 if defined isServer set esuavail=1 if %winbuild% GEQ 10240 if %winbuild% LEQ 19045 if not defined isServer set esuavail=1 if %winbuild% EQU 9600 set esuavail=1 @@ -835,7 +946,7 @@ if not %_actoff%==1 goto :ts_act if %winbuild% LSS 9200 ( echo: call :dk_color %Gray% "Checking Supported Office [TSforge for Office is supported on Windows 8 and later versions]" -call :dk_color %Blue% "On Windows 7 build, use Online %KS% activation option for Office instead." +call :dk_color %Blue% "On Windows Vista / 7, use Online %KS% activation option for Office instead." goto :ts_act ) @@ -1108,7 +1219,7 @@ echo: if %winbuild% GEQ 10586 ( call :dk_color %Gray% "With %KS% Host license, system may randomly change Windows Edition later. It is a Windows issue and can be safely ignored." ) -call :dk_color %Gray% "%KS% Host [Not to be confused with %KS% Client] license causes the sppsvc service to run continuously." +call :dk_color %Gray% "%KS% Host [Not to be confused with %KS% Client] license causes the %_slser% service to run continuously." call :dk_color %Blue% "Only use this activation when necessary, you can revert to normal activation from the previous menu." if %_unattended%==0 ( @@ -1122,6 +1233,8 @@ set _arr= set tempid= set keytype=kmshost +if defined _vis goto :ts_whost_vista + :: Install current edition csvlk license so that correct edition can reflect for csvlk if %winbuild% GEQ 10586 ( @@ -1153,6 +1266,53 @@ goto :ts_act ::======================================================================================================================================== +:ts_whost_vista + +:: Process Windows K-M-S host for Vista + +:: 1st column = Activation ID +:: 2nd column = CSVLK key +:: 3rd column = Edition IDs +:: Separator = _ + +set f= +set key= +set tempid= +if not defined allapps call :dk_actids 55c92734-d682-4d71-983e-d6ec3f16059f + +for %%# in ( +:: WindowsVista +212a64dc-43b1-4d3d-a30c-2fc69d2095c6_TWVG3-9Q4P8-W9XJF-Y76FJ-DW%f%Q4R_-Business-BusinessN-Enterprise-EnterpriseN- +:: WindowsServer2008 +c90d1b4e-8aa8-439e-8b9e-b6d6b6a6d975_BHC4Q-6D7B7-QMVH7-4MKQH-Y9%f%VK7_-ServerComputeCluster-ServerDatacenter-ServerDatacenterV-ServerEnterprise-ServerEnterpriseIA64-ServerEnterpriseV-ServerStandard-ServerStandardV-ServerWeb- +56df4151-1f9f-41bf-acaa-2941c071872b_PVGKG-2R7XQ-7WTFD-FXTJR-DQ%f%BQ3_-ServerComputeCluster-ServerEnterprise-ServerEnterpriseV-ServerStandard-ServerStandardV-ServerWeb- +c448fa06-49d1-44ec-82bb-0085545c3b51_KH4PC-KJFX6-XFVHQ-GDK2G-JC%f%JY9_-ServerComputeCluster-ServerWeb- +) do ( +for /f "tokens=1-3 delims=_" %%A in ("%%#") do if not defined key ( +echo "%allapps%" | find /i "%%A" %nul1% && ( +echo "%%C" | find /i "-%tsedition%-" %nul1% && ( +set key=%%B +set tempid=%%A +) +) +) +) + +if defined key ( +echo Checking Activation ID [%tempid%] [%tsedition%] +) else ( +call :dk_color %Red% "Checking Activation ID [Not Found] [%tsedition%] [%osSKU%]" +call :dk_color %Blue% "%KS% Host license is not found on your system. It is available for the below editions." +call :dk_color %Blue% "Business, BusinessN, Enterprise, EnterpriseN, and Server editions, etc." +goto :ts_act +) + +call :ts_inskey "[%key%]" +if not defined error set tsids=%tsids% %tempid% +goto :ts_act + +::======================================================================================================================================== + :ts_ohost :: Process Office K-M-S host @@ -1160,6 +1320,12 @@ goto :ts_act echo: echo Processing Office %KS% Host... +if defined _vis ( +echo: +call :dk_color %Blue% "Windows Vista and Server 2008 do not support the installation of Office KMS Host." +goto :ts_act +) + set ohostexist= call :dk_actids 0ff1ce15-a989-479d-af46-f275c6370663 set ohostids=%allapps% @@ -1242,7 +1408,11 @@ goto :ts_act :ts_resetall echo: +if defined _vis ( +echo Processing Reset of Rearm / Timers... +) else ( echo Processing Reset of Rearm / Timers / Tamper / Lock... +) echo: set resetstuff=1 @@ -1291,6 +1461,10 @@ goto :dk_done for /f "delims=" %%a in ('%psc% "$ids = Get-WmiObject -Query 'SELECT ID FROM SoftwareLicensingProduct' | Select-Object -ExpandProperty ID; $ids" %nul6%') do call set "allactids= %%a !allactids! " +if defined _vis ( +echo: +call :dk_color %Blue% "On Windows Vista and Server 2008, you must manually install the key before activating it." +) echo: call :dk_color %Gray% "Enter / Paste the Activation ID shown in first column in the opened text file, or just press Enter to return:" echo Add space after each Activation ID if you are adding multiple: @@ -1421,7 +1595,7 @@ call :dk_color2 %Blue% "Check this webpage for help - " %_Yellow% " %mas%trouble if defined tsids ( echo: -echo Installing Forged Product Key Data... +if not defined _vis echo Installing Forged Product Key Data... echo Depositing Zero Confirmation ID... echo: %psc% "$f=[io.file]::ReadAllText('!_batp!') -split ':tsforge\:.*';& ([ScriptBlock]::Create($f[1])) %tsids%" @@ -1969,10 +2143,16 @@ exit /b :dk_setvar -set psc=powershell.exe -nop -c +set ps=%SysPath%\WindowsPowerShell\v1.0\powershell.exe +set psc=%ps% -nop -c set winbuild=1 for /f "tokens=6 delims=[]. " %%G in ('ver') do set winbuild=%%G +set _slexe=sppsvc.exe& set _slser=sppsvc +if %winbuild% LEQ 6300 (set _slexe=SLsvc.exe& set _slser=SLsvc) +if %winbuild% LSS 7600 if exist "%SysPath%\SLsvc.exe" (set _slexe=SLsvc.exe& set _slser=SLsvc) +if %_slexe%==SLsvc.exe set _vis=1 + set _NCS=1 if %winbuild% LSS 10586 set _NCS=0 if %winbuild% GEQ 10586 reg query "HKCU\Console" /v ForceV2 %nul2% | find /i "0x0" %nul1% && (set _NCS=0) @@ -2090,7 +2270,7 @@ if ($r -eq 0) { :ts_checkwinperm -%psc% "Get-WmiObject -Query 'SELECT Name, Description FROM SoftwareLicensingProduct WHERE LicenseStatus=''1'' AND GracePeriodRemaining=''0'' AND PartialProductKey IS NOT NULL AND LicenseDependsOn IS NULL' | Where-Object { $_.Description -notmatch 'KMS_' } | Select-Object -Property Name" %nul2% | findstr /i "Windows" %nul1% && set _perm=1||set _perm= +%psc% "Get-WmiObject -Query 'SELECT Name, Description FROM SoftwareLicensingProduct WHERE LicenseStatus=''1'' AND GracePeriodRemaining=''0'' AND PartialProductKey IS NOT NULL AND LicenseDependsOn IS NULL' | Where-Object { $_.Description -notmatch 'KMS' } | Select-Object -Property Name" %nul2% | findstr /i "Windows" %nul1% && set _perm=1||set _perm= exit /b :: Refresh license status @@ -2101,6 +2281,27 @@ if %_wmic% EQU 1 wmic path %sps% where __CLASS='%sps%' call RefreshLicenseStatus if %_wmic% EQU 0 %psc% "$null=(([WMICLASS]'%sps%').GetInstances()).RefreshLicenseStatus()" %nul% exit /b +:: Install Key + +:ts_inskey + +if %_wmic% EQU 1 wmic path %sps% where __CLASS='%sps%' call InstallProductKey ProductKey="%key%" %nul% +if %_wmic% EQU 0 %psc% "try { $null=(([WMISEARCHER]'SELECT Version FROM %sps%').Get()).InstallProductKey('%key%'); exit 0 } catch { exit $_.Exception.InnerException.HResult }" %nul% +set keyerror=%errorlevel% +cmd /c exit /b %keyerror% +if %keyerror% NEQ 0 set "keyerror=[0x%=ExitCode%]" + +if %keyerror% EQU 0 ( +if %sps%==SoftwareLicensingService call :dk_refresh +echo Installing Product Key %~1 [Successful] +) else ( +set error=1 +call :dk_color %Red% "Installing Product Key %~1 [Failed] %keyerror%" +call :dk_color %Blue% "%_fixmsg%" +) + +exit /b + :: Activation command :dk_act @@ -2153,6 +2354,8 @@ exit /b :dk_reeval +if %winbuild% LSS 7600 exit /b + :: This key is left by the system in rearm process and sppsvc sometimes fails to delete it, it causes issues in working of the Scheduled Tasks of SPP set "ruleskey=HKU\S-1-5-20\Software\Microsoft\Windows NT\CurrentVersion\SoftwareProtectionPlatform\PersistedSystemState" @@ -2180,13 +2383,13 @@ function InstallLicenseArr($Str) { ForEach ($x in $a) {InstallLicenseFile "$x"} } function InstallLicenseDir($Loc) { - dir $Loc *.xrm-ms -af -s | select -expand FullName | % {InstallLicenseFile "$_"} + Get-ChildItem $Loc -Recurse -Filter *.xrm-ms | ForEach-Object {InstallLicenseFile $_.FullName} } function ReinstallLicenses() { - $Oem = "$env:SysPath\oem" - $Spp = "$env:SysPath\spp\tokens" - InstallLicenseDir "$Spp" - If (Test-Path $Oem) {InstallLicenseDir "$Oem"} + $Paths = @("$env:SysPath\oem", "$env:SysPath\licensing", "$env:SysPath\spp\tokens") + foreach ($Path in $Paths) { + if (Test-Path $Path) { InstallLicenseDir "$Path" } + } } :xrm: @@ -2204,16 +2407,16 @@ exit /b :dk_sppissue -sc start sppsvc %nul% +sc start %_slser% %nul% set spperror=%errorlevel% if %spperror% NEQ 1056 if %spperror% NEQ 0 ( %eline% -echo sc start sppsvc [Error Code: %spperror%] +echo sc start %_slser% [Error Code: %spperror%] ) echo: -%psc% "$job = Start-Job { (Get-WmiObject -Query 'SELECT * FROM %sps%').Version }; if (-not (Wait-Job $job -Timeout 30)) {write-host 'sppsvc is not working correctly. Check this webpage for help - %mas%troubleshoot'}" +%psc% "$job = Start-Job { (Get-WmiObject -Query 'SELECT * FROM %sps%').Version }; if (-not (Wait-Job $job -Timeout 30)) {write-host '%_slser% is not working correctly. Check this webpage for help - %mas%troubleshoot'}" exit /b :: Get Product name (WMI/REG methods are not reliable in all conditions, hence winbrand.dll method is used) @@ -2231,6 +2434,10 @@ if %winbuild% GEQ 22000 ( set winos=!winos:Windows 10=Windows 11! ) ) +if %winbuild% LSS 7600 ( +set "winos=!winos:VistaT=Vista!" +set "winos=!winos:Serverr=Server!" +) if not defined winsub exit /b @@ -2277,11 +2484,11 @@ for %%# in (avira.com kaspersky.com virustotal.com mcafee.com) do ( find /i "%%#" %SysPath%\drivers\etc\hosts %nul% && set /a hcount+=1) if %hcount%==4 set "results=[Antivirus URLs are blocked in hosts]" -sc start sppsvc %nul% +sc start %_slser% %nul% echo "%errorlevel%" | findstr "577 225" %nul% && ( set "results=%results%[Likely File Infector]" ) || ( -if not exist %SysPath%\sppsvc.exe if not exist %SysPath%\alg.exe (set "results=%results%[Likely File Infector]") +if not exist %SysPath%\%_slexe% if not exist %SysPath%\alg.exe (set "results=%results%[Likely File Infector]") ) if not "%results%%pupfound%"=="" ( @@ -2361,6 +2568,7 @@ for %%# in (%serv_ste%) do ( if /i %%#==ClipSVC (reg add "HKLM\SYSTEM\CurrentControlSet\Services\%%#" /v "Start" /t REG_DWORD /d "3" /f %nul% & sc config %%# start= demand %nul%) if /i %%#==wlidsvc sc config %%# start= demand %nul% if /i %%#==sppsvc (reg add "HKLM\SYSTEM\CurrentControlSet\Services\%%#" /v "Start" /t REG_DWORD /d "2" /f %nul% & sc config %%# start= delayed-auto %nul%) +if /i %%#==SLsvc sc config %%# start= auto %nul% if /i %%#==KeyIso sc config %%# start= demand %nul% if /i %%#==LicenseManager sc config %%# start= demand %nul% if /i %%#==Winmgmt sc config %%# start= auto %nul% @@ -2490,7 +2698,7 @@ 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" ( +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" if not exist "%SysPath%\licensing\skus\Security-Licensing-SLC-Component-SKU-%osedition%\*-%osedition%-*.xrm-ms" ( set skunotfound=1 call :dk_color %Red% "Checking License Files [Not Found] [%osedition%]" ) @@ -2572,7 +2780,7 @@ call :dk_color2 %Blue% "In case of activation issues, do this - " %_Yellow% " %m ) -for %%# in (SppEx%w%tComObj.exe sppsvc.exe sppsvc.exe\PerfOptions) do ( +for %%# in (SppEx%w%tComObj.exe SLsvc.exe sppsvc.exe sppsvc.exe\PerfOptions) do ( reg query "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Ima%w%ge File Execu%w%tion Options\%%#" %nul% && (if defined _sppint (set "_sppint=!_sppint!, %%#") else (set "_sppint=%%#")) ) if defined _sppint ( @@ -2586,14 +2794,14 @@ echo Checking SPP In IFEO [%_sppint%] ) -for /f "skip=2 tokens=2*" %%a in ('reg query "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\SoftwareProtectionPlatform" /v "SkipRearm" %nul6%') do if /i %%b NEQ 0x0 ( +if %winbuild% GEQ 7600 for /f "skip=2 tokens=2*" %%a in ('reg query "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\SoftwareProtectionPlatform" /v "SkipRearm" %nul6%') do if /i %%b NEQ 0x0 ( 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" ) -reg query "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\SoftwareProtectionPlatform\Plugins\Objects\msft:rm/algorithm/hwid/4.0" /f ba02fed39662 /d %nul% || ( +if %winbuild% GEQ 7600 reg query "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\SoftwareProtectionPlatform\Plugins\Objects\msft:rm/algorithm/hwid/4.0" /f ba02fed39662 /d %nul% || ( call :dk_color %Red% "Checking SPP Registry Key [Incorrect ModuleId Found]" set fixes=%fixes% %mas%issues_due_to_gaming_spoofers call :dk_color2 %Blue% "Most likely caused by gaming spoofers. Check this webpage for help - " %_Yellow% " %mas%issues_due_to_gaming_spoofers" @@ -2603,21 +2811,22 @@ set showfix=1 set tokenstore= +if %winbuild% GEQ 7600 ( for /f "skip=2 tokens=2*" %%a in ('reg query "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\SoftwareProtectionPlatform" /v TokenStore %nul6%') do call set "tokenstore=%%b" if %winbuild% LSS 9200 set "tokenstore=%Systemdrive%\Windows\ServiceProfiles\NetworkService\AppData\Roaming\Microsoft\SoftwareProtectionPlatform" -if %winbuild% GEQ 9200 if /i not "%tokenstore%"=="%SysPath%\spp\store" if /i not "%tokenstore%"=="%SysPath%\spp\store\2.0" if /i not "%tokenstore%"=="%SysPath%\spp\store_test\2.0" ( +if %winbuild% GEQ 9200 if /i not "!tokenstore!"=="%SysPath%\spp\store" if /i not "!tokenstore!"=="%SysPath%\spp\store\2.0" if /i not "!tokenstore!"=="%SysPath%\spp\store_test\2.0" ( set toerr=1 set error=1 set showfix=1 -call :dk_color %Red% "Checking TokenStore Registry Key [Correct Path Not Found] [%tokenstore%]" +call :dk_color %Red% "Checking TokenStore Registry Key [Correct Path Not Found] [!tokenstore!]" set fixes=%fixes% %mas%troubleshoot call :dk_color2 %Blue% "Check this webpage for help - " %_Yellow% " %mas%troubleshoot" ) - +) :: This code creates token folder only if it's missing and sets default permission for it -if not defined toerr if not exist "%tokenstore%\" ( +if %winbuild% GEQ 7600 if not defined toerr if not exist "%tokenstore%\" ( mkdir "%tokenstore%" %nul% if %winbuild% LSS 9200 set "d=$sddl = 'O:NSG:NSD:AI(A;OICIID;FA;;;SY)(A;OICIID;FA;;;BA)(A;OICIID;FA;;;NS)';" if %winbuild% GEQ 9200 set "d=$sddl = 'O:BAG:BAD:PAI(A;OICI;FA;;;SY)(A;OICI;FA;;;BA)(A;OICIIO;GR;;;BU)(A;;FR;;;BU)(A;OICI;FA;;;S-1-5-80-123231216-2592883651-3715271367-3753151631-4175906628)';" @@ -2638,7 +2847,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% +%psc% "if (-not $env:_vis) {Start-Job { Stop-Service %_slser% -force } | Wait-Job -Timeout 20 | Out-Null}; $sls = Get-WmiObject SoftwareLicensingService; $f=[io.file]::ReadAllText('!_batp!') -split ':xrm\:.*';iex ($f[1]); ReinstallLicenses" call :dk_actid 55c92734-d682-4d71-983e-d6ec3f16059f if not defined apps ( set "_notfoundids=Key Not Installed / Act ID Not Found" @@ -2653,7 +2862,7 @@ call :dk_color %Red% "Checking Activation IDs [!_notfoundids!]" ) -if exist "%tokenstore%\" if not exist "%tokenstore%\tokens.dat" ( +if %winbuild% GEQ 7600 if exist "%tokenstore%\" if not exist "%tokenstore%\tokens.dat" ( set error=1 call :dk_color %Red% "Checking SPP tokens.dat [Not Found] [%tokenstore%\]" ) @@ -2788,8 +2997,10 @@ $wpaKey.Close() if %_NCS% EQU 1 ( echo %esc%[%~1%~2%esc%[0m -) else ( +) else if exist %ps% ( %psc% write-host -back '%1' -fore '%2' '%3' +) else if not exist %ps% ( +echo %~3 ) exit /b @@ -2797,8 +3008,10 @@ exit /b if %_NCS% EQU 1 ( echo %esc%[%~1%~2%esc%[%~3%~4%esc%[0m -) else ( +) else if exist %ps% ( %psc% write-host -back '%1' -fore '%2' '%3' -NoNewline; write-host -back '%4' -fore '%5' '%6' +) else if not exist %ps% ( +echo %~3 %~6 ) exit /b @@ -7670,7 +7883,7 @@ function slGetSkuInfo($SkuId) { } } -if ($env:resetstuff -eq $null) { +if (-not $env:resetstuff) { foreach ($tsactid in $tsactids) { try { $prodDes = Get-WmiInfo -tsactid $tsactid -property "Description" @@ -7679,7 +7892,9 @@ if ($env:resetstuff -eq $null) { $nameParts = $prodName -split ',', 2 $prodName = if ($nameParts.Count -gt 1) { ($nameParts[1].Trim() -split '[ ,]')[0] } else { $null } } + if (-not $env:_vis) { [LibTSforge.Modifiers.GenPKeyInstall]::InstallGenPKey($ver, $prod, $tsactid) + } if ($prodName -match 'Office' -and -not (slGetSkuInfo($tsactid))) { $licenseStatus = Get-WmiInfo -tsactid $tsactid -property "LicenseStatus" if ($licenseStatus -eq 1) { @@ -7712,13 +7927,13 @@ if ($env:resetstuff -eq $null) { } } -if ($env:resetstuff -eq '1') { +if ($env:resetstuff) { try { - [LibTSforge.Modifiers.TamperedFlagsDelete]::DeleteTamperFlags($ver, $prod) + if (-not $env:_vis) {[LibTSforge.Modifiers.TamperedFlagsDelete]::DeleteTamperFlags($ver, $prod)} [LibTSforge.SPP.SLApi]::RefreshLicenseStatus() [LibTSforge.Modifiers.RearmReset]::Reset($ver, $prod) [LibTSforge.Modifiers.GracePeriodReset]::Reset($ver, $prod) - [LibTSforge.Modifiers.KeyChangeLockDelete]::Delete($ver, $prod) + if (-not $env:_vis) {[LibTSforge.Modifiers.KeyChangeLockDelete]::Delete($ver, $prod)} } catch { $errcode = 3 diff --git a/MAS/Separate-Files-Version/Change_Office_Edition.cmd b/MAS/Separate-Files-Version/Change_Office_Edition.cmd index 708689b..7cd7548 100644 --- a/MAS/Separate-Files-Version/Change_Office_Edition.cmd +++ b/MAS/Separate-Files-Version/Change_Office_Edition.cmd @@ -134,9 +134,9 @@ goto dk_done ) if %winbuild% LSS 7600 ( -%nceline% +%eline% echo Unsupported OS version detected [%winbuild%]. -echo Project is supported only for Windows 7/8/8.1/10/11 and their Server equivalents. +echo This option is supported only for Windows 7/8/8.1/10/11 and their Server equivalents. goto dk_done ) @@ -1352,10 +1352,16 @@ if ($appIdsList.Count -gt 0) { :dk_setvar -set psc=powershell.exe -nop -c +set ps=%SysPath%\WindowsPowerShell\v1.0\powershell.exe +set psc=%ps% -nop -c set winbuild=1 for /f "tokens=6 delims=[]. " %%G in ('ver') do set winbuild=%%G +set _slexe=sppsvc.exe& set _slser=sppsvc +if %winbuild% LEQ 6300 (set _slexe=SLsvc.exe& set _slser=SLsvc) +if %winbuild% LSS 7600 if exist "%SysPath%\SLsvc.exe" (set _slexe=SLsvc.exe& set _slser=SLsvc) +if %_slexe%==SLsvc.exe set _vis=1 + set _NCS=1 if %winbuild% LSS 10586 set _NCS=0 if %winbuild% GEQ 10586 reg query "HKCU\Console" /v ForceV2 %nul2% | find /i "0x0" %nul1% && (set _NCS=0) @@ -1412,16 +1418,16 @@ exit /b :dk_sppissue -sc start sppsvc %nul% +sc start %_slser% %nul% set spperror=%errorlevel% if %spperror% NEQ 1056 if %spperror% NEQ 0 ( %eline% -echo sc start sppsvc [Error Code: %spperror%] +echo sc start %_slser% [Error Code: %spperror%] ) echo: -%psc% "$job = Start-Job { (Get-WmiObject -Query 'SELECT * FROM %sps%').Version }; if (-not (Wait-Job $job -Timeout 30)) {write-host 'sppsvc is not working correctly. Check this webpage for help - %mas%troubleshoot'}" +%psc% "$job = Start-Job { (Get-WmiObject -Query 'SELECT * FROM %sps%').Version }; if (-not (Wait-Job $job -Timeout 30)) {write-host '%_slser% is not working correctly. Check this webpage for help - %mas%troubleshoot'}" exit /b :: Common lines used in PowerShell reflection code @@ -1439,8 +1445,10 @@ exit /b if %_NCS% EQU 1 ( echo %esc%[%~1%~2%esc%[0m -) else ( +) else if exist %ps% ( %psc% write-host -back '%1' -fore '%2' '%3' +) else if not exist %ps% ( +echo %~3 ) exit /b @@ -1448,8 +1456,10 @@ exit /b if %_NCS% EQU 1 ( echo %esc%[%~1%~2%esc%[%~3%~4%esc%[0m -) else ( +) else if exist %ps% ( %psc% write-host -back '%1' -fore '%2' '%3' -NoNewline; write-host -back '%4' -fore '%5' '%6' +) else if not exist %ps% ( +echo %~3 %~6 ) exit /b diff --git a/MAS/Separate-Files-Version/Change_Windows_Edition.cmd b/MAS/Separate-Files-Version/Change_Windows_Edition.cmd index 594f857..eff01d7 100644 --- a/MAS/Separate-Files-Version/Change_Windows_Edition.cmd +++ b/MAS/Separate-Files-Version/Change_Windows_Edition.cmd @@ -139,9 +139,9 @@ goto dk_done ) if %winbuild% LSS 7600 ( -%nceline% +%eline% echo Unsupported OS version detected [%winbuild%]. -echo Project is supported only for Windows 7/8/8.1/10/11 and their Server equivalents. +echo This option is supported only for Windows 7/8/8.1/10/11 and their Server equivalents. goto dk_done ) @@ -824,10 +824,16 @@ exit /b :dk_setvar -set psc=powershell.exe -nop -c +set ps=%SysPath%\WindowsPowerShell\v1.0\powershell.exe +set psc=%ps% -nop -c set winbuild=1 for /f "tokens=6 delims=[]. " %%G in ('ver') do set winbuild=%%G +set _slexe=sppsvc.exe& set _slser=sppsvc +if %winbuild% LEQ 6300 (set _slexe=SLsvc.exe& set _slser=SLsvc) +if %winbuild% LSS 7600 if exist "%SysPath%\SLsvc.exe" (set _slexe=SLsvc.exe& set _slser=SLsvc) +if %_slexe%==SLsvc.exe set _vis=1 + set _NCS=1 if %winbuild% LSS 10586 set _NCS=0 if %winbuild% GEQ 10586 reg query "HKCU\Console" /v ForceV2 %nul2% | find /i "0x0" %nul1% && (set _NCS=0) @@ -911,16 +917,16 @@ exit /b :dk_sppissue -sc start sppsvc %nul% +sc start %_slser% %nul% set spperror=%errorlevel% if %spperror% NEQ 1056 if %spperror% NEQ 0 ( %eline% -echo sc start sppsvc [Error Code: %spperror%] +echo sc start %_slser% [Error Code: %spperror%] ) echo: -%psc% "$job = Start-Job { (Get-WmiObject -Query 'SELECT * FROM %sps%').Version }; if (-not (Wait-Job $job -Timeout 30)) {write-host 'sppsvc is not working correctly. Check this webpage for help - %mas%troubleshoot'}" +%psc% "$job = Start-Job { (Get-WmiObject -Query 'SELECT * FROM %sps%').Version }; if (-not (Wait-Job $job -Timeout 30)) {write-host '%_slser% is not working correctly. Check this webpage for help - %mas%troubleshoot'}" exit /b :: Common lines used in PowerShell reflection code @@ -1018,8 +1024,10 @@ exit /b if %_NCS% EQU 1 ( echo %esc%[%~1%~2%esc%[0m -) else ( +) else if exist %ps% ( %psc% write-host -back '%1' -fore '%2' '%3' +) else if not exist %ps% ( +echo %~3 ) exit /b @@ -1027,8 +1035,10 @@ exit /b if %_NCS% EQU 1 ( echo %esc%[%~1%~2%esc%[%~3%~4%esc%[0m -) else ( +) else if exist %ps% ( %psc% write-host -back '%1' -fore '%2' '%3' -NoNewline; write-host -back '%4' -fore '%5' '%6' +) else if not exist %ps% ( +echo %~3 %~6 ) exit /b diff --git a/MAS/Separate-Files-Version/Check_Activation_Status.cmd b/MAS/Separate-Files-Version/Check_Activation_Status.cmd index fd72a3f..104a856 100644 --- a/MAS/Separate-Files-Version/Check_Activation_Status.cmd +++ b/MAS/Separate-Files-Version/Check_Activation_Status.cmd @@ -23,10 +23,11 @@ set "Path=%SystemRoot%\Sysnative;%SystemRoot%;%SystemRoot%\Sysnative\Wbem;%Syste set "ComSpec=%SysPath%\cmd.exe" set "PSModulePath=%ProgramFiles%\WindowsPowerShell\Modules;%SysPath%\WindowsPowerShell\v1.0\Modules" -set "_psc=powershell -nop -c" +set "ps=%SysPath%\WindowsPowerShell\v1.0\powershell.exe" +set "_psc=%ps% -nop -c" set "_err===== ERROR ====" set _pwsh=1 -for %%# in (powershell.exe) do @if "%%~$PATH:#"=="" set _pwsh=0 +if not exist %ps% set _pwsh=0 cmd /c "%_psc% "$ExecutionContext.SessionState.LanguageMode"" | find /i "FullLanguage" 1>nul || (set _pwsh=0) if %_pwsh% equ 0 ( echo %_err% diff --git a/MAS/Separate-Files-Version/Extract_OEM_Folder.cmd b/MAS/Separate-Files-Version/Extract_OEM_Folder.cmd index 34ba8d0..469d01f 100644 --- a/MAS/Separate-Files-Version/Extract_OEM_Folder.cmd +++ b/MAS/Separate-Files-Version/Extract_OEM_Folder.cmd @@ -129,13 +129,30 @@ echo: setlocal EnableDelayedExpansion set fixes=%fixes% %mas%troubleshoot call :dk_color2 %Blue% "Check this webpage for help - " %_Yellow% " %mas%troubleshoot" -goto dk_done +goto done2 ) -if %winbuild% LSS 7600 ( +if %winbuild% LSS 6001 ( %nceline% echo Unsupported OS version detected [%winbuild%]. -echo Project is supported only for Windows 7/8/8.1/10/11 and their Server equivalents. +echo MAS only supports Windows Vista/7/8/8.1/10/11 and their Server equivalents. +if %winbuild% EQU 6000 ( +echo: +echo Windows Vista RTM is not supported because Powershell cannot be installed. +echo Upgrade to Windows Vista SP1 or SP2. +) +goto done2 +) + +if not exist %ps% ( +%nceline% +echo PowerShell is not installed in your system. +if %winbuild% LSS 7600 ( +echo Install PowerShell using the following URL. +echo: +echo https://www.catalog.update.microsoft.com/Search.aspx?q=KB968930 +start https://www.catalog.update.microsoft.com/Search.aspx?q=KB968930 +) goto done2 ) @@ -732,10 +749,16 @@ exit /b :dk_setvar -set psc=powershell.exe -nop -c +set ps=%SysPath%\WindowsPowerShell\v1.0\powershell.exe +set psc=%ps% -nop -c set winbuild=1 for /f "tokens=6 delims=[]. " %%G in ('ver') do set winbuild=%%G +set _slexe=sppsvc.exe& set _slser=sppsvc +if %winbuild% LEQ 6300 (set _slexe=SLsvc.exe& set _slser=SLsvc) +if %winbuild% LSS 7600 if exist "%SysPath%\SLsvc.exe" (set _slexe=SLsvc.exe& set _slser=SLsvc) +if %_slexe%==SLsvc.exe set _vis=1 + set _NCS=1 if %winbuild% LSS 10586 set _NCS=0 if %winbuild% GEQ 10586 reg query "HKCU\Console" /v ForceV2 %nul2% | find /i "0x0" %nul1% && (set _NCS=0) @@ -791,8 +814,10 @@ exit /b if %_NCS% EQU 1 ( echo %esc%[%~1%~2%esc%[0m -) else ( +) else if exist %ps% ( %psc% write-host -back '%1' -fore '%2' '%3' +) else if not exist %ps% ( +echo %~3 ) exit /b @@ -800,8 +825,10 @@ exit /b if %_NCS% EQU 1 ( echo %esc%[%~1%~2%esc%[%~3%~4%esc%[0m -) else ( +) else if exist %ps% ( %psc% write-host -back '%1' -fore '%2' '%3' -NoNewline; write-host -back '%4' -fore '%5' '%6' +) else if not exist %ps% ( +echo %~3 %~6 ) exit /b diff --git a/MAS/Separate-Files-Version/Troubleshoot.cmd b/MAS/Separate-Files-Version/Troubleshoot.cmd index 487b496..461e866 100644 --- a/MAS/Separate-Files-Version/Troubleshoot.cmd +++ b/MAS/Separate-Files-Version/Troubleshoot.cmd @@ -133,10 +133,27 @@ call :dk_color2 %Blue% "Check this webpage for help - " %_Yellow% " %mas%trouble goto dk_done ) -if %winbuild% LSS 7600 ( +if %winbuild% LSS 6001 ( %nceline% echo Unsupported OS version detected [%winbuild%]. -echo Project is supported only for Windows 7/8/8.1/10/11 and their Server equivalents. +echo MAS only supports Windows Vista/7/8/8.1/10/11 and their Server equivalents. +if %winbuild% EQU 6000 ( +echo: +echo Windows Vista RTM is not supported because Powershell cannot be installed. +echo Upgrade to Windows Vista SP1 or SP2. +) +goto dk_done +) + +if not exist %ps% ( +%nceline% +echo PowerShell is not installed in your system. +if %winbuild% LSS 7600 ( +echo Install PowerShell using the following URL. +echo: +echo https://www.catalog.update.microsoft.com/Search.aspx?q=KB968930 +start https://www.catalog.update.microsoft.com/Search.aspx?q=KB968930 +) goto dk_done ) @@ -515,6 +532,13 @@ mode 125, 32 ) title Fix Licensing ^(ClipSVC ^+ SPP ^+ OSPP^) +if %winbuild% EQU 6001 ( +%eline% +echo This option is not supported on Windows Vista SP1. +echo Upgrade to Windows Vista SP2. +goto :at_back +) + echo: echo %line% echo: @@ -531,7 +555,7 @@ echo - Clear ClipSVC, SPP and OSPP licenses. echo - Fix permissions of SPP tokens folder and registries. echo - Trigger the repair option for Office. echo: -call :dk_color2 %_White% " - " %Red% "Apply this option only when it is necessary." +call :dk_color2 %_White% " - " %Blue% "Apply this option only when it is necessary." echo: echo %line% echo: @@ -695,19 +719,19 @@ echo [No Error Found] ) echo: -echo Stopping sppsvc service... -%psc% Stop-Service sppsvc -force %nul% +echo Stopping %_slser% service... +%psc% Stop-Service %_slser% -force %nul% set w= set _sppint= -for %%# in (SppEx%w%tComObj.exe sppsvc.exe) do (reg query "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Ima%w%ge File Execu%w%tion Options\%%#" %nul% && (set _sppint=1)) +for %%# in (SppEx%w%tComObj.exe %_slexe%) do (reg query "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Ima%w%ge File Execu%w%tion Options\%%#" %nul% && (set _sppint=1)) if defined _sppint ( echo: echo Removing SPP IFEO registry keys... -for %%# in (SppE%w%xtComObj.exe sppsvc.exe) do (reg delete "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Ima%w%ge File Execu%w%tion Options\%%#" /f %nul%) +for %%# in (SppE%w%xtComObj.exe %_slexe%) do (reg delete "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Ima%w%ge File Execu%w%tion Options\%%#" /f %nul%) ) -if %winbuild% LSS 9200 ( +if %winbuild% LSS 9200 if not defined _vis ( REM Fix issues caused by Update KB971033 in Windows 7 REM https://support.microsoft.com/help/4487266 echo: @@ -726,6 +750,7 @@ del /f /q %SysPath%\7B296FB0-376B-497e-B012-9C450E1B7327-*.C7483456-A289-439d-81 :: Delete registry keys that are not deleted by activation scripts +if not defined _vis ( echo: echo Cleaning some licensing-related registry keys... %nul% reg delete "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\SoftwareProtectionPlatform" /v "ServiceSessionId" /f @@ -733,6 +758,7 @@ echo Cleaning some licensing-related registry keys... %nul% reg delete "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\SoftwareProtectionPlatform" /v "PolicyValuesArray" /f %nul% reg delete "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\SoftwareProtectionPlatform" /v "actionlist" /f %nul% reg delete "HKLM\SOFTWARE\Microsoft\OfficeSoftwareProtectionPlatform\data" /f +) echo: call :scandat delete @@ -744,9 +770,13 @@ call :dk_color %Red% "Failed to delete .dat files." echo: ) +if defined _vis ( +%psc% Start-Service %_slser% %nul% +) + echo: echo Reinstalling system licenses... -%psc% "Stop-Service sppsvc -force; $sls = Get-WmiObject SoftwareLicensingService; $f=[io.file]::ReadAllText('!_batp!') -split ':xrm\:.*';iex ($f[1]); ReinstallLicenses" %nul% +%psc% "$sls = Get-WmiObject SoftwareLicensingService; $f=[io.file]::ReadAllText('!_batp!') -split ':xrm\:.*';iex ($f[1]); ReinstallLicenses" %nul% if %errorlevel% NEQ 0 %psc% "$sls = Get-WmiObject SoftwareLicensingService; $f=[io.file]::ReadAllText('!_batp!') -split ':xrm\:.*';iex ($f[1]); ReinstallLicenses" %nul% if %errorlevel% EQU 0 ( echo [Successful] @@ -763,7 +793,7 @@ call :dk_color %Red% "Failed to rebuild tokens.dat file." echo tokens.dat file was rebuilt successfully. ) -if %winbuild% LSS 9200 ( +if %winbuild% LSS 9200 if not defined _vis ( sc config sppuinotify start= demand ) @@ -1329,13 +1359,13 @@ function InstallLicenseArr($Str) { ForEach ($x in $a) {InstallLicenseFile "$x"} } function InstallLicenseDir($Loc) { - dir $Loc *.xrm-ms -af -s | select -expand FullName | % {InstallLicenseFile "$_"} + Get-ChildItem $Loc -Recurse -Filter *.xrm-ms | ForEach-Object {InstallLicenseFile $_.FullName} } function ReinstallLicenses() { - $Oem = "$env:SysPath\oem" - $Spp = "$env:SysPath\spp\tokens" - InstallLicenseDir "$Spp" - If (Test-Path $Oem) {InstallLicenseDir "$Oem"} + $Paths = @("$env:SysPath\oem", "$env:SysPath\licensing", "$env:SysPath\spp\tokens") + foreach ($Path in $Paths) { + if (Test-Path $Path) { InstallLicenseDir "$Path" } + } } :xrm: @@ -1349,6 +1379,7 @@ for %%# in ( %SysPath%\spp\store\ %SysPath%\spp\store\2.0\ %Systemdrive%\Windows\ServiceProfiles\NetworkService\AppData\Roaming\Microsoft\SoftwareProtectionPlatform\ +%Systemdrive%\Windows\ServiceProfiles\NetworkService\AppData\Roaming\Microsoft\SoftwareLicensing\ ) do ( if %1==check ( @@ -1424,9 +1455,35 @@ $key.SetAccessControl($acl) ::======================================================================================================================================== +:dk_color + +if %_NCS% EQU 1 ( +echo %esc%[%~1%~2%esc%[0m +) else if exist %ps% ( +%psc% write-host -back '%1' -fore '%2' '%3' +) else if not exist %ps% ( +echo %~3 +) +exit /b + +:dk_color2 + +if %_NCS% EQU 1 ( +echo %esc%[%~1%~2%esc%[%~3%~4%esc%[0m +) else if exist %ps% ( +%psc% write-host -back '%1' -fore '%2' '%3' -NoNewline; write-host -back '%4' -fore '%5' '%6' +) else if not exist %ps% ( +echo %~3 %~6 +) +exit /b + +::======================================================================================================================================== + :dk_done echo: +if %_unattended%==1 timeout /t 2 & exit /b + if defined fixes ( call :dk_color %White% "Follow ALL the ABOVE blue lines. " call :dk_color2 %Blue% "Press [1] to Open Support Webpage " %Gray% " Press [0] to Ignore" @@ -1441,26 +1498,7 @@ choice /c 0 /n call :dk_color %_Yellow% "Press any key to %_exitmsg%..." pause %nul1% ) -exit /b -::======================================================================================================================================== - -:dk_color - -if %_NCS% EQU 1 ( -echo %esc%[%~1%~2%esc%[0m -) else ( -%psc% write-host -back '%1' -fore '%2' '%3' -) -exit /b - -:dk_color2 - -if %_NCS% EQU 1 ( -echo %esc%[%~1%~2%esc%[%~3%~4%esc%[0m -) else ( -%psc% write-host -back '%1' -fore '%2' '%3' -NoNewline; write-host -back '%4' -fore '%5' '%6' -) exit /b ::======================================================================================================================================== @@ -1469,10 +1507,16 @@ exit /b :dk_setvar -set psc=powershell.exe -nop -c +set ps=%SysPath%\WindowsPowerShell\v1.0\powershell.exe +set psc=%ps% -nop -c set winbuild=1 for /f "tokens=6 delims=[]. " %%G in ('ver') do set winbuild=%%G +set _slexe=sppsvc.exe& set _slser=sppsvc +if %winbuild% LEQ 6300 (set _slexe=SLsvc.exe& set _slser=SLsvc) +if %winbuild% LSS 7600 if exist "%SysPath%\SLsvc.exe" (set _slexe=SLsvc.exe& set _slser=SLsvc) +if %_slexe%==SLsvc.exe set _vis=1 + set _NCS=1 if %winbuild% LSS 10586 set _NCS=0 if %winbuild% GEQ 10586 reg query "HKCU\Console" /v ForceV2 %nul2% | find /i "0x0" %nul1% && (set _NCS=0) From 52ba9f138f2a256c4f95de464073fd2778595e56 Mon Sep 17 00:00:00 2001 From: WindowsAddict Date: Mon, 21 Apr 2025 00:53:08 +0530 Subject: [PATCH 28/79] Ask to run DISM restore and SFC scan when system files are missing --- MAS/All-In-One-Version-KL/MAS_AIO.cmd | 18 ++++++++++++++++++ .../Activators/HWID_Activation.cmd | 3 +++ .../Activators/KMS38_Activation.cmd | 3 +++ .../Activators/Ohook_Activation_AIO.cmd | 3 +++ .../Activators/Online_KMS_Activation.cmd | 3 +++ .../Activators/TSforge_Activation.cmd | 3 +++ .../Change_Windows_Edition.cmd | 3 +++ 7 files changed, 36 insertions(+) diff --git a/MAS/All-In-One-Version-KL/MAS_AIO.cmd b/MAS/All-In-One-Version-KL/MAS_AIO.cmd index fd2f429..59e6540 100644 --- a/MAS/All-In-One-Version-KL/MAS_AIO.cmd +++ b/MAS/All-In-One-Version-KL/MAS_AIO.cmd @@ -667,6 +667,9 @@ if not exist %SysPath%\%%# ( %eline% echo [%SysPath%\%%#] file is missing, aborting... echo: +call :dk_color %Blue% "Go back to Main Menu, select Troubleshoot and run DISM Restore and SFC Scan options." +call :dk_color %Blue% "After that, restart system and try activation again." +echo: set fixes=%fixes% %mas%troubleshoot call :dk_color2 %Blue% "Check this webpage for help - " %_Yellow% " %mas%troubleshoot" goto dk_done @@ -2232,6 +2235,9 @@ if not exist %SysPath%\sppsvc.exe ( %eline% echo [%SysPath%\sppsvc.exe] file is missing, aborting... echo: +call :dk_color %Blue% "Go back to Main Menu, select Troubleshoot and run DISM Restore and SFC Scan options." +call :dk_color %Blue% "After that, restart system and try activation again." +echo: set fixes=%fixes% %mas%troubleshoot call :dk_color2 %Blue% "Check this webpage for help - " %_Yellow% " %mas%troubleshoot" goto dk_done @@ -3797,6 +3803,9 @@ if not exist %SysPath%\%_slexe% ( %eline% echo [%SysPath%\%_slexe%] file is missing, aborting... echo: +call :dk_color %Blue% "Go back to Main Menu, select Troubleshoot and run DISM Restore and SFC Scan options." +call :dk_color %Blue% "After that, restart system and try activation again." +echo: set fixes=%fixes% %mas%troubleshoot call :dk_color2 %Blue% "Check this webpage for help - " %_Yellow% " %mas%troubleshoot" goto dk_done @@ -10672,6 +10681,9 @@ if defined _fmiss ( %eline% echo [%_fmiss%] file is missing, aborting... echo: +call :dk_color %Blue% "Go back to Main Menu, select Troubleshoot and run DISM Restore and SFC Scan options." +call :dk_color %Blue% "After that, restart system and try activation again." +echo: set fixes=%fixes% %mas%troubleshoot call :dk_color2 %Blue% "Check this webpage for help - " %_Yellow% " %mas%troubleshoot" goto dk_done @@ -11504,6 +11516,9 @@ if not exist %SysPath%\%_slexe% ( %eline% echo [%SysPath%\%_slexe%] file is missing, aborting... echo: +call :dk_color %Blue% "Go back to Main Menu, select Troubleshoot and run DISM Restore and SFC Scan options." +call :dk_color %Blue% "After that, restart system and try activation again." +echo: set fixes=%fixes% %mas%troubleshoot call :dk_color2 %Blue% "Check this webpage for help - " %_Yellow% " %mas%troubleshoot" goto dk_done @@ -16421,6 +16436,9 @@ if not exist %SysPath%\%%# ( %eline% echo [%SysPath%\%%#] file is missing, aborting... echo: +call :dk_color %Blue% "Go back to Main Menu, select Troubleshoot and run DISM Restore and SFC Scan options." +call :dk_color %Blue% "After that, restart system and try activation again." +echo: set fixes=%fixes% %mas%troubleshoot call :dk_color2 %Blue% "Check this webpage for help - " %_Yellow% " %mas%troubleshoot" goto dk_done diff --git a/MAS/Separate-Files-Version/Activators/HWID_Activation.cmd b/MAS/Separate-Files-Version/Activators/HWID_Activation.cmd index 006b184..6aa033b 100644 --- a/MAS/Separate-Files-Version/Activators/HWID_Activation.cmd +++ b/MAS/Separate-Files-Version/Activators/HWID_Activation.cmd @@ -381,6 +381,9 @@ if not exist %SysPath%\%%# ( %eline% echo [%SysPath%\%%#] file is missing, aborting... echo: +call :dk_color %Blue% "Go back to Main Menu, select Troubleshoot and run DISM Restore and SFC Scan options." +call :dk_color %Blue% "After that, restart system and try activation again." +echo: set fixes=%fixes% %mas%troubleshoot call :dk_color2 %Blue% "Check this webpage for help - " %_Yellow% " %mas%troubleshoot" goto dk_done diff --git a/MAS/Separate-Files-Version/Activators/KMS38_Activation.cmd b/MAS/Separate-Files-Version/Activators/KMS38_Activation.cmd index 4610158..890ac89 100644 --- a/MAS/Separate-Files-Version/Activators/KMS38_Activation.cmd +++ b/MAS/Separate-Files-Version/Activators/KMS38_Activation.cmd @@ -421,6 +421,9 @@ if defined _fmiss ( %eline% echo [%_fmiss%] file is missing, aborting... echo: +call :dk_color %Blue% "Go back to Main Menu, select Troubleshoot and run DISM Restore and SFC Scan options." +call :dk_color %Blue% "After that, restart system and try activation again." +echo: set fixes=%fixes% %mas%troubleshoot call :dk_color2 %Blue% "Check this webpage for help - " %_Yellow% " %mas%troubleshoot" goto dk_done diff --git a/MAS/Separate-Files-Version/Activators/Ohook_Activation_AIO.cmd b/MAS/Separate-Files-Version/Activators/Ohook_Activation_AIO.cmd index 7fe95f3..e2978a4 100644 --- a/MAS/Separate-Files-Version/Activators/Ohook_Activation_AIO.cmd +++ b/MAS/Separate-Files-Version/Activators/Ohook_Activation_AIO.cmd @@ -412,6 +412,9 @@ if not exist %SysPath%\sppsvc.exe ( %eline% echo [%SysPath%\sppsvc.exe] file is missing, aborting... echo: +call :dk_color %Blue% "Go back to Main Menu, select Troubleshoot and run DISM Restore and SFC Scan options." +call :dk_color %Blue% "After that, restart system and try activation again." +echo: set fixes=%fixes% %mas%troubleshoot call :dk_color2 %Blue% "Check this webpage for help - " %_Yellow% " %mas%troubleshoot" goto dk_done diff --git a/MAS/Separate-Files-Version/Activators/Online_KMS_Activation.cmd b/MAS/Separate-Files-Version/Activators/Online_KMS_Activation.cmd index 940c217..8e316c0 100644 --- a/MAS/Separate-Files-Version/Activators/Online_KMS_Activation.cmd +++ b/MAS/Separate-Files-Version/Activators/Online_KMS_Activation.cmd @@ -489,6 +489,9 @@ if not exist %SysPath%\%_slexe% ( %eline% echo [%SysPath%\%_slexe%] file is missing, aborting... echo: +call :dk_color %Blue% "Go back to Main Menu, select Troubleshoot and run DISM Restore and SFC Scan options." +call :dk_color %Blue% "After that, restart system and try activation again." +echo: set fixes=%fixes% %mas%troubleshoot call :dk_color2 %Blue% "Check this webpage for help - " %_Yellow% " %mas%troubleshoot" goto dk_done diff --git a/MAS/Separate-Files-Version/Activators/TSforge_Activation.cmd b/MAS/Separate-Files-Version/Activators/TSforge_Activation.cmd index e5228bb..9c64be6 100644 --- a/MAS/Separate-Files-Version/Activators/TSforge_Activation.cmd +++ b/MAS/Separate-Files-Version/Activators/TSforge_Activation.cmd @@ -498,6 +498,9 @@ if not exist %SysPath%\%_slexe% ( %eline% echo [%SysPath%\%_slexe%] file is missing, aborting... echo: +call :dk_color %Blue% "Go back to Main Menu, select Troubleshoot and run DISM Restore and SFC Scan options." +call :dk_color %Blue% "After that, restart system and try activation again." +echo: set fixes=%fixes% %mas%troubleshoot call :dk_color2 %Blue% "Check this webpage for help - " %_Yellow% " %mas%troubleshoot" goto dk_done diff --git a/MAS/Separate-Files-Version/Change_Windows_Edition.cmd b/MAS/Separate-Files-Version/Change_Windows_Edition.cmd index eff01d7..ad5083a 100644 --- a/MAS/Separate-Files-Version/Change_Windows_Edition.cmd +++ b/MAS/Separate-Files-Version/Change_Windows_Edition.cmd @@ -354,6 +354,9 @@ if not exist %SysPath%\%%# ( %eline% echo [%SysPath%\%%#] file is missing, aborting... echo: +call :dk_color %Blue% "Go back to Main Menu, select Troubleshoot and run DISM Restore and SFC Scan options." +call :dk_color %Blue% "After that, restart system and try activation again." +echo: set fixes=%fixes% %mas%troubleshoot call :dk_color2 %Blue% "Check this webpage for help - " %_Yellow% " %mas%troubleshoot" goto dk_done From af18bd773c1b4bb4dd1c4e055ab154cccfa7782f Mon Sep 17 00:00:00 2001 From: WindowsAddict Date: Mon, 21 Apr 2025 02:29:22 +0530 Subject: [PATCH 29/79] Fix a missing echo --- MAS/All-In-One-Version-KL/MAS_AIO.cmd | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/MAS/All-In-One-Version-KL/MAS_AIO.cmd b/MAS/All-In-One-Version-KL/MAS_AIO.cmd index 59e6540..bc8220d 100644 --- a/MAS/All-In-One-Version-KL/MAS_AIO.cmd +++ b/MAS/All-In-One-Version-KL/MAS_AIO.cmd @@ -4903,7 +4903,7 @@ call :dk_color2 %Blue% "Check this webpage for help - " %_Yellow% " %mas%trouble if defined tsids ( echo: -if not defined _vis Installing Forged Product Key Data... +if not defined _vis echo Installing Forged Product Key Data... echo Depositing Zero Confirmation ID... echo: %psc% "$f=[io.file]::ReadAllText('!_batp!') -split ':tsforge\:.*';& ([ScriptBlock]::Create($f[1])) %tsids%" From 5090cde0a04698521979d48f28f670827a69d74e Mon Sep 17 00:00:00 2001 From: WindowsAddict Date: Mon, 21 Apr 2025 18:01:09 +0530 Subject: [PATCH 30/79] Use wmic.exe on builds below 9200 --- MAS/All-In-One-Version-KL/MAS_AIO.cmd | 11 ++++------- .../Activators/HWID_Activation.cmd | 4 +++- .../Activators/KMS38_Activation.cmd | 10 +++------- .../Activators/Ohook_Activation_AIO.cmd | 4 +++- .../Activators/Online_KMS_Activation.cmd | 5 ++++- .../Activators/TSforge_Activation.cmd | 7 ++++--- MAS/Separate-Files-Version/Change_Office_Edition.cmd | 1 + MAS/Separate-Files-Version/Change_Windows_Edition.cmd | 1 + 8 files changed, 23 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 bc8220d..e5bc555 100644 --- a/MAS/All-In-One-Version-KL/MAS_AIO.cmd +++ b/MAS/All-In-One-Version-KL/MAS_AIO.cmd @@ -1374,6 +1374,7 @@ function ReinstallLicenses() { :dk_ckeckwmic +if %winbuild% LSS 9200 (set _wmic=1&exit /b) set _wmic=0 for %%# in (wmic.exe) do @if not "%%~$PATH:#"=="" ( cmd /c "wmic path Win32_ComputerSystem get CreationClassName /value" %nul2% | find /i "computersystem" %nul1% && set _wmic=1 @@ -1687,7 +1688,8 @@ call :dk_color %Red% "Checking Package Files [Not Found] [%osed ) -%psc% "try { $null=([WMISEARCHER]'SELECT * FROM %sps%').Get().Version; exit 0 } catch { exit $_.Exception.InnerException.HResult }" %nul% +if %_wmic% EQU 1 wmic path %sps% get Version %nul% +if %_wmic% EQU 0 %psc% "try { $null=([WMISEARCHER]'SELECT * FROM %sps%').Get().Version; exit 0 } catch { exit $_.Exception.InnerException.HResult }" %nul% set error_code=%errorlevel% cmd /c exit /b %error_code% if %error_code% NEQ 0 set "error_code=0x%=ExitCode%" @@ -10978,12 +10980,6 @@ set "_xmlexist=if exist "%tdir%\GenuineTicket.xml"" %psc% "Start-Job { Stop-Service sppsvc -force } | Wait-Job -Timeout 20 | Out-Null" -sc query sppsvc | find /i "STOPPED" %nul% && ( -echo Stopping sppsvc Service [Successful] -) || ( -call :dk_color %Gray% "Stopping sppsvc Service [Failed]" -) - %_xmlexist% ( %psc% "Start-Job { Restart-Service ClipSVC } | Wait-Job -Timeout 20 | Out-Null" %_xmlexist% timeout /t 2 %nul% @@ -12431,6 +12427,7 @@ set _wmic=0 for %%# in (wmic.exe) do @if not "%%~$PATH:#"=="" ( cmd /c "wmic path Win32_ComputerSystem get CreationClassName /value" 2>nul | find /i "computersystem" 1>nul && set _wmic=1 ) +if %winbuild% LSS 9200 set _wmic=1 setlocal EnableDelayedExpansion if exist "%ProgramFiles%\Activation-Renewal\" call :_taskstart>>"%ProgramFiles%\Activation-Renewal\Logs.txt" diff --git a/MAS/Separate-Files-Version/Activators/HWID_Activation.cmd b/MAS/Separate-Files-Version/Activators/HWID_Activation.cmd index 6aa033b..6409cec 100644 --- a/MAS/Separate-Files-Version/Activators/HWID_Activation.cmd +++ b/MAS/Separate-Files-Version/Activators/HWID_Activation.cmd @@ -1072,6 +1072,7 @@ function ReinstallLicenses() { :dk_ckeckwmic +if %winbuild% LSS 9200 (set _wmic=1&exit /b) set _wmic=0 for %%# in (wmic.exe) do @if not "%%~$PATH:#"=="" ( cmd /c "wmic path Win32_ComputerSystem get CreationClassName /value" %nul2% | find /i "computersystem" %nul1% && set _wmic=1 @@ -1385,7 +1386,8 @@ call :dk_color %Red% "Checking Package Files [Not Found] [%osed ) -%psc% "try { $null=([WMISEARCHER]'SELECT * FROM %sps%').Get().Version; exit 0 } catch { exit $_.Exception.InnerException.HResult }" %nul% +if %_wmic% EQU 1 wmic path %sps% get Version %nul% +if %_wmic% EQU 0 %psc% "try { $null=([WMISEARCHER]'SELECT * FROM %sps%').Get().Version; exit 0 } catch { exit $_.Exception.InnerException.HResult }" %nul% set error_code=%errorlevel% cmd /c exit /b %error_code% if %error_code% NEQ 0 set "error_code=0x%=ExitCode%" diff --git a/MAS/Separate-Files-Version/Activators/KMS38_Activation.cmd b/MAS/Separate-Files-Version/Activators/KMS38_Activation.cmd index 890ac89..bb2c624 100644 --- a/MAS/Separate-Files-Version/Activators/KMS38_Activation.cmd +++ b/MAS/Separate-Files-Version/Activators/KMS38_Activation.cmd @@ -718,12 +718,6 @@ set "_xmlexist=if exist "%tdir%\GenuineTicket.xml"" %psc% "Start-Job { Stop-Service sppsvc -force } | Wait-Job -Timeout 20 | Out-Null" -sc query sppsvc | find /i "STOPPED" %nul% && ( -echo Stopping sppsvc Service [Successful] -) || ( -call :dk_color %Gray% "Stopping sppsvc Service [Failed]" -) - %_xmlexist% ( %psc% "Start-Job { Restart-Service ClipSVC } | Wait-Job -Timeout 20 | Out-Null" %_xmlexist% timeout /t 2 %nul% @@ -1176,6 +1170,7 @@ function ReinstallLicenses() { :dk_ckeckwmic +if %winbuild% LSS 9200 (set _wmic=1&exit /b) set _wmic=0 for %%# in (wmic.exe) do @if not "%%~$PATH:#"=="" ( cmd /c "wmic path Win32_ComputerSystem get CreationClassName /value" %nul2% | find /i "computersystem" %nul1% && set _wmic=1 @@ -1534,7 +1529,8 @@ call :dk_color %Red% "Checking Package Files [Not Found] [%osed ) -%psc% "try { $null=([WMISEARCHER]'SELECT * FROM %sps%').Get().Version; exit 0 } catch { exit $_.Exception.InnerException.HResult }" %nul% +if %_wmic% EQU 1 wmic path %sps% get Version %nul% +if %_wmic% EQU 0 %psc% "try { $null=([WMISEARCHER]'SELECT * FROM %sps%').Get().Version; exit 0 } catch { exit $_.Exception.InnerException.HResult }" %nul% set error_code=%errorlevel% cmd /c exit /b %error_code% if %error_code% NEQ 0 set "error_code=0x%=ExitCode%" diff --git a/MAS/Separate-Files-Version/Activators/Ohook_Activation_AIO.cmd b/MAS/Separate-Files-Version/Activators/Ohook_Activation_AIO.cmd index e2978a4..5be9615 100644 --- a/MAS/Separate-Files-Version/Activators/Ohook_Activation_AIO.cmd +++ b/MAS/Separate-Files-Version/Activators/Ohook_Activation_AIO.cmd @@ -1495,6 +1495,7 @@ function ReinstallLicenses() { :dk_ckeckwmic +if %winbuild% LSS 9200 (set _wmic=1&exit /b) set _wmic=0 for %%# in (wmic.exe) do @if not "%%~$PATH:#"=="" ( cmd /c "wmic path Win32_ComputerSystem get CreationClassName /value" %nul2% | find /i "computersystem" %nul1% && set _wmic=1 @@ -1793,7 +1794,8 @@ call :dk_color %Red% "Checking Package Files [Not Found] [%osed ) -%psc% "try { $null=([WMISEARCHER]'SELECT * FROM %sps%').Get().Version; exit 0 } catch { exit $_.Exception.InnerException.HResult }" %nul% +if %_wmic% EQU 1 wmic path %sps% get Version %nul% +if %_wmic% EQU 0 %psc% "try { $null=([WMISEARCHER]'SELECT * FROM %sps%').Get().Version; exit 0 } catch { exit $_.Exception.InnerException.HResult }" %nul% set error_code=%errorlevel% cmd /c exit /b %error_code% if %error_code% NEQ 0 set "error_code=0x%=ExitCode%" diff --git a/MAS/Separate-Files-Version/Activators/Online_KMS_Activation.cmd b/MAS/Separate-Files-Version/Activators/Online_KMS_Activation.cmd index 8e316c0..48e93ac 100644 --- a/MAS/Separate-Files-Version/Activators/Online_KMS_Activation.cmd +++ b/MAS/Separate-Files-Version/Activators/Online_KMS_Activation.cmd @@ -1686,6 +1686,7 @@ set _wmic=0 for %%# in (wmic.exe) do @if not "%%~$PATH:#"=="" ( cmd /c "wmic path Win32_ComputerSystem get CreationClassName /value" 2>nul | find /i "computersystem" 1>nul && set _wmic=1 ) +if %winbuild% LSS 9200 set _wmic=1 setlocal EnableDelayedExpansion if exist "%ProgramFiles%\Activation-Renewal\" call :_taskstart>>"%ProgramFiles%\Activation-Renewal\Logs.txt" @@ -2739,6 +2740,7 @@ function ReinstallLicenses() { :dk_ckeckwmic +if %winbuild% LSS 9200 (set _wmic=1&exit /b) set _wmic=0 for %%# in (wmic.exe) do @if not "%%~$PATH:#"=="" ( cmd /c "wmic path Win32_ComputerSystem get CreationClassName /value" %nul2% | find /i "computersystem" %nul1% && set _wmic=1 @@ -3097,7 +3099,8 @@ call :dk_color %Red% "Checking Package Files [Not Found] [%osed ) -%psc% "try { $null=([WMISEARCHER]'SELECT * FROM %sps%').Get().Version; exit 0 } catch { exit $_.Exception.InnerException.HResult }" %nul% +if %_wmic% EQU 1 wmic path %sps% get Version %nul% +if %_wmic% EQU 0 %psc% "try { $null=([WMISEARCHER]'SELECT * FROM %sps%').Get().Version; exit 0 } catch { exit $_.Exception.InnerException.HResult }" %nul% set error_code=%errorlevel% cmd /c exit /b %error_code% if %error_code% NEQ 0 set "error_code=0x%=ExitCode%" diff --git a/MAS/Separate-Files-Version/Activators/TSforge_Activation.cmd b/MAS/Separate-Files-Version/Activators/TSforge_Activation.cmd index 9c64be6..b4effe7 100644 --- a/MAS/Separate-Files-Version/Activators/TSforge_Activation.cmd +++ b/MAS/Separate-Files-Version/Activators/TSforge_Activation.cmd @@ -2400,6 +2400,7 @@ function ReinstallLicenses() { :dk_ckeckwmic +if %winbuild% LSS 9200 (set _wmic=1&exit /b) set _wmic=0 for %%# in (wmic.exe) do @if not "%%~$PATH:#"=="" ( cmd /c "wmic path Win32_ComputerSystem get CreationClassName /value" %nul2% | find /i "computersystem" %nul1% && set _wmic=1 @@ -2712,8 +2713,8 @@ call :dk_color %Red% "Checking Package Files [Not Found] [%osed ) ) - -%psc% "try { $null=([WMISEARCHER]'SELECT * FROM %sps%').Get().Version; exit 0 } catch { exit $_.Exception.InnerException.HResult }" %nul% +if %_wmic% EQU 1 wmic path %sps% get Version %nul% +if %_wmic% EQU 0 %psc% "try { $null=([WMISEARCHER]'SELECT * FROM %sps%').Get().Version; exit 0 } catch { exit $_.Exception.InnerException.HResult }" %nul% set error_code=%errorlevel% cmd /c exit /b %error_code% if %error_code% NEQ 0 set "error_code=0x%=ExitCode%" @@ -2850,7 +2851,7 @@ set showfix=1 if not defined notwinact ( call :dk_actid 55c92734-d682-4d71-983e-d6ec3f16059f if not defined apps ( -%psc% "if (-not $env:_vis) {Start-Job { Stop-Service %_slser% -force } | Wait-Job -Timeout 20 | Out-Null}; $sls = Get-WmiObject SoftwareLicensingService; $f=[io.file]::ReadAllText('!_batp!') -split ':xrm\:.*';iex ($f[1]); ReinstallLicenses" +%psc% "if (-not $env:_vis) {Start-Job { Stop-Service %_slser% -force } | Wait-Job -Timeout 20 | Out-Null}; $sls = Get-WmiObject SoftwareLicensingService; $f=[io.file]::ReadAllText('!_batp!') -split ':xrm\:.*';iex ($f[1]); ReinstallLicenses" %nul% call :dk_actid 55c92734-d682-4d71-983e-d6ec3f16059f if not defined apps ( set "_notfoundids=Key Not Installed / Act ID Not Found" diff --git a/MAS/Separate-Files-Version/Change_Office_Edition.cmd b/MAS/Separate-Files-Version/Change_Office_Edition.cmd index 7cd7548..a068afa 100644 --- a/MAS/Separate-Files-Version/Change_Office_Edition.cmd +++ b/MAS/Separate-Files-Version/Change_Office_Edition.cmd @@ -1408,6 +1408,7 @@ exit /b :dk_ckeckwmic +if %winbuild% LSS 9200 (set _wmic=1&exit /b) set _wmic=0 for %%# in (wmic.exe) do @if not "%%~$PATH:#"=="" ( cmd /c "wmic path Win32_ComputerSystem get CreationClassName /value" %nul2% | find /i "computersystem" %nul1% && set _wmic=1 diff --git a/MAS/Separate-Files-Version/Change_Windows_Edition.cmd b/MAS/Separate-Files-Version/Change_Windows_Edition.cmd index ad5083a..5c34093 100644 --- a/MAS/Separate-Files-Version/Change_Windows_Edition.cmd +++ b/MAS/Separate-Files-Version/Change_Windows_Edition.cmd @@ -910,6 +910,7 @@ exit /b :dk_ckeckwmic +if %winbuild% LSS 9200 (set _wmic=1&exit /b) set _wmic=0 for %%# in (wmic.exe) do @if not "%%~$PATH:#"=="" ( cmd /c "wmic path Win32_ComputerSystem get CreationClassName /value" %nul2% | find /i "computersystem" %nul1% && set _wmic=1 From b8ad749bac256882fd5ec1c3b2924ff86e681c90 Mon Sep 17 00:00:00 2001 From: WindowsAddict Date: Mon, 21 Apr 2025 20:22:13 +0530 Subject: [PATCH 31/79] Fix issue related to URL opening in unattended mode --- MAS/All-In-One-Version-KL/MAS_AIO.cmd | 4 ++-- .../Activators/Online_KMS_Activation.cmd | 2 +- MAS/Separate-Files-Version/Activators/TSforge_Activation.cmd | 4 ++-- MAS/Separate-Files-Version/Extract_OEM_Folder.cmd | 2 +- MAS/Separate-Files-Version/Troubleshoot.cmd | 2 +- 5 files changed, 7 insertions(+), 7 deletions(-) diff --git a/MAS/All-In-One-Version-KL/MAS_AIO.cmd b/MAS/All-In-One-Version-KL/MAS_AIO.cmd index e5bc555..a67b39c 100644 --- a/MAS/All-In-One-Version-KL/MAS_AIO.cmd +++ b/MAS/All-In-One-Version-KL/MAS_AIO.cmd @@ -160,7 +160,7 @@ if %winbuild% LSS 7600 ( echo Install PowerShell using the following URL. echo: echo https://www.catalog.update.microsoft.com/Search.aspx?q=KB968930 -start https://www.catalog.update.microsoft.com/Search.aspx?q=KB968930 +if %_unattended%==0 start https://www.catalog.update.microsoft.com/Search.aspx?q=KB968930 ) goto dk_done ) @@ -3719,7 +3719,7 @@ echo .NET 3.5 Framework is not installed in your system. echo Install it using the following URL. echo: echo https://www.microsoft.com/download/details.aspx?id=25150 -start https://www.microsoft.com/download/details.aspx?id=25150 +if %_unattended%==0 start https://www.microsoft.com/download/details.aspx?id=25150 goto dk_done ) ) diff --git a/MAS/Separate-Files-Version/Activators/Online_KMS_Activation.cmd b/MAS/Separate-Files-Version/Activators/Online_KMS_Activation.cmd index 48e93ac..07b7470 100644 --- a/MAS/Separate-Files-Version/Activators/Online_KMS_Activation.cmd +++ b/MAS/Separate-Files-Version/Activators/Online_KMS_Activation.cmd @@ -221,7 +221,7 @@ if %winbuild% LSS 7600 ( echo Install PowerShell using the following URL. echo: echo https://www.catalog.update.microsoft.com/Search.aspx?q=KB968930 -start https://www.catalog.update.microsoft.com/Search.aspx?q=KB968930 +if %_unattended%==0 start https://www.catalog.update.microsoft.com/Search.aspx?q=KB968930 ) goto dk_done ) diff --git a/MAS/Separate-Files-Version/Activators/TSforge_Activation.cmd b/MAS/Separate-Files-Version/Activators/TSforge_Activation.cmd index b4effe7..2400e45 100644 --- a/MAS/Separate-Files-Version/Activators/TSforge_Activation.cmd +++ b/MAS/Separate-Files-Version/Activators/TSforge_Activation.cmd @@ -227,7 +227,7 @@ if %winbuild% LSS 7600 ( echo Install PowerShell using the following URL. echo: echo https://www.catalog.update.microsoft.com/Search.aspx?q=KB968930 -start https://www.catalog.update.microsoft.com/Search.aspx?q=KB968930 +if %_unattended%==0 start https://www.catalog.update.microsoft.com/Search.aspx?q=KB968930 ) goto dk_done ) @@ -239,7 +239,7 @@ echo .NET 3.5 Framework is not installed in your system. echo Install it using the following URL. echo: echo https://www.microsoft.com/download/details.aspx?id=25150 -start https://www.microsoft.com/download/details.aspx?id=25150 +if %_unattended%==0 start https://www.microsoft.com/download/details.aspx?id=25150 goto dk_done ) ) diff --git a/MAS/Separate-Files-Version/Extract_OEM_Folder.cmd b/MAS/Separate-Files-Version/Extract_OEM_Folder.cmd index 469d01f..10030b1 100644 --- a/MAS/Separate-Files-Version/Extract_OEM_Folder.cmd +++ b/MAS/Separate-Files-Version/Extract_OEM_Folder.cmd @@ -151,7 +151,7 @@ if %winbuild% LSS 7600 ( echo Install PowerShell using the following URL. echo: echo https://www.catalog.update.microsoft.com/Search.aspx?q=KB968930 -start https://www.catalog.update.microsoft.com/Search.aspx?q=KB968930 +if %_unattended%==0 start https://www.catalog.update.microsoft.com/Search.aspx?q=KB968930 ) goto done2 ) diff --git a/MAS/Separate-Files-Version/Troubleshoot.cmd b/MAS/Separate-Files-Version/Troubleshoot.cmd index 461e866..55a42ed 100644 --- a/MAS/Separate-Files-Version/Troubleshoot.cmd +++ b/MAS/Separate-Files-Version/Troubleshoot.cmd @@ -152,7 +152,7 @@ if %winbuild% LSS 7600 ( echo Install PowerShell using the following URL. echo: echo https://www.catalog.update.microsoft.com/Search.aspx?q=KB968930 -start https://www.catalog.update.microsoft.com/Search.aspx?q=KB968930 +if %_unattended%==0 start https://www.catalog.update.microsoft.com/Search.aspx?q=KB968930 ) goto dk_done ) From 5872b7df53cb1d0e4316860897a0725695dc4864 Mon Sep 17 00:00:00 2001 From: WindowsAddict Date: Tue, 29 Apr 2025 22:40:56 +0530 Subject: [PATCH 32/79] 3.1 Added Ohook support for OSPP based Office on Vista and later --- .gitattributes | 6 +- MAS/All-In-One-Version-KL/MAS_AIO.cmd | 997 ++++++++++-------- .../Activators/HWID_Activation.cmd | 15 +- .../Activators/KMS38_Activation.cmd | 15 +- .../Activators/Ohook_Activation_AIO.cmd | 480 +++++++-- .../Activators/Online_KMS_Activation.cmd | 63 +- .../Activators/TSforge_Activation.cmd | 92 +- .../Change_Office_Edition.cmd | 2 +- .../Change_Windows_Edition.cmd | 2 +- .../Check_Activation_Status.cmd | 427 ++++---- .../Extract_OEM_Folder.cmd | 2 +- MAS/Separate-Files-Version/Troubleshoot.cmd | 2 +- README.md | 45 +- 13 files changed, 1320 insertions(+), 828 deletions(-) diff --git a/.gitattributes b/.gitattributes index 8749e12..de5bd3d 100644 --- a/.gitattributes +++ b/.gitattributes @@ -1,4 +1,4 @@ -# MAS export-ignore -# LICENSE export-ignore -# README.md export-ignore +MAS export-ignore +LICENSE export-ignore +README.md export-ignore .gitattributes export-ignore diff --git a/MAS/All-In-One-Version-KL/MAS_AIO.cmd b/MAS/All-In-One-Version-KL/MAS_AIO.cmd index a67b39c..73ac408 100644 --- a/MAS/All-In-One-Version-KL/MAS_AIO.cmd +++ b/MAS/All-In-One-Version-KL/MAS_AIO.cmd @@ -1,5 +1,5 @@ -@::63489fhty3-random -@set masver=3.0 +@::de62hd8-random +@set masver=3.1 @setlocal DisableDelayedExpansion @echo off @@ -386,8 +386,7 @@ if not defined terminal mode 76, 34 if %winbuild% GEQ 10240 if not exist "%SystemRoot%\Servicing\Packages\Microsoft-Windows-Server*Edition~*.mum" if not exist "%SystemRoot%\Servicing\Packages\Microsoft-Windows-*EvalEdition~*.mum" set _hwidgo=1 if %winbuild% GTR 14393 if exist "%SysPath%\spp\tokens\skus\EnterpriseSN\" set _hwidgo= if not defined _hwidgo set _tsforgego=1 -if %winbuild% GEQ 9200 set _ohookgo=1 -if %winbuild% LSS 9200 set _okmsgo=1 +set _ohookgo=1 echo: echo: @@ -413,11 +412,7 @@ call :dk_color3 %_White% " [3] " %_Green% "TSforge" %_White% " echo: [3] TSforge - Windows / Office / ESU ) echo: [4] KMS38 - Windows -if defined _okmsgo ( -call :dk_color3 %_White% " [5] " %_Green% "Online KMS" %_White% " - Windows / Office" -) else ( echo: [5] Online KMS - Windows / Office -) echo: __________________________________________________ echo: echo: [6] Check Activation Status @@ -827,6 +822,7 @@ call :dk_color %Blue% "Windows Subscription [SKU ID-%slcSKU%] detected. Script w echo: ) +set generickey=1 call :dk_inskey "[%key%]" ::======================================================================================================================================== @@ -1246,11 +1242,12 @@ set keyerror=%errorlevel% cmd /c exit /b %keyerror% if %keyerror% NEQ 0 set "keyerror=[0x%=ExitCode%]" +if defined generickey (set "keyecho=Installing Generic Product Key ") else (set "keyecho=Installing Product Key ") if %keyerror% EQU 0 ( if %sps%==SoftwareLicensingService call :dk_refresh -echo Installing Generic Product Key %~1 [Successful] +echo %keyecho% %~1 [Successful] ) else ( -call :dk_color %Red% "Installing Generic Product Key %~1 [Failed] %keyerror%" +call :dk_color %Red% "%keyecho% %~1 [Failed] %keyerror%" if not defined error ( if defined altapplist call :dk_color %Red% "Activation ID not found for this key." call :dk_color %Blue% "%_fixmsg%" @@ -1259,6 +1256,7 @@ set showfix=1 set error=1 ) +set generickey= exit /b :: Activation command @@ -1402,7 +1400,7 @@ exit /b :dk_product set d1=%ref% $meth = $TypeBuilder.DefinePInvokeMethod('BrandingFormatString', 'winbrand.dll', 'Public, Static', 1, [String], @([String]), 1, 3); -set d1=%d1% $meth.SetImplementationFlags(128); $TypeBuilder.CreateType()::BrandingFormatString('%%WINDOWS_LONG%%') +set d1=%d1% $meth.SetImplementationFlags(128); $TypeBuilder.CreateType()::BrandingFormatString('%%WINDOWS_LONG%%') -replace [string][char]0xa9, '(C)' -replace [string][char]0xae, '(R)' -replace [string][char]0x2122, '(TM)' set winos= for /f "delims=" %%s in ('"%psc% %d1%"') do if not errorlevel 1 (set winos=%%s) @@ -1412,10 +1410,6 @@ if %winbuild% GEQ 22000 ( set winos=!winos:Windows 10=Windows 11! ) ) -if %winbuild% LSS 7600 ( -set "winos=!winos:VistaT=Vista!" -set "winos=!winos:Serverr=Server!" -) if not defined winsub exit /b @@ -2170,12 +2164,27 @@ for %%A in (%_act% %_rem%) do (if "%%A"=="1" set _unattended=1) ::======================================================================================================================================== -if %winbuild% LSS 9200 ( -%eline% +if %winbuild% LSS 6001 ( +%nceline% echo Unsupported OS version detected [%winbuild%]. -echo Ohook Activation is supported only on Windows 8/10/11 and their server equivalents. +echo MAS only supports Windows Vista/7/8/8.1/10/11 and their Server equivalents. +if %winbuild% EQU 6000 ( echo: -call :dk_color %Blue% "Use Online KMS activation option instead." +echo Windows Vista RTM is not supported because Powershell cannot be installed. +echo Upgrade to Windows Vista SP1 or SP2. +) +goto dk_done +) + +if not exist %ps% ( +%nceline% +echo PowerShell is not installed in your system. +if %winbuild% LSS 7600 ( +echo Install PowerShell using the following URL. +echo: +echo https://www.catalog.update.microsoft.com/Search.aspx?q=KB968930 +if %_unattended%==0 start https://www.catalog.update.microsoft.com/Search.aspx?q=KB968930 +) goto dk_done ) @@ -2223,8 +2232,8 @@ goto :oh_menu cls if not defined terminal ( -mode 130, 32 -if exist "%SysPath%\spp\store_test\" mode 134, 32 +mode 140, 32 +if exist "%SysPath%\spp\store_test\" mode 140, 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;}" %nul% ) title Ohook Activation %masver% @@ -2233,9 +2242,9 @@ echo: echo Initializing... call :dk_chkmal -if not exist %SysPath%\sppsvc.exe ( +if not exist %SysPath%\%_slexe% ( %eline% -echo [%SysPath%\sppsvc.exe] file is missing, aborting... +echo [%SysPath%\%_slexe%] file is missing, aborting... echo: call :dk_color %Blue% "Go back to Main Menu, select Troubleshoot and run DISM Restore and SFC Scan options." call :dk_color %Blue% "After that, restart system and try activation again." @@ -2267,7 +2276,7 @@ call :dk_showosinfo echo Initiating Diagnostic Tests... -set "_serv=sppsvc Winmgmt" +set "_serv=%_slser% Winmgmt" :: Software Protection :: Windows Management Instrumentation @@ -2276,9 +2285,10 @@ set notwinact=1 set ohookact=1 call :dk_errorcheck +call :oh_setspp + :: Check unsupported office versions -set o14msi= set o14c2r= set o16uwp= @@ -2293,10 +2303,10 @@ if %winbuild% GEQ 10240 ( for /f "delims=" %%a in ('%psc% "(Get-AppxPackage -name 'Microsoft.Office.Desktop' | Select-Object -ExpandProperty InstallLocation)" %nul6%') do (if exist "%%a\Integration\Integrator.exe" set o16uwp=Office UWP ) ) -if not "%o14msi%%o14c2r%%o16uwp%"=="" ( +if not "%o14c2r%%o16uwp%"=="" ( echo: -call :dk_color %Red% "Checking Unsupported Office Install [ %o14msi%%o14c2r%%o16uwp%]" -if not "%o14msi%%o16uwp%"=="" call :dk_color %Blue% "Use Online KMS option to activate it." +call :dk_color %Red% "Checking Unsupported Office Install [ %o14c2r%%o16uwp%]" +if not "%o16uwp%"=="" call :dk_color %Blue% "Use TSforge option to activate it." ) if %winbuild% GEQ 10240 %psc% "Get-AppxPackage -name "Microsoft.MicrosoftOfficeHub"" | find /i "Office" %nul1% && ( @@ -2327,10 +2337,10 @@ set o15c2r= set error=1 ) -if "%o16c2r%%o15c2r%%o16msi%%o15msi%"=="" ( +if "%o16c2r%%o15c2r%%o16msi%%o15msi%%o14msi%"=="" ( set error=1 echo: -if not "%o14msi%%o14c2r%%o16uwp%"=="" ( +if not "%o14c2r%%o16uwp%"=="" ( call :dk_color %Red% "Checking Supported Office Install [Not Found]" ) else ( call :dk_color %Red% "Checking Installed Office [Not Found]" @@ -2349,8 +2359,8 @@ goto dk_done ) set multioffice= -if not "%o16c2r%%o15c2r%%o16msi%%o15msi%"=="1" set multioffice=1 -if not "%o14msi%%o14c2r%%o16uwp%"=="" set multioffice=1 +if not "%o16c2r%%o15c2r%%o16msi%%o15msi%%o14msi%"=="1" set multioffice=1 +if not "%o14c2r%%o16uwp%"=="" set multioffice=1 if defined multioffice ( call :dk_color %Gray% "Checking Multiple Office Install [Found, its recommended to install only one version]" @@ -2394,12 +2404,8 @@ set "_oIntegrator=%_oRoot%\integration\integrator.exe" if /i "%_oArch%"=="x64" (set "_hookPath=%_oRoot%\vfs\System" & set "_hook=sppc64.dll") if /i "%_oArch%"=="x86" (set "_hookPath=%_oRoot%\vfs\SystemX86" & set "_hook=sppc32.dll") -if not "%osarch%"=="x86" ( -if /i "%_oArch%"=="x64" set "_sppcPath=%SystemRoot%\System32\sppc.dll" -if /i "%_oArch%"=="x86" set "_sppcPath=%SystemRoot%\SysWOW64\sppc.dll" -) else ( -set "_sppcPath=%SystemRoot%\System32\sppc.dll" -) + +call :oh_ppcpath echo: echo Activating Office... [C2R ^| %_version% ^| %_oArch%] @@ -2410,9 +2416,20 @@ set error=1 goto :starto16c2r ) +if defined noOsppc ( +call :dk_color %Red% "Checking OSPPC.DLL [Not found. Aborting activation...]" +call :dk_color %Blue% "%_fixmsg%" +set error=1 +goto :starto16c2r +) + call :oh_fixprids call :oh_process +if defined isOspp ( +call :oh_hookinstall_ospp +) else ( call :oh_hookinstall +) ::======================================================================================================================================== @@ -2444,12 +2461,8 @@ set "_oIntegrator=%_oRoot%\integration\integrator.exe" if /i "%_oArch%"=="x64" (set "_hookPath=%_oRoot%\vfs\System" & set "_hook=sppc64.dll") if /i "%_oArch%"=="x86" (set "_hookPath=%_oRoot%\vfs\SystemX86" & set "_hook=sppc32.dll") -if not "%osarch%"=="x86" ( -if /i "%_oArch%"=="x64" set "_sppcPath=%SystemRoot%\System32\sppc.dll" -if /i "%_oArch%"=="x86" set "_sppcPath=%SystemRoot%\SysWOW64\sppc.dll" -) else ( -set "_sppcPath=%SystemRoot%\System32\sppc.dll" -) + +call :oh_ppcpath echo: echo Activating Office... [C2R ^| %_version% %_AudienceData%^| %_oArch%] @@ -2460,9 +2473,20 @@ set error=1 goto :startmsi ) +if defined noOsppc ( +call :dk_color %Red% "Checking OSPPC.DLL [Not found. Aborting activation...]" +call :dk_color %Blue% "%_fixmsg%" +set error=1 +goto :startmsi +) + call :oh_fixprids call :oh_process +if defined isOspp ( +call :oh_hookinstall_ospp +) else ( call :oh_hookinstall +) ::======================================================================================================================================== @@ -2499,6 +2523,9 @@ echo Adding a Registry to Prevent Banner [Successful] :startmsi +if defined o14msi call :oh_setspp 14 +if defined o14msi call :oh_processmsi 14 %o14msi_reg% +call :oh_setspp if defined o15msi call :oh_processmsi 15 %o15msi_reg% if defined o16msi call :oh_processmsi 16 %o16msi_reg% @@ -2530,7 +2557,7 @@ goto :dk_done :oh_uninstall cls -if not defined terminal mode 99, 32 +if not defined terminal mode 145, 32 title Uninstall Ohook Activation %masver% set _present= @@ -2546,6 +2573,7 @@ if defined o16c2r_reg (for /f "skip=2 tokens=2*" %%a in ('"reg query %o16c2r_reg if defined o15c2r_reg (for /f "skip=2 tokens=2*" %%a in ('"reg query %o15c2r_reg% /v InstallPath" %nul6%') do (set "_15CHook=%%b\root\vfs")) if defined o16msi_reg (for /f "skip=2 tokens=2*" %%a in ('"reg query %o16msi_reg%\Common\InstallRoot /v Path" %nul6%') do (set "_16MHook=%%b")) if defined o15msi_reg (for /f "skip=2 tokens=2*" %%a in ('"reg query %o15msi_reg%\Common\InstallRoot /v Path" %nul6%') do (set "_15MHook=%%b")) +if defined o14msi_reg (for /f "skip=2 tokens=2*" %%a in ('"reg query %o14msi_reg%\Common\InstallRoot /v Path" %nul6%') do (set "_14MHook=%%b")) if defined _16CHook (if exist "%_16CHook%\System\sppc*dll" (set _present=1& del /s /f /q "%_16CHook%\System\sppc*dll" & if exist "%_16CHook%\System\sppc*dll" set _unerror=1)) if defined _16CHook (if exist "%_16CHook%\SystemX86\sppc*dll" (set _present=1& del /s /f /q "%_16CHook%\SystemX86\sppc*dll" & if exist "%_16CHook%\SystemX86\sppc*dll" set _unerror=1)) @@ -2553,8 +2581,9 @@ if defined _15CHook (if exist "%_15CHook%\System\sppc*dll" (set _present=1& d if defined _15CHook (if exist "%_15CHook%\SystemX86\sppc*dll" (set _present=1& del /s /f /q "%_15CHook%\SystemX86\sppc*dll" & if exist "%_15CHook%\SystemX86\sppc*dll" set _unerror=1)) if defined _16MHook (if exist "%_16MHook%sppc*dll" (set _present=1& del /s /f /q "%_16MHook%sppc*dll" & if exist "%_16MHook%sppc*dll" set _unerror=1)) if defined _15MHook (if exist "%_15MHook%sppc*dll" (set _present=1& del /s /f /q "%_15MHook%sppc*dll" & if exist "%_15MHook%sppc*dll" set _unerror=1)) +if defined _14MHook (if exist "%_14MHook%sppc*dll" (set _present=1& del /s /f /q "%_14MHook%sppc*dll" & if exist "%_14MHook%sppc*dll" set _unerror=1)) -for %%# in (15 16) do ( +for %%# in (14 15 16) do ( for %%A in ("%ProgramFiles%" "%ProgramW6432%" "%ProgramFiles(x86)%") do ( if exist "%%~A\Microsoft Office\Office%%#\sppc*dll" (set _present=1& del /s /f /q "%%~A\Microsoft Office\Office%%#\sppc*dll" & if exist "%%~A\Microsoft Office\Office%%#\sppc*dll" set _unerror=1) ) @@ -2568,6 +2597,31 @@ if exist "%%~A\Microsoft %%~G\root\vfs\%%#\sppc*dll" (set _present=1& del /s /f ) ) +::================================== + +for %%# in (OSPPC.DLL sppcs.dll) do ( +for %%A in ("%CommonProgramFiles%" "%CommonProgramW6432%" "%CommonProgramFiles(x86)%") do ( +for %%G in ("%%~A\Microsoft Shared\OfficeSoftwareProtectionPlatform\%%#") do ( +set size=0 +set size=%%~zG +if !size! GEQ 1 if !size! LSS 100000 ( +set _present=1 +del /f /q "%%~G" +if exist "%%~G" (move /y "%%~G" "!_ttemp!\needsToBeDeleted%random%" %nul%) +if exist "%%~G" (set _unerror=1) else (echo Deleted file - %%~G) +) +if /i sppcs.dll==%%# if !size! GEQ 100000 ( +move /y "%%~G" "%%~A\Microsoft Shared\OfficeSoftwareProtectionPlatform\OSPPC.DLL" %nul% +if exist "%%~G" (move /y "%%~A\Microsoft Shared\OfficeSoftwareProtectionPlatform\OSPPC.DLL" "!_ttemp!\needsToBeDeleted%random%" %nul%) +move /y "%%~G" "%%~A\Microsoft Shared\OfficeSoftwareProtectionPlatform\OSPPC.DLL" %nul% +if exist "%%~G" (set _unerror=1&echo Failed to rename sppcs.dll back to "%%~A\Microsoft Shared\OfficeSoftwareProtectionPlatform\OSPPC.DLL") else (echo Renamed sppcs.dll back to "%%~A\Microsoft Shared\OfficeSoftwareProtectionPlatform\OSPPC.DLL") +) +) +) +) + +::================================== + reg query HKCU\Software\Microsoft\Office\16.0\Common\Licensing\Resiliency %nul% && ( echo: echo Deleting - Registry keys for skipping license check @@ -2597,6 +2651,8 @@ reg unload HKU\%%# %nul% ) ) +::================================== + set "kmskey=HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\SoftwareProtectionPlatform\0ff1ce15-a989-479d-af46-f275c6370663" reg query "%kmskey%" %nul% && ( echo: @@ -2643,6 +2699,7 @@ set _oLPath= set _hookPath= set _hook= set _sppcPath= +set _osppPath= set _actid= set _prod= set _lic= @@ -2661,6 +2718,7 @@ set o16c2r= set o15c2r= set o16msi= set o15msi= +set o14msi= set _68=HKLM\SOFTWARE\Microsoft\Office set _86=HKLM\SOFTWARE\Wow6432Node\Microsoft\Office @@ -2674,6 +2732,52 @@ for /f "skip=2 tokens=2*" %%a in ('"reg query %_86%\16.0\Common\InstallRoot /v P for /f "skip=2 tokens=2*" %%a in ('"reg query %_68%\16.0\Common\InstallRoot /v Path" %nul6%') do if exist "%%b\EntityPicker.dll" (set o16msi=1&set o16msi_reg=%_68%\16.0) for /f "skip=2 tokens=2*" %%a in ('"reg query %_86%\15.0\Common\InstallRoot /v Path" %nul6%') do if exist "%%b\EntityPicker.dll" (set o15msi=1&set o15msi_reg=%_86%\15.0) for /f "skip=2 tokens=2*" %%a in ('"reg query %_68%\15.0\Common\InstallRoot /v Path" %nul6%') do if exist "%%b\EntityPicker.dll" (set o15msi=1&set o15msi_reg=%_68%\15.0) +for /f "skip=2 tokens=2*" %%a in ('"reg query %_86%\14.0\Common\InstallRoot /v Path" %nul6%') do if exist "%%b\EntityPicker.dll" (set o14msi=1&set o14msi_reg=%_86%\14.0) +for /f "skip=2 tokens=2*" %%a in ('"reg query %_68%\14.0\Common\InstallRoot /v Path" %nul6%') do if exist "%%b\EntityPicker.dll" (set o14msi=1&set o14msi_reg=%_68%\14.0) + +exit /b + +::======================================================================================================================================== + +:oh_ppcpath + +if not defined isOspp ( +if not "%osarch%"=="x86" ( +if /i "%_oArch%"=="x64" set "_sppcPath=%SystemRoot%\System32\sppc.dll" +if /i "%_oArch%"=="x86" set "_sppcPath=%SystemRoot%\SysWOW64\sppc.dll" +) else ( +set "_sppcPath=%SystemRoot%\System32\sppc.dll" +) +) + +set noOsppc= +set _hook68= +set _hook86= +set _osppPath68= +set _osppPath86= + +if defined isOspp ( +if not "%osarch%"=="x86" ( +if /i "%_oArch%"=="x64" ( +for /f "skip=2 tokens=2*" %%a in ('"reg query HKLM\SOFTWARE\Microsoft\OfficeSoftwareProtectionPlatform /v Path" %nul6%') do (set "_osppPath68=%%b") +if not exist "!_osppPath68!OSPPC.DLL" set noOsppc=1 +) +if /i "%_oArch%"=="x86" ( +for /f "skip=2 tokens=2*" %%a in ('"reg query HKLM\SOFTWARE\Microsoft\OfficeSoftwareProtectionPlatform /v Path" %nul6%') do (set "_osppPath68=%%b") +for /f "skip=2 tokens=2*" %%a in ('"reg query HKLM\SOFTWARE\Wow6432Node\Microsoft\OfficeSoftwareProtectionPlatform /v Path" %nul6%') do (set "_osppPath86=%%b") +if not exist "!_osppPath68!OSPPC.DLL" set noOsppc=1 +if not exist "!_osppPath86!OSPPC.DLL" set noOsppc=1 +) +) else ( +for /f "skip=2 tokens=2*" %%a in ('"reg query HKLM\SOFTWARE\Microsoft\OfficeSoftwareProtectionPlatform /v Path" %nul6%') do (set "_osppPath86=%%b") +if not exist "!_osppPath86!OSPPC.DLL" set noOsppc=1 +) +if "!_osppPath68:~-1!"=="\" set "_osppPath68=!_osppPath68:~0,-1!" +if "!_osppPath86:~-1!"=="\" set "_osppPath86=!_osppPath86:~0,-1!" +) + +if defined _osppPath68 set _hook68=sppc64.dll +if defined _osppPath86 set _hook86=sppc32.dll exit /b @@ -2769,15 +2873,24 @@ set hasherror= if %_hook%==sppc32.dll set offset=2564 if %_hook%==sppc64.dll set offset=3076 -del /s /q "%_hookPath%\sppcs.dll" %nul% -del /s /q "%_hookPath%\sppc.dll" %nul% +::====================================== -if exist "%_hookPath%\sppcs.dll" set "ierror=Remove Previous Ohook Install" -if exist "%_hookPath%\sppc.dll" set "ierror=Remove Previous Ohook Install" +:: Remove previous Install + +for %%# in (sppcs.dll sppc.dll) do ( +del /f /q "%_hookPath%\%%#" %nul% +if exist "%_hookPath%\%%#" (move /y "%_hookPath%\%%#" "!_ttemp!\needsToBeDeleted%random%" %nul%) +if exist "%_hookPath%\%%#" (set "ierror=Remove Previous Ohook Install [%%#]") +) + +if defined ierror goto :oh_hookinstall_error + +::====================================== mklink "%_hookPath%\sppcs.dll" "%_sppcPath%" %nul% -if not %errorlevel%==0 ( -if not defined ierror set ierror=mklink +if not exist "%_hookPath%\sppcs.dll" ( +set ierror=mklink sppcs.dll +goto :oh_hookinstall_error ) set exhook= @@ -2792,17 +2905,122 @@ popd call :oh_extractdll "%_hookPath%\sppc.dll" "%offset%" ) ) -if not exist "%_hookPath%\sppc.dll" (if not defined ierror set ierror=Copy) +if not exist "%_hookPath%\sppc.dll" ( +set ierror=Copy +goto :oh_hookinstall_error +) echo: -if not defined ierror ( -echo Symlinking System's sppc.dll to ["%_hookPath%\sppcs.dll"] [Successful] +echo Symlinking System's sppc.dll ["%_hookPath%\sppcs.dll"] [Successful] if defined exhook ( echo Copying Custom %_hook% to ["%_hookPath%\sppc.dll"] [Successful] ) else ( echo Extracting Custom %_hook% to ["%_hookPath%\sppc.dll"] [Successful] ) + +goto :oh_hookinstall_error + +::======================================================================================================================================== + +:oh_hookinstall_ospp + +set ierror= +set hasherror= + +if defined _hook86 set offset86=2564 +if defined _hook68 set offset68=3076 + +::====================================== + +:: Remove previous Install + +for %%# in (OSPPC.DLL sppcs.dll) do ( +for %%A in ("%_osppPath68%\%%#" "%_osppPath86%\%%#") do ( +set size=0 +set size=%%~zA +if !size! GEQ 1 if !size! LSS 100000 ( +del /f /q "%%~A" %nul% +if exist "%%~A" (move /y "%%~A" "!_ttemp!\needsToBeDeleted%random%" %nul%) +if exist "%%~A" (set "ierror=Remove Previous Ohook Install [%%#]") +) +) +) + +if defined ierror goto :oh_hookinstall_error + +for %%A in ("%_osppPath68%" "%_osppPath86%") do ( +if exist "%%~A\sppcs.dll" (move /y "%%~A\sppcs.dll" "%%~A\OSPPC.DLL" %nul%) +if exist "%%~A\sppcs.dll" ( +move /y "%%~A\OSPPC.DLL" "!_ttemp!\needsToBeDeleted%random%" %nul% +move /y "%%~A\sppcs.dll" "%%~A\OSPPC.DLL" %nul% +) +if exist "%%~A\sppcs.dll" (set "ierror=Move sppcs.dll back to OSPPC.DLL") +) + +del /f /q "%_hookPath%\sppcs.dll" %nul% +if exist "%_hookPath%\sppcs.dll" (move /y "%_hookPath%\sppcs.dll" "!_ttemp!\needsToBeDeleted%random%" %nul%) +if exist "%_hookPath%\sppcs.dll" (set "ierror=Remove Previous Ohook mklink sppcs.dll") + +if defined ierror goto :oh_hookinstall_error + +::====================================== + +if defined _osppPath68 (move /y "%_osppPath68%\OSPPC.DLL" "%_osppPath68%\sppcs.dll" %nul% & if not exist "%_osppPath68%\sppcs.dll" set ierror=1) +if defined _osppPath86 (move /y "%_osppPath86%\OSPPC.DLL" "%_osppPath86%\sppcs.dll" %nul% & if not exist "%_osppPath86%\sppcs.dll" set ierror=1) + +if defined ierror ( +set "ierror=Rename OSPPC.DLL" +goto :oh_hookinstall_error +) + +if defined _osppPath68 if defined _osppPath86 (mklink "%_hookPath%\sppcs.dll" "%_osppPath86%\sppcs.dll" %nul%) +if defined _osppPath68 if not defined _osppPath86 (mklink "%_hookPath%\sppcs.dll" "%_osppPath68%\sppcs.dll" %nul%) +if defined _osppPath86 if not defined _osppPath68 (mklink "%_hookPath%\sppcs.dll" "%_osppPath86%\sppcs.dll" %nul%) + +if not exist "%_hookPath%\sppcs.dll" ( +set ierror=mklink sppcs.dll +goto :oh_hookinstall_error +) + +set exhook= +if exist "!_work!\BIN\%_hook68%" if exist "!_work!\BIN\%_hook86%" set exhook=1 + +if defined exhook ( +pushd "!_work!\BIN\" +if defined _osppPath68 (copy /y /b "%_hook68%" "%_osppPath68%\OSPPC.DLL" %nul%) +if defined _osppPath86 (copy /y /b "%_hook86%" "%_osppPath86%\OSPPC.DLL" %nul%) +popd ) else ( +if defined _osppPath68 (set _hook=%_hook68%&call :oh_extractdll "%_osppPath68%\OSPPC.DLL" "%offset68%") +if defined _osppPath86 (set _hook=%_hook86%&call :oh_extractdll "%_osppPath86%\OSPPC.DLL" "%offset86%") +) + +if defined _osppPath68 (if not exist "%_osppPath68%\OSPPC.DLL" set ierror=1) +if defined _osppPath86 (if not exist "%_osppPath86%\OSPPC.DLL" set ierror=1) + +if defined ierror ( +set ierror=Copy +goto :oh_hookinstall_error +) + +echo: +if defined _osppPath68 (echo Renaming OSPPC.DLL to sppcs.dll ["%_osppPath68%\sppcs.dll"]) +if defined _osppPath86 (echo Renaming OSPPC.DLL to sppcs.dll ["%_osppPath86%\sppcs.dll"]) +if defined exhook ( +if defined _osppPath68 (echo Copying Custom %_hook68% to ["%_osppPath68%\OSPPC.DLL"]) +if defined _osppPath86 (echo Copying Custom %_hook86% to ["%_osppPath86%\OSPPC.DLL"]) +) else ( +if defined _osppPath68 (echo Extracting Custom %_hook68% to ["%_osppPath68%\OSPPC.DLL"]) +if defined _osppPath86 (echo Extracting Custom %_hook86% to ["%_osppPath86%\OSPPC.DLL"]) +) + +echo Symlinking Renamed sppcs.dll ["%_hookPath%\sppcs.dll"] + +::======================================================================================================================================== + +:oh_hookinstall_error + +if defined ierror ( set error=1 call :dk_color %Red% "Installing Ohook [Failed to %ierror%]" echo: @@ -2821,9 +3039,9 @@ if not defined exhook if not defined ierror ( if defined hasherror ( set error=1 set ierror=1 -call :dk_color %Red% "Modifying Hash of Custom %_hook% [Failed]" +call :dk_color %Red% "Modifying Hash of Custom sppcs.dll [Failed]" ) else ( -echo Modifying Hash of Custom %_hook% [Successful] +echo Modifying Hash of Custom sppcs.dll [Successful] ) ) @@ -2831,6 +3049,26 @@ exit /b ::======================================================================================================================================== +:oh_setspp + +set isOspp= +if %winbuild% GEQ 9200 ( +set spp=SoftwareLicensingProduct +set sps=SoftwareLicensingService +) else ( +set isOspp=1 +set spp=OfficeSoftwareProtectionProduct +set sps=OfficeSoftwareProtectionService +) +if "%1"=="14" ( +set isOspp=1 +set spp=OfficeSoftwareProtectionProduct +set sps=OfficeSoftwareProtectionService +) +exit /b + +::======================================================================================================================================== + :oh_process for %%# in (%_oIds%) do ( @@ -2850,10 +3088,11 @@ call :ohookdata getinfo !_prod! if not "!key!"=="" ( echo "!allapps!" | find /i "!_actid!" %nul1% || call :oh_installlic +if not %oVer%==14 set generickey=1 call :dk_inskey "[!key!] [!_prod!] [!_lic!]" ) else ( set error=1 -call :dk_color %Red% "Checking Product In Script [Office %oVer%.0 !_prod! not found in script]" +call :dk_color %Red% "Checking Product In Script [Office %oVer%.0 !_prod! key not found in script]" call :dk_color %Blue% "Make sure you are using the latest version of MAS." set fixes=%fixes% %mas% call :dk_color %_Yellow% "%mas%" @@ -2880,7 +3119,11 @@ exit /b :: Process Office MSI Version call :oh_reset +if "%1"=="14" ( +call :dk_actids 59a52881-a989-479d-af46-f275c6370663 +) else ( call :dk_actids 0ff1ce15-a989-479d-af46-f275c6370663 +) set oVer=%1 for /f "skip=2 tokens=2*" %%a in ('"reg query %2\Common\InstallRoot /v Path" %nul6%') do (set "_oRoot=%%b") @@ -2893,16 +3136,8 @@ if "%osarch%"=="x86" set _oArch=x86 if /i "%_oArch%"=="x64" (set "_hookPath=%_oRoot%" & set "_hook=sppc64.dll") if /i "%_oArch%"=="x86" (set "_hookPath=%_oRoot%" & set "_hook=sppc32.dll") -if not "%osarch%"=="x86" ( -if /i "%_oArch%"=="x64" set "_sppcPath=%SystemRoot%\System32\sppc.dll" -if /i "%_oArch%"=="x86" set "_sppcPath=%SystemRoot%\SysWOW64\sppc.dll" -) else ( -set "_sppcPath=%SystemRoot%\System32\sppc.dll" -) -set "_common=%CommonProgramFiles%" -if defined PROCESSOR_ARCHITEW6432 set "_common=%CommonProgramW6432%" -set "_common2=%CommonProgramFiles(x86)%" +call :oh_ppcpath call :msiofficedata %2 @@ -2915,8 +3150,23 @@ call :dk_color %Red% "Checking Installed Products [Product IDs not f exit /b ) +if defined noOsppc ( +call :dk_color %Red% "Checking OSPPC.DLL [Not found. Aborting activation...]" +call :dk_color %Blue% "%_fixmsg%" +set error=1 +exit /b +) + +if %oVer%==14 if defined SingleImage ( +echo Checking Installed Products [SingleImage product found, Professional Retail key will be used for activation] +) + call :oh_process +if defined isOspp ( +call :oh_hookinstall_ospp +) else ( call :oh_hookinstall +) exit /b @@ -3154,15 +3404,69 @@ exit /b :: 1st column = Office version number :: 2nd column = Activation ID -:: 3rd column = Generic key. Preference is given in this order, Retail:TB:Sub > Retail > OEM:NONSLP > Volume:MAK > Volume:GVLK +:: 3rd column = For Office 2013 and later, the generated keys are listed. For Office 2010, the blocked keys sourced from the Internet are listed. +:: For Office 2013 and later, key preference is given in this order, Retail:TB:Sub > Retail > OEM:NONSLP > Volume:MAK > Volume:GVLK +:: For Office 2010, key preference is given in this order, Retail > Volume:MAK :: 4th column = Last part of license description :: 5th column = Edition +:: 6th column = Other Edition IDs if they are part of the same primary product (For reference only) :: Separator = "_" +::=============== + +:: We couldn't find any keys (blocked/generic doesn't matter) for these Office 2010 products. If you have them, please share with us. + +14_4eaff0d0-c6cb-4187-94f3-c7656d49a0aa_Retail________ExcelR_[HSExcelR] +14_7004b7f0-6407-4f45-8eac-966e5f868bde_Retail________GrooveR +14_fbf4ac36-31c8-4340-8666-79873129cf40_Retail________OutlookR +14_133c8359-4e93-4241-8118-30bb18737ea0_Retail________PowerPointR_[HSPowerPointR] +14_98677603-a668-4fa4-9980-3f1f05f78f69_Retail________PublisherR +14_db3bbc9c-ce52-41d1-a46f-1a1d68059119_Retail________WordR_[HSWordR] +14_dbe3aee0-5183-4ff7-8142-66050173cb01_Retail________SmallBusBasicsR_[SmallBusBasicsMSDNR] + +:: These installers are not publicly available, so it doesn't matter if we don't have their keys. + +14_19316117-30a8-4773-8fd9-7f7231f4e060_SubPrepid_____HomeBusinessSubR +14_4d06f72e-fd50-4bc2-a24b-d448d7f17ef2_SubPrepid_____ProjectProSubR +14_e98ef0c0-71c4-42ce-8305-287d8721e26c_SubPrepid_____ProPlusSubR +14_14f5946a-debc-4716-babc-7e2c240fec08_Retail________MondoR +14_533b656a-4425-480b-8e30-1a2358898350_MAK___________MondoVL + :ohookdata set f= for %%# in ( +:: Office 2010 +14_4d463c2c-0505-4626-8cdb-a4da82e2d8ed_7KTYC-XR43P-C3MRW-BJKFD-XB%f%YPG_Retail________AccessR +14_745fb377-0a59-4ca9-b9a9-c359557a2c4e_7XHPQ-BQMYG-YBP49-CY8B2-T8%f%CGQ_ByPass________AccessRuntimeR +14_95ab3ec8-4106-4f9d-b632-03c019d1d23f_89RTQ-MT4GK-6CPTX-WWP7C-J9%f%KXR_MAK___________AccessVL +14_71dc86ff-f056-40d0-8ffb-9592705c9b76_39TRR-C2F37-9WYJ2-MJQXH-B9%f%38K_MAK___________ExcelVL +14_fdad0dfa-417d-4b4f-93e4-64ea8867b7fd_RCGT3-FPQDV-H49CD-PPDBF-TH%f%47G_MAK___________GrooveVL +14_7b7d1f17-fdcb-4820-9789-9bec6e377821_3YR9B-D9W79-BY66R-R8XYP-QY%f%YYY_Retail________HomeBusinessR_[HomeBusinessDemoR] +14_09e2d37e-474b-4121-8626-58ad9be5776f_3X43R-HHHXX-FRHRW-2M2WJ-8V%f%PHD_Retail________HomeStudentR_[HomeStudentDemoR] +14_ef1da464-01c8-43a6-91af-e4e5713744f9_XDGJY-KFHW9-JWX9X-YM4GW-GC%f%8WR_Retail________InfoPathR +14_85e22450-b741-430c-a172-a37962c938af_6GKT2-KMJPK-4RRBF-8VQKB-JB%f%6G6_MAK___________InfoPathVL +14_3f7aa693-9a7e-44fc-9309-bb3d8e604925_2TG3P-9DB76-4YT99-8RXGD-CW%f%XBP_Retail________OneNoteR_[HSOneNoteR] +14_6860b31f-6a67-48b8-84b9-e312b3485c4b_CV64P-F4VRH-BJ33D-PH6MR-X6%f%9RY_MAK___________OneNoteVL +14_a9aeabd8-63b8-4079-a28e-f531807fd6b8_J8C9M-YXMH2-9CX44-2C3YG-V7%f%692_MAK___________OutlookVL +14_acb51361-c0db-4895-9497-1831c41f31a6_GMBWM-WVX26-7WHV4-DB43D-WV%f%DY2_Retail________PersonalR_[PersonalDemoR,PersonalPrepaidR] +14_38252940-718c-4aa6-81a4-135398e53851_HPBQP-RJHDR-Q3472-PT9Q6-PB%f%B72_MAK___________PowerPointVL +14_8b559c37-0117-413e-921b-b853aeb6e210_367X9-9HP9R-TKHY6-DH4QH-K9%f%PY7_Retail________ProfessionalR_[ProfessionalAcadR,ProfessionalDemoR,OEM-SingleImage] +14_725714d7-d58f-4d12-9fa8-35873c6f7215_6JD4G-KRW3J-48MGV-DM6FC-T9%f%WKR_Retail________ProjectProR_[ProjectProMSDNR] +14_1cf57a59-c532-4e56-9a7d-ffa2fe94b474_3XDTH-MMGJ6-F9MKX-THP8D-G9%f%BP7_MAK___________ProjectProVL +14_688f6589-2bd9-424e-a152-b13f36aa6de1_2W96V-RTQ9R-2BPVT-PT8H9-MV%f%68T_Retail________ProjectStdR +14_11b39439-6b93-4642-9570-f2eb81be2238_4DTT4-D4MKX-23KFH-JKR6T-YK%f%G2J_MAK___________ProjectStdVL +14_71af7e84-93e6-4363-9b69-699e04e74071_2J9H6-H4D3G-PCXD2-96XVM-TR%f%R73_Retail________ProPlusR_[ProPlusAcadR,ProPlusMSDNR,Sub4R] +14_fdf3ecb9-b56f-43b2-a9b8-1b48b6bae1a7_6CD6C-9R8PB-T2D9Y-8RKKX-W7%f%DFK_MAK___________ProPlusVL_[ProPlusAcadVL] +14_3d014759-b128-4466-9018-e80f6320d9d0_32YG9-3VX77-YXJVV-PRVFW-TT%f%8BV_MAK___________PublisherVL +14_8090771e-d41a-4482-929e-de87f1f47e46_7VKXH-9BWCG-RPTBB-JBRV3-GR%f%HYC_MAK___________SmallBusBasicsVL +14_b78df69e-0966-40b1-ae85-30a5134dedd0_H48K6-FB4Y6-P83GH-9J7XG-HD%f%KKX_ByPass________SPDR +14_b6d2565c-341d-4768-ad7d-addbe00bb5ce_W3BTX-H6BW7-Q6DFW-BXFFY-8R%f%VJP_Retail________StandardR_[StandardMSDNR][KeyisforMSDNR] +14_1f76e346-e0be-49bc-9954-70ec53a4fcfe_2XTQP-GDR7C-GTXPC-6W6PV-4R%f%XGC_MAK___________StandardVL_[StandardAcadVL] +14_2745e581-565a-4670-ae90-6bf7c57ffe43_VXHHB-W7HBD-7M342-RJ7P8-CH%f%BD6_ByPass________StarterR +14_66cad568-c2dc-459d-93ec-2f3cb967ee34_2RDPT-WPYQM-C2WXF-BTPDW-2J%f%2HM_Retail________VisioSIR_Prem[Pro,Std] +14_36756cb8-8e69-4d11-9522-68899507cd6a_7PKFT-X2MKQ-GT6X2-8CB2W-CH%f%C9K_MAK___________VisioSIVL_Prem[Pro,Std] +14_98d4050e-9c98-49bf-9be1-85e12eb3ab13_6J3XK-DFKGK-X373V-QJHYM-V3%f%FC2_MAK___________WordVL :: Office 2013 15_ab4d047b-97cf-4126-a69f-34df08e2f254_B7RFY-7NXPK-Q4342-Y9X2H-3J%f%X4X_Retail________AccessRetail 15_259de5be-492b-44b3-9d78-9645f848f7b0_X3XNB-HJB7K-66THH-8DWQ3-XH%f%GJP_Bypass________AccessRuntimeRetail @@ -3397,7 +3701,7 @@ exit /b :oh_extractdll set b= -%psc% "$f=[io.file]::ReadAllText('!_batp!') -split ':%_hook%\:.*';$encoded = ($f[1]) -replace '-', 'A' -replace '_', 'a';$bytes = [Con%b%vert]::FromBas%b%e64String($encoded); $PePath='%1'; $offset='%2'; $m=[io.file]::ReadAllText('!_batp!') -split ':hexedit\:.*';iex ($m[1]);" %nul2% | find /i "Error found" %nul1% && set hasherror=1 +%psc% "$f=[io.file]::ReadAllText('!_batp!') -split ':%_hook%\:.*';$encoded = ($f[1]) -replace '-', 'A' -replace '_', 'a';$bytes = [Con%b%vert]::FromBas%b%e64String($encoded); $PePath='%1'; $offset='%2'; $m=[io.file]::ReadAllText('!_batp!') -split ':hexedit\:.*';iex ($m[1])" %nul2% | find /i "Error found" %nul1% && set hasherror=1 exit /b :hexedit: @@ -3436,7 +3740,7 @@ $Writer.Write($unixTimestamp) $Writer.Flush() # Write the current state of the MemoryStream to a temporary file -$tempFilePath = [System.IO.Path]::Combine($env:windir, "Temp", [System.IO.Path]::GetRandomFileName()) +$tempFilePath = "$env:windir\Temp\$([System.IO.Path]::GetRandomFileName())" [System.IO.File]::WriteAllBytes($tempFilePath, $MemoryStream.ToArray()) # Update hash using the temporary file @@ -3693,8 +3997,6 @@ set _unattended=0 set _args=%* if defined _args set _args=%_args:"=% -if defined _args set _args=%_args:re1=% -if defined _args set _args=%_args:re2=% if defined _args for %%A in (%_args%) do ( if /i "%%A"=="-el" (set _elev=1) if /i "%%A"=="/Z-Windows" (set _actwin=1) @@ -3739,9 +4041,9 @@ echo: echo ______________________________________________________________ echo: echo [1] Activate - Windows -echo [2] Activate - Windows [ESU] -echo [3] Activate - Office [All] -echo [4] Activate - Office [Project/Visio] +echo [2] Activate - ESU +echo [3] Activate - Office [All] +echo [4] Activate - Office [Project/Visio] echo [5] Activate - All echo _______________________________________________ echo: @@ -3872,13 +4174,6 @@ set "_serv=%_slser% Winmgmt" call :dk_errorcheck -if defined error ( -call :dk_color %Red% "Some errors were detected. Aborting the operation..." -set fixes=%fixes% %mas%troubleshoot -call :dk_color2 %Blue% "Check this webpage for help - " %_Yellow% " %mas%troubleshoot" -goto :dk_done -) - call :ts_getedition if not defined tsedition ( call :dk_color %Red% "Checking Windows Edition ID [Not found in installed licenses, aborting...]" @@ -4012,7 +4307,8 @@ goto :ts_esu echo Checking Activation ID [%tempid%] [%tsedition%] -call :ts_inskey "[%key%]" +set generickey=1 +call :dk_inskey "[%key%]" if not defined error set tsids=%tsids% %tempid% goto :ts_esu @@ -4134,7 +4430,8 @@ goto :ts_esu echo Resetting Rearm / GracePeriod [Successful] ) -call :ts_inskey "[%key%]" +set generickey=1 +call :dk_inskey "[%key%]" ::======================================================================================================================================== @@ -4207,7 +4504,7 @@ set esuexistbutnosup=1 if defined esuexistsup if defined _vis ( set key=9FPV7-MWGT8-7XPDF-JC23W-WT7TW REM This is a non-generic blocked MAK key for Server-ESU-PA -call :ts_inskey "[!key!]" +call :dk_inskey "[!key!]" goto :ts_off ) @@ -4256,7 +4553,7 @@ if not %_actoff%==1 goto :ts_act if %winbuild% LSS 9200 ( echo: call :dk_color %Gray% "Checking Supported Office [TSforge for Office is supported on Windows 8 and later versions]" -call :dk_color %Blue% "On Windows Vista / 7, use Online %KS% activation option for Office instead." +call :dk_color %Blue% "On Windows Vista / 7, use Ohook activation option for Office instead." goto :ts_act ) @@ -4297,6 +4594,7 @@ for /f "skip=2 tokens=2*" %%a in ('"reg query %_68%\14.0\Common\InstallRoot /v P if not "%o14msi%%o14c2r%"=="" ( echo: call :dk_color %Red% "Checking Unsupported Office Install [ %o14msi%%o14c2r%]" +if defined o14msi call :dk_color %Blue% "Use Ohook activation option for Office 2010." ) if %winbuild% GEQ 10240 %psc% "Get-AppxPackage -name "Microsoft.MicrosoftOfficeHub"" | find /i "Office" %nul1% && ( @@ -4617,7 +4915,7 @@ call :dk_color %Blue% "Business, BusinessN, Enterprise, EnterpriseN, and Server goto :ts_act ) -call :ts_inskey "[%key%]" +call :dk_inskey "[%key%]" if not defined error set tsids=%tsids% %tempid% goto :ts_act @@ -5146,27 +5444,6 @@ exit /b %psc% "Get-WmiObject -Query 'SELECT Name, Description FROM SoftwareLicensingProduct WHERE LicenseStatus=''1'' AND GracePeriodRemaining=''0'' AND PartialProductKey IS NOT NULL AND LicenseDependsOn IS NULL' | Where-Object { $_.Description -notmatch 'KMS' } | Select-Object -Property Name" %nul2% | findstr /i "Windows" %nul1% && set _perm=1||set _perm= exit /b -:: Install Key - -:ts_inskey - -if %_wmic% EQU 1 wmic path %sps% where __CLASS='%sps%' call InstallProductKey ProductKey="%key%" %nul% -if %_wmic% EQU 0 %psc% "try { $null=(([WMISEARCHER]'SELECT Version FROM %sps%').Get()).InstallProductKey('%key%'); exit 0 } catch { exit $_.Exception.InnerException.HResult }" %nul% -set keyerror=%errorlevel% -cmd /c exit /b %keyerror% -if %keyerror% NEQ 0 set "keyerror=[0x%=ExitCode%]" - -if %keyerror% EQU 0 ( -if %sps%==SoftwareLicensingService call :dk_refresh -echo Installing Product Key %~1 [Successful] -) else ( -set error=1 -call :dk_color %Red% "Installing Product Key %~1 [Failed] %keyerror%" -call :dk_color %Blue% "%_fixmsg%" -) - -exit /b - ::======================================================================================================================================== :tsforge: @@ -10651,7 +10928,7 @@ echo: echo [0] %_exitmsg% echo: ______________________________________________________ echo: -call :dk_color2 %_White% " " %_Green% "Choose a menu option using your keyboard [1,2,0]" +call :dk_color2 %_White% " " %_Green% "Choose a menu option using your keyboard [1,2,0]" choice /C:120 /N set _el=!errorlevel! if !_el!==3 exit /b @@ -10882,6 +11159,7 @@ call echo Checking Installed Product Key [Partial Key - %%_partial%%] [ ) if defined key ( +set generickey=1 call :dk_inskey "[%key%]" ) @@ -11700,6 +11978,7 @@ call echo Checking Installed Product Key [Partial Key - %%_partial%%] [ ) if defined key ( +set generickey=1 call :dk_inskey "[%key%]" ) @@ -11709,7 +11988,7 @@ call :dk_inskey "[%key%]" if not %_actoff%==1 goto :ks_activate -call :ks_setspp +call :oh_setspp :: Check ohook install @@ -11754,7 +12033,7 @@ set ohub=1 :: Check supported office versions -call :ks_getpath +call :oh_getpath set o16uwp= set o16uwp_path= @@ -11933,9 +12212,9 @@ call :ks_process :ks_startmsi -if defined o14msi call :ks_setspp 14 +if defined o14msi call :oh_setspp 14 if defined o14msi call :ks_processmsi 14 %o14msi_reg% -call :ks_setspp +call :oh_setspp if defined o15msi call :ks_processmsi 15 %o15msi_reg% if defined o16msi call :ks_processmsi 16 %o16msi_reg% @@ -12079,33 +12358,6 @@ exit /b ::======================================================================================================================================== -:ks_getpath - -set o16c2r= -set o15c2r= -set o16msi= -set o15msi= -set o14msi= - -set _68=HKLM\SOFTWARE\Microsoft\Office -set _86=HKLM\SOFTWARE\Wow6432Node\Microsoft\Office - -for /f "skip=2 tokens=2*" %%a in ('"reg query %_86%\ClickToRun /v InstallPath" %nul6%') do if exist "%%b\root\Licenses16\ProPlus*.xrm-ms" (set o16c2r=1&set o16c2r_reg=%_86%\ClickToRun) -for /f "skip=2 tokens=2*" %%a in ('"reg query %_68%\ClickToRun /v InstallPath" %nul6%') do if exist "%%b\root\Licenses16\ProPlus*.xrm-ms" (set o16c2r=1&set o16c2r_reg=%_68%\ClickToRun) -for /f "skip=2 tokens=2*" %%a in ('"reg query %_86%\15.0\ClickToRun /v InstallPath" %nul6%') do if exist "%%b\root\Licenses\ProPlus*.xrm-ms" (set o15c2r=1&set o15c2r_reg=%_86%\15.0\ClickToRun) -for /f "skip=2 tokens=2*" %%a in ('"reg query %_68%\15.0\ClickToRun /v InstallPath" %nul6%') do if exist "%%b\root\Licenses\ProPlus*.xrm-ms" (set o15c2r=1&set o15c2r_reg=%_68%\15.0\ClickToRun) - -for /f "skip=2 tokens=2*" %%a in ('"reg query %_86%\16.0\Common\InstallRoot /v Path" %nul6%') do if exist "%%b\EntityPicker.dll" (set o16msi=1&set o16msi_reg=%_86%\16.0) -for /f "skip=2 tokens=2*" %%a in ('"reg query %_68%\16.0\Common\InstallRoot /v Path" %nul6%') do if exist "%%b\EntityPicker.dll" (set o16msi=1&set o16msi_reg=%_68%\16.0) -for /f "skip=2 tokens=2*" %%a in ('"reg query %_86%\15.0\Common\InstallRoot /v Path" %nul6%') do if exist "%%b\EntityPicker.dll" (set o15msi=1&set o15msi_reg=%_86%\15.0) -for /f "skip=2 tokens=2*" %%a in ('"reg query %_68%\15.0\Common\InstallRoot /v Path" %nul6%') do if exist "%%b\EntityPicker.dll" (set o15msi=1&set o15msi_reg=%_68%\15.0) -for /f "skip=2 tokens=2*" %%a in ('"reg query %_86%\14.0\Common\InstallRoot /v Path" %nul6%') do if exist "%%b\EntityPicker.dll" (set o14msi=1&set o14msi_reg=%_86%\14.0) -for /f "skip=2 tokens=2*" %%a in ('"reg query %_68%\14.0\Common\InstallRoot /v Path" %nul6%') do if exist "%%b\EntityPicker.dll" (set o14msi=1&set o14msi_reg=%_68%\14.0) - -exit /b - -::======================================================================================================================================== - :: After retail to volume conversion, new product ID needs .OSPPReady key in registry, otherwise product info may not fully reflect :ks_osppready @@ -12134,16 +12386,19 @@ exit /b ::======================================================================================================================================== -:ks_setspp +:oh_setspp +set isOspp= if %winbuild% GEQ 9200 ( set spp=SoftwareLicensingProduct set sps=SoftwareLicensingService ) else ( +set isOspp=1 set spp=OfficeSoftwareProtectionProduct set sps=OfficeSoftwareProtectionService ) if "%1"=="14" ( +set isOspp=1 set spp=OfficeSoftwareProtectionProduct set sps=OfficeSoftwareProtectionService ) @@ -12203,6 +12458,7 @@ call :ks_osppready if not "!key!"=="" ( echo "!allapps!" | find /i "!_actid!" %nul1% || call :oh_installlic +set generickey=1 call :dk_inskey "[!key!] [!_prod!]" ) else ( if not defined _oMSI ( @@ -12211,7 +12467,7 @@ call :dk_color %Red% "Checking Product In Script [Office %oVer%.0 ! call :dk_color %Blue% "Make sure you are using Latest MAS script." ) else ( call :dk_color %Red% "Checking Product In Script [!_prod! MSI Retail is not supported]" -call :dk_color %Blue% "Uninstall this and Install C2R or MSI VL version of Office." +call :dk_color %Blue% "Use Ohook option to activate it." ) set fixes=%fixes% %mas%genuine-installation-media call :dk_color %_Yellow% "%mas%genuine-installation-media" @@ -12245,10 +12501,6 @@ echo "%2" | find /i "Wow6432Node" %nul1% && set _oArch=x86 if not "%osarch%"=="x86" if not defined _oArch set _oArch=x64 if "%osarch%"=="x86" set _oArch=x86 -set "_common=%CommonProgramFiles%" -if defined PROCESSOR_ARCHITEW6432 set "_common=%CommonProgramW6432%" -set "_common2=%CommonProgramFiles(x86)%" - call :msiofficedata %2 echo: @@ -13228,47 +13480,30 @@ exit /b :: 5th column = Other Edition IDs if they are part of the same primary product (For reference only) :: Separator = "_" -:: EditionID Notes: -:: For Office 2013 and later, all Edition IDs are clearly defined, and each ID corresponds to its specific licensing. - -:: In Office 2010, the situation is a bit more complicated. -:: Products typically fall into two separate categories: Volume License (VL) and Non-VL. This is because a single installation cannot include both Retail and VL licensing types. -:: Some Edition IDs share the same primary product ID. For example, installing ProPlusVL also installs ProPlusAcadVL licenses, as both use 0011 as the primary product ID. -:: Therefore, in the script, we grouped VL and Non-VL versions by primary product ID and selected the highest Edition ID when multiple Edition IDs existed for the same primary product ID. - -:: There are a few exceptions to this 2010 rule: Visio (Premium, Pro, Standard) and OEM-SingleImage. - -:: For Visio, the issue is that branding.xml lists incorrect primary product IDs. The correct primary product ID for all three Visio variants is 0057. Based on the criteria above, we chose Visio-Premium as the representative Edition ID among the three. -:: For OEM-SingleImage, it installs multiple Edition IDs and uses 003D as the primary product ID. Following our method, we selected the highest available Edition ID—ProfessionalR in this case. - :msiofficedata for %%# in ( 14_4d463c2c-0505-4626-8cdb-a4da82e2d8ed_0015_AccessR 14_745fb377-0a59-4ca9-b9a9-c359557a2c4e_001C_AccessRuntimeR 14_95ab3ec8-4106-4f9d-b632-03c019d1d23f_0015_AccessVL -14_4eaff0d0-c6cb-4187-94f3-c7656d49a0aa_0016_ExcelR +14_4eaff0d0-c6cb-4187-94f3-c7656d49a0aa_0016_ExcelR_[HSExcelR] 14_71dc86ff-f056-40d0-8ffb-9592705c9b76_0016_ExcelVL 14_7004b7f0-6407-4f45-8eac-966e5f868bde_00BA_GrooveR 14_fdad0dfa-417d-4b4f-93e4-64ea8867b7fd_00BA_GrooveVL 14_7b7d1f17-fdcb-4820-9789-9bec6e377821_0013_HomeBusinessR_[HomeBusinessDemoR] 14_19316117-30a8-4773-8fd9-7f7231f4e060_011E_HomeBusinessSubR 14_09e2d37e-474b-4121-8626-58ad9be5776f_002F_HomeStudentR_[HomeStudentDemoR] -14_c3ae020c-5a71-4cc5-a27a-2a97c2d46860_0029_HSExcelR -14_25fe4611-b44d-49cc-ae87-2143d299194e_00A3_HSOneNoteR -14_d652ad8d-da5c-4358-b928-7fb1b4de7a7c_0037_HSPowerPointR -14_a963d7ae-7a88-41a7-94da-8bb5635a8af9_002B_HSWordR 14_ef1da464-01c8-43a6-91af-e4e5713744f9_0044_InfoPathR 14_85e22450-b741-430c-a172-a37962c938af_0044_InfoPathVL 14_14f5946a-debc-4716-babc-7e2c240fec08_000F_MondoR 14_533b656a-4425-480b-8e30-1a2358898350_000F_MondoVL 14_c1ceda8b-c578-4d5d-a4aa-23626be4e234_003D_ProfessionalR_[OEM-SingleImage]Exception -14_3f7aa693-9a7e-44fc-9309-bb3d8e604925_00A1_OneNoteR +14_3f7aa693-9a7e-44fc-9309-bb3d8e604925_00A1_OneNoteR_[HSOneNoteR] 14_6860b31f-6a67-48b8-84b9-e312b3485c4b_00A1_OneNoteVL 14_fbf4ac36-31c8-4340-8666-79873129cf40_001A_OutlookR 14_a9aeabd8-63b8-4079-a28e-f531807fd6b8_001A_OutlookVL 14_acb51361-c0db-4895-9497-1831c41f31a6_0033_PersonalR_[PersonalDemoR,PersonalPrepaidR] -14_133c8359-4e93-4241-8118-30bb18737ea0_0018_PowerPointR +14_133c8359-4e93-4241-8118-30bb18737ea0_0018_PowerPointR_[HSPowerPointR] 14_38252940-718c-4aa6-81a4-135398e53851_0018_PowerPointVL 14_8b559c37-0117-413e-921b-b853aeb6e210_0014_ProfessionalR_[ProfessionalAcadR,ProfessionalDemoR] 14_725714d7-d58f-4d12-9fa8-35873c6f7215_003B_ProjectProR_[ProjectProMSDNR] @@ -13289,7 +13524,7 @@ for %%# in ( 14_2745e581-565a-4670-ae90-6bf7c57ffe43_0066_StarterR 14_66cad568-c2dc-459d-93ec-2f3cb967ee34_0057_VisioSIR_Prem[Pro,Std]Exception 14_36756cb8-8e69-4d11-9522-68899507cd6a_0057_VisioSIVL_Prem[Pro,Std]Exception -14_db3bbc9c-ce52-41d1-a46f-1a1d68059119_001B_WordR +14_db3bbc9c-ce52-41d1-a46f-1a1d68059119_001B_WordR_[HSWordR] 14_98d4050e-9c98-49bf-9be1-85e12eb3ab13_001B_WordVL :: Office 2013 15_ab4d047b-97cf-4126-a69f-34df08e2f254_0015_AccessRetail @@ -13407,6 +13642,7 @@ if "%oVer%"=="%%A" ( reg query "%1\Registration\{%%B}" /v ProductCode %nul2% | find /i "-%%C-" %nul% && ( reg query "%1\Common\InstalledPackages" %nul2% | find /i "-%%C-" %nul% && ( if defined _oIds (set _oIds=!_oIds! %%D) else (set _oIds=%%D) +if /i 003D==%%C set SingleImage=1 ) ) ) @@ -13878,12 +14114,14 @@ function BoolToWStr($bVal) { } function InitializePInvoke($LaDll, $bOffice) { - $Marshal = [System.Runtime.InteropServices.Marshal] - $Module = [AppDomain]::CurrentDomain.DefineDynamicAssembly((Get-Random), 'Run').DefineDynamicModule((Get-Random), $False) - $SLApp = $NT7 -Or $bOffice -Or ($LaDll -EQ 'sppc.dll' -And [Diagnostics.FileVersionInfo]::GetVersionInfo("$SysPath\sppc.dll").FilePrivatePart -GE 16501) - + $LaName = [IO.Path]::GetFileNameWithoutExtension($LaDll) + $SLApp = $NT7 -Or $bOffice -Or ($LaName -EQ 'sppc' -And [Diagnostics.FileVersionInfo]::GetVersionInfo("$SysPath\sppc.dll").FilePrivatePart -GE 16501) $Win32 = $null - $Class = $Module.DefineType((Get-Random), 'Public, Abstract, Sealed, BeforeFieldInit', [Object], 0) + + $Marshal = [System.Runtime.InteropServices.Marshal] + $Module = [AppDomain]::CurrentDomain.DefineDynamicAssembly(($LaName+"_Assembly"), 'Run').DefineDynamicModule(($LaName+"_Module"), $False) + $Class = $Module.DefineType(($LaName+"_Methods"), 'Public, Abstract, Sealed, BeforeFieldInit', [Object], 0) + $Class.DefinePInvokeMethod('SLClose', $LaDll, 22, 1, [Int32], @([IntPtr]), 1, 3).SetImplementationFlags(128) $Class.DefinePInvokeMethod('SLOpen', $LaDll, 22, 1, [Int32], @([IntPtr].MakeByRefType()), 1, 3).SetImplementationFlags(128) $Class.DefinePInvokeMethod('SLGenerateOfflineInstallationId', $LaDll, 22, 1, [Int32], @([IntPtr], [Guid].MakeByRefType(), [IntPtr].MakeByRefType()), 1, 3).SetImplementationFlags(128) @@ -13932,10 +14170,51 @@ function SlGetInfoIID($SkuId) { return $null } + else + { + return $Marshal::PtrToStringUni($bData) + } +} - $rData = $Marshal::PtrToStringUni($bData) - $Marshal::FreeHGlobal($bData) - return $rData +function SlReturnData($hrRet, $tData, $cData, $bData) { + if ($hrRet -NE 0 -Or $cData -EQ 0) + { + return $null + } + if ($tData -EQ 1) + { + return $Marshal::PtrToStringUni($bData) + } + elseif ($tData -EQ 4) + { + return $Marshal::ReadInt32($bData) + } + elseif ($tData -EQ 3 -And $cData -EQ 8) + { + return $Marshal::ReadInt64($bData) + } + else + { + return $null + } +} + +function SlGetInfoPKey($PkeyId, $Value) +{ + $tData = 0 + $cData = 0 + $bData = 0 + + $hrRet = $Win32::SLGetPKeyInformation( + $hSLC, + [ref][Guid]$PkeyId, + $Value, + [ref]$tData, + [ref]$cData, + [ref]$bData + ) + + return SlReturnData $hrRet $tData $cData $bData } function SlGetInfoSku($SkuId, $Value) @@ -13944,7 +14223,7 @@ function SlGetInfoSku($SkuId, $Value) $cData = 0 $bData = 0 - $ret = $Win32::SLGetProductSkuInformation( + $hrRet = $Win32::SLGetProductSkuInformation( $hSLC, [ref][Guid]$SkuId, $Value, @@ -13953,70 +14232,7 @@ function SlGetInfoSku($SkuId, $Value) [ref]$bData ) - if ($ret -Or !$cData) - { - return $null - } - - if ($tData -EQ 1) - { - $rData = $Marshal::PtrToStringUni($bData) - } - elseif ($tData -EQ 4) - { - $rData = $Marshal::ReadInt32($bData) - } - elseif ($tData -EQ 3 -And $cData -EQ 8) - { - $rData = $Marshal::ReadInt64($bData) - } - else - { - $rData = $null - } - - $Marshal::FreeHGlobal($bData) - return $rData -} - -function SlGetInfoService($Value) -{ - $tData = 0 - $cData = 0 - $bData = 0 - - $ret = $Win32::SLGetServiceInformation( - $hSLC, - $Value, - [ref]$tData, - [ref]$cData, - [ref]$bData - ) - - if ($ret -Or !$cData) - { - return $null - } - - if ($tData -EQ 1) - { - $rData = $Marshal::PtrToStringUni($bData) - } - elseif ($tData -EQ 4) - { - $rData = $Marshal::ReadInt32($bData) - } - elseif ($tData -EQ 3 -And $cData -EQ 8) - { - $rData = $Marshal::ReadInt64($bData) - } - else - { - $rData = $null - } - - $Marshal::FreeHGlobal($bData) - return $rData + return SlReturnData $hrRet $tData $cData $bData } function SlGetInfoApp($AppId, $Value) @@ -14025,7 +14241,7 @@ function SlGetInfoApp($AppId, $Value) $cData = 0 $bData = 0 - $ret = $Win32::SLGetApplicationInformation( + $hrRet = $Win32::SLGetApplicationInformation( $hSLC, [ref][Guid]$AppId, $Value, @@ -14034,80 +14250,49 @@ function SlGetInfoApp($AppId, $Value) [ref]$bData ) - if ($ret -Or !$cData) - { - return $null - } + return SlReturnData $hrRet $tData $cData $bData +} - if ($tData -EQ 1) - { - $rData = $Marshal::PtrToStringUni($bData) - } - elseif ($tData -EQ 4) - { - $rData = $Marshal::ReadInt32($bData) - } - elseif ($tData -EQ 3 -And $cData -EQ 8) - { - $rData = $Marshal::ReadInt64($bData) - } - else - { - $rData = $null - } +function SlGetInfoService($Value) +{ + $tData = 0 + $cData = 0 + $bData = 0 - $Marshal::FreeHGlobal($bData) - return $rData + $hrRet = $Win32::SLGetServiceInformation( + $hSLC, + $Value, + [ref]$tData, + [ref]$cData, + [ref]$bData + ) + + return SlReturnData $hrRet $tData $cData $bData } function SlGetInfoSvcApp($strApp, $Value) { if ($SLApp) { - $rData = SlGetInfoApp $strApp $Value + return SlGetInfoApp $strApp $Value } else { - $rData = SlGetInfoService $Value + return SlGetInfoService $Value } - return $rData -} - -function SlGetInfoPKey($PkeyId, $Value) -{ - $cData = 0 - $bData = 0 - - $ret = $Win32::SLGetPKeyInformation( - $hSLC, - [ref][Guid]$PKeyId, - $Value, - [ref]$null, - [ref]$cData, - [ref]$bData - ) - - if ($ret -Or !$cData) - { - return $null - } - - $rData = $Marshal::PtrToStringUni($bData) - $Marshal::FreeHGlobal($bData) - return $rData } function SlGetInfoLicensing($AppId, $SkuId) { - $LicenseStatus = 0 - $GracePeriodRemaining = 0 + $dwStatus = 0 + $dwGrace = 0 $hrReason = 0 - $EvaluationEndDate = 0 + $qwValidity = 0 $cStatus = 0 $pStatus = 0 - $ret = $Win32::SLGetLicensingStatusInformation( + $hrRet = $Win32::SLGetLicensingStatusInformation( $hSLC, [ref][Guid]$AppId, [ref][Guid]$SkuId, @@ -14116,80 +14301,46 @@ function SlGetInfoLicensing($AppId, $SkuId) [ref]$pStatus ) - if ($ret -Or !$cStatus) + if ($hrRet -NE 0 -Or $cStatus -EQ 0) { return } [IntPtr]$ppStatus = [Int64]$pStatus + [Int64]40 * ($cStatus - 1) - $eStatus = $Marshal::ReadInt32($ppStatus, 16) - $GracePeriodRemaining = $Marshal::ReadInt32($ppStatus, 20) + $dwStatus = $Marshal::ReadInt32($ppStatus, 16) + $dwGrace = $Marshal::ReadInt32($ppStatus, 20) $hrReason = $Marshal::ReadInt32($ppStatus, 28) - $EvaluationEndDate = $Marshal::ReadInt64($ppStatus, 32) + $qwValidity = $Marshal::ReadInt64($ppStatus, 32) - if ($eStatus -EQ 3) + if ($dwStatus -EQ 3) { - $eStatus = 5 + $dwStatus = 5 } - if ($eStatus -EQ 2) + if ($dwStatus -EQ 2) { if ($hrReason -EQ 0x4004F00D) { - $eStatus = 3 + $dwStatus = 3 } elseif ($hrReason -EQ 0x4004F065) { - $eStatus = 4 + $dwStatus = 4 } elseif ($hrReason -EQ 0x4004FC06) { - $eStatus = 6 + $dwStatus = 6 } } - $LicenseStatus = $eStatus - $Marshal::FreeHGlobal($pStatus) return } -function SlCheckInfo($SkuId, $Value) -{ - $cData = 0 - $bData = 0 - - $ret = $Win32::SLGetProductSkuInformation( - $hSLC, - [ref][Guid]$SkuId, - $Value, - [ref]$null, - [ref]$cData, - [ref]$bData - ) - - if ($ret -Or !$cData) - { - return $false - } - - if ($Value -EQ "pkeyId") - { - $rData = $Marshal::PtrToStringUni($bData) - } - else - { - $rData = $true - } - - $Marshal::FreeHGlobal($bData) - return $rData -} - function SlGetInfoSLID($AppId) { $cReturnIds = 0 $pReturnIds = 0 - $ret = $Win32::SLGetSLIDList( + $hrRet = $Win32::SLGetSLIDList( $hSLC, 0, [ref][Guid]$AppId, @@ -14198,7 +14349,7 @@ function SlGetInfoSLID($AppId) [ref]$pReturnIds ) - if ($ret -Or !$cReturnIds) + if ($hrRet -NE 0 -Or $cReturnIds -EQ 0) { return } @@ -14213,17 +14364,16 @@ function SlGetInfoSLID($AppId) $bytes = New-Object byte[] 16 $Marshal::Copy([Int64]$pReturnIds + [Int64]16 * $i, $bytes, 0, 16) $actid = ([Guid]$bytes).Guid - $gPPK = SlCheckInfo $actid "pkeyId" - $gAdd = SlCheckInfo $actid "DependsOn" + $gPPK = SlGetInfoSku $actid "pkeyId" + $gAdd = SlGetInfoSku $actid "DependsOn" if ($All.IsPresent) { - if (!$gPPK -And $gAdd) { $a1List += @{id = $actid; pk = $null; ex = $true} } - if (!$gPPK -And !$gAdd) { $a2List += @{id = $actid; pk = $null; ex = $false} } + if ($null -EQ $gPPK -And $null -NE $gAdd) { $a1List += @{id = $actid; pk = $null; ex = $true} } + if ($null -EQ $gPPK -And $null -EQ $gAdd) { $a2List += @{id = $actid; pk = $null; ex = $false} } } - if ($gPPK -And $gAdd) { $a3List += @{id = $actid; pk = $gPPK; ex = $true} } - if ($gPPK -And !$gAdd) { $a4List += @{id = $actid; pk = $gPPK; ex = $false} } + if ($null -NE $gPPK -And $null -NE $gAdd) { $a3List += @{id = $actid; pk = $gPPK; ex = $true} } + if ($null -NE $gPPK -And $null -EQ $gAdd) { $a4List += @{id = $actid; pk = $gPPK; ex = $false} } } - $Marshal::FreeHGlobal($pReturnIds) return ($a1List + $a2List + $a3List + $a4List) } @@ -14280,7 +14430,7 @@ function DetectSubscription { function DetectAdbaClient { - $propADBA | foreach { set $_ (SlGetInfoSku $ID $_) } + $propADBA | foreach { set $_ (SlGetInfoSku $licID $_) } CONOUT "`nAD Activation client information:" CONOUT " Object Name: $ADActivationObjectName" CONOUT " Domain Name: $ADActivationObjectDN" @@ -14290,7 +14440,7 @@ function DetectAdbaClient function DetectAvmClient { - $propAVMA | foreach { set $_ (SlGetInfoSku $ID $_) } + $propAVMA | foreach { set $_ (SlGetInfoSku $licID $_) } CONOUT "`nAutomatic VM Activation client information:" if (-Not [String]::IsNullOrEmpty($InheritedActivationId)) { CONOUT " Guest IAID: $InheritedActivationId" @@ -14321,7 +14471,6 @@ function DetectKmsHost if (-Not $IsKeyManagementService) { return } - if ($null -NE $ExpireMsg) {CONOUT "`n $ExpireMsg"} if ($Vista -Or $NT5) { $regk = $SLKeyPath @@ -14374,9 +14523,9 @@ function DetectKmsHost function DetectKmsClient { - if ($strSLP -EQ $wslp -And $NT8) + if ($win8) { - $VLType = strGetRegistry ($SPKeyPath + '\' + $strApp + '\' + $ID) "VLActivationType" + $VLType = strGetRegistry ($SPKeyPath + '\' + $strApp + '\' + $licID) "VLActivationType" if ($null -EQ $VLType) {$VLType = strGetRegistry ($SPKeyPath + '\' + $strApp) "VLActivationType"} if ($null -EQ $VLType) {$VLType = strGetRegistry ($SPKeyPath) "VLActivationType"} if ($null -EQ $VLType -Or $VLType -GT 3) {$VLType = 0} @@ -14390,7 +14539,7 @@ function DetectKmsClient } if ($NT7 -Or $strSLP -EQ $oslp) { - $propKMSClient | foreach { set $_ (SlGetInfoSku $ID $_) } + $propKMSClient | foreach { set $_ (SlGetInfoSku $licID $_) } if ($strSLP -EQ $oslp) {$regk = $OPKeyPath} else {$regk = $SPKeyPath} $KMSCaching = strGetRegistry $regk "DisableKeyManagementServiceHostCaching" if (-Not $KMSCaching) {$KMSCaching = "TRUE"} else {$KMSCaching = BoolToWStr (!$KMSCaching)} @@ -14448,58 +14597,90 @@ function DetectKmsClient function GetResult($strSLP, $strApp, $entry) { - $ID = $entry.id - $propPrd | foreach { set $_ (SlGetInfoSku $ID $_) } - . SlGetInfoLicensing $strApp $ID + $licID = $entry.id + $propPrd | foreach { set $_ (SlGetInfoSku $licID $_) } + . SlGetInfoLicensing $strApp $licID + $LicenseStatus = $dwStatus + $LicReason = $hrReason + $EvaluationEndDate = $qwValidity + $gprMnt = $dwGrace + + $pkid = $entry.pk + $isPPK = $null -NE $pkid + + $add_on = $Name.IndexOf("add-on for", 5) + if ($add_on -NE -1) { + $Name = $Name.Substring(0, $add_on + 7) + } + + $licPHN = "empty" + if ($Dlv -Or $All.IsPresent) { + $licPHN = SlGetInfoSku $licID "msft:sl/EUL/PHONE/PUBLIC" + } + + if ($LicenseStatus -EQ 0 -And !$isPPK) { + & $isAll + CONOUT "Name: $Name" + CONOUT "Description: $Description" + CONOUT "Activation ID: $licID" + CONOUT "License Status: Unlicensed" + if ($licPHN -NE "empty") { + $gPHN = [String]::IsNullOrEmpty($licPHN) -NE $true + CONOUT "Phone activatable: $($gPHN.ToString())" + } + return + } $winID = ($strApp -EQ $winApp) $winPR = ($winID -And -Not $entry.ex) $Vista = ($winID -And $NT6 -And -Not $NT7) $NT5 = ($strSLP -EQ $wslp -And $winbuild -LT 6001) + $win8 = ($strSLP -EQ $wslp -And $NT8) $reapp = ("Windows", "App")[!$winID] $prmnt = ("machine", "product")[!$winPR] - if ($Description | Select-String "VOLUME_KMSCLIENT") {$cKmsClient = 1; $_mTag = "Volume"} - if ($Description | Select-String "TIMEBASED_") {$cTblClient = 1; $_mTag = "Timebased"} - if ($Description | Select-String "VIRTUAL_MACHINE_ACTIVATION") {$cAvmClient = 1; $_mTag = "Automatic VM"} - if ($null -EQ $cKmsClient) { - if ($Description | Select-String "VOLUME_KMS") {$cKmsServer = 1} + if ($Description.Contains("VOLUME_KMSCLIENT")) {$cKmsClient = 1; $actTag = "Volume"} + if ($Description.Contains("TIMEBASED_")) {$cTblClient = 1; $actTag = "Timebased"} + if ($Description.Contains("VIRTUAL_MACHINE_ACTIVATION")) {$cAvmClient = 1; $actTag = "Automatic VM"} + if ($null -EQ $cKmsClient -And $Description.Contains("VOLUME_KMS")) {$cKmsServer = 1} + + $gprDay = [Math]::Round($gprMnt/1440) + $_xpr = "" + $inGrace = $false + if ($gprMnt -GT 0) { + $_xpr = [DateTime]::Now.AddMinutes($gprMnt).ToString('yyyy-MM-dd hh:mm:ss tt') + $inGrace = $true } - $_gpr = [Math]::Round($GracePeriodRemaining/1440) - if ($_gpr -GT 0) { - $_xpr = [DateTime]::Now.AddMinutes($GracePeriodRemaining).ToString('yyyy-MM-dd hh:mm:ss tt') - } - - $LicenseReason = '0x{0:X}' -f $hrReason - $LicenseMsg = "Time remaining: $GracePeriodRemaining minute(s) ($_gpr day(s))" + $LicenseMsg = "Time remaining: $gprMnt minute(s) ($gprDay day(s))" if ($LicenseStatus -EQ 0) { $LicenseInf = "Unlicensed" $LicenseMsg = $null } if ($LicenseStatus -EQ 1) { $LicenseInf = "Licensed" - if ($GracePeriodRemaining -EQ 0) { + if ($gprMnt -EQ 0) { $LicenseMsg = $null $ExpireMsg = "The $prmnt is permanently activated." } else { - $LicenseMsg = "$_mTag activation expiration: $GracePeriodRemaining minute(s) ($_gpr day(s))" - if ($null -NE $_xpr) {$ExpireMsg = "$_mTag activation will expire $_xpr"} + $LicenseMsg = "$actTag activation expiration: $gprMnt minute(s) ($gprDay day(s))" + if ($inGrace) {$ExpireMsg = "$actTag activation will expire $_xpr"} } } if ($LicenseStatus -EQ 2) { $LicenseInf = "Initial grace period" - if ($null -NE $_xpr) {$ExpireMsg = "Initial grace period ends $_xpr"} + if ($inGrace) {$ExpireMsg = "$LicenseInf ends $_xpr"} } if ($LicenseStatus -EQ 3) { $LicenseInf = "Additional grace period (KMS license expired or hardware out of tolerance)" - if ($null -NE $_xpr) {$ExpireMsg = "Additional grace period ends $_xpr"} + if ($inGrace) {$ExpireMsg = "Additional grace period ends $_xpr"} } if ($LicenseStatus -EQ 4) { $LicenseInf = "Non-genuine grace period" - if ($null -NE $_xpr) {$ExpireMsg = "Non-genuine grace period ends $_xpr"} + if ($inGrace) {$ExpireMsg = "$LicenseInf ends $_xpr"} } if ($LicenseStatus -EQ 5 -And -Not $NT5) { + $LicenseReason = '0x{0:X}' -f $LicReason $LicenseInf = "Notification" $LicenseMsg = "Notification Reason: $LicenseReason" if ($LicenseReason -EQ "0xC004F00F") {if ($null -NE $cKmsClient) {$LicenseMsg = $LicenseMsg + " (KMS license expired)."} else {$LicenseMsg = $LicenseMsg + " (hardware out of tolerance)."}} @@ -14512,36 +14693,35 @@ function GetResult($strSLP, $strApp, $entry) } if ($LicenseStatus -EQ 6 -And -Not $Vista -And -Not $NT5) { $LicenseInf = "Extended grace period" - if ($null -NE $_xpr) {$ExpireMsg = "Extended grace period ends $_xpr"} + if ($inGrace) {$ExpireMsg = "$LicenseInf ends $_xpr"} } - $pkid = $entry.pk - if ($null -NE $pkid) { + if ($isPPK) { $propPkey | foreach { set $_ (SlGetInfoPKey $pkid $_) } } - if ($winPR -And $null -NE $PartialProductKey -And -Not $NT8) { - $uxd = SlGetInfoSku $ID 'UXDifferentiator' + if ($winPR -And $isPPK -And -Not $NT8) { + $uxd = SlGetInfoSku $licID 'UXDifferentiator' $script:primary += @{ - aid = $ID; + aid = $licID; ppk = $PartialProductKey; chn = $Channel; lst = $LicenseStatus; - lcr = $hrReason; - ged = $GracePeriodRemaining; + lcr = $LicReason; + ged = $gprMnt; evl = $EvaluationEndDate; dff = $uxd } } - if ($IID -And $null -NE $PartialProductKey) { - $OfflineInstallationId = SlGetInfoIID $ID + if ($IID -And $isPPK) { + $OfflineInstallationId = SlGetInfoIID $licID } if ($Dlv) { - if ($strSLP -EQ $wslp -And $NT8) + if ($win8) { - $RemainingSkuReArmCount = SlGetInfoSku $ID 'RemainingRearmCount' + $RemainingSkuReArmCount = SlGetInfoSku $licID 'RemainingRearmCount' $RemainingAppReArmCount = SlGetInfoApp $strApp 'RemainingRearmCount' } else @@ -14561,16 +14741,10 @@ function GetResult($strSLP, $strApp, $entry) } } - if ($Dlv -Or $All.IsPresent) { - $gPHN = SlCheckInfo $ID "msft:sl/EUL/PHONE/PUBLIC" - } - - $add_on = $Name.IndexOf("add-on for", 5) - & $isAll - if ($add_on -EQ -1) {CONOUT "Name: $Name"} else {CONOUT "Name: $($Name.Substring(0, $add_on + 7))"} + CONOUT "Name: $Name" CONOUT "Description: $Description" - CONOUT "Activation ID: $ID" + CONOUT "Activation ID: $licID" if ($null -NE $DigitalPID) {CONOUT "Extended PID: $DigitalPID"} if ($null -NE $DigitalPID2 -And $Dlv) {CONOUT "Product ID: $DigitalPID2"} if ($null -NE $OfflineInstallationId -And $IID) {CONOUT "Installation ID: $OfflineInstallationId"} @@ -14582,9 +14756,9 @@ function GetResult($strSLP, $strApp, $entry) $EED = [DateTime]::FromFileTimeUtc($EvaluationEndDate).ToString('yyyy-MM-dd hh:mm:ss tt') CONOUT "Evaluation End Date: $EED UTC" } - if ($LicenseStatus -NE 1 -And $null -NE $gPHN) { - $gPHN = $gPHN.ToString() - CONOUT "Phone activatable: $gPHN" + if ($LicenseStatus -NE 1 -And $licPHN -NE "empty") { + $gPHN = [String]::IsNullOrEmpty($licPHN) -NE $true + CONOUT "Phone activatable: $($gPHN.ToString())" } if ($Dlv) { if ($null -NE $RemainingSLReArmCount) { @@ -14599,11 +14773,11 @@ function GetResult($strSLP, $strApp, $entry) CONOUT "Trusted time: $TTD" } } - if ($null -EQ $PartialProductKey) { + if (!$isPPK) { return } - if ($strSLP -EQ $wslp -And $NT8 -And $VLActivationType -EQ 1) { + if ($win8 -And $VLActivationType -EQ 1) { DetectAdbaClient } @@ -14611,7 +14785,7 @@ function GetResult($strSLP, $strApp, $entry) DetectAvmClient } - $chkSub = ($winPR -And $cSub) + $chkSub = ($winPR -And $isSub) $chkSLS = ($null -NE $cKmsClient -Or $null -NE $cKmsServer -Or $chkSub) @@ -14620,15 +14794,14 @@ function GetResult($strSLP, $strApp, $entry) return } - if ($null -NE $cKmsServer) { - DetectKmsHost - } - if ($null -NE $cKmsClient) { DetectKmsClient } - if ($null -EQ $cKmsServer) { + if ($null -NE $cKmsServer) { + if ($null -NE $ExpireMsg) {CONOUT "`n $ExpireMsg"} + DetectKmsHost + } else { if ($null -NE $ExpireMsg) {CONOUT "`n $ExpireMsg"} } @@ -15045,14 +15218,14 @@ function clcGetExpireKrn $cData = 0 $bData = 0 - $ret = $Win32::SLGetWindowsInformation( + $hrRet = $Win32::SLGetWindowsInformation( "Kernel-ExpirationDate", [ref]$tData, [ref]$cData, [ref]$bData ) - if ($ret -Or !$cData -Or $tData -NE 3) + if ($hrRet -Or !$cData -Or $tData -NE 3) { return $null } @@ -15067,7 +15240,7 @@ function clcGetExpireKrn $rData = '{0}/{1}/{2}:{3}:{4}:{5}' -f $year, $Marshal::ReadInt16($bData, 2), $Marshal::ReadInt16($bData, 4), $Marshal::ReadInt16($bData, 6), $Marshal::ReadInt16($bData, 8), $Marshal::ReadInt16($bData, 10) } - $Marshal::FreeHGlobal($bData) + #$Marshal::FreeHGlobal($bData) return $rData } @@ -15103,12 +15276,12 @@ function clcGetGenuineState($AppId) $dwGenuine = 0 if ($NT7) { - $ret = $Win32::SLIsWindowsGenuineLocal([ref]$dwGenuine) + $hrRet = $Win32::SLIsWindowsGenuineLocal([ref]$dwGenuine) } else { - $ret = $Win32::SLIsGenuineLocal([ref][Guid]$AppId, [ref]$dwGenuine, 0) + $hrRet = $Win32::SLIsGenuineLocal([ref][Guid]$AppId, [ref]$dwGenuine, 0) } - if ($ret) + if ($hrRet) { $dwGenuine = 4 } @@ -15176,7 +15349,7 @@ $osls = "OfficeSoftwareProtectionService" $winApp = "55c92734-d682-4d71-983e-d6ec3f16059f" $o14App = "59a52881-a989-479d-af46-f275c6370663" $o15App = "0ff1ce15-a989-479d-af46-f275c6370663" -$cSub = ($winbuild -GE 26000) -And (Select-String -Path "$SysPath\wbem\sppwmi.mof" -Encoding unicode -Pattern "SubscriptionType") +$isSub = ($winbuild -GE 26000) -And (Select-String -Path "$SysPath\wbem\sppwmi.mof" -Encoding unicode -Pattern "SubscriptionType") $DllDigital = ($winbuild -GE 14393) -And (Test-Path "$SysPath\EditionUpgradeManagerObj.dll") $DllSubscription = ($winbuild -GE 14393) -And (Test-Path "$SysPath\Clipc.dll") $VLActTypes = @("All", "AD", "KMS", "Token") diff --git a/MAS/Separate-Files-Version/Activators/HWID_Activation.cmd b/MAS/Separate-Files-Version/Activators/HWID_Activation.cmd index 6409cec..340c2a8 100644 --- a/MAS/Separate-Files-Version/Activators/HWID_Activation.cmd +++ b/MAS/Separate-Files-Version/Activators/HWID_Activation.cmd @@ -1,4 +1,4 @@ -@set masver=3.0 +@set masver=3.1 @echo off @@ -541,6 +541,7 @@ call :dk_color %Blue% "Windows Subscription [SKU ID-%slcSKU%] detected. Script w echo: ) +set generickey=1 call :dk_inskey "[%key%]" ::======================================================================================================================================== @@ -960,11 +961,12 @@ set keyerror=%errorlevel% cmd /c exit /b %keyerror% if %keyerror% NEQ 0 set "keyerror=[0x%=ExitCode%]" +if defined generickey (set "keyecho=Installing Generic Product Key ") else (set "keyecho=Installing Product Key ") if %keyerror% EQU 0 ( if %sps%==SoftwareLicensingService call :dk_refresh -echo Installing Generic Product Key %~1 [Successful] +echo %keyecho% %~1 [Successful] ) else ( -call :dk_color %Red% "Installing Generic Product Key %~1 [Failed] %keyerror%" +call :dk_color %Red% "%keyecho% %~1 [Failed] %keyerror%" if not defined error ( if defined altapplist call :dk_color %Red% "Activation ID not found for this key." call :dk_color %Blue% "%_fixmsg%" @@ -973,6 +975,7 @@ set showfix=1 set error=1 ) +set generickey= exit /b :: Activation command @@ -1100,7 +1103,7 @@ exit /b :dk_product set d1=%ref% $meth = $TypeBuilder.DefinePInvokeMethod('BrandingFormatString', 'winbrand.dll', 'Public, Static', 1, [String], @([String]), 1, 3); -set d1=%d1% $meth.SetImplementationFlags(128); $TypeBuilder.CreateType()::BrandingFormatString('%%WINDOWS_LONG%%') +set d1=%d1% $meth.SetImplementationFlags(128); $TypeBuilder.CreateType()::BrandingFormatString('%%WINDOWS_LONG%%') -replace [string][char]0xa9, '(C)' -replace [string][char]0xae, '(R)' -replace [string][char]0x2122, '(TM)' set winos= for /f "delims=" %%s in ('"%psc% %d1%"') do if not errorlevel 1 (set winos=%%s) @@ -1110,10 +1113,6 @@ if %winbuild% GEQ 22000 ( set winos=!winos:Windows 10=Windows 11! ) ) -if %winbuild% LSS 7600 ( -set "winos=!winos:VistaT=Vista!" -set "winos=!winos:Serverr=Server!" -) if not defined winsub exit /b diff --git a/MAS/Separate-Files-Version/Activators/KMS38_Activation.cmd b/MAS/Separate-Files-Version/Activators/KMS38_Activation.cmd index bb2c624..3f99aee 100644 --- a/MAS/Separate-Files-Version/Activators/KMS38_Activation.cmd +++ b/MAS/Separate-Files-Version/Activators/KMS38_Activation.cmd @@ -1,4 +1,4 @@ -@set masver=3.0 +@set masver=3.1 @echo off @@ -620,6 +620,7 @@ call echo Checking Installed Product Key [Partial Key - %%_partial%%] [ ) if defined key ( +set generickey=1 call :dk_inskey "[%key%]" ) @@ -1079,11 +1080,12 @@ set keyerror=%errorlevel% cmd /c exit /b %keyerror% if %keyerror% NEQ 0 set "keyerror=[0x%=ExitCode%]" +if defined generickey (set "keyecho=Installing Generic Product Key ") else (set "keyecho=Installing Product Key ") if %keyerror% EQU 0 ( if %sps%==SoftwareLicensingService call :dk_refresh -echo Installing Generic Product Key %~1 [Successful] +echo %keyecho% %~1 [Successful] ) else ( -call :dk_color %Red% "Installing Generic Product Key %~1 [Failed] %keyerror%" +call :dk_color %Red% "%keyecho% %~1 [Failed] %keyerror%" if not defined error ( if defined altapplist call :dk_color %Red% "Activation ID not found for this key." call :dk_color %Blue% "%_fixmsg%" @@ -1092,6 +1094,7 @@ set showfix=1 set error=1 ) +set generickey= exit /b :: Get Windows installed key channel @@ -1198,7 +1201,7 @@ exit /b :dk_product set d1=%ref% $meth = $TypeBuilder.DefinePInvokeMethod('BrandingFormatString', 'winbrand.dll', 'Public, Static', 1, [String], @([String]), 1, 3); -set d1=%d1% $meth.SetImplementationFlags(128); $TypeBuilder.CreateType()::BrandingFormatString('%%WINDOWS_LONG%%') +set d1=%d1% $meth.SetImplementationFlags(128); $TypeBuilder.CreateType()::BrandingFormatString('%%WINDOWS_LONG%%') -replace [string][char]0xa9, '(C)' -replace [string][char]0xae, '(R)' -replace [string][char]0x2122, '(TM)' set winos= for /f "delims=" %%s in ('"%psc% %d1%"') do if not errorlevel 1 (set winos=%%s) @@ -1208,10 +1211,6 @@ if %winbuild% GEQ 22000 ( set winos=!winos:Windows 10=Windows 11! ) ) -if %winbuild% LSS 7600 ( -set "winos=!winos:VistaT=Vista!" -set "winos=!winos:Serverr=Server!" -) if not defined winsub exit /b diff --git a/MAS/Separate-Files-Version/Activators/Ohook_Activation_AIO.cmd b/MAS/Separate-Files-Version/Activators/Ohook_Activation_AIO.cmd index 5be9615..ca9a308 100644 --- a/MAS/Separate-Files-Version/Activators/Ohook_Activation_AIO.cmd +++ b/MAS/Separate-Files-Version/Activators/Ohook_Activation_AIO.cmd @@ -1,4 +1,4 @@ -@set masver=3.0 +@set masver=3.1 @echo off @@ -171,12 +171,27 @@ call :dk_color2 %Blue% "Check this webpage for help - " %_Yellow% " %mas%trouble goto dk_done ) -if %winbuild% LSS 9200 ( -%eline% +if %winbuild% LSS 6001 ( +%nceline% echo Unsupported OS version detected [%winbuild%]. -echo Ohook Activation is supported only on Windows 8/10/11 and their server equivalents. +echo MAS only supports Windows Vista/7/8/8.1/10/11 and their Server equivalents. +if %winbuild% EQU 6000 ( echo: -call :dk_color %Blue% "Use Online KMS activation option instead." +echo Windows Vista RTM is not supported because Powershell cannot be installed. +echo Upgrade to Windows Vista SP1 or SP2. +) +goto dk_done +) + +if not exist %ps% ( +%nceline% +echo PowerShell is not installed in your system. +if %winbuild% LSS 7600 ( +echo Install PowerShell using the following URL. +echo: +echo https://www.catalog.update.microsoft.com/Search.aspx?q=KB968930 +if %_unattended%==0 start https://www.catalog.update.microsoft.com/Search.aspx?q=KB968930 +) goto dk_done ) @@ -398,8 +413,8 @@ goto :oh_menu cls if not defined terminal ( -mode 130, 32 -if exist "%SysPath%\spp\store_test\" mode 134, 32 +mode 140, 32 +if exist "%SysPath%\spp\store_test\" mode 140, 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;}" %nul% ) title Ohook Activation %masver% @@ -408,9 +423,9 @@ echo: echo Initializing... call :dk_chkmal -if not exist %SysPath%\sppsvc.exe ( +if not exist %SysPath%\%_slexe% ( %eline% -echo [%SysPath%\sppsvc.exe] file is missing, aborting... +echo [%SysPath%\%_slexe%] file is missing, aborting... echo: call :dk_color %Blue% "Go back to Main Menu, select Troubleshoot and run DISM Restore and SFC Scan options." call :dk_color %Blue% "After that, restart system and try activation again." @@ -442,7 +457,7 @@ call :dk_showosinfo echo Initiating Diagnostic Tests... -set "_serv=sppsvc Winmgmt" +set "_serv=%_slser% Winmgmt" :: Software Protection :: Windows Management Instrumentation @@ -451,16 +466,15 @@ set notwinact=1 set ohookact=1 call :dk_errorcheck +call :oh_setspp + :: Check unsupported office versions -set o14msi= set o14c2r= set o16uwp= set _68=HKLM\SOFTWARE\Microsoft\Office set _86=HKLM\SOFTWARE\Wow6432Node\Microsoft\Office -for /f "skip=2 tokens=2*" %%a in ('"reg query %_86%\14.0\Common\InstallRoot /v Path" %nul6%') do if exist "%%b\EntityPicker.dll" (set o14msi=Office 2010 MSI ) -for /f "skip=2 tokens=2*" %%a in ('"reg query %_68%\14.0\Common\InstallRoot /v Path" %nul6%') do if exist "%%b\EntityPicker.dll" (set o14msi=Office 2010 MSI ) %nul% reg query %_68%\14.0\CVH /f Click2run /k && set o14c2r=Office 2010 C2R %nul% reg query %_86%\14.0\CVH /f Click2run /k && set o14c2r=Office 2010 C2R @@ -468,10 +482,10 @@ if %winbuild% GEQ 10240 ( for /f "delims=" %%a in ('%psc% "(Get-AppxPackage -name 'Microsoft.Office.Desktop' | Select-Object -ExpandProperty InstallLocation)" %nul6%') do (if exist "%%a\Integration\Integrator.exe" set o16uwp=Office UWP ) ) -if not "%o14msi%%o14c2r%%o16uwp%"=="" ( +if not "%o14c2r%%o16uwp%"=="" ( echo: -call :dk_color %Red% "Checking Unsupported Office Install [ %o14msi%%o14c2r%%o16uwp%]" -if not "%o14msi%%o16uwp%"=="" call :dk_color %Blue% "Use Online KMS option to activate it." +call :dk_color %Red% "Checking Unsupported Office Install [ %o14c2r%%o16uwp%]" +if not "%o16uwp%"=="" call :dk_color %Blue% "Use TSforge option to activate it." ) if %winbuild% GEQ 10240 %psc% "Get-AppxPackage -name "Microsoft.MicrosoftOfficeHub"" | find /i "Office" %nul1% && ( @@ -502,10 +516,10 @@ set o15c2r= set error=1 ) -if "%o16c2r%%o15c2r%%o16msi%%o15msi%"=="" ( +if "%o16c2r%%o15c2r%%o16msi%%o15msi%%o14msi%"=="" ( set error=1 echo: -if not "%o14msi%%o14c2r%%o16uwp%"=="" ( +if not "%o14c2r%%o16uwp%"=="" ( call :dk_color %Red% "Checking Supported Office Install [Not Found]" ) else ( call :dk_color %Red% "Checking Installed Office [Not Found]" @@ -524,8 +538,8 @@ goto dk_done ) set multioffice= -if not "%o16c2r%%o15c2r%%o16msi%%o15msi%"=="1" set multioffice=1 -if not "%o14msi%%o14c2r%%o16uwp%"=="" set multioffice=1 +if not "%o16c2r%%o15c2r%%o16msi%%o15msi%%o14msi%"=="1" set multioffice=1 +if not "%o14c2r%%o16uwp%"=="" set multioffice=1 if defined multioffice ( call :dk_color %Gray% "Checking Multiple Office Install [Found, its recommended to install only one version]" @@ -569,12 +583,8 @@ set "_oIntegrator=%_oRoot%\integration\integrator.exe" if /i "%_oArch%"=="x64" (set "_hookPath=%_oRoot%\vfs\System" & set "_hook=sppc64.dll") if /i "%_oArch%"=="x86" (set "_hookPath=%_oRoot%\vfs\SystemX86" & set "_hook=sppc32.dll") -if not "%osarch%"=="x86" ( -if /i "%_oArch%"=="x64" set "_sppcPath=%SystemRoot%\System32\sppc.dll" -if /i "%_oArch%"=="x86" set "_sppcPath=%SystemRoot%\SysWOW64\sppc.dll" -) else ( -set "_sppcPath=%SystemRoot%\System32\sppc.dll" -) + +call :oh_ppcpath echo: echo Activating Office... [C2R ^| %_version% ^| %_oArch%] @@ -585,9 +595,20 @@ set error=1 goto :starto16c2r ) +if defined noOsppc ( +call :dk_color %Red% "Checking OSPPC.DLL [Not found. Aborting activation...]" +call :dk_color %Blue% "%_fixmsg%" +set error=1 +goto :starto16c2r +) + call :oh_fixprids call :oh_process +if defined isOspp ( +call :oh_hookinstall_ospp +) else ( call :oh_hookinstall +) ::======================================================================================================================================== @@ -619,12 +640,8 @@ set "_oIntegrator=%_oRoot%\integration\integrator.exe" if /i "%_oArch%"=="x64" (set "_hookPath=%_oRoot%\vfs\System" & set "_hook=sppc64.dll") if /i "%_oArch%"=="x86" (set "_hookPath=%_oRoot%\vfs\SystemX86" & set "_hook=sppc32.dll") -if not "%osarch%"=="x86" ( -if /i "%_oArch%"=="x64" set "_sppcPath=%SystemRoot%\System32\sppc.dll" -if /i "%_oArch%"=="x86" set "_sppcPath=%SystemRoot%\SysWOW64\sppc.dll" -) else ( -set "_sppcPath=%SystemRoot%\System32\sppc.dll" -) + +call :oh_ppcpath echo: echo Activating Office... [C2R ^| %_version% %_AudienceData%^| %_oArch%] @@ -635,9 +652,20 @@ set error=1 goto :startmsi ) +if defined noOsppc ( +call :dk_color %Red% "Checking OSPPC.DLL [Not found. Aborting activation...]" +call :dk_color %Blue% "%_fixmsg%" +set error=1 +goto :startmsi +) + call :oh_fixprids call :oh_process +if defined isOspp ( +call :oh_hookinstall_ospp +) else ( call :oh_hookinstall +) ::======================================================================================================================================== @@ -674,6 +702,9 @@ echo Adding a Registry to Prevent Banner [Successful] :startmsi +if defined o14msi call :oh_setspp 14 +if defined o14msi call :oh_processmsi 14 %o14msi_reg% +call :oh_setspp if defined o15msi call :oh_processmsi 15 %o15msi_reg% if defined o16msi call :oh_processmsi 16 %o16msi_reg% @@ -705,7 +736,7 @@ goto :dk_done :oh_uninstall cls -if not defined terminal mode 99, 32 +if not defined terminal mode 145, 32 title Uninstall Ohook Activation %masver% set _present= @@ -721,6 +752,7 @@ if defined o16c2r_reg (for /f "skip=2 tokens=2*" %%a in ('"reg query %o16c2r_reg if defined o15c2r_reg (for /f "skip=2 tokens=2*" %%a in ('"reg query %o15c2r_reg% /v InstallPath" %nul6%') do (set "_15CHook=%%b\root\vfs")) if defined o16msi_reg (for /f "skip=2 tokens=2*" %%a in ('"reg query %o16msi_reg%\Common\InstallRoot /v Path" %nul6%') do (set "_16MHook=%%b")) if defined o15msi_reg (for /f "skip=2 tokens=2*" %%a in ('"reg query %o15msi_reg%\Common\InstallRoot /v Path" %nul6%') do (set "_15MHook=%%b")) +if defined o14msi_reg (for /f "skip=2 tokens=2*" %%a in ('"reg query %o14msi_reg%\Common\InstallRoot /v Path" %nul6%') do (set "_14MHook=%%b")) if defined _16CHook (if exist "%_16CHook%\System\sppc*dll" (set _present=1& del /s /f /q "%_16CHook%\System\sppc*dll" & if exist "%_16CHook%\System\sppc*dll" set _unerror=1)) if defined _16CHook (if exist "%_16CHook%\SystemX86\sppc*dll" (set _present=1& del /s /f /q "%_16CHook%\SystemX86\sppc*dll" & if exist "%_16CHook%\SystemX86\sppc*dll" set _unerror=1)) @@ -728,8 +760,9 @@ if defined _15CHook (if exist "%_15CHook%\System\sppc*dll" (set _present=1& d if defined _15CHook (if exist "%_15CHook%\SystemX86\sppc*dll" (set _present=1& del /s /f /q "%_15CHook%\SystemX86\sppc*dll" & if exist "%_15CHook%\SystemX86\sppc*dll" set _unerror=1)) if defined _16MHook (if exist "%_16MHook%sppc*dll" (set _present=1& del /s /f /q "%_16MHook%sppc*dll" & if exist "%_16MHook%sppc*dll" set _unerror=1)) if defined _15MHook (if exist "%_15MHook%sppc*dll" (set _present=1& del /s /f /q "%_15MHook%sppc*dll" & if exist "%_15MHook%sppc*dll" set _unerror=1)) +if defined _14MHook (if exist "%_14MHook%sppc*dll" (set _present=1& del /s /f /q "%_14MHook%sppc*dll" & if exist "%_14MHook%sppc*dll" set _unerror=1)) -for %%# in (15 16) do ( +for %%# in (14 15 16) do ( for %%A in ("%ProgramFiles%" "%ProgramW6432%" "%ProgramFiles(x86)%") do ( if exist "%%~A\Microsoft Office\Office%%#\sppc*dll" (set _present=1& del /s /f /q "%%~A\Microsoft Office\Office%%#\sppc*dll" & if exist "%%~A\Microsoft Office\Office%%#\sppc*dll" set _unerror=1) ) @@ -743,6 +776,31 @@ if exist "%%~A\Microsoft %%~G\root\vfs\%%#\sppc*dll" (set _present=1& del /s /f ) ) +::================================== + +for %%# in (OSPPC.DLL sppcs.dll) do ( +for %%A in ("%CommonProgramFiles%" "%CommonProgramW6432%" "%CommonProgramFiles(x86)%") do ( +for %%G in ("%%~A\Microsoft Shared\OfficeSoftwareProtectionPlatform\%%#") do ( +set size=0 +set size=%%~zG +if !size! GEQ 1 if !size! LSS 100000 ( +set _present=1 +del /f /q "%%~G" +if exist "%%~G" (move /y "%%~G" "!_ttemp!\needsToBeDeleted%random%" %nul%) +if exist "%%~G" (set _unerror=1) else (echo Deleted file - %%~G) +) +if /i sppcs.dll==%%# if !size! GEQ 100000 ( +move /y "%%~G" "%%~A\Microsoft Shared\OfficeSoftwareProtectionPlatform\OSPPC.DLL" %nul% +if exist "%%~G" (move /y "%%~A\Microsoft Shared\OfficeSoftwareProtectionPlatform\OSPPC.DLL" "!_ttemp!\needsToBeDeleted%random%" %nul%) +move /y "%%~G" "%%~A\Microsoft Shared\OfficeSoftwareProtectionPlatform\OSPPC.DLL" %nul% +if exist "%%~G" (set _unerror=1&echo Failed to rename sppcs.dll back to "%%~A\Microsoft Shared\OfficeSoftwareProtectionPlatform\OSPPC.DLL") else (echo Renamed sppcs.dll back to "%%~A\Microsoft Shared\OfficeSoftwareProtectionPlatform\OSPPC.DLL") +) +) +) +) + +::================================== + reg query HKCU\Software\Microsoft\Office\16.0\Common\Licensing\Resiliency %nul% && ( echo: echo Deleting - Registry keys for skipping license check @@ -772,6 +830,8 @@ reg unload HKU\%%# %nul% ) ) +::================================== + set "kmskey=HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\SoftwareProtectionPlatform\0ff1ce15-a989-479d-af46-f275c6370663" reg query "%kmskey%" %nul% && ( echo: @@ -818,6 +878,7 @@ set _oLPath= set _hookPath= set _hook= set _sppcPath= +set _osppPath= set _actid= set _prod= set _lic= @@ -836,6 +897,7 @@ set o16c2r= set o15c2r= set o16msi= set o15msi= +set o14msi= set _68=HKLM\SOFTWARE\Microsoft\Office set _86=HKLM\SOFTWARE\Wow6432Node\Microsoft\Office @@ -849,6 +911,52 @@ for /f "skip=2 tokens=2*" %%a in ('"reg query %_86%\16.0\Common\InstallRoot /v P for /f "skip=2 tokens=2*" %%a in ('"reg query %_68%\16.0\Common\InstallRoot /v Path" %nul6%') do if exist "%%b\EntityPicker.dll" (set o16msi=1&set o16msi_reg=%_68%\16.0) for /f "skip=2 tokens=2*" %%a in ('"reg query %_86%\15.0\Common\InstallRoot /v Path" %nul6%') do if exist "%%b\EntityPicker.dll" (set o15msi=1&set o15msi_reg=%_86%\15.0) for /f "skip=2 tokens=2*" %%a in ('"reg query %_68%\15.0\Common\InstallRoot /v Path" %nul6%') do if exist "%%b\EntityPicker.dll" (set o15msi=1&set o15msi_reg=%_68%\15.0) +for /f "skip=2 tokens=2*" %%a in ('"reg query %_86%\14.0\Common\InstallRoot /v Path" %nul6%') do if exist "%%b\EntityPicker.dll" (set o14msi=1&set o14msi_reg=%_86%\14.0) +for /f "skip=2 tokens=2*" %%a in ('"reg query %_68%\14.0\Common\InstallRoot /v Path" %nul6%') do if exist "%%b\EntityPicker.dll" (set o14msi=1&set o14msi_reg=%_68%\14.0) + +exit /b + +::======================================================================================================================================== + +:oh_ppcpath + +if not defined isOspp ( +if not "%osarch%"=="x86" ( +if /i "%_oArch%"=="x64" set "_sppcPath=%SystemRoot%\System32\sppc.dll" +if /i "%_oArch%"=="x86" set "_sppcPath=%SystemRoot%\SysWOW64\sppc.dll" +) else ( +set "_sppcPath=%SystemRoot%\System32\sppc.dll" +) +) + +set noOsppc= +set _hook68= +set _hook86= +set _osppPath68= +set _osppPath86= + +if defined isOspp ( +if not "%osarch%"=="x86" ( +if /i "%_oArch%"=="x64" ( +for /f "skip=2 tokens=2*" %%a in ('"reg query HKLM\SOFTWARE\Microsoft\OfficeSoftwareProtectionPlatform /v Path" %nul6%') do (set "_osppPath68=%%b") +if not exist "!_osppPath68!OSPPC.DLL" set noOsppc=1 +) +if /i "%_oArch%"=="x86" ( +for /f "skip=2 tokens=2*" %%a in ('"reg query HKLM\SOFTWARE\Microsoft\OfficeSoftwareProtectionPlatform /v Path" %nul6%') do (set "_osppPath68=%%b") +for /f "skip=2 tokens=2*" %%a in ('"reg query HKLM\SOFTWARE\Wow6432Node\Microsoft\OfficeSoftwareProtectionPlatform /v Path" %nul6%') do (set "_osppPath86=%%b") +if not exist "!_osppPath68!OSPPC.DLL" set noOsppc=1 +if not exist "!_osppPath86!OSPPC.DLL" set noOsppc=1 +) +) else ( +for /f "skip=2 tokens=2*" %%a in ('"reg query HKLM\SOFTWARE\Microsoft\OfficeSoftwareProtectionPlatform /v Path" %nul6%') do (set "_osppPath86=%%b") +if not exist "!_osppPath86!OSPPC.DLL" set noOsppc=1 +) +if "!_osppPath68:~-1!"=="\" set "_osppPath68=!_osppPath68:~0,-1!" +if "!_osppPath86:~-1!"=="\" set "_osppPath86=!_osppPath86:~0,-1!" +) + +if defined _osppPath68 set _hook68=sppc64.dll +if defined _osppPath86 set _hook86=sppc32.dll exit /b @@ -944,15 +1052,24 @@ set hasherror= if %_hook%==sppc32.dll set offset=2564 if %_hook%==sppc64.dll set offset=3076 -del /s /q "%_hookPath%\sppcs.dll" %nul% -del /s /q "%_hookPath%\sppc.dll" %nul% +::====================================== -if exist "%_hookPath%\sppcs.dll" set "ierror=Remove Previous Ohook Install" -if exist "%_hookPath%\sppc.dll" set "ierror=Remove Previous Ohook Install" +:: Remove previous Install + +for %%# in (sppcs.dll sppc.dll) do ( +del /f /q "%_hookPath%\%%#" %nul% +if exist "%_hookPath%\%%#" (move /y "%_hookPath%\%%#" "!_ttemp!\needsToBeDeleted%random%" %nul%) +if exist "%_hookPath%\%%#" (set "ierror=Remove Previous Ohook Install [%%#]") +) + +if defined ierror goto :oh_hookinstall_error + +::====================================== mklink "%_hookPath%\sppcs.dll" "%_sppcPath%" %nul% -if not %errorlevel%==0 ( -if not defined ierror set ierror=mklink +if not exist "%_hookPath%\sppcs.dll" ( +set ierror=mklink sppcs.dll +goto :oh_hookinstall_error ) set exhook= @@ -967,17 +1084,122 @@ popd call :oh_extractdll "%_hookPath%\sppc.dll" "%offset%" ) ) -if not exist "%_hookPath%\sppc.dll" (if not defined ierror set ierror=Copy) +if not exist "%_hookPath%\sppc.dll" ( +set ierror=Copy +goto :oh_hookinstall_error +) echo: -if not defined ierror ( -echo Symlinking System's sppc.dll to ["%_hookPath%\sppcs.dll"] [Successful] +echo Symlinking System's sppc.dll ["%_hookPath%\sppcs.dll"] [Successful] if defined exhook ( echo Copying Custom %_hook% to ["%_hookPath%\sppc.dll"] [Successful] ) else ( echo Extracting Custom %_hook% to ["%_hookPath%\sppc.dll"] [Successful] ) + +goto :oh_hookinstall_error + +::======================================================================================================================================== + +:oh_hookinstall_ospp + +set ierror= +set hasherror= + +if defined _hook86 set offset86=2564 +if defined _hook68 set offset68=3076 + +::====================================== + +:: Remove previous Install + +for %%# in (OSPPC.DLL sppcs.dll) do ( +for %%A in ("%_osppPath68%\%%#" "%_osppPath86%\%%#") do ( +set size=0 +set size=%%~zA +if !size! GEQ 1 if !size! LSS 100000 ( +del /f /q "%%~A" %nul% +if exist "%%~A" (move /y "%%~A" "!_ttemp!\needsToBeDeleted%random%" %nul%) +if exist "%%~A" (set "ierror=Remove Previous Ohook Install [%%#]") +) +) +) + +if defined ierror goto :oh_hookinstall_error + +for %%A in ("%_osppPath68%" "%_osppPath86%") do ( +if exist "%%~A\sppcs.dll" (move /y "%%~A\sppcs.dll" "%%~A\OSPPC.DLL" %nul%) +if exist "%%~A\sppcs.dll" ( +move /y "%%~A\OSPPC.DLL" "!_ttemp!\needsToBeDeleted%random%" %nul% +move /y "%%~A\sppcs.dll" "%%~A\OSPPC.DLL" %nul% +) +if exist "%%~A\sppcs.dll" (set "ierror=Move sppcs.dll back to OSPPC.DLL") +) + +del /f /q "%_hookPath%\sppcs.dll" %nul% +if exist "%_hookPath%\sppcs.dll" (move /y "%_hookPath%\sppcs.dll" "!_ttemp!\needsToBeDeleted%random%" %nul%) +if exist "%_hookPath%\sppcs.dll" (set "ierror=Remove Previous Ohook mklink sppcs.dll") + +if defined ierror goto :oh_hookinstall_error + +::====================================== + +if defined _osppPath68 (move /y "%_osppPath68%\OSPPC.DLL" "%_osppPath68%\sppcs.dll" %nul% & if not exist "%_osppPath68%\sppcs.dll" set ierror=1) +if defined _osppPath86 (move /y "%_osppPath86%\OSPPC.DLL" "%_osppPath86%\sppcs.dll" %nul% & if not exist "%_osppPath86%\sppcs.dll" set ierror=1) + +if defined ierror ( +set "ierror=Rename OSPPC.DLL" +goto :oh_hookinstall_error +) + +if defined _osppPath68 if defined _osppPath86 (mklink "%_hookPath%\sppcs.dll" "%_osppPath86%\sppcs.dll" %nul%) +if defined _osppPath68 if not defined _osppPath86 (mklink "%_hookPath%\sppcs.dll" "%_osppPath68%\sppcs.dll" %nul%) +if defined _osppPath86 if not defined _osppPath68 (mklink "%_hookPath%\sppcs.dll" "%_osppPath86%\sppcs.dll" %nul%) + +if not exist "%_hookPath%\sppcs.dll" ( +set ierror=mklink sppcs.dll +goto :oh_hookinstall_error +) + +set exhook= +if exist "!_work!\BIN\%_hook68%" if exist "!_work!\BIN\%_hook86%" set exhook=1 + +if defined exhook ( +pushd "!_work!\BIN\" +if defined _osppPath68 (copy /y /b "%_hook68%" "%_osppPath68%\OSPPC.DLL" %nul%) +if defined _osppPath86 (copy /y /b "%_hook86%" "%_osppPath86%\OSPPC.DLL" %nul%) +popd ) else ( +if defined _osppPath68 (set _hook=%_hook68%&call :oh_extractdll "%_osppPath68%\OSPPC.DLL" "%offset68%") +if defined _osppPath86 (set _hook=%_hook86%&call :oh_extractdll "%_osppPath86%\OSPPC.DLL" "%offset86%") +) + +if defined _osppPath68 (if not exist "%_osppPath68%\OSPPC.DLL" set ierror=1) +if defined _osppPath86 (if not exist "%_osppPath86%\OSPPC.DLL" set ierror=1) + +if defined ierror ( +set ierror=Copy +goto :oh_hookinstall_error +) + +echo: +if defined _osppPath68 (echo Renaming OSPPC.DLL to sppcs.dll ["%_osppPath68%\sppcs.dll"]) +if defined _osppPath86 (echo Renaming OSPPC.DLL to sppcs.dll ["%_osppPath86%\sppcs.dll"]) +if defined exhook ( +if defined _osppPath68 (echo Copying Custom %_hook68% to ["%_osppPath68%\OSPPC.DLL"]) +if defined _osppPath86 (echo Copying Custom %_hook86% to ["%_osppPath86%\OSPPC.DLL"]) +) else ( +if defined _osppPath68 (echo Extracting Custom %_hook68% to ["%_osppPath68%\OSPPC.DLL"]) +if defined _osppPath86 (echo Extracting Custom %_hook86% to ["%_osppPath86%\OSPPC.DLL"]) +) + +echo Symlinking Renamed sppcs.dll ["%_hookPath%\sppcs.dll"] + +::======================================================================================================================================== + +:oh_hookinstall_error + +if defined ierror ( set error=1 call :dk_color %Red% "Installing Ohook [Failed to %ierror%]" echo: @@ -996,9 +1218,9 @@ if not defined exhook if not defined ierror ( if defined hasherror ( set error=1 set ierror=1 -call :dk_color %Red% "Modifying Hash of Custom %_hook% [Failed]" +call :dk_color %Red% "Modifying Hash of Custom sppcs.dll [Failed]" ) else ( -echo Modifying Hash of Custom %_hook% [Successful] +echo Modifying Hash of Custom sppcs.dll [Successful] ) ) @@ -1006,6 +1228,26 @@ exit /b ::======================================================================================================================================== +:oh_setspp + +set isOspp= +if %winbuild% GEQ 9200 ( +set spp=SoftwareLicensingProduct +set sps=SoftwareLicensingService +) else ( +set isOspp=1 +set spp=OfficeSoftwareProtectionProduct +set sps=OfficeSoftwareProtectionService +) +if "%1"=="14" ( +set isOspp=1 +set spp=OfficeSoftwareProtectionProduct +set sps=OfficeSoftwareProtectionService +) +exit /b + +::======================================================================================================================================== + :oh_process for %%# in (%_oIds%) do ( @@ -1025,10 +1267,11 @@ call :ohookdata getinfo !_prod! if not "!key!"=="" ( echo "!allapps!" | find /i "!_actid!" %nul1% || call :oh_installlic +if not %oVer%==14 set generickey=1 call :dk_inskey "[!key!] [!_prod!] [!_lic!]" ) else ( set error=1 -call :dk_color %Red% "Checking Product In Script [Office %oVer%.0 !_prod! not found in script]" +call :dk_color %Red% "Checking Product In Script [Office %oVer%.0 !_prod! key not found in script]" call :dk_color %Blue% "Make sure you are using the latest version of MAS." set fixes=%fixes% %mas% call :dk_color %_Yellow% "%mas%" @@ -1055,7 +1298,11 @@ exit /b :: Process Office MSI Version call :oh_reset +if "%1"=="14" ( +call :dk_actids 59a52881-a989-479d-af46-f275c6370663 +) else ( call :dk_actids 0ff1ce15-a989-479d-af46-f275c6370663 +) set oVer=%1 for /f "skip=2 tokens=2*" %%a in ('"reg query %2\Common\InstallRoot /v Path" %nul6%') do (set "_oRoot=%%b") @@ -1068,16 +1315,8 @@ if "%osarch%"=="x86" set _oArch=x86 if /i "%_oArch%"=="x64" (set "_hookPath=%_oRoot%" & set "_hook=sppc64.dll") if /i "%_oArch%"=="x86" (set "_hookPath=%_oRoot%" & set "_hook=sppc32.dll") -if not "%osarch%"=="x86" ( -if /i "%_oArch%"=="x64" set "_sppcPath=%SystemRoot%\System32\sppc.dll" -if /i "%_oArch%"=="x86" set "_sppcPath=%SystemRoot%\SysWOW64\sppc.dll" -) else ( -set "_sppcPath=%SystemRoot%\System32\sppc.dll" -) -set "_common=%CommonProgramFiles%" -if defined PROCESSOR_ARCHITEW6432 set "_common=%CommonProgramW6432%" -set "_common2=%CommonProgramFiles(x86)%" +call :oh_ppcpath call :msiofficedata %2 @@ -1090,8 +1329,23 @@ call :dk_color %Red% "Checking Installed Products [Product IDs not f exit /b ) +if defined noOsppc ( +call :dk_color %Red% "Checking OSPPC.DLL [Not found. Aborting activation...]" +call :dk_color %Blue% "%_fixmsg%" +set error=1 +exit /b +) + +if %oVer%==14 if defined SingleImage ( +echo Checking Installed Products [SingleImage product found, Professional Retail key will be used for activation] +) + call :oh_process +if defined isOspp ( +call :oh_hookinstall_ospp +) else ( call :oh_hookinstall +) exit /b @@ -1415,11 +1669,12 @@ set keyerror=%errorlevel% cmd /c exit /b %keyerror% if %keyerror% NEQ 0 set "keyerror=[0x%=ExitCode%]" +if defined generickey (set "keyecho=Installing Generic Product Key ") else (set "keyecho=Installing Product Key ") if %keyerror% EQU 0 ( if %sps%==SoftwareLicensingService call :dk_refresh -echo Installing Generic Product Key %~1 [Successful] +echo %keyecho% %~1 [Successful] ) else ( -call :dk_color %Red% "Installing Generic Product Key %~1 [Failed] %keyerror%" +call :dk_color %Red% "%keyecho% %~1 [Failed] %keyerror%" if not defined error ( if defined altapplist call :dk_color %Red% "Activation ID not found for this key." call :dk_color %Blue% "%_fixmsg%" @@ -1428,6 +1683,7 @@ set showfix=1 set error=1 ) +set generickey= exit /b :: Get all products Activation IDs @@ -1523,7 +1779,7 @@ exit /b :dk_product set d1=%ref% $meth = $TypeBuilder.DefinePInvokeMethod('BrandingFormatString', 'winbrand.dll', 'Public, Static', 1, [String], @([String]), 1, 3); -set d1=%d1% $meth.SetImplementationFlags(128); $TypeBuilder.CreateType()::BrandingFormatString('%%WINDOWS_LONG%%') +set d1=%d1% $meth.SetImplementationFlags(128); $TypeBuilder.CreateType()::BrandingFormatString('%%WINDOWS_LONG%%') -replace [string][char]0xa9, '(C)' -replace [string][char]0xae, '(R)' -replace [string][char]0x2122, '(TM)' set winos= for /f "delims=" %%s in ('"%psc% %d1%"') do if not errorlevel 1 (set winos=%%s) @@ -1533,10 +1789,6 @@ if %winbuild% GEQ 22000 ( set winos=!winos:Windows 10=Windows 11! ) ) -if %winbuild% LSS 7600 ( -set "winos=!winos:VistaT=Vista!" -set "winos=!winos:Serverr=Server!" -) exit /b @@ -2128,15 +2380,69 @@ exit /b :: 1st column = Office version number :: 2nd column = Activation ID -:: 3rd column = Generic key. Preference is given in this order, Retail:TB:Sub > Retail > OEM:NONSLP > Volume:MAK > Volume:GVLK +:: 3rd column = For Office 2013 and later, the generated keys are listed. For Office 2010, the blocked keys sourced from the Internet are listed. +:: For Office 2013 and later, key preference is given in this order, Retail:TB:Sub > Retail > OEM:NONSLP > Volume:MAK > Volume:GVLK +:: For Office 2010, key preference is given in this order, Retail > Volume:MAK :: 4th column = Last part of license description :: 5th column = Edition +:: 6th column = Other Edition IDs if they are part of the same primary product (For reference only) :: Separator = "_" +::=============== + +:: We couldn't find any keys (blocked/generic doesn't matter) for these Office 2010 products. If you have them, please share with us. + +14_4eaff0d0-c6cb-4187-94f3-c7656d49a0aa_Retail________ExcelR_[HSExcelR] +14_7004b7f0-6407-4f45-8eac-966e5f868bde_Retail________GrooveR +14_fbf4ac36-31c8-4340-8666-79873129cf40_Retail________OutlookR +14_133c8359-4e93-4241-8118-30bb18737ea0_Retail________PowerPointR_[HSPowerPointR] +14_98677603-a668-4fa4-9980-3f1f05f78f69_Retail________PublisherR +14_db3bbc9c-ce52-41d1-a46f-1a1d68059119_Retail________WordR_[HSWordR] +14_dbe3aee0-5183-4ff7-8142-66050173cb01_Retail________SmallBusBasicsR_[SmallBusBasicsMSDNR] + +:: These installers are not publicly available, so it doesn't matter if we don't have their keys. + +14_19316117-30a8-4773-8fd9-7f7231f4e060_SubPrepid_____HomeBusinessSubR +14_4d06f72e-fd50-4bc2-a24b-d448d7f17ef2_SubPrepid_____ProjectProSubR +14_e98ef0c0-71c4-42ce-8305-287d8721e26c_SubPrepid_____ProPlusSubR +14_14f5946a-debc-4716-babc-7e2c240fec08_Retail________MondoR +14_533b656a-4425-480b-8e30-1a2358898350_MAK___________MondoVL + :ohookdata set f= for %%# in ( +:: Office 2010 +14_4d463c2c-0505-4626-8cdb-a4da82e2d8ed_7KTYC-XR43P-C3MRW-BJKFD-XB%f%YPG_Retail________AccessR +14_745fb377-0a59-4ca9-b9a9-c359557a2c4e_7XHPQ-BQMYG-YBP49-CY8B2-T8%f%CGQ_ByPass________AccessRuntimeR +14_95ab3ec8-4106-4f9d-b632-03c019d1d23f_89RTQ-MT4GK-6CPTX-WWP7C-J9%f%KXR_MAK___________AccessVL +14_71dc86ff-f056-40d0-8ffb-9592705c9b76_39TRR-C2F37-9WYJ2-MJQXH-B9%f%38K_MAK___________ExcelVL +14_fdad0dfa-417d-4b4f-93e4-64ea8867b7fd_RCGT3-FPQDV-H49CD-PPDBF-TH%f%47G_MAK___________GrooveVL +14_7b7d1f17-fdcb-4820-9789-9bec6e377821_3YR9B-D9W79-BY66R-R8XYP-QY%f%YYY_Retail________HomeBusinessR_[HomeBusinessDemoR] +14_09e2d37e-474b-4121-8626-58ad9be5776f_3X43R-HHHXX-FRHRW-2M2WJ-8V%f%PHD_Retail________HomeStudentR_[HomeStudentDemoR] +14_ef1da464-01c8-43a6-91af-e4e5713744f9_XDGJY-KFHW9-JWX9X-YM4GW-GC%f%8WR_Retail________InfoPathR +14_85e22450-b741-430c-a172-a37962c938af_6GKT2-KMJPK-4RRBF-8VQKB-JB%f%6G6_MAK___________InfoPathVL +14_3f7aa693-9a7e-44fc-9309-bb3d8e604925_2TG3P-9DB76-4YT99-8RXGD-CW%f%XBP_Retail________OneNoteR_[HSOneNoteR] +14_6860b31f-6a67-48b8-84b9-e312b3485c4b_CV64P-F4VRH-BJ33D-PH6MR-X6%f%9RY_MAK___________OneNoteVL +14_a9aeabd8-63b8-4079-a28e-f531807fd6b8_J8C9M-YXMH2-9CX44-2C3YG-V7%f%692_MAK___________OutlookVL +14_acb51361-c0db-4895-9497-1831c41f31a6_GMBWM-WVX26-7WHV4-DB43D-WV%f%DY2_Retail________PersonalR_[PersonalDemoR,PersonalPrepaidR] +14_38252940-718c-4aa6-81a4-135398e53851_HPBQP-RJHDR-Q3472-PT9Q6-PB%f%B72_MAK___________PowerPointVL +14_8b559c37-0117-413e-921b-b853aeb6e210_367X9-9HP9R-TKHY6-DH4QH-K9%f%PY7_Retail________ProfessionalR_[ProfessionalAcadR,ProfessionalDemoR,OEM-SingleImage] +14_725714d7-d58f-4d12-9fa8-35873c6f7215_6JD4G-KRW3J-48MGV-DM6FC-T9%f%WKR_Retail________ProjectProR_[ProjectProMSDNR] +14_1cf57a59-c532-4e56-9a7d-ffa2fe94b474_3XDTH-MMGJ6-F9MKX-THP8D-G9%f%BP7_MAK___________ProjectProVL +14_688f6589-2bd9-424e-a152-b13f36aa6de1_2W96V-RTQ9R-2BPVT-PT8H9-MV%f%68T_Retail________ProjectStdR +14_11b39439-6b93-4642-9570-f2eb81be2238_4DTT4-D4MKX-23KFH-JKR6T-YK%f%G2J_MAK___________ProjectStdVL +14_71af7e84-93e6-4363-9b69-699e04e74071_2J9H6-H4D3G-PCXD2-96XVM-TR%f%R73_Retail________ProPlusR_[ProPlusAcadR,ProPlusMSDNR,Sub4R] +14_fdf3ecb9-b56f-43b2-a9b8-1b48b6bae1a7_6CD6C-9R8PB-T2D9Y-8RKKX-W7%f%DFK_MAK___________ProPlusVL_[ProPlusAcadVL] +14_3d014759-b128-4466-9018-e80f6320d9d0_32YG9-3VX77-YXJVV-PRVFW-TT%f%8BV_MAK___________PublisherVL +14_8090771e-d41a-4482-929e-de87f1f47e46_7VKXH-9BWCG-RPTBB-JBRV3-GR%f%HYC_MAK___________SmallBusBasicsVL +14_b78df69e-0966-40b1-ae85-30a5134dedd0_H48K6-FB4Y6-P83GH-9J7XG-HD%f%KKX_ByPass________SPDR +14_b6d2565c-341d-4768-ad7d-addbe00bb5ce_W3BTX-H6BW7-Q6DFW-BXFFY-8R%f%VJP_Retail________StandardR_[StandardMSDNR][KeyisforMSDNR] +14_1f76e346-e0be-49bc-9954-70ec53a4fcfe_2XTQP-GDR7C-GTXPC-6W6PV-4R%f%XGC_MAK___________StandardVL_[StandardAcadVL] +14_2745e581-565a-4670-ae90-6bf7c57ffe43_VXHHB-W7HBD-7M342-RJ7P8-CH%f%BD6_ByPass________StarterR +14_66cad568-c2dc-459d-93ec-2f3cb967ee34_2RDPT-WPYQM-C2WXF-BTPDW-2J%f%2HM_Retail________VisioSIR_Prem[Pro,Std] +14_36756cb8-8e69-4d11-9522-68899507cd6a_7PKFT-X2MKQ-GT6X2-8CB2W-CH%f%C9K_MAK___________VisioSIVL_Prem[Pro,Std] +14_98d4050e-9c98-49bf-9be1-85e12eb3ab13_6J3XK-DFKGK-X373V-QJHYM-V3%f%FC2_MAK___________WordVL :: Office 2013 15_ab4d047b-97cf-4126-a69f-34df08e2f254_B7RFY-7NXPK-Q4342-Y9X2H-3J%f%X4X_Retail________AccessRetail 15_259de5be-492b-44b3-9d78-9645f848f7b0_X3XNB-HJB7K-66THH-8DWQ3-XH%f%GJP_Bypass________AccessRuntimeRetail @@ -2375,6 +2681,49 @@ exit /b :msiofficedata for %%# in ( +14_4d463c2c-0505-4626-8cdb-a4da82e2d8ed_0015_AccessR +14_745fb377-0a59-4ca9-b9a9-c359557a2c4e_001C_AccessRuntimeR +14_95ab3ec8-4106-4f9d-b632-03c019d1d23f_0015_AccessVL +14_4eaff0d0-c6cb-4187-94f3-c7656d49a0aa_0016_ExcelR_[HSExcelR] +14_71dc86ff-f056-40d0-8ffb-9592705c9b76_0016_ExcelVL +14_7004b7f0-6407-4f45-8eac-966e5f868bde_00BA_GrooveR +14_fdad0dfa-417d-4b4f-93e4-64ea8867b7fd_00BA_GrooveVL +14_7b7d1f17-fdcb-4820-9789-9bec6e377821_0013_HomeBusinessR_[HomeBusinessDemoR] +14_19316117-30a8-4773-8fd9-7f7231f4e060_011E_HomeBusinessSubR +14_09e2d37e-474b-4121-8626-58ad9be5776f_002F_HomeStudentR_[HomeStudentDemoR] +14_ef1da464-01c8-43a6-91af-e4e5713744f9_0044_InfoPathR +14_85e22450-b741-430c-a172-a37962c938af_0044_InfoPathVL +14_14f5946a-debc-4716-babc-7e2c240fec08_000F_MondoR +14_533b656a-4425-480b-8e30-1a2358898350_000F_MondoVL +14_c1ceda8b-c578-4d5d-a4aa-23626be4e234_003D_ProfessionalR_[OEM-SingleImage]Exception +14_3f7aa693-9a7e-44fc-9309-bb3d8e604925_00A1_OneNoteR_[HSOneNoteR] +14_6860b31f-6a67-48b8-84b9-e312b3485c4b_00A1_OneNoteVL +14_fbf4ac36-31c8-4340-8666-79873129cf40_001A_OutlookR +14_a9aeabd8-63b8-4079-a28e-f531807fd6b8_001A_OutlookVL +14_acb51361-c0db-4895-9497-1831c41f31a6_0033_PersonalR_[PersonalDemoR,PersonalPrepaidR] +14_133c8359-4e93-4241-8118-30bb18737ea0_0018_PowerPointR_[HSPowerPointR] +14_38252940-718c-4aa6-81a4-135398e53851_0018_PowerPointVL +14_8b559c37-0117-413e-921b-b853aeb6e210_0014_ProfessionalR_[ProfessionalAcadR,ProfessionalDemoR] +14_725714d7-d58f-4d12-9fa8-35873c6f7215_003B_ProjectProR_[ProjectProMSDNR] +14_4d06f72e-fd50-4bc2-a24b-d448d7f17ef2_011F_ProjectProSubR +14_1cf57a59-c532-4e56-9a7d-ffa2fe94b474_003B_ProjectProVL +14_688f6589-2bd9-424e-a152-b13f36aa6de1_003A_ProjectStdR +14_11b39439-6b93-4642-9570-f2eb81be2238_003A_ProjectStdVL +14_71af7e84-93e6-4363-9b69-699e04e74071_0011_ProPlusR_[ProPlusAcadR,ProPlusMSDNR,Sub4R] +14_e98ef0c0-71c4-42ce-8305-287d8721e26c_011D_ProPlusSubR +14_fdf3ecb9-b56f-43b2-a9b8-1b48b6bae1a7_0011_ProPlusVL_[ProPlusAcadVL] +14_98677603-a668-4fa4-9980-3f1f05f78f69_0019_PublisherR +14_3d014759-b128-4466-9018-e80f6320d9d0_0019_PublisherVL +14_dbe3aee0-5183-4ff7-8142-66050173cb01_008B_SmallBusBasicsR_[SmallBusBasicsMSDNR] +14_8090771e-d41a-4482-929e-de87f1f47e46_008B_SmallBusBasicsVL +14_b78df69e-0966-40b1-ae85-30a5134dedd0_0017_SPDR +14_d3422cfb-8d8b-4ead-99f9-eab0ccd990d7_0012_StandardR +14_1f76e346-e0be-49bc-9954-70ec53a4fcfe_0012_StandardVL_[StandardAcadVL] +14_2745e581-565a-4670-ae90-6bf7c57ffe43_0066_StarterR +14_66cad568-c2dc-459d-93ec-2f3cb967ee34_0057_VisioSIR_Prem[Pro,Std]Exception +14_36756cb8-8e69-4d11-9522-68899507cd6a_0057_VisioSIVL_Prem[Pro,Std]Exception +14_db3bbc9c-ce52-41d1-a46f-1a1d68059119_001B_WordR_[HSWordR] +14_98d4050e-9c98-49bf-9be1-85e12eb3ab13_001B_WordVL :: Office 2013 15_ab4d047b-97cf-4126-a69f-34df08e2f254_0015_AccessRetail 15_259de5be-492b-44b3-9d78-9645f848f7b0_001C_AccessRuntimeRetail @@ -2491,6 +2840,7 @@ if "%oVer%"=="%%A" ( reg query "%1\Registration\{%%B}" /v ProductCode %nul2% | find /i "-%%C-" %nul% && ( reg query "%1\Common\InstalledPackages" %nul2% | find /i "-%%C-" %nul% && ( if defined _oIds (set _oIds=!_oIds! %%D) else (set _oIds=%%D) +if /i 003D==%%C set SingleImage=1 ) ) ) @@ -2507,7 +2857,7 @@ exit /b :oh_extractdll set b= -%psc% "$f=[io.file]::ReadAllText('!_batp!') -split ':%_hook%\:.*';$encoded = ($f[1]) -replace '-', 'A' -replace '_', 'a';$bytes = [Con%b%vert]::FromBas%b%e64String($encoded); $PePath='%1'; $offset='%2'; $m=[io.file]::ReadAllText('!_batp!') -split ':hexedit\:.*';iex ($m[1]);" %nul2% | find /i "Error found" %nul1% && set hasherror=1 +%psc% "$f=[io.file]::ReadAllText('!_batp!') -split ':%_hook%\:.*';$encoded = ($f[1]) -replace '-', 'A' -replace '_', 'a';$bytes = [Con%b%vert]::FromBas%b%e64String($encoded); $PePath='%1'; $offset='%2'; $m=[io.file]::ReadAllText('!_batp!') -split ':hexedit\:.*';iex ($m[1])" %nul2% | find /i "Error found" %nul1% && set hasherror=1 exit /b :hexedit: @@ -2546,7 +2896,7 @@ $Writer.Write($unixTimestamp) $Writer.Flush() # Write the current state of the MemoryStream to a temporary file -$tempFilePath = [System.IO.Path]::Combine($env:windir, "Temp", [System.IO.Path]::GetRandomFileName()) +$tempFilePath = "$env:windir\Temp\$([System.IO.Path]::GetRandomFileName())" [System.IO.File]::WriteAllBytes($tempFilePath, $MemoryStream.ToArray()) # Update hash using the temporary file diff --git a/MAS/Separate-Files-Version/Activators/Online_KMS_Activation.cmd b/MAS/Separate-Files-Version/Activators/Online_KMS_Activation.cmd index 07b7470..bb6fd92 100644 --- a/MAS/Separate-Files-Version/Activators/Online_KMS_Activation.cmd +++ b/MAS/Separate-Files-Version/Activators/Online_KMS_Activation.cmd @@ -1,4 +1,4 @@ -@set masver=3.0 +@set masver=3.1 @echo off @@ -677,6 +677,7 @@ call echo Checking Installed Product Key [Partial Key - %%_partial%%] [ ) if defined key ( +set generickey=1 call :dk_inskey "[%key%]" ) @@ -686,7 +687,7 @@ call :dk_inskey "[%key%]" if not %_actoff%==1 goto :ks_activate -call :ks_setspp +call :oh_setspp :: Check ohook install @@ -731,7 +732,7 @@ set ohub=1 :: Check supported office versions -call :ks_getpath +call :oh_getpath set o16uwp= set o16uwp_path= @@ -910,9 +911,9 @@ call :ks_process :ks_startmsi -if defined o14msi call :ks_setspp 14 +if defined o14msi call :oh_setspp 14 if defined o14msi call :ks_processmsi 14 %o14msi_reg% -call :ks_setspp +call :oh_setspp if defined o15msi call :ks_processmsi 15 %o15msi_reg% if defined o16msi call :ks_processmsi 16 %o16msi_reg% @@ -1056,7 +1057,7 @@ exit /b ::======================================================================================================================================== -:ks_getpath +:oh_getpath set o16c2r= set o15c2r= @@ -1143,16 +1144,19 @@ exit /b ::======================================================================================================================================== -:ks_setspp +:oh_setspp +set isOspp= if %winbuild% GEQ 9200 ( set spp=SoftwareLicensingProduct set sps=SoftwareLicensingService ) else ( +set isOspp=1 set spp=OfficeSoftwareProtectionProduct set sps=OfficeSoftwareProtectionService ) if "%1"=="14" ( +set isOspp=1 set spp=OfficeSoftwareProtectionProduct set sps=OfficeSoftwareProtectionService ) @@ -1212,6 +1216,7 @@ call :ks_osppready if not "!key!"=="" ( echo "!allapps!" | find /i "!_actid!" %nul1% || call :oh_installlic +set generickey=1 call :dk_inskey "[!key!] [!_prod!]" ) else ( if not defined _oMSI ( @@ -1220,7 +1225,7 @@ call :dk_color %Red% "Checking Product In Script [Office %oVer%.0 ! call :dk_color %Blue% "Make sure you are using Latest MAS script." ) else ( call :dk_color %Red% "Checking Product In Script [!_prod! MSI Retail is not supported]" -call :dk_color %Blue% "Uninstall this and Install C2R or MSI VL version of Office." +call :dk_color %Blue% "Use Ohook option to activate it." ) set fixes=%fixes% %mas%genuine-installation-media call :dk_color %_Yellow% "%mas%genuine-installation-media" @@ -1254,10 +1259,6 @@ echo "%2" | find /i "Wow6432Node" %nul1% && set _oArch=x86 if not "%osarch%"=="x86" if not defined _oArch set _oArch=x64 if "%osarch%"=="x86" set _oArch=x86 -set "_common=%CommonProgramFiles%" -if defined PROCESSOR_ARCHITEW6432 set "_common=%CommonProgramW6432%" -set "_common2=%CommonProgramFiles(x86)%" - call :msiofficedata %2 echo: @@ -2633,11 +2634,12 @@ set keyerror=%errorlevel% cmd /c exit /b %keyerror% if %keyerror% NEQ 0 set "keyerror=[0x%=ExitCode%]" +if defined generickey (set "keyecho=Installing Generic Product Key ") else (set "keyecho=Installing Product Key ") if %keyerror% EQU 0 ( if %sps%==SoftwareLicensingService call :dk_refresh -echo Installing Generic Product Key %~1 [Successful] +echo %keyecho% %~1 [Successful] ) else ( -call :dk_color %Red% "Installing Generic Product Key %~1 [Failed] %keyerror%" +call :dk_color %Red% "%keyecho% %~1 [Failed] %keyerror%" if not defined error ( if defined altapplist call :dk_color %Red% "Activation ID not found for this key." call :dk_color %Blue% "%_fixmsg%" @@ -2646,6 +2648,7 @@ set showfix=1 set error=1 ) +set generickey= exit /b :: Get Windows installed key channel @@ -2768,7 +2771,7 @@ exit /b :dk_product set d1=%ref% $meth = $TypeBuilder.DefinePInvokeMethod('BrandingFormatString', 'winbrand.dll', 'Public, Static', 1, [String], @([String]), 1, 3); -set d1=%d1% $meth.SetImplementationFlags(128); $TypeBuilder.CreateType()::BrandingFormatString('%%WINDOWS_LONG%%') +set d1=%d1% $meth.SetImplementationFlags(128); $TypeBuilder.CreateType()::BrandingFormatString('%%WINDOWS_LONG%%') -replace [string][char]0xa9, '(C)' -replace [string][char]0xae, '(R)' -replace [string][char]0x2122, '(TM)' set winos= for /f "delims=" %%s in ('"%psc% %d1%"') do if not errorlevel 1 (set winos=%%s) @@ -2778,10 +2781,6 @@ if %winbuild% GEQ 22000 ( set winos=!winos:Windows 10=Windows 11! ) ) -if %winbuild% LSS 7600 ( -set "winos=!winos:VistaT=Vista!" -set "winos=!winos:Serverr=Server!" -) if not defined winsub exit /b @@ -3438,47 +3437,30 @@ exit /b :: 5th column = Other Edition IDs if they are part of the same primary product (For reference only) :: Separator = "_" -:: EditionID Notes: -:: For Office 2013 and later, all Edition IDs are clearly defined, and each ID corresponds to its specific licensing. - -:: In Office 2010, the situation is a bit more complicated. -:: Products typically fall into two separate categories: Volume License (VL) and Non-VL. This is because a single installation cannot include both Retail and VL licensing types. -:: Some Edition IDs share the same primary product ID. For example, installing ProPlusVL also installs ProPlusAcadVL licenses, as both use 0011 as the primary product ID. -:: Therefore, in the script, we grouped VL and Non-VL versions by primary product ID and selected the highest Edition ID when multiple Edition IDs existed for the same primary product ID. - -:: There are a few exceptions to this 2010 rule: Visio (Premium, Pro, Standard) and OEM-SingleImage. - -:: For Visio, the issue is that branding.xml lists incorrect primary product IDs. The correct primary product ID for all three Visio variants is 0057. Based on the criteria above, we chose Visio-Premium as the representative Edition ID among the three. -:: For OEM-SingleImage, it installs multiple Edition IDs and uses 003D as the primary product ID. Following our method, we selected the highest available Edition ID—ProfessionalR in this case. - :msiofficedata for %%# in ( 14_4d463c2c-0505-4626-8cdb-a4da82e2d8ed_0015_AccessR 14_745fb377-0a59-4ca9-b9a9-c359557a2c4e_001C_AccessRuntimeR 14_95ab3ec8-4106-4f9d-b632-03c019d1d23f_0015_AccessVL -14_4eaff0d0-c6cb-4187-94f3-c7656d49a0aa_0016_ExcelR +14_4eaff0d0-c6cb-4187-94f3-c7656d49a0aa_0016_ExcelR_[HSExcelR] 14_71dc86ff-f056-40d0-8ffb-9592705c9b76_0016_ExcelVL 14_7004b7f0-6407-4f45-8eac-966e5f868bde_00BA_GrooveR 14_fdad0dfa-417d-4b4f-93e4-64ea8867b7fd_00BA_GrooveVL 14_7b7d1f17-fdcb-4820-9789-9bec6e377821_0013_HomeBusinessR_[HomeBusinessDemoR] 14_19316117-30a8-4773-8fd9-7f7231f4e060_011E_HomeBusinessSubR 14_09e2d37e-474b-4121-8626-58ad9be5776f_002F_HomeStudentR_[HomeStudentDemoR] -14_c3ae020c-5a71-4cc5-a27a-2a97c2d46860_0029_HSExcelR -14_25fe4611-b44d-49cc-ae87-2143d299194e_00A3_HSOneNoteR -14_d652ad8d-da5c-4358-b928-7fb1b4de7a7c_0037_HSPowerPointR -14_a963d7ae-7a88-41a7-94da-8bb5635a8af9_002B_HSWordR 14_ef1da464-01c8-43a6-91af-e4e5713744f9_0044_InfoPathR 14_85e22450-b741-430c-a172-a37962c938af_0044_InfoPathVL 14_14f5946a-debc-4716-babc-7e2c240fec08_000F_MondoR 14_533b656a-4425-480b-8e30-1a2358898350_000F_MondoVL 14_c1ceda8b-c578-4d5d-a4aa-23626be4e234_003D_ProfessionalR_[OEM-SingleImage]Exception -14_3f7aa693-9a7e-44fc-9309-bb3d8e604925_00A1_OneNoteR +14_3f7aa693-9a7e-44fc-9309-bb3d8e604925_00A1_OneNoteR_[HSOneNoteR] 14_6860b31f-6a67-48b8-84b9-e312b3485c4b_00A1_OneNoteVL 14_fbf4ac36-31c8-4340-8666-79873129cf40_001A_OutlookR 14_a9aeabd8-63b8-4079-a28e-f531807fd6b8_001A_OutlookVL 14_acb51361-c0db-4895-9497-1831c41f31a6_0033_PersonalR_[PersonalDemoR,PersonalPrepaidR] -14_133c8359-4e93-4241-8118-30bb18737ea0_0018_PowerPointR +14_133c8359-4e93-4241-8118-30bb18737ea0_0018_PowerPointR_[HSPowerPointR] 14_38252940-718c-4aa6-81a4-135398e53851_0018_PowerPointVL 14_8b559c37-0117-413e-921b-b853aeb6e210_0014_ProfessionalR_[ProfessionalAcadR,ProfessionalDemoR] 14_725714d7-d58f-4d12-9fa8-35873c6f7215_003B_ProjectProR_[ProjectProMSDNR] @@ -3499,7 +3481,7 @@ for %%# in ( 14_2745e581-565a-4670-ae90-6bf7c57ffe43_0066_StarterR 14_66cad568-c2dc-459d-93ec-2f3cb967ee34_0057_VisioSIR_Prem[Pro,Std]Exception 14_36756cb8-8e69-4d11-9522-68899507cd6a_0057_VisioSIVL_Prem[Pro,Std]Exception -14_db3bbc9c-ce52-41d1-a46f-1a1d68059119_001B_WordR +14_db3bbc9c-ce52-41d1-a46f-1a1d68059119_001B_WordR_[HSWordR] 14_98d4050e-9c98-49bf-9be1-85e12eb3ab13_001B_WordVL :: Office 2013 15_ab4d047b-97cf-4126-a69f-34df08e2f254_0015_AccessRetail @@ -3617,6 +3599,7 @@ if "%oVer%"=="%%A" ( reg query "%1\Registration\{%%B}" /v ProductCode %nul2% | find /i "-%%C-" %nul% && ( reg query "%1\Common\InstalledPackages" %nul2% | find /i "-%%C-" %nul% && ( if defined _oIds (set _oIds=!_oIds! %%D) else (set _oIds=%%D) +if /i 003D==%%C set SingleImage=1 ) ) ) diff --git a/MAS/Separate-Files-Version/Activators/TSforge_Activation.cmd b/MAS/Separate-Files-Version/Activators/TSforge_Activation.cmd index 2400e45..40d9914 100644 --- a/MAS/Separate-Files-Version/Activators/TSforge_Activation.cmd +++ b/MAS/Separate-Files-Version/Activators/TSforge_Activation.cmd @@ -1,4 +1,4 @@ -@set masver=3.0 +@set masver=3.1 @echo off @@ -432,9 +432,9 @@ echo: echo ______________________________________________________________ echo: echo [1] Activate - Windows -echo [2] Activate - Windows [ESU] -echo [3] Activate - Office [All] -echo [4] Activate - Office [Project/Visio] +echo [2] Activate - ESU +echo [3] Activate - Office [All] +echo [4] Activate - Office [Project/Visio] echo [5] Activate - All echo _______________________________________________ echo: @@ -565,13 +565,6 @@ set "_serv=%_slser% Winmgmt" call :dk_errorcheck -if defined error ( -call :dk_color %Red% "Some errors were detected. Aborting the operation..." -set fixes=%fixes% %mas%troubleshoot -call :dk_color2 %Blue% "Check this webpage for help - " %_Yellow% " %mas%troubleshoot" -goto :dk_done -) - call :ts_getedition if not defined tsedition ( call :dk_color %Red% "Checking Windows Edition ID [Not found in installed licenses, aborting...]" @@ -705,7 +698,8 @@ goto :ts_esu echo Checking Activation ID [%tempid%] [%tsedition%] -call :ts_inskey "[%key%]" +set generickey=1 +call :dk_inskey "[%key%]" if not defined error set tsids=%tsids% %tempid% goto :ts_esu @@ -827,7 +821,8 @@ goto :ts_esu echo Resetting Rearm / GracePeriod [Successful] ) -call :ts_inskey "[%key%]" +set generickey=1 +call :dk_inskey "[%key%]" ::======================================================================================================================================== @@ -900,7 +895,7 @@ set esuexistbutnosup=1 if defined esuexistsup if defined _vis ( set key=9FPV7-MWGT8-7XPDF-JC23W-WT7TW REM This is a non-generic blocked MAK key for Server-ESU-PA -call :ts_inskey "[!key!]" +call :dk_inskey "[!key!]" goto :ts_off ) @@ -949,7 +944,7 @@ if not %_actoff%==1 goto :ts_act if %winbuild% LSS 9200 ( echo: call :dk_color %Gray% "Checking Supported Office [TSforge for Office is supported on Windows 8 and later versions]" -call :dk_color %Blue% "On Windows Vista / 7, use Online %KS% activation option for Office instead." +call :dk_color %Blue% "On Windows Vista / 7, use Ohook activation option for Office instead." goto :ts_act ) @@ -990,6 +985,7 @@ for /f "skip=2 tokens=2*" %%a in ('"reg query %_68%\14.0\Common\InstallRoot /v P if not "%o14msi%%o14c2r%"=="" ( echo: call :dk_color %Red% "Checking Unsupported Office Install [ %o14msi%%o14c2r%]" +if defined o14msi call :dk_color %Blue% "Use Ohook activation option for Office 2010." ) if %winbuild% GEQ 10240 %psc% "Get-AppxPackage -name "Microsoft.MicrosoftOfficeHub"" | find /i "Office" %nul1% && ( @@ -1310,7 +1306,7 @@ call :dk_color %Blue% "Business, BusinessN, Enterprise, EnterpriseN, and Server goto :ts_act ) -call :ts_inskey "[%key%]" +call :dk_inskey "[%key%]" if not defined error set tsids=%tsids% %tempid% goto :ts_act @@ -2286,7 +2282,7 @@ exit /b :: Install Key -:ts_inskey +:dk_inskey if %_wmic% EQU 1 wmic path %sps% where __CLASS='%sps%' call InstallProductKey ProductKey="%key%" %nul% if %_wmic% EQU 0 %psc% "try { $null=(([WMISEARCHER]'SELECT Version FROM %sps%').Get()).InstallProductKey('%key%'); exit 0 } catch { exit $_.Exception.InnerException.HResult }" %nul% @@ -2294,15 +2290,21 @@ set keyerror=%errorlevel% cmd /c exit /b %keyerror% if %keyerror% NEQ 0 set "keyerror=[0x%=ExitCode%]" +if defined generickey (set "keyecho=Installing Generic Product Key ") else (set "keyecho=Installing Product Key ") if %keyerror% EQU 0 ( if %sps%==SoftwareLicensingService call :dk_refresh -echo Installing Product Key %~1 [Successful] +echo %keyecho% %~1 [Successful] ) else ( -set error=1 -call :dk_color %Red% "Installing Product Key %~1 [Failed] %keyerror%" +call :dk_color %Red% "%keyecho% %~1 [Failed] %keyerror%" +if not defined error ( +if defined altapplist call :dk_color %Red% "Activation ID not found for this key." call :dk_color %Blue% "%_fixmsg%" +set showfix=1 +) +set error=1 ) +set generickey= exit /b :: Activation command @@ -2428,7 +2430,7 @@ exit /b :dk_product set d1=%ref% $meth = $TypeBuilder.DefinePInvokeMethod('BrandingFormatString', 'winbrand.dll', 'Public, Static', 1, [String], @([String]), 1, 3); -set d1=%d1% $meth.SetImplementationFlags(128); $TypeBuilder.CreateType()::BrandingFormatString('%%WINDOWS_LONG%%') +set d1=%d1% $meth.SetImplementationFlags(128); $TypeBuilder.CreateType()::BrandingFormatString('%%WINDOWS_LONG%%') -replace [string][char]0xa9, '(C)' -replace [string][char]0xae, '(R)' -replace [string][char]0x2122, '(TM)' set winos= for /f "delims=" %%s in ('"%psc% %d1%"') do if not errorlevel 1 (set winos=%%s) @@ -2438,10 +2440,6 @@ if %winbuild% GEQ 22000 ( set winos=!winos:Windows 10=Windows 11! ) ) -if %winbuild% LSS 7600 ( -set "winos=!winos:VistaT=Vista!" -set "winos=!winos:Serverr=Server!" -) if not defined winsub exit /b @@ -8207,6 +8205,49 @@ Office-ActID -pkeypath "$env:pkeypath" -edition "$env:_License" -keytype "$env:k :msiofficedata for %%# in ( +14_4d463c2c-0505-4626-8cdb-a4da82e2d8ed_0015_AccessR +14_745fb377-0a59-4ca9-b9a9-c359557a2c4e_001C_AccessRuntimeR +14_95ab3ec8-4106-4f9d-b632-03c019d1d23f_0015_AccessVL +14_4eaff0d0-c6cb-4187-94f3-c7656d49a0aa_0016_ExcelR_[HSExcelR] +14_71dc86ff-f056-40d0-8ffb-9592705c9b76_0016_ExcelVL +14_7004b7f0-6407-4f45-8eac-966e5f868bde_00BA_GrooveR +14_fdad0dfa-417d-4b4f-93e4-64ea8867b7fd_00BA_GrooveVL +14_7b7d1f17-fdcb-4820-9789-9bec6e377821_0013_HomeBusinessR_[HomeBusinessDemoR] +14_19316117-30a8-4773-8fd9-7f7231f4e060_011E_HomeBusinessSubR +14_09e2d37e-474b-4121-8626-58ad9be5776f_002F_HomeStudentR_[HomeStudentDemoR] +14_ef1da464-01c8-43a6-91af-e4e5713744f9_0044_InfoPathR +14_85e22450-b741-430c-a172-a37962c938af_0044_InfoPathVL +14_14f5946a-debc-4716-babc-7e2c240fec08_000F_MondoR +14_533b656a-4425-480b-8e30-1a2358898350_000F_MondoVL +14_c1ceda8b-c578-4d5d-a4aa-23626be4e234_003D_ProfessionalR_[OEM-SingleImage]Exception +14_3f7aa693-9a7e-44fc-9309-bb3d8e604925_00A1_OneNoteR_[HSOneNoteR] +14_6860b31f-6a67-48b8-84b9-e312b3485c4b_00A1_OneNoteVL +14_fbf4ac36-31c8-4340-8666-79873129cf40_001A_OutlookR +14_a9aeabd8-63b8-4079-a28e-f531807fd6b8_001A_OutlookVL +14_acb51361-c0db-4895-9497-1831c41f31a6_0033_PersonalR_[PersonalDemoR,PersonalPrepaidR] +14_133c8359-4e93-4241-8118-30bb18737ea0_0018_PowerPointR_[HSPowerPointR] +14_38252940-718c-4aa6-81a4-135398e53851_0018_PowerPointVL +14_8b559c37-0117-413e-921b-b853aeb6e210_0014_ProfessionalR_[ProfessionalAcadR,ProfessionalDemoR] +14_725714d7-d58f-4d12-9fa8-35873c6f7215_003B_ProjectProR_[ProjectProMSDNR] +14_4d06f72e-fd50-4bc2-a24b-d448d7f17ef2_011F_ProjectProSubR +14_1cf57a59-c532-4e56-9a7d-ffa2fe94b474_003B_ProjectProVL +14_688f6589-2bd9-424e-a152-b13f36aa6de1_003A_ProjectStdR +14_11b39439-6b93-4642-9570-f2eb81be2238_003A_ProjectStdVL +14_71af7e84-93e6-4363-9b69-699e04e74071_0011_ProPlusR_[ProPlusAcadR,ProPlusMSDNR,Sub4R] +14_e98ef0c0-71c4-42ce-8305-287d8721e26c_011D_ProPlusSubR +14_fdf3ecb9-b56f-43b2-a9b8-1b48b6bae1a7_0011_ProPlusVL_[ProPlusAcadVL] +14_98677603-a668-4fa4-9980-3f1f05f78f69_0019_PublisherR +14_3d014759-b128-4466-9018-e80f6320d9d0_0019_PublisherVL +14_dbe3aee0-5183-4ff7-8142-66050173cb01_008B_SmallBusBasicsR_[SmallBusBasicsMSDNR] +14_8090771e-d41a-4482-929e-de87f1f47e46_008B_SmallBusBasicsVL +14_b78df69e-0966-40b1-ae85-30a5134dedd0_0017_SPDR +14_d3422cfb-8d8b-4ead-99f9-eab0ccd990d7_0012_StandardR +14_1f76e346-e0be-49bc-9954-70ec53a4fcfe_0012_StandardVL_[StandardAcadVL] +14_2745e581-565a-4670-ae90-6bf7c57ffe43_0066_StarterR +14_66cad568-c2dc-459d-93ec-2f3cb967ee34_0057_VisioSIR_Prem[Pro,Std]Exception +14_36756cb8-8e69-4d11-9522-68899507cd6a_0057_VisioSIVL_Prem[Pro,Std]Exception +14_db3bbc9c-ce52-41d1-a46f-1a1d68059119_001B_WordR_[HSWordR] +14_98d4050e-9c98-49bf-9be1-85e12eb3ab13_001B_WordVL :: Office 2013 15_ab4d047b-97cf-4126-a69f-34df08e2f254_0015_AccessRetail 15_259de5be-492b-44b3-9d78-9645f848f7b0_001C_AccessRuntimeRetail @@ -8323,6 +8364,7 @@ if "%oVer%"=="%%A" ( reg query "%1\Registration\{%%B}" /v ProductCode %nul2% | find /i "-%%C-" %nul% && ( reg query "%1\Common\InstalledPackages" %nul2% | find /i "-%%C-" %nul% && ( if defined _oIds (set _oIds=!_oIds! %%D) else (set _oIds=%%D) +if /i 003D==%%C set SingleImage=1 ) ) ) diff --git a/MAS/Separate-Files-Version/Change_Office_Edition.cmd b/MAS/Separate-Files-Version/Change_Office_Edition.cmd index a068afa..951a5b9 100644 --- a/MAS/Separate-Files-Version/Change_Office_Edition.cmd +++ b/MAS/Separate-Files-Version/Change_Office_Edition.cmd @@ -1,4 +1,4 @@ -@set masver=3.0 +@set masver=3.1 @echo off diff --git a/MAS/Separate-Files-Version/Change_Windows_Edition.cmd b/MAS/Separate-Files-Version/Change_Windows_Edition.cmd index 5c34093..6529adf 100644 --- a/MAS/Separate-Files-Version/Change_Windows_Edition.cmd +++ b/MAS/Separate-Files-Version/Change_Windows_Edition.cmd @@ -1,4 +1,4 @@ -@set masver=3.0 +@set masver=3.1 @echo off diff --git a/MAS/Separate-Files-Version/Check_Activation_Status.cmd b/MAS/Separate-Files-Version/Check_Activation_Status.cmd index 104a856..458b486 100644 --- a/MAS/Separate-Files-Version/Check_Activation_Status.cmd +++ b/MAS/Separate-Files-Version/Check_Activation_Status.cmd @@ -201,12 +201,14 @@ function BoolToWStr($bVal) { } function InitializePInvoke($LaDll, $bOffice) { - $Marshal = [System.Runtime.InteropServices.Marshal] - $Module = [AppDomain]::CurrentDomain.DefineDynamicAssembly((Get-Random), 'Run').DefineDynamicModule((Get-Random), $False) - $SLApp = $NT7 -Or $bOffice -Or ($LaDll -EQ 'sppc.dll' -And [Diagnostics.FileVersionInfo]::GetVersionInfo("$SysPath\sppc.dll").FilePrivatePart -GE 16501) - + $LaName = [IO.Path]::GetFileNameWithoutExtension($LaDll) + $SLApp = $NT7 -Or $bOffice -Or ($LaName -EQ 'sppc' -And [Diagnostics.FileVersionInfo]::GetVersionInfo("$SysPath\sppc.dll").FilePrivatePart -GE 16501) $Win32 = $null - $Class = $Module.DefineType((Get-Random), 'Public, Abstract, Sealed, BeforeFieldInit', [Object], 0) + + $Marshal = [System.Runtime.InteropServices.Marshal] + $Module = [AppDomain]::CurrentDomain.DefineDynamicAssembly(($LaName+"_Assembly"), 'Run').DefineDynamicModule(($LaName+"_Module"), $False) + $Class = $Module.DefineType(($LaName+"_Methods"), 'Public, Abstract, Sealed, BeforeFieldInit', [Object], 0) + $Class.DefinePInvokeMethod('SLClose', $LaDll, 22, 1, [Int32], @([IntPtr]), 1, 3).SetImplementationFlags(128) $Class.DefinePInvokeMethod('SLOpen', $LaDll, 22, 1, [Int32], @([IntPtr].MakeByRefType()), 1, 3).SetImplementationFlags(128) $Class.DefinePInvokeMethod('SLGenerateOfflineInstallationId', $LaDll, 22, 1, [Int32], @([IntPtr], [Guid].MakeByRefType(), [IntPtr].MakeByRefType()), 1, 3).SetImplementationFlags(128) @@ -255,10 +257,51 @@ function SlGetInfoIID($SkuId) { return $null } + else + { + return $Marshal::PtrToStringUni($bData) + } +} - $rData = $Marshal::PtrToStringUni($bData) - $Marshal::FreeHGlobal($bData) - return $rData +function SlReturnData($hrRet, $tData, $cData, $bData) { + if ($hrRet -NE 0 -Or $cData -EQ 0) + { + return $null + } + if ($tData -EQ 1) + { + return $Marshal::PtrToStringUni($bData) + } + elseif ($tData -EQ 4) + { + return $Marshal::ReadInt32($bData) + } + elseif ($tData -EQ 3 -And $cData -EQ 8) + { + return $Marshal::ReadInt64($bData) + } + else + { + return $null + } +} + +function SlGetInfoPKey($PkeyId, $Value) +{ + $tData = 0 + $cData = 0 + $bData = 0 + + $hrRet = $Win32::SLGetPKeyInformation( + $hSLC, + [ref][Guid]$PkeyId, + $Value, + [ref]$tData, + [ref]$cData, + [ref]$bData + ) + + return SlReturnData $hrRet $tData $cData $bData } function SlGetInfoSku($SkuId, $Value) @@ -267,7 +310,7 @@ function SlGetInfoSku($SkuId, $Value) $cData = 0 $bData = 0 - $ret = $Win32::SLGetProductSkuInformation( + $hrRet = $Win32::SLGetProductSkuInformation( $hSLC, [ref][Guid]$SkuId, $Value, @@ -276,70 +319,7 @@ function SlGetInfoSku($SkuId, $Value) [ref]$bData ) - if ($ret -Or !$cData) - { - return $null - } - - if ($tData -EQ 1) - { - $rData = $Marshal::PtrToStringUni($bData) - } - elseif ($tData -EQ 4) - { - $rData = $Marshal::ReadInt32($bData) - } - elseif ($tData -EQ 3 -And $cData -EQ 8) - { - $rData = $Marshal::ReadInt64($bData) - } - else - { - $rData = $null - } - - $Marshal::FreeHGlobal($bData) - return $rData -} - -function SlGetInfoService($Value) -{ - $tData = 0 - $cData = 0 - $bData = 0 - - $ret = $Win32::SLGetServiceInformation( - $hSLC, - $Value, - [ref]$tData, - [ref]$cData, - [ref]$bData - ) - - if ($ret -Or !$cData) - { - return $null - } - - if ($tData -EQ 1) - { - $rData = $Marshal::PtrToStringUni($bData) - } - elseif ($tData -EQ 4) - { - $rData = $Marshal::ReadInt32($bData) - } - elseif ($tData -EQ 3 -And $cData -EQ 8) - { - $rData = $Marshal::ReadInt64($bData) - } - else - { - $rData = $null - } - - $Marshal::FreeHGlobal($bData) - return $rData + return SlReturnData $hrRet $tData $cData $bData } function SlGetInfoApp($AppId, $Value) @@ -348,7 +328,7 @@ function SlGetInfoApp($AppId, $Value) $cData = 0 $bData = 0 - $ret = $Win32::SLGetApplicationInformation( + $hrRet = $Win32::SLGetApplicationInformation( $hSLC, [ref][Guid]$AppId, $Value, @@ -357,80 +337,49 @@ function SlGetInfoApp($AppId, $Value) [ref]$bData ) - if ($ret -Or !$cData) - { - return $null - } + return SlReturnData $hrRet $tData $cData $bData +} - if ($tData -EQ 1) - { - $rData = $Marshal::PtrToStringUni($bData) - } - elseif ($tData -EQ 4) - { - $rData = $Marshal::ReadInt32($bData) - } - elseif ($tData -EQ 3 -And $cData -EQ 8) - { - $rData = $Marshal::ReadInt64($bData) - } - else - { - $rData = $null - } +function SlGetInfoService($Value) +{ + $tData = 0 + $cData = 0 + $bData = 0 - $Marshal::FreeHGlobal($bData) - return $rData + $hrRet = $Win32::SLGetServiceInformation( + $hSLC, + $Value, + [ref]$tData, + [ref]$cData, + [ref]$bData + ) + + return SlReturnData $hrRet $tData $cData $bData } function SlGetInfoSvcApp($strApp, $Value) { if ($SLApp) { - $rData = SlGetInfoApp $strApp $Value + return SlGetInfoApp $strApp $Value } else { - $rData = SlGetInfoService $Value + return SlGetInfoService $Value } - return $rData -} - -function SlGetInfoPKey($PkeyId, $Value) -{ - $cData = 0 - $bData = 0 - - $ret = $Win32::SLGetPKeyInformation( - $hSLC, - [ref][Guid]$PKeyId, - $Value, - [ref]$null, - [ref]$cData, - [ref]$bData - ) - - if ($ret -Or !$cData) - { - return $null - } - - $rData = $Marshal::PtrToStringUni($bData) - $Marshal::FreeHGlobal($bData) - return $rData } function SlGetInfoLicensing($AppId, $SkuId) { - $LicenseStatus = 0 - $GracePeriodRemaining = 0 + $dwStatus = 0 + $dwGrace = 0 $hrReason = 0 - $EvaluationEndDate = 0 + $qwValidity = 0 $cStatus = 0 $pStatus = 0 - $ret = $Win32::SLGetLicensingStatusInformation( + $hrRet = $Win32::SLGetLicensingStatusInformation( $hSLC, [ref][Guid]$AppId, [ref][Guid]$SkuId, @@ -439,80 +388,46 @@ function SlGetInfoLicensing($AppId, $SkuId) [ref]$pStatus ) - if ($ret -Or !$cStatus) + if ($hrRet -NE 0 -Or $cStatus -EQ 0) { return } [IntPtr]$ppStatus = [Int64]$pStatus + [Int64]40 * ($cStatus - 1) - $eStatus = $Marshal::ReadInt32($ppStatus, 16) - $GracePeriodRemaining = $Marshal::ReadInt32($ppStatus, 20) + $dwStatus = $Marshal::ReadInt32($ppStatus, 16) + $dwGrace = $Marshal::ReadInt32($ppStatus, 20) $hrReason = $Marshal::ReadInt32($ppStatus, 28) - $EvaluationEndDate = $Marshal::ReadInt64($ppStatus, 32) + $qwValidity = $Marshal::ReadInt64($ppStatus, 32) - if ($eStatus -EQ 3) + if ($dwStatus -EQ 3) { - $eStatus = 5 + $dwStatus = 5 } - if ($eStatus -EQ 2) + if ($dwStatus -EQ 2) { if ($hrReason -EQ 0x4004F00D) { - $eStatus = 3 + $dwStatus = 3 } elseif ($hrReason -EQ 0x4004F065) { - $eStatus = 4 + $dwStatus = 4 } elseif ($hrReason -EQ 0x4004FC06) { - $eStatus = 6 + $dwStatus = 6 } } - $LicenseStatus = $eStatus - $Marshal::FreeHGlobal($pStatus) return } -function SlCheckInfo($SkuId, $Value) -{ - $cData = 0 - $bData = 0 - - $ret = $Win32::SLGetProductSkuInformation( - $hSLC, - [ref][Guid]$SkuId, - $Value, - [ref]$null, - [ref]$cData, - [ref]$bData - ) - - if ($ret -Or !$cData) - { - return $false - } - - if ($Value -EQ "pkeyId") - { - $rData = $Marshal::PtrToStringUni($bData) - } - else - { - $rData = $true - } - - $Marshal::FreeHGlobal($bData) - return $rData -} - function SlGetInfoSLID($AppId) { $cReturnIds = 0 $pReturnIds = 0 - $ret = $Win32::SLGetSLIDList( + $hrRet = $Win32::SLGetSLIDList( $hSLC, 0, [ref][Guid]$AppId, @@ -521,7 +436,7 @@ function SlGetInfoSLID($AppId) [ref]$pReturnIds ) - if ($ret -Or !$cReturnIds) + if ($hrRet -NE 0 -Or $cReturnIds -EQ 0) { return } @@ -536,17 +451,16 @@ function SlGetInfoSLID($AppId) $bytes = New-Object byte[] 16 $Marshal::Copy([Int64]$pReturnIds + [Int64]16 * $i, $bytes, 0, 16) $actid = ([Guid]$bytes).Guid - $gPPK = SlCheckInfo $actid "pkeyId" - $gAdd = SlCheckInfo $actid "DependsOn" + $gPPK = SlGetInfoSku $actid "pkeyId" + $gAdd = SlGetInfoSku $actid "DependsOn" if ($All.IsPresent) { - if (!$gPPK -And $gAdd) { $a1List += @{id = $actid; pk = $null; ex = $true} } - if (!$gPPK -And !$gAdd) { $a2List += @{id = $actid; pk = $null; ex = $false} } + if ($null -EQ $gPPK -And $null -NE $gAdd) { $a1List += @{id = $actid; pk = $null; ex = $true} } + if ($null -EQ $gPPK -And $null -EQ $gAdd) { $a2List += @{id = $actid; pk = $null; ex = $false} } } - if ($gPPK -And $gAdd) { $a3List += @{id = $actid; pk = $gPPK; ex = $true} } - if ($gPPK -And !$gAdd) { $a4List += @{id = $actid; pk = $gPPK; ex = $false} } + if ($null -NE $gPPK -And $null -NE $gAdd) { $a3List += @{id = $actid; pk = $gPPK; ex = $true} } + if ($null -NE $gPPK -And $null -EQ $gAdd) { $a4List += @{id = $actid; pk = $gPPK; ex = $false} } } - $Marshal::FreeHGlobal($pReturnIds) return ($a1List + $a2List + $a3List + $a4List) } @@ -603,7 +517,7 @@ function DetectSubscription { function DetectAdbaClient { - $propADBA | foreach { set $_ (SlGetInfoSku $ID $_) } + $propADBA | foreach { set $_ (SlGetInfoSku $licID $_) } CONOUT "`nAD Activation client information:" CONOUT " Object Name: $ADActivationObjectName" CONOUT " Domain Name: $ADActivationObjectDN" @@ -613,7 +527,7 @@ function DetectAdbaClient function DetectAvmClient { - $propAVMA | foreach { set $_ (SlGetInfoSku $ID $_) } + $propAVMA | foreach { set $_ (SlGetInfoSku $licID $_) } CONOUT "`nAutomatic VM Activation client information:" if (-Not [String]::IsNullOrEmpty($InheritedActivationId)) { CONOUT " Guest IAID: $InheritedActivationId" @@ -644,7 +558,6 @@ function DetectKmsHost if (-Not $IsKeyManagementService) { return } - if ($null -NE $ExpireMsg) {CONOUT "`n $ExpireMsg"} if ($Vista -Or $NT5) { $regk = $SLKeyPath @@ -697,9 +610,9 @@ function DetectKmsHost function DetectKmsClient { - if ($strSLP -EQ $wslp -And $NT8) + if ($win8) { - $VLType = strGetRegistry ($SPKeyPath + '\' + $strApp + '\' + $ID) "VLActivationType" + $VLType = strGetRegistry ($SPKeyPath + '\' + $strApp + '\' + $licID) "VLActivationType" if ($null -EQ $VLType) {$VLType = strGetRegistry ($SPKeyPath + '\' + $strApp) "VLActivationType"} if ($null -EQ $VLType) {$VLType = strGetRegistry ($SPKeyPath) "VLActivationType"} if ($null -EQ $VLType -Or $VLType -GT 3) {$VLType = 0} @@ -713,7 +626,7 @@ function DetectKmsClient } if ($NT7 -Or $strSLP -EQ $oslp) { - $propKMSClient | foreach { set $_ (SlGetInfoSku $ID $_) } + $propKMSClient | foreach { set $_ (SlGetInfoSku $licID $_) } if ($strSLP -EQ $oslp) {$regk = $OPKeyPath} else {$regk = $SPKeyPath} $KMSCaching = strGetRegistry $regk "DisableKeyManagementServiceHostCaching" if (-Not $KMSCaching) {$KMSCaching = "TRUE"} else {$KMSCaching = BoolToWStr (!$KMSCaching)} @@ -771,58 +684,90 @@ function DetectKmsClient function GetResult($strSLP, $strApp, $entry) { - $ID = $entry.id - $propPrd | foreach { set $_ (SlGetInfoSku $ID $_) } - . SlGetInfoLicensing $strApp $ID + $licID = $entry.id + $propPrd | foreach { set $_ (SlGetInfoSku $licID $_) } + . SlGetInfoLicensing $strApp $licID + $LicenseStatus = $dwStatus + $LicReason = $hrReason + $EvaluationEndDate = $qwValidity + $gprMnt = $dwGrace + + $pkid = $entry.pk + $isPPK = $null -NE $pkid + + $add_on = $Name.IndexOf("add-on for", 5) + if ($add_on -NE -1) { + $Name = $Name.Substring(0, $add_on + 7) + } + + $licPHN = "empty" + if ($Dlv -Or $All.IsPresent) { + $licPHN = SlGetInfoSku $licID "msft:sl/EUL/PHONE/PUBLIC" + } + + if ($LicenseStatus -EQ 0 -And !$isPPK) { + & $isAll + CONOUT "Name: $Name" + CONOUT "Description: $Description" + CONOUT "Activation ID: $licID" + CONOUT "License Status: Unlicensed" + if ($licPHN -NE "empty") { + $gPHN = [String]::IsNullOrEmpty($licPHN) -NE $true + CONOUT "Phone activatable: $($gPHN.ToString())" + } + return + } $winID = ($strApp -EQ $winApp) $winPR = ($winID -And -Not $entry.ex) $Vista = ($winID -And $NT6 -And -Not $NT7) $NT5 = ($strSLP -EQ $wslp -And $winbuild -LT 6001) + $win8 = ($strSLP -EQ $wslp -And $NT8) $reapp = ("Windows", "App")[!$winID] $prmnt = ("machine", "product")[!$winPR] - if ($Description | Select-String "VOLUME_KMSCLIENT") {$cKmsClient = 1; $_mTag = "Volume"} - if ($Description | Select-String "TIMEBASED_") {$cTblClient = 1; $_mTag = "Timebased"} - if ($Description | Select-String "VIRTUAL_MACHINE_ACTIVATION") {$cAvmClient = 1; $_mTag = "Automatic VM"} - if ($null -EQ $cKmsClient) { - if ($Description | Select-String "VOLUME_KMS") {$cKmsServer = 1} + if ($Description.Contains("VOLUME_KMSCLIENT")) {$cKmsClient = 1; $actTag = "Volume"} + if ($Description.Contains("TIMEBASED_")) {$cTblClient = 1; $actTag = "Timebased"} + if ($Description.Contains("VIRTUAL_MACHINE_ACTIVATION")) {$cAvmClient = 1; $actTag = "Automatic VM"} + if ($null -EQ $cKmsClient -And $Description.Contains("VOLUME_KMS")) {$cKmsServer = 1} + + $gprDay = [Math]::Round($gprMnt/1440) + $_xpr = "" + $inGrace = $false + if ($gprMnt -GT 0) { + $_xpr = [DateTime]::Now.AddMinutes($gprMnt).ToString('yyyy-MM-dd hh:mm:ss tt') + $inGrace = $true } - $_gpr = [Math]::Round($GracePeriodRemaining/1440) - if ($_gpr -GT 0) { - $_xpr = [DateTime]::Now.AddMinutes($GracePeriodRemaining).ToString('yyyy-MM-dd hh:mm:ss tt') - } - - $LicenseReason = '0x{0:X}' -f $hrReason - $LicenseMsg = "Time remaining: $GracePeriodRemaining minute(s) ($_gpr day(s))" + $LicenseMsg = "Time remaining: $gprMnt minute(s) ($gprDay day(s))" if ($LicenseStatus -EQ 0) { $LicenseInf = "Unlicensed" $LicenseMsg = $null } if ($LicenseStatus -EQ 1) { $LicenseInf = "Licensed" - if ($GracePeriodRemaining -EQ 0) { + if ($gprMnt -EQ 0) { $LicenseMsg = $null $ExpireMsg = "The $prmnt is permanently activated." } else { - $LicenseMsg = "$_mTag activation expiration: $GracePeriodRemaining minute(s) ($_gpr day(s))" - if ($null -NE $_xpr) {$ExpireMsg = "$_mTag activation will expire $_xpr"} + $LicenseMsg = "$actTag activation expiration: $gprMnt minute(s) ($gprDay day(s))" + if ($inGrace) {$ExpireMsg = "$actTag activation will expire $_xpr"} } } if ($LicenseStatus -EQ 2) { $LicenseInf = "Initial grace period" - if ($null -NE $_xpr) {$ExpireMsg = "Initial grace period ends $_xpr"} + if ($inGrace) {$ExpireMsg = "$LicenseInf ends $_xpr"} } if ($LicenseStatus -EQ 3) { $LicenseInf = "Additional grace period (KMS license expired or hardware out of tolerance)" - if ($null -NE $_xpr) {$ExpireMsg = "Additional grace period ends $_xpr"} + if ($inGrace) {$ExpireMsg = "Additional grace period ends $_xpr"} } if ($LicenseStatus -EQ 4) { $LicenseInf = "Non-genuine grace period" - if ($null -NE $_xpr) {$ExpireMsg = "Non-genuine grace period ends $_xpr"} + if ($inGrace) {$ExpireMsg = "$LicenseInf ends $_xpr"} } if ($LicenseStatus -EQ 5 -And -Not $NT5) { + $LicenseReason = '0x{0:X}' -f $LicReason $LicenseInf = "Notification" $LicenseMsg = "Notification Reason: $LicenseReason" if ($LicenseReason -EQ "0xC004F00F") {if ($null -NE $cKmsClient) {$LicenseMsg = $LicenseMsg + " (KMS license expired)."} else {$LicenseMsg = $LicenseMsg + " (hardware out of tolerance)."}} @@ -835,36 +780,35 @@ function GetResult($strSLP, $strApp, $entry) } if ($LicenseStatus -EQ 6 -And -Not $Vista -And -Not $NT5) { $LicenseInf = "Extended grace period" - if ($null -NE $_xpr) {$ExpireMsg = "Extended grace period ends $_xpr"} + if ($inGrace) {$ExpireMsg = "$LicenseInf ends $_xpr"} } - $pkid = $entry.pk - if ($null -NE $pkid) { + if ($isPPK) { $propPkey | foreach { set $_ (SlGetInfoPKey $pkid $_) } } - if ($winPR -And $null -NE $PartialProductKey -And -Not $NT8) { - $uxd = SlGetInfoSku $ID 'UXDifferentiator' + if ($winPR -And $isPPK -And -Not $NT8) { + $uxd = SlGetInfoSku $licID 'UXDifferentiator' $script:primary += @{ - aid = $ID; + aid = $licID; ppk = $PartialProductKey; chn = $Channel; lst = $LicenseStatus; - lcr = $hrReason; - ged = $GracePeriodRemaining; + lcr = $LicReason; + ged = $gprMnt; evl = $EvaluationEndDate; dff = $uxd } } - if ($IID -And $null -NE $PartialProductKey) { - $OfflineInstallationId = SlGetInfoIID $ID + if ($IID -And $isPPK) { + $OfflineInstallationId = SlGetInfoIID $licID } if ($Dlv) { - if ($strSLP -EQ $wslp -And $NT8) + if ($win8) { - $RemainingSkuReArmCount = SlGetInfoSku $ID 'RemainingRearmCount' + $RemainingSkuReArmCount = SlGetInfoSku $licID 'RemainingRearmCount' $RemainingAppReArmCount = SlGetInfoApp $strApp 'RemainingRearmCount' } else @@ -884,16 +828,10 @@ function GetResult($strSLP, $strApp, $entry) } } - if ($Dlv -Or $All.IsPresent) { - $gPHN = SlCheckInfo $ID "msft:sl/EUL/PHONE/PUBLIC" - } - - $add_on = $Name.IndexOf("add-on for", 5) - & $isAll - if ($add_on -EQ -1) {CONOUT "Name: $Name"} else {CONOUT "Name: $($Name.Substring(0, $add_on + 7))"} + CONOUT "Name: $Name" CONOUT "Description: $Description" - CONOUT "Activation ID: $ID" + CONOUT "Activation ID: $licID" if ($null -NE $DigitalPID) {CONOUT "Extended PID: $DigitalPID"} if ($null -NE $DigitalPID2 -And $Dlv) {CONOUT "Product ID: $DigitalPID2"} if ($null -NE $OfflineInstallationId -And $IID) {CONOUT "Installation ID: $OfflineInstallationId"} @@ -905,9 +843,9 @@ function GetResult($strSLP, $strApp, $entry) $EED = [DateTime]::FromFileTimeUtc($EvaluationEndDate).ToString('yyyy-MM-dd hh:mm:ss tt') CONOUT "Evaluation End Date: $EED UTC" } - if ($LicenseStatus -NE 1 -And $null -NE $gPHN) { - $gPHN = $gPHN.ToString() - CONOUT "Phone activatable: $gPHN" + if ($LicenseStatus -NE 1 -And $licPHN -NE "empty") { + $gPHN = [String]::IsNullOrEmpty($licPHN) -NE $true + CONOUT "Phone activatable: $($gPHN.ToString())" } if ($Dlv) { if ($null -NE $RemainingSLReArmCount) { @@ -922,11 +860,11 @@ function GetResult($strSLP, $strApp, $entry) CONOUT "Trusted time: $TTD" } } - if ($null -EQ $PartialProductKey) { + if (!$isPPK) { return } - if ($strSLP -EQ $wslp -And $NT8 -And $VLActivationType -EQ 1) { + if ($win8 -And $VLActivationType -EQ 1) { DetectAdbaClient } @@ -934,7 +872,7 @@ function GetResult($strSLP, $strApp, $entry) DetectAvmClient } - $chkSub = ($winPR -And $cSub) + $chkSub = ($winPR -And $isSub) $chkSLS = ($null -NE $cKmsClient -Or $null -NE $cKmsServer -Or $chkSub) @@ -943,15 +881,14 @@ function GetResult($strSLP, $strApp, $entry) return } - if ($null -NE $cKmsServer) { - DetectKmsHost - } - if ($null -NE $cKmsClient) { DetectKmsClient } - if ($null -EQ $cKmsServer) { + if ($null -NE $cKmsServer) { + if ($null -NE $ExpireMsg) {CONOUT "`n $ExpireMsg"} + DetectKmsHost + } else { if ($null -NE $ExpireMsg) {CONOUT "`n $ExpireMsg"} } @@ -1368,14 +1305,14 @@ function clcGetExpireKrn $cData = 0 $bData = 0 - $ret = $Win32::SLGetWindowsInformation( + $hrRet = $Win32::SLGetWindowsInformation( "Kernel-ExpirationDate", [ref]$tData, [ref]$cData, [ref]$bData ) - if ($ret -Or !$cData -Or $tData -NE 3) + if ($hrRet -Or !$cData -Or $tData -NE 3) { return $null } @@ -1390,7 +1327,7 @@ function clcGetExpireKrn $rData = '{0}/{1}/{2}:{3}:{4}:{5}' -f $year, $Marshal::ReadInt16($bData, 2), $Marshal::ReadInt16($bData, 4), $Marshal::ReadInt16($bData, 6), $Marshal::ReadInt16($bData, 8), $Marshal::ReadInt16($bData, 10) } - $Marshal::FreeHGlobal($bData) + #$Marshal::FreeHGlobal($bData) return $rData } @@ -1426,12 +1363,12 @@ function clcGetGenuineState($AppId) $dwGenuine = 0 if ($NT7) { - $ret = $Win32::SLIsWindowsGenuineLocal([ref]$dwGenuine) + $hrRet = $Win32::SLIsWindowsGenuineLocal([ref]$dwGenuine) } else { - $ret = $Win32::SLIsGenuineLocal([ref][Guid]$AppId, [ref]$dwGenuine, 0) + $hrRet = $Win32::SLIsGenuineLocal([ref][Guid]$AppId, [ref]$dwGenuine, 0) } - if ($ret) + if ($hrRet) { $dwGenuine = 4 } @@ -1499,7 +1436,7 @@ $osls = "OfficeSoftwareProtectionService" $winApp = "55c92734-d682-4d71-983e-d6ec3f16059f" $o14App = "59a52881-a989-479d-af46-f275c6370663" $o15App = "0ff1ce15-a989-479d-af46-f275c6370663" -$cSub = ($winbuild -GE 26000) -And (Select-String -Path "$SysPath\wbem\sppwmi.mof" -Encoding unicode -Pattern "SubscriptionType") +$isSub = ($winbuild -GE 26000) -And (Select-String -Path "$SysPath\wbem\sppwmi.mof" -Encoding unicode -Pattern "SubscriptionType") $DllDigital = ($winbuild -GE 14393) -And (Test-Path "$SysPath\EditionUpgradeManagerObj.dll") $DllSubscription = ($winbuild -GE 14393) -And (Test-Path "$SysPath\Clipc.dll") $VLActTypes = @("All", "AD", "KMS", "Token") diff --git a/MAS/Separate-Files-Version/Extract_OEM_Folder.cmd b/MAS/Separate-Files-Version/Extract_OEM_Folder.cmd index 10030b1..7f6eb25 100644 --- a/MAS/Separate-Files-Version/Extract_OEM_Folder.cmd +++ b/MAS/Separate-Files-Version/Extract_OEM_Folder.cmd @@ -1,4 +1,4 @@ -@set masver=3.0 +@set masver=3.1 @echo off diff --git a/MAS/Separate-Files-Version/Troubleshoot.cmd b/MAS/Separate-Files-Version/Troubleshoot.cmd index 55a42ed..bc4d49d 100644 --- a/MAS/Separate-Files-Version/Troubleshoot.cmd +++ b/MAS/Separate-Files-Version/Troubleshoot.cmd @@ -1,4 +1,4 @@ -@set masver=3.0 +@set masver=3.1 @echo off diff --git a/README.md b/README.md index 0fca6c6..b3fdf00 100644 --- a/README.md +++ b/README.md @@ -6,43 +6,54 @@
-## Download / How to use it? +## How to Activate Windows / Office? ### Method 1 - PowerShell (Windows 8 and later) ❤️ -1. Open PowerShell (Not CMD). To do that, right-click on the Windows start menu and select PowerShell or Terminal. -2. Copy and paste the code below and press enter +1. **Open PowerShell** + To do that, press the Windows key + X, then select PowerShell or Terminal. + +2. **Copy and paste the code below, then press enter.** ``` irm https://get.activated.win | iex ``` -Alternatively, you can use the following (It will be deprecated in the future.) +Alternatively, you can use the following (this will be deprecated in the future): ``` irm https://massgrave.dev/get | iex ``` -3. You will see the activation options. Choose (1) HWID for Windows activation. Choose (2) Ohook for Office activation. -4. That's all. + +3. You will see the activation options. + Press 1 HWID for Windows activation. + Press 2 Ohook for Office activation. + +4. That's all --- -### Method 2 - Traditional (Windows 7 and later) +### Method 2 - Traditional (Windows Vista and later)
- Click here for info - -1. Download the file using the links provided below. + Click here to view + +1. Download the file using one of the links below: `https://github.com/massgravel/Microsoft-Activation-Scripts/archive/refs/heads/master.zip` or `https://git.activated.win/massgrave/Microsoft-Activation-Scripts/archive/master.zip` -2. Right-click on the downloaded zip file and extract -3. In the extracted folder, find the folder named `All-In-One-Version` -4. Run the file named `MAS_AIO.cmd` -5. You will see the activation options, follow the on-screen instructions. +2. Right-click on the downloaded zip file and extract it. +3. In the extracted folder, find the folder named `All-In-One-Version`. +4. Run the file named `MAS_AIO.cmd`. +5. You will see the activation options. Follow the on-screen instructions. 6. That's all.
--- +- **[Office for macOS](https://massgrave.dev/office_for_mac)** +- To run the scripts in unattended mode, check [here](https://massgrave.dev/command_line_switches). + +--- + ### Not working ❓ - If you are **unable to launch MAS** using the PowerShell method, please refer to **Method 2** listed above. @@ -59,11 +70,9 @@ or --- -To run the scripts in unattended mode, check [here](https://massgrave.dev/command_line_switches). - ``` -Latest Version: 3.0 -Release date: 14-Feb-2025 +Latest Version: 3.1 +Release date: 29-Apr-2025 ``` ### [Troubleshooting / Help](https://massgrave.dev/troubleshoot) From 4e702068bea2cd5372904389ac687c75bc13223f Mon Sep 17 00:00:00 2001 From: WindowsAddict Date: Tue, 29 Apr 2025 23:06:43 +0530 Subject: [PATCH 33/79] Revert export-ignore --- .gitattributes | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.gitattributes b/.gitattributes index de5bd3d..8749e12 100644 --- a/.gitattributes +++ b/.gitattributes @@ -1,4 +1,4 @@ -MAS export-ignore -LICENSE export-ignore -README.md export-ignore +# MAS export-ignore +# LICENSE export-ignore +# README.md export-ignore .gitattributes export-ignore From 1bdee1ce6fd3ad64d1ae708daa7df65b54993ac2 Mon Sep 17 00:00:00 2001 From: WindowsAddict Date: Sun, 4 May 2025 01:03:13 +0530 Subject: [PATCH 34/79] Improve edition package detection --- MAS/All-In-One-Version-KL/MAS_AIO.cmd | 2 ++ MAS/Separate-Files-Version/Activators/HWID_Activation.cmd | 2 ++ MAS/Separate-Files-Version/Activators/KMS38_Activation.cmd | 2 ++ MAS/Separate-Files-Version/Activators/Ohook_Activation_AIO.cmd | 2 ++ .../Activators/Online_KMS_Activation.cmd | 2 ++ MAS/Separate-Files-Version/Activators/TSforge_Activation.cmd | 3 +++ 6 files changed, 13 insertions(+) diff --git a/MAS/All-In-One-Version-KL/MAS_AIO.cmd b/MAS/All-In-One-Version-KL/MAS_AIO.cmd index 73ac408..b2a1df0 100644 --- a/MAS/All-In-One-Version-KL/MAS_AIO.cmd +++ b/MAS/All-In-One-Version-KL/MAS_AIO.cmd @@ -1676,10 +1676,12 @@ call :dk_color %Red% "Checking License Files [Not Found] [%osed ) if not exist "%SystemRoot%\Servicing\Packages\Microsoft-Windows-*-%osedition%-*.mum" ( +if not exist "%SystemRoot%\Servicing\Packages\Microsoft-Windows-%osedition%Edition*.mum" ( call :dk_color %Red% "Checking Package Files [Not Found] [%osedition%]" ) ) ) +) if %_wmic% EQU 1 wmic path %sps% get Version %nul% diff --git a/MAS/Separate-Files-Version/Activators/HWID_Activation.cmd b/MAS/Separate-Files-Version/Activators/HWID_Activation.cmd index 340c2a8..7c0a550 100644 --- a/MAS/Separate-Files-Version/Activators/HWID_Activation.cmd +++ b/MAS/Separate-Files-Version/Activators/HWID_Activation.cmd @@ -1379,10 +1379,12 @@ call :dk_color %Red% "Checking License Files [Not Found] [%osed ) if not exist "%SystemRoot%\Servicing\Packages\Microsoft-Windows-*-%osedition%-*.mum" ( +if not exist "%SystemRoot%\Servicing\Packages\Microsoft-Windows-%osedition%Edition*.mum" ( call :dk_color %Red% "Checking Package Files [Not Found] [%osedition%]" ) ) ) +) if %_wmic% EQU 1 wmic path %sps% get Version %nul% diff --git a/MAS/Separate-Files-Version/Activators/KMS38_Activation.cmd b/MAS/Separate-Files-Version/Activators/KMS38_Activation.cmd index 3f99aee..426549b 100644 --- a/MAS/Separate-Files-Version/Activators/KMS38_Activation.cmd +++ b/MAS/Separate-Files-Version/Activators/KMS38_Activation.cmd @@ -1522,10 +1522,12 @@ call :dk_color %Red% "Checking License Files [Not Found] [%osed ) if not exist "%SystemRoot%\Servicing\Packages\Microsoft-Windows-*-%osedition%-*.mum" ( +if not exist "%SystemRoot%\Servicing\Packages\Microsoft-Windows-%osedition%Edition*.mum" ( call :dk_color %Red% "Checking Package Files [Not Found] [%osedition%]" ) ) ) +) if %_wmic% EQU 1 wmic path %sps% get Version %nul% diff --git a/MAS/Separate-Files-Version/Activators/Ohook_Activation_AIO.cmd b/MAS/Separate-Files-Version/Activators/Ohook_Activation_AIO.cmd index ca9a308..d46343b 100644 --- a/MAS/Separate-Files-Version/Activators/Ohook_Activation_AIO.cmd +++ b/MAS/Separate-Files-Version/Activators/Ohook_Activation_AIO.cmd @@ -2040,10 +2040,12 @@ call :dk_color %Red% "Checking License Files [Not Found] [%osed ) if not exist "%SystemRoot%\Servicing\Packages\Microsoft-Windows-*-%osedition%-*.mum" ( +if not exist "%SystemRoot%\Servicing\Packages\Microsoft-Windows-%osedition%Edition*.mum" ( call :dk_color %Red% "Checking Package Files [Not Found] [%osedition%]" ) ) ) +) if %_wmic% EQU 1 wmic path %sps% get Version %nul% diff --git a/MAS/Separate-Files-Version/Activators/Online_KMS_Activation.cmd b/MAS/Separate-Files-Version/Activators/Online_KMS_Activation.cmd index bb6fd92..4fd6303 100644 --- a/MAS/Separate-Files-Version/Activators/Online_KMS_Activation.cmd +++ b/MAS/Separate-Files-Version/Activators/Online_KMS_Activation.cmd @@ -3092,10 +3092,12 @@ call :dk_color %Red% "Checking License Files [Not Found] [%osed ) if not exist "%SystemRoot%\Servicing\Packages\Microsoft-Windows-*-%osedition%-*.mum" ( +if not exist "%SystemRoot%\Servicing\Packages\Microsoft-Windows-%osedition%Edition*.mum" ( call :dk_color %Red% "Checking Package Files [Not Found] [%osedition%]" ) ) ) +) if %_wmic% EQU 1 wmic path %sps% get Version %nul% diff --git a/MAS/Separate-Files-Version/Activators/TSforge_Activation.cmd b/MAS/Separate-Files-Version/Activators/TSforge_Activation.cmd index 40d9914..9bf5ba0 100644 --- a/MAS/Separate-Files-Version/Activators/TSforge_Activation.cmd +++ b/MAS/Separate-Files-Version/Activators/TSforge_Activation.cmd @@ -2706,10 +2706,13 @@ call :dk_color %Red% "Checking License Files [Not Found] [%osed ) if not exist "%SystemRoot%\Servicing\Packages\Microsoft-Windows-*-%osedition%-*.mum" ( +if not exist "%SystemRoot%\Servicing\Packages\Microsoft-Windows-%osedition%Edition*.mum" ( call :dk_color %Red% "Checking Package Files [Not Found] [%osedition%]" ) ) ) +) + if %_wmic% EQU 1 wmic path %sps% get Version %nul% if %_wmic% EQU 0 %psc% "try { $null=([WMISEARCHER]'SELECT * FROM %sps%').Get().Version; exit 0 } catch { exit $_.Exception.InnerException.HResult }" %nul% From dfebdefebaf1b4ba3052b4ebe165482d7aaa13a4 Mon Sep 17 00:00:00 2001 From: WindowsAddict Date: Sun, 4 May 2025 02:21:50 +0530 Subject: [PATCH 35/79] Add Office 2010 Publisher Retail key --- MAS/All-In-One-Version-KL/MAS_AIO.cmd | 2 +- MAS/Separate-Files-Version/Activators/Ohook_Activation_AIO.cmd | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/MAS/All-In-One-Version-KL/MAS_AIO.cmd b/MAS/All-In-One-Version-KL/MAS_AIO.cmd index b2a1df0..ecc78bc 100644 --- a/MAS/All-In-One-Version-KL/MAS_AIO.cmd +++ b/MAS/All-In-One-Version-KL/MAS_AIO.cmd @@ -3422,7 +3422,6 @@ exit /b 14_7004b7f0-6407-4f45-8eac-966e5f868bde_Retail________GrooveR 14_fbf4ac36-31c8-4340-8666-79873129cf40_Retail________OutlookR 14_133c8359-4e93-4241-8118-30bb18737ea0_Retail________PowerPointR_[HSPowerPointR] -14_98677603-a668-4fa4-9980-3f1f05f78f69_Retail________PublisherR 14_db3bbc9c-ce52-41d1-a46f-1a1d68059119_Retail________WordR_[HSWordR] 14_dbe3aee0-5183-4ff7-8142-66050173cb01_Retail________SmallBusBasicsR_[SmallBusBasicsMSDNR] @@ -3460,6 +3459,7 @@ for %%# in ( 14_11b39439-6b93-4642-9570-f2eb81be2238_4DTT4-D4MKX-23KFH-JKR6T-YK%f%G2J_MAK___________ProjectStdVL 14_71af7e84-93e6-4363-9b69-699e04e74071_2J9H6-H4D3G-PCXD2-96XVM-TR%f%R73_Retail________ProPlusR_[ProPlusAcadR,ProPlusMSDNR,Sub4R] 14_fdf3ecb9-b56f-43b2-a9b8-1b48b6bae1a7_6CD6C-9R8PB-T2D9Y-8RKKX-W7%f%DFK_MAK___________ProPlusVL_[ProPlusAcadVL] +14_98677603-a668-4fa4-9980-3f1f05f78f69_CTRJP-P72VV-JBF8Y-4W6WW-HX%f%HVG_Retail________PublisherR 14_3d014759-b128-4466-9018-e80f6320d9d0_32YG9-3VX77-YXJVV-PRVFW-TT%f%8BV_MAK___________PublisherVL 14_8090771e-d41a-4482-929e-de87f1f47e46_7VKXH-9BWCG-RPTBB-JBRV3-GR%f%HYC_MAK___________SmallBusBasicsVL 14_b78df69e-0966-40b1-ae85-30a5134dedd0_H48K6-FB4Y6-P83GH-9J7XG-HD%f%KKX_ByPass________SPDR diff --git a/MAS/Separate-Files-Version/Activators/Ohook_Activation_AIO.cmd b/MAS/Separate-Files-Version/Activators/Ohook_Activation_AIO.cmd index d46343b..75115e8 100644 --- a/MAS/Separate-Files-Version/Activators/Ohook_Activation_AIO.cmd +++ b/MAS/Separate-Files-Version/Activators/Ohook_Activation_AIO.cmd @@ -2398,7 +2398,6 @@ exit /b 14_7004b7f0-6407-4f45-8eac-966e5f868bde_Retail________GrooveR 14_fbf4ac36-31c8-4340-8666-79873129cf40_Retail________OutlookR 14_133c8359-4e93-4241-8118-30bb18737ea0_Retail________PowerPointR_[HSPowerPointR] -14_98677603-a668-4fa4-9980-3f1f05f78f69_Retail________PublisherR 14_db3bbc9c-ce52-41d1-a46f-1a1d68059119_Retail________WordR_[HSWordR] 14_dbe3aee0-5183-4ff7-8142-66050173cb01_Retail________SmallBusBasicsR_[SmallBusBasicsMSDNR] @@ -2436,6 +2435,7 @@ for %%# in ( 14_11b39439-6b93-4642-9570-f2eb81be2238_4DTT4-D4MKX-23KFH-JKR6T-YK%f%G2J_MAK___________ProjectStdVL 14_71af7e84-93e6-4363-9b69-699e04e74071_2J9H6-H4D3G-PCXD2-96XVM-TR%f%R73_Retail________ProPlusR_[ProPlusAcadR,ProPlusMSDNR,Sub4R] 14_fdf3ecb9-b56f-43b2-a9b8-1b48b6bae1a7_6CD6C-9R8PB-T2D9Y-8RKKX-W7%f%DFK_MAK___________ProPlusVL_[ProPlusAcadVL] +14_98677603-a668-4fa4-9980-3f1f05f78f69_CTRJP-P72VV-JBF8Y-4W6WW-HX%f%HVG_Retail________PublisherR 14_3d014759-b128-4466-9018-e80f6320d9d0_32YG9-3VX77-YXJVV-PRVFW-TT%f%8BV_MAK___________PublisherVL 14_8090771e-d41a-4482-929e-de87f1f47e46_7VKXH-9BWCG-RPTBB-JBRV3-GR%f%HYC_MAK___________SmallBusBasicsVL 14_b78df69e-0966-40b1-ae85-30a5134dedd0_H48K6-FB4Y6-P83GH-9J7XG-HD%f%KKX_ByPass________SPDR From b24bb9bde121a2fea55ac6c634f1bc510cdf3265 Mon Sep 17 00:00:00 2001 From: WindowsAddict Date: Sun, 4 May 2025 17:04:06 +0530 Subject: [PATCH 36/79] Remove () from product name --- MAS/All-In-One-Version-KL/MAS_AIO.cmd | 2 +- MAS/Separate-Files-Version/Activators/HWID_Activation.cmd | 2 +- MAS/Separate-Files-Version/Activators/KMS38_Activation.cmd | 2 +- MAS/Separate-Files-Version/Activators/Ohook_Activation_AIO.cmd | 2 +- MAS/Separate-Files-Version/Activators/Online_KMS_Activation.cmd | 2 +- MAS/Separate-Files-Version/Activators/TSforge_Activation.cmd | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/MAS/All-In-One-Version-KL/MAS_AIO.cmd b/MAS/All-In-One-Version-KL/MAS_AIO.cmd index ecc78bc..ce5eecb 100644 --- a/MAS/All-In-One-Version-KL/MAS_AIO.cmd +++ b/MAS/All-In-One-Version-KL/MAS_AIO.cmd @@ -1400,7 +1400,7 @@ exit /b :dk_product set d1=%ref% $meth = $TypeBuilder.DefinePInvokeMethod('BrandingFormatString', 'winbrand.dll', 'Public, Static', 1, [String], @([String]), 1, 3); -set d1=%d1% $meth.SetImplementationFlags(128); $TypeBuilder.CreateType()::BrandingFormatString('%%WINDOWS_LONG%%') -replace [string][char]0xa9, '(C)' -replace [string][char]0xae, '(R)' -replace [string][char]0x2122, '(TM)' +set d1=%d1% $meth.SetImplementationFlags(128); $TypeBuilder.CreateType()::BrandingFormatString('%%WINDOWS_LONG%%') -replace [string][char]0xa9, '' -replace [string][char]0xae, '' -replace [string][char]0x2122, '' set winos= for /f "delims=" %%s in ('"%psc% %d1%"') do if not errorlevel 1 (set winos=%%s) diff --git a/MAS/Separate-Files-Version/Activators/HWID_Activation.cmd b/MAS/Separate-Files-Version/Activators/HWID_Activation.cmd index 7c0a550..49f841e 100644 --- a/MAS/Separate-Files-Version/Activators/HWID_Activation.cmd +++ b/MAS/Separate-Files-Version/Activators/HWID_Activation.cmd @@ -1103,7 +1103,7 @@ exit /b :dk_product set d1=%ref% $meth = $TypeBuilder.DefinePInvokeMethod('BrandingFormatString', 'winbrand.dll', 'Public, Static', 1, [String], @([String]), 1, 3); -set d1=%d1% $meth.SetImplementationFlags(128); $TypeBuilder.CreateType()::BrandingFormatString('%%WINDOWS_LONG%%') -replace [string][char]0xa9, '(C)' -replace [string][char]0xae, '(R)' -replace [string][char]0x2122, '(TM)' +set d1=%d1% $meth.SetImplementationFlags(128); $TypeBuilder.CreateType()::BrandingFormatString('%%WINDOWS_LONG%%') -replace [string][char]0xa9, '' -replace [string][char]0xae, '' -replace [string][char]0x2122, '' set winos= for /f "delims=" %%s in ('"%psc% %d1%"') do if not errorlevel 1 (set winos=%%s) diff --git a/MAS/Separate-Files-Version/Activators/KMS38_Activation.cmd b/MAS/Separate-Files-Version/Activators/KMS38_Activation.cmd index 426549b..e4690df 100644 --- a/MAS/Separate-Files-Version/Activators/KMS38_Activation.cmd +++ b/MAS/Separate-Files-Version/Activators/KMS38_Activation.cmd @@ -1201,7 +1201,7 @@ exit /b :dk_product set d1=%ref% $meth = $TypeBuilder.DefinePInvokeMethod('BrandingFormatString', 'winbrand.dll', 'Public, Static', 1, [String], @([String]), 1, 3); -set d1=%d1% $meth.SetImplementationFlags(128); $TypeBuilder.CreateType()::BrandingFormatString('%%WINDOWS_LONG%%') -replace [string][char]0xa9, '(C)' -replace [string][char]0xae, '(R)' -replace [string][char]0x2122, '(TM)' +set d1=%d1% $meth.SetImplementationFlags(128); $TypeBuilder.CreateType()::BrandingFormatString('%%WINDOWS_LONG%%') -replace [string][char]0xa9, '' -replace [string][char]0xae, '' -replace [string][char]0x2122, '' set winos= for /f "delims=" %%s in ('"%psc% %d1%"') do if not errorlevel 1 (set winos=%%s) diff --git a/MAS/Separate-Files-Version/Activators/Ohook_Activation_AIO.cmd b/MAS/Separate-Files-Version/Activators/Ohook_Activation_AIO.cmd index 75115e8..7b9488b 100644 --- a/MAS/Separate-Files-Version/Activators/Ohook_Activation_AIO.cmd +++ b/MAS/Separate-Files-Version/Activators/Ohook_Activation_AIO.cmd @@ -1779,7 +1779,7 @@ exit /b :dk_product set d1=%ref% $meth = $TypeBuilder.DefinePInvokeMethod('BrandingFormatString', 'winbrand.dll', 'Public, Static', 1, [String], @([String]), 1, 3); -set d1=%d1% $meth.SetImplementationFlags(128); $TypeBuilder.CreateType()::BrandingFormatString('%%WINDOWS_LONG%%') -replace [string][char]0xa9, '(C)' -replace [string][char]0xae, '(R)' -replace [string][char]0x2122, '(TM)' +set d1=%d1% $meth.SetImplementationFlags(128); $TypeBuilder.CreateType()::BrandingFormatString('%%WINDOWS_LONG%%') -replace [string][char]0xa9, '' -replace [string][char]0xae, '' -replace [string][char]0x2122, '' set winos= for /f "delims=" %%s in ('"%psc% %d1%"') do if not errorlevel 1 (set winos=%%s) diff --git a/MAS/Separate-Files-Version/Activators/Online_KMS_Activation.cmd b/MAS/Separate-Files-Version/Activators/Online_KMS_Activation.cmd index 4fd6303..07c41ad 100644 --- a/MAS/Separate-Files-Version/Activators/Online_KMS_Activation.cmd +++ b/MAS/Separate-Files-Version/Activators/Online_KMS_Activation.cmd @@ -2771,7 +2771,7 @@ exit /b :dk_product set d1=%ref% $meth = $TypeBuilder.DefinePInvokeMethod('BrandingFormatString', 'winbrand.dll', 'Public, Static', 1, [String], @([String]), 1, 3); -set d1=%d1% $meth.SetImplementationFlags(128); $TypeBuilder.CreateType()::BrandingFormatString('%%WINDOWS_LONG%%') -replace [string][char]0xa9, '(C)' -replace [string][char]0xae, '(R)' -replace [string][char]0x2122, '(TM)' +set d1=%d1% $meth.SetImplementationFlags(128); $TypeBuilder.CreateType()::BrandingFormatString('%%WINDOWS_LONG%%') -replace [string][char]0xa9, '' -replace [string][char]0xae, '' -replace [string][char]0x2122, '' set winos= for /f "delims=" %%s in ('"%psc% %d1%"') do if not errorlevel 1 (set winos=%%s) diff --git a/MAS/Separate-Files-Version/Activators/TSforge_Activation.cmd b/MAS/Separate-Files-Version/Activators/TSforge_Activation.cmd index 9bf5ba0..13e9eb0 100644 --- a/MAS/Separate-Files-Version/Activators/TSforge_Activation.cmd +++ b/MAS/Separate-Files-Version/Activators/TSforge_Activation.cmd @@ -2430,7 +2430,7 @@ exit /b :dk_product set d1=%ref% $meth = $TypeBuilder.DefinePInvokeMethod('BrandingFormatString', 'winbrand.dll', 'Public, Static', 1, [String], @([String]), 1, 3); -set d1=%d1% $meth.SetImplementationFlags(128); $TypeBuilder.CreateType()::BrandingFormatString('%%WINDOWS_LONG%%') -replace [string][char]0xa9, '(C)' -replace [string][char]0xae, '(R)' -replace [string][char]0x2122, '(TM)' +set d1=%d1% $meth.SetImplementationFlags(128); $TypeBuilder.CreateType()::BrandingFormatString('%%WINDOWS_LONG%%') -replace [string][char]0xa9, '' -replace [string][char]0xae, '' -replace [string][char]0x2122, '' set winos= for /f "delims=" %%s in ('"%psc% %d1%"') do if not errorlevel 1 (set winos=%%s) From 9e80556df50d7273a6fbd4d28104ba635b7746a2 Mon Sep 17 00:00:00 2001 From: WindowsAddict Date: Mon, 5 May 2025 22:25:54 +0530 Subject: [PATCH 37/79] Add O365AppsBasicRetail support --- MAS/All-In-One-Version-KL/MAS_AIO.cmd | 1 + MAS/Separate-Files-Version/Activators/Ohook_Activation_AIO.cmd | 1 + 2 files changed, 2 insertions(+) diff --git a/MAS/All-In-One-Version-KL/MAS_AIO.cmd b/MAS/All-In-One-Version-KL/MAS_AIO.cmd index ce5eecb..04a0245 100644 --- a/MAS/All-In-One-Version-KL/MAS_AIO.cmd +++ b/MAS/All-In-One-Version-KL/MAS_AIO.cmd @@ -3524,6 +3524,7 @@ for %%# in ( 15_e3dacc06-3bc2-4e13-8e59-8e05f3232325_H8DN8-Y2YP3-CR9JT-DHDR9-C7%f%GP3_Subscription2_O365ProPlusRetail 15_0bc1dae4-6158-4a1c-a893-807665b934b2_2QCNB-RMDKJ-GC8PB-7QGQV-7Q%f%TQJ_Subscription2_O365SmallBusPremRetail :: Office 365 - 16.0 version +16_dabaa1f2-109b-496d-bf49-1536cc862900_3HYJN-9KG99-F8VG9-V3DT8-JF%f%MHV_Subscription__O365AppsBasicRetail 16_742178ed-6b28-42dd-b3d7-b7c0ea78741b_Y9NF9-M2QWD-FF6RJ-QJW36-RR%f%F2T_SubTest_______O365BusinessRetail 16_2f5c71b4-5b7a-4005-bb68-f9fac26f2ea3_W62NQ-267QR-RTF74-PF2MH-JQ%f%MTH_Subscription__O365EduCloudRetail 16_a96f8dae-da54-4fad-bdc6-108da592707a_3NMDC-G7C3W-68RGP-CB4MH-4C%f%XCH_SubTest1______O365HomePremRetail diff --git a/MAS/Separate-Files-Version/Activators/Ohook_Activation_AIO.cmd b/MAS/Separate-Files-Version/Activators/Ohook_Activation_AIO.cmd index 7b9488b..ae020f8 100644 --- a/MAS/Separate-Files-Version/Activators/Ohook_Activation_AIO.cmd +++ b/MAS/Separate-Files-Version/Activators/Ohook_Activation_AIO.cmd @@ -2500,6 +2500,7 @@ for %%# in ( 15_e3dacc06-3bc2-4e13-8e59-8e05f3232325_H8DN8-Y2YP3-CR9JT-DHDR9-C7%f%GP3_Subscription2_O365ProPlusRetail 15_0bc1dae4-6158-4a1c-a893-807665b934b2_2QCNB-RMDKJ-GC8PB-7QGQV-7Q%f%TQJ_Subscription2_O365SmallBusPremRetail :: Office 365 - 16.0 version +16_dabaa1f2-109b-496d-bf49-1536cc862900_3HYJN-9KG99-F8VG9-V3DT8-JF%f%MHV_Subscription__O365AppsBasicRetail 16_742178ed-6b28-42dd-b3d7-b7c0ea78741b_Y9NF9-M2QWD-FF6RJ-QJW36-RR%f%F2T_SubTest_______O365BusinessRetail 16_2f5c71b4-5b7a-4005-bb68-f9fac26f2ea3_W62NQ-267QR-RTF74-PF2MH-JQ%f%MTH_Subscription__O365EduCloudRetail 16_a96f8dae-da54-4fad-bdc6-108da592707a_3NMDC-G7C3W-68RGP-CB4MH-4C%f%XCH_SubTest1______O365HomePremRetail From bcc4214e8ab8919d7cb81aad2ba1043b554f2cf0 Mon Sep 17 00:00:00 2001 From: WindowsAddict Date: Mon, 5 May 2025 22:38:51 +0530 Subject: [PATCH 38/79] Add O365AppsBasicRetail conversion in KMS script --- MAS/All-In-One-Version-KL/MAS_AIO.cmd | 2 +- MAS/Separate-Files-Version/Activators/Online_KMS_Activation.cmd | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/MAS/All-In-One-Version-KL/MAS_AIO.cmd b/MAS/All-In-One-Version-KL/MAS_AIO.cmd index 04a0245..a450c44 100644 --- a/MAS/All-In-One-Version-KL/MAS_AIO.cmd +++ b/MAS/All-In-One-Version-KL/MAS_AIO.cmd @@ -13851,7 +13851,7 @@ d9f5b1c6-5386-495a-88f9-9ad6b41ac9b3_6Q7VD-NX8JD-WJ2VH-88V73-4G%f%BJ7__15_WordVo 67c0fc0c-deba-401b-bf8b-9c8ad8395804_GNH9Y-D2J4T-FJHGG-QRVH7-QP%f%FDW__16_AccessVolume_-AccessRetail- c3e65d36-141f-4d2f-a303-a842ee756a29_9C2PK-NWTVB-JMPW8-BFT28-7F%f%TBF__16_ExcelVolume_-ExcelRetail- e914ea6e-a5fa-4439-a394-a9bb3293ca09_DMTCJ-KNRKX-26982-JYCKT-P7%f%KB6__16_MondoRetail -9caabccb-61b1-4b4b-8bec-d10a3c3ac2ce_HFTND-W9MK4-8B7MJ-B6C4G-XQ%f%BR2__16_MondoVolume_-O365BusinessRetail-O365EduCloudRetail-O365HomePremRetail-O365ProPlusRetail-O365SmallBusPremRetail- +9caabccb-61b1-4b4b-8bec-d10a3c3ac2ce_HFTND-W9MK4-8B7MJ-B6C4G-XQ%f%BR2__16_MondoVolume_-O365AppsBasicRetail-O365BusinessRetail-O365EduCloudRetail-O365HomePremRetail-O365ProPlusRetail-O365SmallBusPremRetail- 436366de-5579-4f24-96db-3893e4400030_XYNTG-R96FY-369HX-YFPHY-F9%f%CPM__16_OneNoteFreeRetail_[Bypass] d8cace59-33d2-4ac7-9b1b-9b72339c51c8_DR92N-9HTF2-97XKM-XW2WJ-XW%f%3J6__16_OneNoteVolume_-OneNoteRetail-OneNote2021Retail- ec9d9265-9d1e-4ed0-838a-cdc20f2551a1_R69KK-NTPKF-7M3Q4-QYBHW-6M%f%T9B__16_OutlookVolume_-OutlookRetail- diff --git a/MAS/Separate-Files-Version/Activators/Online_KMS_Activation.cmd b/MAS/Separate-Files-Version/Activators/Online_KMS_Activation.cmd index 07c41ad..d15779f 100644 --- a/MAS/Separate-Files-Version/Activators/Online_KMS_Activation.cmd +++ b/MAS/Separate-Files-Version/Activators/Online_KMS_Activation.cmd @@ -3807,7 +3807,7 @@ d9f5b1c6-5386-495a-88f9-9ad6b41ac9b3_6Q7VD-NX8JD-WJ2VH-88V73-4G%f%BJ7__15_WordVo 67c0fc0c-deba-401b-bf8b-9c8ad8395804_GNH9Y-D2J4T-FJHGG-QRVH7-QP%f%FDW__16_AccessVolume_-AccessRetail- c3e65d36-141f-4d2f-a303-a842ee756a29_9C2PK-NWTVB-JMPW8-BFT28-7F%f%TBF__16_ExcelVolume_-ExcelRetail- e914ea6e-a5fa-4439-a394-a9bb3293ca09_DMTCJ-KNRKX-26982-JYCKT-P7%f%KB6__16_MondoRetail -9caabccb-61b1-4b4b-8bec-d10a3c3ac2ce_HFTND-W9MK4-8B7MJ-B6C4G-XQ%f%BR2__16_MondoVolume_-O365BusinessRetail-O365EduCloudRetail-O365HomePremRetail-O365ProPlusRetail-O365SmallBusPremRetail- +9caabccb-61b1-4b4b-8bec-d10a3c3ac2ce_HFTND-W9MK4-8B7MJ-B6C4G-XQ%f%BR2__16_MondoVolume_-O365AppsBasicRetail-O365BusinessRetail-O365EduCloudRetail-O365HomePremRetail-O365ProPlusRetail-O365SmallBusPremRetail- 436366de-5579-4f24-96db-3893e4400030_XYNTG-R96FY-369HX-YFPHY-F9%f%CPM__16_OneNoteFreeRetail_[Bypass] d8cace59-33d2-4ac7-9b1b-9b72339c51c8_DR92N-9HTF2-97XKM-XW2WJ-XW%f%3J6__16_OneNoteVolume_-OneNoteRetail-OneNote2021Retail- ec9d9265-9d1e-4ed0-838a-cdc20f2551a1_R69KK-NTPKF-7M3Q4-QYBHW-6M%f%T9B__16_OutlookVolume_-OutlookRetail- From b3aaff5110772927d0c4b6bdcb486d45b730a3aa Mon Sep 17 00:00:00 2001 From: WindowsAddict Date: Tue, 6 May 2025 17:14:27 +0530 Subject: [PATCH 39/79] Update Windows 7 ESU 4-6y info --- MAS/All-In-One-Version-KL/MAS_AIO.cmd | 3 ++- MAS/Separate-Files-Version/Activators/TSforge_Activation.cmd | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/MAS/All-In-One-Version-KL/MAS_AIO.cmd b/MAS/All-In-One-Version-KL/MAS_AIO.cmd index a450c44..daccd34 100644 --- a/MAS/All-In-One-Version-KL/MAS_AIO.cmd +++ b/MAS/All-In-One-Version-KL/MAS_AIO.cmd @@ -4514,7 +4514,8 @@ goto :ts_off if defined esuexistsup ( echo "%tsids%" | find /i "4220f546-f522-46df-8202-4d07afd26454" %nul1% && ( echo "%tsids%" | find /i "7e94be23-b161-4956-a682-146ab291774c" %nul1% || ( -call :dk_color %Gray% "Now update Windows to get Client-ESU-Year6[4-6y] license and activate that using this script." +call :dk_color %Gray% "To get Client-ESU-Year6[4-6y] license, install updates from the below URL." +call :dk_color %Blue% "%mas%tsforge#windows-esu" ) ) goto :ts_off diff --git a/MAS/Separate-Files-Version/Activators/TSforge_Activation.cmd b/MAS/Separate-Files-Version/Activators/TSforge_Activation.cmd index 13e9eb0..732ac71 100644 --- a/MAS/Separate-Files-Version/Activators/TSforge_Activation.cmd +++ b/MAS/Separate-Files-Version/Activators/TSforge_Activation.cmd @@ -902,7 +902,8 @@ goto :ts_off if defined esuexistsup ( echo "%tsids%" | find /i "4220f546-f522-46df-8202-4d07afd26454" %nul1% && ( echo "%tsids%" | find /i "7e94be23-b161-4956-a682-146ab291774c" %nul1% || ( -call :dk_color %Gray% "Now update Windows to get Client-ESU-Year6[4-6y] license and activate that using this script." +call :dk_color %Gray% "To get Client-ESU-Year6[4-6y] license, install updates from the below URL." +call :dk_color %Blue% "%mas%tsforge#windows-esu" ) ) goto :ts_off From 2a806c2e0cb64cd600476261963b8b7a0f59951c Mon Sep 17 00:00:00 2001 From: WindowsAddict Date: Tue, 6 May 2025 17:39:26 +0530 Subject: [PATCH 40/79] Fix ARM32 Office detection --- MAS/All-In-One-Version-KL/MAS_AIO.cmd | 40 +++++++++---------- .../Activators/Ohook_Activation_AIO.cmd | 12 +++--- .../Activators/Online_KMS_Activation.cmd | 12 +++--- .../Activators/TSforge_Activation.cmd | 12 +++--- MAS/Separate-Files-Version/Troubleshoot.cmd | 12 +++--- 5 files changed, 44 insertions(+), 44 deletions(-) diff --git a/MAS/All-In-One-Version-KL/MAS_AIO.cmd b/MAS/All-In-One-Version-KL/MAS_AIO.cmd index daccd34..2bfd051 100644 --- a/MAS/All-In-One-Version-KL/MAS_AIO.cmd +++ b/MAS/All-In-One-Version-KL/MAS_AIO.cmd @@ -2296,8 +2296,8 @@ set o16uwp= set _68=HKLM\SOFTWARE\Microsoft\Office set _86=HKLM\SOFTWARE\Wow6432Node\Microsoft\Office -for /f "skip=2 tokens=2*" %%a in ('"reg query %_86%\14.0\Common\InstallRoot /v Path" %nul6%') do if exist "%%b\EntityPicker.dll" (set o14msi=Office 2010 MSI ) -for /f "skip=2 tokens=2*" %%a in ('"reg query %_68%\14.0\Common\InstallRoot /v Path" %nul6%') do if exist "%%b\EntityPicker.dll" (set o14msi=Office 2010 MSI ) +for /f "skip=2 tokens=2*" %%a in ('"reg query %_86%\14.0\Common\InstallRoot /v Path" %nul6%') do if exist "%%b\*Picker.dll" (set o14msi=Office 2010 MSI ) +for /f "skip=2 tokens=2*" %%a in ('"reg query %_68%\14.0\Common\InstallRoot /v Path" %nul6%') do if exist "%%b\*Picker.dll" (set o14msi=Office 2010 MSI ) %nul% reg query %_68%\14.0\CVH /f Click2run /k && set o14c2r=Office 2010 C2R %nul% reg query %_86%\14.0\CVH /f Click2run /k && set o14c2r=Office 2010 C2R @@ -2730,12 +2730,12 @@ for /f "skip=2 tokens=2*" %%a in ('"reg query %_68%\ClickToRun /v InstallPath" % for /f "skip=2 tokens=2*" %%a in ('"reg query %_86%\15.0\ClickToRun /v InstallPath" %nul6%') do if exist "%%b\root\Licenses\ProPlus*.xrm-ms" (set o15c2r=1&set o15c2r_reg=%_86%\15.0\ClickToRun) for /f "skip=2 tokens=2*" %%a in ('"reg query %_68%\15.0\ClickToRun /v InstallPath" %nul6%') do if exist "%%b\root\Licenses\ProPlus*.xrm-ms" (set o15c2r=1&set o15c2r_reg=%_68%\15.0\ClickToRun) -for /f "skip=2 tokens=2*" %%a in ('"reg query %_86%\16.0\Common\InstallRoot /v Path" %nul6%') do if exist "%%b\EntityPicker.dll" (set o16msi=1&set o16msi_reg=%_86%\16.0) -for /f "skip=2 tokens=2*" %%a in ('"reg query %_68%\16.0\Common\InstallRoot /v Path" %nul6%') do if exist "%%b\EntityPicker.dll" (set o16msi=1&set o16msi_reg=%_68%\16.0) -for /f "skip=2 tokens=2*" %%a in ('"reg query %_86%\15.0\Common\InstallRoot /v Path" %nul6%') do if exist "%%b\EntityPicker.dll" (set o15msi=1&set o15msi_reg=%_86%\15.0) -for /f "skip=2 tokens=2*" %%a in ('"reg query %_68%\15.0\Common\InstallRoot /v Path" %nul6%') do if exist "%%b\EntityPicker.dll" (set o15msi=1&set o15msi_reg=%_68%\15.0) -for /f "skip=2 tokens=2*" %%a in ('"reg query %_86%\14.0\Common\InstallRoot /v Path" %nul6%') do if exist "%%b\EntityPicker.dll" (set o14msi=1&set o14msi_reg=%_86%\14.0) -for /f "skip=2 tokens=2*" %%a in ('"reg query %_68%\14.0\Common\InstallRoot /v Path" %nul6%') do if exist "%%b\EntityPicker.dll" (set o14msi=1&set o14msi_reg=%_68%\14.0) +for /f "skip=2 tokens=2*" %%a in ('"reg query %_86%\16.0\Common\InstallRoot /v Path" %nul6%') do if exist "%%b\*Picker.dll" (set o16msi=1&set o16msi_reg=%_86%\16.0) +for /f "skip=2 tokens=2*" %%a in ('"reg query %_68%\16.0\Common\InstallRoot /v Path" %nul6%') do if exist "%%b\*Picker.dll" (set o16msi=1&set o16msi_reg=%_68%\16.0) +for /f "skip=2 tokens=2*" %%a in ('"reg query %_86%\15.0\Common\InstallRoot /v Path" %nul6%') do if exist "%%b\*Picker.dll" (set o15msi=1&set o15msi_reg=%_86%\15.0) +for /f "skip=2 tokens=2*" %%a in ('"reg query %_68%\15.0\Common\InstallRoot /v Path" %nul6%') do if exist "%%b\*Picker.dll" (set o15msi=1&set o15msi_reg=%_68%\15.0) +for /f "skip=2 tokens=2*" %%a in ('"reg query %_86%\14.0\Common\InstallRoot /v Path" %nul6%') do if exist "%%b\*Picker.dll" (set o14msi=1&set o14msi_reg=%_86%\14.0) +for /f "skip=2 tokens=2*" %%a in ('"reg query %_68%\14.0\Common\InstallRoot /v Path" %nul6%') do if exist "%%b\*Picker.dll" (set o14msi=1&set o14msi_reg=%_68%\14.0) exit /b @@ -4590,8 +4590,8 @@ set o14c2r= set _68=HKLM\SOFTWARE\Microsoft\Office set _86=HKLM\SOFTWARE\Wow6432Node\Microsoft\Office -for /f "skip=2 tokens=2*" %%a in ('"reg query %_86%\14.0\Common\InstallRoot /v Path" %nul6%') do if exist "%%b\EntityPicker.dll" (set o14msi=Office 2010 MSI ) -for /f "skip=2 tokens=2*" %%a in ('"reg query %_68%\14.0\Common\InstallRoot /v Path" %nul6%') do if exist "%%b\EntityPicker.dll" (set o14msi=Office 2010 MSI ) +for /f "skip=2 tokens=2*" %%a in ('"reg query %_86%\14.0\Common\InstallRoot /v Path" %nul6%') do if exist "%%b\*Picker.dll" (set o14msi=Office 2010 MSI ) +for /f "skip=2 tokens=2*" %%a in ('"reg query %_68%\14.0\Common\InstallRoot /v Path" %nul6%') do if exist "%%b\*Picker.dll" (set o14msi=Office 2010 MSI ) %nul% reg query %_68%\14.0\CVH /f Click2run /k && set o14c2r=Office 2010 C2R %nul% reg query %_86%\14.0\CVH /f Click2run /k && set o14c2r=Office 2010 C2R @@ -5305,10 +5305,10 @@ for /f "skip=2 tokens=2*" %%a in ('"reg query %_68%\ClickToRun /v InstallPath" % for /f "skip=2 tokens=2*" %%a in ('"reg query %_86%\15.0\ClickToRun /v InstallPath" %nul6%') do if exist "%%b\root\Licenses\ProPlus*.xrm-ms" (set o15c2r=1&set o15c2r_reg=%_86%\15.0\ClickToRun) for /f "skip=2 tokens=2*" %%a in ('"reg query %_68%\15.0\ClickToRun /v InstallPath" %nul6%') do if exist "%%b\root\Licenses\ProPlus*.xrm-ms" (set o15c2r=1&set o15c2r_reg=%_68%\15.0\ClickToRun) -for /f "skip=2 tokens=2*" %%a in ('"reg query %_86%\16.0\Common\InstallRoot /v Path" %nul6%') do if exist "%%b\EntityPicker.dll" (set o16msi=1&set o16msi_reg=%_86%\16.0) -for /f "skip=2 tokens=2*" %%a in ('"reg query %_68%\16.0\Common\InstallRoot /v Path" %nul6%') do if exist "%%b\EntityPicker.dll" (set o16msi=1&set o16msi_reg=%_68%\16.0) -for /f "skip=2 tokens=2*" %%a in ('"reg query %_86%\15.0\Common\InstallRoot /v Path" %nul6%') do if exist "%%b\EntityPicker.dll" (set o15msi=1&set o15msi_reg=%_86%\15.0) -for /f "skip=2 tokens=2*" %%a in ('"reg query %_68%\15.0\Common\InstallRoot /v Path" %nul6%') do if exist "%%b\EntityPicker.dll" (set o15msi=1&set o15msi_reg=%_68%\15.0) +for /f "skip=2 tokens=2*" %%a in ('"reg query %_86%\16.0\Common\InstallRoot /v Path" %nul6%') do if exist "%%b\*Picker.dll" (set o16msi=1&set o16msi_reg=%_86%\16.0) +for /f "skip=2 tokens=2*" %%a in ('"reg query %_68%\16.0\Common\InstallRoot /v Path" %nul6%') do if exist "%%b\*Picker.dll" (set o16msi=1&set o16msi_reg=%_68%\16.0) +for /f "skip=2 tokens=2*" %%a in ('"reg query %_86%\15.0\Common\InstallRoot /v Path" %nul6%') do if exist "%%b\*Picker.dll" (set o15msi=1&set o15msi_reg=%_86%\15.0) +for /f "skip=2 tokens=2*" %%a in ('"reg query %_68%\15.0\Common\InstallRoot /v Path" %nul6%') do if exist "%%b\*Picker.dll" (set o15msi=1&set o15msi_reg=%_68%\15.0) exit /b @@ -16026,12 +16026,12 @@ set _86=HKLM\SOFTWARE\Wow6432Node\Microsoft\Office reg query %_68%\14.0\CVH /f Click2run /k %nul% && (set "c2r14_68=Office 14.0 C2R x86/x64" & set "c2r14repair68=") reg query %_86%\14.0\CVH /f Click2run /k %nul% && (set "c2r14_86=Office 14.0 C2R x86" & set "c2r14repair86=") -for /f "skip=2 tokens=2*" %%a in ('"reg query %_86%\14.0\Common\InstallRoot /v Path" %nul6%') do if exist "%%b\EntityPicker.dll" (set "msi14_86=Office 14.0 MSI x86" & call :getrepairsetup msi14repair86 14) -for /f "skip=2 tokens=2*" %%a in ('"reg query %_68%\14.0\Common\InstallRoot /v Path" %nul6%') do if exist "%%b\EntityPicker.dll" (set "msi14_68=Office 14.0 MSI x86/x64" & call :getrepairsetup msi14repair68 14) -for /f "skip=2 tokens=2*" %%a in ('"reg query %_86%\15.0\Common\InstallRoot /v Path" %nul6%') do if exist "%%b\EntityPicker.dll" (set "msi15_86=Office 15.0 MSI x86" & call :getrepairsetup msi15repair86 15) -for /f "skip=2 tokens=2*" %%a in ('"reg query %_68%\15.0\Common\InstallRoot /v Path" %nul6%') do if exist "%%b\EntityPicker.dll" (set "msi15_68=Office 15.0 MSI x86/x64" & call :getrepairsetup msi15repair68 15) -for /f "skip=2 tokens=2*" %%a in ('"reg query %_86%\16.0\Common\InstallRoot /v Path" %nul6%') do if exist "%%b\EntityPicker.dll" (set "msi16_86=Office 16.0 MSI x86" & call :getrepairsetup msi16repair86 16) -for /f "skip=2 tokens=2*" %%a in ('"reg query %_68%\16.0\Common\InstallRoot /v Path" %nul6%') do if exist "%%b\EntityPicker.dll" (set "msi16_68=Office 16.0 MSI x86/x64" & call :getrepairsetup msi16repair68 16) +for /f "skip=2 tokens=2*" %%a in ('"reg query %_86%\14.0\Common\InstallRoot /v Path" %nul6%') do if exist "%%b\*Picker.dll" (set "msi14_86=Office 14.0 MSI x86" & call :getrepairsetup msi14repair86 14) +for /f "skip=2 tokens=2*" %%a in ('"reg query %_68%\14.0\Common\InstallRoot /v Path" %nul6%') do if exist "%%b\*Picker.dll" (set "msi14_68=Office 14.0 MSI x86/x64" & call :getrepairsetup msi14repair68 14) +for /f "skip=2 tokens=2*" %%a in ('"reg query %_86%\15.0\Common\InstallRoot /v Path" %nul6%') do if exist "%%b\*Picker.dll" (set "msi15_86=Office 15.0 MSI x86" & call :getrepairsetup msi15repair86 15) +for /f "skip=2 tokens=2*" %%a in ('"reg query %_68%\15.0\Common\InstallRoot /v Path" %nul6%') do if exist "%%b\*Picker.dll" (set "msi15_68=Office 15.0 MSI x86/x64" & call :getrepairsetup msi15repair68 15) +for /f "skip=2 tokens=2*" %%a in ('"reg query %_86%\16.0\Common\InstallRoot /v Path" %nul6%') do if exist "%%b\*Picker.dll" (set "msi16_86=Office 16.0 MSI x86" & call :getrepairsetup msi16repair86 16) +for /f "skip=2 tokens=2*" %%a in ('"reg query %_68%\16.0\Common\InstallRoot /v Path" %nul6%') do if exist "%%b\*Picker.dll" (set "msi16_68=Office 16.0 MSI x86/x64" & call :getrepairsetup msi16repair68 16) for /f "skip=2 tokens=2*" %%a in ('"reg query %_86%\15.0\ClickToRun /v InstallPath" %nul6%') do if exist "%%b\root\Licenses\ProPlus*.xrm-ms" (set "c2r15_86=Office 15.0 C2R x86" & call :getc2rrepair c2r15repair86 integratedoffice.exe) for /f "skip=2 tokens=2*" %%a in ('"reg query %_68%\15.0\ClickToRun /v InstallPath" %nul6%') do if exist "%%b\root\Licenses\ProPlus*.xrm-ms" (set "c2r15_68=Office 15.0 C2R x86/x64" & call :getc2rrepair c2r15repair68 integratedoffice.exe) diff --git a/MAS/Separate-Files-Version/Activators/Ohook_Activation_AIO.cmd b/MAS/Separate-Files-Version/Activators/Ohook_Activation_AIO.cmd index ae020f8..c76640c 100644 --- a/MAS/Separate-Files-Version/Activators/Ohook_Activation_AIO.cmd +++ b/MAS/Separate-Files-Version/Activators/Ohook_Activation_AIO.cmd @@ -907,12 +907,12 @@ for /f "skip=2 tokens=2*" %%a in ('"reg query %_68%\ClickToRun /v InstallPath" % for /f "skip=2 tokens=2*" %%a in ('"reg query %_86%\15.0\ClickToRun /v InstallPath" %nul6%') do if exist "%%b\root\Licenses\ProPlus*.xrm-ms" (set o15c2r=1&set o15c2r_reg=%_86%\15.0\ClickToRun) for /f "skip=2 tokens=2*" %%a in ('"reg query %_68%\15.0\ClickToRun /v InstallPath" %nul6%') do if exist "%%b\root\Licenses\ProPlus*.xrm-ms" (set o15c2r=1&set o15c2r_reg=%_68%\15.0\ClickToRun) -for /f "skip=2 tokens=2*" %%a in ('"reg query %_86%\16.0\Common\InstallRoot /v Path" %nul6%') do if exist "%%b\EntityPicker.dll" (set o16msi=1&set o16msi_reg=%_86%\16.0) -for /f "skip=2 tokens=2*" %%a in ('"reg query %_68%\16.0\Common\InstallRoot /v Path" %nul6%') do if exist "%%b\EntityPicker.dll" (set o16msi=1&set o16msi_reg=%_68%\16.0) -for /f "skip=2 tokens=2*" %%a in ('"reg query %_86%\15.0\Common\InstallRoot /v Path" %nul6%') do if exist "%%b\EntityPicker.dll" (set o15msi=1&set o15msi_reg=%_86%\15.0) -for /f "skip=2 tokens=2*" %%a in ('"reg query %_68%\15.0\Common\InstallRoot /v Path" %nul6%') do if exist "%%b\EntityPicker.dll" (set o15msi=1&set o15msi_reg=%_68%\15.0) -for /f "skip=2 tokens=2*" %%a in ('"reg query %_86%\14.0\Common\InstallRoot /v Path" %nul6%') do if exist "%%b\EntityPicker.dll" (set o14msi=1&set o14msi_reg=%_86%\14.0) -for /f "skip=2 tokens=2*" %%a in ('"reg query %_68%\14.0\Common\InstallRoot /v Path" %nul6%') do if exist "%%b\EntityPicker.dll" (set o14msi=1&set o14msi_reg=%_68%\14.0) +for /f "skip=2 tokens=2*" %%a in ('"reg query %_86%\16.0\Common\InstallRoot /v Path" %nul6%') do if exist "%%b\*Picker.dll" (set o16msi=1&set o16msi_reg=%_86%\16.0) +for /f "skip=2 tokens=2*" %%a in ('"reg query %_68%\16.0\Common\InstallRoot /v Path" %nul6%') do if exist "%%b\*Picker.dll" (set o16msi=1&set o16msi_reg=%_68%\16.0) +for /f "skip=2 tokens=2*" %%a in ('"reg query %_86%\15.0\Common\InstallRoot /v Path" %nul6%') do if exist "%%b\*Picker.dll" (set o15msi=1&set o15msi_reg=%_86%\15.0) +for /f "skip=2 tokens=2*" %%a in ('"reg query %_68%\15.0\Common\InstallRoot /v Path" %nul6%') do if exist "%%b\*Picker.dll" (set o15msi=1&set o15msi_reg=%_68%\15.0) +for /f "skip=2 tokens=2*" %%a in ('"reg query %_86%\14.0\Common\InstallRoot /v Path" %nul6%') do if exist "%%b\*Picker.dll" (set o14msi=1&set o14msi_reg=%_86%\14.0) +for /f "skip=2 tokens=2*" %%a in ('"reg query %_68%\14.0\Common\InstallRoot /v Path" %nul6%') do if exist "%%b\*Picker.dll" (set o14msi=1&set o14msi_reg=%_68%\14.0) exit /b diff --git a/MAS/Separate-Files-Version/Activators/Online_KMS_Activation.cmd b/MAS/Separate-Files-Version/Activators/Online_KMS_Activation.cmd index d15779f..1eb8924 100644 --- a/MAS/Separate-Files-Version/Activators/Online_KMS_Activation.cmd +++ b/MAS/Separate-Files-Version/Activators/Online_KMS_Activation.cmd @@ -1073,12 +1073,12 @@ for /f "skip=2 tokens=2*" %%a in ('"reg query %_68%\ClickToRun /v InstallPath" % for /f "skip=2 tokens=2*" %%a in ('"reg query %_86%\15.0\ClickToRun /v InstallPath" %nul6%') do if exist "%%b\root\Licenses\ProPlus*.xrm-ms" (set o15c2r=1&set o15c2r_reg=%_86%\15.0\ClickToRun) for /f "skip=2 tokens=2*" %%a in ('"reg query %_68%\15.0\ClickToRun /v InstallPath" %nul6%') do if exist "%%b\root\Licenses\ProPlus*.xrm-ms" (set o15c2r=1&set o15c2r_reg=%_68%\15.0\ClickToRun) -for /f "skip=2 tokens=2*" %%a in ('"reg query %_86%\16.0\Common\InstallRoot /v Path" %nul6%') do if exist "%%b\EntityPicker.dll" (set o16msi=1&set o16msi_reg=%_86%\16.0) -for /f "skip=2 tokens=2*" %%a in ('"reg query %_68%\16.0\Common\InstallRoot /v Path" %nul6%') do if exist "%%b\EntityPicker.dll" (set o16msi=1&set o16msi_reg=%_68%\16.0) -for /f "skip=2 tokens=2*" %%a in ('"reg query %_86%\15.0\Common\InstallRoot /v Path" %nul6%') do if exist "%%b\EntityPicker.dll" (set o15msi=1&set o15msi_reg=%_86%\15.0) -for /f "skip=2 tokens=2*" %%a in ('"reg query %_68%\15.0\Common\InstallRoot /v Path" %nul6%') do if exist "%%b\EntityPicker.dll" (set o15msi=1&set o15msi_reg=%_68%\15.0) -for /f "skip=2 tokens=2*" %%a in ('"reg query %_86%\14.0\Common\InstallRoot /v Path" %nul6%') do if exist "%%b\EntityPicker.dll" (set o14msi=1&set o14msi_reg=%_86%\14.0) -for /f "skip=2 tokens=2*" %%a in ('"reg query %_68%\14.0\Common\InstallRoot /v Path" %nul6%') do if exist "%%b\EntityPicker.dll" (set o14msi=1&set o14msi_reg=%_68%\14.0) +for /f "skip=2 tokens=2*" %%a in ('"reg query %_86%\16.0\Common\InstallRoot /v Path" %nul6%') do if exist "%%b\*Picker.dll" (set o16msi=1&set o16msi_reg=%_86%\16.0) +for /f "skip=2 tokens=2*" %%a in ('"reg query %_68%\16.0\Common\InstallRoot /v Path" %nul6%') do if exist "%%b\*Picker.dll" (set o16msi=1&set o16msi_reg=%_68%\16.0) +for /f "skip=2 tokens=2*" %%a in ('"reg query %_86%\15.0\Common\InstallRoot /v Path" %nul6%') do if exist "%%b\*Picker.dll" (set o15msi=1&set o15msi_reg=%_86%\15.0) +for /f "skip=2 tokens=2*" %%a in ('"reg query %_68%\15.0\Common\InstallRoot /v Path" %nul6%') do if exist "%%b\*Picker.dll" (set o15msi=1&set o15msi_reg=%_68%\15.0) +for /f "skip=2 tokens=2*" %%a in ('"reg query %_86%\14.0\Common\InstallRoot /v Path" %nul6%') do if exist "%%b\*Picker.dll" (set o14msi=1&set o14msi_reg=%_86%\14.0) +for /f "skip=2 tokens=2*" %%a in ('"reg query %_68%\14.0\Common\InstallRoot /v Path" %nul6%') do if exist "%%b\*Picker.dll" (set o14msi=1&set o14msi_reg=%_68%\14.0) exit /b diff --git a/MAS/Separate-Files-Version/Activators/TSforge_Activation.cmd b/MAS/Separate-Files-Version/Activators/TSforge_Activation.cmd index 732ac71..cbfaa23 100644 --- a/MAS/Separate-Files-Version/Activators/TSforge_Activation.cmd +++ b/MAS/Separate-Files-Version/Activators/TSforge_Activation.cmd @@ -978,8 +978,8 @@ set o14c2r= set _68=HKLM\SOFTWARE\Microsoft\Office set _86=HKLM\SOFTWARE\Wow6432Node\Microsoft\Office -for /f "skip=2 tokens=2*" %%a in ('"reg query %_86%\14.0\Common\InstallRoot /v Path" %nul6%') do if exist "%%b\EntityPicker.dll" (set o14msi=Office 2010 MSI ) -for /f "skip=2 tokens=2*" %%a in ('"reg query %_68%\14.0\Common\InstallRoot /v Path" %nul6%') do if exist "%%b\EntityPicker.dll" (set o14msi=Office 2010 MSI ) +for /f "skip=2 tokens=2*" %%a in ('"reg query %_86%\14.0\Common\InstallRoot /v Path" %nul6%') do if exist "%%b\*Picker.dll" (set o14msi=Office 2010 MSI ) +for /f "skip=2 tokens=2*" %%a in ('"reg query %_68%\14.0\Common\InstallRoot /v Path" %nul6%') do if exist "%%b\*Picker.dll" (set o14msi=Office 2010 MSI ) %nul% reg query %_68%\14.0\CVH /f Click2run /k && set o14c2r=Office 2010 C2R %nul% reg query %_86%\14.0\CVH /f Click2run /k && set o14c2r=Office 2010 C2R @@ -1693,10 +1693,10 @@ for /f "skip=2 tokens=2*" %%a in ('"reg query %_68%\ClickToRun /v InstallPath" % for /f "skip=2 tokens=2*" %%a in ('"reg query %_86%\15.0\ClickToRun /v InstallPath" %nul6%') do if exist "%%b\root\Licenses\ProPlus*.xrm-ms" (set o15c2r=1&set o15c2r_reg=%_86%\15.0\ClickToRun) for /f "skip=2 tokens=2*" %%a in ('"reg query %_68%\15.0\ClickToRun /v InstallPath" %nul6%') do if exist "%%b\root\Licenses\ProPlus*.xrm-ms" (set o15c2r=1&set o15c2r_reg=%_68%\15.0\ClickToRun) -for /f "skip=2 tokens=2*" %%a in ('"reg query %_86%\16.0\Common\InstallRoot /v Path" %nul6%') do if exist "%%b\EntityPicker.dll" (set o16msi=1&set o16msi_reg=%_86%\16.0) -for /f "skip=2 tokens=2*" %%a in ('"reg query %_68%\16.0\Common\InstallRoot /v Path" %nul6%') do if exist "%%b\EntityPicker.dll" (set o16msi=1&set o16msi_reg=%_68%\16.0) -for /f "skip=2 tokens=2*" %%a in ('"reg query %_86%\15.0\Common\InstallRoot /v Path" %nul6%') do if exist "%%b\EntityPicker.dll" (set o15msi=1&set o15msi_reg=%_86%\15.0) -for /f "skip=2 tokens=2*" %%a in ('"reg query %_68%\15.0\Common\InstallRoot /v Path" %nul6%') do if exist "%%b\EntityPicker.dll" (set o15msi=1&set o15msi_reg=%_68%\15.0) +for /f "skip=2 tokens=2*" %%a in ('"reg query %_86%\16.0\Common\InstallRoot /v Path" %nul6%') do if exist "%%b\*Picker.dll" (set o16msi=1&set o16msi_reg=%_86%\16.0) +for /f "skip=2 tokens=2*" %%a in ('"reg query %_68%\16.0\Common\InstallRoot /v Path" %nul6%') do if exist "%%b\*Picker.dll" (set o16msi=1&set o16msi_reg=%_68%\16.0) +for /f "skip=2 tokens=2*" %%a in ('"reg query %_86%\15.0\Common\InstallRoot /v Path" %nul6%') do if exist "%%b\*Picker.dll" (set o15msi=1&set o15msi_reg=%_86%\15.0) +for /f "skip=2 tokens=2*" %%a in ('"reg query %_68%\15.0\Common\InstallRoot /v Path" %nul6%') do if exist "%%b\*Picker.dll" (set o15msi=1&set o15msi_reg=%_68%\15.0) exit /b diff --git a/MAS/Separate-Files-Version/Troubleshoot.cmd b/MAS/Separate-Files-Version/Troubleshoot.cmd index bc4d49d..9106452 100644 --- a/MAS/Separate-Files-Version/Troubleshoot.cmd +++ b/MAS/Separate-Files-Version/Troubleshoot.cmd @@ -874,12 +874,12 @@ set _86=HKLM\SOFTWARE\Wow6432Node\Microsoft\Office reg query %_68%\14.0\CVH /f Click2run /k %nul% && (set "c2r14_68=Office 14.0 C2R x86/x64" & set "c2r14repair68=") reg query %_86%\14.0\CVH /f Click2run /k %nul% && (set "c2r14_86=Office 14.0 C2R x86" & set "c2r14repair86=") -for /f "skip=2 tokens=2*" %%a in ('"reg query %_86%\14.0\Common\InstallRoot /v Path" %nul6%') do if exist "%%b\EntityPicker.dll" (set "msi14_86=Office 14.0 MSI x86" & call :getrepairsetup msi14repair86 14) -for /f "skip=2 tokens=2*" %%a in ('"reg query %_68%\14.0\Common\InstallRoot /v Path" %nul6%') do if exist "%%b\EntityPicker.dll" (set "msi14_68=Office 14.0 MSI x86/x64" & call :getrepairsetup msi14repair68 14) -for /f "skip=2 tokens=2*" %%a in ('"reg query %_86%\15.0\Common\InstallRoot /v Path" %nul6%') do if exist "%%b\EntityPicker.dll" (set "msi15_86=Office 15.0 MSI x86" & call :getrepairsetup msi15repair86 15) -for /f "skip=2 tokens=2*" %%a in ('"reg query %_68%\15.0\Common\InstallRoot /v Path" %nul6%') do if exist "%%b\EntityPicker.dll" (set "msi15_68=Office 15.0 MSI x86/x64" & call :getrepairsetup msi15repair68 15) -for /f "skip=2 tokens=2*" %%a in ('"reg query %_86%\16.0\Common\InstallRoot /v Path" %nul6%') do if exist "%%b\EntityPicker.dll" (set "msi16_86=Office 16.0 MSI x86" & call :getrepairsetup msi16repair86 16) -for /f "skip=2 tokens=2*" %%a in ('"reg query %_68%\16.0\Common\InstallRoot /v Path" %nul6%') do if exist "%%b\EntityPicker.dll" (set "msi16_68=Office 16.0 MSI x86/x64" & call :getrepairsetup msi16repair68 16) +for /f "skip=2 tokens=2*" %%a in ('"reg query %_86%\14.0\Common\InstallRoot /v Path" %nul6%') do if exist "%%b\*Picker.dll" (set "msi14_86=Office 14.0 MSI x86" & call :getrepairsetup msi14repair86 14) +for /f "skip=2 tokens=2*" %%a in ('"reg query %_68%\14.0\Common\InstallRoot /v Path" %nul6%') do if exist "%%b\*Picker.dll" (set "msi14_68=Office 14.0 MSI x86/x64" & call :getrepairsetup msi14repair68 14) +for /f "skip=2 tokens=2*" %%a in ('"reg query %_86%\15.0\Common\InstallRoot /v Path" %nul6%') do if exist "%%b\*Picker.dll" (set "msi15_86=Office 15.0 MSI x86" & call :getrepairsetup msi15repair86 15) +for /f "skip=2 tokens=2*" %%a in ('"reg query %_68%\15.0\Common\InstallRoot /v Path" %nul6%') do if exist "%%b\*Picker.dll" (set "msi15_68=Office 15.0 MSI x86/x64" & call :getrepairsetup msi15repair68 15) +for /f "skip=2 tokens=2*" %%a in ('"reg query %_86%\16.0\Common\InstallRoot /v Path" %nul6%') do if exist "%%b\*Picker.dll" (set "msi16_86=Office 16.0 MSI x86" & call :getrepairsetup msi16repair86 16) +for /f "skip=2 tokens=2*" %%a in ('"reg query %_68%\16.0\Common\InstallRoot /v Path" %nul6%') do if exist "%%b\*Picker.dll" (set "msi16_68=Office 16.0 MSI x86/x64" & call :getrepairsetup msi16repair68 16) for /f "skip=2 tokens=2*" %%a in ('"reg query %_86%\15.0\ClickToRun /v InstallPath" %nul6%') do if exist "%%b\root\Licenses\ProPlus*.xrm-ms" (set "c2r15_86=Office 15.0 C2R x86" & call :getc2rrepair c2r15repair86 integratedoffice.exe) for /f "skip=2 tokens=2*" %%a in ('"reg query %_68%\15.0\ClickToRun /v InstallPath" %nul6%') do if exist "%%b\root\Licenses\ProPlus*.xrm-ms" (set "c2r15_68=Office 15.0 C2R x86/x64" & call :getc2rrepair c2r15repair68 integratedoffice.exe) From a514a99d0e0e3e8337bae572fafb32d8ebddf37c Mon Sep 17 00:00:00 2001 From: WindowsAddict Date: Tue, 6 May 2025 17:47:27 +0530 Subject: [PATCH 41/79] Update an error message in KMS script --- MAS/All-In-One-Version-KL/MAS_AIO.cmd | 2 +- MAS/Separate-Files-Version/Activators/Online_KMS_Activation.cmd | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/MAS/All-In-One-Version-KL/MAS_AIO.cmd b/MAS/All-In-One-Version-KL/MAS_AIO.cmd index 2bfd051..26b88fb 100644 --- a/MAS/All-In-One-Version-KL/MAS_AIO.cmd +++ b/MAS/All-In-One-Version-KL/MAS_AIO.cmd @@ -12471,7 +12471,7 @@ call :dk_color %Red% "Checking Product In Script [Office %oVer%.0 ! call :dk_color %Blue% "Make sure you are using Latest MAS script." ) else ( call :dk_color %Red% "Checking Product In Script [!_prod! MSI Retail is not supported]" -call :dk_color %Blue% "Use Ohook option to activate it." +call :dk_color %Blue% "Use Ohook option to activate it. To activate with %KS%, you need to install Volume version of Office." ) set fixes=%fixes% %mas%genuine-installation-media call :dk_color %_Yellow% "%mas%genuine-installation-media" diff --git a/MAS/Separate-Files-Version/Activators/Online_KMS_Activation.cmd b/MAS/Separate-Files-Version/Activators/Online_KMS_Activation.cmd index 1eb8924..d1806e3 100644 --- a/MAS/Separate-Files-Version/Activators/Online_KMS_Activation.cmd +++ b/MAS/Separate-Files-Version/Activators/Online_KMS_Activation.cmd @@ -1225,7 +1225,7 @@ call :dk_color %Red% "Checking Product In Script [Office %oVer%.0 ! call :dk_color %Blue% "Make sure you are using Latest MAS script." ) else ( call :dk_color %Red% "Checking Product In Script [!_prod! MSI Retail is not supported]" -call :dk_color %Blue% "Use Ohook option to activate it." +call :dk_color %Blue% "Use Ohook option to activate it. To activate with %KS%, you need to install Volume version of Office." ) set fixes=%fixes% %mas%genuine-installation-media call :dk_color %_Yellow% "%mas%genuine-installation-media" From 2b40259b335d6ac42f012fc368370c5e2aa032d8 Mon Sep 17 00:00:00 2001 From: WindowsAddict Date: Tue, 6 May 2025 18:09:33 +0530 Subject: [PATCH 42/79] Add fixes for CAS --- MAS/All-In-One-Version-KL/MAS_AIO.cmd | 6 +++--- MAS/Separate-Files-Version/Check_Activation_Status.cmd | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/MAS/All-In-One-Version-KL/MAS_AIO.cmd b/MAS/All-In-One-Version-KL/MAS_AIO.cmd index 26b88fb..60d09c8 100644 --- a/MAS/All-In-One-Version-KL/MAS_AIO.cmd +++ b/MAS/All-In-One-Version-KL/MAS_AIO.cmd @@ -14989,8 +14989,8 @@ function PrintLicensesInformation function vNextDiagRun { - $fNUL = ([IO.Directory]::Exists("${env:LOCALAPPDATA}\Microsoft\Office\Licenses")) -and ([IO.Directory]::GetFiles("${env:LOCALAPPDATA}\Microsoft\Office\Licenses", "*", 1).Length -GE 0) - $fDev = ([IO.Directory]::Exists("${env:PROGRAMDATA}\Microsoft\Office\Licenses")) -and ([IO.Directory]::GetFiles("${env:PROGRAMDATA}\Microsoft\Office\Licenses", "*", 1).Length -GE 0) + $fNUL = ([IO.Directory]::Exists("${env:LOCALAPPDATA}\Microsoft\Office\Licenses")) -and ([IO.Directory]::GetFiles("${env:LOCALAPPDATA}\Microsoft\Office\Licenses", "*", 1).Length -GT 0) + $fDev = ([IO.Directory]::Exists("${env:PROGRAMDATA}\Microsoft\Office\Licenses")) -and ([IO.Directory]::GetFiles("${env:PROGRAMDATA}\Microsoft\Office\Licenses", "*", 1).Length -GT 0) $rPID = $null -NE (GP "HKCU:\SOFTWARE\Microsoft\Office\16.0\Common\Licensing\LicensingNext" -EA 0 | select -Expand 'property' -EA 0 | where -Filter {$_.ToLower() -like "*retail" -or $_.ToLower() -like "*volume"}) $rSCA = $null -NE (GP "HKLM:\SOFTWARE\Microsoft\Office\ClickToRun\Configuration" -EA 0 | select -Expand "SharedComputerLicensing" -EA 0) $rSCL = $null -NE (GP "HKLM:\SOFTWARE\Microsoft\Office\16.0\Common\Licensing" -EA 0 | select -Expand "SharedComputerLicensing" -EA 0) @@ -15257,7 +15257,7 @@ function clcGetExpireSys return $null } - $rData = [DateTime]::FromFileTimeUTC($kuser).ToString('yyyy/MM/dd:HH:mm:ss') + $rData = [DateTime]::FromFileTimeUtc($kuser).ToString('yyyy/MM/dd:HH:mm:ss') return $rData } diff --git a/MAS/Separate-Files-Version/Check_Activation_Status.cmd b/MAS/Separate-Files-Version/Check_Activation_Status.cmd index 458b486..728b1a0 100644 --- a/MAS/Separate-Files-Version/Check_Activation_Status.cmd +++ b/MAS/Separate-Files-Version/Check_Activation_Status.cmd @@ -1072,8 +1072,8 @@ function PrintLicensesInformation function vNextDiagRun { - $fNUL = ([IO.Directory]::Exists("${env:LOCALAPPDATA}\Microsoft\Office\Licenses")) -and ([IO.Directory]::GetFiles("${env:LOCALAPPDATA}\Microsoft\Office\Licenses", "*", 1).Length -GE 0) - $fDev = ([IO.Directory]::Exists("${env:PROGRAMDATA}\Microsoft\Office\Licenses")) -and ([IO.Directory]::GetFiles("${env:PROGRAMDATA}\Microsoft\Office\Licenses", "*", 1).Length -GE 0) + $fNUL = ([IO.Directory]::Exists("${env:LOCALAPPDATA}\Microsoft\Office\Licenses")) -and ([IO.Directory]::GetFiles("${env:LOCALAPPDATA}\Microsoft\Office\Licenses", "*", 1).Length -GT 0) + $fDev = ([IO.Directory]::Exists("${env:PROGRAMDATA}\Microsoft\Office\Licenses")) -and ([IO.Directory]::GetFiles("${env:PROGRAMDATA}\Microsoft\Office\Licenses", "*", 1).Length -GT 0) $rPID = $null -NE (GP "HKCU:\SOFTWARE\Microsoft\Office\16.0\Common\Licensing\LicensingNext" -EA 0 | select -Expand 'property' -EA 0 | where -Filter {$_.ToLower() -like "*retail" -or $_.ToLower() -like "*volume"}) $rSCA = $null -NE (GP "HKLM:\SOFTWARE\Microsoft\Office\ClickToRun\Configuration" -EA 0 | select -Expand "SharedComputerLicensing" -EA 0) $rSCL = $null -NE (GP "HKLM:\SOFTWARE\Microsoft\Office\16.0\Common\Licensing" -EA 0 | select -Expand "SharedComputerLicensing" -EA 0) @@ -1340,7 +1340,7 @@ function clcGetExpireSys return $null } - $rData = [DateTime]::FromFileTimeUTC($kuser).ToString('yyyy/MM/dd:HH:mm:ss') + $rData = [DateTime]::FromFileTimeUtc($kuser).ToString('yyyy/MM/dd:HH:mm:ss') return $rData } From 817bfe84de80b15cc407e423872757ec0a258ec5 Mon Sep 17 00:00:00 2001 From: WindowsAddict Date: Tue, 6 May 2025 18:26:33 +0530 Subject: [PATCH 43/79] Don't ask to run SFC scan if malware is found --- MAS/All-In-One-Version-KL/MAS_AIO.cmd | 10 ++++++++++ .../Activators/HWID_Activation.cmd | 2 ++ .../Activators/KMS38_Activation.cmd | 2 ++ .../Activators/Ohook_Activation_AIO.cmd | 2 ++ .../Activators/Online_KMS_Activation.cmd | 2 ++ .../Activators/TSforge_Activation.cmd | 2 ++ 6 files changed, 20 insertions(+) diff --git a/MAS/All-In-One-Version-KL/MAS_AIO.cmd b/MAS/All-In-One-Version-KL/MAS_AIO.cmd index 60d09c8..17472aa 100644 --- a/MAS/All-In-One-Version-KL/MAS_AIO.cmd +++ b/MAS/All-In-One-Version-KL/MAS_AIO.cmd @@ -662,11 +662,13 @@ if not exist %SysPath%\%%# ( %eline% echo [%SysPath%\%%#] file is missing, aborting... echo: +if not defined results ( call :dk_color %Blue% "Go back to Main Menu, select Troubleshoot and run DISM Restore and SFC Scan options." call :dk_color %Blue% "After that, restart system and try activation again." echo: set fixes=%fixes% %mas%troubleshoot call :dk_color2 %Blue% "Check this webpage for help - " %_Yellow% " %mas%troubleshoot" +) goto dk_done ) ) @@ -2248,11 +2250,13 @@ if not exist %SysPath%\%_slexe% ( %eline% echo [%SysPath%\%_slexe%] file is missing, aborting... echo: +if not defined results ( call :dk_color %Blue% "Go back to Main Menu, select Troubleshoot and run DISM Restore and SFC Scan options." call :dk_color %Blue% "After that, restart system and try activation again." echo: set fixes=%fixes% %mas%troubleshoot call :dk_color2 %Blue% "Check this webpage for help - " %_Yellow% " %mas%troubleshoot" +) goto dk_done ) @@ -4110,11 +4114,13 @@ if not exist %SysPath%\%_slexe% ( %eline% echo [%SysPath%\%_slexe%] file is missing, aborting... echo: +if not defined results ( call :dk_color %Blue% "Go back to Main Menu, select Troubleshoot and run DISM Restore and SFC Scan options." call :dk_color %Blue% "After that, restart system and try activation again." echo: set fixes=%fixes% %mas%troubleshoot call :dk_color2 %Blue% "Check this webpage for help - " %_Yellow% " %mas%troubleshoot" +) goto dk_done ) @@ -10964,11 +10970,13 @@ if defined _fmiss ( %eline% echo [%_fmiss%] file is missing, aborting... echo: +if not defined results ( call :dk_color %Blue% "Go back to Main Menu, select Troubleshoot and run DISM Restore and SFC Scan options." call :dk_color %Blue% "After that, restart system and try activation again." echo: set fixes=%fixes% %mas%troubleshoot call :dk_color2 %Blue% "Check this webpage for help - " %_Yellow% " %mas%troubleshoot" +) goto dk_done ) @@ -11794,11 +11802,13 @@ if not exist %SysPath%\%_slexe% ( %eline% echo [%SysPath%\%_slexe%] file is missing, aborting... echo: +if not defined results ( call :dk_color %Blue% "Go back to Main Menu, select Troubleshoot and run DISM Restore and SFC Scan options." call :dk_color %Blue% "After that, restart system and try activation again." echo: set fixes=%fixes% %mas%troubleshoot call :dk_color2 %Blue% "Check this webpage for help - " %_Yellow% " %mas%troubleshoot" +) goto dk_done ) diff --git a/MAS/Separate-Files-Version/Activators/HWID_Activation.cmd b/MAS/Separate-Files-Version/Activators/HWID_Activation.cmd index 49f841e..e6d34f0 100644 --- a/MAS/Separate-Files-Version/Activators/HWID_Activation.cmd +++ b/MAS/Separate-Files-Version/Activators/HWID_Activation.cmd @@ -381,11 +381,13 @@ if not exist %SysPath%\%%# ( %eline% echo [%SysPath%\%%#] file is missing, aborting... echo: +if not defined results ( call :dk_color %Blue% "Go back to Main Menu, select Troubleshoot and run DISM Restore and SFC Scan options." call :dk_color %Blue% "After that, restart system and try activation again." echo: set fixes=%fixes% %mas%troubleshoot call :dk_color2 %Blue% "Check this webpage for help - " %_Yellow% " %mas%troubleshoot" +) goto dk_done ) ) diff --git a/MAS/Separate-Files-Version/Activators/KMS38_Activation.cmd b/MAS/Separate-Files-Version/Activators/KMS38_Activation.cmd index e4690df..c0fca72 100644 --- a/MAS/Separate-Files-Version/Activators/KMS38_Activation.cmd +++ b/MAS/Separate-Files-Version/Activators/KMS38_Activation.cmd @@ -421,11 +421,13 @@ if defined _fmiss ( %eline% echo [%_fmiss%] file is missing, aborting... echo: +if not defined results ( call :dk_color %Blue% "Go back to Main Menu, select Troubleshoot and run DISM Restore and SFC Scan options." call :dk_color %Blue% "After that, restart system and try activation again." echo: set fixes=%fixes% %mas%troubleshoot call :dk_color2 %Blue% "Check this webpage for help - " %_Yellow% " %mas%troubleshoot" +) goto dk_done ) diff --git a/MAS/Separate-Files-Version/Activators/Ohook_Activation_AIO.cmd b/MAS/Separate-Files-Version/Activators/Ohook_Activation_AIO.cmd index c76640c..786d239 100644 --- a/MAS/Separate-Files-Version/Activators/Ohook_Activation_AIO.cmd +++ b/MAS/Separate-Files-Version/Activators/Ohook_Activation_AIO.cmd @@ -427,11 +427,13 @@ if not exist %SysPath%\%_slexe% ( %eline% echo [%SysPath%\%_slexe%] file is missing, aborting... echo: +if not defined results ( call :dk_color %Blue% "Go back to Main Menu, select Troubleshoot and run DISM Restore and SFC Scan options." call :dk_color %Blue% "After that, restart system and try activation again." echo: set fixes=%fixes% %mas%troubleshoot call :dk_color2 %Blue% "Check this webpage for help - " %_Yellow% " %mas%troubleshoot" +) goto dk_done ) diff --git a/MAS/Separate-Files-Version/Activators/Online_KMS_Activation.cmd b/MAS/Separate-Files-Version/Activators/Online_KMS_Activation.cmd index d1806e3..bd6446e 100644 --- a/MAS/Separate-Files-Version/Activators/Online_KMS_Activation.cmd +++ b/MAS/Separate-Files-Version/Activators/Online_KMS_Activation.cmd @@ -489,11 +489,13 @@ if not exist %SysPath%\%_slexe% ( %eline% echo [%SysPath%\%_slexe%] file is missing, aborting... echo: +if not defined results ( call :dk_color %Blue% "Go back to Main Menu, select Troubleshoot and run DISM Restore and SFC Scan options." call :dk_color %Blue% "After that, restart system and try activation again." echo: set fixes=%fixes% %mas%troubleshoot call :dk_color2 %Blue% "Check this webpage for help - " %_Yellow% " %mas%troubleshoot" +) goto dk_done ) diff --git a/MAS/Separate-Files-Version/Activators/TSforge_Activation.cmd b/MAS/Separate-Files-Version/Activators/TSforge_Activation.cmd index cbfaa23..e85078b 100644 --- a/MAS/Separate-Files-Version/Activators/TSforge_Activation.cmd +++ b/MAS/Separate-Files-Version/Activators/TSforge_Activation.cmd @@ -498,11 +498,13 @@ if not exist %SysPath%\%_slexe% ( %eline% echo [%SysPath%\%_slexe%] file is missing, aborting... echo: +if not defined results ( call :dk_color %Blue% "Go back to Main Menu, select Troubleshoot and run DISM Restore and SFC Scan options." call :dk_color %Blue% "After that, restart system and try activation again." echo: set fixes=%fixes% %mas%troubleshoot call :dk_color2 %Blue% "Check this webpage for help - " %_Yellow% " %mas%troubleshoot" +) goto dk_done ) From d47a750badb43077fe13ee87db4464302e14712b Mon Sep 17 00:00:00 2001 From: WindowsAddict Date: Tue, 6 May 2025 19:29:19 +0530 Subject: [PATCH 44/79] Detect Powershell 1.0 on Server 2008 and ask to install Powershell 2.0 --- MAS/All-In-One-Version-KL/MAS_AIO.cmd | 34 +++---------------- .../Activators/Ohook_Activation_AIO.cmd | 8 ++--- .../Activators/Online_KMS_Activation.cmd | 8 ++--- .../Activators/TSforge_Activation.cmd | 8 ++--- .../Extract_OEM_Folder.cmd | 8 ++--- MAS/Separate-Files-Version/Troubleshoot.cmd | 8 ++--- 6 files changed, 24 insertions(+), 50 deletions(-) diff --git a/MAS/All-In-One-Version-KL/MAS_AIO.cmd b/MAS/All-In-One-Version-KL/MAS_AIO.cmd index 17472aa..bd8d6aa 100644 --- a/MAS/All-In-One-Version-KL/MAS_AIO.cmd +++ b/MAS/All-In-One-Version-KL/MAS_AIO.cmd @@ -153,15 +153,15 @@ echo Upgrade to Windows Vista SP1 or SP2. goto dk_done ) -if not exist %ps% ( +if %winbuild% LSS 7600 if not exist "%SysPath%\WindowsPowerShell\v1.0\Modules" ( %nceline% +if not exist %ps% ( echo PowerShell is not installed in your system. -if %winbuild% LSS 7600 ( -echo Install PowerShell using the following URL. +) +echo Install PowerShell 2.0 using the following URL. echo: echo https://www.catalog.update.microsoft.com/Search.aspx?q=KB968930 if %_unattended%==0 start https://www.catalog.update.microsoft.com/Search.aspx?q=KB968930 -) goto dk_done ) @@ -2168,32 +2168,6 @@ for %%A in (%_act% %_rem%) do (if "%%A"=="1" set _unattended=1) ::======================================================================================================================================== -if %winbuild% LSS 6001 ( -%nceline% -echo Unsupported OS version detected [%winbuild%]. -echo MAS only supports Windows Vista/7/8/8.1/10/11 and their Server equivalents. -if %winbuild% EQU 6000 ( -echo: -echo Windows Vista RTM is not supported because Powershell cannot be installed. -echo Upgrade to Windows Vista SP1 or SP2. -) -goto dk_done -) - -if not exist %ps% ( -%nceline% -echo PowerShell is not installed in your system. -if %winbuild% LSS 7600 ( -echo Install PowerShell using the following URL. -echo: -echo https://www.catalog.update.microsoft.com/Search.aspx?q=KB968930 -if %_unattended%==0 start https://www.catalog.update.microsoft.com/Search.aspx?q=KB968930 -) -goto dk_done -) - -::======================================================================================================================================== - if %_rem%==1 goto :oh_uninstall :oh_menu diff --git a/MAS/Separate-Files-Version/Activators/Ohook_Activation_AIO.cmd b/MAS/Separate-Files-Version/Activators/Ohook_Activation_AIO.cmd index 786d239..fd9d75c 100644 --- a/MAS/Separate-Files-Version/Activators/Ohook_Activation_AIO.cmd +++ b/MAS/Separate-Files-Version/Activators/Ohook_Activation_AIO.cmd @@ -183,15 +183,15 @@ echo Upgrade to Windows Vista SP1 or SP2. goto dk_done ) -if not exist %ps% ( +if %winbuild% LSS 7600 if not exist "%SysPath%\WindowsPowerShell\v1.0\Modules" ( %nceline% +if not exist %ps% ( echo PowerShell is not installed in your system. -if %winbuild% LSS 7600 ( -echo Install PowerShell using the following URL. +) +echo Install PowerShell 2.0 using the following URL. echo: echo https://www.catalog.update.microsoft.com/Search.aspx?q=KB968930 if %_unattended%==0 start https://www.catalog.update.microsoft.com/Search.aspx?q=KB968930 -) goto dk_done ) diff --git a/MAS/Separate-Files-Version/Activators/Online_KMS_Activation.cmd b/MAS/Separate-Files-Version/Activators/Online_KMS_Activation.cmd index bd6446e..646818b 100644 --- a/MAS/Separate-Files-Version/Activators/Online_KMS_Activation.cmd +++ b/MAS/Separate-Files-Version/Activators/Online_KMS_Activation.cmd @@ -214,15 +214,15 @@ echo Upgrade to Windows Vista SP1 or SP2. goto dk_done ) -if not exist %ps% ( +if %winbuild% LSS 7600 if not exist "%SysPath%\WindowsPowerShell\v1.0\Modules" ( %nceline% +if not exist %ps% ( echo PowerShell is not installed in your system. -if %winbuild% LSS 7600 ( -echo Install PowerShell using the following URL. +) +echo Install PowerShell 2.0 using the following URL. echo: echo https://www.catalog.update.microsoft.com/Search.aspx?q=KB968930 if %_unattended%==0 start https://www.catalog.update.microsoft.com/Search.aspx?q=KB968930 -) goto dk_done ) diff --git a/MAS/Separate-Files-Version/Activators/TSforge_Activation.cmd b/MAS/Separate-Files-Version/Activators/TSforge_Activation.cmd index e85078b..3a905c7 100644 --- a/MAS/Separate-Files-Version/Activators/TSforge_Activation.cmd +++ b/MAS/Separate-Files-Version/Activators/TSforge_Activation.cmd @@ -220,15 +220,15 @@ echo Upgrade to Windows Vista SP1 or SP2. goto dk_done ) -if not exist %ps% ( +if %winbuild% LSS 7600 if not exist "%SysPath%\WindowsPowerShell\v1.0\Modules" ( %nceline% +if not exist %ps% ( echo PowerShell is not installed in your system. -if %winbuild% LSS 7600 ( -echo Install PowerShell using the following URL. +) +echo Install PowerShell 2.0 using the following URL. echo: echo https://www.catalog.update.microsoft.com/Search.aspx?q=KB968930 if %_unattended%==0 start https://www.catalog.update.microsoft.com/Search.aspx?q=KB968930 -) goto dk_done ) diff --git a/MAS/Separate-Files-Version/Extract_OEM_Folder.cmd b/MAS/Separate-Files-Version/Extract_OEM_Folder.cmd index 7f6eb25..cd5e205 100644 --- a/MAS/Separate-Files-Version/Extract_OEM_Folder.cmd +++ b/MAS/Separate-Files-Version/Extract_OEM_Folder.cmd @@ -144,15 +144,15 @@ echo Upgrade to Windows Vista SP1 or SP2. goto done2 ) -if not exist %ps% ( +if %winbuild% LSS 7600 if not exist "%SysPath%\WindowsPowerShell\v1.0\Modules" ( %nceline% +if not exist %ps% ( echo PowerShell is not installed in your system. -if %winbuild% LSS 7600 ( -echo Install PowerShell using the following URL. +) +echo Install PowerShell 2.0 using the following URL. echo: echo https://www.catalog.update.microsoft.com/Search.aspx?q=KB968930 if %_unattended%==0 start https://www.catalog.update.microsoft.com/Search.aspx?q=KB968930 -) goto done2 ) diff --git a/MAS/Separate-Files-Version/Troubleshoot.cmd b/MAS/Separate-Files-Version/Troubleshoot.cmd index 9106452..35768a8 100644 --- a/MAS/Separate-Files-Version/Troubleshoot.cmd +++ b/MAS/Separate-Files-Version/Troubleshoot.cmd @@ -145,15 +145,15 @@ echo Upgrade to Windows Vista SP1 or SP2. goto dk_done ) -if not exist %ps% ( +if %winbuild% LSS 7600 if not exist "%SysPath%\WindowsPowerShell\v1.0\Modules" ( %nceline% +if not exist %ps% ( echo PowerShell is not installed in your system. -if %winbuild% LSS 7600 ( -echo Install PowerShell using the following URL. +) +echo Install PowerShell 2.0 using the following URL. echo: echo https://www.catalog.update.microsoft.com/Search.aspx?q=KB968930 if %_unattended%==0 start https://www.catalog.update.microsoft.com/Search.aspx?q=KB968930 -) goto dk_done ) From 93cf3864f5a73e9b8f61487eafcbac18ea1bf2b9 Mon Sep 17 00:00:00 2001 From: WindowsAddict Date: Tue, 6 May 2025 19:53:15 +0530 Subject: [PATCH 45/79] Directly go back when asked to press key to ignore opening support page --- MAS/All-In-One-Version-KL/MAS_AIO.cmd | 1 + MAS/Separate-Files-Version/Activators/HWID_Activation.cmd | 1 + MAS/Separate-Files-Version/Activators/KMS38_Activation.cmd | 1 + MAS/Separate-Files-Version/Activators/Ohook_Activation_AIO.cmd | 1 + MAS/Separate-Files-Version/Activators/Online_KMS_Activation.cmd | 1 + MAS/Separate-Files-Version/Activators/TSforge_Activation.cmd | 1 + MAS/Separate-Files-Version/Change_Office_Edition.cmd | 1 + MAS/Separate-Files-Version/Change_Windows_Edition.cmd | 1 + MAS/Separate-Files-Version/Extract_OEM_Folder.cmd | 1 + MAS/Separate-Files-Version/Troubleshoot.cmd | 1 + 10 files changed, 10 insertions(+) diff --git a/MAS/All-In-One-Version-KL/MAS_AIO.cmd b/MAS/All-In-One-Version-KL/MAS_AIO.cmd index bd8d6aa..906a9fc 100644 --- a/MAS/All-In-One-Version-KL/MAS_AIO.cmd +++ b/MAS/All-In-One-Version-KL/MAS_AIO.cmd @@ -2003,6 +2003,7 @@ if defined fixes ( call :dk_color %White% "Follow ALL the ABOVE blue lines. " call :dk_color2 %Blue% "Press [1] to Open Support Webpage " %Gray% " Press [0] to Ignore" choice /C:10 /N +if !errorlevel!==2 exit /b if !errorlevel!==1 (for %%# in (%fixes%) do (start %%#)) ) diff --git a/MAS/Separate-Files-Version/Activators/HWID_Activation.cmd b/MAS/Separate-Files-Version/Activators/HWID_Activation.cmd index e6d34f0..d68c09e 100644 --- a/MAS/Separate-Files-Version/Activators/HWID_Activation.cmd +++ b/MAS/Separate-Files-Version/Activators/HWID_Activation.cmd @@ -1706,6 +1706,7 @@ if defined fixes ( call :dk_color %White% "Follow ALL the ABOVE blue lines. " call :dk_color2 %Blue% "Press [1] to Open Support Webpage " %Gray% " Press [0] to Ignore" choice /C:10 /N +if !errorlevel!==2 exit /b if !errorlevel!==1 (for %%# in (%fixes%) do (start %%#)) ) diff --git a/MAS/Separate-Files-Version/Activators/KMS38_Activation.cmd b/MAS/Separate-Files-Version/Activators/KMS38_Activation.cmd index c0fca72..a49fe55 100644 --- a/MAS/Separate-Files-Version/Activators/KMS38_Activation.cmd +++ b/MAS/Separate-Files-Version/Activators/KMS38_Activation.cmd @@ -1849,6 +1849,7 @@ if defined fixes ( call :dk_color %White% "Follow ALL the ABOVE blue lines. " call :dk_color2 %Blue% "Press [1] to Open Support Webpage " %Gray% " Press [0] to Ignore" choice /C:10 /N +if !errorlevel!==2 exit /b if !errorlevel!==1 (for %%# in (%fixes%) do (start %%#)) ) diff --git a/MAS/Separate-Files-Version/Activators/Ohook_Activation_AIO.cmd b/MAS/Separate-Files-Version/Activators/Ohook_Activation_AIO.cmd index fd9d75c..8d18eb1 100644 --- a/MAS/Separate-Files-Version/Activators/Ohook_Activation_AIO.cmd +++ b/MAS/Separate-Files-Version/Activators/Ohook_Activation_AIO.cmd @@ -2367,6 +2367,7 @@ if defined fixes ( call :dk_color %White% "Follow ALL the ABOVE blue lines. " call :dk_color2 %Blue% "Press [1] to Open Support Webpage " %Gray% " Press [0] to Ignore" choice /C:10 /N +if !errorlevel!==2 exit /b if !errorlevel!==1 (for %%# in (%fixes%) do (start %%#)) ) diff --git a/MAS/Separate-Files-Version/Activators/Online_KMS_Activation.cmd b/MAS/Separate-Files-Version/Activators/Online_KMS_Activation.cmd index 646818b..eff4e33 100644 --- a/MAS/Separate-Files-Version/Activators/Online_KMS_Activation.cmd +++ b/MAS/Separate-Files-Version/Activators/Online_KMS_Activation.cmd @@ -3419,6 +3419,7 @@ if defined fixes ( call :dk_color %White% "Follow ALL the ABOVE blue lines. " call :dk_color2 %Blue% "Press [1] to Open Support Webpage " %Gray% " Press [0] to Ignore" choice /C:10 /N +if !errorlevel!==2 exit /b if !errorlevel!==1 (for %%# in (%fixes%) do (start %%#)) ) diff --git a/MAS/Separate-Files-Version/Activators/TSforge_Activation.cmd b/MAS/Separate-Files-Version/Activators/TSforge_Activation.cmd index 3a905c7..00c87f2 100644 --- a/MAS/Separate-Files-Version/Activators/TSforge_Activation.cmd +++ b/MAS/Separate-Files-Version/Activators/TSforge_Activation.cmd @@ -3034,6 +3034,7 @@ if defined fixes ( call :dk_color %White% "Follow ALL the ABOVE blue lines. " call :dk_color2 %Blue% "Press [1] to Open Support Webpage " %Gray% " Press [0] to Ignore" choice /C:10 /N +if !errorlevel!==2 exit /b if !errorlevel!==1 (for %%# in (%fixes%) do (start %%#)) ) diff --git a/MAS/Separate-Files-Version/Change_Office_Edition.cmd b/MAS/Separate-Files-Version/Change_Office_Edition.cmd index 951a5b9..e77887e 100644 --- a/MAS/Separate-Files-Version/Change_Office_Edition.cmd +++ b/MAS/Separate-Files-Version/Change_Office_Edition.cmd @@ -1475,6 +1475,7 @@ if defined fixes ( call :dk_color %White% "Follow ALL the ABOVE blue lines. " call :dk_color2 %Blue% "Press [1] to Open Support Webpage " %Gray% " Press [0] to Ignore" choice /C:10 /N +if !errorlevel!==2 exit /b if !errorlevel!==1 (for %%# in (%fixes%) do (start %%#)) ) diff --git a/MAS/Separate-Files-Version/Change_Windows_Edition.cmd b/MAS/Separate-Files-Version/Change_Windows_Edition.cmd index 6529adf..bcd09b1 100644 --- a/MAS/Separate-Files-Version/Change_Windows_Edition.cmd +++ b/MAS/Separate-Files-Version/Change_Windows_Edition.cmd @@ -1057,6 +1057,7 @@ if defined fixes ( call :dk_color %White% "Follow ALL the ABOVE blue lines. " call :dk_color2 %Blue% "Press [1] to Open Support Webpage " %Gray% " Press [0] to Ignore" choice /C:10 /N +if !errorlevel!==2 exit /b if !errorlevel!==1 (for %%# in (%fixes%) do (start %%#)) ) diff --git a/MAS/Separate-Files-Version/Extract_OEM_Folder.cmd b/MAS/Separate-Files-Version/Extract_OEM_Folder.cmd index cd5e205..dc10cbf 100644 --- a/MAS/Separate-Files-Version/Extract_OEM_Folder.cmd +++ b/MAS/Separate-Files-Version/Extract_OEM_Folder.cmd @@ -731,6 +731,7 @@ if defined fixes ( call :dk_color %White% "Follow ALL the ABOVE blue lines. " call :dk_color2 %Blue% "Press [1] to Open Support Webpage " %Gray% " Press [0] to Ignore" choice /C:10 /N +if !errorlevel!==2 exit /b if !errorlevel!==1 (for %%# in (%fixes%) do (start %%#)) ) diff --git a/MAS/Separate-Files-Version/Troubleshoot.cmd b/MAS/Separate-Files-Version/Troubleshoot.cmd index 35768a8..76df77f 100644 --- a/MAS/Separate-Files-Version/Troubleshoot.cmd +++ b/MAS/Separate-Files-Version/Troubleshoot.cmd @@ -1488,6 +1488,7 @@ if defined fixes ( call :dk_color %White% "Follow ALL the ABOVE blue lines. " call :dk_color2 %Blue% "Press [1] to Open Support Webpage " %Gray% " Press [0] to Ignore" choice /C:10 /N +if !errorlevel!==2 exit /b if !errorlevel!==1 (for %%# in (%fixes%) do (start %%#)) ) From be9215b7284f2666175d7a55fea45ebdfe446e93 Mon Sep 17 00:00:00 2001 From: WindowsAddict Date: Tue, 6 May 2025 20:01:06 +0530 Subject: [PATCH 46/79] Fix goback button in change Office edition script --- MAS/All-In-One-Version-KL/MAS_AIO.cmd | 1 + MAS/Separate-Files-Version/Change_Office_Edition.cmd | 1 + 2 files changed, 2 insertions(+) diff --git a/MAS/All-In-One-Version-KL/MAS_AIO.cmd b/MAS/All-In-One-Version-KL/MAS_AIO.cmd index 906a9fc..221183f 100644 --- a/MAS/All-In-One-Version-KL/MAS_AIO.cmd +++ b/MAS/All-In-One-Version-KL/MAS_AIO.cmd @@ -18242,6 +18242,7 @@ if defined fixes ( call :dk_color %White% "Follow ALL the ABOVE blue lines. " call :dk_color2 %Blue% "Press [1] to Open Support Webpage " %Gray% " Press [0] to Ignore" choice /C:10 /N +if !errorlevel!==2 goto :oemenu if !errorlevel!==1 (for %%# in (%fixes%) do (start %%#)) ) diff --git a/MAS/Separate-Files-Version/Change_Office_Edition.cmd b/MAS/Separate-Files-Version/Change_Office_Edition.cmd index e77887e..a04e7ad 100644 --- a/MAS/Separate-Files-Version/Change_Office_Edition.cmd +++ b/MAS/Separate-Files-Version/Change_Office_Edition.cmd @@ -1111,6 +1111,7 @@ if defined fixes ( call :dk_color %White% "Follow ALL the ABOVE blue lines. " call :dk_color2 %Blue% "Press [1] to Open Support Webpage " %Gray% " Press [0] to Ignore" choice /C:10 /N +if !errorlevel!==2 goto :oemenu if !errorlevel!==1 (for %%# in (%fixes%) do (start %%#)) ) From 2a2352428eb2735ceb973f1d3795948dddf71752 Mon Sep 17 00:00:00 2001 From: WindowsAddict Date: Tue, 6 May 2025 22:36:13 +0530 Subject: [PATCH 47/79] 3.2 --- MAS/All-In-One-Version-KL/MAS_AIO.cmd | 4 ++-- MAS/Separate-Files-Version/Activators/HWID_Activation.cmd | 2 +- MAS/Separate-Files-Version/Activators/KMS38_Activation.cmd | 2 +- .../Activators/Ohook_Activation_AIO.cmd | 2 +- .../Activators/Online_KMS_Activation.cmd | 2 +- MAS/Separate-Files-Version/Activators/TSforge_Activation.cmd | 2 +- MAS/Separate-Files-Version/Change_Office_Edition.cmd | 2 +- MAS/Separate-Files-Version/Change_Windows_Edition.cmd | 2 +- MAS/Separate-Files-Version/Extract_OEM_Folder.cmd | 2 +- MAS/Separate-Files-Version/Troubleshoot.cmd | 2 +- README.md | 4 ++-- 11 files changed, 13 insertions(+), 13 deletions(-) diff --git a/MAS/All-In-One-Version-KL/MAS_AIO.cmd b/MAS/All-In-One-Version-KL/MAS_AIO.cmd index 221183f..be4714c 100644 --- a/MAS/All-In-One-Version-KL/MAS_AIO.cmd +++ b/MAS/All-In-One-Version-KL/MAS_AIO.cmd @@ -1,5 +1,5 @@ -@::de62hd8-random -@set masver=3.1 +@::7f8jhe-random +@set masver=3.2 @setlocal DisableDelayedExpansion @echo off diff --git a/MAS/Separate-Files-Version/Activators/HWID_Activation.cmd b/MAS/Separate-Files-Version/Activators/HWID_Activation.cmd index d68c09e..7e5bce3 100644 --- a/MAS/Separate-Files-Version/Activators/HWID_Activation.cmd +++ b/MAS/Separate-Files-Version/Activators/HWID_Activation.cmd @@ -1,4 +1,4 @@ -@set masver=3.1 +@set masver=3.2 @echo off diff --git a/MAS/Separate-Files-Version/Activators/KMS38_Activation.cmd b/MAS/Separate-Files-Version/Activators/KMS38_Activation.cmd index a49fe55..4dbf2ca 100644 --- a/MAS/Separate-Files-Version/Activators/KMS38_Activation.cmd +++ b/MAS/Separate-Files-Version/Activators/KMS38_Activation.cmd @@ -1,4 +1,4 @@ -@set masver=3.1 +@set masver=3.2 @echo off diff --git a/MAS/Separate-Files-Version/Activators/Ohook_Activation_AIO.cmd b/MAS/Separate-Files-Version/Activators/Ohook_Activation_AIO.cmd index 8d18eb1..d9dbe1f 100644 --- a/MAS/Separate-Files-Version/Activators/Ohook_Activation_AIO.cmd +++ b/MAS/Separate-Files-Version/Activators/Ohook_Activation_AIO.cmd @@ -1,4 +1,4 @@ -@set masver=3.1 +@set masver=3.2 @echo off diff --git a/MAS/Separate-Files-Version/Activators/Online_KMS_Activation.cmd b/MAS/Separate-Files-Version/Activators/Online_KMS_Activation.cmd index eff4e33..0d0bdf8 100644 --- a/MAS/Separate-Files-Version/Activators/Online_KMS_Activation.cmd +++ b/MAS/Separate-Files-Version/Activators/Online_KMS_Activation.cmd @@ -1,4 +1,4 @@ -@set masver=3.1 +@set masver=3.2 @echo off diff --git a/MAS/Separate-Files-Version/Activators/TSforge_Activation.cmd b/MAS/Separate-Files-Version/Activators/TSforge_Activation.cmd index 00c87f2..b5bf9f5 100644 --- a/MAS/Separate-Files-Version/Activators/TSforge_Activation.cmd +++ b/MAS/Separate-Files-Version/Activators/TSforge_Activation.cmd @@ -1,4 +1,4 @@ -@set masver=3.1 +@set masver=3.2 @echo off diff --git a/MAS/Separate-Files-Version/Change_Office_Edition.cmd b/MAS/Separate-Files-Version/Change_Office_Edition.cmd index a04e7ad..6fd6571 100644 --- a/MAS/Separate-Files-Version/Change_Office_Edition.cmd +++ b/MAS/Separate-Files-Version/Change_Office_Edition.cmd @@ -1,4 +1,4 @@ -@set masver=3.1 +@set masver=3.2 @echo off diff --git a/MAS/Separate-Files-Version/Change_Windows_Edition.cmd b/MAS/Separate-Files-Version/Change_Windows_Edition.cmd index bcd09b1..e0fa600 100644 --- a/MAS/Separate-Files-Version/Change_Windows_Edition.cmd +++ b/MAS/Separate-Files-Version/Change_Windows_Edition.cmd @@ -1,4 +1,4 @@ -@set masver=3.1 +@set masver=3.2 @echo off diff --git a/MAS/Separate-Files-Version/Extract_OEM_Folder.cmd b/MAS/Separate-Files-Version/Extract_OEM_Folder.cmd index dc10cbf..a896e2b 100644 --- a/MAS/Separate-Files-Version/Extract_OEM_Folder.cmd +++ b/MAS/Separate-Files-Version/Extract_OEM_Folder.cmd @@ -1,4 +1,4 @@ -@set masver=3.1 +@set masver=3.2 @echo off diff --git a/MAS/Separate-Files-Version/Troubleshoot.cmd b/MAS/Separate-Files-Version/Troubleshoot.cmd index 76df77f..415ee1a 100644 --- a/MAS/Separate-Files-Version/Troubleshoot.cmd +++ b/MAS/Separate-Files-Version/Troubleshoot.cmd @@ -1,4 +1,4 @@ -@set masver=3.1 +@set masver=3.2 @echo off diff --git a/README.md b/README.md index b3fdf00..61accf5 100644 --- a/README.md +++ b/README.md @@ -71,8 +71,8 @@ or --- ``` -Latest Version: 3.1 -Release date: 29-Apr-2025 +Latest Version: 3.2 +Release date: 6-May-2025 ``` ### [Troubleshooting / Help](https://massgrave.dev/troubleshoot) From bf28e4fbddb9d6362ebe17f5fb890ff5a3c92d35 Mon Sep 17 00:00:00 2001 From: WindowsAddict Date: Tue, 6 May 2025 22:37:54 +0530 Subject: [PATCH 48/79] export-ignore --- .gitattributes | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.gitattributes b/.gitattributes index 8749e12..de5bd3d 100644 --- a/.gitattributes +++ b/.gitattributes @@ -1,4 +1,4 @@ -# MAS export-ignore -# LICENSE export-ignore -# README.md export-ignore +MAS export-ignore +LICENSE export-ignore +README.md export-ignore .gitattributes export-ignore From 2d00dfa704c709b78303191c4b66fe9ae533dced Mon Sep 17 00:00:00 2001 From: WindowsAddict Date: Tue, 6 May 2025 23:10:58 +0530 Subject: [PATCH 49/79] Revert export-ignore --- .gitattributes | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.gitattributes b/.gitattributes index de5bd3d..8749e12 100644 --- a/.gitattributes +++ b/.gitattributes @@ -1,4 +1,4 @@ -MAS export-ignore -LICENSE export-ignore -README.md export-ignore +# MAS export-ignore +# LICENSE export-ignore +# README.md export-ignore .gitattributes export-ignore From 4c53e6231baeeb9985a7721a54c32e6fed854ce8 Mon Sep 17 00:00:00 2001 From: WindowsAddict Date: Thu, 8 May 2025 05:31:04 +0530 Subject: [PATCH 50/79] Fix Microsoft links --- MAS/All-In-One-Version-KL/MAS_AIO.cmd | 26 +++++++++---------- .../Activators/HWID_Activation.cmd | 4 +-- .../Activators/KMS38_Activation.cmd | 4 +-- .../Activators/Ohook_Activation_AIO.cmd | 10 +++---- .../Activators/Online_KMS_Activation.cmd | 14 +++++----- .../Activators/TSforge_Activation.cmd | 14 +++++----- .../Change_Office_Edition.cmd | 2 +- MAS/Separate-Files-Version/Troubleshoot.cmd | 6 ++--- 8 files changed, 40 insertions(+), 40 deletions(-) diff --git a/MAS/All-In-One-Version-KL/MAS_AIO.cmd b/MAS/All-In-One-Version-KL/MAS_AIO.cmd index be4714c..c824895 100644 --- a/MAS/All-In-One-Version-KL/MAS_AIO.cmd +++ b/MAS/All-In-One-Version-KL/MAS_AIO.cmd @@ -1607,7 +1607,7 @@ call :dk_color2 %Red% "Checking Boot Mode [%safeboot_option ) -:: https://learn.microsoft.com/windows-hardware/manufacture/desktop/windows-setup-states +:: https://learn.microsoft.com/en-us/windows-hardware/manufacture/desktop/windows-setup-states for /f "skip=2 tokens=2*" %%A in ('reg query "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Setup\State" /v ImageState') do (set imagestate=%%B) @@ -1878,7 +1878,7 @@ set "permerror=Error Found In SPP Registries" ) ) -REM https://learn.microsoft.com/office/troubleshoot/activation/license-issue-when-start-office-application +REM https://learn.microsoft.com/en-us/office/troubleshoot/activation/license-issue-when-start-office-application if not defined permerror ( reg query "HKU\S-1-5-20\Software\Microsoft\Windows NT\CurrentVersion" %nul% && ( @@ -3156,7 +3156,7 @@ exit /b :oh_clearblock :: Find remnants of Office vNext/shared/device license block and remove it because it stops other licenses from appearing -:: https://learn.microsoft.com/office/troubleshoot/activation/reset-office-365-proplus-activation-state +:: https://learn.microsoft.com/en-us/office/troubleshoot/activation/reset-office-365-proplus-activation-state set _sidlist= for /f "tokens=* delims=" %%a in ('%psc% "$p = 'HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion\ProfileList'; Get-ChildItem $p | ForEach-Object { $pi = (Get-ItemProperty """"$p\$($_.PSChildName)"""").ProfileImagePath; if ($pi -like '*\Users\*' -and (Test-Path """"$pi\NTUSER.DAT"""") -and -not ($_.PSChildName -match '\.bak$')) { Split-Path $_.PSPath -Leaf } }" %nul6%') do (if defined _sidlist (set _sidlist=!_sidlist! %%a) else (set _sidlist=%%a)) @@ -3252,12 +3252,12 @@ reg delete HKLM\SOFTWARE\Microsoft\Office\15.0\ClickToRun\Configuration /v Share ) :: Clear device-based-licensing -:: https://learn.microsoft.com/deployoffice/device-based-licensing +:: https://learn.microsoft.com/en-us/deployoffice/device-based-licensing for /f %%# in ('reg query "%o16c2r_reg%\Configuration" /f *.DeviceBasedLicensing %nul6% ^| findstr REG_') do reg delete "%o16c2r_reg%\Configuration" /v %%# /f %nul% :: Remove OEM registry key -:: https://support.microsoft.com/office/office-repeatedly-prompts-you-to-activate-on-a-new-pc-a9a6b05f-f6ce-4d1f-8d49-eb5007b64ba1 +:: https://support.microsoft.com/en-us/office/office-repeatedly-prompts-you-to-activate-on-a-new-pc-a9a6b05f-f6ce-4d1f-8d49-eb5007b64ba1 for %%# in (15 16) do ( reg delete "HKLM\SOFTWARE\Microsoft\Office\%%#.0\Common\OEM" /f %nul% @@ -4002,8 +4002,8 @@ reg query "HKLM\SOFTWARE\Microsoft\NET Framework Setup\NDP\v3.5" /v Install %nul echo .NET 3.5 Framework is not installed in your system. echo Install it using the following URL. echo: -echo https://www.microsoft.com/download/details.aspx?id=25150 -if %_unattended%==0 start https://www.microsoft.com/download/details.aspx?id=25150 +echo https://www.microsoft.com/en-us/download/details.aspx?id=25150 +if %_unattended%==0 start https://www.microsoft.com/en-us/download/details.aspx?id=25150 goto dk_done ) ) @@ -12219,7 +12219,7 @@ call :oh_licrefresh :ks_activate :: Opt out of sending KMSclient activation data to Microsoft -:: https://learn.microsoft.com/windows/privacy/manage-connections-from-windows-operating-system-components-to-microsoft-services#19-software-protection-platform +:: https://learn.microsoft.com/en-us/windows/privacy/manage-connections-from-windows-operating-system-components-to-microsoft-services#19-software-protection-platform if %winbuild% GEQ 9600 ( reg add "HKLM\SOFTWARE\Policies\Microsoft\Windows NT\CurrentVersion\Software Protection Platform" /v NoGenTicket /t REG_DWORD /d 1 /f %nul% @@ -12287,7 +12287,7 @@ echo Cleared %KS% Server from the registry. ) ) -:: https://learn.microsoft.com/azure/virtual-desktop/windows-10-multisession-faq +:: https://learn.microsoft.com/en-us/azure/virtual-desktop/windows-10-multisession-faq if %_actwin%==1 for %%# in (407) do if %osSKU%==%%# ( call :dk_color %Red% "%winos% does not support activation on non-azure platforms." @@ -15870,7 +15870,7 @@ for %%# in (SppE%w%xtComObj.exe %_slexe%) do (reg delete "HKLM\SOFTWARE\Microsof if %winbuild% LSS 9200 if not defined _vis ( REM Fix issues caused by Update KB971033 in Windows 7 -REM https://support.microsoft.com/help/4487266 +REM https://support.microsoft.com/en-us/help/4487266 echo: echo Checking Update KB971033... %psc% "if (Get-Hotfix -Id KB971033 -ErrorAction SilentlyContinue) {Exit 3}" %nul% @@ -16367,7 +16367,7 @@ set "permerror=Error Found In SPP Registries" ) ) -REM https://learn.microsoft.com/office/troubleshoot/activation/license-issue-when-start-office-application +REM https://learn.microsoft.com/en-us/office/troubleshoot/activation/license-issue-when-start-office-application if not defined permerror ( reg query "HKU\S-1-5-20\Software\Microsoft\Windows NT\CurrentVersion" %nul% && ( @@ -16413,7 +16413,7 @@ if ($env:permerror -eq 'Error Found In SPP Registries') { } # Fix perms for SPP in HKU\S-1-5-20 -# https://learn.microsoft.com/office/troubleshoot/activation/license-issue-when-start-office-application +# https://learn.microsoft.com/en-us/office/troubleshoot/activation/license-issue-when-start-office-application if ($env:permerror -ne 'Error Found In S-1-5-20 SPP') { exit @@ -18175,7 +18175,7 @@ call :dk_color %_Green% "Enter an option number using your keyboard and press En set /p inpt= if "%inpt%"=="" goto :oe_changeupdchnl if "%inpt%"=="0" goto :oemenu -if /i "%inpt%"=="R" start https://learn.microsoft.com/microsoft-365-apps/updates/overview-update-channels & goto :oe_changeupdchnl +if /i "%inpt%"=="R" start https://learn.microsoft.com/en-us/microsoft-365-apps/updates/overview-update-channels & goto :oe_changeupdchnl for /l %%i in (1,1,%counter%) do (if "%inpt%"=="%%i" set verified=1) set targetFFN=!targetFFN%inpt%! set targetchannel=!targetchannel%inpt%! diff --git a/MAS/Separate-Files-Version/Activators/HWID_Activation.cmd b/MAS/Separate-Files-Version/Activators/HWID_Activation.cmd index 7e5bce3..25c7190 100644 --- a/MAS/Separate-Files-Version/Activators/HWID_Activation.cmd +++ b/MAS/Separate-Files-Version/Activators/HWID_Activation.cmd @@ -1310,7 +1310,7 @@ call :dk_color2 %Red% "Checking Boot Mode [%safeboot_option ) -:: https://learn.microsoft.com/windows-hardware/manufacture/desktop/windows-setup-states +:: https://learn.microsoft.com/en-us/windows-hardware/manufacture/desktop/windows-setup-states for /f "skip=2 tokens=2*" %%A in ('reg query "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Setup\State" /v ImageState') do (set imagestate=%%B) @@ -1581,7 +1581,7 @@ set "permerror=Error Found In SPP Registries" ) ) -REM https://learn.microsoft.com/office/troubleshoot/activation/license-issue-when-start-office-application +REM https://learn.microsoft.com/en-us/office/troubleshoot/activation/license-issue-when-start-office-application if not defined permerror ( reg query "HKU\S-1-5-20\Software\Microsoft\Windows NT\CurrentVersion" %nul% && ( diff --git a/MAS/Separate-Files-Version/Activators/KMS38_Activation.cmd b/MAS/Separate-Files-Version/Activators/KMS38_Activation.cmd index 4dbf2ca..bf8850f 100644 --- a/MAS/Separate-Files-Version/Activators/KMS38_Activation.cmd +++ b/MAS/Separate-Files-Version/Activators/KMS38_Activation.cmd @@ -1453,7 +1453,7 @@ call :dk_color2 %Red% "Checking Boot Mode [%safeboot_option ) -:: https://learn.microsoft.com/windows-hardware/manufacture/desktop/windows-setup-states +:: https://learn.microsoft.com/en-us/windows-hardware/manufacture/desktop/windows-setup-states for /f "skip=2 tokens=2*" %%A in ('reg query "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Setup\State" /v ImageState') do (set imagestate=%%B) @@ -1724,7 +1724,7 @@ set "permerror=Error Found In SPP Registries" ) ) -REM https://learn.microsoft.com/office/troubleshoot/activation/license-issue-when-start-office-application +REM https://learn.microsoft.com/en-us/office/troubleshoot/activation/license-issue-when-start-office-application if not defined permerror ( reg query "HKU\S-1-5-20\Software\Microsoft\Windows NT\CurrentVersion" %nul% && ( diff --git a/MAS/Separate-Files-Version/Activators/Ohook_Activation_AIO.cmd b/MAS/Separate-Files-Version/Activators/Ohook_Activation_AIO.cmd index d9dbe1f..4c582c2 100644 --- a/MAS/Separate-Files-Version/Activators/Ohook_Activation_AIO.cmd +++ b/MAS/Separate-Files-Version/Activators/Ohook_Activation_AIO.cmd @@ -1356,7 +1356,7 @@ exit /b :oh_clearblock :: Find remnants of Office vNext/shared/device license block and remove it because it stops other licenses from appearing -:: https://learn.microsoft.com/office/troubleshoot/activation/reset-office-365-proplus-activation-state +:: https://learn.microsoft.com/en-us/office/troubleshoot/activation/reset-office-365-proplus-activation-state set _sidlist= for /f "tokens=* delims=" %%a in ('%psc% "$p = 'HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion\ProfileList'; Get-ChildItem $p | ForEach-Object { $pi = (Get-ItemProperty """"$p\$($_.PSChildName)"""").ProfileImagePath; if ($pi -like '*\Users\*' -and (Test-Path """"$pi\NTUSER.DAT"""") -and -not ($_.PSChildName -match '\.bak$')) { Split-Path $_.PSPath -Leaf } }" %nul6%') do (if defined _sidlist (set _sidlist=!_sidlist! %%a) else (set _sidlist=%%a)) @@ -1452,12 +1452,12 @@ reg delete HKLM\SOFTWARE\Microsoft\Office\15.0\ClickToRun\Configuration /v Share ) :: Clear device-based-licensing -:: https://learn.microsoft.com/deployoffice/device-based-licensing +:: https://learn.microsoft.com/en-us/deployoffice/device-based-licensing for /f %%# in ('reg query "%o16c2r_reg%\Configuration" /f *.DeviceBasedLicensing %nul6% ^| findstr REG_') do reg delete "%o16c2r_reg%\Configuration" /v %%# /f %nul% :: Remove OEM registry key -:: https://support.microsoft.com/office/office-repeatedly-prompts-you-to-activate-on-a-new-pc-a9a6b05f-f6ce-4d1f-8d49-eb5007b64ba1 +:: https://support.microsoft.com/en-us/office/office-repeatedly-prompts-you-to-activate-on-a-new-pc-a9a6b05f-f6ce-4d1f-8d49-eb5007b64ba1 for %%# in (15 16) do ( reg delete "HKLM\SOFTWARE\Microsoft\Office\%%#.0\Common\OEM" /f %nul% @@ -1971,7 +1971,7 @@ call :dk_color2 %Red% "Checking Boot Mode [%safeboot_option ) -:: https://learn.microsoft.com/windows-hardware/manufacture/desktop/windows-setup-states +:: https://learn.microsoft.com/en-us/windows-hardware/manufacture/desktop/windows-setup-states for /f "skip=2 tokens=2*" %%A in ('reg query "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Setup\State" /v ImageState') do (set imagestate=%%B) @@ -2242,7 +2242,7 @@ set "permerror=Error Found In SPP Registries" ) ) -REM https://learn.microsoft.com/office/troubleshoot/activation/license-issue-when-start-office-application +REM https://learn.microsoft.com/en-us/office/troubleshoot/activation/license-issue-when-start-office-application if not defined permerror ( reg query "HKU\S-1-5-20\Software\Microsoft\Windows NT\CurrentVersion" %nul% && ( diff --git a/MAS/Separate-Files-Version/Activators/Online_KMS_Activation.cmd b/MAS/Separate-Files-Version/Activators/Online_KMS_Activation.cmd index 0d0bdf8..3546ad8 100644 --- a/MAS/Separate-Files-Version/Activators/Online_KMS_Activation.cmd +++ b/MAS/Separate-Files-Version/Activators/Online_KMS_Activation.cmd @@ -931,7 +931,7 @@ call :oh_licrefresh :ks_activate :: Opt out of sending KMSclient activation data to Microsoft -:: https://learn.microsoft.com/windows/privacy/manage-connections-from-windows-operating-system-components-to-microsoft-services#19-software-protection-platform +:: https://learn.microsoft.com/en-us/windows/privacy/manage-connections-from-windows-operating-system-components-to-microsoft-services#19-software-protection-platform if %winbuild% GEQ 9600 ( reg add "HKLM\SOFTWARE\Policies\Microsoft\Windows NT\CurrentVersion\Software Protection Platform" /v NoGenTicket /t REG_DWORD /d 1 /f %nul% @@ -999,7 +999,7 @@ echo Cleared %KS% Server from the registry. ) ) -:: https://learn.microsoft.com/azure/virtual-desktop/windows-10-multisession-faq +:: https://learn.microsoft.com/en-us/azure/virtual-desktop/windows-10-multisession-faq if %_actwin%==1 for %%# in (407) do if %osSKU%==%%# ( call :dk_color %Red% "%winos% does not support activation on non-azure platforms." @@ -1330,7 +1330,7 @@ exit /b :oh_clearblock :: Find remnants of Office vNext/shared/device license block and remove it because it stops other licenses from appearing -:: https://learn.microsoft.com/office/troubleshoot/activation/reset-office-365-proplus-activation-state +:: https://learn.microsoft.com/en-us/office/troubleshoot/activation/reset-office-365-proplus-activation-state set _sidlist= for /f "tokens=* delims=" %%a in ('%psc% "$p = 'HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion\ProfileList'; Get-ChildItem $p | ForEach-Object { $pi = (Get-ItemProperty """"$p\$($_.PSChildName)"""").ProfileImagePath; if ($pi -like '*\Users\*' -and (Test-Path """"$pi\NTUSER.DAT"""") -and -not ($_.PSChildName -match '\.bak$')) { Split-Path $_.PSPath -Leaf } }" %nul6%') do (if defined _sidlist (set _sidlist=!_sidlist! %%a) else (set _sidlist=%%a)) @@ -1426,12 +1426,12 @@ reg delete HKLM\SOFTWARE\Microsoft\Office\15.0\ClickToRun\Configuration /v Share ) :: Clear device-based-licensing -:: https://learn.microsoft.com/deployoffice/device-based-licensing +:: https://learn.microsoft.com/en-us/deployoffice/device-based-licensing for /f %%# in ('reg query "%o16c2r_reg%\Configuration" /f *.DeviceBasedLicensing %nul6% ^| findstr REG_') do reg delete "%o16c2r_reg%\Configuration" /v %%# /f %nul% :: Remove OEM registry key -:: https://support.microsoft.com/office/office-repeatedly-prompts-you-to-activate-on-a-new-pc-a9a6b05f-f6ce-4d1f-8d49-eb5007b64ba1 +:: https://support.microsoft.com/en-us/office/office-repeatedly-prompts-you-to-activate-on-a-new-pc-a9a6b05f-f6ce-4d1f-8d49-eb5007b64ba1 for %%# in (15 16) do ( reg delete "HKLM\SOFTWARE\Microsoft\Office\%%#.0\Common\OEM" /f %nul% @@ -3023,7 +3023,7 @@ call :dk_color2 %Red% "Checking Boot Mode [%safeboot_option ) -:: https://learn.microsoft.com/windows-hardware/manufacture/desktop/windows-setup-states +:: https://learn.microsoft.com/en-us/windows-hardware/manufacture/desktop/windows-setup-states for /f "skip=2 tokens=2*" %%A in ('reg query "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Setup\State" /v ImageState') do (set imagestate=%%B) @@ -3294,7 +3294,7 @@ set "permerror=Error Found In SPP Registries" ) ) -REM https://learn.microsoft.com/office/troubleshoot/activation/license-issue-when-start-office-application +REM https://learn.microsoft.com/en-us/office/troubleshoot/activation/license-issue-when-start-office-application if not defined permerror ( reg query "HKU\S-1-5-20\Software\Microsoft\Windows NT\CurrentVersion" %nul% && ( diff --git a/MAS/Separate-Files-Version/Activators/TSforge_Activation.cmd b/MAS/Separate-Files-Version/Activators/TSforge_Activation.cmd index b5bf9f5..01671ab 100644 --- a/MAS/Separate-Files-Version/Activators/TSforge_Activation.cmd +++ b/MAS/Separate-Files-Version/Activators/TSforge_Activation.cmd @@ -238,8 +238,8 @@ reg query "HKLM\SOFTWARE\Microsoft\NET Framework Setup\NDP\v3.5" /v Install %nul echo .NET 3.5 Framework is not installed in your system. echo Install it using the following URL. echo: -echo https://www.microsoft.com/download/details.aspx?id=25150 -if %_unattended%==0 start https://www.microsoft.com/download/details.aspx?id=25150 +echo https://www.microsoft.com/en-us/download/details.aspx?id=25150 +if %_unattended%==0 start https://www.microsoft.com/en-us/download/details.aspx?id=25150 goto dk_done ) ) @@ -1944,7 +1944,7 @@ exit /b :oh_clearblock :: Find remnants of Office vNext/shared/device license block and remove it because it stops other licenses from appearing -:: https://learn.microsoft.com/office/troubleshoot/activation/reset-office-365-proplus-activation-state +:: https://learn.microsoft.com/en-us/office/troubleshoot/activation/reset-office-365-proplus-activation-state set _sidlist= for /f "tokens=* delims=" %%a in ('%psc% "$p = 'HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion\ProfileList'; Get-ChildItem $p | ForEach-Object { $pi = (Get-ItemProperty """"$p\$($_.PSChildName)"""").ProfileImagePath; if ($pi -like '*\Users\*' -and (Test-Path """"$pi\NTUSER.DAT"""") -and -not ($_.PSChildName -match '\.bak$')) { Split-Path $_.PSPath -Leaf } }" %nul6%') do (if defined _sidlist (set _sidlist=!_sidlist! %%a) else (set _sidlist=%%a)) @@ -2040,12 +2040,12 @@ reg delete HKLM\SOFTWARE\Microsoft\Office\15.0\ClickToRun\Configuration /v Share ) :: Clear device-based-licensing -:: https://learn.microsoft.com/deployoffice/device-based-licensing +:: https://learn.microsoft.com/en-us/deployoffice/device-based-licensing for /f %%# in ('reg query "%o16c2r_reg%\Configuration" /f *.DeviceBasedLicensing %nul6% ^| findstr REG_') do reg delete "%o16c2r_reg%\Configuration" /v %%# /f %nul% :: Remove OEM registry key -:: https://support.microsoft.com/office/office-repeatedly-prompts-you-to-activate-on-a-new-pc-a9a6b05f-f6ce-4d1f-8d49-eb5007b64ba1 +:: https://support.microsoft.com/en-us/office/office-repeatedly-prompts-you-to-activate-on-a-new-pc-a9a6b05f-f6ce-4d1f-8d49-eb5007b64ba1 for %%# in (15 16) do ( reg delete "HKLM\SOFTWARE\Microsoft\Office\%%#.0\Common\OEM" /f %nul% @@ -2638,7 +2638,7 @@ call :dk_color2 %Red% "Checking Boot Mode [%safeboot_option ) -:: https://learn.microsoft.com/windows-hardware/manufacture/desktop/windows-setup-states +:: https://learn.microsoft.com/en-us/windows-hardware/manufacture/desktop/windows-setup-states for /f "skip=2 tokens=2*" %%A in ('reg query "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Setup\State" /v ImageState') do (set imagestate=%%B) @@ -2909,7 +2909,7 @@ set "permerror=Error Found In SPP Registries" ) ) -REM https://learn.microsoft.com/office/troubleshoot/activation/license-issue-when-start-office-application +REM https://learn.microsoft.com/en-us/office/troubleshoot/activation/license-issue-when-start-office-application if not defined permerror ( reg query "HKU\S-1-5-20\Software\Microsoft\Windows NT\CurrentVersion" %nul% && ( diff --git a/MAS/Separate-Files-Version/Change_Office_Edition.cmd b/MAS/Separate-Files-Version/Change_Office_Edition.cmd index 6fd6571..835a80b 100644 --- a/MAS/Separate-Files-Version/Change_Office_Edition.cmd +++ b/MAS/Separate-Files-Version/Change_Office_Edition.cmd @@ -1044,7 +1044,7 @@ call :dk_color %_Green% "Enter an option number using your keyboard and press En set /p inpt= if "%inpt%"=="" goto :oe_changeupdchnl if "%inpt%"=="0" goto :oemenu -if /i "%inpt%"=="R" start https://learn.microsoft.com/microsoft-365-apps/updates/overview-update-channels & goto :oe_changeupdchnl +if /i "%inpt%"=="R" start https://learn.microsoft.com/en-us/microsoft-365-apps/updates/overview-update-channels & goto :oe_changeupdchnl for /l %%i in (1,1,%counter%) do (if "%inpt%"=="%%i" set verified=1) set targetFFN=!targetFFN%inpt%! set targetchannel=!targetchannel%inpt%! diff --git a/MAS/Separate-Files-Version/Troubleshoot.cmd b/MAS/Separate-Files-Version/Troubleshoot.cmd index 415ee1a..fb3a879 100644 --- a/MAS/Separate-Files-Version/Troubleshoot.cmd +++ b/MAS/Separate-Files-Version/Troubleshoot.cmd @@ -733,7 +733,7 @@ for %%# in (SppE%w%xtComObj.exe %_slexe%) do (reg delete "HKLM\SOFTWARE\Microsof if %winbuild% LSS 9200 if not defined _vis ( REM Fix issues caused by Update KB971033 in Windows 7 -REM https://support.microsoft.com/help/4487266 +REM https://support.microsoft.com/en-us/help/4487266 echo: echo Checking Update KB971033... %psc% "if (Get-Hotfix -Id KB971033 -ErrorAction SilentlyContinue) {Exit 3}" %nul% @@ -1230,7 +1230,7 @@ set "permerror=Error Found In SPP Registries" ) ) -REM https://learn.microsoft.com/office/troubleshoot/activation/license-issue-when-start-office-application +REM https://learn.microsoft.com/en-us/office/troubleshoot/activation/license-issue-when-start-office-application if not defined permerror ( reg query "HKU\S-1-5-20\Software\Microsoft\Windows NT\CurrentVersion" %nul% && ( @@ -1276,7 +1276,7 @@ if ($env:permerror -eq 'Error Found In SPP Registries') { } # Fix perms for SPP in HKU\S-1-5-20 -# https://learn.microsoft.com/office/troubleshoot/activation/license-issue-when-start-office-application +# https://learn.microsoft.com/en-us/office/troubleshoot/activation/license-issue-when-start-office-application if ($env:permerror -ne 'Error Found In S-1-5-20 SPP') { exit From 74b7c74218f8f0f4fd87b2a71b985ed604fb380e Mon Sep 17 00:00:00 2001 From: WindowsAddict Date: Sun, 18 May 2025 01:40:41 +0530 Subject: [PATCH 51/79] Continue to activate in case of errors --- MAS/All-In-One-Version-KL/MAS_AIO.cmd | 4 ++-- MAS/Separate-Files-Version/Activators/TSforge_Activation.cmd | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/MAS/All-In-One-Version-KL/MAS_AIO.cmd b/MAS/All-In-One-Version-KL/MAS_AIO.cmd index c824895..c683783 100644 --- a/MAS/All-In-One-Version-KL/MAS_AIO.cmd +++ b/MAS/All-In-One-Version-KL/MAS_AIO.cmd @@ -4293,7 +4293,7 @@ echo Checking Activation ID [%tempid%] [%tsedition%] set generickey=1 call :dk_inskey "[%key%]" -if not defined error set tsids=%tsids% %tempid% +set tsids=%tsids% %tempid% goto :ts_esu ::======================================================================================================================================== @@ -4901,7 +4901,7 @@ goto :ts_act ) call :dk_inskey "[%key%]" -if not defined error set tsids=%tsids% %tempid% +set tsids=%tsids% %tempid% goto :ts_act ::======================================================================================================================================== diff --git a/MAS/Separate-Files-Version/Activators/TSforge_Activation.cmd b/MAS/Separate-Files-Version/Activators/TSforge_Activation.cmd index 01671ab..3657ce6 100644 --- a/MAS/Separate-Files-Version/Activators/TSforge_Activation.cmd +++ b/MAS/Separate-Files-Version/Activators/TSforge_Activation.cmd @@ -702,7 +702,7 @@ echo Checking Activation ID [%tempid%] [%tsedition%] set generickey=1 call :dk_inskey "[%key%]" -if not defined error set tsids=%tsids% %tempid% +set tsids=%tsids% %tempid% goto :ts_esu ::======================================================================================================================================== @@ -1310,7 +1310,7 @@ goto :ts_act ) call :dk_inskey "[%key%]" -if not defined error set tsids=%tsids% %tempid% +set tsids=%tsids% %tempid% goto :ts_act ::======================================================================================================================================== From 691e6088d516f25b61cd3de0362668de3be5199b Mon Sep 17 00:00:00 2001 From: WindowsAddict Date: Sun, 18 May 2025 02:41:47 +0530 Subject: [PATCH 52/79] Use user temp folder or random name in Windows/Temp --- MAS/All-In-One-Version-KL/MAS_AIO.cmd | 8 ++++---- .../Activators/Ohook_Activation_AIO.cmd | 6 +++--- .../Activators/Online_KMS_Activation.cmd | 6 +++--- .../Activators/TSforge_Activation.cmd | 6 +++--- MAS/Separate-Files-Version/Change_Windows_Edition.cmd | 2 +- MAS/Separate-Files-Version/Troubleshoot.cmd | 2 +- 6 files changed, 15 insertions(+), 15 deletions(-) diff --git a/MAS/All-In-One-Version-KL/MAS_AIO.cmd b/MAS/All-In-One-Version-KL/MAS_AIO.cmd index c683783..ca13cef 100644 --- a/MAS/All-In-One-Version-KL/MAS_AIO.cmd +++ b/MAS/All-In-One-Version-KL/MAS_AIO.cmd @@ -1286,9 +1286,9 @@ if %_wmic% EQU 0 set "chkapp=for /f "tokens=2 delims==" %%a in ('%psc% "(([WMISE 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% +echo:!allapps!> "!_ttemp!\chklen" +for %%A in ("!_ttemp!\chklen") do (set len=%%~zA) +del "!_ttemp!\chklen" %nul% if !len! GTR 6000 ( %eline% @@ -16315,7 +16315,7 @@ goto :at_menu :: https://stackoverflow.com/a/46268232 -set "ddf="%SystemRoot%\Temp\ddf"" +set "ddf="%SystemRoot%\Temp\%Random%%Random%%Random%%Random%"" %nul% del /q /f %ddf% echo/.New Cabinet>%ddf% echo/.set Cabinet=ON>>%ddf% diff --git a/MAS/Separate-Files-Version/Activators/Ohook_Activation_AIO.cmd b/MAS/Separate-Files-Version/Activators/Ohook_Activation_AIO.cmd index 4c582c2..bef9d50 100644 --- a/MAS/Separate-Files-Version/Activators/Ohook_Activation_AIO.cmd +++ b/MAS/Separate-Files-Version/Activators/Ohook_Activation_AIO.cmd @@ -1701,9 +1701,9 @@ if %_wmic% EQU 0 set "chkapp=for /f "tokens=2 delims==" %%a in ('%psc% "(([WMISE 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% +echo:!allapps!> "!_ttemp!\chklen" +for %%A in ("!_ttemp!\chklen") do (set len=%%~zA) +del "!_ttemp!\chklen" %nul% if !len! GTR 6000 ( %eline% diff --git a/MAS/Separate-Files-Version/Activators/Online_KMS_Activation.cmd b/MAS/Separate-Files-Version/Activators/Online_KMS_Activation.cmd index 3546ad8..53ebe2c 100644 --- a/MAS/Separate-Files-Version/Activators/Online_KMS_Activation.cmd +++ b/MAS/Separate-Files-Version/Activators/Online_KMS_Activation.cmd @@ -2675,9 +2675,9 @@ if %_wmic% EQU 0 set "chkapp=for /f "tokens=2 delims==" %%a in ('%psc% "(([WMISE 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% +echo:!allapps!> "!_ttemp!\chklen" +for %%A in ("!_ttemp!\chklen") do (set len=%%~zA) +del "!_ttemp!\chklen" %nul% if !len! GTR 6000 ( %eline% diff --git a/MAS/Separate-Files-Version/Activators/TSforge_Activation.cmd b/MAS/Separate-Files-Version/Activators/TSforge_Activation.cmd index 3657ce6..5942597 100644 --- a/MAS/Separate-Files-Version/Activators/TSforge_Activation.cmd +++ b/MAS/Separate-Files-Version/Activators/TSforge_Activation.cmd @@ -2335,9 +2335,9 @@ if %_wmic% EQU 0 set "chkapp=for /f "tokens=2 delims==" %%a in ('%psc% "(([WMISE 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% +echo:!allapps!> "!_ttemp!\chklen" +for %%A in ("!_ttemp!\chklen") do (set len=%%~zA) +del "!_ttemp!\chklen" %nul% if !len! GTR 6000 ( %eline% diff --git a/MAS/Separate-Files-Version/Change_Windows_Edition.cmd b/MAS/Separate-Files-Version/Change_Windows_Edition.cmd index e0fa600..f875018 100644 --- a/MAS/Separate-Files-Version/Change_Windows_Edition.cmd +++ b/MAS/Separate-Files-Version/Change_Windows_Edition.cmd @@ -795,7 +795,7 @@ exit /b :: https://stackoverflow.com/a/46268232 -set "ddf="%SystemRoot%\Temp\ddf"" +set "ddf="%SystemRoot%\Temp\%Random%%Random%%Random%%Random%"" %nul% del /q /f %ddf% echo/.New Cabinet>%ddf% echo/.set Cabinet=ON>>%ddf% diff --git a/MAS/Separate-Files-Version/Troubleshoot.cmd b/MAS/Separate-Files-Version/Troubleshoot.cmd index fb3a879..b3af1c4 100644 --- a/MAS/Separate-Files-Version/Troubleshoot.cmd +++ b/MAS/Separate-Files-Version/Troubleshoot.cmd @@ -1178,7 +1178,7 @@ goto :at_menu :: https://stackoverflow.com/a/46268232 -set "ddf="%SystemRoot%\Temp\ddf"" +set "ddf="%SystemRoot%\Temp\%Random%%Random%%Random%%Random%"" %nul% del /q /f %ddf% echo/.New Cabinet>%ddf% echo/.set Cabinet=ON>>%ddf% From 966fbd14f6b4f17ee07c9ccc1d97dc499d16fc0f Mon Sep 17 00:00:00 2001 From: WindowsAddict Date: Sun, 18 May 2025 02:47:41 +0530 Subject: [PATCH 53/79] Don't ask to run other fixes if file infector malware is detected --- MAS/All-In-One-Version-KL/MAS_AIO.cmd | 2 +- MAS/Separate-Files-Version/Activators/HWID_Activation.cmd | 2 +- MAS/Separate-Files-Version/Activators/KMS38_Activation.cmd | 2 +- MAS/Separate-Files-Version/Activators/Ohook_Activation_AIO.cmd | 2 +- MAS/Separate-Files-Version/Activators/Online_KMS_Activation.cmd | 2 +- MAS/Separate-Files-Version/Activators/TSforge_Activation.cmd | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/MAS/All-In-One-Version-KL/MAS_AIO.cmd b/MAS/All-In-One-Version-KL/MAS_AIO.cmd index ca13cef..0dc3954 100644 --- a/MAS/All-In-One-Version-KL/MAS_AIO.cmd +++ b/MAS/All-In-One-Version-KL/MAS_AIO.cmd @@ -1468,7 +1468,7 @@ if not exist %SysPath%\%_slexe% if not exist %SysPath%\alg.exe (set "results=%re if not "%results%%pupfound%"=="" ( if defined pupfound call :dk_color %Gray% "Checking PUP Activators [Found%pupfound%]" if defined results call :dk_color %Red% "Checking Probable Mal%w%ware Infection..." -if defined results call :dk_color %Red% "%results%" +if defined results (call :dk_color %Red% "%results%"&set showfix=1) set fixes=%fixes% %mas%remove_mal%w%ware call :dk_color2 %Blue% "Check this webpage for help - " %_Yellow% " %mas%remove_mal%w%ware" echo: diff --git a/MAS/Separate-Files-Version/Activators/HWID_Activation.cmd b/MAS/Separate-Files-Version/Activators/HWID_Activation.cmd index 25c7190..a24dc4b 100644 --- a/MAS/Separate-Files-Version/Activators/HWID_Activation.cmd +++ b/MAS/Separate-Files-Version/Activators/HWID_Activation.cmd @@ -1171,7 +1171,7 @@ if not exist %SysPath%\%_slexe% if not exist %SysPath%\alg.exe (set "results=%re if not "%results%%pupfound%"=="" ( if defined pupfound call :dk_color %Gray% "Checking PUP Activators [Found%pupfound%]" if defined results call :dk_color %Red% "Checking Probable Mal%w%ware Infection..." -if defined results call :dk_color %Red% "%results%" +if defined results (call :dk_color %Red% "%results%"&set showfix=1) set fixes=%fixes% %mas%remove_mal%w%ware call :dk_color2 %Blue% "Check this webpage for help - " %_Yellow% " %mas%remove_mal%w%ware" echo: diff --git a/MAS/Separate-Files-Version/Activators/KMS38_Activation.cmd b/MAS/Separate-Files-Version/Activators/KMS38_Activation.cmd index bf8850f..30480d3 100644 --- a/MAS/Separate-Files-Version/Activators/KMS38_Activation.cmd +++ b/MAS/Separate-Files-Version/Activators/KMS38_Activation.cmd @@ -1314,7 +1314,7 @@ if not exist %SysPath%\%_slexe% if not exist %SysPath%\alg.exe (set "results=%re if not "%results%%pupfound%"=="" ( if defined pupfound call :dk_color %Gray% "Checking PUP Activators [Found%pupfound%]" if defined results call :dk_color %Red% "Checking Probable Mal%w%ware Infection..." -if defined results call :dk_color %Red% "%results%" +if defined results (call :dk_color %Red% "%results%"&set showfix=1) set fixes=%fixes% %mas%remove_mal%w%ware call :dk_color2 %Blue% "Check this webpage for help - " %_Yellow% " %mas%remove_mal%w%ware" echo: diff --git a/MAS/Separate-Files-Version/Activators/Ohook_Activation_AIO.cmd b/MAS/Separate-Files-Version/Activators/Ohook_Activation_AIO.cmd index bef9d50..f59f85d 100644 --- a/MAS/Separate-Files-Version/Activators/Ohook_Activation_AIO.cmd +++ b/MAS/Separate-Files-Version/Activators/Ohook_Activation_AIO.cmd @@ -1832,7 +1832,7 @@ if not exist %SysPath%\%_slexe% if not exist %SysPath%\alg.exe (set "results=%re if not "%results%%pupfound%"=="" ( if defined pupfound call :dk_color %Gray% "Checking PUP Activators [Found%pupfound%]" if defined results call :dk_color %Red% "Checking Probable Mal%w%ware Infection..." -if defined results call :dk_color %Red% "%results%" +if defined results (call :dk_color %Red% "%results%"&set showfix=1) set fixes=%fixes% %mas%remove_mal%w%ware call :dk_color2 %Blue% "Check this webpage for help - " %_Yellow% " %mas%remove_mal%w%ware" echo: diff --git a/MAS/Separate-Files-Version/Activators/Online_KMS_Activation.cmd b/MAS/Separate-Files-Version/Activators/Online_KMS_Activation.cmd index 53ebe2c..568e0f7 100644 --- a/MAS/Separate-Files-Version/Activators/Online_KMS_Activation.cmd +++ b/MAS/Separate-Files-Version/Activators/Online_KMS_Activation.cmd @@ -2884,7 +2884,7 @@ if not exist %SysPath%\%_slexe% if not exist %SysPath%\alg.exe (set "results=%re if not "%results%%pupfound%"=="" ( if defined pupfound call :dk_color %Gray% "Checking PUP Activators [Found%pupfound%]" if defined results call :dk_color %Red% "Checking Probable Mal%w%ware Infection..." -if defined results call :dk_color %Red% "%results%" +if defined results (call :dk_color %Red% "%results%"&set showfix=1) set fixes=%fixes% %mas%remove_mal%w%ware call :dk_color2 %Blue% "Check this webpage for help - " %_Yellow% " %mas%remove_mal%w%ware" echo: diff --git a/MAS/Separate-Files-Version/Activators/TSforge_Activation.cmd b/MAS/Separate-Files-Version/Activators/TSforge_Activation.cmd index 5942597..ca7eb3e 100644 --- a/MAS/Separate-Files-Version/Activators/TSforge_Activation.cmd +++ b/MAS/Separate-Files-Version/Activators/TSforge_Activation.cmd @@ -2499,7 +2499,7 @@ if not exist %SysPath%\%_slexe% if not exist %SysPath%\alg.exe (set "results=%re if not "%results%%pupfound%"=="" ( if defined pupfound call :dk_color %Gray% "Checking PUP Activators [Found%pupfound%]" if defined results call :dk_color %Red% "Checking Probable Mal%w%ware Infection..." -if defined results call :dk_color %Red% "%results%" +if defined results (call :dk_color %Red% "%results%"&set showfix=1) set fixes=%fixes% %mas%remove_mal%w%ware call :dk_color2 %Blue% "Check this webpage for help - " %_Yellow% " %mas%remove_mal%w%ware" echo: From fc2348bf53a13665bae3f869283798f6dca5373a Mon Sep 17 00:00:00 2001 From: WindowsAddict Date: Sun, 18 May 2025 03:39:29 +0530 Subject: [PATCH 54/79] Add some info related to O365 to Mondo conversion in TSforge --- MAS/All-In-One-Version-KL/MAS_AIO.cmd | 5 +++++ MAS/Separate-Files-Version/Activators/TSforge_Activation.cmd | 5 +++++ 2 files changed, 10 insertions(+) diff --git a/MAS/All-In-One-Version-KL/MAS_AIO.cmd b/MAS/All-In-One-Version-KL/MAS_AIO.cmd index 0dc3954..f3e269a 100644 --- a/MAS/All-In-One-Version-KL/MAS_AIO.cmd +++ b/MAS/All-In-One-Version-KL/MAS_AIO.cmd @@ -5327,6 +5327,11 @@ set _License=MondoRetail set _altoffid=MondoRetail call :ks_osppready echo Converting Unsupported O365 Office [%%# To MondoRetail] +if "%oVer%"=="15" (call :dk_color %Gray% "Mondo 2013 is equivalent to O365 [15.0 version] in terms of the latest features.") +if "%oVer%"=="16" ( +call :dk_color %Gray% "Mondo 2016 is equivalent to O365 in terms of the latest features." +call :dk_color %Gray% "To enhance stability, select the Change Office Edition option in the Main Menu to fully switch to Mondo." +) ) if not defined _oMSI ( diff --git a/MAS/Separate-Files-Version/Activators/TSforge_Activation.cmd b/MAS/Separate-Files-Version/Activators/TSforge_Activation.cmd index ca7eb3e..ded99ca 100644 --- a/MAS/Separate-Files-Version/Activators/TSforge_Activation.cmd +++ b/MAS/Separate-Files-Version/Activators/TSforge_Activation.cmd @@ -1796,6 +1796,11 @@ set _License=MondoRetail set _altoffid=MondoRetail call :ks_osppready echo Converting Unsupported O365 Office [%%# To MondoRetail] +if "%oVer%"=="15" (call :dk_color %Gray% "Mondo 2013 is equivalent to O365 [15.0 version] in terms of the latest features.") +if "%oVer%"=="16" ( +call :dk_color %Gray% "Mondo 2016 is equivalent to O365 in terms of the latest features." +call :dk_color %Gray% "To enhance stability, select the Change Office Edition option in the Main Menu to fully switch to Mondo." +) ) if not defined _oMSI ( From 133d3b9720c29d0d566f8e6bb117a802fda0c454 Mon Sep 17 00:00:00 2001 From: WindowsAddict Date: Sun, 18 May 2025 10:46:12 +0530 Subject: [PATCH 55/79] Edit the info related to Mondo conversion --- MAS/All-In-One-Version-KL/MAS_AIO.cmd | 9 +++++---- .../Activators/Online_KMS_Activation.cmd | 4 ++++ .../Activators/TSforge_Activation.cmd | 5 +---- 3 files changed, 10 insertions(+), 8 deletions(-) diff --git a/MAS/All-In-One-Version-KL/MAS_AIO.cmd b/MAS/All-In-One-Version-KL/MAS_AIO.cmd index f3e269a..198d13e 100644 --- a/MAS/All-In-One-Version-KL/MAS_AIO.cmd +++ b/MAS/All-In-One-Version-KL/MAS_AIO.cmd @@ -5328,10 +5328,7 @@ set _altoffid=MondoRetail call :ks_osppready echo Converting Unsupported O365 Office [%%# To MondoRetail] if "%oVer%"=="15" (call :dk_color %Gray% "Mondo 2013 is equivalent to O365 [15.0 version] in terms of the latest features.") -if "%oVer%"=="16" ( -call :dk_color %Gray% "Mondo 2016 is equivalent to O365 in terms of the latest features." -call :dk_color %Gray% "To enhance stability, select the Change Office Edition option in the Main Menu to fully switch to Mondo." -) +if "%oVer%"=="16" (call :dk_color %Gray% "Mondo 2016 is equivalent to O365 in terms of the latest features.") ) if not defined _oMSI ( @@ -12446,6 +12443,10 @@ call :ksdata getinfo !_prod! if defined _altoffid ( set _License=!_altoffid! echo Converting Retail To Volume [!_prod! To !_altoffid!] +echo %%# | find /i "O365" %nul% && ( +if "%oVer%"=="15" (call :dk_color %Gray% "Mondo 2013 is equivalent to O365 [15.0 version] in terms of the latest features.") +if "%oVer%"=="16" (call :dk_color %Gray% "Mondo 2016 is equivalent to O365 in terms of the latest features.") +) set _prod=!_altoffid! call :ks_osppready ) diff --git a/MAS/Separate-Files-Version/Activators/Online_KMS_Activation.cmd b/MAS/Separate-Files-Version/Activators/Online_KMS_Activation.cmd index 568e0f7..28879e5 100644 --- a/MAS/Separate-Files-Version/Activators/Online_KMS_Activation.cmd +++ b/MAS/Separate-Files-Version/Activators/Online_KMS_Activation.cmd @@ -1212,6 +1212,10 @@ call :ksdata getinfo !_prod! if defined _altoffid ( set _License=!_altoffid! echo Converting Retail To Volume [!_prod! To !_altoffid!] +echo %%# | find /i "O365" %nul% && ( +if "%oVer%"=="15" (call :dk_color %Gray% "Mondo 2013 is equivalent to O365 [15.0 version] in terms of the latest features.") +if "%oVer%"=="16" (call :dk_color %Gray% "Mondo 2016 is equivalent to O365 in terms of the latest features.") +) set _prod=!_altoffid! call :ks_osppready ) diff --git a/MAS/Separate-Files-Version/Activators/TSforge_Activation.cmd b/MAS/Separate-Files-Version/Activators/TSforge_Activation.cmd index ded99ca..a8a1911 100644 --- a/MAS/Separate-Files-Version/Activators/TSforge_Activation.cmd +++ b/MAS/Separate-Files-Version/Activators/TSforge_Activation.cmd @@ -1797,10 +1797,7 @@ set _altoffid=MondoRetail call :ks_osppready echo Converting Unsupported O365 Office [%%# To MondoRetail] if "%oVer%"=="15" (call :dk_color %Gray% "Mondo 2013 is equivalent to O365 [15.0 version] in terms of the latest features.") -if "%oVer%"=="16" ( -call :dk_color %Gray% "Mondo 2016 is equivalent to O365 in terms of the latest features." -call :dk_color %Gray% "To enhance stability, select the Change Office Edition option in the Main Menu to fully switch to Mondo." -) +if "%oVer%"=="16" (call :dk_color %Gray% "Mondo 2016 is equivalent to O365 in terms of the latest features.") ) if not defined _oMSI ( From 206c31ece505276f62f0e1cb9f49f0811d264864 Mon Sep 17 00:00:00 2001 From: WindowsAddict Date: Sun, 18 May 2025 12:09:25 +0530 Subject: [PATCH 56/79] Open mirror pages along with massgrave.dev --- MAS/All-In-One-Version-KL/MAS_AIO.cmd | 6 +++--- MAS/Separate-Files-Version/Activators/HWID_Activation.cmd | 4 ++-- MAS/Separate-Files-Version/Activators/KMS38_Activation.cmd | 4 ++-- .../Activators/Ohook_Activation_AIO.cmd | 4 ++-- .../Activators/Online_KMS_Activation.cmd | 4 ++-- .../Activators/TSforge_Activation.cmd | 4 ++-- MAS/Separate-Files-Version/Change_Office_Edition.cmd | 6 +++--- MAS/Separate-Files-Version/Change_Windows_Edition.cmd | 4 ++-- MAS/Separate-Files-Version/Extract_OEM_Folder.cmd | 4 ++-- MAS/Separate-Files-Version/Troubleshoot.cmd | 4 ++-- 10 files changed, 22 insertions(+), 22 deletions(-) diff --git a/MAS/All-In-One-Version-KL/MAS_AIO.cmd b/MAS/All-In-One-Version-KL/MAS_AIO.cmd index 198d13e..8b6ddbf 100644 --- a/MAS/All-In-One-Version-KL/MAS_AIO.cmd +++ b/MAS/All-In-One-Version-KL/MAS_AIO.cmd @@ -334,7 +334,7 @@ echo: call :dk_color %_Green% "Choose a menu option using your keyboard [1,0] :" choice /C:10 /N if !errorlevel!==2 rem -if !errorlevel!==1 (start %mas% & exit /b) +if !errorlevel!==1 (start https://git.activated.win/massg%-%rave/Micr%-%osoft-Act%-%ivation-Scripts & start https://github.com/massgra%-%vel/Micro%-%soft-Acti%-%vation-Scripts & start %mas% & exit /b) ) ) @@ -2004,7 +2004,7 @@ call :dk_color %White% "Follow ALL the ABOVE blue lines. " call :dk_color2 %Blue% "Press [1] to Open Support Webpage " %Gray% " Press [0] to Ignore" choice /C:10 /N if !errorlevel!==2 exit /b -if !errorlevel!==1 (for %%# in (%fixes%) do (start %%#)) +if !errorlevel!==1 (start https://git.activated.win/massg%-%rave/Micr%-%osoft-Act%-%ivation-Scripts & start https://github.com/massgra%-%vel/Micro%-%soft-Acti%-%vation-Scripts & for %%# in (%fixes%) do (start %%#)) ) if defined terminal ( @@ -18249,7 +18249,7 @@ call :dk_color %White% "Follow ALL the ABOVE blue lines. " call :dk_color2 %Blue% "Press [1] to Open Support Webpage " %Gray% " Press [0] to Ignore" choice /C:10 /N if !errorlevel!==2 goto :oemenu -if !errorlevel!==1 (for %%# in (%fixes%) do (start %%#)) +if !errorlevel!==1 (start https://git.activated.win/massg%-%rave/Micr%-%osoft-Act%-%ivation-Scripts & start https://github.com/massgra%-%vel/Micro%-%soft-Acti%-%vation-Scripts & for %%# in (%fixes%) do (start %%#)) ) if defined terminal ( diff --git a/MAS/Separate-Files-Version/Activators/HWID_Activation.cmd b/MAS/Separate-Files-Version/Activators/HWID_Activation.cmd index a24dc4b..02be6af 100644 --- a/MAS/Separate-Files-Version/Activators/HWID_Activation.cmd +++ b/MAS/Separate-Files-Version/Activators/HWID_Activation.cmd @@ -356,7 +356,7 @@ echo: call :dk_color %_Green% "Choose a menu option using your keyboard [1,0] :" choice /C:10 /N if !errorlevel!==2 rem -if !errorlevel!==1 (start %mas% & exit /b) +if !errorlevel!==1 (start https://git.activated.win/massg%-%rave/Micr%-%osoft-Act%-%ivation-Scripts & start https://github.com/massgra%-%vel/Micro%-%soft-Acti%-%vation-Scripts & start %mas% & exit /b) ) ) @@ -1707,7 +1707,7 @@ call :dk_color %White% "Follow ALL the ABOVE blue lines. " call :dk_color2 %Blue% "Press [1] to Open Support Webpage " %Gray% " Press [0] to Ignore" choice /C:10 /N if !errorlevel!==2 exit /b -if !errorlevel!==1 (for %%# in (%fixes%) do (start %%#)) +if !errorlevel!==1 (start https://git.activated.win/massg%-%rave/Micr%-%osoft-Act%-%ivation-Scripts & start https://github.com/massgra%-%vel/Micro%-%soft-Acti%-%vation-Scripts & for %%# in (%fixes%) do (start %%#)) ) if defined terminal ( diff --git a/MAS/Separate-Files-Version/Activators/KMS38_Activation.cmd b/MAS/Separate-Files-Version/Activators/KMS38_Activation.cmd index 30480d3..e909532 100644 --- a/MAS/Separate-Files-Version/Activators/KMS38_Activation.cmd +++ b/MAS/Separate-Files-Version/Activators/KMS38_Activation.cmd @@ -359,7 +359,7 @@ echo: call :dk_color %_Green% "Choose a menu option using your keyboard [1,0] :" choice /C:10 /N if !errorlevel!==2 rem -if !errorlevel!==1 (start %mas% & exit /b) +if !errorlevel!==1 (start https://git.activated.win/massg%-%rave/Micr%-%osoft-Act%-%ivation-Scripts & start https://github.com/massgra%-%vel/Micro%-%soft-Acti%-%vation-Scripts & start %mas% & exit /b) ) ) cls @@ -1850,7 +1850,7 @@ call :dk_color %White% "Follow ALL the ABOVE blue lines. " call :dk_color2 %Blue% "Press [1] to Open Support Webpage " %Gray% " Press [0] to Ignore" choice /C:10 /N if !errorlevel!==2 exit /b -if !errorlevel!==1 (for %%# in (%fixes%) do (start %%#)) +if !errorlevel!==1 (start https://git.activated.win/massg%-%rave/Micr%-%osoft-Act%-%ivation-Scripts & start https://github.com/massgra%-%vel/Micro%-%soft-Acti%-%vation-Scripts & for %%# in (%fixes%) do (start %%#)) ) if defined terminal ( diff --git a/MAS/Separate-Files-Version/Activators/Ohook_Activation_AIO.cmd b/MAS/Separate-Files-Version/Activators/Ohook_Activation_AIO.cmd index f59f85d..6e06bf1 100644 --- a/MAS/Separate-Files-Version/Activators/Ohook_Activation_AIO.cmd +++ b/MAS/Separate-Files-Version/Activators/Ohook_Activation_AIO.cmd @@ -364,7 +364,7 @@ echo: call :dk_color %_Green% "Choose a menu option using your keyboard [1,0] :" choice /C:10 /N if !errorlevel!==2 rem -if !errorlevel!==1 (start %mas% & exit /b) +if !errorlevel!==1 (start https://git.activated.win/massg%-%rave/Micr%-%osoft-Act%-%ivation-Scripts & start https://github.com/massgra%-%vel/Micro%-%soft-Acti%-%vation-Scripts & start %mas% & exit /b) ) ) cls @@ -2368,7 +2368,7 @@ call :dk_color %White% "Follow ALL the ABOVE blue lines. " call :dk_color2 %Blue% "Press [1] to Open Support Webpage " %Gray% " Press [0] to Ignore" choice /C:10 /N if !errorlevel!==2 exit /b -if !errorlevel!==1 (for %%# in (%fixes%) do (start %%#)) +if !errorlevel!==1 (start https://git.activated.win/massg%-%rave/Micr%-%osoft-Act%-%ivation-Scripts & start https://github.com/massgra%-%vel/Micro%-%soft-Acti%-%vation-Scripts & for %%# in (%fixes%) do (start %%#)) ) if defined terminal ( diff --git a/MAS/Separate-Files-Version/Activators/Online_KMS_Activation.cmd b/MAS/Separate-Files-Version/Activators/Online_KMS_Activation.cmd index 28879e5..321095a 100644 --- a/MAS/Separate-Files-Version/Activators/Online_KMS_Activation.cmd +++ b/MAS/Separate-Files-Version/Activators/Online_KMS_Activation.cmd @@ -395,7 +395,7 @@ echo: call :dk_color %_Green% "Choose a menu option using your keyboard [1,0] :" choice /C:10 /N if !errorlevel!==2 rem -if !errorlevel!==1 (start %mas% & exit /b) +if !errorlevel!==1 (start https://git.activated.win/massg%-%rave/Micr%-%osoft-Act%-%ivation-Scripts & start https://github.com/massgra%-%vel/Micro%-%soft-Acti%-%vation-Scripts & start %mas% & exit /b) ) ) @@ -3424,7 +3424,7 @@ call :dk_color %White% "Follow ALL the ABOVE blue lines. " call :dk_color2 %Blue% "Press [1] to Open Support Webpage " %Gray% " Press [0] to Ignore" choice /C:10 /N if !errorlevel!==2 exit /b -if !errorlevel!==1 (for %%# in (%fixes%) do (start %%#)) +if !errorlevel!==1 (start https://git.activated.win/massg%-%rave/Micr%-%osoft-Act%-%ivation-Scripts & start https://github.com/massgra%-%vel/Micro%-%soft-Acti%-%vation-Scripts & for %%# in (%fixes%) do (start %%#)) ) if defined terminal ( diff --git a/MAS/Separate-Files-Version/Activators/TSforge_Activation.cmd b/MAS/Separate-Files-Version/Activators/TSforge_Activation.cmd index a8a1911..e9b75e6 100644 --- a/MAS/Separate-Files-Version/Activators/TSforge_Activation.cmd +++ b/MAS/Separate-Files-Version/Activators/TSforge_Activation.cmd @@ -413,7 +413,7 @@ echo: call :dk_color %_Green% "Choose a menu option using your keyboard [1,0] :" choice /C:10 /N if !errorlevel!==2 rem -if !errorlevel!==1 (start %mas% & exit /b) +if !errorlevel!==1 (start https://git.activated.win/massg%-%rave/Micr%-%osoft-Act%-%ivation-Scripts & start https://github.com/massgra%-%vel/Micro%-%soft-Acti%-%vation-Scripts & start %mas% & exit /b) ) ) @@ -3037,7 +3037,7 @@ call :dk_color %White% "Follow ALL the ABOVE blue lines. " call :dk_color2 %Blue% "Press [1] to Open Support Webpage " %Gray% " Press [0] to Ignore" choice /C:10 /N if !errorlevel!==2 exit /b -if !errorlevel!==1 (for %%# in (%fixes%) do (start %%#)) +if !errorlevel!==1 (start https://git.activated.win/massg%-%rave/Micr%-%osoft-Act%-%ivation-Scripts & start https://github.com/massgra%-%vel/Micro%-%soft-Acti%-%vation-Scripts & for %%# in (%fixes%) do (start %%#)) ) if defined terminal ( diff --git a/MAS/Separate-Files-Version/Change_Office_Edition.cmd b/MAS/Separate-Files-Version/Change_Office_Edition.cmd index 835a80b..b5bd456 100644 --- a/MAS/Separate-Files-Version/Change_Office_Edition.cmd +++ b/MAS/Separate-Files-Version/Change_Office_Edition.cmd @@ -309,7 +309,7 @@ echo: call :dk_color %_Green% "Choose a menu option using your keyboard [1,0] :" choice /C:10 /N if !errorlevel!==2 rem -if !errorlevel!==1 (start %mas% & exit /b) +if !errorlevel!==1 (start https://git.activated.win/massg%-%rave/Micr%-%osoft-Act%-%ivation-Scripts & start https://github.com/massgra%-%vel/Micro%-%soft-Acti%-%vation-Scripts & start %mas% & exit /b) ) ) @@ -1112,7 +1112,7 @@ call :dk_color %White% "Follow ALL the ABOVE blue lines. " call :dk_color2 %Blue% "Press [1] to Open Support Webpage " %Gray% " Press [0] to Ignore" choice /C:10 /N if !errorlevel!==2 goto :oemenu -if !errorlevel!==1 (for %%# in (%fixes%) do (start %%#)) +if !errorlevel!==1 (start https://git.activated.win/massg%-%rave/Micr%-%osoft-Act%-%ivation-Scripts & start https://github.com/massgra%-%vel/Micro%-%soft-Acti%-%vation-Scripts & for %%# in (%fixes%) do (start %%#)) ) if defined terminal ( @@ -1477,7 +1477,7 @@ call :dk_color %White% "Follow ALL the ABOVE blue lines. " call :dk_color2 %Blue% "Press [1] to Open Support Webpage " %Gray% " Press [0] to Ignore" choice /C:10 /N if !errorlevel!==2 exit /b -if !errorlevel!==1 (for %%# in (%fixes%) do (start %%#)) +if !errorlevel!==1 (start https://git.activated.win/massg%-%rave/Micr%-%osoft-Act%-%ivation-Scripts & start https://github.com/massgra%-%vel/Micro%-%soft-Acti%-%vation-Scripts & for %%# in (%fixes%) do (start %%#)) ) if defined terminal ( diff --git a/MAS/Separate-Files-Version/Change_Windows_Edition.cmd b/MAS/Separate-Files-Version/Change_Windows_Edition.cmd index f875018..eaa0956 100644 --- a/MAS/Separate-Files-Version/Change_Windows_Edition.cmd +++ b/MAS/Separate-Files-Version/Change_Windows_Edition.cmd @@ -314,7 +314,7 @@ echo: call :dk_color %_Green% "Choose a menu option using your keyboard [1,0] :" choice /C:10 /N if !errorlevel!==2 rem -if !errorlevel!==1 (start %mas% & exit /b) +if !errorlevel!==1 (start https://git.activated.win/massg%-%rave/Micr%-%osoft-Act%-%ivation-Scripts & start https://github.com/massgra%-%vel/Micro%-%soft-Acti%-%vation-Scripts & start %mas% & exit /b) ) ) @@ -1058,7 +1058,7 @@ call :dk_color %White% "Follow ALL the ABOVE blue lines. " call :dk_color2 %Blue% "Press [1] to Open Support Webpage " %Gray% " Press [0] to Ignore" choice /C:10 /N if !errorlevel!==2 exit /b -if !errorlevel!==1 (for %%# in (%fixes%) do (start %%#)) +if !errorlevel!==1 (start https://git.activated.win/massg%-%rave/Micr%-%osoft-Act%-%ivation-Scripts & start https://github.com/massgra%-%vel/Micro%-%soft-Acti%-%vation-Scripts & for %%# in (%fixes%) do (start %%#)) ) if defined terminal ( diff --git a/MAS/Separate-Files-Version/Extract_OEM_Folder.cmd b/MAS/Separate-Files-Version/Extract_OEM_Folder.cmd index a896e2b..f1049bd 100644 --- a/MAS/Separate-Files-Version/Extract_OEM_Folder.cmd +++ b/MAS/Separate-Files-Version/Extract_OEM_Folder.cmd @@ -325,7 +325,7 @@ echo: call :dk_color %_Green% "Choose a menu option using your keyboard [1,0] :" choice /C:10 /N if !errorlevel!==2 rem -if !errorlevel!==1 (start %mas% & exit /b) +if !errorlevel!==1 (start https://git.activated.win/massg%-%rave/Micr%-%osoft-Act%-%ivation-Scripts & start https://github.com/massgra%-%vel/Micro%-%soft-Acti%-%vation-Scripts & start %mas% & exit /b) ) ) @@ -732,7 +732,7 @@ call :dk_color %White% "Follow ALL the ABOVE blue lines. " call :dk_color2 %Blue% "Press [1] to Open Support Webpage " %Gray% " Press [0] to Ignore" choice /C:10 /N if !errorlevel!==2 exit /b -if !errorlevel!==1 (for %%# in (%fixes%) do (start %%#)) +if !errorlevel!==1 (start https://git.activated.win/massg%-%rave/Micr%-%osoft-Act%-%ivation-Scripts & start https://github.com/massgra%-%vel/Micro%-%soft-Acti%-%vation-Scripts & for %%# in (%fixes%) do (start %%#)) ) if defined terminal ( diff --git a/MAS/Separate-Files-Version/Troubleshoot.cmd b/MAS/Separate-Files-Version/Troubleshoot.cmd index b3af1c4..ce82567 100644 --- a/MAS/Separate-Files-Version/Troubleshoot.cmd +++ b/MAS/Separate-Files-Version/Troubleshoot.cmd @@ -326,7 +326,7 @@ echo: call :dk_color %_Green% "Choose a menu option using your keyboard [1,0] :" choice /C:10 /N if !errorlevel!==2 rem -if !errorlevel!==1 (start %mas% & exit /b) +if !errorlevel!==1 (start https://git.activated.win/massg%-%rave/Micr%-%osoft-Act%-%ivation-Scripts & start https://github.com/massgra%-%vel/Micro%-%soft-Acti%-%vation-Scripts & start %mas% & exit /b) ) ) @@ -1489,7 +1489,7 @@ call :dk_color %White% "Follow ALL the ABOVE blue lines. " call :dk_color2 %Blue% "Press [1] to Open Support Webpage " %Gray% " Press [0] to Ignore" choice /C:10 /N if !errorlevel!==2 exit /b -if !errorlevel!==1 (for %%# in (%fixes%) do (start %%#)) +if !errorlevel!==1 (start https://git.activated.win/massg%-%rave/Micr%-%osoft-Act%-%ivation-Scripts & start https://github.com/massgra%-%vel/Micro%-%soft-Acti%-%vation-Scripts & for %%# in (%fixes%) do (start %%#)) ) if defined terminal ( From b75ba72bc5ff9ccd80a225a1f7410ab051949a6a Mon Sep 17 00:00:00 2001 From: WindowsAddict Date: Sun, 18 May 2025 12:52:40 +0530 Subject: [PATCH 57/79] Change hash --- MAS/All-In-One-Version-KL/MAS_AIO.cmd | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/MAS/All-In-One-Version-KL/MAS_AIO.cmd b/MAS/All-In-One-Version-KL/MAS_AIO.cmd index 8b6ddbf..f72acb4 100644 --- a/MAS/All-In-One-Version-KL/MAS_AIO.cmd +++ b/MAS/All-In-One-Version-KL/MAS_AIO.cmd @@ -1,4 +1,4 @@ -@::7f8jhe-random +@::fh36d7f-random @set masver=3.2 @setlocal DisableDelayedExpansion @echo off From a149fc5f2048b135c649a04da89e1b2f3178b449 Mon Sep 17 00:00:00 2001 From: WindowsAddict Date: Sun, 18 May 2025 12:52:40 +0530 Subject: [PATCH 58/79] Change hash --- MAS/All-In-One-Version-KL/MAS_AIO.cmd | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/MAS/All-In-One-Version-KL/MAS_AIO.cmd b/MAS/All-In-One-Version-KL/MAS_AIO.cmd index be4714c..8148441 100644 --- a/MAS/All-In-One-Version-KL/MAS_AIO.cmd +++ b/MAS/All-In-One-Version-KL/MAS_AIO.cmd @@ -1,4 +1,4 @@ -@::7f8jhe-random +@::fh36d7f-random @set masver=3.2 @setlocal DisableDelayedExpansion @echo off From 830755f6b606446225ca4535a6a0d45ba9f8c052 Mon Sep 17 00:00:00 2001 From: WindowsAddict Date: Sun, 18 May 2025 18:11:04 +0530 Subject: [PATCH 59/79] Fix an issue in detecting Office preview licenses in TSforge --- MAS/All-In-One-Version-KL/MAS_AIO.cmd | 2 +- MAS/Separate-Files-Version/Activators/TSforge_Activation.cmd | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/MAS/All-In-One-Version-KL/MAS_AIO.cmd b/MAS/All-In-One-Version-KL/MAS_AIO.cmd index f72acb4..9bff890 100644 --- a/MAS/All-In-One-Version-KL/MAS_AIO.cmd +++ b/MAS/All-In-One-Version-KL/MAS_AIO.cmd @@ -10570,7 +10570,7 @@ function Office-ActID { } } - $filterPreview = $filteredConfigs | Where-Object { $_.ProductDescription -notmatch 'preview' } + $filterPreview = $filteredConfigs | Where-Object { $_.ProductDescription -notmatch 'preview|c2r' } if ($filterPreview.Count -ne 0) { $filteredConfigs = $filterPreview diff --git a/MAS/Separate-Files-Version/Activators/TSforge_Activation.cmd b/MAS/Separate-Files-Version/Activators/TSforge_Activation.cmd index e9b75e6..444a20b 100644 --- a/MAS/Separate-Files-Version/Activators/TSforge_Activation.cmd +++ b/MAS/Separate-Files-Version/Activators/TSforge_Activation.cmd @@ -8189,7 +8189,7 @@ function Office-ActID { } } - $filterPreview = $filteredConfigs | Where-Object { $_.ProductDescription -notmatch 'preview' } + $filterPreview = $filteredConfigs | Where-Object { $_.ProductDescription -notmatch 'preview|c2r' } if ($filterPreview.Count -ne 0) { $filteredConfigs = $filterPreview From ae93f547f58417191cbdc59f4d2be282cdd8ffe0 Mon Sep 17 00:00:00 2001 From: WindowsAddict Date: Fri, 23 May 2025 17:54:17 +0530 Subject: [PATCH 60/79] Add the option to change Office update channel to VL and from VL to retail --- MAS/All-In-One-Version-KL/MAS_AIO.cmd | 229 ++++++++++++++---- .../Change_Office_Edition.cmd | 229 ++++++++++++++---- 2 files changed, 354 insertions(+), 104 deletions(-) diff --git a/MAS/All-In-One-Version-KL/MAS_AIO.cmd b/MAS/All-In-One-Version-KL/MAS_AIO.cmd index 9bff890..e43bb90 100644 --- a/MAS/All-In-One-Version-KL/MAS_AIO.cmd +++ b/MAS/All-In-One-Version-KL/MAS_AIO.cmd @@ -17552,6 +17552,7 @@ _updch _lang _clversion _version +_AudienceData _oIds _c2rXml _c2rExe @@ -17939,8 +17940,39 @@ set errorcode=%errorlevel% timeout /t 10 %nul% echo: +set suggestchannel= + if %errorcode% EQU 0 ( -call :dk_color %Gray% "Now run the Office activation option from the main menu." +echo %targetedition% | find /i "2019Volume" %nul% && ( +if not defined ltsc19 set suggestchannel=Production::LTSC +if /i not %_AudienceData%==Production::LTSC set suggestchannel=Production::LTSC +if /i not %_updch%==F2E724C1-748F-4B47-8FB8-8E0D210E9208 set suggestchannel=Production::LTSC +) + +echo %targetedition% | find /i "2021Volume" %nul% && ( +if not defined ltsc21 set suggestchannel=Production::LTSC2021 +if /i not %_AudienceData%==Production::LTSC2021 set suggestchannel=Production::LTSC2021 +if /i not %_updch%==5030841D-C919-4594-8D2D-84AE4F96E58E set suggestchannel=Production::LTSC2021 +) + +echo %targetedition% | find /i "2024Volume" %nul% && ( +if not defined ltsc24 set suggestchannel=Production::LTSC2024 +if /i not %_AudienceData%==Production::LTSC2024 set suggestchannel=Production::LTSC2024 +if /i not %_updch%==7983BAC0-E531-40CF-BE00-FD24FE66619C set suggestchannel=Production::LTSC2024 +) + +echo %targetedition% | findstr /R "20.*Volume" %nul% || ( +if defined ltscfound set suggestchannel=Production::CC +echo %_AudienceData% | find /i "LTSC" %nul% && set suggestchannel=Production::CC +) + +if defined suggestchannel ( +call :dk_color %Gray% "Mismatch found in update channel and installed product." +call :dk_color %Blue% "It is recommended to change the update channel to [!suggestchannel!] from the previous menu." +) + +echo: +call :dk_color %Gray% "To activate Office, run the activation option from the main menu." ) else ( set fixes=%fixes% %mas%troubleshoot call :dk_color2 %Blue% "Check this webpage for help - " %_Yellow% " %mas%troubleshoot" @@ -18117,6 +18149,12 @@ echo Installed Office editions: %_oIds% echo Unsupported Office edition is installed on your Windows build version %winbuild%. goto :oe_goback ) +if defined ltscfound ( +%eline% +echo Installed Office update channel: %ltsc19%%ltsc21%%ltsc24% +echo Unsupported Office update channel is installed on your Windows build version %winbuild%. +goto :oe_goback +) ) ::=============== @@ -18125,49 +18163,52 @@ set inpt= set counter=0 set verified=0 set targetFFN= +set bypassFFN= set targetchannel= %line% echo: call :dk_color %Gray% "Installed update channel: %_AudienceData%, %_version%, Client: %_clversion%" -call :dk_color %Gray% "Unsupported update channels are excluded from this list." +call :dk_color %Gray% "Installed Office editions: %_oIds%" %line% echo: for %%# in ( -"5440FD1F-7ECB-4221-8110-145EFAA6372F_Insider Fast [Beta] - Insiders::DevMain" -"64256AFE-F5D9-4F86-8936-8840A6A4F5BE_Monthly Preview - Insiders::CC" -"492350F6-3A01-4F97-B9C0-C7C6DDF67D60_Monthly [Current] - Production::CC" -"55336B82-A18D-4DD6-B5F6-9E5095C314A6_Monthly Enterprise - Production::MEC" -"B8F9B850-328D-4355-9145-C59439A0C4CF_Semi Annual Preview - Insiders::FRDC" -"7FFBC6BF-BC32-4F92-8982-F9DD17FD3114_Semi Annual - Production::DC" -"EA4A4090-DE26-49D7-93C1-91BFF9E53FC3_DevMain Channel - Dogfood::DevMain" -"B61285DD-D9F7-41F2-9757-8F61CBA4E9C8_Microsoft Elite - Microsoft::DevMain" -"F2E724C1-748F-4B47-8FB8-8E0D210E9208_Perpetual2019 VL - Production::LTSC" -"1D2D2EA6-1680-4C56-AC58-A441C8C24FF9_Microsoft2019 VL - Microsoft::LTSC" -"5030841D-C919-4594-8D2D-84AE4F96E58E_Perpetual2021 VL - Production::LTSC2021" -"86752282-5841-4120-AC80-DB03AE6B5FDB_Microsoft2021 VL - Microsoft::LTSC2021" -"7983BAC0-E531-40CF-BE00-FD24FE66619C_Perpetual2024 VL - Production::LTSC2024" -"C02D8FE6-5242-4DA8-972F-82EE55E00671_Microsoft2024 VL - Microsoft::LTSC2024" +"5440fd1f-7ecb-4221-8110-145efaa6372f_Insider Fast [Beta] - Insiders::DevMain -" +"64256afe-f5d9-4f86-8936-8840a6a4f5be_Monthly Preview - Insiders::CC -" +"492350f6-3a01-4f97-b9c0-c7c6ddf67d60_Monthly [Current] - Production::CC -" +"55336b82-a18d-4dd6-b5f6-9e5095c314a6_Monthly Enterprise - Production::MEC -" +"b8f9b850-328d-4355-9145-c59439a0c4cf_Semi Annual Preview - Insiders::FRDC -" +"7ffbc6bf-bc32-4f92-8982-f9dd17fd3114_Semi Annual - Production::DC -" +"ea4a4090-de26-49d7-93c1-91bff9e53fc3_DevMain Channel - Dogfood::DevMain -" +"b61285dd-d9f7-41f2-9757-8f61cba4e9c8_Microsoft Elite - Microsoft::DevMain -" +"f2e724c1-748f-4b47-8fb8-8e0d210e9208_Perpetual2019 VL - Production::LTSC -" +"1d2d2ea6-1680-4c56-ac58-a441c8c24ff9_Microsoft2019 VL - Microsoft::LTSC -" +"5030841d-c919-4594-8d2d-84ae4f96e58e_Perpetual2021 VL - Production::LTSC2021 -" +"86752282-5841-4120-ac80-db03ae6b5fdb_Microsoft2021 VL - Microsoft::LTSC2021 -" +"7983bac0-e531-40cf-be00-fd24fe66619c_Perpetual2024 VL - Production::LTSC2024 -" +"c02d8fe6-5242-4da8-972f-82ee55e00671_Microsoft2024 VL - Microsoft::LTSC2024 -" ) do ( for /f "tokens=1-2 delims=_" %%A in ("%%~#") do ( +set bypass= 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 %%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 ltsc19 echo %%B | find /i "2019 VL" %nul% || set bypass=1 +if defined ltsc21 echo %%B | find /i "2021 VL" %nul% || set bypass=1 +if defined ltsc24 echo %%B | find /i "2024 VL" %nul% || set bypass=1 +if not defined ltscfound echo %%B | find /i "LTSC" %nul% && set bypass=1 ) if defined supported ( set /a counter+=1 if !counter! LSS 10 ( -echo [!counter!] %%B +if defined bypass (echo [!counter!] %%B Unofficial change method will be used) else (echo [!counter!] %%B) ) else ( -echo [!counter!] %%B +if defined bypass (echo [!counter!] %%B Unofficial change method will be used) else (echo [!counter!] %%B) ) set targetFFN!counter!=%%A set targetchannel!counter!=%%B +if defined bypass set bypassFFN=!bypassFFN!%%A ) ) ) @@ -18198,30 +18239,12 @@ set build= for /f "delims=" %%a in ('%psc% "$f=[io.file]::ReadAllText('!_batp!') -split ':getbuild\:.*';iex ($f[1])" %nul6%') do (set build=%%a) echo "%build%" | find /i "16." %nul% || set build= -:: Cleanup Office update related registries, thanks to @abbodi1406 -:: https://techcommunity.microsoft.com/t5/office-365-blog/how-to-manage-office-365-proplus-channels-for-it-pros/ba-p/795813 -:: https://learn.microsoft.com/en-us/microsoft-365-apps/updates/change-update-channels#considerations-when-changing-channels - echo: for /f "tokens=1 delims=-" %%A in ("%targetchannel%") do (echo Target update channel: %%A) -echo: -echo Cleaning Office update registry keys... -echo Adding new update channel to registry keys... +echo Target build number: %build% +echo: %bypassFFN% | find /i "%targetFFN%" %nul% && goto :oe_changeunoff -%nul% reg add %o16c2r_reg%\Configuration /v CDNBaseUrl /t REG_SZ /d "https://officecdn.microsoft.com/pr/%targetFFN%" /f -%nul% reg add %o16c2r_reg%\Configuration /v UpdateChannel /t REG_SZ /d "https://officecdn.microsoft.com/pr/%targetFFN%" /f -%nul% reg add %o16c2r_reg%\Configuration /v UpdateChannelChanged /t REG_SZ /d "True" /f -%nul% reg delete %o16c2r_reg%\Configuration /v UnmanagedUpdateURL /f -%nul% reg delete %o16c2r_reg%\Configuration /v UpdateUrl /f -%nul% reg delete %o16c2r_reg%\Configuration /v UpdatePath /f -%nul% reg delete %o16c2r_reg%\Configuration /v UpdateToVersion /f -%nul% reg delete %o16c2r_reg%\Updates /v UpdateToVersion /f -%nul% reg delete HKLM\SOFTWARE\Policies\Microsoft\office\16.0\common\officeupdate /f -%nul% reg delete HKLM\SOFTWARE\Policies\Microsoft\office\16.0\common\officeupdate /f /reg:32 -%nul% reg delete HKCU\SOFTWARE\Policies\Microsoft\office\16.0\common\officeupdate /f -%nul% reg delete HKLM\SOFTWARE\Policies\Microsoft\cloud\office\16.0\Common\officeupdate /f -%nul% reg delete HKLM\SOFTWARE\Policies\Microsoft\cloud\office\16.0\Common\officeupdate /f /reg:32 -%nul% reg delete HKCU\Software\Policies\Microsoft\cloud\office\16.0\Common\officeupdate /f +call :oe_cleanupreg if not defined build ( if %winbuild% GEQ 9200 call :dk_color %Gray% "Failed to detect build number for the target FFN." @@ -18237,6 +18260,76 @@ echo: echo Check this webpage for help - %mas%troubleshoot goto :oe_goback +::======================= + +:: Unofficial method to change channel + +:oe_changeunoff + +set abortchange= +echo %targetchannel% | find /i "2019 VL" %nul% && (for %%A in (%_oIds%) do (echo %%A | find /i "2019Volume" %nul% || set abortchange=1)) +echo %targetchannel% | find /i "2021 VL" %nul% && (for %%A in (%_oIds%) do (echo %%A | find /i "2021Volume" %nul% || set abortchange=1)) +echo %targetchannel% | find /i "2024 VL" %nul% && (for %%A in (%_oIds%) do (echo %%A | find /i "2024Volume" %nul% || set abortchange=1)) + +if defined abortchange ( +%eline% +echo Mismatch found in installed Office products and target update channel. Aborting... +echo Non-perpetual Office products are not suppported with Perpetual VL update channels. +goto :oe_goback +) + +if not defined build ( +%eline% +call :dk_color %Red% "Failed to detect build number for the target FFN." +echo: +set fixes=%fixes% %mas%troubleshoot +call :dk_color2 %Blue% "Check this webpage for help - " %_Yellow% " %mas%troubleshoot" +goto :oe_goback +) + +set buildchk=0 +for /f "tokens=3 delims=." %%a in ("%build%") do set "buildchk=%%a" + +set "c2rcommand="%_c2rExe%" platform=%_oArch% culture=%_lang% productstoadd=%_firstoId%.16_%_lang%_x-none cdnbaseurl.16=http://officecdn.microsoft.com/pr/%targetFFN% baseurl.16=http://officecdn.microsoft.com/pr/%targetFFN% version.16=%build% mediatype.16=CDN sourcetype.16=CDN deliverymechanism=%targetFFN% %_firstoId%.excludedapps.16=%_firstoIdExcludelist% flt.useteamsaddon=disabled flt.usebingaddononinstall=disabled flt.usebingaddononupdate=disabled" +set "c2rclientupdate=!c2rcommand! scenario=CLIENTUPDATE" + +if %clverchk% LSS %buildchk% ( +echo: +call :dk_color %Blue% "Do not break the operation in the middle..." +echo: +echo Updating Office C2R client with the command below, please wait... +echo: +echo %c2rclientupdate% +%c2rclientupdate% +for /l %%i in (1,1,30) do (if !clverchk! LSS %buildchk% (call :ch_getinfo&timeout /t 10 %nul%)) +) + +if %clverchk% LSS %buildchk% ( +echo: +call :dk_color %Red% "Failed to update Office C2R client. Aborting..." +echo: +set fixes=%fixes% %mas%troubleshoot +call :dk_color2 %Blue% "Check this webpage for help - " %_Yellow% " %mas%troubleshoot" +goto :oe_goback +) + +call :oe_cleanupreg + +echo Running the below command to change update channel, please wait... +echo: +echo %c2rcommand% +%c2rcommand% +set errorcode=%errorlevel% +timeout /t 10 %nul% + +echo: +if %errorcode% EQU 0 ( +call :dk_color %Gray% "Now run the Office activation option from the main menu." +) else ( +set fixes=%fixes% %mas%troubleshoot +call :dk_color2 %Blue% "Check this webpage for help - " %_Yellow% " %mas%troubleshoot" +) + ::======================================================================================================================================== :oe_goback @@ -18263,6 +18356,36 @@ goto :oemenu ::======================================================================================================================================== +:oe_cleanupreg + +:: Cleanup Office update related registries, thanks to @abbodi1406 +:: https://techcommunity.microsoft.com/t5/office-365-blog/how-to-manage-office-365-proplus-channels-for-it-pros/ba-p/795813 +:: https://learn.microsoft.com/en-us/microsoft-365-apps/updates/change-update-channels#considerations-when-changing-channels + +echo: +echo Cleaning Office update registry keys... +echo Adding new update channel to registry keys... +echo: + +%nul% reg add %o16c2r_reg%\Configuration /v CDNBaseUrl /t REG_SZ /d "https://officecdn.microsoft.com/pr/%targetFFN%" /f +%nul% reg add %o16c2r_reg%\Configuration /v UpdateChannel /t REG_SZ /d "https://officecdn.microsoft.com/pr/%targetFFN%" /f +%nul% reg add %o16c2r_reg%\Configuration /v UpdateChannelChanged /t REG_SZ /d "True" /f +%nul% reg delete %o16c2r_reg%\Configuration /v UnmanagedUpdateURL /f +%nul% reg delete %o16c2r_reg%\Configuration /v UpdateUrl /f +%nul% reg delete %o16c2r_reg%\Configuration /v UpdatePath /f +%nul% reg delete %o16c2r_reg%\Configuration /v UpdateToVersion /f +%nul% reg delete %o16c2r_reg%\Updates /v UpdateToVersion /f +%nul% reg delete HKLM\SOFTWARE\Policies\Microsoft\office\16.0\common\officeupdate /f +%nul% reg delete HKLM\SOFTWARE\Policies\Microsoft\office\16.0\common\officeupdate /f /reg:32 +%nul% reg delete HKCU\SOFTWARE\Policies\Microsoft\office\16.0\common\officeupdate /f +%nul% reg delete HKLM\SOFTWARE\Policies\Microsoft\cloud\office\16.0\Common\officeupdate /f +%nul% reg delete HKLM\SOFTWARE\Policies\Microsoft\cloud\office\16.0\Common\officeupdate /f /reg:32 +%nul% reg delete HKCU\Software\Policies\Microsoft\cloud\office\16.0\Common\officeupdate /f + +exit /b + +::======================================================================================================================================== + :oe_tempcleanup del /f /q %SystemRoot%\Temp\SingleApps_Volume.txt %nul% @@ -18282,6 +18405,7 @@ set _oRoot= set _oArch= set _updch= set _oIds= +set _firstoId= set _lang= set _cfolder= set _version= @@ -18312,9 +18436,13 @@ for /f "tokens=%_tok% delims=\" %%a in ('reg query "%o16c2r_reg%\ProductReleaseI if defined _oIds (set "_oIds=!_oIds! %%a") else (set "_oIds=%%a") ) set _oIds=%_oIds:.16=% +for /f "tokens=1" %%A in ("%_oIds%") do set _firstoId=%%A +for /f "skip=2 tokens=2*" %%a in ('"reg query %o16c2r_reg%\Configuration /v %_firstoId%.ExcludedApps" %nul6%') do (set "_firstoIdExcludelist=%%b") set verchk=0 +set clverchk=0 for /f "tokens=3 delims=." %%a in ("%_version%") do set "verchk=%%a" +for /f "tokens=3 delims=." %%a in ("%_clversion%") do set "clverchk=%%a" if exist "%_oRoot%\Licenses16\c2rpridslicensefiles_auto.xml" set "_c2rXml=%_oRoot%\Licenses16\c2rpridslicensefiles_auto.xml" @@ -18330,16 +18458,13 @@ if exist "%_cfolder%\OfficeC2RClient.exe" ( set "_c2rCexe=%_cfolder%\OfficeC2RClient.exe" ) -set "audidata4=%_AudienceData:~-4%" +:: Check LTSC version files -if /i "%audidata4%"=="LTSC" set ltsc19=LTSC -echo %_clversion% %_version% | findstr "16.0.103 16.0.104 16.0.105" %nul% && set ltsc19=LTSC - -if /i "%audidata4%"=="2021" set ltsc21=LTSC2021 -echo %_clversion% %_version% | findstr "16.0.14332" %nul% && set ltsc21=LTSC2021 - -if /i "%audidata4%"=="2024" set ltsc24=LTSC2024 -:: LTSC 2024 build is not fixed yet +for /f "skip=2 tokens=2*" %%a in ('"reg query %o16c2r_reg%\ProductReleaseIDs\%_actconfig%" /s %nul6%') do ( +echo "%%b" %nul2% | findstr "16.0.103 16.0.104 16.0.105" %nul% && set ltsc19=LTSC +echo "%%b" %nul2% | findstr "16.0.14332" %nul% && set ltsc21=LTSC2021 +echo "%%b" %nul2% | findstr "16.0.17932" %nul% && set ltsc24=LTSC2024 +) if not "%ltsc19%%ltsc21%%ltsc24%"=="" set ltscfound=1 diff --git a/MAS/Separate-Files-Version/Change_Office_Edition.cmd b/MAS/Separate-Files-Version/Change_Office_Edition.cmd index b5bd456..a14988b 100644 --- a/MAS/Separate-Files-Version/Change_Office_Edition.cmd +++ b/MAS/Separate-Files-Version/Change_Office_Edition.cmd @@ -415,6 +415,7 @@ _updch _lang _clversion _version +_AudienceData _oIds _c2rXml _c2rExe @@ -802,8 +803,39 @@ set errorcode=%errorlevel% timeout /t 10 %nul% echo: +set suggestchannel= + if %errorcode% EQU 0 ( -call :dk_color %Gray% "Now run the Office activation option from the main menu." +echo %targetedition% | find /i "2019Volume" %nul% && ( +if not defined ltsc19 set suggestchannel=Production::LTSC +if /i not %_AudienceData%==Production::LTSC set suggestchannel=Production::LTSC +if /i not %_updch%==F2E724C1-748F-4B47-8FB8-8E0D210E9208 set suggestchannel=Production::LTSC +) + +echo %targetedition% | find /i "2021Volume" %nul% && ( +if not defined ltsc21 set suggestchannel=Production::LTSC2021 +if /i not %_AudienceData%==Production::LTSC2021 set suggestchannel=Production::LTSC2021 +if /i not %_updch%==5030841D-C919-4594-8D2D-84AE4F96E58E set suggestchannel=Production::LTSC2021 +) + +echo %targetedition% | find /i "2024Volume" %nul% && ( +if not defined ltsc24 set suggestchannel=Production::LTSC2024 +if /i not %_AudienceData%==Production::LTSC2024 set suggestchannel=Production::LTSC2024 +if /i not %_updch%==7983BAC0-E531-40CF-BE00-FD24FE66619C set suggestchannel=Production::LTSC2024 +) + +echo %targetedition% | findstr /R "20.*Volume" %nul% || ( +if defined ltscfound set suggestchannel=Production::CC +echo %_AudienceData% | find /i "LTSC" %nul% && set suggestchannel=Production::CC +) + +if defined suggestchannel ( +call :dk_color %Gray% "Mismatch found in update channel and installed product." +call :dk_color %Blue% "It is recommended to change the update channel to [!suggestchannel!] from the previous menu." +) + +echo: +call :dk_color %Gray% "To activate Office, run the activation option from the main menu." ) else ( set fixes=%fixes% %mas%troubleshoot call :dk_color2 %Blue% "Check this webpage for help - " %_Yellow% " %mas%troubleshoot" @@ -980,6 +1012,12 @@ echo Installed Office editions: %_oIds% echo Unsupported Office edition is installed on your Windows build version %winbuild%. goto :oe_goback ) +if defined ltscfound ( +%eline% +echo Installed Office update channel: %ltsc19%%ltsc21%%ltsc24% +echo Unsupported Office update channel is installed on your Windows build version %winbuild%. +goto :oe_goback +) ) ::=============== @@ -988,49 +1026,52 @@ set inpt= set counter=0 set verified=0 set targetFFN= +set bypassFFN= set targetchannel= %line% echo: call :dk_color %Gray% "Installed update channel: %_AudienceData%, %_version%, Client: %_clversion%" -call :dk_color %Gray% "Unsupported update channels are excluded from this list." +call :dk_color %Gray% "Installed Office editions: %_oIds%" %line% echo: for %%# in ( -"5440FD1F-7ECB-4221-8110-145EFAA6372F_Insider Fast [Beta] - Insiders::DevMain" -"64256AFE-F5D9-4F86-8936-8840A6A4F5BE_Monthly Preview - Insiders::CC" -"492350F6-3A01-4F97-B9C0-C7C6DDF67D60_Monthly [Current] - Production::CC" -"55336B82-A18D-4DD6-B5F6-9E5095C314A6_Monthly Enterprise - Production::MEC" -"B8F9B850-328D-4355-9145-C59439A0C4CF_Semi Annual Preview - Insiders::FRDC" -"7FFBC6BF-BC32-4F92-8982-F9DD17FD3114_Semi Annual - Production::DC" -"EA4A4090-DE26-49D7-93C1-91BFF9E53FC3_DevMain Channel - Dogfood::DevMain" -"B61285DD-D9F7-41F2-9757-8F61CBA4E9C8_Microsoft Elite - Microsoft::DevMain" -"F2E724C1-748F-4B47-8FB8-8E0D210E9208_Perpetual2019 VL - Production::LTSC" -"1D2D2EA6-1680-4C56-AC58-A441C8C24FF9_Microsoft2019 VL - Microsoft::LTSC" -"5030841D-C919-4594-8D2D-84AE4F96E58E_Perpetual2021 VL - Production::LTSC2021" -"86752282-5841-4120-AC80-DB03AE6B5FDB_Microsoft2021 VL - Microsoft::LTSC2021" -"7983BAC0-E531-40CF-BE00-FD24FE66619C_Perpetual2024 VL - Production::LTSC2024" -"C02D8FE6-5242-4DA8-972F-82EE55E00671_Microsoft2024 VL - Microsoft::LTSC2024" +"5440fd1f-7ecb-4221-8110-145efaa6372f_Insider Fast [Beta] - Insiders::DevMain -" +"64256afe-f5d9-4f86-8936-8840a6a4f5be_Monthly Preview - Insiders::CC -" +"492350f6-3a01-4f97-b9c0-c7c6ddf67d60_Monthly [Current] - Production::CC -" +"55336b82-a18d-4dd6-b5f6-9e5095c314a6_Monthly Enterprise - Production::MEC -" +"b8f9b850-328d-4355-9145-c59439a0c4cf_Semi Annual Preview - Insiders::FRDC -" +"7ffbc6bf-bc32-4f92-8982-f9dd17fd3114_Semi Annual - Production::DC -" +"ea4a4090-de26-49d7-93c1-91bff9e53fc3_DevMain Channel - Dogfood::DevMain -" +"b61285dd-d9f7-41f2-9757-8f61cba4e9c8_Microsoft Elite - Microsoft::DevMain -" +"f2e724c1-748f-4b47-8fb8-8e0d210e9208_Perpetual2019 VL - Production::LTSC -" +"1d2d2ea6-1680-4c56-ac58-a441c8c24ff9_Microsoft2019 VL - Microsoft::LTSC -" +"5030841d-c919-4594-8d2d-84ae4f96e58e_Perpetual2021 VL - Production::LTSC2021 -" +"86752282-5841-4120-ac80-db03ae6b5fdb_Microsoft2021 VL - Microsoft::LTSC2021 -" +"7983bac0-e531-40cf-be00-fd24fe66619c_Perpetual2024 VL - Production::LTSC2024 -" +"c02d8fe6-5242-4da8-972f-82ee55e00671_Microsoft2024 VL - Microsoft::LTSC2024 -" ) do ( for /f "tokens=1-2 delims=_" %%A in ("%%~#") do ( +set bypass= 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 %%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 ltsc19 echo %%B | find /i "2019 VL" %nul% || set bypass=1 +if defined ltsc21 echo %%B | find /i "2021 VL" %nul% || set bypass=1 +if defined ltsc24 echo %%B | find /i "2024 VL" %nul% || set bypass=1 +if not defined ltscfound echo %%B | find /i "LTSC" %nul% && set bypass=1 ) if defined supported ( set /a counter+=1 if !counter! LSS 10 ( -echo [!counter!] %%B +if defined bypass (echo [!counter!] %%B Unofficial change method will be used) else (echo [!counter!] %%B) ) else ( -echo [!counter!] %%B +if defined bypass (echo [!counter!] %%B Unofficial change method will be used) else (echo [!counter!] %%B) ) set targetFFN!counter!=%%A set targetchannel!counter!=%%B +if defined bypass set bypassFFN=!bypassFFN!%%A ) ) ) @@ -1061,30 +1102,12 @@ set build= for /f "delims=" %%a in ('%psc% "$f=[io.file]::ReadAllText('!_batp!') -split ':getbuild\:.*';iex ($f[1])" %nul6%') do (set build=%%a) echo "%build%" | find /i "16." %nul% || set build= -:: Cleanup Office update related registries, thanks to @abbodi1406 -:: https://techcommunity.microsoft.com/t5/office-365-blog/how-to-manage-office-365-proplus-channels-for-it-pros/ba-p/795813 -:: https://learn.microsoft.com/en-us/microsoft-365-apps/updates/change-update-channels#considerations-when-changing-channels - echo: for /f "tokens=1 delims=-" %%A in ("%targetchannel%") do (echo Target update channel: %%A) -echo: -echo Cleaning Office update registry keys... -echo Adding new update channel to registry keys... +echo Target build number: %build% +echo: %bypassFFN% | find /i "%targetFFN%" %nul% && goto :oe_changeunoff -%nul% reg add %o16c2r_reg%\Configuration /v CDNBaseUrl /t REG_SZ /d "https://officecdn.microsoft.com/pr/%targetFFN%" /f -%nul% reg add %o16c2r_reg%\Configuration /v UpdateChannel /t REG_SZ /d "https://officecdn.microsoft.com/pr/%targetFFN%" /f -%nul% reg add %o16c2r_reg%\Configuration /v UpdateChannelChanged /t REG_SZ /d "True" /f -%nul% reg delete %o16c2r_reg%\Configuration /v UnmanagedUpdateURL /f -%nul% reg delete %o16c2r_reg%\Configuration /v UpdateUrl /f -%nul% reg delete %o16c2r_reg%\Configuration /v UpdatePath /f -%nul% reg delete %o16c2r_reg%\Configuration /v UpdateToVersion /f -%nul% reg delete %o16c2r_reg%\Updates /v UpdateToVersion /f -%nul% reg delete HKLM\SOFTWARE\Policies\Microsoft\office\16.0\common\officeupdate /f -%nul% reg delete HKLM\SOFTWARE\Policies\Microsoft\office\16.0\common\officeupdate /f /reg:32 -%nul% reg delete HKCU\SOFTWARE\Policies\Microsoft\office\16.0\common\officeupdate /f -%nul% reg delete HKLM\SOFTWARE\Policies\Microsoft\cloud\office\16.0\Common\officeupdate /f -%nul% reg delete HKLM\SOFTWARE\Policies\Microsoft\cloud\office\16.0\Common\officeupdate /f /reg:32 -%nul% reg delete HKCU\Software\Policies\Microsoft\cloud\office\16.0\Common\officeupdate /f +call :oe_cleanupreg if not defined build ( if %winbuild% GEQ 9200 call :dk_color %Gray% "Failed to detect build number for the target FFN." @@ -1100,6 +1123,76 @@ echo: echo Check this webpage for help - %mas%troubleshoot goto :oe_goback +::======================= + +:: Unofficial method to change channel + +:oe_changeunoff + +set abortchange= +echo %targetchannel% | find /i "2019 VL" %nul% && (for %%A in (%_oIds%) do (echo %%A | find /i "2019Volume" %nul% || set abortchange=1)) +echo %targetchannel% | find /i "2021 VL" %nul% && (for %%A in (%_oIds%) do (echo %%A | find /i "2021Volume" %nul% || set abortchange=1)) +echo %targetchannel% | find /i "2024 VL" %nul% && (for %%A in (%_oIds%) do (echo %%A | find /i "2024Volume" %nul% || set abortchange=1)) + +if defined abortchange ( +%eline% +echo Mismatch found in installed Office products and target update channel. Aborting... +echo Non-perpetual Office products are not suppported with Perpetual VL update channels. +goto :oe_goback +) + +if not defined build ( +%eline% +call :dk_color %Red% "Failed to detect build number for the target FFN." +echo: +set fixes=%fixes% %mas%troubleshoot +call :dk_color2 %Blue% "Check this webpage for help - " %_Yellow% " %mas%troubleshoot" +goto :oe_goback +) + +set buildchk=0 +for /f "tokens=3 delims=." %%a in ("%build%") do set "buildchk=%%a" + +set "c2rcommand="%_c2rExe%" platform=%_oArch% culture=%_lang% productstoadd=%_firstoId%.16_%_lang%_x-none cdnbaseurl.16=http://officecdn.microsoft.com/pr/%targetFFN% baseurl.16=http://officecdn.microsoft.com/pr/%targetFFN% version.16=%build% mediatype.16=CDN sourcetype.16=CDN deliverymechanism=%targetFFN% %_firstoId%.excludedapps.16=%_firstoIdExcludelist% flt.useteamsaddon=disabled flt.usebingaddononinstall=disabled flt.usebingaddononupdate=disabled" +set "c2rclientupdate=!c2rcommand! scenario=CLIENTUPDATE" + +if %clverchk% LSS %buildchk% ( +echo: +call :dk_color %Blue% "Do not break the operation in the middle..." +echo: +echo Updating Office C2R client with the command below, please wait... +echo: +echo %c2rclientupdate% +%c2rclientupdate% +for /l %%i in (1,1,30) do (if !clverchk! LSS %buildchk% (call :ch_getinfo&timeout /t 10 %nul%)) +) + +if %clverchk% LSS %buildchk% ( +echo: +call :dk_color %Red% "Failed to update Office C2R client. Aborting..." +echo: +set fixes=%fixes% %mas%troubleshoot +call :dk_color2 %Blue% "Check this webpage for help - " %_Yellow% " %mas%troubleshoot" +goto :oe_goback +) + +call :oe_cleanupreg + +echo Running the below command to change update channel, please wait... +echo: +echo %c2rcommand% +%c2rcommand% +set errorcode=%errorlevel% +timeout /t 10 %nul% + +echo: +if %errorcode% EQU 0 ( +call :dk_color %Gray% "Now run the Office activation option from the main menu." +) else ( +set fixes=%fixes% %mas%troubleshoot +call :dk_color2 %Blue% "Check this webpage for help - " %_Yellow% " %mas%troubleshoot" +) + ::======================================================================================================================================== :oe_goback @@ -1126,6 +1219,36 @@ goto :oemenu ::======================================================================================================================================== +:oe_cleanupreg + +:: Cleanup Office update related registries, thanks to @abbodi1406 +:: https://techcommunity.microsoft.com/t5/office-365-blog/how-to-manage-office-365-proplus-channels-for-it-pros/ba-p/795813 +:: https://learn.microsoft.com/en-us/microsoft-365-apps/updates/change-update-channels#considerations-when-changing-channels + +echo: +echo Cleaning Office update registry keys... +echo Adding new update channel to registry keys... +echo: + +%nul% reg add %o16c2r_reg%\Configuration /v CDNBaseUrl /t REG_SZ /d "https://officecdn.microsoft.com/pr/%targetFFN%" /f +%nul% reg add %o16c2r_reg%\Configuration /v UpdateChannel /t REG_SZ /d "https://officecdn.microsoft.com/pr/%targetFFN%" /f +%nul% reg add %o16c2r_reg%\Configuration /v UpdateChannelChanged /t REG_SZ /d "True" /f +%nul% reg delete %o16c2r_reg%\Configuration /v UnmanagedUpdateURL /f +%nul% reg delete %o16c2r_reg%\Configuration /v UpdateUrl /f +%nul% reg delete %o16c2r_reg%\Configuration /v UpdatePath /f +%nul% reg delete %o16c2r_reg%\Configuration /v UpdateToVersion /f +%nul% reg delete %o16c2r_reg%\Updates /v UpdateToVersion /f +%nul% reg delete HKLM\SOFTWARE\Policies\Microsoft\office\16.0\common\officeupdate /f +%nul% reg delete HKLM\SOFTWARE\Policies\Microsoft\office\16.0\common\officeupdate /f /reg:32 +%nul% reg delete HKCU\SOFTWARE\Policies\Microsoft\office\16.0\common\officeupdate /f +%nul% reg delete HKLM\SOFTWARE\Policies\Microsoft\cloud\office\16.0\Common\officeupdate /f +%nul% reg delete HKLM\SOFTWARE\Policies\Microsoft\cloud\office\16.0\Common\officeupdate /f /reg:32 +%nul% reg delete HKCU\Software\Policies\Microsoft\cloud\office\16.0\Common\officeupdate /f + +exit /b + +::======================================================================================================================================== + :oe_tempcleanup del /f /q %SystemRoot%\Temp\SingleApps_Volume.txt %nul% @@ -1145,6 +1268,7 @@ set _oRoot= set _oArch= set _updch= set _oIds= +set _firstoId= set _lang= set _cfolder= set _version= @@ -1175,9 +1299,13 @@ for /f "tokens=%_tok% delims=\" %%a in ('reg query "%o16c2r_reg%\ProductReleaseI if defined _oIds (set "_oIds=!_oIds! %%a") else (set "_oIds=%%a") ) set _oIds=%_oIds:.16=% +for /f "tokens=1" %%A in ("%_oIds%") do set _firstoId=%%A +for /f "skip=2 tokens=2*" %%a in ('"reg query %o16c2r_reg%\Configuration /v %_firstoId%.ExcludedApps" %nul6%') do (set "_firstoIdExcludelist=%%b") set verchk=0 +set clverchk=0 for /f "tokens=3 delims=." %%a in ("%_version%") do set "verchk=%%a" +for /f "tokens=3 delims=." %%a in ("%_clversion%") do set "clverchk=%%a" if exist "%_oRoot%\Licenses16\c2rpridslicensefiles_auto.xml" set "_c2rXml=%_oRoot%\Licenses16\c2rpridslicensefiles_auto.xml" @@ -1193,16 +1321,13 @@ if exist "%_cfolder%\OfficeC2RClient.exe" ( set "_c2rCexe=%_cfolder%\OfficeC2RClient.exe" ) -set "audidata4=%_AudienceData:~-4%" +:: Check LTSC version files -if /i "%audidata4%"=="LTSC" set ltsc19=LTSC -echo %_clversion% %_version% | findstr "16.0.103 16.0.104 16.0.105" %nul% && set ltsc19=LTSC - -if /i "%audidata4%"=="2021" set ltsc21=LTSC2021 -echo %_clversion% %_version% | findstr "16.0.14332" %nul% && set ltsc21=LTSC2021 - -if /i "%audidata4%"=="2024" set ltsc24=LTSC2024 -:: LTSC 2024 build is not fixed yet +for /f "skip=2 tokens=2*" %%a in ('"reg query %o16c2r_reg%\ProductReleaseIDs\%_actconfig%" /s %nul6%') do ( +echo "%%b" %nul2% | findstr "16.0.103 16.0.104 16.0.105" %nul% && set ltsc19=LTSC +echo "%%b" %nul2% | findstr "16.0.14332" %nul% && set ltsc21=LTSC2021 +echo "%%b" %nul2% | findstr "16.0.17932" %nul% && set ltsc24=LTSC2024 +) if not "%ltsc19%%ltsc21%%ltsc24%"=="" set ltscfound=1 From 6e74d497218be8f47ab7e547c5eb60e677612360 Mon Sep 17 00:00:00 2001 From: WindowsAddict Date: Fri, 23 May 2025 18:20:53 +0530 Subject: [PATCH 61/79] Minor fix --- MAS/All-In-One-Version-KL/MAS_AIO.cmd | 3 ++- MAS/Separate-Files-Version/Change_Office_Edition.cmd | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/MAS/All-In-One-Version-KL/MAS_AIO.cmd b/MAS/All-In-One-Version-KL/MAS_AIO.cmd index e43bb90..a95d9e4 100644 --- a/MAS/All-In-One-Version-KL/MAS_AIO.cmd +++ b/MAS/All-In-One-Version-KL/MAS_AIO.cmd @@ -17943,6 +17943,7 @@ echo: set suggestchannel= if %errorcode% EQU 0 ( +if %change%==1 ( echo %targetedition% | find /i "2019Volume" %nul% && ( if not defined ltsc19 set suggestchannel=Production::LTSC if /i not %_AudienceData%==Production::LTSC set suggestchannel=Production::LTSC @@ -17970,8 +17971,8 @@ if defined suggestchannel ( call :dk_color %Gray% "Mismatch found in update channel and installed product." call :dk_color %Blue% "It is recommended to change the update channel to [!suggestchannel!] from the previous menu." ) - echo: +) call :dk_color %Gray% "To activate Office, run the activation option from the main menu." ) else ( set fixes=%fixes% %mas%troubleshoot diff --git a/MAS/Separate-Files-Version/Change_Office_Edition.cmd b/MAS/Separate-Files-Version/Change_Office_Edition.cmd index a14988b..61c908a 100644 --- a/MAS/Separate-Files-Version/Change_Office_Edition.cmd +++ b/MAS/Separate-Files-Version/Change_Office_Edition.cmd @@ -806,6 +806,7 @@ echo: set suggestchannel= if %errorcode% EQU 0 ( +if %change%==1 ( echo %targetedition% | find /i "2019Volume" %nul% && ( if not defined ltsc19 set suggestchannel=Production::LTSC if /i not %_AudienceData%==Production::LTSC set suggestchannel=Production::LTSC @@ -833,8 +834,8 @@ if defined suggestchannel ( call :dk_color %Gray% "Mismatch found in update channel and installed product." call :dk_color %Blue% "It is recommended to change the update channel to [!suggestchannel!] from the previous menu." ) - echo: +) call :dk_color %Gray% "To activate Office, run the activation option from the main menu." ) else ( set fixes=%fixes% %mas%troubleshoot From 69c469a9971379b5c3eb955866896cf230e8a6bc Mon Sep 17 00:00:00 2001 From: WindowsAddict Date: Fri, 23 May 2025 18:56:14 +0530 Subject: [PATCH 62/79] Update old Office version detection with subscription license --- MAS/All-In-One-Version-KL/MAS_AIO.cmd | 4 ++-- .../Activators/Ohook_Activation_AIO.cmd | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/MAS/All-In-One-Version-KL/MAS_AIO.cmd b/MAS/All-In-One-Version-KL/MAS_AIO.cmd index a95d9e4..204f400 100644 --- a/MAS/All-In-One-Version-KL/MAS_AIO.cmd +++ b/MAS/All-In-One-Version-KL/MAS_AIO.cmd @@ -2471,12 +2471,12 @@ call :oh_hookinstall ::======================================================================================================================================== -:: Old version (16.0.9xxxx and below) of Office with subscription license key may show a banner to sign in to fix license issue. +:: Old version of Office with subscription license key may show a banner to sign in to fix license issue. :: Although script applies a Resiliency registry entry to fix that but it doesn't work on old office versions. :: Below code checks that condition and informs the user to update the Office. if defined _sublic ( -if not exist "%_oLPath%\Word2019VL_KMS_Client_AE*.xrm-ms" ( +if not exist "%_oLPath%\Word2021VL_KMS_Client_AE*.xrm-ms" ( call :dk_color %Gray% "Checking Old Office With Sub License [Found. Update Office, otherwise, it may show a licensing issue-related banner.]" ) ) diff --git a/MAS/Separate-Files-Version/Activators/Ohook_Activation_AIO.cmd b/MAS/Separate-Files-Version/Activators/Ohook_Activation_AIO.cmd index 6e06bf1..cee100b 100644 --- a/MAS/Separate-Files-Version/Activators/Ohook_Activation_AIO.cmd +++ b/MAS/Separate-Files-Version/Activators/Ohook_Activation_AIO.cmd @@ -671,12 +671,12 @@ call :oh_hookinstall ::======================================================================================================================================== -:: Old version (16.0.9xxxx and below) of Office with subscription license key may show a banner to sign in to fix license issue. +:: Old version of Office with subscription license key may show a banner to sign in to fix license issue. :: Although script applies a Resiliency registry entry to fix that but it doesn't work on old office versions. :: Below code checks that condition and informs the user to update the Office. if defined _sublic ( -if not exist "%_oLPath%\Word2019VL_KMS_Client_AE*.xrm-ms" ( +if not exist "%_oLPath%\Word2021VL_KMS_Client_AE*.xrm-ms" ( call :dk_color %Gray% "Checking Old Office With Sub License [Found. Update Office, otherwise, it may show a licensing issue-related banner.]" ) ) From fc80735dacd135daf6f0f1821ff80773022b76a0 Mon Sep 17 00:00:00 2001 From: WindowsAddict Date: Sun, 25 May 2025 00:38:43 +0530 Subject: [PATCH 63/79] Improve fix info in the script --- MAS/All-In-One-Version-KL/MAS_AIO.cmd | 20 ++++--------------- .../Change_Office_Edition.cmd | 14 ++----------- .../Change_Windows_Edition.cmd | 6 ++---- 3 files changed, 8 insertions(+), 32 deletions(-) diff --git a/MAS/All-In-One-Version-KL/MAS_AIO.cmd b/MAS/All-In-One-Version-KL/MAS_AIO.cmd index 204f400..9b215ee 100644 --- a/MAS/All-In-One-Version-KL/MAS_AIO.cmd +++ b/MAS/All-In-One-Version-KL/MAS_AIO.cmd @@ -16637,8 +16637,7 @@ if not defined allapps ( %eline% echo Failed to find activation IDs. Aborting... echo: -set fixes=%fixes% %mas%troubleshoot -call :dk_color2 %Blue% "Check this webpage for help - " %_Yellow% " %mas%troubleshoot" +call :dk_color %Blue% "To fix this issue, activate Windows from the main menu." goto dk_done ) @@ -16660,8 +16659,7 @@ if not defined osedition ( %eline% echo Failed to detect OS edition, aborting... echo: -set fixes=%fixes% %mas%troubleshoot -call :dk_color2 %Blue% "Check this webpage for help - " %_Yellow% " %mas%troubleshoot" +call :dk_color %Blue% "To fix this issue, activate Windows from the main menu." goto dk_done ) @@ -17460,15 +17458,6 @@ echo: echo Initializing... echo: -if not exist %SysPath%\sppsvc.exe ( -%eline% -echo [%SysPath%\sppsvc.exe] file is missing. Aborting... -echo: -set fixes=%fixes% %mas%troubleshoot -call :dk_color2 %Blue% "Check this webpage for help - " %_Yellow% " %mas%troubleshoot" -goto dk_done -) - ::======================================================================================================================================== set spp=SoftwareLicensingProduct @@ -17502,8 +17491,7 @@ if %osedition%==0 ( %eline% echo Failed to detect OS Edition. Aborting... echo: -set fixes=%fixes% %mas%troubleshoot -call :dk_color2 %Blue% "Check this webpage for help - " %_Yellow% " %mas%troubleshoot" +call :dk_color %Blue% "To fix this issue, activate Windows from the main menu." goto dk_done ) @@ -18296,7 +18284,7 @@ set "c2rclientupdate=!c2rcommand! scenario=CLIENTUPDATE" if %clverchk% LSS %buildchk% ( echo: -call :dk_color %Blue% "Do not break the operation in the middle..." +call :dk_color %Blue% "Do not terminate the operation before it completes..." echo: echo Updating Office C2R client with the command below, please wait... echo: diff --git a/MAS/Separate-Files-Version/Change_Office_Edition.cmd b/MAS/Separate-Files-Version/Change_Office_Edition.cmd index 61c908a..6926cd0 100644 --- a/MAS/Separate-Files-Version/Change_Office_Edition.cmd +++ b/MAS/Separate-Files-Version/Change_Office_Edition.cmd @@ -323,15 +323,6 @@ echo: echo Initializing... echo: -if not exist %SysPath%\sppsvc.exe ( -%eline% -echo [%SysPath%\sppsvc.exe] file is missing. Aborting... -echo: -set fixes=%fixes% %mas%troubleshoot -call :dk_color2 %Blue% "Check this webpage for help - " %_Yellow% " %mas%troubleshoot" -goto dk_done -) - ::======================================================================================================================================== set spp=SoftwareLicensingProduct @@ -365,8 +356,7 @@ if %osedition%==0 ( %eline% echo Failed to detect OS Edition. Aborting... echo: -set fixes=%fixes% %mas%troubleshoot -call :dk_color2 %Blue% "Check this webpage for help - " %_Yellow% " %mas%troubleshoot" +call :dk_color %Blue% "To fix this issue, activate Windows from the main menu." goto dk_done ) @@ -1159,7 +1149,7 @@ set "c2rclientupdate=!c2rcommand! scenario=CLIENTUPDATE" if %clverchk% LSS %buildchk% ( echo: -call :dk_color %Blue% "Do not break the operation in the middle..." +call :dk_color %Blue% "Do not terminate the operation before it completes..." echo: echo Updating Office C2R client with the command below, please wait... echo: diff --git a/MAS/Separate-Files-Version/Change_Windows_Edition.cmd b/MAS/Separate-Files-Version/Change_Windows_Edition.cmd index eaa0956..5bfc43e 100644 --- a/MAS/Separate-Files-Version/Change_Windows_Edition.cmd +++ b/MAS/Separate-Files-Version/Change_Windows_Edition.cmd @@ -390,8 +390,7 @@ if not defined allapps ( %eline% echo Failed to find activation IDs. Aborting... echo: -set fixes=%fixes% %mas%troubleshoot -call :dk_color2 %Blue% "Check this webpage for help - " %_Yellow% " %mas%troubleshoot" +call :dk_color %Blue% "To fix this issue, activate Windows from the main menu." goto dk_done ) @@ -413,8 +412,7 @@ if not defined osedition ( %eline% echo Failed to detect OS edition, aborting... echo: -set fixes=%fixes% %mas%troubleshoot -call :dk_color2 %Blue% "Check this webpage for help - " %_Yellow% " %mas%troubleshoot" +call :dk_color %Blue% "To fix this issue, activate Windows from the main menu." goto dk_done ) From be867f6616e7408342c00346bcee49268b966778 Mon Sep 17 00:00:00 2001 From: WindowsAddict Date: Tue, 27 May 2025 19:32:44 +0530 Subject: [PATCH 64/79] Update links --- MAS/All-In-One-Version-KL/MAS_AIO.cmd | 12 +++++++----- .../Activators/HWID_Activation.cmd | 6 ++++-- .../Activators/KMS38_Activation.cmd | 6 ++++-- .../Activators/Ohook_Activation_AIO.cmd | 6 ++++-- .../Activators/Online_KMS_Activation.cmd | 6 ++++-- .../Activators/TSforge_Activation.cmd | 6 ++++-- MAS/Separate-Files-Version/Change_Office_Edition.cmd | 8 +++++--- .../Change_Windows_Edition.cmd | 6 ++++-- MAS/Separate-Files-Version/Extract_OEM_Folder.cmd | 6 ++++-- MAS/Separate-Files-Version/Troubleshoot.cmd | 8 +++++--- 10 files changed, 45 insertions(+), 25 deletions(-) diff --git a/MAS/All-In-One-Version-KL/MAS_AIO.cmd b/MAS/All-In-One-Version-KL/MAS_AIO.cmd index 9b215ee..ced0953 100644 --- a/MAS/All-In-One-Version-KL/MAS_AIO.cmd +++ b/MAS/All-In-One-Version-KL/MAS_AIO.cmd @@ -67,6 +67,8 @@ exit /b set "blank=" set "mas=ht%blank%tps%blank%://mass%blank%grave.dev/" +set "github=ht%blank%tps%blank%://github.com/massgra%blank%vel/Micro%blank%soft-Acti%blank%vation-Scripts" +set "selfgit=ht%blank%tps%blank%://git.acti%blank%vated.win/massg%blank%rave/Micr%blank%osoft-Act%blank%ivation-Scripts" :: Check if Null service is working, it's important for the batch script @@ -334,7 +336,7 @@ echo: call :dk_color %_Green% "Choose a menu option using your keyboard [1,0] :" choice /C:10 /N if !errorlevel!==2 rem -if !errorlevel!==1 (start https://git.activated.win/massg%-%rave/Micr%-%osoft-Act%-%ivation-Scripts & start https://github.com/massgra%-%vel/Micro%-%soft-Acti%-%vation-Scripts & start %mas% & exit /b) +if !errorlevel!==1 (start %selfgit% & start %github% & start %mas% & exit /b) ) ) @@ -431,7 +433,7 @@ choice /C:123456789EH0 /N set _erl=%errorlevel% if %_erl%==12 exit /b -if %_erl%==11 start %mas%troubleshoot & goto :MainMenu +if %_erl%==11 (start %selfgit% & start %github% & start %mas%troubleshoot & goto :MainMenu) if %_erl%==10 goto :Extras if %_erl%==9 setlocal & call :troubleshoot & cls & endlocal & goto :MainMenu if %_erl%==8 setlocal & call :change_offedition & cls & endlocal & goto :MainMenu @@ -2004,7 +2006,7 @@ call :dk_color %White% "Follow ALL the ABOVE blue lines. " call :dk_color2 %Blue% "Press [1] to Open Support Webpage " %Gray% " Press [0] to Ignore" choice /C:10 /N if !errorlevel!==2 exit /b -if !errorlevel!==1 (start https://git.activated.win/massg%-%rave/Micr%-%osoft-Act%-%ivation-Scripts & start https://github.com/massgra%-%vel/Micro%-%soft-Acti%-%vation-Scripts & for %%# in (%fixes%) do (start %%#)) +if !errorlevel!==1 (start %selfgit% & start %github% & for %%# in (%fixes%) do (start %%#)) ) if defined terminal ( @@ -15530,7 +15532,7 @@ if %_erl%==5 goto:retokens if %_erl%==4 goto:fixwmi if %_erl%==3 goto:sfcscan if %_erl%==2 goto:dism_rest -if %_erl%==1 start %mas%troubleshoot.html &goto at_menu +if %_erl%==1 (start %selfgit% & start %github% & start %mas%troubleshoot & goto at_menu) goto :at_menu ::======================================================================================================================================== @@ -18331,7 +18333,7 @@ call :dk_color %White% "Follow ALL the ABOVE blue lines. " call :dk_color2 %Blue% "Press [1] to Open Support Webpage " %Gray% " Press [0] to Ignore" choice /C:10 /N if !errorlevel!==2 goto :oemenu -if !errorlevel!==1 (start https://git.activated.win/massg%-%rave/Micr%-%osoft-Act%-%ivation-Scripts & start https://github.com/massgra%-%vel/Micro%-%soft-Acti%-%vation-Scripts & for %%# in (%fixes%) do (start %%#)) +if !errorlevel!==1 (start %selfgit% & start %github% & for %%# in (%fixes%) do (start %%#)) ) if defined terminal ( diff --git a/MAS/Separate-Files-Version/Activators/HWID_Activation.cmd b/MAS/Separate-Files-Version/Activators/HWID_Activation.cmd index 02be6af..2b1fe2e 100644 --- a/MAS/Separate-Files-Version/Activators/HWID_Activation.cmd +++ b/MAS/Separate-Files-Version/Activators/HWID_Activation.cmd @@ -100,6 +100,8 @@ set "nul=" set "blank=" set "mas=ht%blank%tps%blank%://mass%blank%grave.dev/" +set "github=ht%blank%tps%blank%://github.com/massgra%blank%vel/Micro%blank%soft-Acti%blank%vation-Scripts" +set "selfgit=ht%blank%tps%blank%://git.acti%blank%vated.win/massg%blank%rave/Micr%blank%osoft-Act%blank%ivation-Scripts" :: Check if Null service is working, it's important for the batch script @@ -356,7 +358,7 @@ echo: call :dk_color %_Green% "Choose a menu option using your keyboard [1,0] :" choice /C:10 /N if !errorlevel!==2 rem -if !errorlevel!==1 (start https://git.activated.win/massg%-%rave/Micr%-%osoft-Act%-%ivation-Scripts & start https://github.com/massgra%-%vel/Micro%-%soft-Acti%-%vation-Scripts & start %mas% & exit /b) +if !errorlevel!==1 (start %selfgit% & start %github% & start %mas% & exit /b) ) ) @@ -1707,7 +1709,7 @@ call :dk_color %White% "Follow ALL the ABOVE blue lines. " call :dk_color2 %Blue% "Press [1] to Open Support Webpage " %Gray% " Press [0] to Ignore" choice /C:10 /N if !errorlevel!==2 exit /b -if !errorlevel!==1 (start https://git.activated.win/massg%-%rave/Micr%-%osoft-Act%-%ivation-Scripts & start https://github.com/massgra%-%vel/Micro%-%soft-Acti%-%vation-Scripts & for %%# in (%fixes%) do (start %%#)) +if !errorlevel!==1 (start %selfgit% & start %github% & for %%# in (%fixes%) do (start %%#)) ) if defined terminal ( diff --git a/MAS/Separate-Files-Version/Activators/KMS38_Activation.cmd b/MAS/Separate-Files-Version/Activators/KMS38_Activation.cmd index e909532..eed6d3b 100644 --- a/MAS/Separate-Files-Version/Activators/KMS38_Activation.cmd +++ b/MAS/Separate-Files-Version/Activators/KMS38_Activation.cmd @@ -103,6 +103,8 @@ set "nul=" set "blank=" set "mas=ht%blank%tps%blank%://mass%blank%grave.dev/" +set "github=ht%blank%tps%blank%://github.com/massgra%blank%vel/Micro%blank%soft-Acti%blank%vation-Scripts" +set "selfgit=ht%blank%tps%blank%://git.acti%blank%vated.win/massg%blank%rave/Micr%blank%osoft-Act%blank%ivation-Scripts" :: Check if Null service is working, it's important for the batch script @@ -359,7 +361,7 @@ echo: call :dk_color %_Green% "Choose a menu option using your keyboard [1,0] :" choice /C:10 /N if !errorlevel!==2 rem -if !errorlevel!==1 (start https://git.activated.win/massg%-%rave/Micr%-%osoft-Act%-%ivation-Scripts & start https://github.com/massgra%-%vel/Micro%-%soft-Acti%-%vation-Scripts & start %mas% & exit /b) +if !errorlevel!==1 (start %selfgit% & start %github% & start %mas% & exit /b) ) ) cls @@ -1850,7 +1852,7 @@ call :dk_color %White% "Follow ALL the ABOVE blue lines. " call :dk_color2 %Blue% "Press [1] to Open Support Webpage " %Gray% " Press [0] to Ignore" choice /C:10 /N if !errorlevel!==2 exit /b -if !errorlevel!==1 (start https://git.activated.win/massg%-%rave/Micr%-%osoft-Act%-%ivation-Scripts & start https://github.com/massgra%-%vel/Micro%-%soft-Acti%-%vation-Scripts & for %%# in (%fixes%) do (start %%#)) +if !errorlevel!==1 (start %selfgit% & start %github% & for %%# in (%fixes%) do (start %%#)) ) if defined terminal ( diff --git a/MAS/Separate-Files-Version/Activators/Ohook_Activation_AIO.cmd b/MAS/Separate-Files-Version/Activators/Ohook_Activation_AIO.cmd index cee100b..9904958 100644 --- a/MAS/Separate-Files-Version/Activators/Ohook_Activation_AIO.cmd +++ b/MAS/Separate-Files-Version/Activators/Ohook_Activation_AIO.cmd @@ -100,6 +100,8 @@ set "nul=" set "blank=" set "mas=ht%blank%tps%blank%://mass%blank%grave.dev/" +set "github=ht%blank%tps%blank%://github.com/massgra%blank%vel/Micro%blank%soft-Acti%blank%vation-Scripts" +set "selfgit=ht%blank%tps%blank%://git.acti%blank%vated.win/massg%blank%rave/Micr%blank%osoft-Act%blank%ivation-Scripts" :: Check if Null service is working, it's important for the batch script @@ -364,7 +366,7 @@ echo: call :dk_color %_Green% "Choose a menu option using your keyboard [1,0] :" choice /C:10 /N if !errorlevel!==2 rem -if !errorlevel!==1 (start https://git.activated.win/massg%-%rave/Micr%-%osoft-Act%-%ivation-Scripts & start https://github.com/massgra%-%vel/Micro%-%soft-Acti%-%vation-Scripts & start %mas% & exit /b) +if !errorlevel!==1 (start %selfgit% & start %github% & start %mas% & exit /b) ) ) cls @@ -2368,7 +2370,7 @@ call :dk_color %White% "Follow ALL the ABOVE blue lines. " call :dk_color2 %Blue% "Press [1] to Open Support Webpage " %Gray% " Press [0] to Ignore" choice /C:10 /N if !errorlevel!==2 exit /b -if !errorlevel!==1 (start https://git.activated.win/massg%-%rave/Micr%-%osoft-Act%-%ivation-Scripts & start https://github.com/massgra%-%vel/Micro%-%soft-Acti%-%vation-Scripts & for %%# in (%fixes%) do (start %%#)) +if !errorlevel!==1 (start %selfgit% & start %github% & for %%# in (%fixes%) do (start %%#)) ) if defined terminal ( diff --git a/MAS/Separate-Files-Version/Activators/Online_KMS_Activation.cmd b/MAS/Separate-Files-Version/Activators/Online_KMS_Activation.cmd index 321095a..a5ff772 100644 --- a/MAS/Separate-Files-Version/Activators/Online_KMS_Activation.cmd +++ b/MAS/Separate-Files-Version/Activators/Online_KMS_Activation.cmd @@ -125,6 +125,8 @@ set "nul=" set "blank=" set "mas=ht%blank%tps%blank%://mass%blank%grave.dev/" +set "github=ht%blank%tps%blank%://github.com/massgra%blank%vel/Micro%blank%soft-Acti%blank%vation-Scripts" +set "selfgit=ht%blank%tps%blank%://git.acti%blank%vated.win/massg%blank%rave/Micr%blank%osoft-Act%blank%ivation-Scripts" :: Check if Null service is working, it's important for the batch script @@ -395,7 +397,7 @@ echo: call :dk_color %_Green% "Choose a menu option using your keyboard [1,0] :" choice /C:10 /N if !errorlevel!==2 rem -if !errorlevel!==1 (start https://git.activated.win/massg%-%rave/Micr%-%osoft-Act%-%ivation-Scripts & start https://github.com/massgra%-%vel/Micro%-%soft-Acti%-%vation-Scripts & start %mas% & exit /b) +if !errorlevel!==1 (start %selfgit% & start %github% & start %mas% & exit /b) ) ) @@ -3424,7 +3426,7 @@ call :dk_color %White% "Follow ALL the ABOVE blue lines. " call :dk_color2 %Blue% "Press [1] to Open Support Webpage " %Gray% " Press [0] to Ignore" choice /C:10 /N if !errorlevel!==2 exit /b -if !errorlevel!==1 (start https://git.activated.win/massg%-%rave/Micr%-%osoft-Act%-%ivation-Scripts & start https://github.com/massgra%-%vel/Micro%-%soft-Acti%-%vation-Scripts & for %%# in (%fixes%) do (start %%#)) +if !errorlevel!==1 (start %selfgit% & start %github% & for %%# in (%fixes%) do (start %%#)) ) if defined terminal ( diff --git a/MAS/Separate-Files-Version/Activators/TSforge_Activation.cmd b/MAS/Separate-Files-Version/Activators/TSforge_Activation.cmd index 444a20b..d1ecff3 100644 --- a/MAS/Separate-Files-Version/Activators/TSforge_Activation.cmd +++ b/MAS/Separate-Files-Version/Activators/TSforge_Activation.cmd @@ -129,6 +129,8 @@ set "nul=" set "blank=" set "mas=ht%blank%tps%blank%://mass%blank%grave.dev/" +set "github=ht%blank%tps%blank%://github.com/massgra%blank%vel/Micro%blank%soft-Acti%blank%vation-Scripts" +set "selfgit=ht%blank%tps%blank%://git.acti%blank%vated.win/massg%blank%rave/Micr%blank%osoft-Act%blank%ivation-Scripts" :: Check if Null service is working, it's important for the batch script @@ -413,7 +415,7 @@ echo: call :dk_color %_Green% "Choose a menu option using your keyboard [1,0] :" choice /C:10 /N if !errorlevel!==2 rem -if !errorlevel!==1 (start https://git.activated.win/massg%-%rave/Micr%-%osoft-Act%-%ivation-Scripts & start https://github.com/massgra%-%vel/Micro%-%soft-Acti%-%vation-Scripts & start %mas% & exit /b) +if !errorlevel!==1 (start %selfgit% & start %github% & start %mas% & exit /b) ) ) @@ -3037,7 +3039,7 @@ call :dk_color %White% "Follow ALL the ABOVE blue lines. " call :dk_color2 %Blue% "Press [1] to Open Support Webpage " %Gray% " Press [0] to Ignore" choice /C:10 /N if !errorlevel!==2 exit /b -if !errorlevel!==1 (start https://git.activated.win/massg%-%rave/Micr%-%osoft-Act%-%ivation-Scripts & start https://github.com/massgra%-%vel/Micro%-%soft-Acti%-%vation-Scripts & for %%# in (%fixes%) do (start %%#)) +if !errorlevel!==1 (start %selfgit% & start %github% & for %%# in (%fixes%) do (start %%#)) ) if defined terminal ( diff --git a/MAS/Separate-Files-Version/Change_Office_Edition.cmd b/MAS/Separate-Files-Version/Change_Office_Edition.cmd index 6926cd0..652109d 100644 --- a/MAS/Separate-Files-Version/Change_Office_Edition.cmd +++ b/MAS/Separate-Files-Version/Change_Office_Edition.cmd @@ -60,6 +60,8 @@ exit /b set "blank=" set "mas=ht%blank%tps%blank%://mass%blank%grave.dev/" +set "github=ht%blank%tps%blank%://github.com/massgra%blank%vel/Micro%blank%soft-Acti%blank%vation-Scripts" +set "selfgit=ht%blank%tps%blank%://git.acti%blank%vated.win/massg%blank%rave/Micr%blank%osoft-Act%blank%ivation-Scripts" :: Check if Null service is working, it's important for the batch script @@ -309,7 +311,7 @@ echo: call :dk_color %_Green% "Choose a menu option using your keyboard [1,0] :" choice /C:10 /N if !errorlevel!==2 rem -if !errorlevel!==1 (start https://git.activated.win/massg%-%rave/Micr%-%osoft-Act%-%ivation-Scripts & start https://github.com/massgra%-%vel/Micro%-%soft-Acti%-%vation-Scripts & start %mas% & exit /b) +if !errorlevel!==1 (start %selfgit% & start %github% & start %mas% & exit /b) ) ) @@ -1196,7 +1198,7 @@ call :dk_color %White% "Follow ALL the ABOVE blue lines. " call :dk_color2 %Blue% "Press [1] to Open Support Webpage " %Gray% " Press [0] to Ignore" choice /C:10 /N if !errorlevel!==2 goto :oemenu -if !errorlevel!==1 (start https://git.activated.win/massg%-%rave/Micr%-%osoft-Act%-%ivation-Scripts & start https://github.com/massgra%-%vel/Micro%-%soft-Acti%-%vation-Scripts & for %%# in (%fixes%) do (start %%#)) +if !errorlevel!==1 (start %selfgit% & start %github% & for %%# in (%fixes%) do (start %%#)) ) if defined terminal ( @@ -1593,7 +1595,7 @@ call :dk_color %White% "Follow ALL the ABOVE blue lines. " call :dk_color2 %Blue% "Press [1] to Open Support Webpage " %Gray% " Press [0] to Ignore" choice /C:10 /N if !errorlevel!==2 exit /b -if !errorlevel!==1 (start https://git.activated.win/massg%-%rave/Micr%-%osoft-Act%-%ivation-Scripts & start https://github.com/massgra%-%vel/Micro%-%soft-Acti%-%vation-Scripts & for %%# in (%fixes%) do (start %%#)) +if !errorlevel!==1 (start %selfgit% & start %github% & for %%# in (%fixes%) do (start %%#)) ) if defined terminal ( diff --git a/MAS/Separate-Files-Version/Change_Windows_Edition.cmd b/MAS/Separate-Files-Version/Change_Windows_Edition.cmd index 5bfc43e..9ff5535 100644 --- a/MAS/Separate-Files-Version/Change_Windows_Edition.cmd +++ b/MAS/Separate-Files-Version/Change_Windows_Edition.cmd @@ -65,6 +65,8 @@ exit /b set "blank=" set "mas=ht%blank%tps%blank%://mass%blank%grave.dev/" +set "github=ht%blank%tps%blank%://github.com/massgra%blank%vel/Micro%blank%soft-Acti%blank%vation-Scripts" +set "selfgit=ht%blank%tps%blank%://git.acti%blank%vated.win/massg%blank%rave/Micr%blank%osoft-Act%blank%ivation-Scripts" :: Check if Null service is working, it's important for the batch script @@ -314,7 +316,7 @@ echo: call :dk_color %_Green% "Choose a menu option using your keyboard [1,0] :" choice /C:10 /N if !errorlevel!==2 rem -if !errorlevel!==1 (start https://git.activated.win/massg%-%rave/Micr%-%osoft-Act%-%ivation-Scripts & start https://github.com/massgra%-%vel/Micro%-%soft-Acti%-%vation-Scripts & start %mas% & exit /b) +if !errorlevel!==1 (start %selfgit% & start %github% & start %mas% & exit /b) ) ) @@ -1056,7 +1058,7 @@ call :dk_color %White% "Follow ALL the ABOVE blue lines. " call :dk_color2 %Blue% "Press [1] to Open Support Webpage " %Gray% " Press [0] to Ignore" choice /C:10 /N if !errorlevel!==2 exit /b -if !errorlevel!==1 (start https://git.activated.win/massg%-%rave/Micr%-%osoft-Act%-%ivation-Scripts & start https://github.com/massgra%-%vel/Micro%-%soft-Acti%-%vation-Scripts & for %%# in (%fixes%) do (start %%#)) +if !errorlevel!==1 (start %selfgit% & start %github% & for %%# in (%fixes%) do (start %%#)) ) if defined terminal ( diff --git a/MAS/Separate-Files-Version/Extract_OEM_Folder.cmd b/MAS/Separate-Files-Version/Extract_OEM_Folder.cmd index f1049bd..29c50cb 100644 --- a/MAS/Separate-Files-Version/Extract_OEM_Folder.cmd +++ b/MAS/Separate-Files-Version/Extract_OEM_Folder.cmd @@ -60,6 +60,8 @@ exit /b set "blank=" set "mas=ht%blank%tps%blank%://mass%blank%grave.dev/" +set "github=ht%blank%tps%blank%://github.com/massgra%blank%vel/Micro%blank%soft-Acti%blank%vation-Scripts" +set "selfgit=ht%blank%tps%blank%://git.acti%blank%vated.win/massg%blank%rave/Micr%blank%osoft-Act%blank%ivation-Scripts" :: Check if Null service is working, it's important for the batch script @@ -325,7 +327,7 @@ echo: call :dk_color %_Green% "Choose a menu option using your keyboard [1,0] :" choice /C:10 /N if !errorlevel!==2 rem -if !errorlevel!==1 (start https://git.activated.win/massg%-%rave/Micr%-%osoft-Act%-%ivation-Scripts & start https://github.com/massgra%-%vel/Micro%-%soft-Acti%-%vation-Scripts & start %mas% & exit /b) +if !errorlevel!==1 (start %selfgit% & start %github% & start %mas% & exit /b) ) ) @@ -732,7 +734,7 @@ call :dk_color %White% "Follow ALL the ABOVE blue lines. " call :dk_color2 %Blue% "Press [1] to Open Support Webpage " %Gray% " Press [0] to Ignore" choice /C:10 /N if !errorlevel!==2 exit /b -if !errorlevel!==1 (start https://git.activated.win/massg%-%rave/Micr%-%osoft-Act%-%ivation-Scripts & start https://github.com/massgra%-%vel/Micro%-%soft-Acti%-%vation-Scripts & for %%# in (%fixes%) do (start %%#)) +if !errorlevel!==1 (start %selfgit% & start %github% & for %%# in (%fixes%) do (start %%#)) ) if defined terminal ( diff --git a/MAS/Separate-Files-Version/Troubleshoot.cmd b/MAS/Separate-Files-Version/Troubleshoot.cmd index ce82567..5df6110 100644 --- a/MAS/Separate-Files-Version/Troubleshoot.cmd +++ b/MAS/Separate-Files-Version/Troubleshoot.cmd @@ -60,6 +60,8 @@ exit /b set "blank=" set "mas=ht%blank%tps%blank%://mass%blank%grave.dev/" +set "github=ht%blank%tps%blank%://github.com/massgra%blank%vel/Micro%blank%soft-Acti%blank%vation-Scripts" +set "selfgit=ht%blank%tps%blank%://git.acti%blank%vated.win/massg%blank%rave/Micr%blank%osoft-Act%blank%ivation-Scripts" :: Check if Null service is working, it's important for the batch script @@ -326,7 +328,7 @@ echo: call :dk_color %_Green% "Choose a menu option using your keyboard [1,0] :" choice /C:10 /N if !errorlevel!==2 rem -if !errorlevel!==1 (start https://git.activated.win/massg%-%rave/Micr%-%osoft-Act%-%ivation-Scripts & start https://github.com/massgra%-%vel/Micro%-%soft-Acti%-%vation-Scripts & start %mas% & exit /b) +if !errorlevel!==1 (start %selfgit% & start %github% & start %mas% & exit /b) ) ) @@ -387,7 +389,7 @@ if %_erl%==5 goto:retokens if %_erl%==4 goto:fixwmi if %_erl%==3 goto:sfcscan if %_erl%==2 goto:dism_rest -if %_erl%==1 start %mas%troubleshoot.html &goto at_menu +if %_erl%==1 (start %selfgit% & start %github% & start %mas%troubleshoot & goto at_menu) goto :at_menu ::======================================================================================================================================== @@ -1489,7 +1491,7 @@ call :dk_color %White% "Follow ALL the ABOVE blue lines. " call :dk_color2 %Blue% "Press [1] to Open Support Webpage " %Gray% " Press [0] to Ignore" choice /C:10 /N if !errorlevel!==2 exit /b -if !errorlevel!==1 (start https://git.activated.win/massg%-%rave/Micr%-%osoft-Act%-%ivation-Scripts & start https://github.com/massgra%-%vel/Micro%-%soft-Acti%-%vation-Scripts & for %%# in (%fixes%) do (start %%#)) +if !errorlevel!==1 (start %selfgit% & start %github% & for %%# in (%fixes%) do (start %%#)) ) if defined terminal ( From a99acbb02557409e553f2e2c9cb906b8682cfb04 Mon Sep 17 00:00:00 2001 From: WindowsAddict Date: Tue, 27 May 2025 20:43:23 +0530 Subject: [PATCH 65/79] Update Powershell error detection code --- MAS/All-In-One-Version-KL/MAS_AIO.cmd | 16 ++++++++++++---- .../Activators/HWID_Activation.cmd | 16 ++++++++++++---- .../Activators/KMS38_Activation.cmd | 16 ++++++++++++---- .../Activators/Ohook_Activation_AIO.cmd | 16 ++++++++++++---- .../Activators/Online_KMS_Activation.cmd | 16 ++++++++++++---- .../Activators/TSforge_Activation.cmd | 16 ++++++++++++---- .../Change_Office_Edition.cmd | 16 ++++++++++++---- .../Change_Windows_Edition.cmd | 16 ++++++++++++---- .../Extract_OEM_Folder.cmd | 16 ++++++++++++---- MAS/Separate-Files-Version/Troubleshoot.cmd | 16 ++++++++++++---- 10 files changed, 120 insertions(+), 40 deletions(-) diff --git a/MAS/All-In-One-Version-KL/MAS_AIO.cmd b/MAS/All-In-One-Version-KL/MAS_AIO.cmd index ced0953..9d2c61f 100644 --- a/MAS/All-In-One-Version-KL/MAS_AIO.cmd +++ b/MAS/All-In-One-Version-KL/MAS_AIO.cmd @@ -219,12 +219,14 @@ for /f "delims=" %%a in ('%psc% "if ($PSVersionTable.PSEdition -ne 'Core') {$f=[ if /i not "%tstresult%"=="FullLanguage" ( %eline% -echo: %tstresult% -cmd /c "%psc% $ExecutionContext.SessionState.LanguageMode" +for /f "delims=" %%a in ('%psc% "$ExecutionContext.SessionState.LanguageMode" %nul6%') do (set tstresult2=%%a) +echo Test 1 - %tstresult% +echo Test 2 - !tstresult2! +echo: REM check LanguageMode -cmd /c "%psc% "$ExecutionContext.SessionState.LanguageMode"" | findstr /i "ConstrainedLanguage RestrictedLanguage NoLanguage" %nul1% && ( +echo: !tstresult2! | findstr /i "ConstrainedLanguage RestrictedLanguage NoLanguage" %nul1% && ( echo FullLanguage mode not found in PowerShell. Aborting... echo If you have applied restrictions on Powershell then undo those changes. echo: @@ -254,7 +256,13 @@ goto dk_done REM check antivirus and other errors echo PowerShell is not working properly. Aborting... -cmd /c "%psc% ""$av = Get-WmiObject -Namespace root\SecurityCenter2 -Class AntiVirusProduct; $n = @(); foreach ($i in $av) { if ($i.displayName -notlike '*windows*') { $n += $i.displayName } }; if ($n) { Write-Host ('Installed 3rd party Antivirus might be blocking the script - ' + ($n -join ', ')) -ForegroundColor White -BackgroundColor Blue }""" + +if /i "!tstresult2!"=="FullLanguage" ( +echo: +echo Your antivirus software might be blocking the script, or PowerShell on your system might be corrupted. +cmd /c "%psc% ""$av = Get-WmiObject -Namespace root\SecurityCenter2 -Class AntiVirusProduct; $n = @(); foreach ($i in $av) { $n += $i.displayName }; if ($n) { Write-Host ('Installed Antivirus - ' + ($n -join ', '))}""" +) + echo: set fixes=%fixes% %mas%troubleshoot call :dk_color2 %Blue% "Check this webpage for help - " %_Yellow% " %mas%troubleshoot" diff --git a/MAS/Separate-Files-Version/Activators/HWID_Activation.cmd b/MAS/Separate-Files-Version/Activators/HWID_Activation.cmd index 2b1fe2e..34fe81d 100644 --- a/MAS/Separate-Files-Version/Activators/HWID_Activation.cmd +++ b/MAS/Separate-Files-Version/Activators/HWID_Activation.cmd @@ -241,12 +241,14 @@ for /f "delims=" %%a in ('%psc% "if ($PSVersionTable.PSEdition -ne 'Core') {$f=[ if /i not "%tstresult%"=="FullLanguage" ( %eline% -echo: %tstresult% -cmd /c "%psc% $ExecutionContext.SessionState.LanguageMode" +for /f "delims=" %%a in ('%psc% "$ExecutionContext.SessionState.LanguageMode" %nul6%') do (set tstresult2=%%a) +echo Test 1 - %tstresult% +echo Test 2 - !tstresult2! +echo: REM check LanguageMode -cmd /c "%psc% "$ExecutionContext.SessionState.LanguageMode"" | findstr /i "ConstrainedLanguage RestrictedLanguage NoLanguage" %nul1% && ( +echo: !tstresult2! | findstr /i "ConstrainedLanguage RestrictedLanguage NoLanguage" %nul1% && ( echo FullLanguage mode not found in PowerShell. Aborting... echo If you have applied restrictions on Powershell then undo those changes. echo: @@ -276,7 +278,13 @@ goto dk_done REM check antivirus and other errors echo PowerShell is not working properly. Aborting... -cmd /c "%psc% ""$av = Get-WmiObject -Namespace root\SecurityCenter2 -Class AntiVirusProduct; $n = @(); foreach ($i in $av) { if ($i.displayName -notlike '*windows*') { $n += $i.displayName } }; if ($n) { Write-Host ('Installed 3rd party Antivirus might be blocking the script - ' + ($n -join ', ')) -ForegroundColor White -BackgroundColor Blue }""" + +if /i "!tstresult2!"=="FullLanguage" ( +echo: +echo Your antivirus software might be blocking the script, or PowerShell on your system might be corrupted. +cmd /c "%psc% ""$av = Get-WmiObject -Namespace root\SecurityCenter2 -Class AntiVirusProduct; $n = @(); foreach ($i in $av) { $n += $i.displayName }; if ($n) { Write-Host ('Installed Antivirus - ' + ($n -join ', '))}""" +) + echo: set fixes=%fixes% %mas%troubleshoot call :dk_color2 %Blue% "Check this webpage for help - " %_Yellow% " %mas%troubleshoot" diff --git a/MAS/Separate-Files-Version/Activators/KMS38_Activation.cmd b/MAS/Separate-Files-Version/Activators/KMS38_Activation.cmd index eed6d3b..c9aa57f 100644 --- a/MAS/Separate-Files-Version/Activators/KMS38_Activation.cmd +++ b/MAS/Separate-Files-Version/Activators/KMS38_Activation.cmd @@ -244,12 +244,14 @@ for /f "delims=" %%a in ('%psc% "if ($PSVersionTable.PSEdition -ne 'Core') {$f=[ if /i not "%tstresult%"=="FullLanguage" ( %eline% -echo: %tstresult% -cmd /c "%psc% $ExecutionContext.SessionState.LanguageMode" +for /f "delims=" %%a in ('%psc% "$ExecutionContext.SessionState.LanguageMode" %nul6%') do (set tstresult2=%%a) +echo Test 1 - %tstresult% +echo Test 2 - !tstresult2! +echo: REM check LanguageMode -cmd /c "%psc% "$ExecutionContext.SessionState.LanguageMode"" | findstr /i "ConstrainedLanguage RestrictedLanguage NoLanguage" %nul1% && ( +echo: !tstresult2! | findstr /i "ConstrainedLanguage RestrictedLanguage NoLanguage" %nul1% && ( echo FullLanguage mode not found in PowerShell. Aborting... echo If you have applied restrictions on Powershell then undo those changes. echo: @@ -279,7 +281,13 @@ goto dk_done REM check antivirus and other errors echo PowerShell is not working properly. Aborting... -cmd /c "%psc% ""$av = Get-WmiObject -Namespace root\SecurityCenter2 -Class AntiVirusProduct; $n = @(); foreach ($i in $av) { if ($i.displayName -notlike '*windows*') { $n += $i.displayName } }; if ($n) { Write-Host ('Installed 3rd party Antivirus might be blocking the script - ' + ($n -join ', ')) -ForegroundColor White -BackgroundColor Blue }""" + +if /i "!tstresult2!"=="FullLanguage" ( +echo: +echo Your antivirus software might be blocking the script, or PowerShell on your system might be corrupted. +cmd /c "%psc% ""$av = Get-WmiObject -Namespace root\SecurityCenter2 -Class AntiVirusProduct; $n = @(); foreach ($i in $av) { $n += $i.displayName }; if ($n) { Write-Host ('Installed Antivirus - ' + ($n -join ', '))}""" +) + echo: set fixes=%fixes% %mas%troubleshoot call :dk_color2 %Blue% "Check this webpage for help - " %_Yellow% " %mas%troubleshoot" diff --git a/MAS/Separate-Files-Version/Activators/Ohook_Activation_AIO.cmd b/MAS/Separate-Files-Version/Activators/Ohook_Activation_AIO.cmd index 9904958..aa321b3 100644 --- a/MAS/Separate-Files-Version/Activators/Ohook_Activation_AIO.cmd +++ b/MAS/Separate-Files-Version/Activators/Ohook_Activation_AIO.cmd @@ -249,12 +249,14 @@ for /f "delims=" %%a in ('%psc% "if ($PSVersionTable.PSEdition -ne 'Core') {$f=[ if /i not "%tstresult%"=="FullLanguage" ( %eline% -echo: %tstresult% -cmd /c "%psc% $ExecutionContext.SessionState.LanguageMode" +for /f "delims=" %%a in ('%psc% "$ExecutionContext.SessionState.LanguageMode" %nul6%') do (set tstresult2=%%a) +echo Test 1 - %tstresult% +echo Test 2 - !tstresult2! +echo: REM check LanguageMode -cmd /c "%psc% "$ExecutionContext.SessionState.LanguageMode"" | findstr /i "ConstrainedLanguage RestrictedLanguage NoLanguage" %nul1% && ( +echo: !tstresult2! | findstr /i "ConstrainedLanguage RestrictedLanguage NoLanguage" %nul1% && ( echo FullLanguage mode not found in PowerShell. Aborting... echo If you have applied restrictions on Powershell then undo those changes. echo: @@ -284,7 +286,13 @@ goto dk_done REM check antivirus and other errors echo PowerShell is not working properly. Aborting... -cmd /c "%psc% ""$av = Get-WmiObject -Namespace root\SecurityCenter2 -Class AntiVirusProduct; $n = @(); foreach ($i in $av) { if ($i.displayName -notlike '*windows*') { $n += $i.displayName } }; if ($n) { Write-Host ('Installed 3rd party Antivirus might be blocking the script - ' + ($n -join ', ')) -ForegroundColor White -BackgroundColor Blue }""" + +if /i "!tstresult2!"=="FullLanguage" ( +echo: +echo Your antivirus software might be blocking the script, or PowerShell on your system might be corrupted. +cmd /c "%psc% ""$av = Get-WmiObject -Namespace root\SecurityCenter2 -Class AntiVirusProduct; $n = @(); foreach ($i in $av) { $n += $i.displayName }; if ($n) { Write-Host ('Installed Antivirus - ' + ($n -join ', '))}""" +) + echo: set fixes=%fixes% %mas%troubleshoot call :dk_color2 %Blue% "Check this webpage for help - " %_Yellow% " %mas%troubleshoot" diff --git a/MAS/Separate-Files-Version/Activators/Online_KMS_Activation.cmd b/MAS/Separate-Files-Version/Activators/Online_KMS_Activation.cmd index a5ff772..db8bba9 100644 --- a/MAS/Separate-Files-Version/Activators/Online_KMS_Activation.cmd +++ b/MAS/Separate-Files-Version/Activators/Online_KMS_Activation.cmd @@ -280,12 +280,14 @@ for /f "delims=" %%a in ('%psc% "if ($PSVersionTable.PSEdition -ne 'Core') {$f=[ if /i not "%tstresult%"=="FullLanguage" ( %eline% -echo: %tstresult% -cmd /c "%psc% $ExecutionContext.SessionState.LanguageMode" +for /f "delims=" %%a in ('%psc% "$ExecutionContext.SessionState.LanguageMode" %nul6%') do (set tstresult2=%%a) +echo Test 1 - %tstresult% +echo Test 2 - !tstresult2! +echo: REM check LanguageMode -cmd /c "%psc% "$ExecutionContext.SessionState.LanguageMode"" | findstr /i "ConstrainedLanguage RestrictedLanguage NoLanguage" %nul1% && ( +echo: !tstresult2! | findstr /i "ConstrainedLanguage RestrictedLanguage NoLanguage" %nul1% && ( echo FullLanguage mode not found in PowerShell. Aborting... echo If you have applied restrictions on Powershell then undo those changes. echo: @@ -315,7 +317,13 @@ goto dk_done REM check antivirus and other errors echo PowerShell is not working properly. Aborting... -cmd /c "%psc% ""$av = Get-WmiObject -Namespace root\SecurityCenter2 -Class AntiVirusProduct; $n = @(); foreach ($i in $av) { if ($i.displayName -notlike '*windows*') { $n += $i.displayName } }; if ($n) { Write-Host ('Installed 3rd party Antivirus might be blocking the script - ' + ($n -join ', ')) -ForegroundColor White -BackgroundColor Blue }""" + +if /i "!tstresult2!"=="FullLanguage" ( +echo: +echo Your antivirus software might be blocking the script, or PowerShell on your system might be corrupted. +cmd /c "%psc% ""$av = Get-WmiObject -Namespace root\SecurityCenter2 -Class AntiVirusProduct; $n = @(); foreach ($i in $av) { $n += $i.displayName }; if ($n) { Write-Host ('Installed Antivirus - ' + ($n -join ', '))}""" +) + echo: set fixes=%fixes% %mas%troubleshoot call :dk_color2 %Blue% "Check this webpage for help - " %_Yellow% " %mas%troubleshoot" diff --git a/MAS/Separate-Files-Version/Activators/TSforge_Activation.cmd b/MAS/Separate-Files-Version/Activators/TSforge_Activation.cmd index d1ecff3..5c0a10b 100644 --- a/MAS/Separate-Files-Version/Activators/TSforge_Activation.cmd +++ b/MAS/Separate-Files-Version/Activators/TSforge_Activation.cmd @@ -298,12 +298,14 @@ for /f "delims=" %%a in ('%psc% "if ($PSVersionTable.PSEdition -ne 'Core') {$f=[ if /i not "%tstresult%"=="FullLanguage" ( %eline% -echo: %tstresult% -cmd /c "%psc% $ExecutionContext.SessionState.LanguageMode" +for /f "delims=" %%a in ('%psc% "$ExecutionContext.SessionState.LanguageMode" %nul6%') do (set tstresult2=%%a) +echo Test 1 - %tstresult% +echo Test 2 - !tstresult2! +echo: REM check LanguageMode -cmd /c "%psc% "$ExecutionContext.SessionState.LanguageMode"" | findstr /i "ConstrainedLanguage RestrictedLanguage NoLanguage" %nul1% && ( +echo: !tstresult2! | findstr /i "ConstrainedLanguage RestrictedLanguage NoLanguage" %nul1% && ( echo FullLanguage mode not found in PowerShell. Aborting... echo If you have applied restrictions on Powershell then undo those changes. echo: @@ -333,7 +335,13 @@ goto dk_done REM check antivirus and other errors echo PowerShell is not working properly. Aborting... -cmd /c "%psc% ""$av = Get-WmiObject -Namespace root\SecurityCenter2 -Class AntiVirusProduct; $n = @(); foreach ($i in $av) { if ($i.displayName -notlike '*windows*') { $n += $i.displayName } }; if ($n) { Write-Host ('Installed 3rd party Antivirus might be blocking the script - ' + ($n -join ', ')) -ForegroundColor White -BackgroundColor Blue }""" + +if /i "!tstresult2!"=="FullLanguage" ( +echo: +echo Your antivirus software might be blocking the script, or PowerShell on your system might be corrupted. +cmd /c "%psc% ""$av = Get-WmiObject -Namespace root\SecurityCenter2 -Class AntiVirusProduct; $n = @(); foreach ($i in $av) { $n += $i.displayName }; if ($n) { Write-Host ('Installed Antivirus - ' + ($n -join ', '))}""" +) + echo: set fixes=%fixes% %mas%troubleshoot call :dk_color2 %Blue% "Check this webpage for help - " %_Yellow% " %mas%troubleshoot" diff --git a/MAS/Separate-Files-Version/Change_Office_Edition.cmd b/MAS/Separate-Files-Version/Change_Office_Edition.cmd index 652109d..eed5d70 100644 --- a/MAS/Separate-Files-Version/Change_Office_Edition.cmd +++ b/MAS/Separate-Files-Version/Change_Office_Edition.cmd @@ -194,12 +194,14 @@ for /f "delims=" %%a in ('%psc% "if ($PSVersionTable.PSEdition -ne 'Core') {$f=[ if /i not "%tstresult%"=="FullLanguage" ( %eline% -echo: %tstresult% -cmd /c "%psc% $ExecutionContext.SessionState.LanguageMode" +for /f "delims=" %%a in ('%psc% "$ExecutionContext.SessionState.LanguageMode" %nul6%') do (set tstresult2=%%a) +echo Test 1 - %tstresult% +echo Test 2 - !tstresult2! +echo: REM check LanguageMode -cmd /c "%psc% "$ExecutionContext.SessionState.LanguageMode"" | findstr /i "ConstrainedLanguage RestrictedLanguage NoLanguage" %nul1% && ( +echo: !tstresult2! | findstr /i "ConstrainedLanguage RestrictedLanguage NoLanguage" %nul1% && ( echo FullLanguage mode not found in PowerShell. Aborting... echo If you have applied restrictions on Powershell then undo those changes. echo: @@ -229,7 +231,13 @@ goto dk_done REM check antivirus and other errors echo PowerShell is not working properly. Aborting... -cmd /c "%psc% ""$av = Get-WmiObject -Namespace root\SecurityCenter2 -Class AntiVirusProduct; $n = @(); foreach ($i in $av) { if ($i.displayName -notlike '*windows*') { $n += $i.displayName } }; if ($n) { Write-Host ('Installed 3rd party Antivirus might be blocking the script - ' + ($n -join ', ')) -ForegroundColor White -BackgroundColor Blue }""" + +if /i "!tstresult2!"=="FullLanguage" ( +echo: +echo Your antivirus software might be blocking the script, or PowerShell on your system might be corrupted. +cmd /c "%psc% ""$av = Get-WmiObject -Namespace root\SecurityCenter2 -Class AntiVirusProduct; $n = @(); foreach ($i in $av) { $n += $i.displayName }; if ($n) { Write-Host ('Installed Antivirus - ' + ($n -join ', '))}""" +) + echo: set fixes=%fixes% %mas%troubleshoot call :dk_color2 %Blue% "Check this webpage for help - " %_Yellow% " %mas%troubleshoot" diff --git a/MAS/Separate-Files-Version/Change_Windows_Edition.cmd b/MAS/Separate-Files-Version/Change_Windows_Edition.cmd index 9ff5535..e93db0c 100644 --- a/MAS/Separate-Files-Version/Change_Windows_Edition.cmd +++ b/MAS/Separate-Files-Version/Change_Windows_Edition.cmd @@ -199,12 +199,14 @@ for /f "delims=" %%a in ('%psc% "if ($PSVersionTable.PSEdition -ne 'Core') {$f=[ if /i not "%tstresult%"=="FullLanguage" ( %eline% -echo: %tstresult% -cmd /c "%psc% $ExecutionContext.SessionState.LanguageMode" +for /f "delims=" %%a in ('%psc% "$ExecutionContext.SessionState.LanguageMode" %nul6%') do (set tstresult2=%%a) +echo Test 1 - %tstresult% +echo Test 2 - !tstresult2! +echo: REM check LanguageMode -cmd /c "%psc% "$ExecutionContext.SessionState.LanguageMode"" | findstr /i "ConstrainedLanguage RestrictedLanguage NoLanguage" %nul1% && ( +echo: !tstresult2! | findstr /i "ConstrainedLanguage RestrictedLanguage NoLanguage" %nul1% && ( echo FullLanguage mode not found in PowerShell. Aborting... echo If you have applied restrictions on Powershell then undo those changes. echo: @@ -234,7 +236,13 @@ goto dk_done REM check antivirus and other errors echo PowerShell is not working properly. Aborting... -cmd /c "%psc% ""$av = Get-WmiObject -Namespace root\SecurityCenter2 -Class AntiVirusProduct; $n = @(); foreach ($i in $av) { if ($i.displayName -notlike '*windows*') { $n += $i.displayName } }; if ($n) { Write-Host ('Installed 3rd party Antivirus might be blocking the script - ' + ($n -join ', ')) -ForegroundColor White -BackgroundColor Blue }""" + +if /i "!tstresult2!"=="FullLanguage" ( +echo: +echo Your antivirus software might be blocking the script, or PowerShell on your system might be corrupted. +cmd /c "%psc% ""$av = Get-WmiObject -Namespace root\SecurityCenter2 -Class AntiVirusProduct; $n = @(); foreach ($i in $av) { $n += $i.displayName }; if ($n) { Write-Host ('Installed Antivirus - ' + ($n -join ', '))}""" +) + echo: set fixes=%fixes% %mas%troubleshoot call :dk_color2 %Blue% "Check this webpage for help - " %_Yellow% " %mas%troubleshoot" diff --git a/MAS/Separate-Files-Version/Extract_OEM_Folder.cmd b/MAS/Separate-Files-Version/Extract_OEM_Folder.cmd index 29c50cb..9b43ac2 100644 --- a/MAS/Separate-Files-Version/Extract_OEM_Folder.cmd +++ b/MAS/Separate-Files-Version/Extract_OEM_Folder.cmd @@ -210,12 +210,14 @@ for /f "delims=" %%a in ('%psc% "if ($PSVersionTable.PSEdition -ne 'Core') {$f=[ if /i not "%tstresult%"=="FullLanguage" ( %eline% -echo: %tstresult% -cmd /c "%psc% $ExecutionContext.SessionState.LanguageMode" +for /f "delims=" %%a in ('%psc% "$ExecutionContext.SessionState.LanguageMode" %nul6%') do (set tstresult2=%%a) +echo Test 1 - %tstresult% +echo Test 2 - !tstresult2! +echo: REM check LanguageMode -cmd /c "%psc% "$ExecutionContext.SessionState.LanguageMode"" | findstr /i "ConstrainedLanguage RestrictedLanguage NoLanguage" %nul1% && ( +echo: !tstresult2! | findstr /i "ConstrainedLanguage RestrictedLanguage NoLanguage" %nul1% && ( echo FullLanguage mode not found in PowerShell. Aborting... echo If you have applied restrictions on Powershell then undo those changes. echo: @@ -245,7 +247,13 @@ goto done2 REM check antivirus and other errors echo PowerShell is not working properly. Aborting... -cmd /c "%psc% ""$av = Get-WmiObject -Namespace root\SecurityCenter2 -Class AntiVirusProduct; $n = @(); foreach ($i in $av) { if ($i.displayName -notlike '*windows*') { $n += $i.displayName } }; if ($n) { Write-Host ('Installed 3rd party Antivirus might be blocking the script - ' + ($n -join ', ')) -ForegroundColor White -BackgroundColor Blue }""" + +if /i "!tstresult2!"=="FullLanguage" ( +echo: +echo Your antivirus software might be blocking the script, or PowerShell on your system might be corrupted. +cmd /c "%psc% ""$av = Get-WmiObject -Namespace root\SecurityCenter2 -Class AntiVirusProduct; $n = @(); foreach ($i in $av) { $n += $i.displayName }; if ($n) { Write-Host ('Installed Antivirus - ' + ($n -join ', '))}""" +) + echo: set fixes=%fixes% %mas%troubleshoot call :dk_color2 %Blue% "Check this webpage for help - " %_Yellow% " %mas%troubleshoot" diff --git a/MAS/Separate-Files-Version/Troubleshoot.cmd b/MAS/Separate-Files-Version/Troubleshoot.cmd index 5df6110..d35e046 100644 --- a/MAS/Separate-Files-Version/Troubleshoot.cmd +++ b/MAS/Separate-Files-Version/Troubleshoot.cmd @@ -211,12 +211,14 @@ for /f "delims=" %%a in ('%psc% "if ($PSVersionTable.PSEdition -ne 'Core') {$f=[ if /i not "%tstresult%"=="FullLanguage" ( %eline% -echo: %tstresult% -cmd /c "%psc% $ExecutionContext.SessionState.LanguageMode" +for /f "delims=" %%a in ('%psc% "$ExecutionContext.SessionState.LanguageMode" %nul6%') do (set tstresult2=%%a) +echo Test 1 - %tstresult% +echo Test 2 - !tstresult2! +echo: REM check LanguageMode -cmd /c "%psc% "$ExecutionContext.SessionState.LanguageMode"" | findstr /i "ConstrainedLanguage RestrictedLanguage NoLanguage" %nul1% && ( +echo: !tstresult2! | findstr /i "ConstrainedLanguage RestrictedLanguage NoLanguage" %nul1% && ( echo FullLanguage mode not found in PowerShell. Aborting... echo If you have applied restrictions on Powershell then undo those changes. echo: @@ -246,7 +248,13 @@ goto dk_done REM check antivirus and other errors echo PowerShell is not working properly. Aborting... -cmd /c "%psc% ""$av = Get-WmiObject -Namespace root\SecurityCenter2 -Class AntiVirusProduct; $n = @(); foreach ($i in $av) { if ($i.displayName -notlike '*windows*') { $n += $i.displayName } }; if ($n) { Write-Host ('Installed 3rd party Antivirus might be blocking the script - ' + ($n -join ', ')) -ForegroundColor White -BackgroundColor Blue }""" + +if /i "!tstresult2!"=="FullLanguage" ( +echo: +echo Your antivirus software might be blocking the script, or PowerShell on your system might be corrupted. +cmd /c "%psc% ""$av = Get-WmiObject -Namespace root\SecurityCenter2 -Class AntiVirusProduct; $n = @(); foreach ($i in $av) { $n += $i.displayName }; if ($n) { Write-Host ('Installed Antivirus - ' + ($n -join ', '))}""" +) + echo: set fixes=%fixes% %mas%troubleshoot call :dk_color2 %Blue% "Check this webpage for help - " %_Yellow% " %mas%troubleshoot" From 8ed0c6874bf63f3b3c9499a7cd7546611f75be02 Mon Sep 17 00:00:00 2001 From: WindowsAddict Date: Tue, 27 May 2025 22:04:35 +0530 Subject: [PATCH 66/79] Suggest TSforge for Office where Windows is not supposed to get feature upgrades --- MAS/All-In-One-Version-KL/MAS_AIO.cmd | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/MAS/All-In-One-Version-KL/MAS_AIO.cmd b/MAS/All-In-One-Version-KL/MAS_AIO.cmd index 9d2c61f..b8026db 100644 --- a/MAS/All-In-One-Version-KL/MAS_AIO.cmd +++ b/MAS/All-In-One-Version-KL/MAS_AIO.cmd @@ -396,7 +396,16 @@ if not defined terminal mode 76, 34 if %winbuild% GEQ 10240 if not exist "%SystemRoot%\Servicing\Packages\Microsoft-Windows-Server*Edition~*.mum" if not exist "%SystemRoot%\Servicing\Packages\Microsoft-Windows-*EvalEdition~*.mum" set _hwidgo=1 if %winbuild% GTR 14393 if exist "%SysPath%\spp\tokens\skus\EnterpriseSN\" set _hwidgo= if not defined _hwidgo set _tsforgego=1 + set _ohookgo=1 +if %winbuild% GEQ 9200 ( +if %winbuild% LSS 10240 set _ohookgo= +if %winbuild% GEQ 19041 if %winbuild% LEQ 19045 set _ohookgo= +if exist "%SystemRoot%\Servicing\Packages\Microsoft-Windows-Server*Edition~*.mum" set _ohookgo= +if exist "%SystemRoot%\Servicing\Packages\Microsoft-Windows-*EvalEdition~*.mum" set _ohookgo= +if exist "%SystemRoot%\Servicing\Packages\Microsoft-Windows-EnterpriseS*dition~*.mum" set _ohookgo= +) +if not defined _ohookgo set _tsforgego=1 echo: echo: From 9f244ddc179b3fd3479aebec58cbc26c1bebb78a Mon Sep 17 00:00:00 2001 From: WindowsAddict Date: Tue, 27 May 2025 22:10:02 +0530 Subject: [PATCH 67/79] Fix grammar --- MAS/All-In-One-Version-KL/MAS_AIO.cmd | 6 +++--- .../Activators/Ohook_Activation_AIO.cmd | 2 +- .../Activators/Online_KMS_Activation.cmd | 2 +- .../Activators/TSforge_Activation.cmd | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/MAS/All-In-One-Version-KL/MAS_AIO.cmd b/MAS/All-In-One-Version-KL/MAS_AIO.cmd index b8026db..a5761b0 100644 --- a/MAS/All-In-One-Version-KL/MAS_AIO.cmd +++ b/MAS/All-In-One-Version-KL/MAS_AIO.cmd @@ -2348,7 +2348,7 @@ call :dk_color %Red% "Checking Installed Office [Not Found]" if defined ohub ( echo: -echo You only have the Office dashboard app installed, you need to install the full version of Office. +echo You only have the Office Dashboard app installed. You need to install the full version of Office. ) echo: call :dk_color %Blue% "Download and install Office from the below URL and then try again." @@ -4654,7 +4654,7 @@ call :dk_color %Gray% "Checking Installed Office [Not Found]" if defined ohub ( echo: -echo You have only Office dashboard app installed, you need to install full Office version. +echo You only have the Office Dashboard app installed. You need to install the full version of Office. ) call :dk_color %Blue% "Download and install Office from below URL and try again." if %_actwin%==0 set fixes=%fixes% %mas%genuine-installation-media @@ -12083,7 +12083,7 @@ call :dk_color %Red% "Checking Installed Office [Not Found]" if defined ohub ( echo: -echo You have only Office dashboard app installed, you need to install full Office version. +echo You only have the Office Dashboard app installed. You need to install the full version of Office. ) call :dk_color %Blue% "Download and install Office from below URL and try again." set fixes=%fixes% %mas%genuine-installation-media diff --git a/MAS/Separate-Files-Version/Activators/Ohook_Activation_AIO.cmd b/MAS/Separate-Files-Version/Activators/Ohook_Activation_AIO.cmd index aa321b3..ac11d16 100644 --- a/MAS/Separate-Files-Version/Activators/Ohook_Activation_AIO.cmd +++ b/MAS/Separate-Files-Version/Activators/Ohook_Activation_AIO.cmd @@ -539,7 +539,7 @@ call :dk_color %Red% "Checking Installed Office [Not Found]" if defined ohub ( echo: -echo You only have the Office dashboard app installed, you need to install the full version of Office. +echo You only have the Office Dashboard app installed. You need to install the full version of Office. ) echo: call :dk_color %Blue% "Download and install Office from the below URL and then try again." diff --git a/MAS/Separate-Files-Version/Activators/Online_KMS_Activation.cmd b/MAS/Separate-Files-Version/Activators/Online_KMS_Activation.cmd index db8bba9..200c69e 100644 --- a/MAS/Separate-Files-Version/Activators/Online_KMS_Activation.cmd +++ b/MAS/Separate-Files-Version/Activators/Online_KMS_Activation.cmd @@ -784,7 +784,7 @@ call :dk_color %Red% "Checking Installed Office [Not Found]" if defined ohub ( echo: -echo You have only Office dashboard app installed, you need to install full Office version. +echo You only have the Office Dashboard app installed. You need to install the full version of Office. ) call :dk_color %Blue% "Download and install Office from below URL and try again." set fixes=%fixes% %mas%genuine-installation-media diff --git a/MAS/Separate-Files-Version/Activators/TSforge_Activation.cmd b/MAS/Separate-Files-Version/Activators/TSforge_Activation.cmd index 5c0a10b..33e8f7c 100644 --- a/MAS/Separate-Files-Version/Activators/TSforge_Activation.cmd +++ b/MAS/Separate-Files-Version/Activators/TSforge_Activation.cmd @@ -1054,7 +1054,7 @@ call :dk_color %Gray% "Checking Installed Office [Not Found]" if defined ohub ( echo: -echo You have only Office dashboard app installed, you need to install full Office version. +echo You only have the Office Dashboard app installed. You need to install the full version of Office. ) call :dk_color %Blue% "Download and install Office from below URL and try again." if %_actwin%==0 set fixes=%fixes% %mas%genuine-installation-media From 9073a35fe00b7b40b8086a0036e4f13a20e9d4f4 Mon Sep 17 00:00:00 2001 From: WindowsAddict Date: Sun, 1 Jun 2025 20:27:57 +0530 Subject: [PATCH 68/79] Add StaticCID and KMS4k method in TSforge --- MAS/All-In-One-Version-KL/MAS_AIO.cmd | 934 +++++++++++++++-- .../Activators/TSforge_Activation.cmd | 987 ++++++++++++++++-- README.md | 234 ++--- 3 files changed, 1891 insertions(+), 264 deletions(-) diff --git a/MAS/All-In-One-Version-KL/MAS_AIO.cmd b/MAS/All-In-One-Version-KL/MAS_AIO.cmd index a5761b0..9c90b53 100644 --- a/MAS/All-In-One-Version-KL/MAS_AIO.cmd +++ b/MAS/All-In-One-Version-KL/MAS_AIO.cmd @@ -3976,6 +3976,11 @@ set tsids= :: To reset rearm counter, evaluation period and clear the tamper state, key lock, run the script with "/Z-Reset" parameter or change 0 to 1 in below line set _resall=0 +:: Choose activation method: +:: In builds 19041 and later, the script will auto select StaticCID (requires internet). If no internet is detected, it will then auto select the KMS4k method. For builds lower than 19041, the script will auto select ZeroCID. +:: To change the activation method, run the script with the parameters "/Z-SCID", "/Z-ZCID", or "/Z-KMS4k", or modify the option from Auto to SCID, ZCID, or KMS4k in the line below. +set _actmethod=Auto + :: Debug Mode: :: To run the script in debug mode, change 0 to any parameter above that you want to run, in below line set "_debug=0" @@ -4010,10 +4015,14 @@ if /i "%%A"=="/Z-OffHost" (set _actoffhost=1) if /i "%%A"=="/Z-APPX" (set _actappx=1) echo "%%A" | find /i "/Z-ID-" >nul && (set _actman=1& set "filtsids=%%A" & call set "filtsids=%%filtsids:~6%%" & if defined filtsids call set tsids=%%filtsids%% %%tsids%%) if /i "%%A"=="/Z-Reset" (set _resall=1) +if /i "%%A"=="/Z-SCID" (set _actmethod=SCID) +if /i "%%A"=="/Z-ZCID" (set _actmethod=ZCID) +if /i "%%A"=="/Z-KMS4k" (set _actmethod=KMS4k) ) if not defined tsids set _actman=0 for %%A in (%_actwin% %_actesu% %_actoff% %_actprojvis% %_actwinesuoff% %_actwinhost% %_actoffhost% %_actappx% %_actman% %_resall%) do (if "%%A"=="1" set _unattended=1) +if /i not %_actmethod%==Auto set _unattended=1 if %winbuild% LSS 7600 ( reg query "HKLM\SOFTWARE\Microsoft\NET Framework Setup\NDP\v3.5" /v Install %nul2% | find /i "0x1" %nul1% || ( @@ -4059,6 +4068,7 @@ echo [E] Reset - Rearm/Timers ) else ( echo [E] Reset - Rearm/Timers/Tamper/Lock ) +echo [F] Change - Activation Method [%_actmethod%] echo _______________________________________________ echo: echo [6] Remove TSforge Activation @@ -4067,12 +4077,13 @@ echo [0] %_exitmsg% echo ______________________________________________________________ echo: call :dk_color2 %_White% " " %_Green% "Choose a menu option using your keyboard..." -choice /C:12345ABCDE670 /N +choice /C:12345ABCDEF670 /N set _el=!errorlevel! -if !_el!==13 exit /b -if !_el!==12 start %mas%genuine-installation-media & goto :ts_menu -if !_el!==11 call :ts_remove & cls & goto :ts_menu +if !_el!==14 exit /b +if !_el!==13 start %mas%genuine-installation-media & goto :ts_menu +if !_el!==12 call :ts_remove & cls & goto :ts_menu +if !_el!==11 goto :ts_changemethod if !_el!==10 cls & setlocal & set "_resall=1" & call :ts_start & endlocal & cls & goto :ts_menu if !_el!==9 cls & setlocal & set "_actman=1" & call :ts_start & endlocal & cls & goto :ts_menu if !_el!==8 cls & setlocal & set "_actappx=1" & call :ts_start & endlocal & cls & goto :ts_menu @@ -4088,6 +4099,54 @@ goto :ts_menu ::======================================================================================================================================== +:ts_changemethod + +cls +if not defined terminal mode 76, 36 + +echo: +echo: +echo: +echo ______________________________________________________________ +echo: +call :dk_color2 %_White% " [1] " %_Green% " Auto" +echo Build 19041 and later: +echo Uses StaticCID, or KMS4k if offline. +echo Older builds: Uses ZeroCID. +echo _______________________________________________ +echo: +echo [2] StaticCID +echo Needs Internet. +echo Not for Windows 7 or older. +echo _______________________________________________ +echo: +echo [3] ZeroCID +echo Works only on builds below 19041. +echo _______________________________________________ +echo: +echo [4] KMS4k +echo This applies only to volume products. +echo Activates for 4000+ years using KMS. +echo _______________________________________________ +echo: +echo [5] Learn More +echo [0] %_exitmsg% +echo ______________________________________________________________ +echo: +call :dk_color2 %_White% " " %_Green% "Choose a menu option using your keyboard..." +choice /C:123450 /N +set _el=!errorlevel! + +if !_el!==6 goto :ts_menu +if !_el!==5 cls & start %mas%tsforge &goto :ts_menu +if !_el!==4 cls & set "_actmethod=KMS4k" & goto :ts_menu +if !_el!==3 cls & set "_actmethod=ZCID" & goto :ts_menu +if !_el!==2 cls & set "_actmethod=SCID" & goto :ts_menu +if !_el!==1 cls & set "_actmethod=Auto" & goto :ts_menu +goto :ts_changemethod + +::======================================================================================================================================== + :ts_start cls @@ -4168,6 +4227,57 @@ cls echo: call :dk_showosinfo +if /i %_actmethod%==SCID set tsmethod=StaticCID +if /i %_actmethod%==ZCID set tsmethod=ZeroCID +if /i %_actmethod%==KMS4k set tsmethod=KMS4k + +if /i %_actmethod%==Auto ( +if %winbuild% GEQ 19041 ( +set tsmethod=StaticCID +) else ( +set tsmethod=ZeroCID +) +) + +if %winbuild% LSS 9200 if /i %tsmethod%==StaticCID ( +%eline% +echo StaticCID method is supported only on Windows 8 and later. +goto dk_done +) + +::======================================================================================================================================== + +:: Check Internet connection + +if /i %tsmethod%==StaticCID ( +set _int= +for %%a in (l.root-servers.net resolver1.opendns.com download.windowsupdate.com google.com) do if not defined _int ( +for /f "delims=[] tokens=2" %%# in ('ping -n 1 %%a') do (if not "%%#"=="" set _int=1) +) + +if not defined _int ( +%psc% "If([Activator]::CreateInstance([Type]::GetTypeFromCLSID([Guid]'{DCB00C01-570F-4A9B-8D69-199FDBA5723B}')).IsConnectedToInternet){Exit 0}Else{Exit 1}" +if !errorlevel!==0 (set _int=1&set ping_f= But Ping Failed) +) + +if defined _int ( +echo Checking Internet Connection [Connected!ping_f!] +) else ( +if /i %_actmethod%==Auto if not %_actman%==1 set tsmethod=KMS4k +if /i !tsmethod!==KMS4k ( +call :dk_color %Gray% "Checking Internet Connection [Not Connected]" +call :dk_color %Blue% "Switching To KMS4k Activation Method because Internet is needed for StaticCID method." +) else ( +set error=1 +call :dk_color %Red% "Checking Internet Connection [Not Connected]" +call :dk_color %Blue% "Internet is required for TSforge StaticCID option." +) +echo: +) +) + +::======================================================================================================================================== + echo Initiating Diagnostic Tests... set "_serv=%_slser% Winmgmt" @@ -4185,6 +4295,11 @@ call :dk_color2 %Blue% "Check this webpage for help - " %_Yellow% " %mas%trouble goto :dk_done ) +if /i !tsmethod!==KMS4k ( +call :_taskclear-cache +echo Clearing %KS% Cache [Successful] +) + ::======================================================================================================================================== if %_resall%==1 goto :ts_resetall @@ -4206,16 +4321,23 @@ echo %tsedition% | find /i "Eval" %nul1% && ( goto :ts_wineval ) -call :ts_checkwinperm +set /a UBR=0 +if %winbuild% EQU 26100 ( +for /f "skip=2 tokens=2*" %%a in ('reg query "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion" /v UBR %nul6%') do if not errorlevel 1 set /a UBR=%%b +if !UBR! LSS 4188 (set dontcheckact=1) +) + +if not defined dontcheckact call :ts_checkwinperm if defined _perm ( call :dk_color %Gray% "Checking OS Activation [Windows is already permanently activated]" goto :ts_esu ) +if %winbuild% LSS 9200 if /i %tsmethod%==KMS4k goto :ts_oldks if defined _vis goto :ts_winvista set tempid= -set keytype=zero +if /i %tsmethod%==KMS4k (set keytype=ks) else (set keytype=zero) for /f "delims=" %%a in ('%psc% "$f=[io.file]::ReadAllText('!_batp!') -split ':wintsid\:.*';iex ($f[1])" %nul6%') do ( echo "%%a" | findstr /r ".*-.*-.*-.*-.*" %nul1% && (set tsids=!tsids! %%a& set tempid=%%a) ) @@ -4225,6 +4347,13 @@ echo Checking Activation ID [%tempid%] [%tsedition%] ) else ( call :dk_color %Red% "Checking Activation ID [Not Found] [%tsedition%] [%osSKU%]" set error=1 +if /i %tsmethod%==KMS4k ( +if /i %_actmethod%==Auto ( +call :dk_color %Blue% "Connect to the Internet and try again. Script will use the StaticCID activation method." +) else ( +call :dk_color %Blue% "Use non-KMS4K activation options from the previous menu." +) +) goto :ts_esu ) @@ -4232,6 +4361,83 @@ if defined winsub ( call :dk_color %Blue% "Windows Subscription [SKU ID-%slcSKU%] found. Script will activate base edition [SKU ID-%regSKU%]." echo: ) + +goto :ts_esu + +::======================================================================================================================================== + +:ts_oldks + +:: KMS keys for KMS4k method because TSforge cannot install KMS key on Windows Vista and 7 + +:: 1st column = Activation ID +:: 2nd column = Generic key +:: 3rd column = Edition ID +:: Separator = _ + +set f= +set key= +set tempid= +if not defined allapps call :dk_actids 55c92734-d682-4d71-983e-d6ec3f16059f + +for %%# in ( +:: Windows 7 +ae2ee509-1b34-41c0-acb7-6d4650168915_33PXH-7Y6KF-2VJC9-XBBR8-HV%f%THH_Enterprise +1cb6d605-11b3-4e14-bb30-da91c8e3983a_YDRBP-3D83W-TY26F-D46B2-XC%f%KRJ_EnterpriseN +b92e9980-b9d5-4821-9c94-140f632f6312_FJ82H-XT6CR-J8D7P-XQJJ2-GP%f%DD4_Professional +54a09a0d-d57b-4c10-8b69-a842d6590ad5_MRPKT-YTG23-K7D7T-X2JMM-QY%f%7MG_ProfessionalN +db537896-376f-48ae-a492-53d0547773d0_YBYF6-BHCR3-JPKRB-CDW7B-F9%f%BK4_Embedded_POSReady +aa6dd3aa-c2b4-40e2-a544-a6bbb3f5c395_73KQT-CD9G6-K7TQG-66MRP-CQ%f%22C_Embedded_ThinPC +5a041529-fef8-4d07-b06f-b59b573b32d2_W82YF-2Q76Y-63HXB-FGJG9-GF%f%7QX_ProfessionalE +46bbed08-9c7b-48fc-a614-95250573f4ea_C29WB-22CC8-VJ326-GHFJW-H9%f%DH4_EnterpriseE +:: Windows Server 2008 R2 +68531fb9-5511-4989-97be-d11a0f55633f_YC6KT-GKW9T-YTKYR-T4X34-R7%f%VHC_ServerStandard +7482e61b-c589-4b7f-8ecc-46d455ac3b87_74YFP-3QFB3-KQT8W-PMXWJ-7M%f%648_ServerDatacenter +620e2b3d-09e7-42fd-802a-17a13652fe7a_489J6-VHDMP-X63PK-3K798-CP%f%X3Y_ServerEnterprise +7482e61b-c589-4b7f-8ecc-46d455ac3b87_74YFP-3QFB3-KQT8W-PMXWJ-7M%f%648_ServerDatacenterCore +68531fb9-5511-4989-97be-d11a0f55633f_YC6KT-GKW9T-YTKYR-T4X34-R7%f%VHC_ServerStandardCore +620e2b3d-09e7-42fd-802a-17a13652fe7a_489J6-VHDMP-X63PK-3K798-CP%f%X3Y_ServerEnterpriseCore +8a26851c-1c7e-48d3-a687-fbca9b9ac16b_GT63C-RJFQ3-4GMB6-BRFB9-CB%f%83V_ServerEnterpriseIA64 +a78b8bd9-8017-4df5-b86a-09f756affa7c_6TPJF-RBVHG-WBW2R-86QPH-6R%f%TM4_ServerWeb +cda18cf3-c196-46ad-b289-60c072869994_TT8MH-CG224-D3D7Q-498W2-9Q%f%CTX_ServerHPC +a78b8bd9-8017-4df5-b86a-09f756affa7c_6TPJF-RBVHG-WBW2R-86QPH-6R%f%TM4_ServerWebCore +f772515c-0e87-48d5-a676-e6962c3e1195_736RG-XDKJK-V34PF-BHK87-J6%f%X3K_ServerEmbeddedSolution +:: Windows Vista +cfd8ff08-c0d7-452b-9f60-ef5c70c32094_VKK3X-68KWM-X2YGT-QR4M6-4B%f%WMV_Enterprise +4f3d1606-3fea-4c01-be3c-8d671c401e3b_YFKBB-PQJJV-G996G-VWGXY-2V%f%3X8_Business +2c682dc2-8b68-4f63-a165-ae291d4cf138_HMBQG-8H2RH-C77VX-27R82-VM%f%QBT_BusinessN +d4f54950-26f2-4fb4-ba21-ffab16afcade_VTC42-BM838-43QHV-84HX6-XJ%f%XKV_EnterpriseN +:: Windows Server 2008 +ad2542d4-9154-4c6d-8a44-30f11ee96989_TM24T-X9RMF-VWXK6-X8JC9-BF%f%GM2_ServerStandard +68b6e220-cf09-466b-92d3-45cd964b9509_7M67G-PC374-GR742-YH8V4-TC%f%BY3_ServerDatacenter +c1af4d90-d1bc-44ca-85d4-003ba33db3b9_YQGMW-MPWTJ-34KDK-48M3W-X4%f%Q6V_ServerEnterprise +01ef176b-3e0d-422a-b4f8-4ea880035e8f_4DWFP-JF3DJ-B7DTH-78FJB-PD%f%RHK_ServerEnterpriseIA64 +ddfa9f7c-f09e-40b9-8c1a-be877a9a7f4b_WYR28-R7TFJ-3X2YQ-YCY4H-M2%f%49D_ServerWeb +7afb1156-2c1d-40fc-b260-aab7442b62fe_RCTX3-KWVHP-BR6TB-RB6DM-6X%f%7HP_ServerComputeCluster +2401e3d0-c50a-4b58-87b2-7e794b7d2607_W7VD6-7JFBR-RX26B-YKQ3Y-6F%f%FFJ_ServerStandardV +fd09ef77-5647-4eff-809c-af2b64659a45_22XQ2-VRXRG-P8D42-K34TD-G3%f%QQC_ServerDatacenterV +8198490a-add0-47b2-b3ba-316b12d647b4_39BXF-X8Q23-P2WWT-38T2F-G3%f%FPG_ServerEnterpriseV +) do ( +for /f "tokens=1-3 delims=_" %%A in ("%%#") do if %tsedition%==%%C if not defined key ( +echo "%allapps%" | find /i "%%A" %nul1% && ( +set key=%%B +set tempid=%%A +) +) +) + +if not defined key ( +call :dk_color %Red% "Checking Activation ID [%tsedition% SKU-%osSKU% %KS% key is not available]" +call :dk_color %Blue% "Use ZeroCID activation method from the previous menu." +goto :ts_esu +) + +echo Checking Activation ID [%tempid%] [%tsedition%] + +set oldks=1 +set generickey=1 +call :dk_inskey "[%key%]" +set tsids=%tsids% %tempid% goto :ts_esu ::======================================================================================================================================== @@ -4441,6 +4647,15 @@ call :dk_inskey "[%key%]" :ts_esu if not %_actesu%==1 goto :ts_off +if /i %tsmethod%==KMS4k ( +call :dk_color %Red% "Skipping Windows ESU [KMS4k method is not supported with Windows ESU]" +if /i %_actmethod%==Auto ( +call :dk_color %Blue% "Connect to the Internet and try again. Script will use the StaticCID activation method." +) else ( +call :dk_color %Blue% "Use non-KMS4K activation options from the previous menu." +) +goto :ts_off +) :: Process Windows ESU @@ -4528,8 +4743,12 @@ goto :ts_off if defined esuexistbutnosup ( call :dk_color %Red% "Checking Activation ID [Commercial ESU is not supported for %tsedition%]" +echo %esueditionlist% | find /i "Professional" %nul1% && ( +call :dk_color %Blue% "Go back to Main Menu, select Change Windows Edition option, and change it to [Professional] or any non-Home edition." +) || ( call :dk_color %Blue% "Go back to Main Menu, select Change Windows Edition option and change to any of the below listed editions." echo [%esueditionlist%] +) goto :ts_off ) @@ -4804,6 +5023,24 @@ call :ts_process ::======================================================================================================================================== +:: mass grave[.]dev/office-license-is-not-genuine +:: Add registry keys for volume products so that 'non-genuine' banner won't appear + +set "kmskey=HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\SoftwareProtectionPlatform\0ff1ce15-a989-479d-af46-f275c6370663" +if /i %tsmethod%==KMS4k ( +if %winbuild% GEQ 9200 ( +if not "%osarch%"=="x86" ( +reg delete "%kmskey%" /f /reg:32 %nul% +reg add "%kmskey%" /f /v KeyManagementServiceName /t REG_SZ /d "10.0.0.10" /reg:32 %nul% +) +reg delete "%kmskey%" /f %nul% +reg add "%kmskey%" /f /v KeyManagementServiceName /t REG_SZ /d "10.0.0.10" %nul% +echo Adding a Registry to Prevent Banner [Successful] +) +) + +::======================================================================================================================================== + :ts_startmsi if defined o15msi call :ts_processmsi 15 %o15msi_reg% @@ -4827,6 +5064,17 @@ goto :ts_act echo: echo Processing Windows %KS% Host... +if /i %tsmethod%==KMS4k ( +echo: +call :dk_color %Red% "Skipping Windows %KS% Host [KMS4k method is not supported with Windows %KS% Host]" +if /i %_actmethod%==Auto ( +call :dk_color %Blue% "Connect to the Internet and try again. Script will use the StaticCID activation method." +) else ( +call :dk_color %Blue% "Use non-KMS4K activation options from the previous menu." +) +goto :ts_act +) + echo: if %winbuild% GEQ 10586 ( call :dk_color %Gray% "With %KS% Host license, system may randomly change Windows Edition later. It is a Windows issue and can be safely ignored." @@ -4938,6 +5186,17 @@ call :dk_color %Blue% "Windows Vista and Server 2008 do not support the installa goto :ts_act ) +if /i %tsmethod%==KMS4k ( +echo: +call :dk_color %Red% "Skipping Office %KS% Host [KMS4k method is not supported with Office %KS% Host]" +if /i %_actmethod%==Auto ( +call :dk_color %Blue% "Connect to the Internet and try again. Script will use the StaticCID activation method." +) else ( +call :dk_color %Blue% "Use non-KMS4K activation options from the previous menu." +) +goto :ts_act +) + set ohostexist= call :dk_actids 0ff1ce15-a989-479d-af46-f275c6370663 set ohostids=%allapps% @@ -4990,6 +5249,17 @@ call :dk_color %Gray% "Checking Activation ID [APPX Sideloading goto :dk_done ) +if /i %tsmethod%==KMS4k ( +echo: +call :dk_color %Red% "Skipping Windows 8/8.1 APPX [KMS4k method is not supported with Windows 8/8.1 APPX]" +if /i %_actmethod%==Auto ( +call :dk_color %Blue% "Connect to the Internet and try again. Script will use the StaticCID activation method." +) else ( +call :dk_color %Blue% "Use non-KMS4K activation options from the previous menu." +) +goto :dk_done +) + set appxexist= if not defined allapps call :dk_actids 55c92734-d682-4d71-983e-d6ec3f16059f @@ -5048,6 +5318,17 @@ echo: echo Processing Manual Activation... echo: +if /i %tsmethod%==KMS4k ( +echo: +call :dk_color %Red% "Skipping Manual Activation [KMS4k method is not supported with it]" +if /i %_actmethod%==Auto ( +call :dk_color %Blue% "Connect to the Internet and try again. Script will use the StaticCID activation method." +) else ( +call :dk_color %Blue% "Use non-KMS4K activation options from the previous menu." +) +goto :dk_done +) + call :dk_color %Gray% "This option is for advanced users, those who already know what they are doing." call :dk_color %Blue% "Some activation IDs may cause system crash [MUI mismatch], or irreversible changes [CloudEdition etc]." @@ -5207,12 +5488,16 @@ call :dk_color2 %Blue% "Check this webpage for help - " %_Yellow% " %mas%trouble if defined tsids ( echo: -if not defined _vis echo Installing Forged Product Key Data... -echo Depositing Zero Confirmation ID... +if not defined _vis if not defined oldks echo Installing Forged Product Key Data... +if /i %tsmethod%==KMS4k ( +echo Writing TrustedStore data... +) else ( +if /i %tsmethod%==StaticCID (echo Depositing Static Confirmation ID...) else (echo Depositing Zero Confirmation ID...) +) echo: %psc% "$f=[io.file]::ReadAllText('!_batp!') -split ':tsforge\:.*';& ([ScriptBlock]::Create($f[1])) %tsids%" if !errorlevel!==3 ( -if %_actman%==0 call :dk_color %Blue% "%_fixmsg%" +if %_actman%==0 (if not defined error call :dk_color %Blue% "%_fixmsg%") set fixes=%fixes% %mas%troubleshoot call :dk_color2 %Blue% "Check this webpage for help - " %_Yellow% " %mas%troubleshoot" ) else ( @@ -5328,6 +5613,19 @@ set _preview= set _License=%%# set skipprocess= + +set foundprod= +call :tsksdata chkprod %%# +if defined _oMSI if not defined foundprod if /i %tsmethod%==KMS4k ( +set skipprocess=1 +call :dk_color %Red% "Checking Product In Script [%%# MSI Retail is not supported with KMS4k]" +if /i %_actmethod%==Auto ( +call :dk_color %Blue% "Connect to the Internet and try again. Script will use the StaticCID activation method." +) else ( +call :dk_color %Blue% "Use non-KMS4K activation options from the previous menu." +) +) + if "%_actprojvis%"=="1" ( echo %%# | findstr /i "Project Visio" %nul% || ( set skipprocess=1 @@ -5335,8 +5633,17 @@ call :dk_color %Gray% "Skipping Because Project/Visio Mode [%%#]" ) ) +if "%_actprojvis%"=="0" if /i %tsmethod%==KMS4k echo %_oIds% | findstr /i "O365" %nul% && ( +echo %%# | findstr /i "Project Visio" %nul% && ( +set skipprocess=1 +echo Skipping Because Mondo Is Available [%%#] +) +) + + if not defined skipprocess ( +if /i not %tsmethod%==KMS4k ( set no365= if "%oVer%"=="15" (echo %%# | findstr /i "O365HomePremRetail" %nul% && set no365=1) if "%oVer%"=="16" (echo %%# | findstr /i "O365" %nul% && set no365=1) @@ -5358,8 +5665,30 @@ call :ks_osppready echo Converting Unsupported OEM-ARM Office [%%# To MondoRetail] ) ) +) +if not defined _oMSI if /i %tsmethod%==KMS4k if not defined foundprod ( +call :tsksdata getinfo %%# +if defined _altoffid ( +echo Converting Retail To Volume [%%# To !_altoffid!] +) else ( +set _License=MondoVolume +set _altoffid=MondoVolume +echo Converting Retail To Volume [%%# To !_altoffid!] [Using Mondo because %%# is not found in the script] +) +echo %%# | find /i "O365" %nul% && ( +if "%oVer%"=="15" (call :dk_color %Gray% "Mondo 2013 is equivalent to O365 [15.0 version] in terms of the latest features.") +if "%oVer%"=="16" (call :dk_color %Gray% "Mondo 2016 is equivalent to O365 in terms of the latest features.") +) +call :ks_osppready +) + +if /i %tsmethod%==KMS4k ( +echo !_License! | find /i "Retail" %nul% && (set keytype=zero) || (set keytype=ks) +) else ( set keytype=zero +) + for /f "delims=" %%a in ('%psc% "$f=[io.file]::ReadAllText('!_batp!') -split ':offtsid\:.*';iex ($f[1])" %nul6%') do ( echo "%%a" | findstr /r ".*-.*-.*-.*-.*" %nul1% && (set tsids=!tsids! %%a& set _actid=%%a) ) @@ -5388,7 +5717,7 @@ echo "!allapps!" | find /i "!_actid!" %nul1% || call :oh_installlic :: Add SharedComputerLicensing registry key if Retail Office C2R is installed on Windows Server :: https://learn.microsoft.com/en-us/office/troubleshoot/office-suite-issues/click-to-run-office-on-terminal-server -if defined winserver if defined _config if exist "%_oLPath%\Word2019VL_KMS_Client_AE*.xrm-ms" ( +if /i not %tsmethod%==KMS4k if defined winserver if defined _config if exist "%_oLPath%\Word2019VL_KMS_Client_AE*.xrm-ms" ( echo %_oIds% | find /i "Retail" %nul1% && ( set scaIsNeeded=1 reg add %_config% /v SharedComputerLicensing /t REG_SZ /d "1" /f %nul1% @@ -5454,6 +5783,220 @@ exit /b :tsforge: $src = @' +#if !POWERSHELL2 +namespace ActivationWs +{ + +/* + +This code is adapted from ActivationWs. +Original Repository: https://github.com/dadorner-msft/activationws + +MIT License + +Copyright (c) Daniel Dorner + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. + +*/ + +using System; +using System.IO; +using System.Linq; +using System.Net; +using System.Security.Cryptography; +using System.Text; +using System.Xml.Linq; + + public static class ActivationHelper { + // Key for HMAC/SHA256 signature. + private static readonly byte[] MacKey = new byte[64] { + 254, 49, 152, 117, 251, 72, 132, 134, + 156, 243, 241, 206, 153, 168, 144, 100, + 171, 87, 31, 202, 71, 4, 80, 88, + 48, 36, 226, 20, 98, 135, 121, 160, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0 + }; + + private const string Action = "http://www.microsoft.com/BatchActivationService/BatchActivate"; + + private static readonly Uri Uri = new Uri("https://activation.sls.microsoft.com/BatchActivation/BatchActivation.asmx"); + + private static readonly XNamespace SoapSchemaNs = "http://schemas.xmlsoap.org/soap/envelope/"; + private static readonly XNamespace XmlSchemaInstanceNs = "http://www.w3.org/2001/XMLSchema-instance"; + private static readonly XNamespace XmlSchemaNs = "http://www.w3.org/2001/XMLSchema"; + private static readonly XNamespace BatchActivationServiceNs = "http://www.microsoft.com/BatchActivationService"; + private static readonly XNamespace BatchActivationRequestNs = "http://www.microsoft.com/DRM/SL/BatchActivationRequest/1.0"; + private static readonly XNamespace BatchActivationResponseNs = "http://www.microsoft.com/DRM/SL/BatchActivationResponse/1.0"; + + public static string CallWebService(int requestType, string installationId, string extendedProductId) { + XDocument soapRequest = CreateSoapRequest(requestType, installationId, extendedProductId); + HttpWebRequest webRequest = CreateWebRequest(soapRequest); + XDocument soapResponse = new XDocument(); + + try { + IAsyncResult asyncResult = webRequest.BeginGetResponse(null, null); + asyncResult.AsyncWaitHandle.WaitOne(); + + // Read data from the response stream. + using (WebResponse webResponse = webRequest.EndGetResponse(asyncResult)) + using (StreamReader streamReader = new StreamReader(webResponse.GetResponseStream())) { + soapResponse = XDocument.Parse(streamReader.ReadToEnd()); + } + + return ParseSoapResponse(soapResponse); + + } catch { + throw; + } + } + + private static XDocument CreateSoapRequest(int requestType, string installationId, string extendedProductId) { + // Create an activation request. + XElement activationRequest = new XElement(BatchActivationRequestNs + "ActivationRequest", + new XElement(BatchActivationRequestNs + "VersionNumber", "2.0"), + new XElement(BatchActivationRequestNs + "RequestType", requestType), + new XElement(BatchActivationRequestNs + "Requests", + new XElement(BatchActivationRequestNs + "Request", + new XElement(BatchActivationRequestNs + "PID", extendedProductId), + requestType == 1 ? new XElement(BatchActivationRequestNs + "IID", installationId) : null) + ) + ); + + // Get the unicode byte array of activationRequest and convert it to Base64. + byte[] bytes = Encoding.Unicode.GetBytes(activationRequest.ToString()); + string requestXml = Convert.ToBase64String(bytes); + + XDocument soapRequest = new XDocument(); + + using (HMACSHA256 hMACSHA = new HMACSHA256(MacKey)) { + // Convert the HMAC hashed data to Base64. + string digest = Convert.ToBase64String(hMACSHA.ComputeHash(bytes)); + + soapRequest = new XDocument( + new XDeclaration("1.0", "UTF-8", "no"), + new XElement(SoapSchemaNs + "Envelope", + new XAttribute(XNamespace.Xmlns + "soap", SoapSchemaNs), + new XAttribute(XNamespace.Xmlns + "xsi", XmlSchemaInstanceNs), + new XAttribute(XNamespace.Xmlns + "xsd", XmlSchemaNs), + new XElement(SoapSchemaNs + "Body", + new XElement(BatchActivationServiceNs + "BatchActivate", + new XElement(BatchActivationServiceNs + "request", + new XElement(BatchActivationServiceNs + "Digest", digest), + new XElement(BatchActivationServiceNs + "RequestXml", requestXml) + ) + ) + ) + )); + + } + + return soapRequest; + } + + private static HttpWebRequest CreateWebRequest(XDocument soapRequest) { + HttpWebRequest webRequest = (HttpWebRequest)WebRequest.Create(Uri); + webRequest.Accept = "text/xml"; + webRequest.ContentType = "text/xml; charset=\"utf-8\""; + webRequest.Headers.Add("SOAPAction", Action); + webRequest.Host = "activation.sls.microsoft.com"; + webRequest.Method = "POST"; + + try { + // Insert SOAP envelope + using (Stream stream = webRequest.GetRequestStream()) { + soapRequest.Save(stream); + } + + return webRequest; + + } catch { + throw; + } + } + + private static string ParseSoapResponse(XDocument soapResponse) { + if (soapResponse == null) { + throw new ArgumentNullException("soapResponse", "The remote server returned an unexpected response."); + } + + if (!soapResponse.Descendants(BatchActivationServiceNs + "ResponseXml").Any()) { + throw new Exception("The remote server returned an unexpected response"); + } + + try { + XDocument responseXml = XDocument.Parse(soapResponse.Descendants(BatchActivationServiceNs + "ResponseXml").First().Value); + + if (responseXml.Descendants(BatchActivationResponseNs + "ErrorCode").Any()) { + string errorCode = responseXml.Descendants(BatchActivationResponseNs + "ErrorCode").First().Value; + + switch (errorCode) { + case "0x7F": + throw new Exception("The Multiple Activation Key has exceeded its limit"); + + case "0x67": + throw new Exception("The product key has been blocked"); + + case "0x68": + throw new Exception("Invalid product key"); + + case "0x86": + throw new Exception("Invalid key type"); + + case "0x90": + throw new Exception("Please check the Installation ID and try again"); + + default: + throw new Exception(string.Format("The remote server reported an error ({0})", errorCode)); + } + + } else if (responseXml.Descendants(BatchActivationResponseNs + "ResponseType").Any()) { + string responseType = responseXml.Descendants(BatchActivationResponseNs + "ResponseType").First().Value; + + switch (responseType) { + case "1": + string confirmationId = responseXml.Descendants(BatchActivationResponseNs + "CID").First().Value; + return confirmationId; + + case "2": + string activationsRemaining = responseXml.Descendants(BatchActivationResponseNs + "ActivationRemaining").First().Value; + return activationsRemaining; + + default: + throw new Exception("The remote server returned an unrecognized response"); + } + + } else { + throw new Exception("The remote server returned an unrecognized response"); + } + + } catch { + throw; + } + } + } +} +#endif + // Common.cs namespace LibTSforge { @@ -8015,27 +8558,23 @@ namespace LibTSforge.Modifiers } -// Activators/AVMA4K.cs +// Activators/KMS4K.cs namespace LibTSforge.Activators { using System; + using System.IO; using PhysicalStore; using SPP; - public static class AVMA4k + public class KMS4k { public static void Activate(PSVersion version, bool production, Guid actId) { - if (version != PSVersion.WinModern && version != PSVersion.WinBlue) - { - throw new NotSupportedException("AVMA licenses are not available for this product."); - } - Guid appId; if (actId == Guid.Empty) { appId = SLApi.WINDOWS_APP_ID; - actId = SLApi.GetDefaultActivationID(appId, false); + actId = SLApi.GetDefaultActivationID(appId, true); if (actId == Guid.Empty) { @@ -8047,9 +8586,9 @@ namespace LibTSforge.Activators appId = SLApi.GetAppId(actId); } - if (SLApi.GetPKeyChannel(SLApi.GetInstalledPkeyID(actId)) != "VT:IA") + if (SLApi.GetPKeyChannel(SLApi.GetInstalledPkeyID(actId)) != "Volume:GVLK") { - throw new NotSupportedException("Non-VT:IA product key installed."); + throw new NotSupportedException("Non-Volume:GVLK product key installed."); } SPPUtils.KillSPP(version); @@ -8060,80 +8599,171 @@ namespace LibTSforge.Activators { string key = string.Format("SPPSVC\\{0}\\{1}", appId, actId); - long creationTime = BitConverter.ToInt64(store.GetBlock("__##USERSEP##\\$$_RESERVED_$$\\NAMESPACE__", "__##USERSEP-RESERVED##__$$GLOBAL-CREATION-TIME$$").Data, 0); - long tickCount = BitConverter.ToInt64(store.GetBlock("__##USERSEP##\\$$_RESERVED_$$\\NAMESPACE__", "__##USERSEP-RESERVED##__$$GLOBAL-TICKCOUNT-UPTIME$$").Data, 0); - long deltaTime = BitConverter.ToInt64(store.GetBlock(key, "__##USERSEP-RESERVED##__$$UP-TIME-DELTA$$").Data, 0); + ulong unknown = 0; + ulong time1; + ulong time2 = (ulong)DateTime.UtcNow.ToFileTime(); + ulong expiry = Constants.TimerMax; - const ulong unknown = 0; - ulong time1 = (ulong)(creationTime + tickCount + deltaTime); - ulong crcBindTime = (ulong)DateTime.UtcNow.ToFileTime(); - ulong timerTime = crcBindTime / 10000; - ulong expiry = Constants.TimerMax / 10000; - - VariableBag avmaBinding = new VariableBag(version); - - avmaBinding.Blocks.AddRange(new[] + if (version == PSVersion.Vista || version == PSVersion.Win7) { + unknown = 0x800000000; + time1 = 0; + } + else + { + long creationTime = BitConverter.ToInt64(store.GetBlock("__##USERSEP##\\$$_RESERVED_$$\\NAMESPACE__", "__##USERSEP-RESERVED##__$$GLOBAL-CREATION-TIME$$").Data, 0); + long tickCount = BitConverter.ToInt64(store.GetBlock("__##USERSEP##\\$$_RESERVED_$$\\NAMESPACE__", "__##USERSEP-RESERVED##__$$GLOBAL-TICKCOUNT-UPTIME$$").Data, 0); + long deltaTime = BitConverter.ToInt64(store.GetBlock(key, "__##USERSEP-RESERVED##__$$UP-TIME-DELTA$$").Data, 0); + + time1 = (ulong)(creationTime + tickCount + deltaTime); + time2 /= 10000; + expiry /= 10000; + } + + if (version == PSVersion.Vista) + { + VistaTimer vistaTimer = new VistaTimer + { + Time = time2, + Expiry = Constants.TimerMax + }; + + string vistaTimerName = string.Format("msft:sl/timer/VLExpiration/VOLUME/{0}/{1}", appId, actId); + + store.DeleteBlock(key, vistaTimerName); + store.DeleteBlock(key, actId.ToString()); + + BinaryWriter writer = new BinaryWriter(new MemoryStream()); + writer.Write(Constants.KMSv4Response.Length); + writer.Write(Constants.KMSv4Response); + writer.Write(Constants.UniversalHWIDBlock); + byte[] kmsData = writer.GetBytes(); + + store.AddBlocks(new[] + { + new PSBlock + { + Type = BlockType.TIMER, + Flags = 0, + KeyAsStr = key, + ValueAsStr = vistaTimerName, + Data = vistaTimer.CastToArray() + }, + new PSBlock + { + Type = BlockType.NAMED, + Flags = 0, + KeyAsStr = key, + ValueAsStr = actId.ToString(), + Data = kmsData + } + }); + } + else + { + byte[] hwidBlock = Constants.UniversalHWIDBlock; + byte[] kmsResp; + + switch (version) + { + case PSVersion.Win7: + kmsResp = Constants.KMSv4Response; + break; + case PSVersion.Win8: + kmsResp = Constants.KMSv5Response; + break; + case PSVersion.WinBlue: + case PSVersion.WinModern: + kmsResp = Constants.KMSv6Response; + break; + default: + throw new NotSupportedException("Unsupported PSVersion."); + } + + VariableBag kmsBinding = new VariableBag(version); + + kmsBinding.Blocks.AddRange(new[] + { new CRCBlockModern { DataType = CRCBlockType.BINARY, Key = new byte[] { }, - Value = BitConverter.GetBytes(crcBindTime), + Value = kmsResp }, new CRCBlockModern { DataType = CRCBlockType.STRING, Key = new byte[] { }, - ValueAsStr = "AVMA4K", + ValueAsStr = "msft:rm/algorithm/hwid/4.0" }, new CRCBlockModern { - DataType = CRCBlockType.STRING, - Key = new byte[] { }, - ValueAsStr = "00491-50000-00001-AA666", + DataType = CRCBlockType.BINARY, + KeyAsStr = "SppBindingLicenseData", + Value = hwidBlock } - }); + }); - byte[] avmaBindingData = avmaBinding.Serialize(); + if (version == PSVersion.WinModern) + { + kmsBinding.Blocks.AddRange(new[] + { + new CRCBlockModern + { + DataType = CRCBlockType.STRING, + Key = new byte[] { }, + ValueAsStr = "massgrave.dev" + }, + new CRCBlockModern + { + DataType = CRCBlockType.STRING, + Key = new byte[] { }, + ValueAsStr = "6969" + } + }); + } - Timer avmaTimer = new Timer - { - Unknown = unknown, - Time1 = time1, - Time2 = timerTime, - Expiry = expiry - }; + byte[] kmsBindingData = kmsBinding.Serialize(); - string storeVal = string.Format("msft:spp/ia/bind/1.0/store/{0}/{1}", appId, actId); - string timerVal = string.Format("msft:spp/ia/bind/1.0/timer/{0}/{1}", appId, actId); + Timer kmsTimer = new Timer + { + Unknown = unknown, + Time1 = time1, + Time2 = time2, + Expiry = expiry + }; - store.DeleteBlock(key, storeVal); - store.DeleteBlock(key, timerVal); + string storeVal = string.Format("msft:spp/kms/bind/2.0/store/{0}/{1}", appId, actId); + string timerVal = string.Format("msft:spp/kms/bind/2.0/timer/{0}/{1}", appId, actId); - store.AddBlocks(new[] - { + store.DeleteBlock(key, storeVal); + store.DeleteBlock(key, timerVal); + + store.AddBlocks(new[] + { new PSBlock { Type = BlockType.NAMED, - Flags = 0x400, + Flags = (version == PSVersion.WinModern) ? (uint)0x400 : 0, KeyAsStr = key, ValueAsStr = storeVal, - Data = avmaBindingData, + Data = kmsBindingData }, new PSBlock { Type = BlockType.TIMER, - Flags = 0x4, + Flags = (version == PSVersion.Win7) ? (uint)0 : 0x4, KeyAsStr = key, ValueAsStr = timerVal, - Data = avmaTimer.CastToArray() + Data = kmsTimer.CastToArray() } - }); + }); + } } - SLApi.RefreshLicenseStatus(); + SPPUtils.RestartSPP(version); SLApi.FireStateChangedEvent(appId); - Logger.WriteLine("Activated using AVMA4k successfully."); + Logger.WriteLine("Activated using KMS4k successfully."); } } } @@ -10240,15 +10870,16 @@ namespace LibTSforge.PhysicalStore '@ $ErrorActionPreference = 'Stop' $binPath = "$env:_work\BIN\LibTSforge.dll" +$psMajorVer = (Get-Host).Version.Major if (Test-Path -LiteralPath $binPath) { Write-Host "LibTSforge.dll found in BIN folder. Loading the DLL..." Add-Type -Path $binPath } else { - $cp = [CodeDom.Compiler.CompilerParameters] [string[]]@("System.dll", "System.Core.dll", "System.ServiceProcess.dll", "System.Xml.dll") - $cp.CompilerOptions = "/unsafe" - $lang = If ((Get-Host).Version.Major -gt 2) { "CSharp" } Else { "CSharpVersion3" } + $cp = [CodeDom.Compiler.CompilerParameters] [string[]]@("System.dll", "System.Core.dll", "System.ServiceProcess.dll", "System.Xml.dll", "System.Xml.Linq.dll") + if ($psMajorVer -le 2) { $cp.CompilerOptions = "/define:POWERSHELL2 /unsafe" } else { $cp.CompilerOptions = "/unsafe" } + $lang = if ($psMajorVer -gt 2) { "CSharp" } else { "CSharpVersion3" } $ctemp = "$env:SystemRoot\Temp\" if (-Not (Test-Path -Path $ctemp)) { New-Item -Path $ctemp -ItemType Directory > $null } @@ -10297,32 +10928,65 @@ function slGetSkuInfo($SkuId) { if (-not $env:resetstuff) { foreach ($tsactid in $tsactids) { try { + $activated = $null $prodDes = Get-WmiInfo -tsactid $tsactid -property "Description" $prodName = Get-WmiInfo -tsactid $tsactid -property "Name" if ($prodName) { $nameParts = $prodName -split ',', 2 $prodName = if ($nameParts.Count -gt 1) { ($nameParts[1].Trim() -split '[ ,]')[0] } else { $null } } - if (-not $env:_vis) { - [LibTSforge.Modifiers.GenPKeyInstall]::InstallGenPKey($ver, $prod, $tsactid) - } - if ($prodName -match 'Office' -and -not (slGetSkuInfo($tsactid))) { + if (-not $env:_vis -and -not $env:oldks) { + [LibTSforge.Modifiers.GenPKeyInstall]::InstallGenPKey($ver, $prod, $tsactid) + } + if ($prodName -match 'Office' -and $prodDes -notmatch 'KMS' -and -not (slGetSkuInfo($tsactid))) { $licenseStatus = Get-WmiInfo -tsactid $tsactid -property "LicenseStatus" if ($licenseStatus -eq 1) { Write-Host "[$prodName] is already permanently activated." -ForegroundColor White -BackgroundColor DarkGreen continue } } - [LibTSforge.Activators.ZeroCID]::Activate($ver, $prod, $tsactid) - $licenseStatus = Get-WmiInfo -tsactid $tsactid -property "LicenseStatus" - if ($licenseStatus -eq 1) { + if ($env:tsmethod -eq "StaticCID") { + [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12 + $attempts = @( + @(100055, 1000043, 1338662172562478), + @(1345, 1003020, 6311608238084405) + ) + foreach ($params in $attempts) { + [LibTSforge.Modifiers.SetIIDParams]::SetParams($ver, $prod, $tsactid, [LibTSforge.SPP.PKeyAlgorithm]::PKEY2009, $params[0], $params[1], $params[2]) + $instId = [LibTSforge.SPP.SLApi]::GetInstallationID($tsactid) + $confId = [ActivationWs.ActivationHelper]::CallWebService(1, $instId, "31337-42069-123-456789-04-1337-2600.0000-2542001") + $result = [LibTSforge.SPP.SLApi]::DepositConfirmationID($tsactid, $instId, $confId) + if ($result -eq 0) { break } + } + [LibTSforge.SPP.SPPUtils]::RestartSPP($ver) + } + elseif ($env:tsmethod -eq "KMS4k") { + [LibTSforge.Activators.KMS4k]::Activate($ver, $prod, $tsactid) + } + else { + [LibTSforge.Activators.ZeroCID]::Activate($ver, $prod, $tsactid) + } + if ($env:tsmethod -eq "KMS4k") { + $GracePeriodStatus = Get-WmiInfo -tsactid $tsactid -property "GracePeriodRemaining" + if ($GracePeriodStatus -gt 259200) { $activated = 1 } + } + else { + $licenseStatus = Get-WmiInfo -tsactid $tsactid -property "LicenseStatus" + if ($licenseStatus -eq 1) { $activated = 1 } + } + if ($activated) { if ($prodDes -match 'KMS' -and $prodDes -notmatch 'CLIENT') { [LibTSforge.Modifiers.KMSHostCharge]::Charge($ver, $prod, $tsactid) - Write-Host "[$prodName] CSVLK is permanently activated with ZeroCID." -ForegroundColor White -BackgroundColor DarkGreen + Write-Host "[$prodName] CSVLK is permanently activated with $env:tsmethod." -ForegroundColor White -BackgroundColor DarkGreen Write-Host "[$prodName] CSVLK is charged with 25 clients for 30 days." -ForegroundColor White -BackgroundColor DarkGreen } else { - Write-Host "[$prodName] is permanently activated with ZeroCID." -ForegroundColor White -BackgroundColor DarkGreen + if ($env:tsmethod -eq "KMS4k") { + Write-Host "[$prodName] is activated till $([DateTime]::Now.AddMinutes($GracePeriodStatus).ToString('yyyy-MM-dd HH:mm:ss')) with $env:tsmethod." -ForegroundColor White -BackgroundColor DarkGreen + } + else { + Write-Host "[$prodName] is permanently activated with $env:tsmethod." -ForegroundColor White -BackgroundColor DarkGreen + } } } else { @@ -10340,11 +11004,11 @@ if (-not $env:resetstuff) { if ($env:resetstuff) { try { - if (-not $env:_vis) {[LibTSforge.Modifiers.TamperedFlagsDelete]::DeleteTamperFlags($ver, $prod)} + if (-not $env:_vis) { [LibTSforge.Modifiers.TamperedFlagsDelete]::DeleteTamperFlags($ver, $prod) } [LibTSforge.SPP.SLApi]::RefreshLicenseStatus() [LibTSforge.Modifiers.RearmReset]::Reset($ver, $prod) [LibTSforge.Modifiers.GracePeriodReset]::Reset($ver, $prod) - if (-not $env:_vis) {[LibTSforge.Modifiers.KeyChangeLockDelete]::Delete($ver, $prod)} + if (-not $env:_vis) { [LibTSforge.Modifiers.KeyChangeLockDelete]::Delete($ver, $prod) } } catch { $errcode = 3 @@ -10604,6 +11268,130 @@ Office-ActID -pkeypath "$env:pkeypath" -edition "$env:_License" -keytype "$env:k ::======================================================================================================================================== +:: 1st column = Office version +:: 2nd column = Volume or free retail product +:: 3rd column = Retail product names that needs to be converted to the Volume product mentioned in 2nd column +:: Separator = "_" + +:tsksdata + +set f= +for %%# in ( +:: Office 2013 +15_AccessVolume_-AccessRetail- +15_AccessRuntimeRetail +15_ExcelVolume_-ExcelRetail- +15_GrooveVolume_-GrooveRetail- +15_InfoPathVolume_-InfoPathRetail- +15_LyncAcademicRetail +15_LyncEntryRetail +15_LyncVolume_-LyncRetail- +15_MondoRetail +15_MondoVolume_-O365BusinessRetail-O365HomePremRetail-O365ProPlusRetail-O365SmallBusPremRetail- +15_OneNoteFreeRetail +15_OneNoteVolume_-OneNoteRetail- +15_OutlookVolume_-OutlookRetail- +15_PowerPointVolume_-PowerPointRetail- +15_ProjectProVolume_-ProjectProRetail- +15_ProjectStdVolume_-ProjectStdRetail- +15_ProPlusVolume_-ProPlusRetail-ProfessionalPipcRetail-ProfessionalRetail- +15_PublisherVolume_-PublisherRetail- +15_SPDRetail +15_StandardVolume_-StandardRetail-HomeBusinessPipcRetail-HomeBusinessRetail-HomeStudentARMRetail-HomeStudentPlusARMRetail-HomeStudentRetail-PersonalPipcRetail-PersonalRetail- +15_VisioProVolume_-VisioProRetail- +15_VisioStdVolume_-VisioStdRetail- +15_WordVolume_-WordRetail- +:: Office 2016 +16_AccessRuntimeRetail +16_AccessVolume_-AccessRetail- +16_ExcelVolume_-ExcelRetail- +16_MondoRetail +16_MondoVolume_-O365AppsBasicRetail-O365BusinessRetail-O365EduCloudRetail-O365HomePremRetail-O365ProPlusRetail-O365SmallBusPremRetail- +16_OneNoteFreeRetail +16_OneNoteVolume_-OneNoteRetail-OneNote2021Retail- +16_OutlookVolume_-OutlookRetail- +16_PowerPointVolume_-PowerPointRetail- +16_ProjectProVolume_-ProjectProRetail- +16_ProjectProXVolume +16_ProjectStdVolume_-ProjectStdRetail- +16_ProjectStdXVolume +16_ProPlusVolume_-ProPlusRetail-ProfessionalPipcRetail-ProfessionalRetail- +16_PublisherVolume_-PublisherRetail- +16_SkypeServiceBypassRetail +16_SkypeforBusinessEntryRetail +16_SkypeforBusinessVolume_-SkypeforBusinessRetail- +16_StandardVolume_-StandardRetail-HomeBusinessPipcRetail-HomeBusinessRetail-HomeStudentARMRetail-HomeStudentPlusARMRetail-HomeStudentRetail-HomeStudentVNextRetail-PersonalPipcRetail-PersonalRetail- +16_VisioProVolume_-VisioProRetail- +16_VisioProXVolume +16_VisioStdVolume_-VisioStdRetail- +16_VisioStdXVolume +16_WordVolume_-WordRetail- +:: Office 2019 +16_AccessRuntime2019Retail +16_Access2019Volume_-Access2019Retail- +16_Excel2019Volume_-Excel2019Retail- +16_Outlook2019Volume_-Outlook2019Retail- +16_PowerPoint2019Volume_-PowerPoint2019Retail- +16_ProjectPro2019Volume_-ProjectPro2019Retail- +16_ProjectStd2019Volume_-ProjectStd2019Retail- +16_ProPlus2019Volume_-ProPlus2019Retail-Professional2019Retail- +16_Publisher2019Volume_-Publisher2019Retail- +16_SkypeforBusiness2019Volume_-SkypeforBusiness2019Retail- +16_SkypeforBusinessEntry2019Retail +16_Standard2019Volume_-Standard2019Retail-HomeBusiness2019Retail-HomeStudentARM2019Retail-HomeStudentPlusARM2019Retail-HomeStudent2019Retail-Personal2019Retail- +16_VisioPro2019Volume_-VisioPro2019Retail- +16_VisioStd2019Volume_-VisioStd2019Retail- +16_Word2019Volume_-Word2019Retail- +:: Office 2021 +:: OneNote2021Volume KMS license is not available +16_AccessRuntime2021Retail +16_Access2021Volume_-Access2021Retail- +16_Excel2021Volume_-Excel2021Retail- +16_Outlook2021Volume_-Outlook2021Retail- +16_OneNoteFree2021Retail +16_PowerPoint2021Volume_-PowerPoint2021Retail- +16_ProjectPro2021Volume_-ProjectPro2021Retail- +16_ProjectStd2021Volume_-ProjectStd2021Retail- +16_ProPlus2021Volume_-ProPlus2021Retail-Professional2021Retail- +16_Publisher2021Volume_-Publisher2021Retail- +16_SkypeforBusiness2021Volume_-SkypeforBusiness2021Retail- +16_Standard2021Volume_-Standard2021Retail-HomeBusiness2021Retail-HomeStudent2021Retail-Personal2021Retail- +16_VisioPro2021Volume_-VisioPro2021Retail- +16_VisioStd2021Volume_-VisioStd2021Retail- +16_Word2021Volume_-Word2021Retail- +:: Office 2024 +16_Access2024Volume_-Access2024Retail- +16_Excel2024Volume_-Excel2024Retail- +16_Outlook2024Volume_-Outlook2024Retail- +16_PowerPoint2024Volume_-PowerPoint2024Retail- +16_ProjectPro2024Volume_-ProjectPro2024Retail- +16_ProjectStd2024Volume_-ProjectStd2024Retail- +16_ProPlus2024Volume_-ProPlus2024Retail- +16_SkypeforBusiness2024Volume +16_Standard2024Volume_-Home2024Retail-HomeBusiness2024Retail- +16_VisioPro2024Volume_-VisioPro2024Retail- +16_VisioStd2024Volume_-VisioStd2024Retail- +16_Word2024Volume_-Word2024Retail- +) do ( +for /f "tokens=1-3 delims=_" %%A in ("%%#") do ( + +if %1==chkprod if "%oVer%"=="%%A" if not defined foundprod ( +if /i "%%B"=="%2" set foundprod=1 +) + +if %1==getinfo if "%oVer%"=="%%A" ( +echo: %%C | find /i "-%2-" %nul% && ( +set _License=%%B +set _altoffid=%%B +) +) + +) +) +exit /b + +::======================================================================================================================================== + :ts_getedition set tsedition= diff --git a/MAS/Separate-Files-Version/Activators/TSforge_Activation.cmd b/MAS/Separate-Files-Version/Activators/TSforge_Activation.cmd index 33e8f7c..c80d70e 100644 --- a/MAS/Separate-Files-Version/Activators/TSforge_Activation.cmd +++ b/MAS/Separate-Files-Version/Activators/TSforge_Activation.cmd @@ -45,6 +45,11 @@ set tsids= :: To reset rearm counter, evaluation period and clear the tamper state, key lock, run the script with "/Z-Reset" parameter or change 0 to 1 in below line set _resall=0 +:: Choose activation method: +:: In builds 19041 and later, the script will auto select StaticCID (requires internet). If no internet is detected, it will then auto select the KMS4k method. For builds lower than 19041, the script will auto select ZeroCID. +:: To change the activation method, run the script with the parameters "/Z-SCID", "/Z-ZCID", or "/Z-KMS4k", or modify the option from Auto to SCID, ZCID, or KMS4k in the line below. +set _actmethod=Auto + :: Debug Mode: :: To run the script in debug mode, change 0 to any parameter above that you want to run, in below line set "_debug=0" @@ -191,10 +196,14 @@ if /i "%%A"=="/Z-OffHost" (set _actoffhost=1) if /i "%%A"=="/Z-APPX" (set _actappx=1) echo "%%A" | find /i "/Z-ID-" >nul && (set _actman=1& set "filtsids=%%A" & call set "filtsids=%%filtsids:~6%%" & if defined filtsids call set tsids=%%filtsids%% %%tsids%%) if /i "%%A"=="/Z-Reset" (set _resall=1) +if /i "%%A"=="/Z-SCID" (set _actmethod=SCID) +if /i "%%A"=="/Z-ZCID" (set _actmethod=ZCID) +if /i "%%A"=="/Z-KMS4k" (set _actmethod=KMS4k) ) if not defined tsids set _actman=0 for %%A in (%_actwin% %_actesu% %_actoff% %_actprojvis% %_actwinesuoff% %_actwinhost% %_actoffhost% %_actappx% %_actman% %_resall%) do (if "%%A"=="1" set _unattended=1) +if /i not %_actmethod%==Auto set _unattended=1 ::======================================================================================================================================== @@ -459,6 +468,7 @@ echo [E] Reset - Rearm/Timers ) else ( echo [E] Reset - Rearm/Timers/Tamper/Lock ) +echo [F] Change - Activation Method [%_actmethod%] echo _______________________________________________ echo: echo [6] Remove TSforge Activation @@ -467,12 +477,13 @@ echo [0] %_exitmsg% echo ______________________________________________________________ echo: call :dk_color2 %_White% " " %_Green% "Choose a menu option using your keyboard..." -choice /C:12345ABCDE670 /N +choice /C:12345ABCDEF670 /N set _el=!errorlevel! -if !_el!==13 exit /b -if !_el!==12 start %mas%genuine-installation-media & goto :ts_menu -if !_el!==11 call :ts_remove & cls & goto :ts_menu +if !_el!==14 exit /b +if !_el!==13 start %mas%genuine-installation-media & goto :ts_menu +if !_el!==12 call :ts_remove & cls & goto :ts_menu +if !_el!==11 goto :ts_changemethod if !_el!==10 cls & setlocal & set "_resall=1" & call :ts_start & endlocal & cls & goto :ts_menu if !_el!==9 cls & setlocal & set "_actman=1" & call :ts_start & endlocal & cls & goto :ts_menu if !_el!==8 cls & setlocal & set "_actappx=1" & call :ts_start & endlocal & cls & goto :ts_menu @@ -488,6 +499,54 @@ goto :ts_menu ::======================================================================================================================================== +:ts_changemethod + +cls +if not defined terminal mode 76, 36 + +echo: +echo: +echo: +echo ______________________________________________________________ +echo: +call :dk_color2 %_White% " [1] " %_Green% " Auto" +echo Build 19041 and later: +echo Uses StaticCID, or KMS4k if offline. +echo Older builds: Uses ZeroCID. +echo _______________________________________________ +echo: +echo [2] StaticCID +echo Needs Internet. +echo Not for Windows 7 or older. +echo _______________________________________________ +echo: +echo [3] ZeroCID +echo Works only on builds below 19041. +echo _______________________________________________ +echo: +echo [4] KMS4k +echo This applies only to volume products. +echo Activates for 4000+ years using KMS. +echo _______________________________________________ +echo: +echo [5] Learn More +echo [0] %_exitmsg% +echo ______________________________________________________________ +echo: +call :dk_color2 %_White% " " %_Green% "Choose a menu option using your keyboard..." +choice /C:123450 /N +set _el=!errorlevel! + +if !_el!==6 goto :ts_menu +if !_el!==5 cls & start %mas%tsforge &goto :ts_menu +if !_el!==4 cls & set "_actmethod=KMS4k" & goto :ts_menu +if !_el!==3 cls & set "_actmethod=ZCID" & goto :ts_menu +if !_el!==2 cls & set "_actmethod=SCID" & goto :ts_menu +if !_el!==1 cls & set "_actmethod=Auto" & goto :ts_menu +goto :ts_changemethod + +::======================================================================================================================================== + :ts_start cls @@ -568,6 +627,57 @@ cls echo: call :dk_showosinfo +if /i %_actmethod%==SCID set tsmethod=StaticCID +if /i %_actmethod%==ZCID set tsmethod=ZeroCID +if /i %_actmethod%==KMS4k set tsmethod=KMS4k + +if /i %_actmethod%==Auto ( +if %winbuild% GEQ 19041 ( +set tsmethod=StaticCID +) else ( +set tsmethod=ZeroCID +) +) + +if %winbuild% LSS 9200 if /i %tsmethod%==StaticCID ( +%eline% +echo StaticCID method is supported only on Windows 8 and later. +goto dk_done +) + +::======================================================================================================================================== + +:: Check Internet connection + +if /i %tsmethod%==StaticCID ( +set _int= +for %%a in (l.root-servers.net resolver1.opendns.com download.windowsupdate.com google.com) do if not defined _int ( +for /f "delims=[] tokens=2" %%# in ('ping -n 1 %%a') do (if not "%%#"=="" set _int=1) +) + +if not defined _int ( +%psc% "If([Activator]::CreateInstance([Type]::GetTypeFromCLSID([Guid]'{DCB00C01-570F-4A9B-8D69-199FDBA5723B}')).IsConnectedToInternet){Exit 0}Else{Exit 1}" +if !errorlevel!==0 (set _int=1&set ping_f= But Ping Failed) +) + +if defined _int ( +echo Checking Internet Connection [Connected!ping_f!] +) else ( +if /i %_actmethod%==Auto if not %_actman%==1 set tsmethod=KMS4k +if /i !tsmethod!==KMS4k ( +call :dk_color %Gray% "Checking Internet Connection [Not Connected]" +call :dk_color %Blue% "Switching To KMS4k Activation Method because Internet is needed for StaticCID method." +) else ( +set error=1 +call :dk_color %Red% "Checking Internet Connection [Not Connected]" +call :dk_color %Blue% "Internet is required for TSforge StaticCID option." +) +echo: +) +) + +::======================================================================================================================================== + echo Initiating Diagnostic Tests... set "_serv=%_slser% Winmgmt" @@ -585,6 +695,11 @@ call :dk_color2 %Blue% "Check this webpage for help - " %_Yellow% " %mas%trouble goto :dk_done ) +if /i !tsmethod!==KMS4k ( +call :_taskclear-cache +echo Clearing %KS% Cache [Successful] +) + ::======================================================================================================================================== if %_resall%==1 goto :ts_resetall @@ -606,16 +721,23 @@ echo %tsedition% | find /i "Eval" %nul1% && ( goto :ts_wineval ) -call :ts_checkwinperm +set /a UBR=0 +if %winbuild% EQU 26100 ( +for /f "skip=2 tokens=2*" %%a in ('reg query "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion" /v UBR %nul6%') do if not errorlevel 1 set /a UBR=%%b +if !UBR! LSS 4188 (set dontcheckact=1) +) + +if not defined dontcheckact call :ts_checkwinperm if defined _perm ( call :dk_color %Gray% "Checking OS Activation [Windows is already permanently activated]" goto :ts_esu ) +if %winbuild% LSS 9200 if /i %tsmethod%==KMS4k goto :ts_oldks if defined _vis goto :ts_winvista set tempid= -set keytype=zero +if /i %tsmethod%==KMS4k (set keytype=ks) else (set keytype=zero) for /f "delims=" %%a in ('%psc% "$f=[io.file]::ReadAllText('!_batp!') -split ':wintsid\:.*';iex ($f[1])" %nul6%') do ( echo "%%a" | findstr /r ".*-.*-.*-.*-.*" %nul1% && (set tsids=!tsids! %%a& set tempid=%%a) ) @@ -625,6 +747,13 @@ echo Checking Activation ID [%tempid%] [%tsedition%] ) else ( call :dk_color %Red% "Checking Activation ID [Not Found] [%tsedition%] [%osSKU%]" set error=1 +if /i %tsmethod%==KMS4k ( +if /i %_actmethod%==Auto ( +call :dk_color %Blue% "Connect to the Internet and try again. Script will use the StaticCID activation method." +) else ( +call :dk_color %Blue% "Use non-KMS4K activation options from the previous menu." +) +) goto :ts_esu ) @@ -632,6 +761,83 @@ if defined winsub ( call :dk_color %Blue% "Windows Subscription [SKU ID-%slcSKU%] found. Script will activate base edition [SKU ID-%regSKU%]." echo: ) + +goto :ts_esu + +::======================================================================================================================================== + +:ts_oldks + +:: KMS keys for KMS4k method because TSforge cannot install KMS key on Windows Vista and 7 + +:: 1st column = Activation ID +:: 2nd column = Generic key +:: 3rd column = Edition ID +:: Separator = _ + +set f= +set key= +set tempid= +if not defined allapps call :dk_actids 55c92734-d682-4d71-983e-d6ec3f16059f + +for %%# in ( +:: Windows 7 +ae2ee509-1b34-41c0-acb7-6d4650168915_33PXH-7Y6KF-2VJC9-XBBR8-HV%f%THH_Enterprise +1cb6d605-11b3-4e14-bb30-da91c8e3983a_YDRBP-3D83W-TY26F-D46B2-XC%f%KRJ_EnterpriseN +b92e9980-b9d5-4821-9c94-140f632f6312_FJ82H-XT6CR-J8D7P-XQJJ2-GP%f%DD4_Professional +54a09a0d-d57b-4c10-8b69-a842d6590ad5_MRPKT-YTG23-K7D7T-X2JMM-QY%f%7MG_ProfessionalN +db537896-376f-48ae-a492-53d0547773d0_YBYF6-BHCR3-JPKRB-CDW7B-F9%f%BK4_Embedded_POSReady +aa6dd3aa-c2b4-40e2-a544-a6bbb3f5c395_73KQT-CD9G6-K7TQG-66MRP-CQ%f%22C_Embedded_ThinPC +5a041529-fef8-4d07-b06f-b59b573b32d2_W82YF-2Q76Y-63HXB-FGJG9-GF%f%7QX_ProfessionalE +46bbed08-9c7b-48fc-a614-95250573f4ea_C29WB-22CC8-VJ326-GHFJW-H9%f%DH4_EnterpriseE +:: Windows Server 2008 R2 +68531fb9-5511-4989-97be-d11a0f55633f_YC6KT-GKW9T-YTKYR-T4X34-R7%f%VHC_ServerStandard +7482e61b-c589-4b7f-8ecc-46d455ac3b87_74YFP-3QFB3-KQT8W-PMXWJ-7M%f%648_ServerDatacenter +620e2b3d-09e7-42fd-802a-17a13652fe7a_489J6-VHDMP-X63PK-3K798-CP%f%X3Y_ServerEnterprise +7482e61b-c589-4b7f-8ecc-46d455ac3b87_74YFP-3QFB3-KQT8W-PMXWJ-7M%f%648_ServerDatacenterCore +68531fb9-5511-4989-97be-d11a0f55633f_YC6KT-GKW9T-YTKYR-T4X34-R7%f%VHC_ServerStandardCore +620e2b3d-09e7-42fd-802a-17a13652fe7a_489J6-VHDMP-X63PK-3K798-CP%f%X3Y_ServerEnterpriseCore +8a26851c-1c7e-48d3-a687-fbca9b9ac16b_GT63C-RJFQ3-4GMB6-BRFB9-CB%f%83V_ServerEnterpriseIA64 +a78b8bd9-8017-4df5-b86a-09f756affa7c_6TPJF-RBVHG-WBW2R-86QPH-6R%f%TM4_ServerWeb +cda18cf3-c196-46ad-b289-60c072869994_TT8MH-CG224-D3D7Q-498W2-9Q%f%CTX_ServerHPC +a78b8bd9-8017-4df5-b86a-09f756affa7c_6TPJF-RBVHG-WBW2R-86QPH-6R%f%TM4_ServerWebCore +f772515c-0e87-48d5-a676-e6962c3e1195_736RG-XDKJK-V34PF-BHK87-J6%f%X3K_ServerEmbeddedSolution +:: Windows Vista +cfd8ff08-c0d7-452b-9f60-ef5c70c32094_VKK3X-68KWM-X2YGT-QR4M6-4B%f%WMV_Enterprise +4f3d1606-3fea-4c01-be3c-8d671c401e3b_YFKBB-PQJJV-G996G-VWGXY-2V%f%3X8_Business +2c682dc2-8b68-4f63-a165-ae291d4cf138_HMBQG-8H2RH-C77VX-27R82-VM%f%QBT_BusinessN +d4f54950-26f2-4fb4-ba21-ffab16afcade_VTC42-BM838-43QHV-84HX6-XJ%f%XKV_EnterpriseN +:: Windows Server 2008 +ad2542d4-9154-4c6d-8a44-30f11ee96989_TM24T-X9RMF-VWXK6-X8JC9-BF%f%GM2_ServerStandard +68b6e220-cf09-466b-92d3-45cd964b9509_7M67G-PC374-GR742-YH8V4-TC%f%BY3_ServerDatacenter +c1af4d90-d1bc-44ca-85d4-003ba33db3b9_YQGMW-MPWTJ-34KDK-48M3W-X4%f%Q6V_ServerEnterprise +01ef176b-3e0d-422a-b4f8-4ea880035e8f_4DWFP-JF3DJ-B7DTH-78FJB-PD%f%RHK_ServerEnterpriseIA64 +ddfa9f7c-f09e-40b9-8c1a-be877a9a7f4b_WYR28-R7TFJ-3X2YQ-YCY4H-M2%f%49D_ServerWeb +7afb1156-2c1d-40fc-b260-aab7442b62fe_RCTX3-KWVHP-BR6TB-RB6DM-6X%f%7HP_ServerComputeCluster +2401e3d0-c50a-4b58-87b2-7e794b7d2607_W7VD6-7JFBR-RX26B-YKQ3Y-6F%f%FFJ_ServerStandardV +fd09ef77-5647-4eff-809c-af2b64659a45_22XQ2-VRXRG-P8D42-K34TD-G3%f%QQC_ServerDatacenterV +8198490a-add0-47b2-b3ba-316b12d647b4_39BXF-X8Q23-P2WWT-38T2F-G3%f%FPG_ServerEnterpriseV +) do ( +for /f "tokens=1-3 delims=_" %%A in ("%%#") do if %tsedition%==%%C if not defined key ( +echo "%allapps%" | find /i "%%A" %nul1% && ( +set key=%%B +set tempid=%%A +) +) +) + +if not defined key ( +call :dk_color %Red% "Checking Activation ID [%tsedition% SKU-%osSKU% %KS% key is not available]" +call :dk_color %Blue% "Use ZeroCID activation method from the previous menu." +goto :ts_esu +) + +echo Checking Activation ID [%tempid%] [%tsedition%] + +set oldks=1 +set generickey=1 +call :dk_inskey "[%key%]" +set tsids=%tsids% %tempid% goto :ts_esu ::======================================================================================================================================== @@ -841,6 +1047,15 @@ call :dk_inskey "[%key%]" :ts_esu if not %_actesu%==1 goto :ts_off +if /i %tsmethod%==KMS4k ( +call :dk_color %Red% "Skipping Windows ESU [KMS4k method is not supported with Windows ESU]" +if /i %_actmethod%==Auto ( +call :dk_color %Blue% "Connect to the Internet and try again. Script will use the StaticCID activation method." +) else ( +call :dk_color %Blue% "Use non-KMS4K activation options from the previous menu." +) +goto :ts_off +) :: Process Windows ESU @@ -928,8 +1143,12 @@ goto :ts_off if defined esuexistbutnosup ( call :dk_color %Red% "Checking Activation ID [Commercial ESU is not supported for %tsedition%]" +echo %esueditionlist% | find /i "Professional" %nul1% && ( +call :dk_color %Blue% "Go back to Main Menu, select Change Windows Edition option, and change it to [Professional] or any non-Home edition." +) || ( call :dk_color %Blue% "Go back to Main Menu, select Change Windows Edition option and change to any of the below listed editions." echo [%esueditionlist%] +) goto :ts_off ) @@ -1204,6 +1423,24 @@ call :ts_process ::======================================================================================================================================== +:: mass grave[.]dev/office-license-is-not-genuine +:: Add registry keys for volume products so that 'non-genuine' banner won't appear + +set "kmskey=HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\SoftwareProtectionPlatform\0ff1ce15-a989-479d-af46-f275c6370663" +if /i %tsmethod%==KMS4k ( +if %winbuild% GEQ 9200 ( +if not "%osarch%"=="x86" ( +reg delete "%kmskey%" /f /reg:32 %nul% +reg add "%kmskey%" /f /v KeyManagementServiceName /t REG_SZ /d "10.0.0.10" /reg:32 %nul% +) +reg delete "%kmskey%" /f %nul% +reg add "%kmskey%" /f /v KeyManagementServiceName /t REG_SZ /d "10.0.0.10" %nul% +echo Adding a Registry to Prevent Banner [Successful] +) +) + +::======================================================================================================================================== + :ts_startmsi if defined o15msi call :ts_processmsi 15 %o15msi_reg% @@ -1227,6 +1464,17 @@ goto :ts_act echo: echo Processing Windows %KS% Host... +if /i %tsmethod%==KMS4k ( +echo: +call :dk_color %Red% "Skipping Windows %KS% Host [KMS4k method is not supported with Windows %KS% Host]" +if /i %_actmethod%==Auto ( +call :dk_color %Blue% "Connect to the Internet and try again. Script will use the StaticCID activation method." +) else ( +call :dk_color %Blue% "Use non-KMS4K activation options from the previous menu." +) +goto :ts_act +) + echo: if %winbuild% GEQ 10586 ( call :dk_color %Gray% "With %KS% Host license, system may randomly change Windows Edition later. It is a Windows issue and can be safely ignored." @@ -1338,6 +1586,17 @@ call :dk_color %Blue% "Windows Vista and Server 2008 do not support the installa goto :ts_act ) +if /i %tsmethod%==KMS4k ( +echo: +call :dk_color %Red% "Skipping Office %KS% Host [KMS4k method is not supported with Office %KS% Host]" +if /i %_actmethod%==Auto ( +call :dk_color %Blue% "Connect to the Internet and try again. Script will use the StaticCID activation method." +) else ( +call :dk_color %Blue% "Use non-KMS4K activation options from the previous menu." +) +goto :ts_act +) + set ohostexist= call :dk_actids 0ff1ce15-a989-479d-af46-f275c6370663 set ohostids=%allapps% @@ -1390,6 +1649,17 @@ call :dk_color %Gray% "Checking Activation ID [APPX Sideloading goto :dk_done ) +if /i %tsmethod%==KMS4k ( +echo: +call :dk_color %Red% "Skipping Windows 8/8.1 APPX [KMS4k method is not supported with Windows 8/8.1 APPX]" +if /i %_actmethod%==Auto ( +call :dk_color %Blue% "Connect to the Internet and try again. Script will use the StaticCID activation method." +) else ( +call :dk_color %Blue% "Use non-KMS4K activation options from the previous menu." +) +goto :dk_done +) + set appxexist= if not defined allapps call :dk_actids 55c92734-d682-4d71-983e-d6ec3f16059f @@ -1448,6 +1718,17 @@ echo: echo Processing Manual Activation... echo: +if /i %tsmethod%==KMS4k ( +echo: +call :dk_color %Red% "Skipping Manual Activation [KMS4k method is not supported with it]" +if /i %_actmethod%==Auto ( +call :dk_color %Blue% "Connect to the Internet and try again. Script will use the StaticCID activation method." +) else ( +call :dk_color %Blue% "Use non-KMS4K activation options from the previous menu." +) +goto :dk_done +) + call :dk_color %Gray% "This option is for advanced users, those who already know what they are doing." call :dk_color %Blue% "Some activation IDs may cause system crash [MUI mismatch], or irreversible changes [CloudEdition etc]." @@ -1607,12 +1888,16 @@ call :dk_color2 %Blue% "Check this webpage for help - " %_Yellow% " %mas%trouble if defined tsids ( echo: -if not defined _vis echo Installing Forged Product Key Data... -echo Depositing Zero Confirmation ID... +if not defined _vis if not defined oldks echo Installing Forged Product Key Data... +if /i %tsmethod%==KMS4k ( +echo Writing TrustedStore data... +) else ( +if /i %tsmethod%==StaticCID (echo Depositing Static Confirmation ID...) else (echo Depositing Zero Confirmation ID...) +) echo: %psc% "$f=[io.file]::ReadAllText('!_batp!') -split ':tsforge\:.*';& ([ScriptBlock]::Create($f[1])) %tsids%" if !errorlevel!==3 ( -if %_actman%==0 call :dk_color %Blue% "%_fixmsg%" +if %_actman%==0 (if not defined error call :dk_color %Blue% "%_fixmsg%") set fixes=%fixes% %mas%troubleshoot call :dk_color2 %Blue% "Check this webpage for help - " %_Yellow% " %mas%troubleshoot" ) else ( @@ -1788,6 +2073,19 @@ set _preview= set _License=%%# set skipprocess= + +set foundprod= +call :tsksdata chkprod %%# +if defined _oMSI if not defined foundprod if /i %tsmethod%==KMS4k ( +set skipprocess=1 +call :dk_color %Red% "Checking Product In Script [%%# MSI Retail is not supported with KMS4k]" +if /i %_actmethod%==Auto ( +call :dk_color %Blue% "Connect to the Internet and try again. Script will use the StaticCID activation method." +) else ( +call :dk_color %Blue% "Use non-KMS4K activation options from the previous menu." +) +) + if "%_actprojvis%"=="1" ( echo %%# | findstr /i "Project Visio" %nul% || ( set skipprocess=1 @@ -1795,8 +2093,17 @@ call :dk_color %Gray% "Skipping Because Project/Visio Mode [%%#]" ) ) +if "%_actprojvis%"=="0" if /i %tsmethod%==KMS4k echo %_oIds% | findstr /i "O365" %nul% && ( +echo %%# | findstr /i "Project Visio" %nul% && ( +set skipprocess=1 +echo Skipping Because Mondo Is Available [%%#] +) +) + + if not defined skipprocess ( +if /i not %tsmethod%==KMS4k ( set no365= if "%oVer%"=="15" (echo %%# | findstr /i "O365HomePremRetail" %nul% && set no365=1) if "%oVer%"=="16" (echo %%# | findstr /i "O365" %nul% && set no365=1) @@ -1818,8 +2125,30 @@ call :ks_osppready echo Converting Unsupported OEM-ARM Office [%%# To MondoRetail] ) ) +) +if not defined _oMSI if /i %tsmethod%==KMS4k if not defined foundprod ( +call :tsksdata getinfo %%# +if defined _altoffid ( +echo Converting Retail To Volume [%%# To !_altoffid!] +) else ( +set _License=MondoVolume +set _altoffid=MondoVolume +echo Converting Retail To Volume [%%# To !_altoffid!] [Using Mondo because %%# is not found in the script] +) +echo %%# | find /i "O365" %nul% && ( +if "%oVer%"=="15" (call :dk_color %Gray% "Mondo 2013 is equivalent to O365 [15.0 version] in terms of the latest features.") +if "%oVer%"=="16" (call :dk_color %Gray% "Mondo 2016 is equivalent to O365 in terms of the latest features.") +) +call :ks_osppready +) + +if /i %tsmethod%==KMS4k ( +echo !_License! | find /i "Retail" %nul% && (set keytype=zero) || (set keytype=ks) +) else ( set keytype=zero +) + for /f "delims=" %%a in ('%psc% "$f=[io.file]::ReadAllText('!_batp!') -split ':offtsid\:.*';iex ($f[1])" %nul6%') do ( echo "%%a" | findstr /r ".*-.*-.*-.*-.*" %nul1% && (set tsids=!tsids! %%a& set _actid=%%a) ) @@ -1848,7 +2177,7 @@ echo "!allapps!" | find /i "!_actid!" %nul1% || call :oh_installlic :: Add SharedComputerLicensing registry key if Retail Office C2R is installed on Windows Server :: https://learn.microsoft.com/en-us/office/troubleshoot/office-suite-issues/click-to-run-office-on-terminal-server -if defined winserver if defined _config if exist "%_oLPath%\Word2019VL_KMS_Client_AE*.xrm-ms" ( +if /i not %tsmethod%==KMS4k if defined winserver if defined _config if exist "%_oLPath%\Word2019VL_KMS_Client_AE*.xrm-ms" ( echo %_oIds% | find /i "Retail" %nul1% && ( set scaIsNeeded=1 reg add %_config% /v SharedComputerLicensing /t REG_SZ /d "1" /f %nul1% @@ -2153,6 +2482,59 @@ exit /b ::======================================================================================================================================== +:: Clean existing K-M-S cache from the registry + +:_taskclear-cache + +set w= +for %%# in (SppE%w%xtComObj.exe sppsvc.exe SLsvc.exe) do ( +reg delete "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Ima%w%ge File Execu%w%tion Options\%%#" /f %nul% +) + +set "OPPk=SOFTWARE\Microsoft\OfficeSoftwareProtectionPlatform" + +if %winbuild% LSS 7600 ( +reg query "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\SL" %nul% && ( +set "SPPk=SOFTWARE\Microsoft\Windows NT\CurrentVersion\SL" +) +) +if not defined SPPk ( +set "SPPk=SOFTWARE\Microsoft\Windows NT\CurrentVersion\SoftwareProtectionPlatform" +) + +set "slp=SoftwareLicensingProduct" +set "ospp=OfficeSoftwareProtectionProduct" + +set "_wApp=55c92734-d682-4d71-983e-d6ec3f16059f" +set "_oApp=0ff1ce15-a989-479d-af46-f275c6370663" +set "_oA14=59a52881-a989-479d-af46-f275c6370663" + +%nul% reg delete "HKLM\%SPPk%" /f /v KeyManagementServiceName +%nul% reg delete "HKLM\%SPPk%" /f /v KeyManagementServiceName /reg:32 +%nul% reg delete "HKLM\%SPPk%" /f /v KeyManagementServicePort +%nul% reg delete "HKLM\%SPPk%" /f /v KeyManagementServicePort /reg:32 +%nul% reg delete "HKLM\%SPPk%" /f /v DisableDnsPublishing +%nul% reg delete "HKLM\%SPPk%" /f /v DisableKeyManagementServiceHostCaching +%nul% reg delete "HKLM\%SPPk%\%_wApp%" /f +if %winbuild% GEQ 9200 ( +%nul% reg delete "HKLM\%SPPk%\%_oApp%" /f +%nul% reg delete "HKLM\%SPPk%\%_oApp%" /f /reg:32 +) +if %winbuild% GEQ 9600 ( +%nul% reg delete "HKU\S-1-5-20\%SPPk%\%_wApp%" /f +%nul% reg delete "HKU\S-1-5-20\%SPPk%\%_oApp%" /f +) +%nul% reg delete "HKLM\%OPPk%" /f /v KeyManagementServiceName +%nul% reg delete "HKLM\%OPPk%" /f /v KeyManagementServicePort +%nul% reg delete "HKLM\%OPPk%" /f /v DisableDnsPublishing +%nul% reg delete "HKLM\%OPPk%" /f /v DisableKeyManagementServiceHostCaching +%nul% reg delete "HKLM\%OPPk%\%_oA14%" /f +%nul% reg delete "HKLM\%OPPk%\%_oApp%" /f + +exit /b + +::======================================================================================================================================== + :: Set variables :dk_setvar @@ -3064,6 +3446,220 @@ exit /b :tsforge: $src = @' +#if !POWERSHELL2 +namespace ActivationWs +{ + +/* + +This code is adapted from ActivationWs. +Original Repository: https://github.com/dadorner-msft/activationws + +MIT License + +Copyright (c) Daniel Dorner + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. + +*/ + +using System; +using System.IO; +using System.Linq; +using System.Net; +using System.Security.Cryptography; +using System.Text; +using System.Xml.Linq; + + public static class ActivationHelper { + // Key for HMAC/SHA256 signature. + private static readonly byte[] MacKey = new byte[64] { + 254, 49, 152, 117, 251, 72, 132, 134, + 156, 243, 241, 206, 153, 168, 144, 100, + 171, 87, 31, 202, 71, 4, 80, 88, + 48, 36, 226, 20, 98, 135, 121, 160, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0 + }; + + private const string Action = "http://www.microsoft.com/BatchActivationService/BatchActivate"; + + private static readonly Uri Uri = new Uri("https://activation.sls.microsoft.com/BatchActivation/BatchActivation.asmx"); + + private static readonly XNamespace SoapSchemaNs = "http://schemas.xmlsoap.org/soap/envelope/"; + private static readonly XNamespace XmlSchemaInstanceNs = "http://www.w3.org/2001/XMLSchema-instance"; + private static readonly XNamespace XmlSchemaNs = "http://www.w3.org/2001/XMLSchema"; + private static readonly XNamespace BatchActivationServiceNs = "http://www.microsoft.com/BatchActivationService"; + private static readonly XNamespace BatchActivationRequestNs = "http://www.microsoft.com/DRM/SL/BatchActivationRequest/1.0"; + private static readonly XNamespace BatchActivationResponseNs = "http://www.microsoft.com/DRM/SL/BatchActivationResponse/1.0"; + + public static string CallWebService(int requestType, string installationId, string extendedProductId) { + XDocument soapRequest = CreateSoapRequest(requestType, installationId, extendedProductId); + HttpWebRequest webRequest = CreateWebRequest(soapRequest); + XDocument soapResponse = new XDocument(); + + try { + IAsyncResult asyncResult = webRequest.BeginGetResponse(null, null); + asyncResult.AsyncWaitHandle.WaitOne(); + + // Read data from the response stream. + using (WebResponse webResponse = webRequest.EndGetResponse(asyncResult)) + using (StreamReader streamReader = new StreamReader(webResponse.GetResponseStream())) { + soapResponse = XDocument.Parse(streamReader.ReadToEnd()); + } + + return ParseSoapResponse(soapResponse); + + } catch { + throw; + } + } + + private static XDocument CreateSoapRequest(int requestType, string installationId, string extendedProductId) { + // Create an activation request. + XElement activationRequest = new XElement(BatchActivationRequestNs + "ActivationRequest", + new XElement(BatchActivationRequestNs + "VersionNumber", "2.0"), + new XElement(BatchActivationRequestNs + "RequestType", requestType), + new XElement(BatchActivationRequestNs + "Requests", + new XElement(BatchActivationRequestNs + "Request", + new XElement(BatchActivationRequestNs + "PID", extendedProductId), + requestType == 1 ? new XElement(BatchActivationRequestNs + "IID", installationId) : null) + ) + ); + + // Get the unicode byte array of activationRequest and convert it to Base64. + byte[] bytes = Encoding.Unicode.GetBytes(activationRequest.ToString()); + string requestXml = Convert.ToBase64String(bytes); + + XDocument soapRequest = new XDocument(); + + using (HMACSHA256 hMACSHA = new HMACSHA256(MacKey)) { + // Convert the HMAC hashed data to Base64. + string digest = Convert.ToBase64String(hMACSHA.ComputeHash(bytes)); + + soapRequest = new XDocument( + new XDeclaration("1.0", "UTF-8", "no"), + new XElement(SoapSchemaNs + "Envelope", + new XAttribute(XNamespace.Xmlns + "soap", SoapSchemaNs), + new XAttribute(XNamespace.Xmlns + "xsi", XmlSchemaInstanceNs), + new XAttribute(XNamespace.Xmlns + "xsd", XmlSchemaNs), + new XElement(SoapSchemaNs + "Body", + new XElement(BatchActivationServiceNs + "BatchActivate", + new XElement(BatchActivationServiceNs + "request", + new XElement(BatchActivationServiceNs + "Digest", digest), + new XElement(BatchActivationServiceNs + "RequestXml", requestXml) + ) + ) + ) + )); + + } + + return soapRequest; + } + + private static HttpWebRequest CreateWebRequest(XDocument soapRequest) { + HttpWebRequest webRequest = (HttpWebRequest)WebRequest.Create(Uri); + webRequest.Accept = "text/xml"; + webRequest.ContentType = "text/xml; charset=\"utf-8\""; + webRequest.Headers.Add("SOAPAction", Action); + webRequest.Host = "activation.sls.microsoft.com"; + webRequest.Method = "POST"; + + try { + // Insert SOAP envelope + using (Stream stream = webRequest.GetRequestStream()) { + soapRequest.Save(stream); + } + + return webRequest; + + } catch { + throw; + } + } + + private static string ParseSoapResponse(XDocument soapResponse) { + if (soapResponse == null) { + throw new ArgumentNullException("soapResponse", "The remote server returned an unexpected response."); + } + + if (!soapResponse.Descendants(BatchActivationServiceNs + "ResponseXml").Any()) { + throw new Exception("The remote server returned an unexpected response"); + } + + try { + XDocument responseXml = XDocument.Parse(soapResponse.Descendants(BatchActivationServiceNs + "ResponseXml").First().Value); + + if (responseXml.Descendants(BatchActivationResponseNs + "ErrorCode").Any()) { + string errorCode = responseXml.Descendants(BatchActivationResponseNs + "ErrorCode").First().Value; + + switch (errorCode) { + case "0x7F": + throw new Exception("The Multiple Activation Key has exceeded its limit"); + + case "0x67": + throw new Exception("The product key has been blocked"); + + case "0x68": + throw new Exception("Invalid product key"); + + case "0x86": + throw new Exception("Invalid key type"); + + case "0x90": + throw new Exception("Please check the Installation ID and try again"); + + default: + throw new Exception(string.Format("The remote server reported an error ({0})", errorCode)); + } + + } else if (responseXml.Descendants(BatchActivationResponseNs + "ResponseType").Any()) { + string responseType = responseXml.Descendants(BatchActivationResponseNs + "ResponseType").First().Value; + + switch (responseType) { + case "1": + string confirmationId = responseXml.Descendants(BatchActivationResponseNs + "CID").First().Value; + return confirmationId; + + case "2": + string activationsRemaining = responseXml.Descendants(BatchActivationResponseNs + "ActivationRemaining").First().Value; + return activationsRemaining; + + default: + throw new Exception("The remote server returned an unrecognized response"); + } + + } else { + throw new Exception("The remote server returned an unrecognized response"); + } + + } catch { + throw; + } + } + } +} +#endif + // Common.cs namespace LibTSforge { @@ -5625,27 +6221,23 @@ namespace LibTSforge.Modifiers } -// Activators/AVMA4K.cs +// Activators/KMS4K.cs namespace LibTSforge.Activators { using System; + using System.IO; using PhysicalStore; using SPP; - public static class AVMA4k + public class KMS4k { public static void Activate(PSVersion version, bool production, Guid actId) { - if (version != PSVersion.WinModern && version != PSVersion.WinBlue) - { - throw new NotSupportedException("AVMA licenses are not available for this product."); - } - Guid appId; if (actId == Guid.Empty) { appId = SLApi.WINDOWS_APP_ID; - actId = SLApi.GetDefaultActivationID(appId, false); + actId = SLApi.GetDefaultActivationID(appId, true); if (actId == Guid.Empty) { @@ -5657,9 +6249,9 @@ namespace LibTSforge.Activators appId = SLApi.GetAppId(actId); } - if (SLApi.GetPKeyChannel(SLApi.GetInstalledPkeyID(actId)) != "VT:IA") + if (SLApi.GetPKeyChannel(SLApi.GetInstalledPkeyID(actId)) != "Volume:GVLK") { - throw new NotSupportedException("Non-VT:IA product key installed."); + throw new NotSupportedException("Non-Volume:GVLK product key installed."); } SPPUtils.KillSPP(version); @@ -5670,80 +6262,171 @@ namespace LibTSforge.Activators { string key = string.Format("SPPSVC\\{0}\\{1}", appId, actId); - long creationTime = BitConverter.ToInt64(store.GetBlock("__##USERSEP##\\$$_RESERVED_$$\\NAMESPACE__", "__##USERSEP-RESERVED##__$$GLOBAL-CREATION-TIME$$").Data, 0); - long tickCount = BitConverter.ToInt64(store.GetBlock("__##USERSEP##\\$$_RESERVED_$$\\NAMESPACE__", "__##USERSEP-RESERVED##__$$GLOBAL-TICKCOUNT-UPTIME$$").Data, 0); - long deltaTime = BitConverter.ToInt64(store.GetBlock(key, "__##USERSEP-RESERVED##__$$UP-TIME-DELTA$$").Data, 0); + ulong unknown = 0; + ulong time1; + ulong time2 = (ulong)DateTime.UtcNow.ToFileTime(); + ulong expiry = Constants.TimerMax; - const ulong unknown = 0; - ulong time1 = (ulong)(creationTime + tickCount + deltaTime); - ulong crcBindTime = (ulong)DateTime.UtcNow.ToFileTime(); - ulong timerTime = crcBindTime / 10000; - ulong expiry = Constants.TimerMax / 10000; - - VariableBag avmaBinding = new VariableBag(version); - - avmaBinding.Blocks.AddRange(new[] + if (version == PSVersion.Vista || version == PSVersion.Win7) { + unknown = 0x800000000; + time1 = 0; + } + else + { + long creationTime = BitConverter.ToInt64(store.GetBlock("__##USERSEP##\\$$_RESERVED_$$\\NAMESPACE__", "__##USERSEP-RESERVED##__$$GLOBAL-CREATION-TIME$$").Data, 0); + long tickCount = BitConverter.ToInt64(store.GetBlock("__##USERSEP##\\$$_RESERVED_$$\\NAMESPACE__", "__##USERSEP-RESERVED##__$$GLOBAL-TICKCOUNT-UPTIME$$").Data, 0); + long deltaTime = BitConverter.ToInt64(store.GetBlock(key, "__##USERSEP-RESERVED##__$$UP-TIME-DELTA$$").Data, 0); + + time1 = (ulong)(creationTime + tickCount + deltaTime); + time2 /= 10000; + expiry /= 10000; + } + + if (version == PSVersion.Vista) + { + VistaTimer vistaTimer = new VistaTimer + { + Time = time2, + Expiry = Constants.TimerMax + }; + + string vistaTimerName = string.Format("msft:sl/timer/VLExpiration/VOLUME/{0}/{1}", appId, actId); + + store.DeleteBlock(key, vistaTimerName); + store.DeleteBlock(key, actId.ToString()); + + BinaryWriter writer = new BinaryWriter(new MemoryStream()); + writer.Write(Constants.KMSv4Response.Length); + writer.Write(Constants.KMSv4Response); + writer.Write(Constants.UniversalHWIDBlock); + byte[] kmsData = writer.GetBytes(); + + store.AddBlocks(new[] + { + new PSBlock + { + Type = BlockType.TIMER, + Flags = 0, + KeyAsStr = key, + ValueAsStr = vistaTimerName, + Data = vistaTimer.CastToArray() + }, + new PSBlock + { + Type = BlockType.NAMED, + Flags = 0, + KeyAsStr = key, + ValueAsStr = actId.ToString(), + Data = kmsData + } + }); + } + else + { + byte[] hwidBlock = Constants.UniversalHWIDBlock; + byte[] kmsResp; + + switch (version) + { + case PSVersion.Win7: + kmsResp = Constants.KMSv4Response; + break; + case PSVersion.Win8: + kmsResp = Constants.KMSv5Response; + break; + case PSVersion.WinBlue: + case PSVersion.WinModern: + kmsResp = Constants.KMSv6Response; + break; + default: + throw new NotSupportedException("Unsupported PSVersion."); + } + + VariableBag kmsBinding = new VariableBag(version); + + kmsBinding.Blocks.AddRange(new[] + { new CRCBlockModern { DataType = CRCBlockType.BINARY, Key = new byte[] { }, - Value = BitConverter.GetBytes(crcBindTime), + Value = kmsResp }, new CRCBlockModern { DataType = CRCBlockType.STRING, Key = new byte[] { }, - ValueAsStr = "AVMA4K", + ValueAsStr = "msft:rm/algorithm/hwid/4.0" }, new CRCBlockModern { - DataType = CRCBlockType.STRING, - Key = new byte[] { }, - ValueAsStr = "00491-50000-00001-AA666", + DataType = CRCBlockType.BINARY, + KeyAsStr = "SppBindingLicenseData", + Value = hwidBlock } - }); + }); - byte[] avmaBindingData = avmaBinding.Serialize(); + if (version == PSVersion.WinModern) + { + kmsBinding.Blocks.AddRange(new[] + { + new CRCBlockModern + { + DataType = CRCBlockType.STRING, + Key = new byte[] { }, + ValueAsStr = "massgrave.dev" + }, + new CRCBlockModern + { + DataType = CRCBlockType.STRING, + Key = new byte[] { }, + ValueAsStr = "6969" + } + }); + } - Timer avmaTimer = new Timer - { - Unknown = unknown, - Time1 = time1, - Time2 = timerTime, - Expiry = expiry - }; + byte[] kmsBindingData = kmsBinding.Serialize(); - string storeVal = string.Format("msft:spp/ia/bind/1.0/store/{0}/{1}", appId, actId); - string timerVal = string.Format("msft:spp/ia/bind/1.0/timer/{0}/{1}", appId, actId); + Timer kmsTimer = new Timer + { + Unknown = unknown, + Time1 = time1, + Time2 = time2, + Expiry = expiry + }; - store.DeleteBlock(key, storeVal); - store.DeleteBlock(key, timerVal); + string storeVal = string.Format("msft:spp/kms/bind/2.0/store/{0}/{1}", appId, actId); + string timerVal = string.Format("msft:spp/kms/bind/2.0/timer/{0}/{1}", appId, actId); - store.AddBlocks(new[] - { + store.DeleteBlock(key, storeVal); + store.DeleteBlock(key, timerVal); + + store.AddBlocks(new[] + { new PSBlock { Type = BlockType.NAMED, - Flags = 0x400, + Flags = (version == PSVersion.WinModern) ? (uint)0x400 : 0, KeyAsStr = key, ValueAsStr = storeVal, - Data = avmaBindingData, + Data = kmsBindingData }, new PSBlock { Type = BlockType.TIMER, - Flags = 0x4, + Flags = (version == PSVersion.Win7) ? (uint)0 : 0x4, KeyAsStr = key, ValueAsStr = timerVal, - Data = avmaTimer.CastToArray() + Data = kmsTimer.CastToArray() } - }); + }); + } } - SLApi.RefreshLicenseStatus(); + SPPUtils.RestartSPP(version); SLApi.FireStateChangedEvent(appId); - Logger.WriteLine("Activated using AVMA4k successfully."); + Logger.WriteLine("Activated using KMS4k successfully."); } } } @@ -7850,15 +8533,16 @@ namespace LibTSforge.PhysicalStore '@ $ErrorActionPreference = 'Stop' $binPath = "$env:_work\BIN\LibTSforge.dll" +$psMajorVer = (Get-Host).Version.Major if (Test-Path -LiteralPath $binPath) { Write-Host "LibTSforge.dll found in BIN folder. Loading the DLL..." Add-Type -Path $binPath } else { - $cp = [CodeDom.Compiler.CompilerParameters] [string[]]@("System.dll", "System.Core.dll", "System.ServiceProcess.dll", "System.Xml.dll") - $cp.CompilerOptions = "/unsafe" - $lang = If ((Get-Host).Version.Major -gt 2) { "CSharp" } Else { "CSharpVersion3" } + $cp = [CodeDom.Compiler.CompilerParameters] [string[]]@("System.dll", "System.Core.dll", "System.ServiceProcess.dll", "System.Xml.dll", "System.Xml.Linq.dll") + if ($psMajorVer -le 2) { $cp.CompilerOptions = "/define:POWERSHELL2 /unsafe" } else { $cp.CompilerOptions = "/unsafe" } + $lang = if ($psMajorVer -gt 2) { "CSharp" } else { "CSharpVersion3" } $ctemp = "$env:SystemRoot\Temp\" if (-Not (Test-Path -Path $ctemp)) { New-Item -Path $ctemp -ItemType Directory > $null } @@ -7907,32 +8591,65 @@ function slGetSkuInfo($SkuId) { if (-not $env:resetstuff) { foreach ($tsactid in $tsactids) { try { + $activated = $null $prodDes = Get-WmiInfo -tsactid $tsactid -property "Description" $prodName = Get-WmiInfo -tsactid $tsactid -property "Name" if ($prodName) { $nameParts = $prodName -split ',', 2 $prodName = if ($nameParts.Count -gt 1) { ($nameParts[1].Trim() -split '[ ,]')[0] } else { $null } } - if (-not $env:_vis) { - [LibTSforge.Modifiers.GenPKeyInstall]::InstallGenPKey($ver, $prod, $tsactid) - } - if ($prodName -match 'Office' -and -not (slGetSkuInfo($tsactid))) { + if (-not $env:_vis -and -not $env:oldks) { + [LibTSforge.Modifiers.GenPKeyInstall]::InstallGenPKey($ver, $prod, $tsactid) + } + if ($prodName -match 'Office' -and $prodDes -notmatch 'KMS' -and -not (slGetSkuInfo($tsactid))) { $licenseStatus = Get-WmiInfo -tsactid $tsactid -property "LicenseStatus" if ($licenseStatus -eq 1) { Write-Host "[$prodName] is already permanently activated." -ForegroundColor White -BackgroundColor DarkGreen continue } } - [LibTSforge.Activators.ZeroCID]::Activate($ver, $prod, $tsactid) - $licenseStatus = Get-WmiInfo -tsactid $tsactid -property "LicenseStatus" - if ($licenseStatus -eq 1) { + if ($env:tsmethod -eq "StaticCID") { + [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12 + $attempts = @( + @(100055, 1000043, 1338662172562478), + @(1345, 1003020, 6311608238084405) + ) + foreach ($params in $attempts) { + [LibTSforge.Modifiers.SetIIDParams]::SetParams($ver, $prod, $tsactid, [LibTSforge.SPP.PKeyAlgorithm]::PKEY2009, $params[0], $params[1], $params[2]) + $instId = [LibTSforge.SPP.SLApi]::GetInstallationID($tsactid) + $confId = [ActivationWs.ActivationHelper]::CallWebService(1, $instId, "31337-42069-123-456789-04-1337-2600.0000-2542001") + $result = [LibTSforge.SPP.SLApi]::DepositConfirmationID($tsactid, $instId, $confId) + if ($result -eq 0) { break } + } + [LibTSforge.SPP.SPPUtils]::RestartSPP($ver) + } + elseif ($env:tsmethod -eq "KMS4k") { + [LibTSforge.Activators.KMS4k]::Activate($ver, $prod, $tsactid) + } + else { + [LibTSforge.Activators.ZeroCID]::Activate($ver, $prod, $tsactid) + } + if ($env:tsmethod -eq "KMS4k") { + $GracePeriodStatus = Get-WmiInfo -tsactid $tsactid -property "GracePeriodRemaining" + if ($GracePeriodStatus -gt 259200) { $activated = 1 } + } + else { + $licenseStatus = Get-WmiInfo -tsactid $tsactid -property "LicenseStatus" + if ($licenseStatus -eq 1) { $activated = 1 } + } + if ($activated) { if ($prodDes -match 'KMS' -and $prodDes -notmatch 'CLIENT') { [LibTSforge.Modifiers.KMSHostCharge]::Charge($ver, $prod, $tsactid) - Write-Host "[$prodName] CSVLK is permanently activated with ZeroCID." -ForegroundColor White -BackgroundColor DarkGreen + Write-Host "[$prodName] CSVLK is permanently activated with $env:tsmethod." -ForegroundColor White -BackgroundColor DarkGreen Write-Host "[$prodName] CSVLK is charged with 25 clients for 30 days." -ForegroundColor White -BackgroundColor DarkGreen } else { - Write-Host "[$prodName] is permanently activated with ZeroCID." -ForegroundColor White -BackgroundColor DarkGreen + if ($env:tsmethod -eq "KMS4k") { + Write-Host "[$prodName] is activated till $([DateTime]::Now.AddMinutes($GracePeriodStatus).ToString('yyyy-MM-dd HH:mm:ss')) with $env:tsmethod." -ForegroundColor White -BackgroundColor DarkGreen + } + else { + Write-Host "[$prodName] is permanently activated with $env:tsmethod." -ForegroundColor White -BackgroundColor DarkGreen + } } } else { @@ -7950,11 +8667,11 @@ if (-not $env:resetstuff) { if ($env:resetstuff) { try { - if (-not $env:_vis) {[LibTSforge.Modifiers.TamperedFlagsDelete]::DeleteTamperFlags($ver, $prod)} + if (-not $env:_vis) { [LibTSforge.Modifiers.TamperedFlagsDelete]::DeleteTamperFlags($ver, $prod) } [LibTSforge.SPP.SLApi]::RefreshLicenseStatus() [LibTSforge.Modifiers.RearmReset]::Reset($ver, $prod) [LibTSforge.Modifiers.GracePeriodReset]::Reset($ver, $prod) - if (-not $env:_vis) {[LibTSforge.Modifiers.KeyChangeLockDelete]::Delete($ver, $prod)} + if (-not $env:_vis) { [LibTSforge.Modifiers.KeyChangeLockDelete]::Delete($ver, $prod) } } catch { $errcode = 3 @@ -8394,6 +9111,130 @@ exit /b ::======================================================================================================================================== +:: 1st column = Office version +:: 2nd column = Volume or free retail product +:: 3rd column = Retail product names that needs to be converted to the Volume product mentioned in 2nd column +:: Separator = "_" + +:tsksdata + +set f= +for %%# in ( +:: Office 2013 +15_AccessVolume_-AccessRetail- +15_AccessRuntimeRetail +15_ExcelVolume_-ExcelRetail- +15_GrooveVolume_-GrooveRetail- +15_InfoPathVolume_-InfoPathRetail- +15_LyncAcademicRetail +15_LyncEntryRetail +15_LyncVolume_-LyncRetail- +15_MondoRetail +15_MondoVolume_-O365BusinessRetail-O365HomePremRetail-O365ProPlusRetail-O365SmallBusPremRetail- +15_OneNoteFreeRetail +15_OneNoteVolume_-OneNoteRetail- +15_OutlookVolume_-OutlookRetail- +15_PowerPointVolume_-PowerPointRetail- +15_ProjectProVolume_-ProjectProRetail- +15_ProjectStdVolume_-ProjectStdRetail- +15_ProPlusVolume_-ProPlusRetail-ProfessionalPipcRetail-ProfessionalRetail- +15_PublisherVolume_-PublisherRetail- +15_SPDRetail +15_StandardVolume_-StandardRetail-HomeBusinessPipcRetail-HomeBusinessRetail-HomeStudentARMRetail-HomeStudentPlusARMRetail-HomeStudentRetail-PersonalPipcRetail-PersonalRetail- +15_VisioProVolume_-VisioProRetail- +15_VisioStdVolume_-VisioStdRetail- +15_WordVolume_-WordRetail- +:: Office 2016 +16_AccessRuntimeRetail +16_AccessVolume_-AccessRetail- +16_ExcelVolume_-ExcelRetail- +16_MondoRetail +16_MondoVolume_-O365AppsBasicRetail-O365BusinessRetail-O365EduCloudRetail-O365HomePremRetail-O365ProPlusRetail-O365SmallBusPremRetail- +16_OneNoteFreeRetail +16_OneNoteVolume_-OneNoteRetail-OneNote2021Retail- +16_OutlookVolume_-OutlookRetail- +16_PowerPointVolume_-PowerPointRetail- +16_ProjectProVolume_-ProjectProRetail- +16_ProjectProXVolume +16_ProjectStdVolume_-ProjectStdRetail- +16_ProjectStdXVolume +16_ProPlusVolume_-ProPlusRetail-ProfessionalPipcRetail-ProfessionalRetail- +16_PublisherVolume_-PublisherRetail- +16_SkypeServiceBypassRetail +16_SkypeforBusinessEntryRetail +16_SkypeforBusinessVolume_-SkypeforBusinessRetail- +16_StandardVolume_-StandardRetail-HomeBusinessPipcRetail-HomeBusinessRetail-HomeStudentARMRetail-HomeStudentPlusARMRetail-HomeStudentRetail-HomeStudentVNextRetail-PersonalPipcRetail-PersonalRetail- +16_VisioProVolume_-VisioProRetail- +16_VisioProXVolume +16_VisioStdVolume_-VisioStdRetail- +16_VisioStdXVolume +16_WordVolume_-WordRetail- +:: Office 2019 +16_AccessRuntime2019Retail +16_Access2019Volume_-Access2019Retail- +16_Excel2019Volume_-Excel2019Retail- +16_Outlook2019Volume_-Outlook2019Retail- +16_PowerPoint2019Volume_-PowerPoint2019Retail- +16_ProjectPro2019Volume_-ProjectPro2019Retail- +16_ProjectStd2019Volume_-ProjectStd2019Retail- +16_ProPlus2019Volume_-ProPlus2019Retail-Professional2019Retail- +16_Publisher2019Volume_-Publisher2019Retail- +16_SkypeforBusiness2019Volume_-SkypeforBusiness2019Retail- +16_SkypeforBusinessEntry2019Retail +16_Standard2019Volume_-Standard2019Retail-HomeBusiness2019Retail-HomeStudentARM2019Retail-HomeStudentPlusARM2019Retail-HomeStudent2019Retail-Personal2019Retail- +16_VisioPro2019Volume_-VisioPro2019Retail- +16_VisioStd2019Volume_-VisioStd2019Retail- +16_Word2019Volume_-Word2019Retail- +:: Office 2021 +:: OneNote2021Volume KMS license is not available +16_AccessRuntime2021Retail +16_Access2021Volume_-Access2021Retail- +16_Excel2021Volume_-Excel2021Retail- +16_Outlook2021Volume_-Outlook2021Retail- +16_OneNoteFree2021Retail +16_PowerPoint2021Volume_-PowerPoint2021Retail- +16_ProjectPro2021Volume_-ProjectPro2021Retail- +16_ProjectStd2021Volume_-ProjectStd2021Retail- +16_ProPlus2021Volume_-ProPlus2021Retail-Professional2021Retail- +16_Publisher2021Volume_-Publisher2021Retail- +16_SkypeforBusiness2021Volume_-SkypeforBusiness2021Retail- +16_Standard2021Volume_-Standard2021Retail-HomeBusiness2021Retail-HomeStudent2021Retail-Personal2021Retail- +16_VisioPro2021Volume_-VisioPro2021Retail- +16_VisioStd2021Volume_-VisioStd2021Retail- +16_Word2021Volume_-Word2021Retail- +:: Office 2024 +16_Access2024Volume_-Access2024Retail- +16_Excel2024Volume_-Excel2024Retail- +16_Outlook2024Volume_-Outlook2024Retail- +16_PowerPoint2024Volume_-PowerPoint2024Retail- +16_ProjectPro2024Volume_-ProjectPro2024Retail- +16_ProjectStd2024Volume_-ProjectStd2024Retail- +16_ProPlus2024Volume_-ProPlus2024Retail- +16_SkypeforBusiness2024Volume +16_Standard2024Volume_-Home2024Retail-HomeBusiness2024Retail- +16_VisioPro2024Volume_-VisioPro2024Retail- +16_VisioStd2024Volume_-VisioStd2024Retail- +16_Word2024Volume_-Word2024Retail- +) do ( +for /f "tokens=1-3 delims=_" %%A in ("%%#") do ( + +if %1==chkprod if "%oVer%"=="%%A" if not defined foundprod ( +if /i "%%B"=="%2" set foundprod=1 +) + +if %1==getinfo if "%oVer%"=="%%A" ( +echo: %%C | find /i "-%2-" %nul% && ( +set _License=%%B +set _altoffid=%%B +) +) + +) +) +exit /b + +::======================================================================================================================================== + :ts_getedition set tsedition= diff --git a/README.md b/README.md index 61accf5..3e776ee 100644 --- a/README.md +++ b/README.md @@ -1,118 +1,116 @@ -

MAS Logo

- -

Microsoft Activation Scripts (MAS)

- -

Open-source Windows and Office activator featuring HWID, Ohook, TSforge, KMS38, and Online KMS activation methods, along with advanced troubleshooting.

- -
- -## How to Activate Windows / Office? - -### Method 1 - PowerShell (Windows 8 and later) ❤️ - -1. **Open PowerShell** - To do that, press the Windows key + X, then select PowerShell or Terminal. - -2. **Copy and paste the code below, then press enter.** -``` -irm https://get.activated.win | iex -``` -Alternatively, you can use the following (this will be deprecated in the future): -``` -irm https://massgrave.dev/get | iex -``` - -3. You will see the activation options. - Press 1 HWID for Windows activation. - Press 2 Ohook for Office activation. - -4. That's all - ---- - -### Method 2 - Traditional (Windows Vista and later) - -
- Click here to view - -1. Download the file using one of the links below: -`https://github.com/massgravel/Microsoft-Activation-Scripts/archive/refs/heads/master.zip` -or -`https://git.activated.win/massgrave/Microsoft-Activation-Scripts/archive/master.zip` -2. Right-click on the downloaded zip file and extract it. -3. In the extracted folder, find the folder named `All-In-One-Version`. -4. Run the file named `MAS_AIO.cmd`. -5. You will see the activation options. Follow the on-screen instructions. -6. That's all. - -
- ---- - -- **[Office for macOS](https://massgrave.dev/office_for_mac)** -- To run the scripts in unattended mode, check [here](https://massgrave.dev/command_line_switches). - ---- - -### Not working ❓ - -- If you are **unable to launch MAS** using the PowerShell method, please refer to **Method 2** listed above. -- If MAS is launched and the script shows any errors, check for any troubleshooting steps mentioned in blue color and try to follow those. -- If you have any issues, please feel free to reach out to us [here](https://massgrave.dev/troubleshoot). - ---- - -> [!NOTE] -> -> - The IRM command in PowerShell downloads a script from a specified URL, and the IEX command executes it. -> - Always double-check the URL before executing the command and verify the source if manually downloading files. -> - Be cautious, as some spread malware disguised as MAS by using different URLs in the IRM command. - ---- - -``` -Latest Version: 3.2 -Release date: 6-May-2025 -``` - -### [Troubleshooting / Help](https://massgrave.dev/troubleshoot) -### [Download Original Windows & Office](https://massgrave.dev/genuine-installation-media) -### Homepage - [https://massgrave.dev/](https://massgrave.dev/) - -
- -[![1.1]][1] -[![1.2]][2] -[![1.3]][3] - -
- -
- -[![1.4]][4] -[![1.5]][5] -[![1.6]][6] -[![1.7]][7] - -
- -[1.1]: https://massgrave.dev/img/logo_github.png (GitHub) -[1.2]: https://massgrave.dev/img/logo_azuredevops.png (AzureDevOps) -[1.3]: https://massgrave.dev/img/logo_gitea.png (Self-hosted Git) - -[1.4]: https://massgrave.dev/img/logo_discord.png (Chat with us without signup) -[1.5]: https://massgrave.dev/img/logo_reddit.png (Reddit) -[1.6]: https://massgrave.dev/img/logo_bluesky.png (Bluesky) -[1.7]: https://massgrave.dev/img/logo_x.png (Twitter) - -[1]: https://github.com/massgravel/Microsoft-Activation-Scripts -[2]: https://dev.azure.com/massgrave/_git/Microsoft-Activation-Scripts -[3]: https://git.activated.win/massgrave/Microsoft-Activation-Scripts -[4]: https://discord.gg/j2yFsV5ZVC -[5]: https://www.reddit.com/r/MAS_Activator -[6]: https://bsky.app/profile/massgrave.dev -[7]: https://twitter.com/massgravel - ---- - -

Made with Love ❤️

+

MAS Logo

+ +

Microsoft Activation Scripts (MAS)

+ +

Open-source Windows and Office activator featuring HWID, Ohook, TSforge, KMS38, and Online KMS activation methods, along with advanced troubleshooting.

+ +
+ +## How to Activate Windows / Office? + +### Method 1 - PowerShell (Windows 8 and later) ❤️ + +1. **Open PowerShell** + To do that, press the Windows key + X, then select PowerShell or Terminal. + +2. **Copy and paste the code below, then press enter.** +``` +irm https://get.activated.win | iex +``` +Alternatively, you can use the following (this will be deprecated in the future): +``` +irm https://massgrave.dev/get | iex +``` + +3. You will see the activation options. Choose the activation options highlighted in green. + +4. That's all + +--- + +### Method 2 - Traditional (Windows Vista and later) + +
+ Click here to view + +1. Download the file using one of the links below: +`https://github.com/massgravel/Microsoft-Activation-Scripts/archive/refs/heads/master.zip` +or +`https://git.activated.win/massgrave/Microsoft-Activation-Scripts/archive/master.zip` +2. Right-click on the downloaded zip file and extract it. +3. In the extracted folder, find the folder named `All-In-One-Version`. +4. Run the file named `MAS_AIO.cmd`. +5. You will see the activation options. Follow the on-screen instructions. +6. That's all. + +
+ +--- + +- To activate additional products such as **Office for macOS, Visual Studio, RDS CALs, and Windows XP**, check [here](https://massgrave.dev/unsupported_products_activation). +- To run the scripts in unattended mode, check [here](https://massgrave.dev/command_line_switches). + +--- + +### Not working ❓ + +- If you are **unable to launch MAS** using the PowerShell method, please refer to **Method 2** listed above. +- If MAS is launched and the script shows any errors, check for any troubleshooting steps mentioned in blue color and try to follow those. +- If you have any issues, please feel free to reach out to us [here](https://massgrave.dev/troubleshoot). + +--- + +> [!NOTE] +> +> - The IRM command in PowerShell downloads a script from a specified URL, and the IEX command executes it. +> - Always double-check the URL before executing the command and verify the source if manually downloading files. +> - Be cautious, as some spread malware disguised as MAS by using different URLs in the IRM command. + +--- + +``` +Latest Version: 3.2 +Release date: 6-May-2025 +``` + +### [Troubleshooting / Help](https://massgrave.dev/troubleshoot) +### [Download Original Windows & Office](https://massgrave.dev/genuine-installation-media) +### Homepage - [https://massgrave.dev/](https://massgrave.dev/) + +
+ +[![1.1]][1] +[![1.2]][2] +[![1.3]][3] + +
+ +
+ +[![1.4]][4] +[![1.5]][5] +[![1.6]][6] +[![1.7]][7] + +
+ +[1.1]: https://massgrave.dev/img/logo_github.png (GitHub) +[1.2]: https://massgrave.dev/img/logo_azuredevops.png (AzureDevOps) +[1.3]: https://massgrave.dev/img/logo_gitea.png (Self-hosted Git) + +[1.4]: https://massgrave.dev/img/logo_discord.png (Chat with us without signup) +[1.5]: https://massgrave.dev/img/logo_reddit.png (Reddit) +[1.6]: https://massgrave.dev/img/logo_bluesky.png (Bluesky) +[1.7]: https://massgrave.dev/img/logo_x.png (Twitter) + +[1]: https://github.com/massgravel/Microsoft-Activation-Scripts +[2]: https://dev.azure.com/massgrave/_git/Microsoft-Activation-Scripts +[3]: https://git.activated.win/massgrave/Microsoft-Activation-Scripts +[4]: https://discord.gg/j2yFsV5ZVC +[5]: https://www.reddit.com/r/MAS_Activator +[6]: https://bsky.app/profile/massgrave.dev +[7]: https://twitter.com/massgravel + +--- + +

Made with Love ❤️

From 2e44a4a77bc4564c6ad38fa09ff4e134765c6b31 Mon Sep 17 00:00:00 2001 From: WindowsAddict Date: Sun, 1 Jun 2025 20:30:48 +0530 Subject: [PATCH 69/79] 3.3 --- MAS/All-In-One-Version-KL/MAS_AIO.cmd | 2 +- MAS/Separate-Files-Version/Activators/HWID_Activation.cmd | 2 +- MAS/Separate-Files-Version/Activators/KMS38_Activation.cmd | 2 +- MAS/Separate-Files-Version/Activators/Ohook_Activation_AIO.cmd | 2 +- MAS/Separate-Files-Version/Activators/Online_KMS_Activation.cmd | 2 +- MAS/Separate-Files-Version/Activators/TSforge_Activation.cmd | 2 +- MAS/Separate-Files-Version/Change_Office_Edition.cmd | 2 +- MAS/Separate-Files-Version/Change_Windows_Edition.cmd | 2 +- MAS/Separate-Files-Version/Extract_OEM_Folder.cmd | 2 +- MAS/Separate-Files-Version/Troubleshoot.cmd | 2 +- 10 files changed, 10 insertions(+), 10 deletions(-) diff --git a/MAS/All-In-One-Version-KL/MAS_AIO.cmd b/MAS/All-In-One-Version-KL/MAS_AIO.cmd index 9c90b53..7a8eaa9 100644 --- a/MAS/All-In-One-Version-KL/MAS_AIO.cmd +++ b/MAS/All-In-One-Version-KL/MAS_AIO.cmd @@ -1,5 +1,5 @@ @::fh36d7f-random -@set masver=3.2 +@set masver=3.3 @setlocal DisableDelayedExpansion @echo off diff --git a/MAS/Separate-Files-Version/Activators/HWID_Activation.cmd b/MAS/Separate-Files-Version/Activators/HWID_Activation.cmd index 34fe81d..3f46cb3 100644 --- a/MAS/Separate-Files-Version/Activators/HWID_Activation.cmd +++ b/MAS/Separate-Files-Version/Activators/HWID_Activation.cmd @@ -1,4 +1,4 @@ -@set masver=3.2 +@set masver=3.3 @echo off diff --git a/MAS/Separate-Files-Version/Activators/KMS38_Activation.cmd b/MAS/Separate-Files-Version/Activators/KMS38_Activation.cmd index c9aa57f..e2190ac 100644 --- a/MAS/Separate-Files-Version/Activators/KMS38_Activation.cmd +++ b/MAS/Separate-Files-Version/Activators/KMS38_Activation.cmd @@ -1,4 +1,4 @@ -@set masver=3.2 +@set masver=3.3 @echo off diff --git a/MAS/Separate-Files-Version/Activators/Ohook_Activation_AIO.cmd b/MAS/Separate-Files-Version/Activators/Ohook_Activation_AIO.cmd index ac11d16..60e7a5c 100644 --- a/MAS/Separate-Files-Version/Activators/Ohook_Activation_AIO.cmd +++ b/MAS/Separate-Files-Version/Activators/Ohook_Activation_AIO.cmd @@ -1,4 +1,4 @@ -@set masver=3.2 +@set masver=3.3 @echo off diff --git a/MAS/Separate-Files-Version/Activators/Online_KMS_Activation.cmd b/MAS/Separate-Files-Version/Activators/Online_KMS_Activation.cmd index 200c69e..27e539a 100644 --- a/MAS/Separate-Files-Version/Activators/Online_KMS_Activation.cmd +++ b/MAS/Separate-Files-Version/Activators/Online_KMS_Activation.cmd @@ -1,4 +1,4 @@ -@set masver=3.2 +@set masver=3.3 @echo off diff --git a/MAS/Separate-Files-Version/Activators/TSforge_Activation.cmd b/MAS/Separate-Files-Version/Activators/TSforge_Activation.cmd index c80d70e..4c625e9 100644 --- a/MAS/Separate-Files-Version/Activators/TSforge_Activation.cmd +++ b/MAS/Separate-Files-Version/Activators/TSforge_Activation.cmd @@ -1,4 +1,4 @@ -@set masver=3.2 +@set masver=3.3 @echo off diff --git a/MAS/Separate-Files-Version/Change_Office_Edition.cmd b/MAS/Separate-Files-Version/Change_Office_Edition.cmd index eed5d70..6cf421e 100644 --- a/MAS/Separate-Files-Version/Change_Office_Edition.cmd +++ b/MAS/Separate-Files-Version/Change_Office_Edition.cmd @@ -1,4 +1,4 @@ -@set masver=3.2 +@set masver=3.3 @echo off diff --git a/MAS/Separate-Files-Version/Change_Windows_Edition.cmd b/MAS/Separate-Files-Version/Change_Windows_Edition.cmd index e93db0c..6020c87 100644 --- a/MAS/Separate-Files-Version/Change_Windows_Edition.cmd +++ b/MAS/Separate-Files-Version/Change_Windows_Edition.cmd @@ -1,4 +1,4 @@ -@set masver=3.2 +@set masver=3.3 @echo off diff --git a/MAS/Separate-Files-Version/Extract_OEM_Folder.cmd b/MAS/Separate-Files-Version/Extract_OEM_Folder.cmd index 9b43ac2..63a4ad9 100644 --- a/MAS/Separate-Files-Version/Extract_OEM_Folder.cmd +++ b/MAS/Separate-Files-Version/Extract_OEM_Folder.cmd @@ -1,4 +1,4 @@ -@set masver=3.2 +@set masver=3.3 @echo off diff --git a/MAS/Separate-Files-Version/Troubleshoot.cmd b/MAS/Separate-Files-Version/Troubleshoot.cmd index d35e046..c10657e 100644 --- a/MAS/Separate-Files-Version/Troubleshoot.cmd +++ b/MAS/Separate-Files-Version/Troubleshoot.cmd @@ -1,4 +1,4 @@ -@set masver=3.2 +@set masver=3.3 @echo off From 6566bb53c12c9d9c3d892f8eb41340366bdf9d5d Mon Sep 17 00:00:00 2001 From: WindowsAddict Date: Sun, 1 Jun 2025 20:31:23 +0530 Subject: [PATCH 70/79] export-ignore --- .gitattributes | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.gitattributes b/.gitattributes index 8749e12..de5bd3d 100644 --- a/.gitattributes +++ b/.gitattributes @@ -1,4 +1,4 @@ -# MAS export-ignore -# LICENSE export-ignore -# README.md export-ignore +MAS export-ignore +LICENSE export-ignore +README.md export-ignore .gitattributes export-ignore From 55b6fce50aba2229f8a071aa8de439d8d7f763b0 Mon Sep 17 00:00:00 2001 From: WindowsAddict Date: Sun, 1 Jun 2025 20:46:56 +0530 Subject: [PATCH 71/79] Update readme --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 3e776ee..1f55758 100644 --- a/README.md +++ b/README.md @@ -69,8 +69,8 @@ or --- ``` -Latest Version: 3.2 -Release date: 6-May-2025 +Latest Version: 3.3 +Release date: 1-June-2025 ``` ### [Troubleshooting / Help](https://massgrave.dev/troubleshoot) From c89bebdee8880bb4d288f813cf4f4b32c3b80f79 Mon Sep 17 00:00:00 2001 From: WindowsAddict Date: Sun, 1 Jun 2025 21:10:50 +0530 Subject: [PATCH 72/79] Revert export-ignore --- .gitattributes | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.gitattributes b/.gitattributes index de5bd3d..8749e12 100644 --- a/.gitattributes +++ b/.gitattributes @@ -1,4 +1,4 @@ -MAS export-ignore -LICENSE export-ignore -README.md export-ignore +# MAS export-ignore +# LICENSE export-ignore +# README.md export-ignore .gitattributes export-ignore From f969378f6b6a958d9f0913c58315bb17cf54e88b Mon Sep 17 00:00:00 2001 From: WindowsAddict Date: Tue, 3 Jun 2025 13:35:40 +0530 Subject: [PATCH 73/79] Fix a bug in unattended mode in TSforge --- MAS/All-In-One-Version-KL/MAS_AIO.cmd | 2 ++ MAS/Separate-Files-Version/Activators/TSforge_Activation.cmd | 2 ++ 2 files changed, 4 insertions(+) diff --git a/MAS/All-In-One-Version-KL/MAS_AIO.cmd b/MAS/All-In-One-Version-KL/MAS_AIO.cmd index 7a8eaa9..ce84109 100644 --- a/MAS/All-In-One-Version-KL/MAS_AIO.cmd +++ b/MAS/All-In-One-Version-KL/MAS_AIO.cmd @@ -4097,6 +4097,8 @@ if !_el!==1 cls & setlocal & set "_actwin=1" & call :ts_start & endlocal goto :ts_menu ) +goto :ts_start + ::======================================================================================================================================== :ts_changemethod diff --git a/MAS/Separate-Files-Version/Activators/TSforge_Activation.cmd b/MAS/Separate-Files-Version/Activators/TSforge_Activation.cmd index 4c625e9..2814b35 100644 --- a/MAS/Separate-Files-Version/Activators/TSforge_Activation.cmd +++ b/MAS/Separate-Files-Version/Activators/TSforge_Activation.cmd @@ -497,6 +497,8 @@ if !_el!==1 cls & setlocal & set "_actwin=1" & call :ts_start & endlocal goto :ts_menu ) +goto :ts_start + ::======================================================================================================================================== :ts_changemethod From dc90e1ff0fbf3d3a5dc47d3c54afb265a304e689 Mon Sep 17 00:00:00 2001 From: WindowsAddict Date: Tue, 3 Jun 2025 14:55:20 +0530 Subject: [PATCH 74/79] Update info message related to ZCID --- MAS/All-In-One-Version-KL/MAS_AIO.cmd | 27 ++++++++++--------- .../Activators/TSforge_Activation.cmd | 27 ++++++++++--------- 2 files changed, 28 insertions(+), 26 deletions(-) diff --git a/MAS/All-In-One-Version-KL/MAS_AIO.cmd b/MAS/All-In-One-Version-KL/MAS_AIO.cmd index ce84109..4a15d57 100644 --- a/MAS/All-In-One-Version-KL/MAS_AIO.cmd +++ b/MAS/All-In-One-Version-KL/MAS_AIO.cmd @@ -4111,25 +4111,26 @@ echo: echo: echo ______________________________________________________________ echo: -call :dk_color2 %_White% " [1] " %_Green% " Auto" -echo Build 19041 and later: -echo Uses StaticCID, or KMS4k if offline. -echo Older builds: Uses ZeroCID. -echo _______________________________________________ +call :dk_color2 %_White% " [1] " %_Green% "Auto" +echo Builds ^> 19041 -StaticCID (KMS4k if offline) +echo Builds ^< 19041 -ZeroCID +echo ________________________________________________ echo: echo [2] StaticCID -echo Needs Internet. -echo Not for Windows 7 or older. -echo _______________________________________________ +echo Needs Internet +echo Not for Windows 7 or older +echo ________________________________________________ echo: echo [3] ZeroCID -echo Works only on builds below 19041. -echo _______________________________________________ +echo Works reliably on builds below 19041 +echo May break on builds between 19041-26100 +echo Does not work on builds above 26100.4188 +echo ________________________________________________ echo: echo [4] KMS4k -echo This applies only to volume products. -echo Activates for 4000+ years using KMS. -echo _______________________________________________ +echo Volume licenses only +echo Activates for 4000+ years +echo ________________________________________________ echo: echo [5] Learn More echo [0] %_exitmsg% diff --git a/MAS/Separate-Files-Version/Activators/TSforge_Activation.cmd b/MAS/Separate-Files-Version/Activators/TSforge_Activation.cmd index 2814b35..3de091f 100644 --- a/MAS/Separate-Files-Version/Activators/TSforge_Activation.cmd +++ b/MAS/Separate-Files-Version/Activators/TSforge_Activation.cmd @@ -511,25 +511,26 @@ echo: echo: echo ______________________________________________________________ echo: -call :dk_color2 %_White% " [1] " %_Green% " Auto" -echo Build 19041 and later: -echo Uses StaticCID, or KMS4k if offline. -echo Older builds: Uses ZeroCID. -echo _______________________________________________ +call :dk_color2 %_White% " [1] " %_Green% "Auto" +echo Builds ^> 19041 -StaticCID (KMS4k if offline) +echo Builds ^< 19041 -ZeroCID +echo ________________________________________________ echo: echo [2] StaticCID -echo Needs Internet. -echo Not for Windows 7 or older. -echo _______________________________________________ +echo Needs Internet +echo Not for Windows 7 or older +echo ________________________________________________ echo: echo [3] ZeroCID -echo Works only on builds below 19041. -echo _______________________________________________ +echo Works reliably on builds below 19041 +echo May break on builds between 19041-26100 +echo Does not work on builds above 26100.4188 +echo ________________________________________________ echo: echo [4] KMS4k -echo This applies only to volume products. -echo Activates for 4000+ years using KMS. -echo _______________________________________________ +echo Volume licenses only +echo Activates for 4000+ years +echo ________________________________________________ echo: echo [5] Learn More echo [0] %_exitmsg% From 482600c890468cc1f818633ed0787589398a57a7 Mon Sep 17 00:00:00 2001 From: WindowsAddict Date: Tue, 3 Jun 2025 16:44:13 +0530 Subject: [PATCH 75/79] Show info related to expired Office preview products --- MAS/All-In-One-Version-KL/MAS_AIO.cmd | 59 +++++++++++++------ .../Activators/Ohook_Activation_AIO.cmd | 17 ++++++ .../Activators/Online_KMS_Activation.cmd | 17 ++++++ .../Activators/TSforge_Activation.cmd | 55 +++++++++++------ 4 files changed, 110 insertions(+), 38 deletions(-) diff --git a/MAS/All-In-One-Version-KL/MAS_AIO.cmd b/MAS/All-In-One-Version-KL/MAS_AIO.cmd index 4a15d57..f9b8c35 100644 --- a/MAS/All-In-One-Version-KL/MAS_AIO.cmd +++ b/MAS/All-In-One-Version-KL/MAS_AIO.cmd @@ -2423,6 +2423,7 @@ set error=1 goto :starto16c2r ) +call :oh_expiredpreview 2013 call :oh_fixprids call :oh_process if defined isOspp ( @@ -2480,6 +2481,7 @@ set error=1 goto :startmsi ) +call :oh_expiredpreview 2016 2019 2021 2024 call :oh_fixprids call :oh_process if defined isOspp ( @@ -2739,6 +2741,21 @@ exit /b ::======================================================================================================================================== +:oh_expiredpreview + +for %%# in (%*) do ( +if exist "!_oLPath!\ProPlus%%#PreviewVL_*.xrm-ms" if not exist "!_oLPath!\ProPlus%%#VL_*.xrm-ms" ( +set error=1 +set showfix=1 +call :dk_color %Red% "Checking Expired Preview Products [Office %%# Preview Found]" +call :dk_color %Blue% "Please run the Office updates first, and then attempt to activate it again." +) +) + +exit /b + +::======================================================================================================================================== + :oh_ppcpath if not defined isOspp ( @@ -4111,29 +4128,29 @@ echo: echo: echo ______________________________________________________________ echo: -call :dk_color2 %_White% " [1] " %_Green% "Auto" -echo Builds ^> 19041 -StaticCID (KMS4k if offline) -echo Builds ^< 19041 -ZeroCID -echo ________________________________________________ +call :dk_color2 %_White% " [1] " %_Green% "Auto" +echo Builds ^>= 19041 - StaticCID (KMS4k if offline) +echo Builds ^< 19041 - ZeroCID +echo __________________________________________________ echo: -echo [2] StaticCID -echo Needs Internet -echo Not for Windows 7 or older -echo ________________________________________________ +echo [2] StaticCID +echo Needs Internet +echo Not for Windows 7 or older +echo __________________________________________________ echo: -echo [3] ZeroCID -echo Works reliably on builds below 19041 -echo May break on builds between 19041-26100 -echo Does not work on builds above 26100.4188 -echo ________________________________________________ +echo [3] ZeroCID +echo Works reliably on builds below 19041 +echo May break on builds between 19041-26100 +echo Does not work on builds above 26100.4188 +echo __________________________________________________ echo: -echo [4] KMS4k -echo Volume licenses only -echo Activates for 4000+ years -echo ________________________________________________ +echo [4] KMS4k +echo Volume licenses only +echo Activates for 4000+ years +echo __________________________________________________ echo: -echo [5] Learn More -echo [0] %_exitmsg% +echo [5] Learn More +echo [0] %_exitmsg% echo ______________________________________________________________ echo: call :dk_color2 %_White% " " %_Green% "Choose a menu option using your keyboard..." @@ -4980,6 +4997,7 @@ set error=1 goto :ts_starto16c2r ) +call :oh_expiredpreview 2013 if "%_actprojvis%"=="0" call :oh_fixprids call :ts_process @@ -5021,6 +5039,7 @@ set error=1 goto :ts_startmsi ) +call :oh_expiredpreview 2016 2019 2021 2024 if "%_actprojvis%"=="0" call :oh_fixprids call :ts_process @@ -12966,6 +12985,7 @@ set error=1 goto :ks_starto16c2r ) +call :oh_expiredpreview 2013 if "%_actprojvis%"=="0" call :oh_fixprids call :ks_process @@ -13006,6 +13026,7 @@ set error=1 goto :ks_startmsi ) +call :oh_expiredpreview 2016 2019 2021 2024 if "%_actprojvis%"=="0" call :oh_fixprids call :ks_process diff --git a/MAS/Separate-Files-Version/Activators/Ohook_Activation_AIO.cmd b/MAS/Separate-Files-Version/Activators/Ohook_Activation_AIO.cmd index 60e7a5c..0a5ae7c 100644 --- a/MAS/Separate-Files-Version/Activators/Ohook_Activation_AIO.cmd +++ b/MAS/Separate-Files-Version/Activators/Ohook_Activation_AIO.cmd @@ -614,6 +614,7 @@ set error=1 goto :starto16c2r ) +call :oh_expiredpreview 2013 call :oh_fixprids call :oh_process if defined isOspp ( @@ -671,6 +672,7 @@ set error=1 goto :startmsi ) +call :oh_expiredpreview 2016 2019 2021 2024 call :oh_fixprids call :oh_process if defined isOspp ( @@ -930,6 +932,21 @@ exit /b ::======================================================================================================================================== +:oh_expiredpreview + +for %%# in (%*) do ( +if exist "!_oLPath!\ProPlus%%#PreviewVL_*.xrm-ms" if not exist "!_oLPath!\ProPlus%%#VL_*.xrm-ms" ( +set error=1 +set showfix=1 +call :dk_color %Red% "Checking Expired Preview Products [Office %%# Preview Found]" +call :dk_color %Blue% "Please run the Office updates first, and then attempt to activate it again." +) +) + +exit /b + +::======================================================================================================================================== + :oh_ppcpath if not defined isOspp ( diff --git a/MAS/Separate-Files-Version/Activators/Online_KMS_Activation.cmd b/MAS/Separate-Files-Version/Activators/Online_KMS_Activation.cmd index 27e539a..670cc67 100644 --- a/MAS/Separate-Files-Version/Activators/Online_KMS_Activation.cmd +++ b/MAS/Separate-Files-Version/Activators/Online_KMS_Activation.cmd @@ -876,6 +876,7 @@ set error=1 goto :ks_starto16c2r ) +call :oh_expiredpreview 2013 if "%_actprojvis%"=="0" call :oh_fixprids call :ks_process @@ -916,6 +917,7 @@ set error=1 goto :ks_startmsi ) +call :oh_expiredpreview 2016 2019 2021 2024 if "%_actprojvis%"=="0" call :oh_fixprids call :ks_process @@ -1096,6 +1098,21 @@ exit /b ::======================================================================================================================================== +:oh_expiredpreview + +for %%# in (%*) do ( +if exist "!_oLPath!\ProPlus%%#PreviewVL_*.xrm-ms" if not exist "!_oLPath!\ProPlus%%#VL_*.xrm-ms" ( +set error=1 +set showfix=1 +call :dk_color %Red% "Checking Expired Preview Products [Office %%# Preview Found]" +call :dk_color %Blue% "Please run the Office updates first, and then attempt to activate it again." +) +) + +exit /b + +::======================================================================================================================================== + :: Some Office Retail to Volume converter tools may edit the ProductReleaseIds to add VL products. This code restores it because it may affect features. :oh_fixprids diff --git a/MAS/Separate-Files-Version/Activators/TSforge_Activation.cmd b/MAS/Separate-Files-Version/Activators/TSforge_Activation.cmd index 3de091f..e07baeb 100644 --- a/MAS/Separate-Files-Version/Activators/TSforge_Activation.cmd +++ b/MAS/Separate-Files-Version/Activators/TSforge_Activation.cmd @@ -511,29 +511,29 @@ echo: echo: echo ______________________________________________________________ echo: -call :dk_color2 %_White% " [1] " %_Green% "Auto" -echo Builds ^> 19041 -StaticCID (KMS4k if offline) -echo Builds ^< 19041 -ZeroCID -echo ________________________________________________ +call :dk_color2 %_White% " [1] " %_Green% "Auto" +echo Builds ^>= 19041 - StaticCID (KMS4k if offline) +echo Builds ^< 19041 - ZeroCID +echo __________________________________________________ echo: -echo [2] StaticCID -echo Needs Internet -echo Not for Windows 7 or older -echo ________________________________________________ +echo [2] StaticCID +echo Needs Internet +echo Not for Windows 7 or older +echo __________________________________________________ echo: -echo [3] ZeroCID -echo Works reliably on builds below 19041 -echo May break on builds between 19041-26100 -echo Does not work on builds above 26100.4188 -echo ________________________________________________ +echo [3] ZeroCID +echo Works reliably on builds below 19041 +echo May break on builds between 19041-26100 +echo Does not work on builds above 26100.4188 +echo __________________________________________________ echo: -echo [4] KMS4k -echo Volume licenses only -echo Activates for 4000+ years -echo ________________________________________________ +echo [4] KMS4k +echo Volume licenses only +echo Activates for 4000+ years +echo __________________________________________________ echo: -echo [5] Learn More -echo [0] %_exitmsg% +echo [5] Learn More +echo [0] %_exitmsg% echo ______________________________________________________________ echo: call :dk_color2 %_White% " " %_Green% "Choose a menu option using your keyboard..." @@ -1380,6 +1380,7 @@ set error=1 goto :ts_starto16c2r ) +call :oh_expiredpreview 2013 if "%_actprojvis%"=="0" call :oh_fixprids call :ts_process @@ -1421,6 +1422,7 @@ set error=1 goto :ts_startmsi ) +call :oh_expiredpreview 2016 2019 2021 2024 if "%_actprojvis%"=="0" call :oh_fixprids call :ts_process @@ -2002,6 +2004,21 @@ exit /b ::======================================================================================================================================== +:oh_expiredpreview + +for %%# in (%*) do ( +if exist "!_oLPath!\ProPlus%%#PreviewVL_*.xrm-ms" if not exist "!_oLPath!\ProPlus%%#VL_*.xrm-ms" ( +set error=1 +set showfix=1 +call :dk_color %Red% "Checking Expired Preview Products [Office %%# Preview Found]" +call :dk_color %Blue% "Please run the Office updates first, and then attempt to activate it again." +) +) + +exit /b + +::======================================================================================================================================== + :: Some Office Retail to Volume converter tools may edit the ProductReleaseIds to add VL products. This code restores it because it may affect features. :oh_fixprids From faf3bf3a08f875d0f3df2ef8bb089d0ab5c42049 Mon Sep 17 00:00:00 2001 From: WindowsAddict Date: Tue, 3 Jun 2025 17:23:00 +0530 Subject: [PATCH 76/79] Update KMS server list --- MAS/All-In-One-Version-KL/MAS_AIO.cmd | 4 ++-- .../Activators/Online_KMS_Activation.cmd | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/MAS/All-In-One-Version-KL/MAS_AIO.cmd b/MAS/All-In-One-Version-KL/MAS_AIO.cmd index f9b8c35..c6d62c4 100644 --- a/MAS/All-In-One-Version-KL/MAS_AIO.cmd +++ b/MAS/All-In-One-Version-KL/MAS_AIO.cmd @@ -13939,8 +13939,8 @@ set srvlist= set -= set "srvlist=kms.03%-%k.org kms-default.cangs%-%hui.net kms.six%-%yin.com kms.moe%-%club.org kms.cgt%-%soft.com" -set "srvlist=%srvlist% kms.id%-%ina.cn kms.moe%-%yuuko.com xinch%-%eng213618.cn kms.lol%-%i.best kms.my%-%ds.cloud" -set "srvlist=%srvlist% kms.0%-%t.net.cn win.k%-%ms.pub kms.wx%-%lost.com kms.moe%-%yuuko.top kms.gh%-%pym.com" +set "srvlist=%srvlist% kms.id%-%ina.cn kms.moe%-%yuuko.com xinch%-%eng213618.cn kms.lol%-%i.best kms.mc%-%06.net" +set "srvlist=%srvlist% kms.0%-%t.net.cn win.k%-%ms.pub kms.wx%-%lost.com kms.moe%-%yuuko.top kms.gh%-%xi.com" set n=1 for %%a in (%srvlist%) do (set %%a=&set server!n!=%%a&set /a n+=1) diff --git a/MAS/Separate-Files-Version/Activators/Online_KMS_Activation.cmd b/MAS/Separate-Files-Version/Activators/Online_KMS_Activation.cmd index 670cc67..afd489b 100644 --- a/MAS/Separate-Files-Version/Activators/Online_KMS_Activation.cmd +++ b/MAS/Separate-Files-Version/Activators/Online_KMS_Activation.cmd @@ -2154,8 +2154,8 @@ set srvlist= set -= set "srvlist=kms.03%-%k.org kms-default.cangs%-%hui.net kms.six%-%yin.com kms.moe%-%club.org kms.cgt%-%soft.com" -set "srvlist=%srvlist% kms.id%-%ina.cn kms.moe%-%yuuko.com xinch%-%eng213618.cn kms.lol%-%i.best kms.my%-%ds.cloud" -set "srvlist=%srvlist% kms.0%-%t.net.cn win.k%-%ms.pub kms.wx%-%lost.com kms.moe%-%yuuko.top kms.gh%-%pym.com" +set "srvlist=%srvlist% kms.id%-%ina.cn kms.moe%-%yuuko.com xinch%-%eng213618.cn kms.lol%-%i.best kms.mc%-%06.net" +set "srvlist=%srvlist% kms.0%-%t.net.cn win.k%-%ms.pub kms.wx%-%lost.com kms.moe%-%yuuko.top kms.gh%-%xi.com" set n=1 for %%a in (%srvlist%) do (set %%a=&set server!n!=%%a&set /a n+=1) From 67abcd0c8925832fcf4365b9cf3706ab6fbf8571 Mon Sep 17 00:00:00 2001 From: WindowsAddict Date: Tue, 3 Jun 2025 18:25:10 +0530 Subject: [PATCH 77/79] 3.4 --- MAS/All-In-One-Version-KL/MAS_AIO.cmd | 4 ++-- MAS/Separate-Files-Version/Activators/HWID_Activation.cmd | 2 +- MAS/Separate-Files-Version/Activators/KMS38_Activation.cmd | 2 +- .../Activators/Ohook_Activation_AIO.cmd | 2 +- .../Activators/Online_KMS_Activation.cmd | 2 +- MAS/Separate-Files-Version/Activators/TSforge_Activation.cmd | 2 +- MAS/Separate-Files-Version/Change_Office_Edition.cmd | 2 +- MAS/Separate-Files-Version/Change_Windows_Edition.cmd | 2 +- MAS/Separate-Files-Version/Extract_OEM_Folder.cmd | 2 +- MAS/Separate-Files-Version/Troubleshoot.cmd | 2 +- README.md | 4 ++-- 11 files changed, 13 insertions(+), 13 deletions(-) diff --git a/MAS/All-In-One-Version-KL/MAS_AIO.cmd b/MAS/All-In-One-Version-KL/MAS_AIO.cmd index c6d62c4..20a5790 100644 --- a/MAS/All-In-One-Version-KL/MAS_AIO.cmd +++ b/MAS/All-In-One-Version-KL/MAS_AIO.cmd @@ -1,5 +1,5 @@ -@::fh36d7f-random -@set masver=3.3 +@::yfh37fow-random +@set masver=3.4 @setlocal DisableDelayedExpansion @echo off diff --git a/MAS/Separate-Files-Version/Activators/HWID_Activation.cmd b/MAS/Separate-Files-Version/Activators/HWID_Activation.cmd index 3f46cb3..3224434 100644 --- a/MAS/Separate-Files-Version/Activators/HWID_Activation.cmd +++ b/MAS/Separate-Files-Version/Activators/HWID_Activation.cmd @@ -1,4 +1,4 @@ -@set masver=3.3 +@set masver=3.4 @echo off diff --git a/MAS/Separate-Files-Version/Activators/KMS38_Activation.cmd b/MAS/Separate-Files-Version/Activators/KMS38_Activation.cmd index e2190ac..3e9e4d5 100644 --- a/MAS/Separate-Files-Version/Activators/KMS38_Activation.cmd +++ b/MAS/Separate-Files-Version/Activators/KMS38_Activation.cmd @@ -1,4 +1,4 @@ -@set masver=3.3 +@set masver=3.4 @echo off diff --git a/MAS/Separate-Files-Version/Activators/Ohook_Activation_AIO.cmd b/MAS/Separate-Files-Version/Activators/Ohook_Activation_AIO.cmd index 0a5ae7c..93b5c80 100644 --- a/MAS/Separate-Files-Version/Activators/Ohook_Activation_AIO.cmd +++ b/MAS/Separate-Files-Version/Activators/Ohook_Activation_AIO.cmd @@ -1,4 +1,4 @@ -@set masver=3.3 +@set masver=3.4 @echo off diff --git a/MAS/Separate-Files-Version/Activators/Online_KMS_Activation.cmd b/MAS/Separate-Files-Version/Activators/Online_KMS_Activation.cmd index afd489b..eb43119 100644 --- a/MAS/Separate-Files-Version/Activators/Online_KMS_Activation.cmd +++ b/MAS/Separate-Files-Version/Activators/Online_KMS_Activation.cmd @@ -1,4 +1,4 @@ -@set masver=3.3 +@set masver=3.4 @echo off diff --git a/MAS/Separate-Files-Version/Activators/TSforge_Activation.cmd b/MAS/Separate-Files-Version/Activators/TSforge_Activation.cmd index e07baeb..27307cb 100644 --- a/MAS/Separate-Files-Version/Activators/TSforge_Activation.cmd +++ b/MAS/Separate-Files-Version/Activators/TSforge_Activation.cmd @@ -1,4 +1,4 @@ -@set masver=3.3 +@set masver=3.4 @echo off diff --git a/MAS/Separate-Files-Version/Change_Office_Edition.cmd b/MAS/Separate-Files-Version/Change_Office_Edition.cmd index 6cf421e..f83e68c 100644 --- a/MAS/Separate-Files-Version/Change_Office_Edition.cmd +++ b/MAS/Separate-Files-Version/Change_Office_Edition.cmd @@ -1,4 +1,4 @@ -@set masver=3.3 +@set masver=3.4 @echo off diff --git a/MAS/Separate-Files-Version/Change_Windows_Edition.cmd b/MAS/Separate-Files-Version/Change_Windows_Edition.cmd index 6020c87..905b584 100644 --- a/MAS/Separate-Files-Version/Change_Windows_Edition.cmd +++ b/MAS/Separate-Files-Version/Change_Windows_Edition.cmd @@ -1,4 +1,4 @@ -@set masver=3.3 +@set masver=3.4 @echo off diff --git a/MAS/Separate-Files-Version/Extract_OEM_Folder.cmd b/MAS/Separate-Files-Version/Extract_OEM_Folder.cmd index 63a4ad9..7fa15af 100644 --- a/MAS/Separate-Files-Version/Extract_OEM_Folder.cmd +++ b/MAS/Separate-Files-Version/Extract_OEM_Folder.cmd @@ -1,4 +1,4 @@ -@set masver=3.3 +@set masver=3.4 @echo off diff --git a/MAS/Separate-Files-Version/Troubleshoot.cmd b/MAS/Separate-Files-Version/Troubleshoot.cmd index c10657e..aebe72b 100644 --- a/MAS/Separate-Files-Version/Troubleshoot.cmd +++ b/MAS/Separate-Files-Version/Troubleshoot.cmd @@ -1,4 +1,4 @@ -@set masver=3.3 +@set masver=3.4 @echo off diff --git a/README.md b/README.md index 1f55758..53a01b9 100644 --- a/README.md +++ b/README.md @@ -69,8 +69,8 @@ or --- ``` -Latest Version: 3.3 -Release date: 1-June-2025 +Latest Version: 3.4 +Release date: 3-June-2025 ``` ### [Troubleshooting / Help](https://massgrave.dev/troubleshoot) From ae9f4e34ffa18817ce3b7746094520dec5e2cf34 Mon Sep 17 00:00:00 2001 From: WindowsAddict Date: Tue, 3 Jun 2025 18:31:39 +0530 Subject: [PATCH 78/79] export-ignore --- .gitattributes | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.gitattributes b/.gitattributes index 8749e12..de5bd3d 100644 --- a/.gitattributes +++ b/.gitattributes @@ -1,4 +1,4 @@ -# MAS export-ignore -# LICENSE export-ignore -# README.md export-ignore +MAS export-ignore +LICENSE export-ignore +README.md export-ignore .gitattributes export-ignore From 5ad6226f37e7af75807819d669ff5ae0e3421a87 Mon Sep 17 00:00:00 2001 From: WindowsAddict Date: Tue, 3 Jun 2025 18:37:59 +0530 Subject: [PATCH 79/79] Revert export-ignore --- .gitattributes | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.gitattributes b/.gitattributes index de5bd3d..8749e12 100644 --- a/.gitattributes +++ b/.gitattributes @@ -1,4 +1,4 @@ -MAS export-ignore -LICENSE export-ignore -README.md export-ignore +# MAS export-ignore +# LICENSE export-ignore +# README.md export-ignore .gitattributes export-ignore