Compare commits

..

19 Commits

Author SHA1 Message Date
WindowsAddict a9c2f58741 export-ignore 2025-09-10 04:18:00 +05:30
WindowsAddict 79012c7db0 3.6 2025-09-10 04:16:01 +05:30
WindowsAddict caffa62abe Fixed an issue with TSforge caused by updated pkeyconfig on 22631.5840. Thanks to WitherOrNot for the fix. 2025-09-10 01:44:23 +05:30
WindowsAddict a8f6d051a6 Change TSforge to use StaticCID only on build 26100 and above 2025-09-10 00:57:04 +05:30
WindowsAddict 6022b6de10 Use ComObject instead of Get-ScheduledTask for more reliability, improve info 2025-09-10 00:33:30 +05:30
WindowsAddict 4ea26906cd Add Outlook 2010 Retail key, thanks to celestial_tiger_98134 2025-09-06 03:09:24 +05:30
WindowsAddict 564aad78b4 Evade detection 2025-09-06 02:34:53 +05:30
WindowsAddict d5e382e763 Revert export-ignore 2025-08-11 02:48:26 +05:30
WindowsAddict 793550725a export-ignore 2025-08-11 02:36:40 +05:30
WindowsAddict 3917497c82 3.5 2025-08-11 02:29:59 +05:30
WindowsAddict 28c2264d89 Change arg to detect no relaunch to change process 2025-08-11 01:39:53 +05:30
WindowsAddict a51ae62332 Update README, don't relaunch if unattended mode found 2025-08-10 17:22:28 +05:30
WindowsAddict ffcb641f17 Fix a typo 2025-08-08 22:14:21 +05:30
WindowsAddict 53a2747338 Fix redirection issue on W10 ARM64 2025-08-07 17:43:26 +05:30
WindowsAddict 3a99ea4eeb Fix build version detection on XP and older 2025-08-07 02:43:05 +05:30
WindowsAddict e6eaeaa682 Detect vnext license and show info 2025-08-07 01:50:09 +05:30
WindowsAddict e2c52b4ac8 Some more minor changes 2025-08-04 21:30:05 +05:30
WindowsAddict 31c47b9538 Minor changes 2025-08-04 21:03:49 +05:30
WindowsAddict 904e96d748 Check .NET corruption 2025-08-04 02:05:13 +05:30
12 changed files with 637 additions and 218 deletions
+3 -3
View File
@@ -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
+150 -64
View File
@@ -1,18 +1,18 @@
@::yfh37fow-random
@set masver=3.4
@::r45f3r3-random
@set masver=3.6
@setlocal DisableDelayedExpansion
@echo off
:: For command line switches, check mass<>grave<.>dev/command_line_switches
:: For command line switches, check mass()grave(dot)dev/command_line_switches
:: If you want to better understand script, read from separate files version.
::============================================================================
::
:: Homepage: mass<>grave<.>dev
:: Homepage: mass()grave(dot)dev
:: Email: mas.help@outlook.com
::
::============================================================================
@@ -44,6 +44,7 @@ set "_cmdf=%~f0"
for %%# in (%*) do (
if /i "%%#"=="re1" set re1=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
@@ -249,6 +250,9 @@ 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...
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
)
@@ -263,13 +267,26 @@ call :dk_color2 %Blue% "Check this webpage for help - " %_Yellow% " %mas%remove_
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
echo PowerShell is not working properly. Aborting...
if /i "!tstresult2!"=="FullLanguage" (
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
@@ -958,7 +975,9 @@ call :dk_color %Red% "Checking Ticket Migration [Failed]"
if not defined altapplist if not defined showfix if defined rebuildinfo (
set showfix=1
echo:
call :dk_color %Blue% "%_fixmsg%"
echo:
)
if exist "%tdir%\Genuine*" del /f /q "%tdir%\Genuine*" %nul%
@@ -1028,8 +1047,10 @@ licensing.mp.microsoft.com
findstr /i "%%#" "%SysPath%\drivers\etc\hosts" %nul1% && set "hosfail= [%%# Blocked in Hosts]"
)
call :dk_color %Red% "Checking Licensing Servers [Failed to Connect]!hosfail!"
echo:
set fixes=%fixes% %mas%licensing-servers-issue
call :dk_color2 %Blue% "Check this webpage for help - " %_Yellow% " %mas%licensing-servers-issue"
echo:
)
::==========================================================================================================================================
@@ -1042,13 +1063,17 @@ reg query "HKLM\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate" /v DisableWin
reg query "HKLM\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate" /v DoNotConnectToWindowsUpdateInternetLocations %nul2% | find /i "0x1" %nul% && set wublock=1
if defined wublock (
call :dk_color %Red% "Checking Update Blocker In Registry [Found]"
echo:
call :dk_color %Blue% "HWID activation needs working Windows updates, if you have used any tool to block updates, undo it."
echo:
)
reg query "HKLM\SOFTWARE\Policies\Microsoft\WindowsStore" /v DisableStoreApps %nul2% | find /i "0x1" %nul% && (
set storeblock=1
call :dk_color %Red% "Checking Store Blocker In Registry [Found]"
echo:
call :dk_color %Blue% "If you have used any tool to block Store, undo it."
echo:
)
set wcount=0
@@ -1065,10 +1090,14 @@ set error=1
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."
echo:
set fixes=%fixes% %mas%remove_mal%w%ware
call :dk_color2 %Blue% "Check this webpage for help - " %_Yellow% " %mas%remove_mal%w%ware"
echo:
) else (
echo:
call :dk_color %Blue% "HWID activation needs working Windows updates, if you have used any tool to block updates, undo it."
echo:
)
) else (
%psc% "Start-Job { Start-Service wuauserv } | Wait-Job -Timeout 20 | Out-Null"
@@ -1077,7 +1106,9 @@ set error=1
set wuerror=1
sc start wuauserv %nul%
call :dk_color %Red% "Starting Windows Update Service [Failed] [!errorlevel!]"
echo:
call :dk_color %Blue% "HWID activation needs working Windows updates, if you have used any tool to block updates, undo it."
echo:
)
)
)
@@ -1090,8 +1121,10 @@ if %keyerror% EQU 0 if not defined _perm if defined _int (
if not defined wucorrupt if not defined wublock if not defined wuerror if not defined storeblock if not defined resfail (
echo "%error_code%" | findstr /i "0x80072e 0x80072f 0x800704cf 0x87e10bcf 0x800705b4" %nul% && (
call :dk_color %Red% "Checking Internet Issues [Found] %error_code%"
echo:
set fixes=%fixes% %mas%licensing-servers-issue
call :dk_color2 %Blue% "Check this webpage for help - " %_Yellow% " %mas%licensing-servers-issue"
echo:
)
)
)
@@ -1146,7 +1179,7 @@ goto :dk_done
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
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
if %winbuild% LEQ 6300 (set _slexe=SLsvc.exe& set _slser=SLsvc)
@@ -1298,9 +1331,11 @@ if %sps%==SoftwareLicensingService call :dk_refresh
echo %keyecho% %~1 [Successful]
) else (
call :dk_color %Red% "%keyecho% %~1 [Failed] %keyerror%"
if not defined error (
if not defined showfix (
if defined altapplist call :dk_color %Red% "Activation ID not found for this key."
echo:
call :dk_color %Blue% "%_fixmsg%"
echo:
set showfix=1
)
set error=1
@@ -1517,6 +1552,7 @@ 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%"&set showfix=1)
echo:
set fixes=%fixes% %mas%remove_mal%w%ware
call :dk_color2 %Blue% "Check this webpage for help - " %_Yellow% " %mas%remove_mal%w%ware"
echo:
@@ -1623,7 +1659,7 @@ sc start %%# %nul%
if !errorlevel! EQU 1060 set _corrupt=1
sc query %%# %nul% || set _corrupt=1
for %%G in (DependOnService Description DisplayName ErrorControl ImagePath ObjectName Start Type) do if not defined _regcorr (
reg query HKLM\SYSTEM\CurrentControlSet\Services\%%# /v %%G %nul% || (set _corrupt=1&set _regcorr="-RegistryError" )
reg query HKLM\SYSTEM\CurrentControlSet\Services\%%# /v %%G %nul% || (set _corrupt=1&set _regcorr=-RegistryError)
)
if defined _corrupt (if defined serv_cor (set "serv_cor=!serv_cor! %%#!_regcorr!") else (set "serv_cor=%%#!_regcorr!"))
@@ -1949,7 +1985,7 @@ cmd /c exit /b %error_code%
if %error_code% NEQ 0 set "error_code=0x%=ExitCode%"
if %error_code% NEQ 0 (
call :dk_color %Red% "Checking SoftwareLicensingService [Not Working] %error_code%"
call :dk_color %Red% "Checking SoftwareLicensingService [Not Working] [%error_code%]"
if not defined showfix (
echo:
call :dk_color %Blue% "%_fixmsg%"
@@ -1968,6 +2004,7 @@ 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=[System.IO.File]::ReadAllText('!_batp!') -split ':xrm\:.*';. ([scriptblock]::Create($f[1])); ReinstallLicenses" %nul%
if not defined _vis if !errorlevel! NEQ 0 set rlicfailed=1
call :dk_actid 55c92734-d682-4d71-983e-d6ec3f16059f
)
@@ -1989,6 +2026,13 @@ set error=1
set showfix=1
)
if not defined showfix if defined rlicfailed (
echo:
call :dk_color %Blue% "%_fixmsg%"
call :dk_color %Blue% "If activation still fails then run Fix WPA Registry option."
echo:
)
if %winbuild% GEQ 7600 if exist "%tokenstore%\" if not exist "%tokenstore%\tokens.dat" (
call :dk_color %Red% "Checking SPP tokens.dat [Not Found] [%tokenstore%\]"
)
@@ -2127,19 +2171,22 @@ call :dk_color %Gray% "Checking SkipRearm [Default 0 Value
if %winbuild% GEQ 9200 if not exist "%SystemRoot%\Servicing\Packages\Microsoft-Windows-*EvalEdition~*.mum" (
%psc% "Get-WmiObject -Query 'SELECT Description FROM SoftwareLicensingProduct WHERE PartialProductKey IS NOT NULL AND LicenseDependsOn IS NULL' | Select-Object -Property Description" %nul2% | findstr /i "KMS_" %nul1% || (
for /f "delims=" %%a in ('%psc% "(Get-ScheduledTask -TaskName 'SvcRestartTask' -TaskPath '\Microsoft\Windows\SoftwareProtectionPlatform\').State" %nul6%') do (set taskinfo=%%a)
for /f "delims=" %%a in ('%psc% "$s=New-Object -ComObject 'Schedule.Service'; $s.Connect(); $state=$s.GetFolder('\Microsoft\Windows\SoftwareProtectionPlatform').GetTask('SvcRestartTask').State; @{0='Unknown';1='Disabled';2='Queued';3='Ready';4='Running'}[$state]" %nul6%') do (set taskinfo=%%a)
echo !taskinfo! | find /i "Ready" %nul% || (
reg delete "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\SoftwareProtectionPlatform" /v "actionlist" /f %nul%
reg query "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Schedule\TaskCache\Tree\Microsoft\Windows\SoftwareProtectionPlatform\SvcRestartTask" %nul% || set taskinfo=Removed
if "!taskinfo!"=="" set "taskinfo=Not Found"
call :dk_color %Red% "Checking SvcRestartTask Status [!taskinfo!, system might deactivate later]"
call :dk_color %Gray% "Checking SvcRestartTask Status [!taskinfo!. System might deactivate later.]"
if not defined showfix (
echo:
echo "!taskinfo!" | findstr /i "Removed Not Found" %nul1% && (
set fixes=%fixes% %mas%in-place_repair_upgrade
call :dk_color2 %Blue% "Check this webpage for help - " %_Yellow% " %mas%in-place_repair_upgrade"
) || (
call :dk_color %Blue% "Reboot your machine using the restart option and run the script again."
set fixes=%fixes% %mas%troubleshoot
call :dk_color2 %Blue% "Check this webpage for help - " %_Yellow% " %mas%troubleshoot"
)
echo:
)
)
@@ -2257,7 +2304,7 @@ exit /b
:: 2nd column = Generic Retail/OEM/MAK Key
:: 3rd column = SKU ID
:: 4th column = Key part number
:: 5th column = Ticket signature value. It's as it is, it's not encoded. (Check mass<>grave<.>dev/hwid#manual-activation to see how it's generated)
:: 5th column = Ticket signature value. It's as it is, it's not encoded. (Check mass()grave(dot)dev/hwid#manual-activation to see how it's generated)
:: 6th column = 1 = activation is not working (at the time of writing this), 0 = activation is working
:: 7th column = Key Type
:: 8th column = WMI Edition ID (For reference only)
@@ -2719,7 +2766,7 @@ call :dk_color %Gray% "Checking Old Office With Sub License [Found. Update Of
::========================================================================================================================================
:: mass<>grave<.>dev/office-license-is-not-genuine
:: mass()grave(dot)dev/office-license-is-not-genuine
:: Add registry keys for volume products so that 'non-genuine' banner won't appear
:: Script already is using MAK instead of GVLK so it won't appear anyway, but registry keys are added incase Office installs default GVLK grace key for volume products
@@ -2761,7 +2808,7 @@ if defined ohub call :dk_color %Gray% "Office apps such as Word, Excel are activ
echo Help: %mas%troubleshoot
) else (
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%"
if not defined ierror if not defined showfix call :dk_color %Blue% "%_fixmsg%"
echo:
set fixes=%fixes% %mas%troubleshoot
call :dk_color2 %Blue% "Check this webpage for help - " %_Yellow% " %mas%troubleshoot"
@@ -3466,10 +3513,12 @@ call :dk_color %Gray% "Checking Total User Accounts [%counter%]"
:: Clear the vNext/shared/device license blocks which may prevent ohook activation
set vnextexist=
rmdir /s /q "%ProgramData%\Microsoft\Office\Licenses\" %nul%
for %%x in (15 16) do (
for %%# in (%_sidlist%) do (
reg query HKU\%%#\Software\Microsoft\Office\%%x.0\Common\Licensing /s %nul2% | findstr /i "CIDToLicenseIdsMapping LicenseIdToEmailMapping @" %nul% && set vnextexist=1
reg delete HKU\%%#\Software\Microsoft\Office\%%x.0\Common\Licensing /f %nul%
for /f "skip=2 tokens=2*" %%a in ('"reg query "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\ProfileList\%%#" /v ProfileImagePath" %nul6%') do (
@@ -3492,6 +3541,7 @@ rmdir /s /q "%%b\AppData\Local\Packages\Microsoft.Office.Desktop_8wekyb3d8bbwe\L
if exist "%%b\AppData\Local\Packages\Microsoft.Office.Desktop_8wekyb3d8bbwe\SystemAppData\Helium\User.dat" (
set defname=DEFTEMP-%%#
reg load HKU\!defname! "%%b\AppData\Local\Packages\Microsoft.Office.Desktop_8wekyb3d8bbwe\SystemAppData\Helium\User.dat" %nul%
reg query HKU\!defname!\Software\Microsoft\Office\16.0\Common\Licensing /s %nul2% | findstr /i "CIDToLicenseIdsMapping LicenseIdToEmailMapping @" %nul% && set vnextexist=1
reg delete HKU\!defname!\Software\Microsoft\Office\16.0\Common\Licensing /f %nul%
reg unload HKU\!defname! %nul%
)
@@ -3499,6 +3549,15 @@ reg unload HKU\!defname! %nul%
)
)
if defined vnextexist (
echo:
call :dk_color %Gray% "Office vNext subscription detected:"
call :dk_color %Blue% "If active, this license overrides other activation methods."
call :dk_color %Blue% "If expiring soon, rerun the script after expiration."
call :dk_color2 %Blue% "If expired and script activation fails, get help - " %_Yellow% " %mas%troubleshoot"
echo:
)
:: Clear SharedComputerLicensing for office
:: https://learn.microsoft.com/en-us/deployoffice/overview-shared-computer-activation
@@ -3593,7 +3652,15 @@ set upk_result=2
if defined ohookact if not %upk_result%==0 echo:
if %upk_result%==1 echo Uninstalling Other/Grace Keys [Successful]
if %upk_result%==2 call :dk_color %Red% "Uninstalling Other/Grace Keys [Failed]"
if %upk_result%==2 (
call :dk_color %Red% "Uninstalling Other/Grace Keys [Failed]"
if not defined showfix (
echo:
call :dk_color %Blue% "%_fixmsg%"
echo:
set showfix=1
)
)
exit /b
::========================================================================================================================================
@@ -3657,7 +3724,6 @@ exit /b
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_db3bbc9c-ce52-41d1-a46f-1a1d68059119_Retail________WordR_[HSWordR]
14_dbe3aee0-5183-4ff7-8142-66050173cb01_Retail________SmallBusBasicsR_[SmallBusBasicsMSDNR]
@@ -3686,6 +3752,7 @@ for %%# in (
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_fbf4ac36-31c8-4340-8666-79873129cf40_9D8FR-7GYBW-4YG8M-V36JK-VD%f%7CM_Retail________OutlookR
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
@@ -4024,13 +4091,13 @@ $MemoryStream.Close()
::
:: The files are encoded in base64 to make AIO version.
::
:: mass<>grave<.>dev/ohook
:: mass()grave(dot)dev/ohook
:: Here you can find the files source code and info on how to rebuild the identical sppc.dll files
::
:: stackoverflow.com/a/35335273
:: Here you can check how to extract sppc.dll files from base64
::
:: For any further question, feel free to contact us on mass<>grave<.>dev/contactus
:: For any further question, feel free to contact us on mass()grave(dot)dev/contactus
::
::========================================================================================================================================
::
@@ -4216,7 +4283,7 @@ set tsids=
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.
:: In builds 26100 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 26100, 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
@@ -4351,8 +4418,8 @@ echo:
echo ______________________________________________________________
echo:
call :dk_color2 %_White% " [1] " %_Green% "Auto"
echo Builds ^>= 19041 - StaticCID (KMS4k if offline)
echo Builds ^< 19041 - ZeroCID
echo Builds ^>= 26100 - StaticCID (KMS4k if offline)
echo Builds ^< 26100 - ZeroCID
echo __________________________________________________
echo:
echo [2] StaticCID
@@ -4361,8 +4428,7 @@ 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 Works reliably on builds below 26100
echo Does not work on builds above 26100.4188
echo __________________________________________________
echo:
@@ -4474,7 +4540,7 @@ if /i %_actmethod%==ZCID set tsmethod=ZeroCID
if /i %_actmethod%==KMS4k set tsmethod=KMS4k
if /i %_actmethod%==Auto (
if %winbuild% GEQ 19041 (
if %winbuild% GEQ 26100 (
set tsmethod=StaticCID
) else (
set tsmethod=ZeroCID
@@ -5276,7 +5342,7 @@ call :ts_process
::========================================================================================================================================
:: mass<>grave<.>dev/office-license-is-not-genuine
:: mass()grave(dot)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"
@@ -5734,6 +5800,7 @@ call :dk_color %Gray% "To activate, check your internet connection and ensure th
) else (
call :dk_color %Blue% "This Windows version is known to not activate due to MS Windows/Server issues."
)
if not defined showfix call :dk_color %Blue% "%_fixmsg%"
set fixes=%fixes% %mas%troubleshoot
call :dk_color2 %Blue% "Check this webpage for help - " %_Yellow% " %mas%troubleshoot"
)
@@ -5750,7 +5817,7 @@ if /i %tsmethod%==StaticCID (echo Depositing Static Confirmation ID...) else (ec
echo:
%psc% "$f=[System.IO.File]::ReadAllText('!_batp!') -split ':tsforge\:.*';. ([scriptblock]::Create($f[1])) %tsids%"
if !errorlevel!==3 (
if %_actman%==0 (if not defined error call :dk_color %Blue% "%_fixmsg%")
if %_actman%==0 (if not defined showfix call :dk_color %Blue% "%_fixmsg%")
set fixes=%fixes% %mas%troubleshoot
call :dk_color2 %Blue% "Check this webpage for help - " %_Yellow% " %mas%troubleshoot"
) else (
@@ -6255,7 +6322,7 @@ using System.Xml.Linq;
}
#endif
// Common.cs
// LibTSforge/Common.cs
namespace LibTSforge
{
using System;
@@ -6497,7 +6564,7 @@ namespace LibTSforge
}
// SPP/PKeyConfig.cs
// LibTSforge/SPP/PKeyConfig.cs
namespace LibTSforge.SPP
{
using System;
@@ -6523,7 +6590,7 @@ namespace LibTSforge.SPP
public bool Contains(int n)
{
return Start <= n && End <= n;
return Start <= n && n <= End;
}
}
@@ -6653,10 +6720,19 @@ namespace LibTSforge.SPP
string refActIdStr = configNode.SelectSingleNode("./p:ActConfigId", nsmgr).InnerText;
Guid refActId = new Guid(refActIdStr);
int group = int.Parse(configNode.SelectSingleNode("./p:RefGroupId", nsmgr).InnerText);
List<KeyRange> keyRanges = ranges[refActIdStr];
List<KeyRange> keyRanges;
ranges.TryGetValue(refActIdStr, out keyRanges);
if (keyRanges == null)
{
continue;
}
if (keyRanges.Count > 0 && !Products.ContainsKey(refActId))
{
PKeyAlgorithm algorithm;
algorithms.TryGetValue(group, out algorithm);
ProductConfig productConfig = new ProductConfig
{
GroupId = group,
@@ -6664,7 +6740,7 @@ namespace LibTSforge.SPP
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],
Algorithm = algorithm,
Ranges = keyRanges,
ActivationId = refActId
};
@@ -6714,7 +6790,7 @@ namespace LibTSforge.SPP
}
// SPP/ProductKey.cs
// LibTSforge/SPP/ProductKey.cs
namespace LibTSforge.SPP
{
using System;
@@ -7030,7 +7106,7 @@ namespace LibTSforge.SPP
}
// SPP/SLAPI.cs
// LibTSforge/SPP/SLAPI.cs
namespace LibTSforge.SPP
{
using System;
@@ -7443,7 +7519,7 @@ namespace LibTSforge.SPP
}
// SPP/SPPUtils.cs
// LibTSforge/SPP/SPPUtils.cs
namespace LibTSforge.SPP
{
using Microsoft.Win32;
@@ -7780,7 +7856,7 @@ namespace LibTSforge.SPP
}
// SPP/SPSys.cs
// LibTSforge/SPP/SPSys.cs
namespace LibTSforge.SPP
{
using Microsoft.Win32.SafeHandles;
@@ -7827,7 +7903,7 @@ namespace LibTSforge.SPP
}
// Crypto/CryptoUtils.cs
// LibTSforge/Crypto/CryptoUtils.cs
namespace LibTSforge.Crypto
{
using System;
@@ -7962,7 +8038,7 @@ namespace LibTSforge.Crypto
}
// Crypto/Keys.cs
// LibTSforge/Crypto/Keys.cs
namespace LibTSforge.Crypto
{
public static class Keys
@@ -8052,7 +8128,7 @@ namespace LibTSforge.Crypto
}
// Crypto/PhysStoreCrypto.cs
// LibTSforge/Crypto/PhysStoreCrypto.cs
namespace LibTSforge.Crypto
{
using System;
@@ -8137,7 +8213,7 @@ namespace LibTSforge.Crypto
}
// Modifiers/GenPKeyInstall.cs
// LibTSforge/Modifiers/GenPKeyInstall.cs
namespace LibTSforge.Modifiers
{
using System;
@@ -8348,7 +8424,7 @@ namespace LibTSforge.Modifiers
}
// Modifiers/GracePeriodReset.cs
// LibTSforge/Modifiers/GracePeriodReset.cs
namespace LibTSforge.Modifiers
{
using System.Collections.Generic;
@@ -8381,7 +8457,7 @@ namespace LibTSforge.Modifiers
}
// Modifiers/KeyChangeLockDelete.cs
// LibTSforge/Modifiers/KeyChangeLockDelete.cs
namespace LibTSforge.Modifiers
{
using System.Collections.Generic;
@@ -8421,7 +8497,7 @@ namespace LibTSforge.Modifiers
}
// Modifiers/KMSHostCharge.cs
// LibTSforge/Modifiers/KMSHostCharge.cs
namespace LibTSforge.Modifiers
{
using System;
@@ -8582,7 +8658,7 @@ namespace LibTSforge.Modifiers
}
// Modifiers/RearmReset.cs
// LibTSforge/Modifiers/RearmReset.cs
namespace LibTSforge.Modifiers
{
using System.Collections.Generic;
@@ -8638,7 +8714,7 @@ namespace LibTSforge.Modifiers
}
// Modifiers/SetIIDParams.cs
// LibTSforge/Modifiers/SetIIDParams.cs
namespace LibTSforge.Modifiers
{
using PhysicalStore;
@@ -8707,7 +8783,7 @@ namespace LibTSforge.Modifiers
}
// Modifiers/TamperedFlagsDelete.cs
// LibTSforge/Modifiers/TamperedFlagsDelete.cs
namespace LibTSforge.Modifiers
{
using System.Linq;
@@ -8757,7 +8833,7 @@ namespace LibTSforge.Modifiers
}
// Modifiers/UniqueIdDelete.cs
// LibTSforge/Modifiers/UniqueIdDelete.cs
namespace LibTSforge.Modifiers
{
using System;
@@ -8816,7 +8892,7 @@ namespace LibTSforge.Modifiers
}
// Activators/KMS4K.cs
// LibTSforge/Activators/KMS4K.cs
namespace LibTSforge.Activators
{
using System;
@@ -9027,7 +9103,7 @@ namespace LibTSforge.Activators
}
// Activators/ZeroCID.cs
// LibTSforge/Activators/ZeroCID.cs
namespace LibTSforge.Activators
{
using System;
@@ -9216,7 +9292,7 @@ namespace LibTSforge.Activators
}
// TokenStore/Common.cs
// LibTSforge/TokenStore/Common.cs
namespace LibTSforge.TokenStore
{
using System.Collections.Generic;
@@ -9286,7 +9362,7 @@ namespace LibTSforge.TokenStore
}
// TokenStore/ITokenStore.cs
// LibTSforge/TokenStore/ITokenStore.cs
namespace LibTSforge.TokenStore
{
using System;
@@ -9306,7 +9382,7 @@ namespace LibTSforge.TokenStore
}
// TokenStore/TokenStoreModern.cs
// LibTSforge/TokenStore/TokenStoreModern.cs
namespace LibTSforge.TokenStore
{
using System;
@@ -9592,7 +9668,7 @@ namespace LibTSforge.TokenStore
}
// PhysicalStore/Common.cs
// LibTSforge/PhysicalStore/Common.cs
namespace LibTSforge.PhysicalStore
{
using System.Runtime.InteropServices;
@@ -9623,7 +9699,7 @@ namespace LibTSforge.PhysicalStore
}
// PhysicalStore/IPhysicalStore.cs
// LibTSforge/PhysicalStore/IPhysicalStore.cs
namespace LibTSforge.PhysicalStore
{
using System;
@@ -9718,7 +9794,7 @@ namespace LibTSforge.PhysicalStore
}
// PhysicalStore/PhysicalStoreModern.cs
// LibTSforge/PhysicalStore/PhysicalStoreModern.cs
namespace LibTSforge.PhysicalStore
{
using System;
@@ -10136,7 +10212,7 @@ namespace LibTSforge.PhysicalStore
}
// PhysicalStore/PhysicalStoreVista.cs
// LibTSforge/PhysicalStore/PhysicalStoreVista.cs
namespace LibTSforge.PhysicalStore
{
using System;
@@ -10495,7 +10571,7 @@ namespace LibTSforge.PhysicalStore
}
// PhysicalStore/PhysicalStoreWin7.cs
// LibTSforge/PhysicalStore/PhysicalStoreWin7.cs
namespace LibTSforge.PhysicalStore
{
using System;
@@ -10872,7 +10948,7 @@ namespace LibTSforge.PhysicalStore
}
// PhysicalStore/VariableBag.cs
// LibTSforge/PhysicalStore/VariableBag.cs
namespace LibTSforge.PhysicalStore
{
using System;
@@ -11151,6 +11227,7 @@ else {
if ($env:_debug -eq '0') {
[LibTSforge.Logger]::HideOutput = $true
}
[void][LibTSforge.Utils]::Wow64EnableWow64FsRedirection($false)
$ver = [LibTSforge.Utils]::DetectVersion()
$prod = [LibTSforge.SPP.SPPUtils]::DetectCurrentKey()
$tsactids = @($args)
@@ -12244,9 +12321,9 @@ set k_error=
%nul% reg add "HKLM\%specific_kms%\%app%" /f /v KeyManagementServicePort /t REG_SZ /d "1688" || set k_error=1
if not defined k_error (
echo Adding Specific KMS Host [LocalHost 127.0.0.2] [Successful]
echo Adding Specific KMS Host [LocalHost] [Successful]
) else (
call :dk_color %Red% "Adding Specific KMS Host [LocalHost 127.0.0.2] [Failed]"
call :dk_color %Red% "Adding Specific KMS Host [LocalHost] [Failed]"
)
::========================================================================================================================================
@@ -12342,7 +12419,9 @@ call :dk_color %Red% "Checking Ticket Migration [Failed]"
if not defined showfix if defined rebuildinfo (
set showfix=1
echo:
call :dk_color %Blue% "%_fixmsg%"
echo:
)
if exist "%tdir%\Genuine*" del /f /q "%tdir%\Genuine*" %nul%
@@ -13302,7 +13381,7 @@ if %winbuild% GEQ 9200 (
for /f "skip=2 tokens=2*" %%a in ('"reg query HKLM\SOFTWARE\Microsoft\Office\ClickToRun /v InstallPath" %nul6%') do if exist "%%b\root\Licenses16\ProPlus*.xrm-ms" set "_C16R=1"
for /f "skip=2 tokens=2*" %%a in ('"reg query HKLM\SOFTWARE\Microsoft\Office\ClickToRun /v InstallPath /reg:32" %nul6%') do if exist "%%b\root\Licenses16\ProPlus*.xrm-ms" set "_C16R=1"
if defined _C16R (
REM mass<>grave<.>dev/office-license-is-not-genuine
REM mass()grave(dot)dev/office-license-is-not-genuine
set _server=10.0.0.10
call :_taskregserv
echo Keeping the non-existent IP address 10.0.0.10 as %KS% Server.
@@ -13569,6 +13648,9 @@ call :ks_clearstuff
set error_=9
echo Failed to completely clear %KS% Cache.
reg query "HKLM\%SPPk%\%_wApp%" /s %nul2% | findstr /i "127.0.0.2" %nul1% && echo KMS38 activation is locked.
echo:
call :dk_color %Blue% "%_fixmsg%"
echo:
) || (
echo Cleared %KS% Cache successfully.
)
@@ -13584,6 +13666,10 @@ echo %uline%
echo %uline%
echo:
call :dk_color %Green% "Online %KS% has been successfully uninstalled."
echo:
call :dk_color %Gray% "If you want to reset the activation status,"
call :dk_color %Blue% "%_fixmsg%"
echo:
echo %uline%
)
@@ -13640,7 +13726,7 @@ exit /b
::============================================================================
::
:: Homepage: mass<>grave<.>dev
:: Homepage: mass()grave(dot)dev
:: Email: mas.help@outlook.com
::
::============================================================================
@@ -13681,7 +13767,7 @@ set "PSModulePath=%ProgramFiles%\WindowsPowerShell\Modules;%SysPath%\WindowsPowe
set _tserror=
set winbuild=1
set "nul=>nul 2>&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 psc=powershell.exe -nop -c
set _slexe=sppsvc.exe& set _slser=sppsvc
@@ -1,11 +1,11 @@
@set masver=3.4
@set masver=3.6
@echo off
::============================================================================
::
:: Homepage: mass<>grave<.>dev
:: Homepage: mass()grave(dot)dev
:: Email: mas.help@outlook.com
::
::============================================================================
@@ -50,6 +50,7 @@ set "_cmdf=%~f0"
for %%# in (%*) do (
if /i "%%#"=="re1" set re1=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
@@ -271,6 +272,9 @@ 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...
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
)
@@ -285,13 +289,26 @@ call :dk_color2 %Blue% "Check this webpage for help - " %_Yellow% " %mas%remove_
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
echo PowerShell is not working properly. Aborting...
if /i "!tstresult2!"=="FullLanguage" (
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
@@ -658,7 +675,9 @@ call :dk_color %Red% "Checking Ticket Migration [Failed]"
if not defined altapplist if not defined showfix if defined rebuildinfo (
set showfix=1
echo:
call :dk_color %Blue% "%_fixmsg%"
echo:
)
if exist "%tdir%\Genuine*" del /f /q "%tdir%\Genuine*" %nul%
@@ -728,8 +747,10 @@ licensing.mp.microsoft.com
findstr /i "%%#" "%SysPath%\drivers\etc\hosts" %nul1% && set "hosfail= [%%# Blocked in Hosts]"
)
call :dk_color %Red% "Checking Licensing Servers [Failed to Connect]!hosfail!"
echo:
set fixes=%fixes% %mas%licensing-servers-issue
call :dk_color2 %Blue% "Check this webpage for help - " %_Yellow% " %mas%licensing-servers-issue"
echo:
)
::==========================================================================================================================================
@@ -742,13 +763,17 @@ reg query "HKLM\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate" /v DisableWin
reg query "HKLM\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate" /v DoNotConnectToWindowsUpdateInternetLocations %nul2% | find /i "0x1" %nul% && set wublock=1
if defined wublock (
call :dk_color %Red% "Checking Update Blocker In Registry [Found]"
echo:
call :dk_color %Blue% "HWID activation needs working Windows updates, if you have used any tool to block updates, undo it."
echo:
)
reg query "HKLM\SOFTWARE\Policies\Microsoft\WindowsStore" /v DisableStoreApps %nul2% | find /i "0x1" %nul% && (
set storeblock=1
call :dk_color %Red% "Checking Store Blocker In Registry [Found]"
echo:
call :dk_color %Blue% "If you have used any tool to block Store, undo it."
echo:
)
set wcount=0
@@ -765,10 +790,14 @@ set error=1
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."
echo:
set fixes=%fixes% %mas%remove_mal%w%ware
call :dk_color2 %Blue% "Check this webpage for help - " %_Yellow% " %mas%remove_mal%w%ware"
echo:
) else (
echo:
call :dk_color %Blue% "HWID activation needs working Windows updates, if you have used any tool to block updates, undo it."
echo:
)
) else (
%psc% "Start-Job { Start-Service wuauserv } | Wait-Job -Timeout 20 | Out-Null"
@@ -777,7 +806,9 @@ set error=1
set wuerror=1
sc start wuauserv %nul%
call :dk_color %Red% "Starting Windows Update Service [Failed] [!errorlevel!]"
echo:
call :dk_color %Blue% "HWID activation needs working Windows updates, if you have used any tool to block updates, undo it."
echo:
)
)
)
@@ -790,8 +821,10 @@ if %keyerror% EQU 0 if not defined _perm if defined _int (
if not defined wucorrupt if not defined wublock if not defined wuerror if not defined storeblock if not defined resfail (
echo "%error_code%" | findstr /i "0x80072e 0x80072f 0x800704cf 0x87e10bcf 0x800705b4" %nul% && (
call :dk_color %Red% "Checking Internet Issues [Found] %error_code%"
echo:
set fixes=%fixes% %mas%licensing-servers-issue
call :dk_color2 %Blue% "Check this webpage for help - " %_Yellow% " %mas%licensing-servers-issue"
echo:
)
)
)
@@ -846,7 +879,7 @@ goto :dk_done
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
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
if %winbuild% LEQ 6300 (set _slexe=SLsvc.exe& set _slser=SLsvc)
@@ -998,9 +1031,11 @@ if %sps%==SoftwareLicensingService call :dk_refresh
echo %keyecho% %~1 [Successful]
) else (
call :dk_color %Red% "%keyecho% %~1 [Failed] %keyerror%"
if not defined error (
if not defined showfix (
if defined altapplist call :dk_color %Red% "Activation ID not found for this key."
echo:
call :dk_color %Blue% "%_fixmsg%"
echo:
set showfix=1
)
set error=1
@@ -1201,6 +1236,7 @@ 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%"&set showfix=1)
echo:
set fixes=%fixes% %mas%remove_mal%w%ware
call :dk_color2 %Blue% "Check this webpage for help - " %_Yellow% " %mas%remove_mal%w%ware"
echo:
@@ -1307,7 +1343,7 @@ sc start %%# %nul%
if !errorlevel! EQU 1060 set _corrupt=1
sc query %%# %nul% || set _corrupt=1
for %%G in (DependOnService Description DisplayName ErrorControl ImagePath ObjectName Start Type) do if not defined _regcorr (
reg query HKLM\SYSTEM\CurrentControlSet\Services\%%# /v %%G %nul% || (set _corrupt=1&set _regcorr="-RegistryError" )
reg query HKLM\SYSTEM\CurrentControlSet\Services\%%# /v %%G %nul% || (set _corrupt=1&set _regcorr=-RegistryError)
)
if defined _corrupt (if defined serv_cor (set "serv_cor=!serv_cor! %%#!_regcorr!") else (set "serv_cor=%%#!_regcorr!"))
@@ -1633,7 +1669,7 @@ cmd /c exit /b %error_code%
if %error_code% NEQ 0 set "error_code=0x%=ExitCode%"
if %error_code% NEQ 0 (
call :dk_color %Red% "Checking SoftwareLicensingService [Not Working] %error_code%"
call :dk_color %Red% "Checking SoftwareLicensingService [Not Working] [%error_code%]"
if not defined showfix (
echo:
call :dk_color %Blue% "%_fixmsg%"
@@ -1652,6 +1688,7 @@ 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=[System.IO.File]::ReadAllText('!_batp!') -split ':xrm\:.*';. ([scriptblock]::Create($f[1])); ReinstallLicenses" %nul%
if not defined _vis if !errorlevel! NEQ 0 set rlicfailed=1
call :dk_actid 55c92734-d682-4d71-983e-d6ec3f16059f
)
@@ -1673,6 +1710,13 @@ set error=1
set showfix=1
)
if not defined showfix if defined rlicfailed (
echo:
call :dk_color %Blue% "%_fixmsg%"
call :dk_color %Blue% "If activation still fails then run Fix WPA Registry option."
echo:
)
if %winbuild% GEQ 7600 if exist "%tokenstore%\" if not exist "%tokenstore%\tokens.dat" (
call :dk_color %Red% "Checking SPP tokens.dat [Not Found] [%tokenstore%\]"
)
@@ -1811,19 +1855,22 @@ call :dk_color %Gray% "Checking SkipRearm [Default 0 Value
if %winbuild% GEQ 9200 if not exist "%SystemRoot%\Servicing\Packages\Microsoft-Windows-*EvalEdition~*.mum" (
%psc% "Get-WmiObject -Query 'SELECT Description FROM SoftwareLicensingProduct WHERE PartialProductKey IS NOT NULL AND LicenseDependsOn IS NULL' | Select-Object -Property Description" %nul2% | findstr /i "KMS_" %nul1% || (
for /f "delims=" %%a in ('%psc% "(Get-ScheduledTask -TaskName 'SvcRestartTask' -TaskPath '\Microsoft\Windows\SoftwareProtectionPlatform\').State" %nul6%') do (set taskinfo=%%a)
for /f "delims=" %%a in ('%psc% "$s=New-Object -ComObject 'Schedule.Service'; $s.Connect(); $state=$s.GetFolder('\Microsoft\Windows\SoftwareProtectionPlatform').GetTask('SvcRestartTask').State; @{0='Unknown';1='Disabled';2='Queued';3='Ready';4='Running'}[$state]" %nul6%') do (set taskinfo=%%a)
echo !taskinfo! | find /i "Ready" %nul% || (
reg delete "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\SoftwareProtectionPlatform" /v "actionlist" /f %nul%
reg query "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Schedule\TaskCache\Tree\Microsoft\Windows\SoftwareProtectionPlatform\SvcRestartTask" %nul% || set taskinfo=Removed
if "!taskinfo!"=="" set "taskinfo=Not Found"
call :dk_color %Red% "Checking SvcRestartTask Status [!taskinfo!, system might deactivate later]"
call :dk_color %Gray% "Checking SvcRestartTask Status [!taskinfo!. System might deactivate later.]"
if not defined showfix (
echo:
echo "!taskinfo!" | findstr /i "Removed Not Found" %nul1% && (
set fixes=%fixes% %mas%in-place_repair_upgrade
call :dk_color2 %Blue% "Check this webpage for help - " %_Yellow% " %mas%in-place_repair_upgrade"
) || (
call :dk_color %Blue% "Reboot your machine using the restart option and run the script again."
set fixes=%fixes% %mas%troubleshoot
call :dk_color2 %Blue% "Check this webpage for help - " %_Yellow% " %mas%troubleshoot"
)
echo:
)
)
@@ -1941,7 +1988,7 @@ exit /b
:: 2nd column = Generic Retail/OEM/MAK Key
:: 3rd column = SKU ID
:: 4th column = Key part number
:: 5th column = Ticket signature value. It's as it is, it's not encoded. (Check mass<>grave<.>dev/hwid#manual-activation to see how it's generated)
:: 5th column = Ticket signature value. It's as it is, it's not encoded. (Check mass()grave(dot)dev/hwid#manual-activation to see how it's generated)
:: 6th column = 1 = activation is not working (at the time of writing this), 0 = activation is working
:: 7th column = Key Type
:: 8th column = WMI Edition ID (For reference only)
@@ -1,11 +1,11 @@
@set masver=3.4
@set masver=3.6
@echo off
::============================================================================
::
:: Homepage: mass<>grave<.>dev
:: Homepage: mass()grave(dot)dev
:: Email: mas.help@outlook.com
::
::============================================================================
@@ -50,6 +50,7 @@ set "_cmdf=%~f0"
for %%# in (%*) do (
if /i "%%#"=="re1" set re1=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
@@ -178,7 +179,7 @@ goto dk_done
if exist "%Systemdrive%\Users\WDAGUtilityAccount" (
sc query gcs | find /i "RUNNING" %nul% && (
%eline%
echo Windows Sandbox detected; activation is not required.
echo Windows Sandbox detected; activation is not supported.
echo The script cannot run due to missing licensing components. Aborting...
echo:
goto dk_done
@@ -270,6 +271,9 @@ 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...
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
)
@@ -284,13 +288,26 @@ call :dk_color2 %Blue% "Check this webpage for help - " %_Yellow% " %mas%remove_
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
echo PowerShell is not working properly. Aborting...
if /i "!tstresult2!"=="FullLanguage" (
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
@@ -679,9 +696,9 @@ set k_error=
%nul% reg add "HKLM\%specific_kms%\%app%" /f /v KeyManagementServicePort /t REG_SZ /d "1688" || set k_error=1
if not defined k_error (
echo Adding Specific KMS Host [LocalHost 127.0.0.2] [Successful]
echo Adding Specific KMS Host [LocalHost] [Successful]
) else (
call :dk_color %Red% "Adding Specific KMS Host [LocalHost 127.0.0.2] [Failed]"
call :dk_color %Red% "Adding Specific KMS Host [LocalHost] [Failed]"
)
::========================================================================================================================================
@@ -777,7 +794,9 @@ call :dk_color %Red% "Checking Ticket Migration [Failed]"
if not defined showfix if defined rebuildinfo (
set showfix=1
echo:
call :dk_color %Blue% "%_fixmsg%"
echo:
)
if exist "%tdir%\Genuine*" del /f /q "%tdir%\Genuine*" %nul%
@@ -902,7 +921,7 @@ goto :dk_done
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
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
if %winbuild% LEQ 6300 (set _slexe=SLsvc.exe& set _slser=SLsvc)
@@ -1073,9 +1092,11 @@ if %sps%==SoftwareLicensingService call :dk_refresh
echo %keyecho% %~1 [Successful]
) else (
call :dk_color %Red% "%keyecho% %~1 [Failed] %keyerror%"
if not defined error (
if not defined showfix (
if defined altapplist call :dk_color %Red% "Activation ID not found for this key."
echo:
call :dk_color %Blue% "%_fixmsg%"
echo:
set showfix=1
)
set error=1
@@ -1300,6 +1321,7 @@ 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%"&set showfix=1)
echo:
set fixes=%fixes% %mas%remove_mal%w%ware
call :dk_color2 %Blue% "Check this webpage for help - " %_Yellow% " %mas%remove_mal%w%ware"
echo:
@@ -1406,7 +1428,7 @@ sc start %%# %nul%
if !errorlevel! EQU 1060 set _corrupt=1
sc query %%# %nul% || set _corrupt=1
for %%G in (DependOnService Description DisplayName ErrorControl ImagePath ObjectName Start Type) do if not defined _regcorr (
reg query HKLM\SYSTEM\CurrentControlSet\Services\%%# /v %%G %nul% || (set _corrupt=1&set _regcorr="-RegistryError" )
reg query HKLM\SYSTEM\CurrentControlSet\Services\%%# /v %%G %nul% || (set _corrupt=1&set _regcorr=-RegistryError)
)
if defined _corrupt (if defined serv_cor (set "serv_cor=!serv_cor! %%#!_regcorr!") else (set "serv_cor=%%#!_regcorr!"))
@@ -1732,7 +1754,7 @@ cmd /c exit /b %error_code%
if %error_code% NEQ 0 set "error_code=0x%=ExitCode%"
if %error_code% NEQ 0 (
call :dk_color %Red% "Checking SoftwareLicensingService [Not Working] %error_code%"
call :dk_color %Red% "Checking SoftwareLicensingService [Not Working] [%error_code%]"
if not defined showfix (
echo:
call :dk_color %Blue% "%_fixmsg%"
@@ -1751,6 +1773,7 @@ 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=[System.IO.File]::ReadAllText('!_batp!') -split ':xrm\:.*';. ([scriptblock]::Create($f[1])); ReinstallLicenses" %nul%
if not defined _vis if !errorlevel! NEQ 0 set rlicfailed=1
call :dk_actid 55c92734-d682-4d71-983e-d6ec3f16059f
)
@@ -1772,6 +1795,13 @@ set error=1
set showfix=1
)
if not defined showfix if defined rlicfailed (
echo:
call :dk_color %Blue% "%_fixmsg%"
call :dk_color %Blue% "If activation still fails then run Fix WPA Registry option."
echo:
)
if %winbuild% GEQ 7600 if exist "%tokenstore%\" if not exist "%tokenstore%\tokens.dat" (
call :dk_color %Red% "Checking SPP tokens.dat [Not Found] [%tokenstore%\]"
)
@@ -1910,19 +1940,22 @@ call :dk_color %Gray% "Checking SkipRearm [Default 0 Value
if %winbuild% GEQ 9200 if not exist "%SystemRoot%\Servicing\Packages\Microsoft-Windows-*EvalEdition~*.mum" (
%psc% "Get-WmiObject -Query 'SELECT Description FROM SoftwareLicensingProduct WHERE PartialProductKey IS NOT NULL AND LicenseDependsOn IS NULL' | Select-Object -Property Description" %nul2% | findstr /i "KMS_" %nul1% || (
for /f "delims=" %%a in ('%psc% "(Get-ScheduledTask -TaskName 'SvcRestartTask' -TaskPath '\Microsoft\Windows\SoftwareProtectionPlatform\').State" %nul6%') do (set taskinfo=%%a)
for /f "delims=" %%a in ('%psc% "$s=New-Object -ComObject 'Schedule.Service'; $s.Connect(); $state=$s.GetFolder('\Microsoft\Windows\SoftwareProtectionPlatform').GetTask('SvcRestartTask').State; @{0='Unknown';1='Disabled';2='Queued';3='Ready';4='Running'}[$state]" %nul6%') do (set taskinfo=%%a)
echo !taskinfo! | find /i "Ready" %nul% || (
reg delete "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\SoftwareProtectionPlatform" /v "actionlist" /f %nul%
reg query "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Schedule\TaskCache\Tree\Microsoft\Windows\SoftwareProtectionPlatform\SvcRestartTask" %nul% || set taskinfo=Removed
if "!taskinfo!"=="" set "taskinfo=Not Found"
call :dk_color %Red% "Checking SvcRestartTask Status [!taskinfo!, system might deactivate later]"
call :dk_color %Gray% "Checking SvcRestartTask Status [!taskinfo!. System might deactivate later.]"
if not defined showfix (
echo:
echo "!taskinfo!" | findstr /i "Removed Not Found" %nul1% && (
set fixes=%fixes% %mas%in-place_repair_upgrade
call :dk_color2 %Blue% "Check this webpage for help - " %_Yellow% " %mas%in-place_repair_upgrade"
) || (
call :dk_color %Blue% "Reboot your machine using the restart option and run the script again."
set fixes=%fixes% %mas%troubleshoot
call :dk_color2 %Blue% "Check this webpage for help - " %_Yellow% " %mas%troubleshoot"
)
echo:
)
)
@@ -1,11 +1,11 @@
@set masver=3.4
@set masver=3.6
@echo off
::============================================================================
::
:: Homepage: mass<>grave<.>dev
:: Homepage: mass()grave(dot)dev
:: Email: mas.help@outlook.com
::
::============================================================================
@@ -50,6 +50,7 @@ set "_cmdf=%~f0"
for %%# in (%*) do (
if /i "%%#"=="re1" set re1=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
@@ -176,7 +177,7 @@ goto dk_done
if exist "%Systemdrive%\Users\WDAGUtilityAccount" (
sc query gcs | find /i "RUNNING" %nul% && (
%eline%
echo Windows Sandbox detected; activation is not required.
echo Windows Sandbox detected; activation is not supported.
echo The script cannot run due to missing licensing components. Aborting...
echo:
goto dk_done
@@ -279,6 +280,9 @@ 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...
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
)
@@ -293,13 +297,26 @@ call :dk_color2 %Blue% "Check this webpage for help - " %_Yellow% " %mas%remove_
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
echo PowerShell is not working properly. Aborting...
if /i "!tstresult2!"=="FullLanguage" (
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
@@ -711,7 +728,7 @@ call :dk_color %Gray% "Checking Old Office With Sub License [Found. Update Of
::========================================================================================================================================
:: mass<>grave<.>dev/office-license-is-not-genuine
:: mass()grave(dot)dev/office-license-is-not-genuine
:: Add registry keys for volume products so that 'non-genuine' banner won't appear
:: Script already is using MAK instead of GVLK so it won't appear anyway, but registry keys are added incase Office installs default GVLK grace key for volume products
@@ -753,7 +770,7 @@ if defined ohub call :dk_color %Gray% "Office apps such as Word, Excel are activ
echo Help: %mas%troubleshoot
) else (
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%"
if not defined ierror if not defined showfix call :dk_color %Blue% "%_fixmsg%"
echo:
set fixes=%fixes% %mas%troubleshoot
call :dk_color2 %Blue% "Check this webpage for help - " %_Yellow% " %mas%troubleshoot"
@@ -1458,10 +1475,12 @@ call :dk_color %Gray% "Checking Total User Accounts [%counter%]"
:: Clear the vNext/shared/device license blocks which may prevent ohook activation
set vnextexist=
rmdir /s /q "%ProgramData%\Microsoft\Office\Licenses\" %nul%
for %%x in (15 16) do (
for %%# in (%_sidlist%) do (
reg query HKU\%%#\Software\Microsoft\Office\%%x.0\Common\Licensing /s %nul2% | findstr /i "CIDToLicenseIdsMapping LicenseIdToEmailMapping @" %nul% && set vnextexist=1
reg delete HKU\%%#\Software\Microsoft\Office\%%x.0\Common\Licensing /f %nul%
for /f "skip=2 tokens=2*" %%a in ('"reg query "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\ProfileList\%%#" /v ProfileImagePath" %nul6%') do (
@@ -1484,6 +1503,7 @@ rmdir /s /q "%%b\AppData\Local\Packages\Microsoft.Office.Desktop_8wekyb3d8bbwe\L
if exist "%%b\AppData\Local\Packages\Microsoft.Office.Desktop_8wekyb3d8bbwe\SystemAppData\Helium\User.dat" (
set defname=DEFTEMP-%%#
reg load HKU\!defname! "%%b\AppData\Local\Packages\Microsoft.Office.Desktop_8wekyb3d8bbwe\SystemAppData\Helium\User.dat" %nul%
reg query HKU\!defname!\Software\Microsoft\Office\16.0\Common\Licensing /s %nul2% | findstr /i "CIDToLicenseIdsMapping LicenseIdToEmailMapping @" %nul% && set vnextexist=1
reg delete HKU\!defname!\Software\Microsoft\Office\16.0\Common\Licensing /f %nul%
reg unload HKU\!defname! %nul%
)
@@ -1491,6 +1511,15 @@ reg unload HKU\!defname! %nul%
)
)
if defined vnextexist (
echo:
call :dk_color %Gray% "Office vNext subscription detected:"
call :dk_color %Blue% "If active, this license overrides other activation methods."
call :dk_color %Blue% "If expiring soon, rerun the script after expiration."
call :dk_color2 %Blue% "If expired and script activation fails, get help - " %_Yellow% " %mas%troubleshoot"
echo:
)
:: Clear SharedComputerLicensing for office
:: https://learn.microsoft.com/en-us/deployoffice/overview-shared-computer-activation
@@ -1585,7 +1614,15 @@ set upk_result=2
if defined ohookact if not %upk_result%==0 echo:
if %upk_result%==1 echo Uninstalling Other/Grace Keys [Successful]
if %upk_result%==2 call :dk_color %Red% "Uninstalling Other/Grace Keys [Failed]"
if %upk_result%==2 (
call :dk_color %Red% "Uninstalling Other/Grace Keys [Failed]"
if not defined showfix (
echo:
call :dk_color %Blue% "%_fixmsg%"
echo:
set showfix=1
)
)
exit /b
::========================================================================================================================================
@@ -1638,7 +1675,7 @@ exit /b
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
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
if %winbuild% LEQ 6300 (set _slexe=SLsvc.exe& set _slser=SLsvc)
@@ -1727,9 +1764,11 @@ if %sps%==SoftwareLicensingService call :dk_refresh
echo %keyecho% %~1 [Successful]
) else (
call :dk_color %Red% "%keyecho% %~1 [Failed] %keyerror%"
if not defined error (
if not defined showfix (
if defined altapplist call :dk_color %Red% "Activation ID not found for this key."
echo:
call :dk_color %Blue% "%_fixmsg%"
echo:
set showfix=1
)
set error=1
@@ -1883,6 +1922,7 @@ 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%"&set showfix=1)
echo:
set fixes=%fixes% %mas%remove_mal%w%ware
call :dk_color2 %Blue% "Check this webpage for help - " %_Yellow% " %mas%remove_mal%w%ware"
echo:
@@ -1989,7 +2029,7 @@ sc start %%# %nul%
if !errorlevel! EQU 1060 set _corrupt=1
sc query %%# %nul% || set _corrupt=1
for %%G in (DependOnService Description DisplayName ErrorControl ImagePath ObjectName Start Type) do if not defined _regcorr (
reg query HKLM\SYSTEM\CurrentControlSet\Services\%%# /v %%G %nul% || (set _corrupt=1&set _regcorr="-RegistryError" )
reg query HKLM\SYSTEM\CurrentControlSet\Services\%%# /v %%G %nul% || (set _corrupt=1&set _regcorr=-RegistryError)
)
if defined _corrupt (if defined serv_cor (set "serv_cor=!serv_cor! %%#!_regcorr!") else (set "serv_cor=%%#!_regcorr!"))
@@ -2315,7 +2355,7 @@ cmd /c exit /b %error_code%
if %error_code% NEQ 0 set "error_code=0x%=ExitCode%"
if %error_code% NEQ 0 (
call :dk_color %Red% "Checking SoftwareLicensingService [Not Working] %error_code%"
call :dk_color %Red% "Checking SoftwareLicensingService [Not Working] [%error_code%]"
if not defined showfix (
echo:
call :dk_color %Blue% "%_fixmsg%"
@@ -2334,6 +2374,7 @@ 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=[System.IO.File]::ReadAllText('!_batp!') -split ':xrm\:.*';. ([scriptblock]::Create($f[1])); ReinstallLicenses" %nul%
if not defined _vis if !errorlevel! NEQ 0 set rlicfailed=1
call :dk_actid 55c92734-d682-4d71-983e-d6ec3f16059f
)
@@ -2355,6 +2396,13 @@ set error=1
set showfix=1
)
if not defined showfix if defined rlicfailed (
echo:
call :dk_color %Blue% "%_fixmsg%"
call :dk_color %Blue% "If activation still fails then run Fix WPA Registry option."
echo:
)
if %winbuild% GEQ 7600 if exist "%tokenstore%\" if not exist "%tokenstore%\tokens.dat" (
call :dk_color %Red% "Checking SPP tokens.dat [Not Found] [%tokenstore%\]"
)
@@ -2493,19 +2541,22 @@ call :dk_color %Gray% "Checking SkipRearm [Default 0 Value
if %winbuild% GEQ 9200 if not exist "%SystemRoot%\Servicing\Packages\Microsoft-Windows-*EvalEdition~*.mum" (
%psc% "Get-WmiObject -Query 'SELECT Description FROM SoftwareLicensingProduct WHERE PartialProductKey IS NOT NULL AND LicenseDependsOn IS NULL' | Select-Object -Property Description" %nul2% | findstr /i "KMS_" %nul1% || (
for /f "delims=" %%a in ('%psc% "(Get-ScheduledTask -TaskName 'SvcRestartTask' -TaskPath '\Microsoft\Windows\SoftwareProtectionPlatform\').State" %nul6%') do (set taskinfo=%%a)
for /f "delims=" %%a in ('%psc% "$s=New-Object -ComObject 'Schedule.Service'; $s.Connect(); $state=$s.GetFolder('\Microsoft\Windows\SoftwareProtectionPlatform').GetTask('SvcRestartTask').State; @{0='Unknown';1='Disabled';2='Queued';3='Ready';4='Running'}[$state]" %nul6%') do (set taskinfo=%%a)
echo !taskinfo! | find /i "Ready" %nul% || (
reg delete "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\SoftwareProtectionPlatform" /v "actionlist" /f %nul%
reg query "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Schedule\TaskCache\Tree\Microsoft\Windows\SoftwareProtectionPlatform\SvcRestartTask" %nul% || set taskinfo=Removed
if "!taskinfo!"=="" set "taskinfo=Not Found"
call :dk_color %Red% "Checking SvcRestartTask Status [!taskinfo!, system might deactivate later]"
call :dk_color %Gray% "Checking SvcRestartTask Status [!taskinfo!. System might deactivate later.]"
if not defined showfix (
echo:
echo "!taskinfo!" | findstr /i "Removed Not Found" %nul1% && (
set fixes=%fixes% %mas%in-place_repair_upgrade
call :dk_color2 %Blue% "Check this webpage for help - " %_Yellow% " %mas%in-place_repair_upgrade"
) || (
call :dk_color %Blue% "Reboot your machine using the restart option and run the script again."
set fixes=%fixes% %mas%troubleshoot
call :dk_color2 %Blue% "Check this webpage for help - " %_Yellow% " %mas%troubleshoot"
)
echo:
)
)
@@ -2635,7 +2686,6 @@ exit /b
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_db3bbc9c-ce52-41d1-a46f-1a1d68059119_Retail________WordR_[HSWordR]
14_dbe3aee0-5183-4ff7-8142-66050173cb01_Retail________SmallBusBasicsR_[SmallBusBasicsMSDNR]
@@ -2664,6 +2714,7 @@ for %%# in (
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_fbf4ac36-31c8-4340-8666-79873129cf40_9D8FR-7GYBW-4YG8M-V36JK-VD%f%7CM_Retail________OutlookR
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
@@ -3182,13 +3233,13 @@ $MemoryStream.Close()
::
:: The files are encoded in base64 to make AIO version.
::
:: mass<>grave<.>dev/ohook
:: mass()grave(dot)dev/ohook
:: Here you can find the files source code and info on how to rebuild the identical sppc.dll files
::
:: stackoverflow.com/a/35335273
:: Here you can check how to extract sppc.dll files from base64
::
:: For any further question, feel free to contact us on mass<>grave<.>dev/contactus
:: For any further question, feel free to contact us on mass()grave(dot)dev/contactus
::
::========================================================================================================================================
::
@@ -1,11 +1,11 @@
@set masver=3.4
@set masver=3.6
@echo off
::============================================================================
::
:: Homepage: mass<>grave<.>dev
:: Homepage: mass()grave(dot)dev
:: Email: mas.help@outlook.com
::
::============================================================================
@@ -75,6 +75,7 @@ set "_cmdf=%~f0"
for %%# in (%*) do (
if /i "%%#"=="re1" set re1=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
@@ -207,7 +208,7 @@ goto dk_done
if exist "%Systemdrive%\Users\WDAGUtilityAccount" (
sc query gcs | find /i "RUNNING" %nul% && (
%eline%
echo Windows Sandbox detected; activation is not required.
echo Windows Sandbox detected; activation is not supported.
echo The script cannot run due to missing licensing components. Aborting...
echo:
goto dk_done
@@ -310,6 +311,9 @@ 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...
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
)
@@ -324,13 +328,26 @@ call :dk_color2 %Blue% "Check this webpage for help - " %_Yellow% " %mas%remove_
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
echo PowerShell is not working properly. Aborting...
if /i "!tstresult2!"=="FullLanguage" (
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
@@ -1014,7 +1031,7 @@ if %winbuild% GEQ 9200 (
for /f "skip=2 tokens=2*" %%a in ('"reg query HKLM\SOFTWARE\Microsoft\Office\ClickToRun /v InstallPath" %nul6%') do if exist "%%b\root\Licenses16\ProPlus*.xrm-ms" set "_C16R=1"
for /f "skip=2 tokens=2*" %%a in ('"reg query HKLM\SOFTWARE\Microsoft\Office\ClickToRun /v InstallPath /reg:32" %nul6%') do if exist "%%b\root\Licenses16\ProPlus*.xrm-ms" set "_C16R=1"
if defined _C16R (
REM mass<>grave<.>dev/office-license-is-not-genuine
REM mass()grave(dot)dev/office-license-is-not-genuine
set _server=10.0.0.10
call :_taskregserv
echo Keeping the non-existent IP address 10.0.0.10 as %KS% Server.
@@ -1436,10 +1453,12 @@ call :dk_color %Gray% "Checking Total User Accounts [%counter%]"
:: Clear the vNext/shared/device license blocks which may prevent ohook activation
set vnextexist=
rmdir /s /q "%ProgramData%\Microsoft\Office\Licenses\" %nul%
for %%x in (15 16) do (
for %%# in (%_sidlist%) do (
reg query HKU\%%#\Software\Microsoft\Office\%%x.0\Common\Licensing /s %nul2% | findstr /i "CIDToLicenseIdsMapping LicenseIdToEmailMapping @" %nul% && set vnextexist=1
reg delete HKU\%%#\Software\Microsoft\Office\%%x.0\Common\Licensing /f %nul%
for /f "skip=2 tokens=2*" %%a in ('"reg query "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\ProfileList\%%#" /v ProfileImagePath" %nul6%') do (
@@ -1462,6 +1481,7 @@ rmdir /s /q "%%b\AppData\Local\Packages\Microsoft.Office.Desktop_8wekyb3d8bbwe\L
if exist "%%b\AppData\Local\Packages\Microsoft.Office.Desktop_8wekyb3d8bbwe\SystemAppData\Helium\User.dat" (
set defname=DEFTEMP-%%#
reg load HKU\!defname! "%%b\AppData\Local\Packages\Microsoft.Office.Desktop_8wekyb3d8bbwe\SystemAppData\Helium\User.dat" %nul%
reg query HKU\!defname!\Software\Microsoft\Office\16.0\Common\Licensing /s %nul2% | findstr /i "CIDToLicenseIdsMapping LicenseIdToEmailMapping @" %nul% && set vnextexist=1
reg delete HKU\!defname!\Software\Microsoft\Office\16.0\Common\Licensing /f %nul%
reg unload HKU\!defname! %nul%
)
@@ -1469,6 +1489,15 @@ reg unload HKU\!defname! %nul%
)
)
if defined vnextexist (
echo:
call :dk_color %Gray% "Office vNext subscription detected:"
call :dk_color %Blue% "If active, this license overrides other activation methods."
call :dk_color %Blue% "If expiring soon, rerun the script after expiration."
call :dk_color2 %Blue% "If expired and script activation fails, get help - " %_Yellow% " %mas%troubleshoot"
echo:
)
:: Clear SharedComputerLicensing for office
:: https://learn.microsoft.com/en-us/deployoffice/overview-shared-computer-activation
@@ -1563,7 +1592,15 @@ set upk_result=2
if defined ohookact if not %upk_result%==0 echo:
if %upk_result%==1 echo Uninstalling Other/Grace Keys [Successful]
if %upk_result%==2 call :dk_color %Red% "Uninstalling Other/Grace Keys [Failed]"
if %upk_result%==2 (
call :dk_color %Red% "Uninstalling Other/Grace Keys [Failed]"
if not defined showfix (
echo:
call :dk_color %Blue% "%_fixmsg%"
echo:
set showfix=1
)
)
exit /b
::========================================================================================================================================
@@ -1612,6 +1649,9 @@ call :ks_clearstuff
set error_=9
echo Failed to completely clear %KS% Cache.
reg query "HKLM\%SPPk%\%_wApp%" /s %nul2% | findstr /i "127.0.0.2" %nul1% && echo KMS38 activation is locked.
echo:
call :dk_color %Blue% "%_fixmsg%"
echo:
) || (
echo Cleared %KS% Cache successfully.
)
@@ -1627,6 +1667,10 @@ echo %uline%
echo %uline%
echo:
call :dk_color %Green% "Online %KS% has been successfully uninstalled."
echo:
call :dk_color %Gray% "If you want to reset the activation status,"
call :dk_color %Blue% "%_fixmsg%"
echo:
echo %uline%
)
@@ -1683,7 +1727,7 @@ exit /b
::============================================================================
::
:: Homepage: mass<>grave<.>dev
:: Homepage: mass()grave(dot)dev
:: Email: mas.help@outlook.com
::
::============================================================================
@@ -1724,7 +1768,7 @@ set "PSModulePath=%ProgramFiles%\WindowsPowerShell\Modules;%SysPath%\WindowsPowe
set _tserror=
set winbuild=1
set "nul=>nul 2>&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 psc=powershell.exe -nop -c
set _slexe=sppsvc.exe& set _slser=sppsvc
@@ -2544,7 +2588,7 @@ exit /b
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
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
if %winbuild% LEQ 6300 (set _slexe=SLsvc.exe& set _slser=SLsvc)
@@ -2696,9 +2740,11 @@ if %sps%==SoftwareLicensingService call :dk_refresh
echo %keyecho% %~1 [Successful]
) else (
call :dk_color %Red% "%keyecho% %~1 [Failed] %keyerror%"
if not defined error (
if not defined showfix (
if defined altapplist call :dk_color %Red% "Activation ID not found for this key."
echo:
call :dk_color %Blue% "%_fixmsg%"
echo:
set showfix=1
)
set error=1
@@ -2939,6 +2985,7 @@ 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%"&set showfix=1)
echo:
set fixes=%fixes% %mas%remove_mal%w%ware
call :dk_color2 %Blue% "Check this webpage for help - " %_Yellow% " %mas%remove_mal%w%ware"
echo:
@@ -3045,7 +3092,7 @@ sc start %%# %nul%
if !errorlevel! EQU 1060 set _corrupt=1
sc query %%# %nul% || set _corrupt=1
for %%G in (DependOnService Description DisplayName ErrorControl ImagePath ObjectName Start Type) do if not defined _regcorr (
reg query HKLM\SYSTEM\CurrentControlSet\Services\%%# /v %%G %nul% || (set _corrupt=1&set _regcorr="-RegistryError" )
reg query HKLM\SYSTEM\CurrentControlSet\Services\%%# /v %%G %nul% || (set _corrupt=1&set _regcorr=-RegistryError)
)
if defined _corrupt (if defined serv_cor (set "serv_cor=!serv_cor! %%#!_regcorr!") else (set "serv_cor=%%#!_regcorr!"))
@@ -3371,7 +3418,7 @@ cmd /c exit /b %error_code%
if %error_code% NEQ 0 set "error_code=0x%=ExitCode%"
if %error_code% NEQ 0 (
call :dk_color %Red% "Checking SoftwareLicensingService [Not Working] %error_code%"
call :dk_color %Red% "Checking SoftwareLicensingService [Not Working] [%error_code%]"
if not defined showfix (
echo:
call :dk_color %Blue% "%_fixmsg%"
@@ -3390,6 +3437,7 @@ 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=[System.IO.File]::ReadAllText('!_batp!') -split ':xrm\:.*';. ([scriptblock]::Create($f[1])); ReinstallLicenses" %nul%
if not defined _vis if !errorlevel! NEQ 0 set rlicfailed=1
call :dk_actid 55c92734-d682-4d71-983e-d6ec3f16059f
)
@@ -3411,6 +3459,13 @@ set error=1
set showfix=1
)
if not defined showfix if defined rlicfailed (
echo:
call :dk_color %Blue% "%_fixmsg%"
call :dk_color %Blue% "If activation still fails then run Fix WPA Registry option."
echo:
)
if %winbuild% GEQ 7600 if exist "%tokenstore%\" if not exist "%tokenstore%\tokens.dat" (
call :dk_color %Red% "Checking SPP tokens.dat [Not Found] [%tokenstore%\]"
)
@@ -3549,19 +3604,22 @@ call :dk_color %Gray% "Checking SkipRearm [Default 0 Value
if %winbuild% GEQ 9200 if not exist "%SystemRoot%\Servicing\Packages\Microsoft-Windows-*EvalEdition~*.mum" (
%psc% "Get-WmiObject -Query 'SELECT Description FROM SoftwareLicensingProduct WHERE PartialProductKey IS NOT NULL AND LicenseDependsOn IS NULL' | Select-Object -Property Description" %nul2% | findstr /i "KMS_" %nul1% || (
for /f "delims=" %%a in ('%psc% "(Get-ScheduledTask -TaskName 'SvcRestartTask' -TaskPath '\Microsoft\Windows\SoftwareProtectionPlatform\').State" %nul6%') do (set taskinfo=%%a)
for /f "delims=" %%a in ('%psc% "$s=New-Object -ComObject 'Schedule.Service'; $s.Connect(); $state=$s.GetFolder('\Microsoft\Windows\SoftwareProtectionPlatform').GetTask('SvcRestartTask').State; @{0='Unknown';1='Disabled';2='Queued';3='Ready';4='Running'}[$state]" %nul6%') do (set taskinfo=%%a)
echo !taskinfo! | find /i "Ready" %nul% || (
reg delete "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\SoftwareProtectionPlatform" /v "actionlist" /f %nul%
reg query "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Schedule\TaskCache\Tree\Microsoft\Windows\SoftwareProtectionPlatform\SvcRestartTask" %nul% || set taskinfo=Removed
if "!taskinfo!"=="" set "taskinfo=Not Found"
call :dk_color %Red% "Checking SvcRestartTask Status [!taskinfo!, system might deactivate later]"
call :dk_color %Gray% "Checking SvcRestartTask Status [!taskinfo!. System might deactivate later.]"
if not defined showfix (
echo:
echo "!taskinfo!" | findstr /i "Removed Not Found" %nul1% && (
set fixes=%fixes% %mas%in-place_repair_upgrade
call :dk_color2 %Blue% "Check this webpage for help - " %_Yellow% " %mas%in-place_repair_upgrade"
) || (
call :dk_color %Blue% "Reboot your machine using the restart option and run the script again."
set fixes=%fixes% %mas%troubleshoot
call :dk_color2 %Blue% "Check this webpage for help - " %_Yellow% " %mas%troubleshoot"
)
echo:
)
)
@@ -1,11 +1,11 @@
@set masver=3.4
@set masver=3.6
@echo off
::============================================================================
::
:: Homepage: mass<>grave<.>dev
:: Homepage: mass()grave(dot)dev
:: Email: mas.help@outlook.com
::
::============================================================================
@@ -46,7 +46,7 @@ set tsids=
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.
:: In builds 26100 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 26100, 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
@@ -84,6 +84,7 @@ set "_cmdf=%~f0"
for %%# in (%*) do (
if /i "%%#"=="re1" set re1=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
@@ -222,7 +223,7 @@ goto dk_done
if exist "%Systemdrive%\Users\WDAGUtilityAccount" (
sc query gcs | find /i "RUNNING" %nul% && (
%eline%
echo Windows Sandbox detected; activation is not required.
echo Windows Sandbox detected; activation is not supported.
echo The script cannot run due to missing licensing components. Aborting...
echo:
goto dk_done
@@ -337,6 +338,9 @@ 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...
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
)
@@ -351,13 +355,26 @@ call :dk_color2 %Blue% "Check this webpage for help - " %_Yellow% " %mas%remove_
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
echo PowerShell is not working properly. Aborting...
if /i "!tstresult2!"=="FullLanguage" (
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
@@ -528,8 +545,8 @@ echo:
echo ______________________________________________________________
echo:
call :dk_color2 %_White% " [1] " %_Green% "Auto"
echo Builds ^>= 19041 - StaticCID (KMS4k if offline)
echo Builds ^< 19041 - ZeroCID
echo Builds ^>= 26100 - StaticCID (KMS4k if offline)
echo Builds ^< 26100 - ZeroCID
echo __________________________________________________
echo:
echo [2] StaticCID
@@ -538,8 +555,7 @@ 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 Works reliably on builds below 26100
echo Does not work on builds above 26100.4188
echo __________________________________________________
echo:
@@ -651,7 +667,7 @@ if /i %_actmethod%==ZCID set tsmethod=ZeroCID
if /i %_actmethod%==KMS4k set tsmethod=KMS4k
if /i %_actmethod%==Auto (
if %winbuild% GEQ 19041 (
if %winbuild% GEQ 26100 (
set tsmethod=StaticCID
) else (
set tsmethod=ZeroCID
@@ -1453,7 +1469,7 @@ call :ts_process
::========================================================================================================================================
:: mass<>grave<.>dev/office-license-is-not-genuine
:: mass()grave(dot)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"
@@ -1911,6 +1927,7 @@ call :dk_color %Gray% "To activate, check your internet connection and ensure th
) else (
call :dk_color %Blue% "This Windows version is known to not activate due to MS Windows/Server issues."
)
if not defined showfix call :dk_color %Blue% "%_fixmsg%"
set fixes=%fixes% %mas%troubleshoot
call :dk_color2 %Blue% "Check this webpage for help - " %_Yellow% " %mas%troubleshoot"
)
@@ -1927,7 +1944,7 @@ if /i %tsmethod%==StaticCID (echo Depositing Static Confirmation ID...) else (ec
echo:
%psc% "$f=[System.IO.File]::ReadAllText('!_batp!') -split ':tsforge\:.*';. ([scriptblock]::Create($f[1])) %tsids%"
if !errorlevel!==3 (
if %_actman%==0 (if not defined error call :dk_color %Blue% "%_fixmsg%")
if %_actman%==0 (if not defined showfix call :dk_color %Blue% "%_fixmsg%")
set fixes=%fixes% %mas%troubleshoot
call :dk_color2 %Blue% "Check this webpage for help - " %_Yellow% " %mas%troubleshoot"
) else (
@@ -2394,10 +2411,12 @@ call :dk_color %Gray% "Checking Total User Accounts [%counter%]"
:: Clear the vNext/shared/device license blocks which may prevent ohook activation
set vnextexist=
rmdir /s /q "%ProgramData%\Microsoft\Office\Licenses\" %nul%
for %%x in (15 16) do (
for %%# in (%_sidlist%) do (
reg query HKU\%%#\Software\Microsoft\Office\%%x.0\Common\Licensing /s %nul2% | findstr /i "CIDToLicenseIdsMapping LicenseIdToEmailMapping @" %nul% && set vnextexist=1
reg delete HKU\%%#\Software\Microsoft\Office\%%x.0\Common\Licensing /f %nul%
for /f "skip=2 tokens=2*" %%a in ('"reg query "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\ProfileList\%%#" /v ProfileImagePath" %nul6%') do (
@@ -2420,6 +2439,7 @@ rmdir /s /q "%%b\AppData\Local\Packages\Microsoft.Office.Desktop_8wekyb3d8bbwe\L
if exist "%%b\AppData\Local\Packages\Microsoft.Office.Desktop_8wekyb3d8bbwe\SystemAppData\Helium\User.dat" (
set defname=DEFTEMP-%%#
reg load HKU\!defname! "%%b\AppData\Local\Packages\Microsoft.Office.Desktop_8wekyb3d8bbwe\SystemAppData\Helium\User.dat" %nul%
reg query HKU\!defname!\Software\Microsoft\Office\16.0\Common\Licensing /s %nul2% | findstr /i "CIDToLicenseIdsMapping LicenseIdToEmailMapping @" %nul% && set vnextexist=1
reg delete HKU\!defname!\Software\Microsoft\Office\16.0\Common\Licensing /f %nul%
reg unload HKU\!defname! %nul%
)
@@ -2427,6 +2447,15 @@ reg unload HKU\!defname! %nul%
)
)
if defined vnextexist (
echo:
call :dk_color %Gray% "Office vNext subscription detected:"
call :dk_color %Blue% "If active, this license overrides other activation methods."
call :dk_color %Blue% "If expiring soon, rerun the script after expiration."
call :dk_color2 %Blue% "If expired and script activation fails, get help - " %_Yellow% " %mas%troubleshoot"
echo:
)
:: Clear SharedComputerLicensing for office
:: https://learn.microsoft.com/en-us/deployoffice/overview-shared-computer-activation
@@ -2521,7 +2550,15 @@ set upk_result=2
if defined ohookact if not %upk_result%==0 echo:
if %upk_result%==1 echo Uninstalling Other/Grace Keys [Successful]
if %upk_result%==2 call :dk_color %Red% "Uninstalling Other/Grace Keys [Failed]"
if %upk_result%==2 (
call :dk_color %Red% "Uninstalling Other/Grace Keys [Failed]"
if not defined showfix (
echo:
call :dk_color %Blue% "%_fixmsg%"
echo:
set showfix=1
)
)
exit /b
::========================================================================================================================================
@@ -2599,7 +2636,7 @@ exit /b
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
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
if %winbuild% LEQ 6300 (set _slexe=SLsvc.exe& set _slser=SLsvc)
@@ -2750,9 +2787,11 @@ if %sps%==SoftwareLicensingService call :dk_refresh
echo %keyecho% %~1 [Successful]
) else (
call :dk_color %Red% "%keyecho% %~1 [Failed] %keyerror%"
if not defined error (
if not defined showfix (
if defined altapplist call :dk_color %Red% "Activation ID not found for this key."
echo:
call :dk_color %Blue% "%_fixmsg%"
echo:
set showfix=1
)
set error=1
@@ -2951,6 +2990,7 @@ 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%"&set showfix=1)
echo:
set fixes=%fixes% %mas%remove_mal%w%ware
call :dk_color2 %Blue% "Check this webpage for help - " %_Yellow% " %mas%remove_mal%w%ware"
echo:
@@ -3057,7 +3097,7 @@ sc start %%# %nul%
if !errorlevel! EQU 1060 set _corrupt=1
sc query %%# %nul% || set _corrupt=1
for %%G in (DependOnService Description DisplayName ErrorControl ImagePath ObjectName Start Type) do if not defined _regcorr (
reg query HKLM\SYSTEM\CurrentControlSet\Services\%%# /v %%G %nul% || (set _corrupt=1&set _regcorr="-RegistryError" )
reg query HKLM\SYSTEM\CurrentControlSet\Services\%%# /v %%G %nul% || (set _corrupt=1&set _regcorr=-RegistryError)
)
if defined _corrupt (if defined serv_cor (set "serv_cor=!serv_cor! %%#!_regcorr!") else (set "serv_cor=%%#!_regcorr!"))
@@ -3383,7 +3423,7 @@ cmd /c exit /b %error_code%
if %error_code% NEQ 0 set "error_code=0x%=ExitCode%"
if %error_code% NEQ 0 (
call :dk_color %Red% "Checking SoftwareLicensingService [Not Working] %error_code%"
call :dk_color %Red% "Checking SoftwareLicensingService [Not Working] [%error_code%]"
if not defined showfix (
echo:
call :dk_color %Blue% "%_fixmsg%"
@@ -3402,6 +3442,7 @@ 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=[System.IO.File]::ReadAllText('!_batp!') -split ':xrm\:.*';. ([scriptblock]::Create($f[1])); ReinstallLicenses" %nul%
if not defined _vis if !errorlevel! NEQ 0 set rlicfailed=1
call :dk_actid 55c92734-d682-4d71-983e-d6ec3f16059f
)
@@ -3423,6 +3464,13 @@ set error=1
set showfix=1
)
if not defined showfix if defined rlicfailed (
echo:
call :dk_color %Blue% "%_fixmsg%"
call :dk_color %Blue% "If activation still fails then run Fix WPA Registry option."
echo:
)
if %winbuild% GEQ 7600 if exist "%tokenstore%\" if not exist "%tokenstore%\tokens.dat" (
call :dk_color %Red% "Checking SPP tokens.dat [Not Found] [%tokenstore%\]"
)
@@ -3561,19 +3609,22 @@ call :dk_color %Gray% "Checking SkipRearm [Default 0 Value
if %winbuild% GEQ 9200 if not exist "%SystemRoot%\Servicing\Packages\Microsoft-Windows-*EvalEdition~*.mum" (
%psc% "Get-WmiObject -Query 'SELECT Description FROM SoftwareLicensingProduct WHERE PartialProductKey IS NOT NULL AND LicenseDependsOn IS NULL' | Select-Object -Property Description" %nul2% | findstr /i "KMS_" %nul1% || (
for /f "delims=" %%a in ('%psc% "(Get-ScheduledTask -TaskName 'SvcRestartTask' -TaskPath '\Microsoft\Windows\SoftwareProtectionPlatform\').State" %nul6%') do (set taskinfo=%%a)
for /f "delims=" %%a in ('%psc% "$s=New-Object -ComObject 'Schedule.Service'; $s.Connect(); $state=$s.GetFolder('\Microsoft\Windows\SoftwareProtectionPlatform').GetTask('SvcRestartTask').State; @{0='Unknown';1='Disabled';2='Queued';3='Ready';4='Running'}[$state]" %nul6%') do (set taskinfo=%%a)
echo !taskinfo! | find /i "Ready" %nul% || (
reg delete "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\SoftwareProtectionPlatform" /v "actionlist" /f %nul%
reg query "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Schedule\TaskCache\Tree\Microsoft\Windows\SoftwareProtectionPlatform\SvcRestartTask" %nul% || set taskinfo=Removed
if "!taskinfo!"=="" set "taskinfo=Not Found"
call :dk_color %Red% "Checking SvcRestartTask Status [!taskinfo!, system might deactivate later]"
call :dk_color %Gray% "Checking SvcRestartTask Status [!taskinfo!. System might deactivate later.]"
if not defined showfix (
echo:
echo "!taskinfo!" | findstr /i "Removed Not Found" %nul1% && (
set fixes=%fixes% %mas%in-place_repair_upgrade
call :dk_color2 %Blue% "Check this webpage for help - " %_Yellow% " %mas%in-place_repair_upgrade"
) || (
call :dk_color %Blue% "Reboot your machine using the restart option and run the script again."
set fixes=%fixes% %mas%troubleshoot
call :dk_color2 %Blue% "Check this webpage for help - " %_Yellow% " %mas%troubleshoot"
)
echo:
)
)
@@ -3903,7 +3954,7 @@ using System.Xml.Linq;
}
#endif
// Common.cs
// LibTSforge/Common.cs
namespace LibTSforge
{
using System;
@@ -4145,7 +4196,7 @@ namespace LibTSforge
}
// SPP/PKeyConfig.cs
// LibTSforge/SPP/PKeyConfig.cs
namespace LibTSforge.SPP
{
using System;
@@ -4171,7 +4222,7 @@ namespace LibTSforge.SPP
public bool Contains(int n)
{
return Start <= n && End <= n;
return Start <= n && n <= End;
}
}
@@ -4301,10 +4352,19 @@ namespace LibTSforge.SPP
string refActIdStr = configNode.SelectSingleNode("./p:ActConfigId", nsmgr).InnerText;
Guid refActId = new Guid(refActIdStr);
int group = int.Parse(configNode.SelectSingleNode("./p:RefGroupId", nsmgr).InnerText);
List<KeyRange> keyRanges = ranges[refActIdStr];
List<KeyRange> keyRanges;
ranges.TryGetValue(refActIdStr, out keyRanges);
if (keyRanges == null)
{
continue;
}
if (keyRanges.Count > 0 && !Products.ContainsKey(refActId))
{
PKeyAlgorithm algorithm;
algorithms.TryGetValue(group, out algorithm);
ProductConfig productConfig = new ProductConfig
{
GroupId = group,
@@ -4312,7 +4372,7 @@ namespace LibTSforge.SPP
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],
Algorithm = algorithm,
Ranges = keyRanges,
ActivationId = refActId
};
@@ -4362,7 +4422,7 @@ namespace LibTSforge.SPP
}
// SPP/ProductKey.cs
// LibTSforge/SPP/ProductKey.cs
namespace LibTSforge.SPP
{
using System;
@@ -4678,7 +4738,7 @@ namespace LibTSforge.SPP
}
// SPP/SLAPI.cs
// LibTSforge/SPP/SLAPI.cs
namespace LibTSforge.SPP
{
using System;
@@ -5091,7 +5151,7 @@ namespace LibTSforge.SPP
}
// SPP/SPPUtils.cs
// LibTSforge/SPP/SPPUtils.cs
namespace LibTSforge.SPP
{
using Microsoft.Win32;
@@ -5428,7 +5488,7 @@ namespace LibTSforge.SPP
}
// SPP/SPSys.cs
// LibTSforge/SPP/SPSys.cs
namespace LibTSforge.SPP
{
using Microsoft.Win32.SafeHandles;
@@ -5475,7 +5535,7 @@ namespace LibTSforge.SPP
}
// Crypto/CryptoUtils.cs
// LibTSforge/Crypto/CryptoUtils.cs
namespace LibTSforge.Crypto
{
using System;
@@ -5610,7 +5670,7 @@ namespace LibTSforge.Crypto
}
// Crypto/Keys.cs
// LibTSforge/Crypto/Keys.cs
namespace LibTSforge.Crypto
{
public static class Keys
@@ -5700,7 +5760,7 @@ namespace LibTSforge.Crypto
}
// Crypto/PhysStoreCrypto.cs
// LibTSforge/Crypto/PhysStoreCrypto.cs
namespace LibTSforge.Crypto
{
using System;
@@ -5785,7 +5845,7 @@ namespace LibTSforge.Crypto
}
// Modifiers/GenPKeyInstall.cs
// LibTSforge/Modifiers/GenPKeyInstall.cs
namespace LibTSforge.Modifiers
{
using System;
@@ -5996,7 +6056,7 @@ namespace LibTSforge.Modifiers
}
// Modifiers/GracePeriodReset.cs
// LibTSforge/Modifiers/GracePeriodReset.cs
namespace LibTSforge.Modifiers
{
using System.Collections.Generic;
@@ -6029,7 +6089,7 @@ namespace LibTSforge.Modifiers
}
// Modifiers/KeyChangeLockDelete.cs
// LibTSforge/Modifiers/KeyChangeLockDelete.cs
namespace LibTSforge.Modifiers
{
using System.Collections.Generic;
@@ -6069,7 +6129,7 @@ namespace LibTSforge.Modifiers
}
// Modifiers/KMSHostCharge.cs
// LibTSforge/Modifiers/KMSHostCharge.cs
namespace LibTSforge.Modifiers
{
using System;
@@ -6230,7 +6290,7 @@ namespace LibTSforge.Modifiers
}
// Modifiers/RearmReset.cs
// LibTSforge/Modifiers/RearmReset.cs
namespace LibTSforge.Modifiers
{
using System.Collections.Generic;
@@ -6286,7 +6346,7 @@ namespace LibTSforge.Modifiers
}
// Modifiers/SetIIDParams.cs
// LibTSforge/Modifiers/SetIIDParams.cs
namespace LibTSforge.Modifiers
{
using PhysicalStore;
@@ -6355,7 +6415,7 @@ namespace LibTSforge.Modifiers
}
// Modifiers/TamperedFlagsDelete.cs
// LibTSforge/Modifiers/TamperedFlagsDelete.cs
namespace LibTSforge.Modifiers
{
using System.Linq;
@@ -6405,7 +6465,7 @@ namespace LibTSforge.Modifiers
}
// Modifiers/UniqueIdDelete.cs
// LibTSforge/Modifiers/UniqueIdDelete.cs
namespace LibTSforge.Modifiers
{
using System;
@@ -6464,7 +6524,7 @@ namespace LibTSforge.Modifiers
}
// Activators/KMS4K.cs
// LibTSforge/Activators/KMS4K.cs
namespace LibTSforge.Activators
{
using System;
@@ -6675,7 +6735,7 @@ namespace LibTSforge.Activators
}
// Activators/ZeroCID.cs
// LibTSforge/Activators/ZeroCID.cs
namespace LibTSforge.Activators
{
using System;
@@ -6864,7 +6924,7 @@ namespace LibTSforge.Activators
}
// TokenStore/Common.cs
// LibTSforge/TokenStore/Common.cs
namespace LibTSforge.TokenStore
{
using System.Collections.Generic;
@@ -6934,7 +6994,7 @@ namespace LibTSforge.TokenStore
}
// TokenStore/ITokenStore.cs
// LibTSforge/TokenStore/ITokenStore.cs
namespace LibTSforge.TokenStore
{
using System;
@@ -6954,7 +7014,7 @@ namespace LibTSforge.TokenStore
}
// TokenStore/TokenStoreModern.cs
// LibTSforge/TokenStore/TokenStoreModern.cs
namespace LibTSforge.TokenStore
{
using System;
@@ -7240,7 +7300,7 @@ namespace LibTSforge.TokenStore
}
// PhysicalStore/Common.cs
// LibTSforge/PhysicalStore/Common.cs
namespace LibTSforge.PhysicalStore
{
using System.Runtime.InteropServices;
@@ -7271,7 +7331,7 @@ namespace LibTSforge.PhysicalStore
}
// PhysicalStore/IPhysicalStore.cs
// LibTSforge/PhysicalStore/IPhysicalStore.cs
namespace LibTSforge.PhysicalStore
{
using System;
@@ -7366,7 +7426,7 @@ namespace LibTSforge.PhysicalStore
}
// PhysicalStore/PhysicalStoreModern.cs
// LibTSforge/PhysicalStore/PhysicalStoreModern.cs
namespace LibTSforge.PhysicalStore
{
using System;
@@ -7784,7 +7844,7 @@ namespace LibTSforge.PhysicalStore
}
// PhysicalStore/PhysicalStoreVista.cs
// LibTSforge/PhysicalStore/PhysicalStoreVista.cs
namespace LibTSforge.PhysicalStore
{
using System;
@@ -8143,7 +8203,7 @@ namespace LibTSforge.PhysicalStore
}
// PhysicalStore/PhysicalStoreWin7.cs
// LibTSforge/PhysicalStore/PhysicalStoreWin7.cs
namespace LibTSforge.PhysicalStore
{
using System;
@@ -8520,7 +8580,7 @@ namespace LibTSforge.PhysicalStore
}
// PhysicalStore/VariableBag.cs
// LibTSforge/PhysicalStore/VariableBag.cs
namespace LibTSforge.PhysicalStore
{
using System;
@@ -8799,6 +8859,7 @@ else {
if ($env:_debug -eq '0') {
[LibTSforge.Logger]::HideOutput = $true
}
[void][LibTSforge.Utils]::Wow64EnableWow64FsRedirection($false)
$ver = [LibTSforge.Utils]::DetectVersion()
$prod = [LibTSforge.SPP.SPPUtils]::DetectCurrentKey()
$tsactids = @($args)
@@ -1,11 +1,11 @@
@set masver=3.4
@set masver=3.6
@echo off
::============================================================================
::
:: Homepage: mass<>grave<.>dev
:: Homepage: mass()grave(dot)dev
:: Email: mas.help@outlook.com
::
::============================================================================
@@ -37,6 +37,7 @@ set "_cmdf=%~f0"
for %%# in (%*) do (
if /i "%%#"=="re1" set re1=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
@@ -224,6 +225,9 @@ 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...
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
)
@@ -238,13 +242,26 @@ call :dk_color2 %Blue% "Check this webpage for help - " %_Yellow% " %mas%remove_
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
echo PowerShell is not working properly. Aborting...
if /i "!tstresult2!"=="FullLanguage" (
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
@@ -1531,7 +1548,7 @@ if ($appIdsList.Count -gt 0) {
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
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
if %winbuild% LEQ 6300 (set _slexe=SLsvc.exe& set _slser=SLsvc)
@@ -1,11 +1,11 @@
@set masver=3.4
@set masver=3.6
@echo off
::============================================================================
::
:: Homepage: mass<>grave<.>dev
:: Homepage: mass()grave(dot)dev
:: Email: mas.help@outlook.com
::
::============================================================================
@@ -42,6 +42,7 @@ set "_cmdf=%~f0"
for %%# in (%*) do (
if /i "%%#"=="re1" set re1=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
@@ -229,6 +230,9 @@ 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...
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
)
@@ -243,13 +247,26 @@ call :dk_color2 %Blue% "Check this webpage for help - " %_Yellow% " %mas%remove_
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
echo PowerShell is not working properly. Aborting...
if /i "!tstresult2!"=="FullLanguage" (
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
@@ -854,7 +871,7 @@ exit /b
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
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
if %winbuild% LEQ 6300 (set _slexe=SLsvc.exe& set _slser=SLsvc)
@@ -1,11 +1,11 @@
@set masver=3.4
@set masver=3.6
@echo off
::============================================================================
::
:: Homepage: mass<>grave<.>dev
:: Homepage: mass()grave(dot)dev
:: Email: mas.help@outlook.com
::
::============================================================================
@@ -37,6 +37,7 @@ set "_cmdf=%~f0"
for %%# in (%*) do (
if /i "%%#"=="re1" set re1=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
@@ -240,6 +241,9 @@ 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...
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
)
@@ -254,13 +258,26 @@ call :dk_color2 %Blue% "Check this webpage for help - " %_Yellow% " %mas%remove_
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
echo PowerShell is not working properly. Aborting...
if /i "!tstresult2!"=="FullLanguage" (
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
@@ -779,7 +796,7 @@ exit /b
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
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
if %winbuild% LEQ 6300 (set _slexe=SLsvc.exe& set _slser=SLsvc)
+21 -4
View File
@@ -1,11 +1,11 @@
@set masver=3.4
@set masver=3.6
@echo off
::============================================================================
::
:: Homepage: mass<>grave<.>dev
:: Homepage: mass()grave(dot)dev
:: Email: mas.help@outlook.com
::
::============================================================================
@@ -37,6 +37,7 @@ set "_cmdf=%~f0"
for %%# in (%*) do (
if /i "%%#"=="re1" set re1=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
@@ -241,6 +242,9 @@ 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...
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
)
@@ -255,13 +259,26 @@ call :dk_color2 %Blue% "Check this webpage for help - " %_Yellow% " %mas%remove_
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
echo PowerShell is not working properly. Aborting...
if /i "!tstresult2!"=="FullLanguage" (
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
@@ -1639,7 +1656,7 @@ exit /b
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
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
if %winbuild% LEQ 6300 (set _slexe=SLsvc.exe& set _slser=SLsvc)
+31 -16
View File
@@ -6,25 +6,42 @@
<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**
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.**
- For **Windows 8, 10, 11**: 📌
```
irm https://get.activated.win | iex
```
Alternatively, you can use the following (this will be deprecated in the future):
- For **Windows 7** and later:
```
irm https://massgrave.dev/get | iex
iex ((New-Object Net.WebClient).DownloadString('https://get.activated.win'))
```
3. You will see the activation options. Choose the activation options highlighted in green.
<details>
4. That's all
<summary>Script not launching❓Click here for info.</summary>
---
- If the above is blocked (by ISP/DNS), try this (needs **updated Windows 10 or 11**):
```
iex (curl.exe -s --doh-url https://1.1.1.1/dns-query https://get.activated.win | Out-String)
```
- If that fails or you have an older Windows, use the below-listed Method 2.
---
</details>
3. The activation menu will appear. **Choose the green-highlighted options** to activate Windows or Office.
4. **Done!**
---
@@ -47,16 +64,14 @@ or
---
- 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).
> [!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).
---
### 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).
- 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).
---
@@ -69,8 +84,8 @@ or
---
```
Latest Version: 3.4
Release date: 3-June-2025
Latest Version: 3.6
Release date: 9-Sep-2025
```
### [Troubleshooting / Help](https://massgrave.dev/troubleshoot)