mirror of
https://github.com/massgravel/Microsoft-Activation-Scripts.git
synced 2025-12-05 03:34:54 +01:00
Compare commits
88 commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
54a1ec3d54 | ||
|
|
5f40fb4a79 | ||
|
|
541364642b | ||
|
|
2bc48bfd4d | ||
|
|
f69e4ff432 | ||
|
|
f8f37b38fe | ||
|
|
3c7178aaf6 | ||
|
|
41783f7a23 | ||
|
|
e7e73a8fbc | ||
|
|
7327f3b445 | ||
|
|
27f21a13d5 | ||
|
|
7f3372d778 | ||
|
|
4958ddf474 | ||
|
|
eeae1dd931 | ||
|
|
d16661cc87 | ||
|
|
1ee7cd1e60 | ||
|
|
55cc6d95d1 | ||
|
|
f4e08dac3d | ||
|
|
979dfb750b | ||
|
|
82f7cfe5f4 | ||
|
|
0a35a00266 | ||
|
|
4bf82f576c | ||
|
|
1e444671be | ||
|
|
0aee35e673 | ||
|
|
77c4bacde6 | ||
|
|
117ccae4ed | ||
|
|
470d3b900e | ||
|
|
b064fc628a | ||
|
|
c9789e9aa3 | ||
|
|
0d4ab4b435 | ||
|
|
8c440c5c48 | ||
|
|
233c9d1b29 | ||
|
|
4953ed82b5 | ||
|
|
b627d74f5a | ||
|
|
07fd04ea10 | ||
|
|
e5ed8c2487 | ||
|
|
c37609eabe | ||
|
|
4e06a401b5 | ||
|
|
b74d1155b9 | ||
|
|
d940db1e60 | ||
|
|
ab6b572af9 | ||
|
|
75a4d2e3a7 | ||
|
|
fd2cecb4ec | ||
|
|
a9c2f58741 | ||
|
|
79012c7db0 | ||
|
|
caffa62abe | ||
|
|
a8f6d051a6 | ||
|
|
6022b6de10 | ||
|
|
4ea26906cd | ||
|
|
564aad78b4 | ||
|
|
d5e382e763 | ||
|
|
793550725a | ||
|
|
3917497c82 | ||
|
|
28c2264d89 | ||
|
|
a51ae62332 | ||
|
|
ffcb641f17 | ||
|
|
53a2747338 | ||
|
|
3a99ea4eeb | ||
|
|
e6eaeaa682 | ||
|
|
e2c52b4ac8 | ||
|
|
31c47b9538 | ||
|
|
904e96d748 | ||
|
|
5e2cc4f5cf | ||
|
|
c619a2c381 | ||
|
|
9c09432b01 | ||
|
|
e476ac66a4 | ||
|
|
dba7213a91 | ||
|
|
0f38fa3cef | ||
|
|
2dd41cc2c5 | ||
|
|
d78e262f5b | ||
|
|
fd1e146753 | ||
|
|
bc781ad079 | ||
|
|
43cceb366e | ||
|
|
39bcefa02b | ||
|
|
2b37400aa8 | ||
|
|
1fb65d4f9c | ||
|
|
10b6e8b6dc | ||
|
|
cb36c19f01 | ||
|
|
4aa811dd5e | ||
|
|
5d37a99966 | ||
|
|
64a726202c | ||
|
|
c3e70173e4 | ||
|
|
c817ae8bd9 | ||
|
|
ef411e14ca | ||
|
|
5aa7d4f3de | ||
|
|
409c4f71ad | ||
|
|
d7a6994363 | ||
|
|
5ad6226f37 |
14 changed files with 4023 additions and 4741 deletions
8
.gitattributes
vendored
8
.gitattributes
vendored
|
|
@ -1,4 +1,4 @@
|
||||||
MAS export-ignore
|
# MAS export-ignore
|
||||||
LICENSE export-ignore
|
# LICENSE export-ignore
|
||||||
README.md export-ignore
|
# README.md export-ignore
|
||||||
.gitattributes export-ignore
|
# .gitattributes export-ignore
|
||||||
|
|
|
||||||
File diff suppressed because it is too large
Load diff
File diff suppressed because it is too large
Load diff
File diff suppressed because it is too large
Load diff
File diff suppressed because it is too large
Load diff
File diff suppressed because it is too large
Load diff
File diff suppressed because it is too large
Load diff
|
|
@ -5,7 +5,6 @@ Activation Type Supported Product Activation Period
|
||||||
HWID - Windows 10-11 - Permanent
|
HWID - Windows 10-11 - Permanent
|
||||||
Ohook - Office - Permanent
|
Ohook - Office - Permanent
|
||||||
TSforge - Windows / ESU / Office - Permanent
|
TSforge - Windows / ESU / Office - Permanent
|
||||||
KMS38 - Windows 10-11-Server - Till the Year 2038
|
|
||||||
Online KMS - Windows / Office - 180 Days. Lifetime With Renewal Task
|
Online KMS - Windows / Office - 180 Days. Lifetime With Renewal Task
|
||||||
|
|
||||||
--------------------------------------------------------------------------------------
|
--------------------------------------------------------------------------------------
|
||||||
|
|
|
||||||
|
|
@ -1,12 +1,11 @@
|
||||||
@set masver=3.4
|
@set masver=3.9
|
||||||
@echo off
|
@echo off
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
::============================================================================
|
::============================================================================
|
||||||
::
|
::
|
||||||
:: Homepage: mass grave[.]dev
|
:: Homepage: mass{}grave{dot}dev
|
||||||
:: Email: mas.help@outlook.com
|
|
||||||
::
|
::
|
||||||
::============================================================================
|
::============================================================================
|
||||||
|
|
||||||
|
|
@ -37,6 +36,7 @@ set "_cmdf=%~f0"
|
||||||
for %%# in (%*) do (
|
for %%# in (%*) do (
|
||||||
if /i "%%#"=="re1" set re1=1
|
if /i "%%#"=="re1" set re1=1
|
||||||
if /i "%%#"=="re2" set re2=1
|
if /i "%%#"=="re2" set re2=1
|
||||||
|
if /i "%%#"=="-qedit" (set re1=1&set re2=1)
|
||||||
)
|
)
|
||||||
|
|
||||||
:: Re-launch the script with x64 process if it was initiated by x86 process on x64 bit Windows
|
:: Re-launch the script with x64 process if it was initiated by x86 process on x64 bit Windows
|
||||||
|
|
@ -135,6 +135,16 @@ call :dk_color2 %Blue% "Check this webpage for help - " %_Yellow% " %mas%trouble
|
||||||
goto dk_done
|
goto dk_done
|
||||||
)
|
)
|
||||||
|
|
||||||
|
if exist "%Systemdrive%\Users\WDAGUtilityAccount" (
|
||||||
|
sc query gcs | find /i "RUNNING" %nul% && (
|
||||||
|
%eline%
|
||||||
|
echo Windows Sandbox detected.
|
||||||
|
echo The script cannot run due to missing licensing components. Aborting...
|
||||||
|
echo:
|
||||||
|
goto dk_done
|
||||||
|
)
|
||||||
|
)
|
||||||
|
|
||||||
if %winbuild% LSS 7600 (
|
if %winbuild% LSS 7600 (
|
||||||
%eline%
|
%eline%
|
||||||
echo Unsupported OS version detected [%winbuild%].
|
echo Unsupported OS version detected [%winbuild%].
|
||||||
|
|
@ -190,7 +200,7 @@ goto dk_done
|
||||||
|
|
||||||
::pstst $ExecutionContext.SessionState.LanguageMode :pstst
|
::pstst $ExecutionContext.SessionState.LanguageMode :pstst
|
||||||
|
|
||||||
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)
|
for /f "delims=" %%a in ('%psc% "if ($PSVersionTable.PSEdition -ne 'Core') {$f=[System.IO.File]::ReadAllText('!_batp!') -split ':pstst';. ([scriptblock]::Create($f[1]))}" %nul6%') do (set tstresult=%%a)
|
||||||
|
|
||||||
if /i not "%tstresult%"=="FullLanguage" (
|
if /i not "%tstresult%"=="FullLanguage" (
|
||||||
%eline%
|
%eline%
|
||||||
|
|
@ -214,6 +224,9 @@ REM check Powershell core version
|
||||||
|
|
||||||
cmd /c "%psc% "$PSVersionTable.PSEdition"" | find /i "Core" %nul1% && (
|
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...
|
echo Windows Powershell is needed for MAS but it seems to be replaced with Powershell core. Aborting...
|
||||||
|
echo:
|
||||||
|
set fixes=%fixes% %mas%in-place_repair_upgrade
|
||||||
|
call :dk_color2 %Blue% "Check this webpage for help - " %_Yellow% " %mas%in-place_repair_upgrade"
|
||||||
goto dk_done
|
goto dk_done
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
@ -228,13 +241,30 @@ call :dk_color2 %Blue% "Check this webpage for help - " %_Yellow% " %mas%remove_
|
||||||
goto dk_done
|
goto dk_done
|
||||||
)
|
)
|
||||||
|
|
||||||
|
REM check if .NET is working properly
|
||||||
|
|
||||||
|
if /i "!tstresult2!"=="FullLanguage" (
|
||||||
|
cmd /c "%psc% ""try {[System.AppDomain]::CurrentDomain.GetAssemblies(); [System.Math]::Sqrt(144)} catch {Exit 3}""" %nul%
|
||||||
|
if !errorlevel!==3 (
|
||||||
|
echo Windows Powershell failed to load .NET command. Aborting...
|
||||||
|
echo:
|
||||||
|
set fixes=%fixes% %mas%in-place_repair_upgrade
|
||||||
|
call :dk_color2 %Blue% "Check this webpage for help - " %_Yellow% " %mas%in-place_repair_upgrade"
|
||||||
|
goto dk_done
|
||||||
|
)
|
||||||
|
)
|
||||||
|
|
||||||
REM check antivirus and other errors
|
REM check antivirus and other errors
|
||||||
|
|
||||||
echo PowerShell is not working properly. Aborting...
|
echo PowerShell is not working properly. Aborting...
|
||||||
|
|
||||||
if /i "!tstresult2!"=="FullLanguage" (
|
if /i "!tstresult2!"=="FullLanguage" (
|
||||||
echo:
|
echo:
|
||||||
echo Your antivirus software might be blocking the script, or PowerShell on your system might be corrupted.
|
echo Your antivirus software might be blocking the script.
|
||||||
|
echo:
|
||||||
|
sc query sense | find /i "RUNNING" %nul% && (
|
||||||
|
echo Installed Antivirus - Microsoft Defender for Endpoint
|
||||||
|
)
|
||||||
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 ', '))}"""
|
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 ', '))}"""
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
@ -258,7 +288,9 @@ set terminal=
|
||||||
|
|
||||||
if defined terminal (
|
if defined terminal (
|
||||||
set lines=0
|
set lines=0
|
||||||
for /f "skip=2 tokens=2 delims=: " %%A in ('mode con') do if "!lines!"=="0" set lines=%%A
|
for /f "skip=3 tokens=* delims=" %%A in ('mode con') do if "!lines!"=="0" (
|
||||||
|
for %%B in (%%A) do set lines=%%B
|
||||||
|
)
|
||||||
if !lines! GEQ 100 set terminal=
|
if !lines! GEQ 100 set terminal=
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
@ -543,9 +575,10 @@ goto :oe_edition
|
||||||
:oe_editionchangepre
|
:oe_editionchangepre
|
||||||
|
|
||||||
cls
|
cls
|
||||||
|
set editedition=
|
||||||
call :ch_getinfo
|
call :ch_getinfo
|
||||||
call :oe_tempcleanup
|
call :oe_tempcleanup
|
||||||
%psc% "$f=[io.file]::ReadAllText('!_batp!') -split ':getlist\:.*';iex ($f[1])"
|
%psc% "$f=[System.IO.File]::ReadAllText('!_batp!') -split ':getlist\:.*';. ([scriptblock]::Create($f[1]))"
|
||||||
|
|
||||||
:oe_editionchange
|
:oe_editionchange
|
||||||
|
|
||||||
|
|
@ -619,7 +652,7 @@ cls
|
||||||
set suites=
|
set suites=
|
||||||
echo %list% | find /i "Suites" %nul1% && (
|
echo %list% | find /i "Suites" %nul1% && (
|
||||||
set suites=1
|
set suites=1
|
||||||
%psc% "$f=[io.file]::ReadAllText('!_batp!') -split ':getappnames\:.*';iex ($f[1])"
|
%psc% "$f=[System.IO.File]::ReadAllText('!_batp!') -split ':getappnames\:.*';. ([scriptblock]::Create($f[1]))"
|
||||||
if not exist %SystemRoot%\Temp\getAppIds.txt (
|
if not exist %SystemRoot%\Temp\getAppIds.txt (
|
||||||
%eline%
|
%eline%
|
||||||
echo Failed to generate available apps list.
|
echo Failed to generate available apps list.
|
||||||
|
|
@ -661,7 +694,8 @@ if not defined terminal mode 98, 32
|
||||||
%line%
|
%line%
|
||||||
echo:
|
echo:
|
||||||
call :dk_color %Gray% "Target edition: %targetedition%"
|
call :dk_color %Gray% "Target edition: %targetedition%"
|
||||||
call :dk_color %Gray% "You can exclude the below apps from installation."
|
call :dk_color %Gray% "To exclude the apps listed below from installation, toggle them from On to Off."
|
||||||
|
if defined editedition call :dk_color %Gray% "Note: The On/Off status below does not reflect the current status of the installed apps."
|
||||||
%line%
|
%line%
|
||||||
if defined suites echo:
|
if defined suites echo:
|
||||||
if defined Access_st echo [A] Access : %Access_st%
|
if defined Access_st echo [A] Access : %Access_st%
|
||||||
|
|
@ -788,7 +822,9 @@ goto :oe_goback
|
||||||
:: OfficeClickToRun.exe with productstoadd method is used here to add editions
|
:: OfficeClickToRun.exe with productstoadd method is used here to add editions
|
||||||
:: It uses delta updates, meaning that since it's using same installed build, it will consume very less Internet
|
:: It uses delta updates, meaning that since it's using same installed build, it will consume very less Internet
|
||||||
|
|
||||||
set "c2rcommand="%_c2rExe%" platform=%_oArch% culture=%_lang% productstoadd=%targetedition%.16_%_lang%_x-none cdnbaseurl.16=http://officecdn.microsoft.com/pr/%_updch% baseurl.16=http://officecdn.microsoft.com/pr/%_updch% version.16=%_version% mediatype.16=CDN sourcetype.16=CDN deliverymechanism=%_updch% %targetedition%.excludedapps.16=groove%excludelist% flt.useteamsaddon=disabled flt.usebingaddononinstall=disabled flt.usebingaddononupdate=disabled"
|
call :oe_getlangs
|
||||||
|
|
||||||
|
set "c2rcommand="%_c2rExe%" platform=%_oArch% culture=%_lang% productstoadd=%targetedition%.16_%_allLangs% cdnbaseurl.16=http://officecdn.microsoft.com/pr/%_updch% baseurl.16=http://officecdn.microsoft.com/pr/%_updch% version.16=%_version% mediatype.16=CDN sourcetype.16=CDN deliverymechanism=%_updch% %targetedition%.excludedapps.16=groove%excludelist% flt.useteamsaddon=disabled flt.usebingaddononinstall=disabled flt.usebingaddononupdate=disabled"
|
||||||
|
|
||||||
if %change%==1 (
|
if %change%==1 (
|
||||||
set "c2rcommand=!c2rcommand! productstoremove=AllProducts"
|
set "c2rcommand=!c2rcommand! productstoremove=AllProducts"
|
||||||
|
|
@ -860,6 +896,7 @@ goto :oe_goback
|
||||||
)
|
)
|
||||||
|
|
||||||
set change=0
|
set change=0
|
||||||
|
set editedition=1
|
||||||
call :ch_getinfo
|
call :ch_getinfo
|
||||||
cls
|
cls
|
||||||
|
|
||||||
|
|
@ -965,13 +1002,8 @@ if %verified%==0 goto :oe_removeedition
|
||||||
cls
|
cls
|
||||||
if not defined terminal mode 105, 32
|
if not defined terminal mode 105, 32
|
||||||
|
|
||||||
set _lang=
|
call :oe_getlangs %targetedition%
|
||||||
echo "%o16c2r_reg%" | find /i "Wow6432Node" %nul1% && (set _tok=10) || (set _tok=9)
|
set "c2rcommand="%_c2rExe%" platform=%_oArch% productstoremove=%targetedition%.16_%_allLangs%"
|
||||||
for /f "tokens=%_tok% delims=\" %%a in ('reg query "%o16c2r_reg%\ProductReleaseIDs\%_actconfig%\%targetedition%.16" /f "-" /k ^| findstr /i ".*16\\.*-.*"') do (
|
|
||||||
if defined _lang (set "_lang=!_lang!_%%a") else (set "_lang=_%%a")
|
|
||||||
)
|
|
||||||
|
|
||||||
set "c2rcommand="%_c2rExe%" platform=%_oArch% productstoremove=%targetedition%.16%_lang%"
|
|
||||||
|
|
||||||
echo:
|
echo:
|
||||||
echo Running the below command, please wait...
|
echo Running the below command, please wait...
|
||||||
|
|
@ -1038,20 +1070,19 @@ call :dk_color %Gray% "Installed Office editions: %_oIds%"
|
||||||
echo:
|
echo:
|
||||||
|
|
||||||
for %%# in (
|
for %%# in (
|
||||||
"5440fd1f-7ecb-4221-8110-145efaa6372f_Insider Fast [Beta] - Insiders::DevMain -"
|
"5440fd1f-7ecb-4221-8110-145efaa6372f_Beta / Insider Fast - Insiders::DevMain -"
|
||||||
"64256afe-f5d9-4f86-8936-8840a6a4f5be_Monthly Preview - Insiders::CC -"
|
"64256afe-f5d9-4f86-8936-8840a6a4f5be_Current / Monthly Preview - Insiders::CC -"
|
||||||
"492350f6-3a01-4f97-b9c0-c7c6ddf67d60_Monthly [Current] - Production::CC -"
|
"492350f6-3a01-4f97-b9c0-c7c6ddf67d60_Current / Monthly - Production::CC -"
|
||||||
"55336b82-a18d-4dd6-b5f6-9e5095c314a6_Monthly Enterprise - Production::MEC -"
|
"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 Enterprise - Production::DC -"
|
||||||
"7ffbc6bf-bc32-4f92-8982-f9dd17fd3114_Semi Annual - Production::DC -"
|
"ea4a4090-de26-49d7-93c1-91bff9e53fc3_DevMain Channel - Dogfood::DevMain -"
|
||||||
"ea4a4090-de26-49d7-93c1-91bff9e53fc3_DevMain Channel - Dogfood::DevMain -"
|
"b61285dd-d9f7-41f2-9757-8f61cba4e9c8_Microsoft Elite - Microsoft::DevMain -"
|
||||||
"b61285dd-d9f7-41f2-9757-8f61cba4e9c8_Microsoft Elite - Microsoft::DevMain -"
|
"f2e724c1-748f-4b47-8fb8-8e0d210e9208_Perpetual2019 VL - Production::LTSC -"
|
||||||
"f2e724c1-748f-4b47-8fb8-8e0d210e9208_Perpetual2019 VL - Production::LTSC -"
|
"1d2d2ea6-1680-4c56-ac58-a441c8c24ff9_Microsoft2019 VL - Microsoft::LTSC -"
|
||||||
"1d2d2ea6-1680-4c56-ac58-a441c8c24ff9_Microsoft2019 VL - Microsoft::LTSC -"
|
"5030841d-c919-4594-8d2d-84ae4f96e58e_Perpetual2021 VL - Production::LTSC2021 -"
|
||||||
"5030841d-c919-4594-8d2d-84ae4f96e58e_Perpetual2021 VL - Production::LTSC2021 -"
|
"86752282-5841-4120-ac80-db03ae6b5fdb_Microsoft2021 VL - Microsoft::LTSC2021 -"
|
||||||
"86752282-5841-4120-ac80-db03ae6b5fdb_Microsoft2021 VL - Microsoft::LTSC2021 -"
|
"7983bac0-e531-40cf-be00-fd24fe66619c_Perpetual2024 VL - Production::LTSC2024 -"
|
||||||
"7983bac0-e531-40cf-be00-fd24fe66619c_Perpetual2024 VL - Production::LTSC2024 -"
|
"c02d8fe6-5242-4da8-972f-82ee55e00671_Microsoft2024 VL - Microsoft::LTSC2024 -"
|
||||||
"c02d8fe6-5242-4da8-972f-82ee55e00671_Microsoft2024 VL - Microsoft::LTSC2024 -"
|
|
||||||
) do (
|
) do (
|
||||||
for /f "tokens=1-2 delims=_" %%A in ("%%~#") do (
|
for /f "tokens=1-2 delims=_" %%A in ("%%~#") do (
|
||||||
set bypass=
|
set bypass=
|
||||||
|
|
@ -1100,7 +1131,7 @@ if not defined terminal mode 105, 32
|
||||||
:: Get build number for the target FFN, using build number with OfficeC2RClient.exe command to trigger updates provides accurate results
|
:: Get build number for the target FFN, using build number with OfficeC2RClient.exe command to trigger updates provides accurate results
|
||||||
|
|
||||||
set build=
|
set build=
|
||||||
for /f "delims=" %%a in ('%psc% "$f=[io.file]::ReadAllText('!_batp!') -split ':getbuild\:.*';iex ($f[1])" %nul6%') do (set build=%%a)
|
for /f "delims=" %%a in ('%psc% "$f=[System.IO.File]::ReadAllText('!_batp!') -split ':getbuild\:.*';. ([scriptblock]::Create($f[1]))" %nul6%') do (set build=%%a)
|
||||||
echo "%build%" | find /i "16." %nul% || set build=
|
echo "%build%" | find /i "16." %nul% || set build=
|
||||||
|
|
||||||
echo:
|
echo:
|
||||||
|
|
@ -1154,7 +1185,19 @@ goto :oe_goback
|
||||||
set buildchk=0
|
set buildchk=0
|
||||||
for /f "tokens=3 delims=." %%a in ("%build%") do set "buildchk=%%a"
|
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"
|
call :oe_getlangs %_firstoId%
|
||||||
|
|
||||||
|
echo %targetchannel% | find /i "2019 VL" %nul% && (
|
||||||
|
for %%A in (en-gb es-mx fr-ca) do (
|
||||||
|
echo %_allLangs% | find /i "%%A" %nul% && (
|
||||||
|
%eline%
|
||||||
|
echo [%%A] language is not supported on the Office 2019 Perpetual VL update channel. Aborting...
|
||||||
|
goto :oe_goback
|
||||||
|
)
|
||||||
|
)
|
||||||
|
)
|
||||||
|
|
||||||
|
set "c2rcommand="%_c2rExe%" platform=%_oArch% culture=%_lang% productstoadd=%_firstoId%.16_%_allLangs% 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"
|
set "c2rclientupdate=!c2rcommand! scenario=CLIENTUPDATE"
|
||||||
|
|
||||||
if %clverchk% LSS %buildchk% (
|
if %clverchk% LSS %buildchk% (
|
||||||
|
|
@ -1336,6 +1379,27 @@ exit /b
|
||||||
|
|
||||||
::========================================================================================================================================
|
::========================================================================================================================================
|
||||||
|
|
||||||
|
:: Check all the installed languages
|
||||||
|
|
||||||
|
:oe_getlangs
|
||||||
|
|
||||||
|
if "%1"=="" (
|
||||||
|
set langreg=culture
|
||||||
|
) else (
|
||||||
|
set langreg=%1.16
|
||||||
|
)
|
||||||
|
|
||||||
|
set _allLangs=
|
||||||
|
echo "%o16c2r_reg%" | find /i "Wow6432Node" %nul1% && (set _tok=10) || (set _tok=9)
|
||||||
|
for /f "tokens=%_tok% delims=\" %%a in ('reg query "%o16c2r_reg%\ProductReleaseIDs\%_actconfig%\%langreg%" /f "-" /k ^| findstr /i "%langreg%\\.*-.*"') do (
|
||||||
|
if defined _allLangs (set "_allLangs=!_allLangs!_%%a") else (set "_allLangs=%%a")
|
||||||
|
)
|
||||||
|
|
||||||
|
set _allLangs=%_allLangs:.16=%
|
||||||
|
exit /b
|
||||||
|
|
||||||
|
::========================================================================================================================================
|
||||||
|
|
||||||
:: Check Internet connection
|
:: Check Internet connection
|
||||||
|
|
||||||
:oe_chkinternet
|
:oe_chkinternet
|
||||||
|
|
@ -1482,7 +1546,7 @@ if ($appIdsList.Count -gt 0) {
|
||||||
set ps=%SysPath%\WindowsPowerShell\v1.0\powershell.exe
|
set ps=%SysPath%\WindowsPowerShell\v1.0\powershell.exe
|
||||||
set psc=%ps% -nop -c
|
set psc=%ps% -nop -c
|
||||||
set winbuild=1
|
set winbuild=1
|
||||||
for /f "tokens=6 delims=[]. " %%G in ('ver') do set winbuild=%%G
|
for /f "tokens=2 delims=[]" %%G in ('ver') do for /f "tokens=2,3,4 delims=. " %%H in ("%%~G") do set "winbuild=%%J"
|
||||||
|
|
||||||
set _slexe=sppsvc.exe& set _slser=sppsvc
|
set _slexe=sppsvc.exe& set _slser=sppsvc
|
||||||
if %winbuild% LEQ 6300 (set _slexe=SLsvc.exe& set _slser=SLsvc)
|
if %winbuild% LEQ 6300 (set _slexe=SLsvc.exe& set _slser=SLsvc)
|
||||||
|
|
@ -1552,6 +1616,11 @@ set spperror=%errorlevel%
|
||||||
if %spperror% NEQ 1056 if %spperror% NEQ 0 (
|
if %spperror% NEQ 1056 if %spperror% NEQ 0 (
|
||||||
%eline%
|
%eline%
|
||||||
echo sc start %_slser% [Error Code: %spperror%]
|
echo sc start %_slser% [Error Code: %spperror%]
|
||||||
|
if %spperror% EQU 1053 (
|
||||||
|
echo:
|
||||||
|
call :dk_color %Blue% "Reboot your machine using the restart option and try again."
|
||||||
|
call :dk_color %Blue% "If it still does not work, go back to Main Menu, select Troubleshoot and run Fix WPA Registry option."
|
||||||
|
)
|
||||||
)
|
)
|
||||||
|
|
||||||
echo:
|
echo:
|
||||||
|
|
|
||||||
|
|
@ -1,12 +1,11 @@
|
||||||
@set masver=3.4
|
@set masver=3.9
|
||||||
@echo off
|
@echo off
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
::============================================================================
|
::============================================================================
|
||||||
::
|
::
|
||||||
:: Homepage: mass grave[.]dev
|
:: Homepage: mass{}grave{dot}dev
|
||||||
:: Email: mas.help@outlook.com
|
|
||||||
::
|
::
|
||||||
::============================================================================
|
::============================================================================
|
||||||
|
|
||||||
|
|
@ -42,6 +41,7 @@ set "_cmdf=%~f0"
|
||||||
for %%# in (%*) do (
|
for %%# in (%*) do (
|
||||||
if /i "%%#"=="re1" set re1=1
|
if /i "%%#"=="re1" set re1=1
|
||||||
if /i "%%#"=="re2" set re2=1
|
if /i "%%#"=="re2" set re2=1
|
||||||
|
if /i "%%#"=="-qedit" (set re1=1&set re2=1)
|
||||||
)
|
)
|
||||||
|
|
||||||
:: Re-launch the script with x64 process if it was initiated by x86 process on x64 bit Windows
|
:: Re-launch the script with x64 process if it was initiated by x86 process on x64 bit Windows
|
||||||
|
|
@ -140,6 +140,16 @@ call :dk_color2 %Blue% "Check this webpage for help - " %_Yellow% " %mas%trouble
|
||||||
goto dk_done
|
goto dk_done
|
||||||
)
|
)
|
||||||
|
|
||||||
|
if exist "%Systemdrive%\Users\WDAGUtilityAccount" (
|
||||||
|
sc query gcs | find /i "RUNNING" %nul% && (
|
||||||
|
%eline%
|
||||||
|
echo Windows Sandbox detected.
|
||||||
|
echo The script cannot run due to missing licensing components. Aborting...
|
||||||
|
echo:
|
||||||
|
goto dk_done
|
||||||
|
)
|
||||||
|
)
|
||||||
|
|
||||||
if %winbuild% LSS 7600 (
|
if %winbuild% LSS 7600 (
|
||||||
%eline%
|
%eline%
|
||||||
echo Unsupported OS version detected [%winbuild%].
|
echo Unsupported OS version detected [%winbuild%].
|
||||||
|
|
@ -195,7 +205,7 @@ goto dk_done
|
||||||
|
|
||||||
::pstst $ExecutionContext.SessionState.LanguageMode :pstst
|
::pstst $ExecutionContext.SessionState.LanguageMode :pstst
|
||||||
|
|
||||||
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)
|
for /f "delims=" %%a in ('%psc% "if ($PSVersionTable.PSEdition -ne 'Core') {$f=[System.IO.File]::ReadAllText('!_batp!') -split ':pstst';. ([scriptblock]::Create($f[1]))}" %nul6%') do (set tstresult=%%a)
|
||||||
|
|
||||||
if /i not "%tstresult%"=="FullLanguage" (
|
if /i not "%tstresult%"=="FullLanguage" (
|
||||||
%eline%
|
%eline%
|
||||||
|
|
@ -219,6 +229,9 @@ REM check Powershell core version
|
||||||
|
|
||||||
cmd /c "%psc% "$PSVersionTable.PSEdition"" | find /i "Core" %nul1% && (
|
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...
|
echo Windows Powershell is needed for MAS but it seems to be replaced with Powershell core. Aborting...
|
||||||
|
echo:
|
||||||
|
set fixes=%fixes% %mas%in-place_repair_upgrade
|
||||||
|
call :dk_color2 %Blue% "Check this webpage for help - " %_Yellow% " %mas%in-place_repair_upgrade"
|
||||||
goto dk_done
|
goto dk_done
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
@ -233,13 +246,30 @@ call :dk_color2 %Blue% "Check this webpage for help - " %_Yellow% " %mas%remove_
|
||||||
goto dk_done
|
goto dk_done
|
||||||
)
|
)
|
||||||
|
|
||||||
|
REM check if .NET is working properly
|
||||||
|
|
||||||
|
if /i "!tstresult2!"=="FullLanguage" (
|
||||||
|
cmd /c "%psc% ""try {[System.AppDomain]::CurrentDomain.GetAssemblies(); [System.Math]::Sqrt(144)} catch {Exit 3}""" %nul%
|
||||||
|
if !errorlevel!==3 (
|
||||||
|
echo Windows Powershell failed to load .NET command. Aborting...
|
||||||
|
echo:
|
||||||
|
set fixes=%fixes% %mas%in-place_repair_upgrade
|
||||||
|
call :dk_color2 %Blue% "Check this webpage for help - " %_Yellow% " %mas%in-place_repair_upgrade"
|
||||||
|
goto dk_done
|
||||||
|
)
|
||||||
|
)
|
||||||
|
|
||||||
REM check antivirus and other errors
|
REM check antivirus and other errors
|
||||||
|
|
||||||
echo PowerShell is not working properly. Aborting...
|
echo PowerShell is not working properly. Aborting...
|
||||||
|
|
||||||
if /i "!tstresult2!"=="FullLanguage" (
|
if /i "!tstresult2!"=="FullLanguage" (
|
||||||
echo:
|
echo:
|
||||||
echo Your antivirus software might be blocking the script, or PowerShell on your system might be corrupted.
|
echo Your antivirus software might be blocking the script.
|
||||||
|
echo:
|
||||||
|
sc query sense | find /i "RUNNING" %nul% && (
|
||||||
|
echo Installed Antivirus - Microsoft Defender for Endpoint
|
||||||
|
)
|
||||||
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 ', '))}"""
|
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 ', '))}"""
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
@ -263,7 +293,9 @@ set terminal=
|
||||||
|
|
||||||
if defined terminal (
|
if defined terminal (
|
||||||
set lines=0
|
set lines=0
|
||||||
for /f "skip=2 tokens=2 delims=: " %%A in ('mode con') do if "!lines!"=="0" set lines=%%A
|
for /f "skip=3 tokens=* delims=" %%A in ('mode con') do if "!lines!"=="0" (
|
||||||
|
for %%B in (%%A) do set lines=%%B
|
||||||
|
)
|
||||||
if !lines! GEQ 100 set terminal=
|
if !lines! GEQ 100 set terminal=
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
@ -367,8 +399,8 @@ echo:
|
||||||
call :dk_color %Blue% "Go back to Main Menu, select Troubleshoot and run DISM Restore and SFC Scan options."
|
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."
|
call :dk_color %Blue% "After that, restart system and try activation again."
|
||||||
echo:
|
echo:
|
||||||
set fixes=%fixes% %mas%troubleshoot
|
set fixes=%fixes% %mas%in-place_repair_upgrade
|
||||||
call :dk_color2 %Blue% "Check this webpage for help - " %_Yellow% " %mas%troubleshoot"
|
call :dk_color2 %Blue% "If it still shows the same error, do this - " %_Yellow% " %mas%in-place_repair_upgrade"
|
||||||
goto dk_done
|
goto dk_done
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
|
@ -445,7 +477,7 @@ set _ntarget=
|
||||||
set _wtarget=
|
set _wtarget=
|
||||||
|
|
||||||
if %winbuild% GEQ 10240 for /f "tokens=4" %%a in ('dism /online /english /Get-TargetEditions ^| findstr /i /c:"Target Edition : "') do (if defined _dtarget (set "_dtarget= !_dtarget! %%a ") else (set "_dtarget= %%a "))
|
if %winbuild% GEQ 10240 for /f "tokens=4" %%a in ('dism /online /english /Get-TargetEditions ^| findstr /i /c:"Target Edition : "') do (if defined _dtarget (set "_dtarget= !_dtarget! %%a ") else (set "_dtarget= %%a "))
|
||||||
if %winbuild% LSS 10240 for /f "tokens=4" %%a in ('%psc% "$f=[io.file]::ReadAllText('!_batp!') -split ':cbsxml\:.*';& ([ScriptBlock]::Create($f[1])) -GetTargetEditions;" ^| findstr /i /c:"Target Edition : "') do (if defined _ptarget (set "_ptarget= !_ptarget! %%a ") else (set "_ptarget= %%a "))
|
if %winbuild% LSS 10240 for /f "tokens=4" %%a in ('%psc% "$f=[System.IO.File]::ReadAllText('!_batp!') -split ':cbsxml\:.*';. ([scriptblock]::Create($f[1])) -GetTargetEditions;" ^| findstr /i /c:"Target Edition : "') do (if defined _ptarget (set "_ptarget= !_ptarget! %%a ") else (set "_ptarget= %%a "))
|
||||||
|
|
||||||
if %winbuild% GEQ 10240 if not exist "%SystemRoot%\Servicing\Packages\Microsoft-Windows-Server*Edition~*.mum" (
|
if %winbuild% GEQ 10240 if not exist "%SystemRoot%\Servicing\Packages\Microsoft-Windows-Server*Edition~*.mum" (
|
||||||
if %winbuild% GEQ 17063 call :ced_edilist
|
if %winbuild% GEQ 17063 call :ced_edilist
|
||||||
|
|
@ -514,7 +546,11 @@ echo:
|
||||||
|
|
||||||
for %%A in (%_ntarget%) do (
|
for %%A in (%_ntarget%) do (
|
||||||
set /a counter+=1
|
set /a counter+=1
|
||||||
|
if /i %%A==IoTEnterprise (
|
||||||
|
echo [!counter!] %%A [GAC, not LTSC]
|
||||||
|
) else (
|
||||||
echo [!counter!] %%A
|
echo [!counter!] %%A
|
||||||
|
)
|
||||||
set targetedition!counter!=%%A
|
set targetedition!counter!=%%A
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
@ -567,7 +603,7 @@ set _dismapi=1
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
|
||||||
set "keyflow=Retail Volume:GVLK Volume:MAK OEM:NONSLP OEM:DM PGS:TB Retail:TB:Eval"
|
set "keyflow=Retail OEM:NONSLP OEM:DM Volume:MAK Volume:GVLK PGS:TB Retail:TB:Eval"
|
||||||
|
|
||||||
call :ced_targetSKU %targetedition%
|
call :ced_targetSKU %targetedition%
|
||||||
if defined targetSKU call :ced_windowskey
|
if defined targetSKU call :ced_windowskey
|
||||||
|
|
@ -651,7 +687,7 @@ echo:
|
||||||
call :ced_prep
|
call :ced_prep
|
||||||
if defined preperror goto dk_done
|
if defined preperror goto dk_done
|
||||||
|
|
||||||
%psc% "$f=[io.file]::ReadAllText('!_batp!') -split ':dismapi\:.*';& ([ScriptBlock]::Create($f[1])) %targetedition% %key%"
|
%psc% "$f=[System.IO.File]::ReadAllText('!_batp!') -split ':dismapi\:.*';. ([scriptblock]::Create($f[1])) %targetedition% %key%"
|
||||||
call :ced_postprep
|
call :ced_postprep
|
||||||
)
|
)
|
||||||
%line%
|
%line%
|
||||||
|
|
@ -689,7 +725,7 @@ call :ced_prep
|
||||||
if defined preperror goto dk_done
|
if defined preperror goto dk_done
|
||||||
|
|
||||||
if %_stg%==0 (set stage=) else (set stage=-StageCurrent)
|
if %_stg%==0 (set stage=) else (set stage=-StageCurrent)
|
||||||
%psc% "$f=[io.file]::ReadAllText('!_batp!') -split ':cbsxml\:.*';& ([ScriptBlock]::Create($f[1])) -SetEdition %targetedition% %stage%"
|
%psc% "$f=[System.IO.File]::ReadAllText('!_batp!') -split ':cbsxml\:.*';. ([scriptblock]::Create($f[1])) -SetEdition %targetedition% %stage%"
|
||||||
call :ced_postprep
|
call :ced_postprep
|
||||||
%line%
|
%line%
|
||||||
|
|
||||||
|
|
@ -838,7 +874,7 @@ exit /b
|
||||||
set ps=%SysPath%\WindowsPowerShell\v1.0\powershell.exe
|
set ps=%SysPath%\WindowsPowerShell\v1.0\powershell.exe
|
||||||
set psc=%ps% -nop -c
|
set psc=%ps% -nop -c
|
||||||
set winbuild=1
|
set winbuild=1
|
||||||
for /f "tokens=6 delims=[]. " %%G in ('ver') do set winbuild=%%G
|
for /f "tokens=2 delims=[]" %%G in ('ver') do for /f "tokens=2,3,4 delims=. " %%H in ("%%~G") do set "winbuild=%%J"
|
||||||
|
|
||||||
set _slexe=sppsvc.exe& set _slser=sppsvc
|
set _slexe=sppsvc.exe& set _slser=sppsvc
|
||||||
if %winbuild% LEQ 6300 (set _slexe=SLsvc.exe& set _slser=SLsvc)
|
if %winbuild% LEQ 6300 (set _slexe=SLsvc.exe& set _slser=SLsvc)
|
||||||
|
|
@ -935,6 +971,11 @@ set spperror=%errorlevel%
|
||||||
if %spperror% NEQ 1056 if %spperror% NEQ 0 (
|
if %spperror% NEQ 1056 if %spperror% NEQ 0 (
|
||||||
%eline%
|
%eline%
|
||||||
echo sc start %_slser% [Error Code: %spperror%]
|
echo sc start %_slser% [Error Code: %spperror%]
|
||||||
|
if %spperror% EQU 1053 (
|
||||||
|
echo:
|
||||||
|
call :dk_color %Blue% "Reboot your machine using the restart option and try again."
|
||||||
|
call :dk_color %Blue% "If it still does not work, go back to Main Menu, select Troubleshoot and run Fix WPA Registry option."
|
||||||
|
)
|
||||||
)
|
)
|
||||||
|
|
||||||
echo:
|
echo:
|
||||||
|
|
@ -1355,55 +1396,55 @@ if %winbuild% GEQ 22000 exit /b
|
||||||
)
|
)
|
||||||
if exist "%SystemRoot%\Servicing\Packages\Microsoft-Windows-Server*CorEdition~*.mum" (set Cor=Cor) else (set Cor=)
|
if exist "%SystemRoot%\Servicing\Packages\Microsoft-Windows-Server*CorEdition~*.mum" (set Cor=Cor) else (set Cor=)
|
||||||
|
|
||||||
set h=
|
set w=
|
||||||
for %%# in (
|
for %%# in (
|
||||||
XGVPP-NMH47-7TTHJ-W3FW7-8HV%h%2C__OEM:NONSLP_Enterprise
|
XGVPP-NMH47-7TTHJ-W3FW7-8HV%w%2C__OEM:NONSLP_Enterprise
|
||||||
D6RD9-D4N8T-RT9QX-YW6YT-FCW%h%WJ______Retail_Starter
|
D6RD9-D4N8T-RT9QX-YW6YT-FCW%w%WJ______Retail_Starter
|
||||||
3V6Q6-NQXCX-V8YXR-9QCYV-QPF%h%CT__Volume:MAK_EnterpriseN
|
3V6Q6-NQXCX-V8YXR-9QCYV-QPF%w%CT__Volume:MAK_EnterpriseN
|
||||||
3NFXW-2T27M-2BDW6-4GHRV-68X%h%RX______Retail_StarterN
|
3NFXW-2T27M-2BDW6-4GHRV-68X%w%RX______Retail_StarterN
|
||||||
VK7JG-NPHTM-C97JM-9MPGT-3V6%h%6T______Retail_Professional
|
VK7JG-NPHTM-C97JM-9MPGT-3V6%w%6T______Retail_Professional
|
||||||
2B87N-8KFHP-DKV6R-Y2C8J-PKC%h%KT______Retail_ProfessionalN
|
2B87N-8KFHP-DKV6R-Y2C8J-PKC%w%KT______Retail_ProfessionalN
|
||||||
4CPRK-NM3K3-X6XXQ-RXX86-WXC%h%HW______Retail_CoreN
|
4CPRK-NM3K3-X6XXQ-RXX86-WXC%w%HW______Retail_CoreN
|
||||||
N2434-X9D7W-8PF6X-8DV9T-8TY%h%MD______Retail_CoreCountrySpecific
|
N2434-X9D7W-8PF6X-8DV9T-8TY%w%MD______Retail_CoreCountrySpecific
|
||||||
BT79Q-G7N6G-PGBYW-4YWX6-6F4%h%BT______Retail_CoreSingleLanguage
|
BT79Q-G7N6G-PGBYW-4YWX6-6F4%w%BT______Retail_CoreSingleLanguage
|
||||||
YTMG3-N6DKC-DKB77-7M9GH-8HV%h%X7______Retail_Core
|
YTMG3-N6DKC-DKB77-7M9GH-8HV%w%X7______Retail_Core
|
||||||
XKCNC-J26Q9-KFHD2-FKTHY-KD7%h%2Y__OEM:NONSLP_PPIPro
|
XKCNC-J26Q9-KFHD2-FKTHY-KD7%w%2Y__OEM:NONSLP_PPIPro
|
||||||
YNMGQ-8RYV3-4PGQ3-C8XTP-7CF%h%BY______Retail_Education
|
YNMGQ-8RYV3-4PGQ3-C8XTP-7CF%w%BY______Retail_Education
|
||||||
84NGF-MHBT6-FXBX8-QWJK7-DRR%h%8H______Retail_EducationN
|
84NGF-MHBT6-FXBX8-QWJK7-DRR%w%8H______Retail_EducationN
|
||||||
KCNVH-YKWX8-GJJB9-H9FDT-6F7%h%W2__Volume:MAK_EnterpriseS_VB
|
KCNVH-YKWX8-GJJB9-H9FDT-6F7%w%W2__Volume:MAK_EnterpriseS_VB
|
||||||
43TBQ-NH92J-XKTM7-KT3KK-P39%h%PB__OEM:NONSLP_EnterpriseS_RS5
|
43TBQ-NH92J-XKTM7-KT3KK-P39%w%PB__OEM:NONSLP_EnterpriseS_RS5
|
||||||
NK96Y-D9CD8-W44CQ-R8YTK-DYJ%h%WX__OEM:NONSLP_EnterpriseS_RS1
|
NK96Y-D9CD8-W44CQ-R8YTK-DYJ%w%WX__OEM:NONSLP_EnterpriseS_RS1
|
||||||
FWN7H-PF93Q-4GGP8-M8RF3-MDW%h%WW__OEM:NONSLP_EnterpriseS_TH
|
FWN7H-PF93Q-4GGP8-M8RF3-MDW%w%WW__OEM:NONSLP_EnterpriseS_TH
|
||||||
RQFNW-9TPM3-JQ73T-QV4VQ-DV9%h%PT__Volume:MAK_EnterpriseSN_VB
|
RQFNW-9TPM3-JQ73T-QV4VQ-DV9%w%PT__Volume:MAK_EnterpriseSN_VB
|
||||||
M33WV-NHY3C-R7FPM-BQGPT-239%h%PG__Volume:MAK_EnterpriseSN_RS5
|
M33WV-NHY3C-R7FPM-BQGPT-239%w%PG__Volume:MAK_EnterpriseSN_RS5
|
||||||
2DBW3-N2PJG-MVHW3-G7TDK-9HK%h%R4__Volume:MAK_EnterpriseSN_RS1
|
2DBW3-N2PJG-MVHW3-G7TDK-9HK%w%R4__Volume:MAK_EnterpriseSN_RS1
|
||||||
NTX6B-BRYC2-K6786-F6MVQ-M7V%h%2X__Volume:MAK_EnterpriseSN_TH
|
NTX6B-BRYC2-K6786-F6MVQ-M7V%w%2X__Volume:MAK_EnterpriseSN_TH
|
||||||
G3KNM-CHG6T-R36X3-9QDG6-8M8%h%K9______Retail_ProfessionalSingleLanguage
|
G3KNM-CHG6T-R36X3-9QDG6-8M8%w%K9______Retail_ProfessionalSingleLanguage
|
||||||
HNGCC-Y38KG-QVK8D-WMWRK-X86%h%VK______Retail_ProfessionalCountrySpecific
|
HNGCC-Y38KG-QVK8D-WMWRK-X86%w%VK______Retail_ProfessionalCountrySpecific
|
||||||
DXG7C-N36C4-C4HTG-X4T3X-2YV%h%77______Retail_ProfessionalWorkstation
|
DXG7C-N36C4-C4HTG-X4T3X-2YV%w%77______Retail_ProfessionalWorkstation
|
||||||
WYPNQ-8C467-V2W6J-TX4WX-WT2%h%RQ______Retail_ProfessionalWorkstationN
|
WYPNQ-8C467-V2W6J-TX4WX-WT2%w%RQ______Retail_ProfessionalWorkstationN
|
||||||
8PTT6-RNW4C-6V7J2-C2D3X-MHB%h%PB______Retail_ProfessionalEducation
|
8PTT6-RNW4C-6V7J2-C2D3X-MHB%w%PB______Retail_ProfessionalEducation
|
||||||
GJTYN-HDMQY-FRR76-HVGC7-QPF%h%8P______Retail_ProfessionalEducationN
|
GJTYN-HDMQY-FRR76-HVGC7-QPF%w%8P______Retail_ProfessionalEducationN
|
||||||
C4NTJ-CX6Q2-VXDMR-XVKGM-F9D%h%JC__Volume:MAK_EnterpriseG
|
C4NTJ-CX6Q2-VXDMR-XVKGM-F9D%w%JC__Volume:MAK_EnterpriseG
|
||||||
46PN6-R9BK9-CVHKB-HWQ9V-MBJ%h%Y8__Volume:MAK_EnterpriseGN
|
46PN6-R9BK9-CVHKB-HWQ9V-MBJ%w%Y8__Volume:MAK_EnterpriseGN
|
||||||
NJCF7-PW8QT-3324D-688JX-2YV%h%66______Retail_ServerRdsh
|
NJCF7-PW8QT-3324D-688JX-2YV%w%66______Retail_ServerRdsh
|
||||||
XQQYW-NFFMW-XJPBH-K8732-CKF%h%FD______OEM:DM_IoTEnterprise
|
XQQYW-NFFMW-XJPBH-K8732-CKF%w%FD______OEM:DM_IoTEnterprise
|
||||||
QPM6N-7J2WJ-P88HH-P3YRH-YY7%h%4H__OEM:NONSLP_IoTEnterpriseS
|
QPM6N-7J2WJ-P88HH-P3YRH-YY7%w%4H__OEM:NONSLP_IoTEnterpriseS
|
||||||
K9VKN-3BGWV-Y624W-MCRMQ-BHD%h%CD______Retail_CloudEditionN
|
K9VKN-3BGWV-Y624W-MCRMQ-BHD%w%CD______Retail_CloudEditionN
|
||||||
KY7PN-VR6RX-83W6Y-6DDYQ-T6R%h%4W______Retail_CloudEdition
|
KY7PN-VR6RX-83W6Y-6DDYQ-T6R%w%4W______Retail_CloudEdition
|
||||||
V3WVW-N2PV2-CGWC3-34QGF-VMJ%h%2C______Retail_Cloud
|
V3WVW-N2PV2-CGWC3-34QGF-VMJ%w%2C______Retail_Cloud
|
||||||
NH9J3-68WK7-6FB93-4K3DF-DJ4%h%F6______Retail_CloudN
|
NH9J3-68WK7-6FB93-4K3DF-DJ4%w%F6______Retail_CloudN
|
||||||
2HN6V-HGTM8-6C97C-RK67V-JQP%h%FD______Retail_CloudE
|
2HN6V-HGTM8-6C97C-RK67V-JQP%w%FD______Retail_CloudE
|
||||||
WC2BQ-8NRM3-FDDYY-2BFGV-KHK%h%QY_Volume:GVLK_ServerStandard%Cor%_RS1
|
WC2BQ-8NRM3-FDDYY-2BFGV-KHK%w%QY_Volume:GVLK_ServerStandard%Cor%_RS1
|
||||||
CB7KF-BWN84-R7R2Y-793K2-8XD%h%DG_Volume:GVLK_ServerDatacenter%Cor%_RS1
|
CB7KF-BWN84-R7R2Y-793K2-8XD%w%DG_Volume:GVLK_ServerDatacenter%Cor%_RS1
|
||||||
JCKRF-N37P4-C2D82-9YXRT-4M6%h%3B_Volume:GVLK_ServerSolution_RS1
|
JCKRF-N37P4-C2D82-9YXRT-4M6%w%3B_Volume:GVLK_ServerSolution_RS1
|
||||||
QN4C6-GBJD2-FB422-GHWJK-GJG%h%2R_Volume:GVLK_ServerCloudStorage_RS1
|
QN4C6-GBJD2-FB422-GHWJK-GJG%w%2R_Volume:GVLK_ServerCloudStorage_RS1
|
||||||
VP34G-4NPPG-79JTQ-864T4-R3M%h%QX_Volume:GVLK_ServerAzureCor_RS1
|
VP34G-4NPPG-79JTQ-864T4-R3M%w%QX_Volume:GVLK_ServerAzureCor_RS1
|
||||||
9JQNQ-V8HQ6-PKB8H-GGHRY-R62%h%H6______Retail_ServerAzureNano_RS1
|
9JQNQ-V8HQ6-PKB8H-GGHRY-R62%w%H6______Retail_ServerAzureNano_RS1
|
||||||
VN8D3-PR82H-DB6BJ-J9P4M-92F%h%6J______Retail_ServerStorageStandard_RS1
|
VN8D3-PR82H-DB6BJ-J9P4M-92F%w%6J______Retail_ServerStorageStandard_RS1
|
||||||
48TQX-NVK3R-D8QR3-GTHHM-8FH%h%XC______Retail_ServerStorageWorkgroup_RS1
|
48TQX-NVK3R-D8QR3-GTHHM-8FH%w%XC______Retail_ServerStorageWorkgroup_RS1
|
||||||
2HXDN-KRXHB-GPYC7-YCKFJ-7FV%h%DG_Volume:GVLK_ServerDatacenterACor_RS3
|
2HXDN-KRXHB-GPYC7-YCKFJ-7FV%w%DG_Volume:GVLK_ServerDatacenterACor_RS3
|
||||||
PTXN8-JFHJM-4WC78-MPCBR-9W4%h%KR_Volume:GVLK_ServerStandardACor_RS3
|
PTXN8-JFHJM-4WC78-MPCBR-9W4%w%KR_Volume:GVLK_ServerStandardACor_RS3
|
||||||
) do (
|
) do (
|
||||||
for /f "tokens=1-4 delims=_" %%A in ("%%#") do if /i %targetedition%==%%C (
|
for /f "tokens=1-4 delims=_" %%A in ("%%#") do if /i %targetedition%==%%C (
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -39,7 +39,7 @@ goto :E_Exit
|
||||||
set "_batf=%~f0"
|
set "_batf=%~f0"
|
||||||
set "_batp=%_batf:'=''%"
|
set "_batp=%_batf:'=''%"
|
||||||
setlocal EnableDelayedExpansion
|
setlocal EnableDelayedExpansion
|
||||||
%_psc% "$f=[IO.File]::ReadAllText('!_batp!') -split ':sppmgr\:.*';iex ($f[1])"
|
%_psc% "$f=[System.IO.File]::ReadAllText('!_batp!') -split ':sppmgr\:.*';. ([scriptblock]::Create($f[1]))"
|
||||||
|
|
||||||
:E_Exit
|
:E_Exit
|
||||||
echo.
|
echo.
|
||||||
|
|
@ -518,6 +518,7 @@ function DetectSubscription {
|
||||||
function DetectAdbaClient
|
function DetectAdbaClient
|
||||||
{
|
{
|
||||||
$propADBA | foreach { set $_ (SlGetInfoSku $licID $_) }
|
$propADBA | foreach { set $_ (SlGetInfoSku $licID $_) }
|
||||||
|
DetectActType
|
||||||
CONOUT "`nAD Activation client information:"
|
CONOUT "`nAD Activation client information:"
|
||||||
CONOUT " Object Name: $ADActivationObjectName"
|
CONOUT " Object Name: $ADActivationObjectName"
|
||||||
CONOUT " Domain Name: $ADActivationObjectDN"
|
CONOUT " Domain Name: $ADActivationObjectDN"
|
||||||
|
|
@ -608,17 +609,18 @@ function DetectKmsHost
|
||||||
if ($null -NE $KeyManagementServiceNotificationRequests) {CONOUT " Notification: $KeyManagementServiceNotificationRequests"}
|
if ($null -NE $KeyManagementServiceNotificationRequests) {CONOUT " Notification: $KeyManagementServiceNotificationRequests"}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function DetectActType
|
||||||
|
{
|
||||||
|
$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}
|
||||||
|
if ($null -NE $VLType) {CONOUT "Configured Activation Type: $($VLActTypes[$VLType])"}
|
||||||
|
}
|
||||||
|
|
||||||
function DetectKmsClient
|
function DetectKmsClient
|
||||||
{
|
{
|
||||||
if ($win8)
|
if ($win8) {DetectActType}
|
||||||
{
|
|
||||||
$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}
|
|
||||||
}
|
|
||||||
if ($null -NE $VLType) {CONOUT "Configured Activation Type: $($VLActTypes[$VLType])"}
|
|
||||||
|
|
||||||
CONOUT "`r"
|
CONOUT "`r"
|
||||||
if ($LicenseStatus -NE 1) {
|
if ($LicenseStatus -NE 1) {
|
||||||
CONOUT "Please activate the product in order to update KMS client information values."
|
CONOUT "Please activate the product in order to update KMS client information values."
|
||||||
|
|
@ -866,6 +868,7 @@ function GetResult($strSLP, $strApp, $entry)
|
||||||
|
|
||||||
if ($win8 -And $VLActivationType -EQ 1) {
|
if ($win8 -And $VLActivationType -EQ 1) {
|
||||||
DetectAdbaClient
|
DetectAdbaClient
|
||||||
|
$cKmsClient = $null
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($winID -And $null -NE $cAvmClient) {
|
if ($winID -And $null -NE $cAvmClient) {
|
||||||
|
|
|
||||||
|
|
@ -1,12 +1,11 @@
|
||||||
@set masver=3.4
|
@set masver=3.9
|
||||||
@echo off
|
@echo off
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
::============================================================================
|
::============================================================================
|
||||||
::
|
::
|
||||||
:: Homepage: mass grave[.]dev
|
:: Homepage: mass{}grave{dot}dev
|
||||||
:: Email: mas.help@outlook.com
|
|
||||||
::
|
::
|
||||||
::============================================================================
|
::============================================================================
|
||||||
|
|
||||||
|
|
@ -37,6 +36,7 @@ set "_cmdf=%~f0"
|
||||||
for %%# in (%*) do (
|
for %%# in (%*) do (
|
||||||
if /i "%%#"=="re1" set re1=1
|
if /i "%%#"=="re1" set re1=1
|
||||||
if /i "%%#"=="re2" set re2=1
|
if /i "%%#"=="re2" set re2=1
|
||||||
|
if /i "%%#"=="-qedit" (set re1=1&set re2=1)
|
||||||
)
|
)
|
||||||
|
|
||||||
:: Re-launch the script with x64 process if it was initiated by x86 process on x64 bit Windows
|
:: Re-launch the script with x64 process if it was initiated by x86 process on x64 bit Windows
|
||||||
|
|
@ -134,6 +134,16 @@ call :dk_color2 %Blue% "Check this webpage for help - " %_Yellow% " %mas%trouble
|
||||||
goto done2
|
goto done2
|
||||||
)
|
)
|
||||||
|
|
||||||
|
if exist "%Systemdrive%\Users\WDAGUtilityAccount" (
|
||||||
|
sc query gcs | find /i "RUNNING" %nul% && (
|
||||||
|
%eline%
|
||||||
|
echo Windows Sandbox detected.
|
||||||
|
echo The script cannot run due to missing licensing components. Aborting...
|
||||||
|
echo:
|
||||||
|
goto done2
|
||||||
|
)
|
||||||
|
)
|
||||||
|
|
||||||
if %winbuild% LSS 6001 (
|
if %winbuild% LSS 6001 (
|
||||||
%nceline%
|
%nceline%
|
||||||
echo Unsupported OS version detected [%winbuild%].
|
echo Unsupported OS version detected [%winbuild%].
|
||||||
|
|
@ -206,7 +216,7 @@ goto done2
|
||||||
|
|
||||||
::pstst $ExecutionContext.SessionState.LanguageMode :pstst
|
::pstst $ExecutionContext.SessionState.LanguageMode :pstst
|
||||||
|
|
||||||
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)
|
for /f "delims=" %%a in ('%psc% "if ($PSVersionTable.PSEdition -ne 'Core') {$f=[System.IO.File]::ReadAllText('!_batp!') -split ':pstst';. ([scriptblock]::Create($f[1]))}" %nul6%') do (set tstresult=%%a)
|
||||||
|
|
||||||
if /i not "%tstresult%"=="FullLanguage" (
|
if /i not "%tstresult%"=="FullLanguage" (
|
||||||
%eline%
|
%eline%
|
||||||
|
|
@ -230,6 +240,9 @@ REM check Powershell core version
|
||||||
|
|
||||||
cmd /c "%psc% "$PSVersionTable.PSEdition"" | find /i "Core" %nul1% && (
|
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...
|
echo Windows Powershell is needed for MAS but it seems to be replaced with Powershell core. Aborting...
|
||||||
|
echo:
|
||||||
|
set fixes=%fixes% %mas%in-place_repair_upgrade
|
||||||
|
call :dk_color2 %Blue% "Check this webpage for help - " %_Yellow% " %mas%in-place_repair_upgrade"
|
||||||
goto done2
|
goto done2
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
@ -244,13 +257,30 @@ call :dk_color2 %Blue% "Check this webpage for help - " %_Yellow% " %mas%remove_
|
||||||
goto done2
|
goto done2
|
||||||
)
|
)
|
||||||
|
|
||||||
|
REM check if .NET is working properly
|
||||||
|
|
||||||
|
if /i "!tstresult2!"=="FullLanguage" (
|
||||||
|
cmd /c "%psc% ""try {[System.AppDomain]::CurrentDomain.GetAssemblies(); [System.Math]::Sqrt(144)} catch {Exit 3}""" %nul%
|
||||||
|
if !errorlevel!==3 (
|
||||||
|
echo Windows Powershell failed to load .NET command. Aborting...
|
||||||
|
echo:
|
||||||
|
set fixes=%fixes% %mas%in-place_repair_upgrade
|
||||||
|
call :dk_color2 %Blue% "Check this webpage for help - " %_Yellow% " %mas%in-place_repair_upgrade"
|
||||||
|
goto done2
|
||||||
|
)
|
||||||
|
)
|
||||||
|
|
||||||
REM check antivirus and other errors
|
REM check antivirus and other errors
|
||||||
|
|
||||||
echo PowerShell is not working properly. Aborting...
|
echo PowerShell is not working properly. Aborting...
|
||||||
|
|
||||||
if /i "!tstresult2!"=="FullLanguage" (
|
if /i "!tstresult2!"=="FullLanguage" (
|
||||||
echo:
|
echo:
|
||||||
echo Your antivirus software might be blocking the script, or PowerShell on your system might be corrupted.
|
echo Your antivirus software might be blocking the script.
|
||||||
|
echo:
|
||||||
|
sc query sense | find /i "RUNNING" %nul% && (
|
||||||
|
echo Installed Antivirus - Microsoft Defender for Endpoint
|
||||||
|
)
|
||||||
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 ', '))}"""
|
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 ', '))}"""
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
@ -274,7 +304,9 @@ set terminal=
|
||||||
|
|
||||||
if defined terminal (
|
if defined terminal (
|
||||||
set lines=0
|
set lines=0
|
||||||
for /f "skip=2 tokens=2 delims=: " %%A in ('mode con') do if "!lines!"=="0" set lines=%%A
|
for /f "skip=3 tokens=* delims=" %%A in ('mode con') do if "!lines!"=="0" (
|
||||||
|
for %%B in (%%A) do set lines=%%B
|
||||||
|
)
|
||||||
if !lines! GEQ 100 set terminal=
|
if !lines! GEQ 100 set terminal=
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
@ -373,7 +405,6 @@ goto done2
|
||||||
)
|
)
|
||||||
|
|
||||||
set HWID_Activation.cmd=Activators\HWID_Activation.cmd
|
set HWID_Activation.cmd=Activators\HWID_Activation.cmd
|
||||||
set KMS38_Activation.cmd=Activators\KMS38_Activation.cmd
|
|
||||||
set Online_KMS_Activation.cmd=Activators\Online_KMS_Activation.cmd
|
set Online_KMS_Activation.cmd=Activators\Online_KMS_Activation.cmd
|
||||||
set Ohook_Activation_AIO.cmd=Activators\Ohook_Activation_AIO.cmd
|
set Ohook_Activation_AIO.cmd=Activators\Ohook_Activation_AIO.cmd
|
||||||
set TSforge_Activation.cmd=Activators\TSforge_Activation.cmd
|
set TSforge_Activation.cmd=Activators\TSforge_Activation.cmd
|
||||||
|
|
@ -382,7 +413,6 @@ pushd "!_work!"
|
||||||
set _nofile=
|
set _nofile=
|
||||||
for %%# in (
|
for %%# in (
|
||||||
%HWID_Activation.cmd%
|
%HWID_Activation.cmd%
|
||||||
%KMS38_Activation.cmd%
|
|
||||||
%Online_KMS_Activation.cmd%
|
%Online_KMS_Activation.cmd%
|
||||||
%Ohook_Activation_AIO.cmd%
|
%Ohook_Activation_AIO.cmd%
|
||||||
%TSforge_Activation.cmd%
|
%TSforge_Activation.cmd%
|
||||||
|
|
@ -413,31 +443,29 @@ echo:
|
||||||
echo: Extract $OEM$ folder on the desktop
|
echo: Extract $OEM$ folder on the desktop
|
||||||
echo: ____________________________________________________________
|
echo: ____________________________________________________________
|
||||||
echo:
|
echo:
|
||||||
echo: [1] HWID [Windows]
|
echo: [1] HWID [Windows]
|
||||||
echo: [2] Ohook [Office]
|
echo: [2] Ohook [Office]
|
||||||
echo: [3] TSforge [Windows / ESU / Office]
|
echo: [3] TSforge [Windows / ESU / Office]
|
||||||
echo: [4] KMS38 [Windows]
|
echo: [4] Online KMS [Windows / Office]
|
||||||
echo: [5] Online KMS [Windows / Office]
|
|
||||||
echo:
|
echo:
|
||||||
echo: [6] HWID [Windows] ^+ Ohook [Office]
|
echo: [5] HWID [Windows] ^+ Ohook [Office]
|
||||||
echo: [7] HWID [Windows] ^+ Ohook [Office] ^+ TSforge [ESU]
|
echo: [6] HWID [Windows] ^+ Ohook [Office] ^+ TSforge [ESU]
|
||||||
echo: [8] TSforge [Windows] ^+ Online KMS [Office]
|
echo: [7] TSforge [Windows / ESU] ^+ Ohook [Office]
|
||||||
echo:
|
echo:
|
||||||
call :dk_color2 %_White% " [R] " %_Green% "ReadMe"
|
call :dk_color2 %_White% " [R] " %_Green% "ReadMe"
|
||||||
echo: [0] Exit
|
echo: [0] Exit
|
||||||
echo: ____________________________________________________________
|
echo: ____________________________________________________________
|
||||||
echo:
|
echo:
|
||||||
call :dk_color2 %_White% " " %_Green% "Choose a menu option using your keyboard :"
|
call :dk_color2 %_White% " " %_Green% "Choose a menu option using your keyboard :"
|
||||||
choice /C:12345678R0 /N
|
choice /C:1234567R0 /N
|
||||||
set _erl=%errorlevel%
|
set _erl=%errorlevel%
|
||||||
|
|
||||||
if %_erl%==10 exit /b
|
if %_erl%==9 exit /b
|
||||||
if %_erl%==9 start %mas%oem-folder &goto :Menu
|
if %_erl%==8 start %mas%oem-folder &goto :Menu
|
||||||
if %_erl%==8 goto:tsforge_kms
|
if %_erl%==7 goto:tsforge_ohook
|
||||||
if %_erl%==7 goto:hwid_ohook_tsforge
|
if %_erl%==6 goto:hwid_ohook_tsforge
|
||||||
if %_erl%==6 goto:hwid_ohook
|
if %_erl%==5 goto:hwid_ohook
|
||||||
if %_erl%==5 goto:kms
|
if %_erl%==4 goto:kms
|
||||||
if %_erl%==4 goto:kms38
|
|
||||||
if %_erl%==3 goto:tsforge
|
if %_erl%==3 goto:tsforge
|
||||||
if %_erl%==2 goto:ohook
|
if %_erl%==2 goto:ohook
|
||||||
if %_erl%==1 goto:hwid
|
if %_erl%==1 goto:hwid
|
||||||
|
|
@ -535,36 +563,6 @@ cd \
|
||||||
|
|
||||||
::========================================================================================================================================
|
::========================================================================================================================================
|
||||||
|
|
||||||
:kms38
|
|
||||||
|
|
||||||
cls
|
|
||||||
md "!desktop!\$OEM$\$$\Setup\Scripts"
|
|
||||||
pushd "!_work!"
|
|
||||||
copy /y /b "%KMS38_Activation.cmd%" "!_dir!\KMS38_Activation.cmd" %nul%
|
|
||||||
popd
|
|
||||||
call :export kms38_setup
|
|
||||||
|
|
||||||
set _error=
|
|
||||||
if not exist "!_dir!\KMS38_Activation.cmd" set _error=1
|
|
||||||
if not exist "!_dir!\SetupComplete.cmd" set _error=1
|
|
||||||
if defined _error goto errorfound
|
|
||||||
|
|
||||||
set oem=KMS38
|
|
||||||
goto done
|
|
||||||
|
|
||||||
:kms38_setup:
|
|
||||||
@echo off
|
|
||||||
|
|
||||||
fltmc >nul || exit /b
|
|
||||||
|
|
||||||
call "%~dp0KMS38_Activation.cmd" /KMS38
|
|
||||||
|
|
||||||
cd \
|
|
||||||
(goto) 2>nul & (if "%~dp0"=="%SystemRoot%\Setup\Scripts\" rd /s /q "%~dp0")
|
|
||||||
:kms38_setup:
|
|
||||||
|
|
||||||
::========================================================================================================================================
|
|
||||||
|
|
||||||
:kms
|
:kms
|
||||||
|
|
||||||
cls
|
cls
|
||||||
|
|
@ -677,41 +675,41 @@ cd \
|
||||||
|
|
||||||
::========================================================================================================================================
|
::========================================================================================================================================
|
||||||
|
|
||||||
:tsforge_kms
|
:tsforge_ohook
|
||||||
|
|
||||||
cls
|
cls
|
||||||
md "!desktop!\$OEM$\$$\Setup\Scripts"
|
md "!desktop!\$OEM$\$$\Setup\Scripts"
|
||||||
pushd "!_work!"
|
pushd "!_work!"
|
||||||
copy /y /b "%TSforge_Activation.cmd%" "!_dir!\TSforge_Activation.cmd" %nul%
|
copy /y /b "%TSforge_Activation.cmd%" "!_dir!\TSforge_Activation.cmd" %nul%
|
||||||
copy /y /b "%Online_KMS_Activation.cmd%" "!_dir!\Online_KMS_Activation.cmd" %nul%
|
copy /y /b "%Ohook_Activation_AIO.cmd%" "!_dir!\Ohook_Activation_AIO.cmd" %nul%
|
||||||
popd
|
popd
|
||||||
call :export tsforge_kms_setup
|
call :export tsforge_ohook_setup
|
||||||
|
|
||||||
set _error=
|
set _error=
|
||||||
if not exist "!_dir!\TSforge_Activation.cmd" set _error=1
|
if not exist "!_dir!\TSforge_Activation.cmd" set _error=1
|
||||||
if not exist "!_dir!\Online_KMS_Activation.cmd" set _error=1
|
if not exist "!_dir!\Ohook_Activation_AIO.cmd" set _error=1
|
||||||
if not exist "!_dir!\SetupComplete.cmd" set _error=1
|
if not exist "!_dir!\SetupComplete.cmd" set _error=1
|
||||||
if defined _error goto errorfound
|
if defined _error goto errorfound
|
||||||
|
|
||||||
set oem=TSforge [Windows] + Online KMS [Office]
|
set oem=TSforge [Windows / ESU] + Ohook [Office]
|
||||||
goto done
|
goto done
|
||||||
|
|
||||||
:tsforge_kms_setup:
|
:tsforge_ohook_setup:
|
||||||
@echo off
|
@echo off
|
||||||
|
|
||||||
fltmc >nul || exit /b
|
fltmc >nul || exit /b
|
||||||
|
|
||||||
setlocal
|
setlocal
|
||||||
call "%~dp0TSforge_Activation.cmd" /Z-Windows
|
call "%~dp0TSforge_Activation.cmd" /Z-Windows /Z-ESU
|
||||||
endlocal
|
endlocal
|
||||||
|
|
||||||
setlocal
|
setlocal
|
||||||
call "%~dp0Online_KMS_Activation.cmd" /K-Office
|
call "%~dp0Ohook_Activation_AIO.cmd" /Ohook
|
||||||
endlocal
|
endlocal
|
||||||
|
|
||||||
cd \
|
cd \
|
||||||
(goto) 2>nul & (if "%~dp0"=="%SystemRoot%\Setup\Scripts\" rd /s /q "%~dp0")
|
(goto) 2>nul & (if "%~dp0"=="%SystemRoot%\Setup\Scripts\" rd /s /q "%~dp0")
|
||||||
:tsforge_kms_setup:
|
:tsforge_ohook_setup:
|
||||||
|
|
||||||
::========================================================================================================================================
|
::========================================================================================================================================
|
||||||
|
|
||||||
|
|
@ -727,11 +725,6 @@ echo ______________________________________________________________
|
||||||
echo:
|
echo:
|
||||||
call :dk_color %Blue% "%oem%"
|
call :dk_color %Blue% "%oem%"
|
||||||
call :dk_color %Green% "$OEM$ folder was successfully created on your Desktop."
|
call :dk_color %Green% "$OEM$ folder was successfully created on your Desktop."
|
||||||
echo "%oem%" | find /i "38" %nul% && (
|
|
||||||
echo:
|
|
||||||
echo To KMS38 activate Server Cor/Acor editions [No GUI Versions],
|
|
||||||
echo Check this page %mas%oem-folder
|
|
||||||
)
|
|
||||||
echo ______________________________________________________________
|
echo ______________________________________________________________
|
||||||
|
|
||||||
:done2
|
:done2
|
||||||
|
|
@ -763,7 +756,7 @@ exit /b
|
||||||
set ps=%SysPath%\WindowsPowerShell\v1.0\powershell.exe
|
set ps=%SysPath%\WindowsPowerShell\v1.0\powershell.exe
|
||||||
set psc=%ps% -nop -c
|
set psc=%ps% -nop -c
|
||||||
set winbuild=1
|
set winbuild=1
|
||||||
for /f "tokens=6 delims=[]. " %%G in ('ver') do set winbuild=%%G
|
for /f "tokens=2 delims=[]" %%G in ('ver') do for /f "tokens=2,3,4 delims=. " %%H in ("%%~G") do set "winbuild=%%J"
|
||||||
|
|
||||||
set _slexe=sppsvc.exe& set _slser=sppsvc
|
set _slexe=sppsvc.exe& set _slser=sppsvc
|
||||||
if %winbuild% LEQ 6300 (set _slexe=SLsvc.exe& set _slser=SLsvc)
|
if %winbuild% LEQ 6300 (set _slexe=SLsvc.exe& set _slser=SLsvc)
|
||||||
|
|
@ -816,7 +809,7 @@ exit /b
|
||||||
|
|
||||||
:export
|
:export
|
||||||
|
|
||||||
%psc% "$f=[io.file]::ReadAllText('!_batp!') -split \":%~1\:.*`r`n\"; [io.file]::WriteAllText('!_pdesk!\$OEM$\$$\Setup\Scripts\SetupComplete.cmd',$f[1].Trim(),[System.Text.Encoding]::ASCII);"
|
%psc% "$f=[System.IO.File]::ReadAllText('!_batp!') -split \":%~1\:.*`r`n\"; [io.file]::WriteAllText('!_pdesk!\$OEM$\$$\Setup\Scripts\SetupComplete.cmd',$f[1].Trim(),[System.Text.Encoding]::ASCII);"
|
||||||
exit /b
|
exit /b
|
||||||
|
|
||||||
::========================================================================================================================================
|
::========================================================================================================================================
|
||||||
|
|
|
||||||
|
|
@ -1,12 +1,11 @@
|
||||||
@set masver=3.4
|
@set masver=3.9
|
||||||
@echo off
|
@echo off
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
::============================================================================
|
::============================================================================
|
||||||
::
|
::
|
||||||
:: Homepage: mass grave[.]dev
|
:: Homepage: mass{}grave{dot}dev
|
||||||
:: Email: mas.help@outlook.com
|
|
||||||
::
|
::
|
||||||
::============================================================================
|
::============================================================================
|
||||||
|
|
||||||
|
|
@ -37,6 +36,7 @@ set "_cmdf=%~f0"
|
||||||
for %%# in (%*) do (
|
for %%# in (%*) do (
|
||||||
if /i "%%#"=="re1" set re1=1
|
if /i "%%#"=="re1" set re1=1
|
||||||
if /i "%%#"=="re2" set re2=1
|
if /i "%%#"=="re2" set re2=1
|
||||||
|
if /i "%%#"=="-qedit" (set re1=1&set re2=1)
|
||||||
)
|
)
|
||||||
|
|
||||||
:: Re-launch the script with x64 process if it was initiated by x86 process on x64 bit Windows
|
:: Re-launch the script with x64 process if it was initiated by x86 process on x64 bit Windows
|
||||||
|
|
@ -135,6 +135,16 @@ call :dk_color2 %Blue% "Check this webpage for help - " %_Yellow% " %mas%trouble
|
||||||
goto dk_done
|
goto dk_done
|
||||||
)
|
)
|
||||||
|
|
||||||
|
if exist "%Systemdrive%\Users\WDAGUtilityAccount" (
|
||||||
|
sc query gcs | find /i "RUNNING" %nul% && (
|
||||||
|
%eline%
|
||||||
|
echo Windows Sandbox detected.
|
||||||
|
echo The script cannot run due to missing licensing components. Aborting...
|
||||||
|
echo:
|
||||||
|
goto dk_done
|
||||||
|
)
|
||||||
|
)
|
||||||
|
|
||||||
if %winbuild% LSS 6001 (
|
if %winbuild% LSS 6001 (
|
||||||
%nceline%
|
%nceline%
|
||||||
echo Unsupported OS version detected [%winbuild%].
|
echo Unsupported OS version detected [%winbuild%].
|
||||||
|
|
@ -207,7 +217,7 @@ goto dk_done
|
||||||
|
|
||||||
::pstst $ExecutionContext.SessionState.LanguageMode :pstst
|
::pstst $ExecutionContext.SessionState.LanguageMode :pstst
|
||||||
|
|
||||||
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)
|
for /f "delims=" %%a in ('%psc% "if ($PSVersionTable.PSEdition -ne 'Core') {$f=[System.IO.File]::ReadAllText('!_batp!') -split ':pstst';. ([scriptblock]::Create($f[1]))}" %nul6%') do (set tstresult=%%a)
|
||||||
|
|
||||||
if /i not "%tstresult%"=="FullLanguage" (
|
if /i not "%tstresult%"=="FullLanguage" (
|
||||||
%eline%
|
%eline%
|
||||||
|
|
@ -231,6 +241,9 @@ REM check Powershell core version
|
||||||
|
|
||||||
cmd /c "%psc% "$PSVersionTable.PSEdition"" | find /i "Core" %nul1% && (
|
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...
|
echo Windows Powershell is needed for MAS but it seems to be replaced with Powershell core. Aborting...
|
||||||
|
echo:
|
||||||
|
set fixes=%fixes% %mas%in-place_repair_upgrade
|
||||||
|
call :dk_color2 %Blue% "Check this webpage for help - " %_Yellow% " %mas%in-place_repair_upgrade"
|
||||||
goto dk_done
|
goto dk_done
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
@ -245,13 +258,30 @@ call :dk_color2 %Blue% "Check this webpage for help - " %_Yellow% " %mas%remove_
|
||||||
goto dk_done
|
goto dk_done
|
||||||
)
|
)
|
||||||
|
|
||||||
|
REM check if .NET is working properly
|
||||||
|
|
||||||
|
if /i "!tstresult2!"=="FullLanguage" (
|
||||||
|
cmd /c "%psc% ""try {[System.AppDomain]::CurrentDomain.GetAssemblies(); [System.Math]::Sqrt(144)} catch {Exit 3}""" %nul%
|
||||||
|
if !errorlevel!==3 (
|
||||||
|
echo Windows Powershell failed to load .NET command. Aborting...
|
||||||
|
echo:
|
||||||
|
set fixes=%fixes% %mas%in-place_repair_upgrade
|
||||||
|
call :dk_color2 %Blue% "Check this webpage for help - " %_Yellow% " %mas%in-place_repair_upgrade"
|
||||||
|
goto dk_done
|
||||||
|
)
|
||||||
|
)
|
||||||
|
|
||||||
REM check antivirus and other errors
|
REM check antivirus and other errors
|
||||||
|
|
||||||
echo PowerShell is not working properly. Aborting...
|
echo PowerShell is not working properly. Aborting...
|
||||||
|
|
||||||
if /i "!tstresult2!"=="FullLanguage" (
|
if /i "!tstresult2!"=="FullLanguage" (
|
||||||
echo:
|
echo:
|
||||||
echo Your antivirus software might be blocking the script, or PowerShell on your system might be corrupted.
|
echo Your antivirus software might be blocking the script.
|
||||||
|
echo:
|
||||||
|
sc query sense | find /i "RUNNING" %nul% && (
|
||||||
|
echo Installed Antivirus - Microsoft Defender for Endpoint
|
||||||
|
)
|
||||||
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 ', '))}"""
|
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 ', '))}"""
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
@ -275,7 +305,9 @@ set terminal=
|
||||||
|
|
||||||
if defined terminal (
|
if defined terminal (
|
||||||
set lines=0
|
set lines=0
|
||||||
for /f "skip=2 tokens=2 delims=: " %%A in ('mode con') do if "!lines!"=="0" set lines=%%A
|
for /f "skip=3 tokens=* delims=" %%A in ('mode con') do if "!lines!"=="0" (
|
||||||
|
for %%B in (%%A) do set lines=%%B
|
||||||
|
)
|
||||||
if !lines! GEQ 100 set terminal=
|
if !lines! GEQ 100 set terminal=
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
@ -586,7 +618,7 @@ call :dk_color %Blue% "Rebuilding ClipSVC Licenses..."
|
||||||
echo:
|
echo:
|
||||||
|
|
||||||
if %winbuild% LSS 10240 (
|
if %winbuild% LSS 10240 (
|
||||||
echo ClipSVC license rebuilding is supported only on Windows 10/11 and their Server equivalents.
|
echo ClipSVC license rebuilding is supported only on Windows 10/11.
|
||||||
echo Skipping...
|
echo Skipping...
|
||||||
goto :rebuildspptok
|
goto :rebuildspptok
|
||||||
)
|
)
|
||||||
|
|
@ -597,6 +629,40 @@ echo Skipping...
|
||||||
goto :rebuildspptok
|
goto :rebuildspptok
|
||||||
)
|
)
|
||||||
|
|
||||||
|
set _partial=
|
||||||
|
set _keymatch=
|
||||||
|
for /f "tokens=2 delims==" %%# in ('%psc% "(([WMISEARCHER]'SELECT PartialProductKey FROM SoftwareLicensingProduct WHERE ApplicationID=''55c92734-d682-4d71-983e-d6ec3f16059f'' AND PartialProductKey IS NOT NULL AND LicenseDependsOn is NULL').Get()).PartialProductKey | %% {echo ('PartialProductKey='+$_)}" %nul6%') do set "_partial=%%#"
|
||||||
|
for %%# in (8HV2C QPFCT 3V66T PKCKT WXCHW 8TYMD 6F4BT 8HVX7 KD72Y 7CFBY DRR8H P39PB DYJWX MDWWW 9HKR4 M7V2X 2YV77 WT2RQ MHBPB QPF8P 2YV66 VMJ2C DJ4F6 CKFFD YY74H J8JXD BHDCD T6R4W D32MH RRK69 3PJBP) do if /i "%_partial%"=="%%#" set _keymatch=1
|
||||||
|
|
||||||
|
if not defined _keymatch (
|
||||||
|
echo HWID activation key is not installed.
|
||||||
|
echo Skipping...
|
||||||
|
goto :rebuildspptok
|
||||||
|
)
|
||||||
|
|
||||||
|
%psc% "If([Activator]::CreateInstance([Type]::GetTypeFromCLSID([Guid]'{DCB00C01-570F-4A9B-8D69-199FDBA5723B}')).IsConnectedToInternet){Exit 0}Else{Exit 1}"
|
||||||
|
if errorlevel 1 (
|
||||||
|
echo Internet is not connected.
|
||||||
|
echo Skipping...
|
||||||
|
goto :rebuildspptok
|
||||||
|
)
|
||||||
|
|
||||||
|
set resfail=
|
||||||
|
for %%# in (
|
||||||
|
licensing.mp.microsoft.com/v7.0/licenses/content
|
||||||
|
login.live.com/ppsecure/deviceaddcredential.srf
|
||||||
|
purchase.mp.microsoft.com/v7.0/users/me/orders
|
||||||
|
) do if not defined resfail (
|
||||||
|
%psc% "try { [Net.ServicePointManager]::SecurityProtocol=[Net.SecurityProtocolType]::Tls12; irm https://%%# -Method POST } catch { if ($_.Exception.Response -eq $null) { Write-Host """"[%%#] $($_.Exception.Message)"""" -ForegroundColor Red -BackgroundColor Black; exit 3 } }"
|
||||||
|
if !errorlevel!==3 set resfail=1
|
||||||
|
)
|
||||||
|
|
||||||
|
if defined resfail (
|
||||||
|
echo Failed to connect to licensing servers.
|
||||||
|
echo Skipping...
|
||||||
|
goto :rebuildspptok
|
||||||
|
)
|
||||||
|
|
||||||
echo Stopping ClipSVC service...
|
echo Stopping ClipSVC service...
|
||||||
%psc% Stop-Service ClipSVC -force %nul%
|
%psc% Stop-Service ClipSVC -force %nul%
|
||||||
timeout /t 2 %nul%
|
timeout /t 2 %nul%
|
||||||
|
|
@ -691,6 +757,25 @@ echo:
|
||||||
call :dk_color %Blue% "Rebuilding SPP licensing tokens..."
|
call :dk_color %Blue% "Rebuilding SPP licensing tokens..."
|
||||||
echo:
|
echo:
|
||||||
|
|
||||||
|
echo Clearing KMS Cache...
|
||||||
|
echo:
|
||||||
|
call :_taskclear-cache
|
||||||
|
|
||||||
|
%nul% reg query "HKLM\%SPPk%\%_wApp%" && (
|
||||||
|
echo Removing KMS38 protection...
|
||||||
|
%psc% "$f=[System.IO.File]::ReadAllText('!_batp!') -split ':regdel\:.*';. ([scriptblock]::Create($f[1]))"
|
||||||
|
%nul% reg delete "HKLM\%SPPk%\%_wApp%" /f
|
||||||
|
%nul% reg query "HKLM\%SPPk%\%_wApp%" && (
|
||||||
|
call :dk_color %Red% "Failed to remove KMS38 protection."
|
||||||
|
) || (
|
||||||
|
echo Successfully removed KMS38 protection.
|
||||||
|
echo Successfully cleared KMS Cache.
|
||||||
|
)
|
||||||
|
) || (
|
||||||
|
echo Successfully cleared KMS Cache.
|
||||||
|
)
|
||||||
|
echo:
|
||||||
|
|
||||||
call :scandat check
|
call :scandat check
|
||||||
|
|
||||||
if not defined token (
|
if not defined token (
|
||||||
|
|
@ -716,7 +801,7 @@ echo Checking SPP permission related issues...
|
||||||
call :checkperms
|
call :checkperms
|
||||||
if defined permerror (
|
if defined permerror (
|
||||||
call :dk_color %Red% "[!permerror!]"
|
call :dk_color %Red% "[!permerror!]"
|
||||||
%psc% "$f=[io.file]::ReadAllText('!_batp!') -split ':fixsppperms\:.*';iex ($f[1])" %nul%
|
%psc% "$f=[System.IO.File]::ReadAllText('!_batp!') -split ':fixsppperms\:.*';. ([scriptblock]::Create($f[1]))" %nul%
|
||||||
call :checkperms
|
call :checkperms
|
||||||
if defined permerror (
|
if defined permerror (
|
||||||
call :dk_color %Red% "[!permerror!] [Failed To Fix]"
|
call :dk_color %Red% "[!permerror!] [Failed To Fix]"
|
||||||
|
|
@ -786,8 +871,8 @@ if defined _vis (
|
||||||
|
|
||||||
echo:
|
echo:
|
||||||
echo Reinstalling system licenses...
|
echo Reinstalling system licenses...
|
||||||
%psc% "$sls = Get-WmiObject SoftwareLicensingService; $f=[io.file]::ReadAllText('!_batp!') -split ':xrm\:.*';iex ($f[1]); ReinstallLicenses" %nul%
|
%psc% "$sls = Get-WmiObject SoftwareLicensingService; $f=[System.IO.File]::ReadAllText('!_batp!') -split ':xrm\:.*';. ([scriptblock]::Create($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% NEQ 0 %psc% "$sls = Get-WmiObject SoftwareLicensingService; $f=[System.IO.File]::ReadAllText('!_batp!') -split ':xrm\:.*';. ([scriptblock]::Create($f[1])); ReinstallLicenses" %nul%
|
||||||
if %errorlevel% EQU 0 (
|
if %errorlevel% EQU 0 (
|
||||||
echo [Successful]
|
echo [Successful]
|
||||||
) else (
|
) else (
|
||||||
|
|
@ -893,8 +978,8 @@ for /f "skip=2 tokens=2*" %%a in ('"reg query %_68%\16.0\Common\InstallRoot /v P
|
||||||
|
|
||||||
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 %_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)
|
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)
|
||||||
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 "c2r16_86=Office 16.0 C2R x86" & call :getc2rrepair c2r16repair86 OfficeClickToRun.exe)
|
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 "c2r16_86=Office 16.0 C2R x86" & call :getc2r16repair c2r16repair86 OfficeClickToRun.exe)
|
||||||
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 "c2r16_68=Office 16.0 C2R x86/x64" & call :getc2rrepair c2r16repair68 OfficeClickToRun.exe)
|
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 "c2r16_68=Office 16.0 C2R x86/x64" & call :getc2r16repair c2r16repair68 OfficeClickToRun.exe)
|
||||||
|
|
||||||
set uwp16=
|
set uwp16=
|
||||||
if %winbuild% GEQ 10240 (
|
if %winbuild% GEQ 10240 (
|
||||||
|
|
@ -936,13 +1021,11 @@ echo ________________________________________________________________
|
||||||
echo:
|
echo:
|
||||||
)
|
)
|
||||||
|
|
||||||
if %counter% EQU 0 (
|
|
||||||
echo:
|
echo:
|
||||||
|
if %counter% EQU 0 (
|
||||||
echo Office ^(2010 and later^) is not installed.
|
echo Office ^(2010 and later^) is not installed.
|
||||||
goto :repairend
|
goto :repairend
|
||||||
echo:
|
) else if not defined c2r16_68 if not defined c2r16_86 (
|
||||||
) else (
|
|
||||||
echo:
|
|
||||||
call :dk_color %_Yellow% "A new window will appear, in that window you need to select [Quick Repair] option."
|
call :dk_color %_Yellow% "A new window will appear, in that window you need to select [Quick Repair] option."
|
||||||
if defined terminal (
|
if defined terminal (
|
||||||
call :dk_color %_Yellow% "Press [0] to continue..."
|
call :dk_color %_Yellow% "Press [0] to continue..."
|
||||||
|
|
@ -969,16 +1052,16 @@ echo Skipping repair for Office 14.0 C2R...
|
||||||
echo:
|
echo:
|
||||||
)
|
)
|
||||||
|
|
||||||
if defined msi14_68 if exist "%msi14repair68%" echo Running - "%msi14repair68%" & "%msi14repair68%"
|
if defined msi14_68 if exist "%msi14repair68%" echo Running - "%msi14repair68%" & "%msi14repair68%"
|
||||||
if defined msi14_86 if exist "%msi14repair86%" echo Running - "%msi14repair86%" & "%msi14repair86%"
|
if defined msi14_86 if exist "%msi14repair86%" echo Running - "%msi14repair86%" & "%msi14repair86%"
|
||||||
if defined msi15_68 if exist "%msi15repair68%" echo Running - "%msi15repair68%" & "%msi15repair68%"
|
if defined msi15_68 if exist "%msi15repair68%" echo Running - "%msi15repair68%" & "%msi15repair68%"
|
||||||
if defined msi15_86 if exist "%msi15repair86%" echo Running - "%msi15repair86%" & "%msi15repair86%"
|
if defined msi15_86 if exist "%msi15repair86%" echo Running - "%msi15repair86%" & "%msi15repair86%"
|
||||||
if defined msi16_68 if exist "%msi16repair68%" echo Running - "%msi16repair68%" & "%msi16repair68%"
|
if defined msi16_68 if exist "%msi16repair68%" echo Running - "%msi16repair68%" & "%msi16repair68%"
|
||||||
if defined msi16_86 if exist "%msi16repair86%" echo Running - "%msi16repair86%" & "%msi16repair86%"
|
if defined msi16_86 if exist "%msi16repair86%" echo Running - "%msi16repair86%" & "%msi16repair86%"
|
||||||
if defined c2r15_68 if exist "%c2r15repair68%" echo Running - "%c2r15repair68%" REPAIRUI RERUNMODE & "%c2r15repair68%" REPAIRUI RERUNMODE
|
if defined c2r15_68 if exist "%c2r15repair68%" echo Running - "%c2r15repair68%" REPAIRUI RERUNMODE & "%c2r15repair68%" REPAIRUI RERUNMODE
|
||||||
if defined c2r15_86 if exist "%c2r15repair86%" echo Running - "%c2r15repair86%" REPAIRUI RERUNMODE & "%c2r15repair86%" REPAIRUI RERUNMODE
|
if defined c2r15_86 if exist "%c2r15repair86%" echo Running - "%c2r15repair86%" REPAIRUI RERUNMODE & "%c2r15repair86%" REPAIRUI RERUNMODE
|
||||||
if defined c2r16_68 if exist "%c2r16repair68%" echo Running - "%c2r16repair68%" scenario=Repair & "%c2r16repair68%" scenario=Repair
|
if defined c2r16_68 if exist "%c2r16repair68%" echo Running - "%c2r16repair68%" Scenario=Repair RepairType=QuickRepair & "%c2r16repair68%" Scenario=Repair RepairType=QuickRepair
|
||||||
if defined c2r16_86 if exist "%c2r16repair86%" echo Running - "%c2r16repair86%" scenario=Repair & "%c2r16repair86%" scenario=Repair
|
if defined c2r16_86 if exist "%c2r16repair86%" echo Running - "%c2r16repair86%" Scenario=Repair RepairType=QuickRepair & "%c2r16repair86%" Scenario=Repair RepairType=QuickRepair
|
||||||
|
|
||||||
:repairend
|
:repairend
|
||||||
|
|
||||||
|
|
@ -998,6 +1081,13 @@ set "%1=%systemdrive%\Program Files\Microsoft Office 15\Client%%#\%2"
|
||||||
)
|
)
|
||||||
exit /b
|
exit /b
|
||||||
|
|
||||||
|
:getc2r16repair
|
||||||
|
|
||||||
|
for %%# in (%_68% %_86%) do (
|
||||||
|
for /f "skip=2 tokens=2*" %%a in ('"reg query %%#\ClickToRun\Configuration /v ClientFolder" %nul6%') do if exist "%%b\%2" (set "%1=%%b\%2")
|
||||||
|
)
|
||||||
|
exit /b
|
||||||
|
|
||||||
:getrepairsetup
|
:getrepairsetup
|
||||||
|
|
||||||
set "_common86=%systemdrive%\Program Files (x86)\Common Files\Microsoft Shared\OFFICE%2\Office Setup Controller\setup.exe"
|
set "_common86=%systemdrive%\Program Files (x86)\Common Files\Microsoft Shared\OFFICE%2\Office Setup Controller\setup.exe"
|
||||||
|
|
@ -1254,6 +1344,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
|
||||||
|
|
||||||
|
::========================================================================================================================================
|
||||||
|
|
||||||
:: Fix SPP related registry and folder permissions
|
:: Fix SPP related registry and folder permissions
|
||||||
|
|
||||||
:fixsppperms:
|
:fixsppperms:
|
||||||
|
|
@ -1433,7 +1576,7 @@ exit /b
|
||||||
|
|
||||||
:regownstart
|
:regownstart
|
||||||
|
|
||||||
%psc% "$f=[io.file]::ReadAllText('!_batp!') -split ':regown\:.*';iex ($f[1]);"
|
%psc% "$f=[System.IO.File]::ReadAllText('!_batp!') -split ':regown\:.*';. ([scriptblock]::Create($f[1]));"
|
||||||
exit /b
|
exit /b
|
||||||
|
|
||||||
:: Below code takes ownership of a volatile registry key and deletes it
|
:: Below code takes ownership of a volatile registry key and deletes it
|
||||||
|
|
@ -1465,6 +1608,36 @@ $key.SetAccessControl($acl)
|
||||||
|
|
||||||
::========================================================================================================================================
|
::========================================================================================================================================
|
||||||
|
|
||||||
|
:: This code runs to undo below registry key KMS38 protection
|
||||||
|
:: HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\SoftwareProtectionPlatform\55c92734-d682-4d71-983e-d6ec3f16059f
|
||||||
|
|
||||||
|
:: This option is not used in KMS38 anymore, it's here only to remove previous versions protection.
|
||||||
|
|
||||||
|
:regdel:
|
||||||
|
param (
|
||||||
|
[switch]$protect
|
||||||
|
)
|
||||||
|
|
||||||
|
$SID = New-Object System.Security.Principal.SecurityIdentifier('S-1-5-32-544')
|
||||||
|
$Admin = ($SID.Translate([System.Security.Principal.NTAccount])).Value
|
||||||
|
|
||||||
|
if($protect) {
|
||||||
|
$ruleArgs = @("$Admin", "Delete, SetValue", "ContainerInherit", "None", "Deny")
|
||||||
|
} else {
|
||||||
|
$ruleArgs = @("$Admin", "FullControl", "Allow")
|
||||||
|
}
|
||||||
|
|
||||||
|
$path = 'SOFTWARE\Microsoft\Windows NT\CurrentVersion\SoftwareProtectionPlatform\55c92734-d682-4d71-983e-d6ec3f16059f'
|
||||||
|
$key = [Microsoft.Win32.RegistryKey]::OpenBaseKey('LocalMachine', 'Registry64').OpenSubKey($path, 'ReadWriteSubTree', 'ChangePermissions')
|
||||||
|
$acl = $key.GetAccessControl()
|
||||||
|
|
||||||
|
$rule = [System.Security.AccessControl.RegistryAccessRule]::new.Invoke($ruleArgs)
|
||||||
|
$acl.ResetAccessRule($rule)
|
||||||
|
$key.SetAccessControl($acl)
|
||||||
|
:regdel:
|
||||||
|
|
||||||
|
::========================================================================================================================================
|
||||||
|
|
||||||
:dk_color
|
:dk_color
|
||||||
|
|
||||||
if %_NCS% EQU 1 (
|
if %_NCS% EQU 1 (
|
||||||
|
|
@ -1521,7 +1694,7 @@ exit /b
|
||||||
set ps=%SysPath%\WindowsPowerShell\v1.0\powershell.exe
|
set ps=%SysPath%\WindowsPowerShell\v1.0\powershell.exe
|
||||||
set psc=%ps% -nop -c
|
set psc=%ps% -nop -c
|
||||||
set winbuild=1
|
set winbuild=1
|
||||||
for /f "tokens=6 delims=[]. " %%G in ('ver') do set winbuild=%%G
|
for /f "tokens=2 delims=[]" %%G in ('ver') do for /f "tokens=2,3,4 delims=. " %%H in ("%%~G") do set "winbuild=%%J"
|
||||||
|
|
||||||
set _slexe=sppsvc.exe& set _slser=sppsvc
|
set _slexe=sppsvc.exe& set _slser=sppsvc
|
||||||
if %winbuild% LEQ 6300 (set _slexe=SLsvc.exe& set _slser=SLsvc)
|
if %winbuild% LEQ 6300 (set _slexe=SLsvc.exe& set _slser=SLsvc)
|
||||||
|
|
|
||||||
71
README.md
71
README.md
|
|
@ -2,48 +2,50 @@
|
||||||
|
|
||||||
<h1 align="center">Microsoft Activation Scripts (MAS)</h1>
|
<h1 align="center">Microsoft Activation Scripts (MAS)</h1>
|
||||||
|
|
||||||
<p align="center">Open-source Windows and Office activator featuring HWID, Ohook, TSforge, KMS38, and Online KMS activation methods, along with advanced troubleshooting.</p>
|
<p align="center">Open-source Windows and Office activator featuring HWID, Ohook, TSforge, and Online KMS activation methods, along with advanced troubleshooting.</p>
|
||||||
|
|
||||||
<hr>
|
<hr>
|
||||||
|
|
||||||
## How to Activate Windows / Office?
|
## How to Activate Windows / Office / Extended Updates (ESU)?
|
||||||
|
|
||||||
### Method 1 - PowerShell (Windows 8 and later) ❤️
|
### Method 1 - PowerShell ❤️
|
||||||
|
|
||||||
1. **Open PowerShell**
|
1. **Open PowerShell**
|
||||||
To do that, press the Windows key + X, then select PowerShell or Terminal.
|
Click the **Start Menu**, type `PowerShell`, then open it.
|
||||||
|
|
||||||
2. **Copy and paste the code below, then press enter.**
|
2. **Copy and paste the code below, then press enter.**
|
||||||
```
|
- For **Windows 8, 10, 11**: 📌
|
||||||
irm https://get.activated.win | iex
|
```
|
||||||
```
|
irm https://get.activated.win | iex
|
||||||
Alternatively, you can use the following (this will be deprecated in the future):
|
```
|
||||||
```
|
If the above is blocked (by ISP/DNS), try this (needs updated Windows 10 or 11):
|
||||||
irm https://massgrave.dev/get | iex
|
```
|
||||||
```
|
iex (curl.exe -s --doh-url https://1.1.1.1/dns-query https://get.activated.win | Out-String)
|
||||||
|
```
|
||||||
|
- For **Windows 7** and later:
|
||||||
|
```
|
||||||
|
iex ((New-Object Net.WebClient).DownloadString('https://get.activated.win'))
|
||||||
|
```
|
||||||
|
- **Script not launching❓Use the below-listed Method 2.**
|
||||||
|
|
||||||
3. You will see the activation options. Choose the activation options highlighted in green.
|
3. The activation menu will appear. **Choose the green-highlighted options** to activate Windows or Office.
|
||||||
|
|
||||||
4. That's all
|
4. **Done!**
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
### Method 2 - Traditional (Windows Vista and later)
|
### Method 2 - Traditional (Windows Vista and later)
|
||||||
|
|
||||||
<details>
|
1. Download the script: [**MAS_AIO.cmd**](https://dev.azure.com/massgrave/Microsoft-Activation-Scripts/_apis/git/repositories/Microsoft-Activation-Scripts/items?path=/MAS/All-In-One-Version-KL/MAS_AIO.cmd&download=true) or the [full ZIP](https://dev.azure.com/massgrave/Microsoft-Activation-Scripts/_apis/git/repositories/Microsoft-Activation-Scripts/items?$format=zip).
|
||||||
<summary>Click here to view</summary>
|
2. Run the file named `MAS_AIO.cmd`.
|
||||||
|
3. You will see the activation options. Follow the on-screen instructions.
|
||||||
|
4. That's all.
|
||||||
|
|
||||||
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.
|
|
||||||
|
|
||||||
</details>
|
> [!TIP]
|
||||||
|
> - Some ISPs/DNS block access to our domains. You can bypass this by enabling [DNS-over-HTTPS (DoH)](https://developers.cloudflare.com/1.1.1.1/encryption/dns-over-https/encrypted-dns-browsers/) in your browser.
|
||||||
|
> - **Having trouble**❓Visit our [troubleshooting page](https://massgrave.dev/troubleshoot) or raise an issue on [GitHub](https://github.com/massgravel/Microsoft-Activation-Scripts/issues).
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
|
|
@ -52,14 +54,6 @@ or
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
### 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]
|
> [!NOTE]
|
||||||
>
|
>
|
||||||
> - The IRM command in PowerShell downloads a script from a specified URL, and the IEX command executes it.
|
> - The IRM command in PowerShell downloads a script from a specified URL, and the IEX command executes it.
|
||||||
|
|
@ -69,8 +63,8 @@ or
|
||||||
---
|
---
|
||||||
|
|
||||||
```
|
```
|
||||||
Latest Version: 3.4
|
Latest Version: 3.9
|
||||||
Release date: 3-June-2025
|
Release date: 19-Nov-2025
|
||||||
```
|
```
|
||||||
|
|
||||||
### [Troubleshooting / Help](https://massgrave.dev/troubleshoot)
|
### [Troubleshooting / Help](https://massgrave.dev/troubleshoot)
|
||||||
|
|
@ -105,7 +99,7 @@ Release date: 3-June-2025
|
||||||
|
|
||||||
[1]: https://github.com/massgravel/Microsoft-Activation-Scripts
|
[1]: https://github.com/massgravel/Microsoft-Activation-Scripts
|
||||||
[2]: https://dev.azure.com/massgrave/_git/Microsoft-Activation-Scripts
|
[2]: https://dev.azure.com/massgrave/_git/Microsoft-Activation-Scripts
|
||||||
[3]: https://git.activated.win/massgrave/Microsoft-Activation-Scripts
|
[3]: https://git.activated.win/Microsoft-Activation-Scripts
|
||||||
[4]: https://discord.gg/j2yFsV5ZVC
|
[4]: https://discord.gg/j2yFsV5ZVC
|
||||||
[5]: https://www.reddit.com/r/MAS_Activator
|
[5]: https://www.reddit.com/r/MAS_Activator
|
||||||
[6]: https://bsky.app/profile/massgrave.dev
|
[6]: https://bsky.app/profile/massgrave.dev
|
||||||
|
|
@ -114,3 +108,4 @@ Release date: 3-June-2025
|
||||||
---
|
---
|
||||||
|
|
||||||
<p align="center">Made with Love ❤️</p>
|
<p align="center">Made with Love ❤️</p>
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue