86 Commits

Author SHA1 Message Date
Ave
b1b5299c47 Rename 2024-09-07 01:51:27 +00:00
Ave
652092e985 Merge branch 'dev' 2024-09-07 01:50:37 +00:00
WindowsAddict
b06c83622a Update readme 2024-09-07 06:30:17 +05:30
WindowsAddict
ce669809bf 2.7 2024-09-07 06:03:06 +05:30
WindowsAddict
0afb09cbd1 Use IsOSBinary check 2024-09-05 05:11:08 +05:30
WindowsAddict
5d8a463475 Check signature of clipup.exe in Server Cor/Acor editions 2024-09-05 04:44:49 +05:30
WindowsAddict
7044f37b44 Add a line in main menu 2024-09-05 03:50:03 +05:30
WindowsAddict
08443039aa Reword again 2024-09-01 03:24:58 +05:30
WindowsAddict
fd8b81411c Reword the restart line 2024-09-01 02:50:49 +05:30
WindowsAddict
213bc50b49 Update asdcorp's Set-WindowsCbsEdition link 2024-09-01 02:41:55 +05:30
WindowsAddict
00e81be52f Reword some sentences 2024-09-01 02:39:12 +05:30
WindowsAddict
2443e1e471 Remove preview keys
It can cause issues with correct key detection and its not important anyways
2024-09-01 02:27:23 +05:30
WindowsAddict
ec31fef9b9 Fix line alignment in KMS38 menu 2024-08-30 03:22:35 +05:30
WindowsAddict
84f5516632 Remove CRC32 from AIO name and use random letters in folder name
(To avoid AV's detection in URL)
2024-08-30 03:11:05 +05:30
WindowsAddict
f9f386a896 Detect SPP's PerfOptions registry in IFEO, and remove it in troubleshoot script 2024-08-30 02:58:38 +05:30
WindowsAddict
8e3b4135f5 Fix text alignment 2024-08-28 08:30:14 +05:30
WindowsAddict
bacb32f4a1 Update MAS AIO to 2.7 2024-08-28 08:18:25 +05:30
WindowsAddict
86c86c179a LICENSE 2024-08-28 02:15:43 +05:30
WindowsAddict
445a74ccea Check unsupported language for Project/Visio 2024-08-27 19:00:10 +05:30
WindowsAddict
69e6c9bf71 Add change Office edition script 2024-08-26 19:47:33 +05:30
WindowsAddict
0ced0f5d8e Rename filename to Change_Windows_Edition.cmd 2024-08-26 19:46:19 +05:30
Lyssa
19be25c029 Fix many grammar/spelling issues in the script (#543)
* Proof-read Change Edition script

* .

* Proof-read OEM folder script

* Update Change_Edition.cmd

* Update Troubleshoot.cmd

* Update Troubleshoot.cmd

* Update HWID_Activation.cmd

* Update HWID_Activation.cmd

* Update HWID_Activation.cmd

* Update KMS38_Activation.cmd

* Add files via upload

* Update Change_Edition.cmd

* I'm tired

* Update Extract_OEM_Folder.cmd

* Update Troubleshoot.cmd

* Update HWID_Activation.cmd

* Update HWID_Activation.cmd

* Update HWID_Activation.cmd

* finish with hwid

* Update KMS38_Activation.cmd

* final kms38 update

* Update Ohook_Activation_AIO.cmd

* start ohook

* Update Ohook_Activation_AIO.cmd

* Update Online_KMS_Activation.cmd

* Update HWID_Activation.cmd

* Update KMS38_Activation.cmd

* Update Ohook_Activation_AIO.cmd

* Update Online_KMS_Activation.cmd

* Update Change_Edition.cmd

* Update Extract_OEM_Folder.cmd

* Update Troubleshoot.cmd

---------

Co-authored-by: nekoppai <109633131+nekoppai@users.noreply.github.com>
Co-authored-by: WindowsAddict <windowsaddict@protonmail.com>
2024-08-20 22:45:06 +05:30
WindowsAddict
d372b62280 Revert "Merge pull request #542 from alouiadel/dev"
This reverts commit 1dfd3f6626, reversing
changes made to 79bc7b0242.
2024-08-20 04:54:16 +05:30
WindowsAddict
9e5062e7cc Update deletion of Office related keys 2024-08-20 03:51:13 +05:30
WindowsAddict
ed3dace78f Cleanup some registry keys 2024-08-20 03:13:20 +05:30
WindowsAddict
1f50e4ba98 Allow Office repair on ARM64 as well 2024-08-19 19:53:05 +05:30
WindowsAddict
af7d204c96 Rename file (- to _) 2024-08-19 19:20:52 +05:30
WindowsAddict
0d26ba046e Use %syspath% 2024-08-19 19:07:39 +05:30
WindowsAddict
3fd1666926 Fix color code 2024-08-19 18:43:14 +05:30
WindowsAddict
bf814304c6 Add fix for issues caused by update KB971033 in Windows 7 2024-08-19 18:40:07 +05:30
WindowsAddict
1dfd3f6626 Merge pull request #542 from alouiadel/dev
Rephrase text and fix issue #521
2024-08-19 16:44:46 +05:30
WindowsAddict
79bc7b0242 Avoid a potential crash in wmic.exe check 2024-08-19 06:17:15 +05:30
Adel Aloui
ae48118ddb Rephrase text and fix issue #521 2024-08-19 01:22:08 +01:00
WindowsAddict
b983bd41da Replace square brackets with double quotes in string comparison 2024-08-19 05:29:19 +05:30
WindowsAddict
d55b9fa78c Avoid using pause if Terminal is detected 2024-08-18 05:08:35 +05:30
WindowsAddict
fb113c7c24 Replace wmic.exe with Powershell in fix wmi 2024-08-18 04:48:57 +05:30
WindowsAddict
9efc3e49b9 Show perms error separately for folder and registry 2024-08-18 04:15:20 +05:30
WindowsAddict
a62c3ac36d Optimize checks and fixes for SPP perms, replace slmgr /rilc 2024-08-18 03:44:07 +05:30
WindowsAddict
73eabbff59 Remove WPA check
Already present in activation scripts
2024-08-17 07:17:04 +05:30
WindowsAddict
bc5efae19d Remove Office vNext cleaning code
Its already there in activation scripts
2024-08-17 07:08:19 +05:30
WindowsAddict
deb74ab9b8 Optimize DISM restore and SFC scan log creation 2024-08-17 02:28:32 +05:30
WindowsAddict
d08ed1bd38 Update Troubleshoot script with 2.7 structure 2024-08-17 01:41:42 +05:30
WindowsAddict
5f5a51322d Realign lines related to dashboard app info 2024-08-16 05:14:16 +05:30
WindowsAddict
fd0e25f477 Detect Ohook install in KMS script 2024-08-16 04:34:19 +05:30
WindowsAddict
b33dcb2f72 Update OEM folder script 2024-08-16 04:12:38 +05:30
WindowsAddict
117ba004f0 better check for malware if sppsvc.exe is not found 2024-08-16 03:03:12 +05:30
WindowsAddict
b0d898973f Change wording 2024-08-16 03:00:58 +05:30
WindowsAddict
63b3c5097b Show info regarding Office dashboard app in KMS script 2024-08-14 09:20:42 +05:30
WindowsAddict
69430c6458 Don't create renewal task if VL IDs not found or OEMBIOS error is present and Office VL IDs not found 2024-08-14 08:46:43 +05:30
WindowsAddict
9f57f585d5 Don't show fix licensing solution in some more cases 2024-08-14 06:44:43 +05:30
WindowsAddict
52decdde18 Replace hyphen from evaluation-editions URL 2024-08-13 05:36:51 +05:30
WindowsAddict
35e044ddc8 Evade AV's detection - 7 2024-08-12 05:34:06 +05:30
WindowsAddict
601bd0e420 Add old preview edition keys in KMS38 2024-08-05 06:42:49 +05:30
WindowsAddict
5e4988a634 Add more KMS keys for old preview editions 2024-08-05 06:15:01 +05:30
WindowsAddict
3a050f2da7 Fix eval edition change and show .net 3.5 status 2024-08-04 14:06:08 +05:30
WindowsAddict
31b55fd0e3 Add two more preview editions and sort all of them
EmbeddedIndustryE_TAP-CTP
EmbeddedIndustryE_Beta
2024-07-31 21:38:39 +05:30
WindowsAddict
62d5d5442e Add old preview editions in KMS script 2024-07-31 15:52:49 +05:30
WindowsAddict
f2e6e6e389 Fix SID code in KMS script 2024-07-31 15:19:32 +05:30
WindowsAddict
b5a305a14e Highlight options if unsupported product is detected 2024-07-31 06:35:36 +05:30
WindowsAddict
6c71e82ef3 Fig a bug in server section 2024-07-30 08:56:25 +05:30
WindowsAddict
66e8cda508 Add timeout 2024-07-30 08:43:48 +05:30
WindowsAddict
98027af16d Compress generated logs 2024-07-30 08:41:48 +05:30
WindowsAddict
be45752a21 Add info about edition ID difference 2024-07-30 06:21:01 +05:30
WindowsAddict
a421b12ae4 Add info about how to use a different sppc.dll file 2024-07-29 20:43:55 +05:30
WindowsAddict
d06185d7f7 Highlight skipping of Office activation 2024-07-29 20:31:28 +05:30
WindowsAddict
a46bb78e5e Show info about buy button in Office dashboard app for Zoomers 2024-07-29 01:48:14 +05:30
WindowsAddict
2470963537 Inform to check antivirus block if dll extraction fails 2024-07-28 22:36:55 +05:30
WindowsAddict
89bff68b28 Fix pkeyconfig path 2024-07-28 22:33:18 +05:30
WindowsAddict
191121c3d4 Add more checks in checking user profile SID's 2024-07-28 22:25:36 +05:30
WindowsAddict
7bf55fc6ee Fix bug where 'NETWORK SERVICE' translation is needed 2024-07-28 19:22:13 +05:30
WindowsAddict
816925bfef Ignore log deletion error 2024-07-28 08:03:09 +05:30
WindowsAddict
ad45cf0926 Add red color 2024-07-28 06:56:54 +05:30
WindowsAddict
29eb5bd60d Generate clean logs on desktop on edition change failure and other fixes 2024-07-28 06:54:15 +05:30
WindowsAddict
70b754657f Use random GUID instead of %random% 2024-07-23 07:14:24 +05:30
WindowsAddict
8b58696455 Add a check for old renewal task detection 2024-07-23 06:54:47 +05:30
WindowsAddict
5d47723d07 Show fix_powershell link 2024-07-23 05:12:02 +05:30
WindowsAddict
2b786e3037 Correct a info line in KMS script 2024-07-23 03:17:56 +05:30
WindowsAddict
4451a25e7f Differentiate between new and old outlook detection 2024-07-21 05:02:51 +05:30
WindowsAddict
886745f103 Detect sandboxing 2024-07-21 04:31:33 +05:30
WindowsAddict
5728ba2686 Add check for NT SERVICE\sppsvc 2024-07-20 03:13:45 +05:30
WindowsAddict
ddccc4025f Optimize the code
Thanks to abbodi1406
2024-07-19 21:32:28 +05:30
WindowsAddict
1567903b09 Improve device-based-licensing cleaning 2024-07-19 20:21:27 +05:30
WindowsAddict
f6125eaa5b Add comment about S-1-5-20 SPP registry issue 2024-07-19 20:06:52 +05:30
WindowsAddict
07c4fcdc74 Improve error check of SPP in HKU\S-1-5-20 2024-07-18 04:36:50 +05:30
WindowsAddict
962f7e326a Remove duplicacy of file infector checks 2024-07-17 03:54:38 +05:30
WindowsAddict
6f88a4bf90 More accurate check for Office Products in NoEditionChange mode 2024-07-17 01:19:06 +05:30
14 changed files with 13443 additions and 11920 deletions

7
.gitattributes vendored
View File

@@ -1,3 +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

View File

@@ -672,4 +672,3 @@ may consider it more useful to permit linking proprietary applications with
the library. If this is what you want to do, use the GNU Lesser General
Public License instead of this License. But first, please read
<https://www.gnu.org/licenses/why-not-lgpl.html>.

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -1,4 +1,4 @@
@set masver=2.6
@set masver=2.7
@echo off
@@ -27,7 +27,7 @@ set "_debug=0"
::========================================================================================================================================
:: Set Environment variables, it helps if they are misconfigured in the system
:: Set environment variables, it helps if they are misconfigured in the system
setlocal EnableExtensions
setlocal DisableDelayedExpansion
@@ -160,21 +160,22 @@ call :dk_setvar
if %winbuild% LSS 10240 (
%eline%
echo Unsupported OS version detected [%winbuild%].
echo HWID Activation is supported only for Windows 10/11.
echo Use Online KMS Activation option.
echo HWID Activation is only supported on Windows 10/11.
echo:
call :dk_color %Blue% "Use Online KMS activation option."
goto dk_done
)
if exist "%SystemRoot%\Servicing\Packages\Microsoft-Windows-Server*Edition~*.mum" (
%eline%
echo HWID Activation is not supported for Windows Server.
echo Use KMS38 or Online KMS Activation option.
echo HWID Activation is not supported on Windows Server.
call :dk_color %Blue% "Use KMS38 or Online KMS activation option."
goto dk_done
)
::========================================================================================================================================
:: Fix special characters limitation in path name
:: Fix special character limitations in path name
set "_work=%~dp0"
if "%_work:~-1%"=="\" set "_work=%_work:~0,-1%"
@@ -194,8 +195,8 @@ setlocal EnableDelayedExpansion
echo "!_batf!" | find /i "!_ttemp!" %nul1% && (
if /i not "!_work!"=="!_ttemp!" (
%eline%
echo Script is launched from the temp folder,
echo Most likely you are running the script directly from the archive file.
echo The script was launched from the temp folder.
echo You are most likely running the script directly from the archive file.
echo:
echo Extract the archive file and launch the script from the extracted folder.
goto dk_done
@@ -215,13 +216,16 @@ echo:
cmd /c "%psc% "$ExecutionContext.SessionState.LanguageMode"" | find /i "FullLanguage" %nul1% && (
echo Failed to run Powershell command but Powershell is working.
call :dk_color %Blue% "Check if your antivirus is blocking the script."
) || (
echo PowerShell is not working. Aborting...
echo If you have applied restrictions on Powershell then undo those changes.
)
echo:
set fixes=%fixes% %mas%troubleshoot
call :dk_color2 %Blue% "Help - " %_Yellow% " %mas%troubleshoot"
) || (
echo PowerShell is not working. Aborting...
echo If you have applied restrictions on Powershell then undo those changes.
echo:
set fixes=%fixes% %mas%fix_powershell
call :dk_color2 %Blue% "Help - " %_Yellow% " %mas%fix_powershell"
)
goto dk_done
)
@@ -233,7 +237,7 @@ goto dk_done
if not defined _elev %psc% "start cmd.exe -arg '/c \"!_PSarg!\"' -verb runas" && exit /b
%eline%
echo This script needs admin rights.
echo To do so, right click on this script and select 'Run as administrator'.
echo Right click on this script and select 'Run as administrator'.
goto dk_done
)
@@ -286,20 +290,20 @@ set -=
set old=
for /f "delims=[] tokens=2" %%# in ('ping -4 -n 1 updatecheck.mass%-%grave.dev') do (
if not [%%#]==[] (echo "%%#" | find "127.69" %nul1% && (echo "%%#" | find "127.69.%masver%" %nul1% || set old=1))
if not "%%#"=="" (echo "%%#" | find "127.69" %nul1% && (echo "%%#" | find "127.69.%masver%" %nul1% || set old=1))
)
if defined old (
echo ________________________________________________
%eline%
echo Version %masver% of MAS is outdated.
echo Your version of MAS [%masver%] is outdated.
echo ________________________________________________
echo:
if not %_unattended%==1 (
echo [1] Get Latest MAS
echo [0] Continue Anyway
echo:
call :dk_color %_Green% "Enter a menu option in the Keyboard [1,0] :"
call :dk_color %_Green% "Choose a menu option using your keyboard [1,0] :"
choice /C:10 /N
if !errorlevel!==2 rem
if !errorlevel!==1 (start ht%-%tps://github.com/mass%-%gravel/Microsoft-Acti%-%vation-Scripts & start %mas% & exit /b)
@@ -325,7 +329,7 @@ ClipUp.exe
) do (
if not exist %SysPath%\%%# (
%eline%
echo [%SysPath%\%%#] file is missing. Aborting...
echo [%SysPath%\%%#] file is missing, aborting...
echo:
set fixes=%fixes% %mas%troubleshoot
call :dk_color2 %Blue% "Help - " %_Yellow% " %mas%troubleshoot"
@@ -352,12 +356,12 @@ if defined _perm (
cls
echo ___________________________________________________________________________________________
echo:
call :dk_color2 %_White% " " %Green% "Checking: %winos% is Permanently Activated."
call :dk_color2 %_White% " " %Green% "%winos% is already permanently activated."
call :dk_color2 %_White% " " %Gray% "Activation is not required."
echo ___________________________________________________________________________________________
if %_unattended%==1 goto dk_done
echo:
choice /C:10 /N /M "> [1] Activate [0] %_exitmsg% : "
choice /C:10 /N /M "> [1] Activate Anyway [0] %_exitmsg% : "
if errorlevel 2 exit /b
)
cls
@@ -371,10 +375,10 @@ reg query "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion" /v EditionID %nul2
%eline%
echo [%winos% ^| %winbuild%]
echo:
echo Evaluation Editions cannot be activated outside of evaluation period.
echo Evaluation editions cannot be activated outside of their evaluation period.
echo:
set fixes=%fixes% %mas%evaluation-editions
call :dk_color2 %Blue% "Help - " %_Yellow% " %mas%evaluation-editions"
set fixes=%fixes% %mas%evaluation_editions
call :dk_color2 %Blue% "Help - " %_Yellow% " %mas%evaluation_editions"
goto dk_done
)
)
@@ -391,7 +395,7 @@ call :dk_showosinfo
set _int=
for %%a in (l.root-servers.net resolver1.opendns.com download.windowsupdate.com google.com) do if not defined _int (
for /f "delims=[] tokens=2" %%# in ('ping -n 1 %%a') do (if not [%%#]==[] set _int=1)
for /f "delims=[] tokens=2" %%# in ('ping -n 1 %%a') do (if not "%%#"=="" set _int=1)
)
if not defined _int (
@@ -404,7 +408,7 @@ echo Checking Internet Connection [Connected%ping_f%]
) else (
set error=1
call :dk_color %Red% "Checking Internet Connection [Not Connected]"
call :dk_color %Blue% "Internet is required for HWID Activation."
call :dk_color %Blue% "Internet is required for HWID activation."
)
::========================================================================================================================================
@@ -453,13 +457,13 @@ if not defined key (
%eline%
echo [%winos% ^| %winbuild% ^| SKU:%osSKU%]
if not defined skunotfound (
echo This product does not support HWID Activation.
echo Try KMS38 Activation option.
echo Make sure you are using updated version of the script.
echo This product does not support HWID activation.
echo Make sure you are using the latest version of the script.
echo If you are, then try KMS38 activation option.
set fixes=%fixes% %mas%
echo %mas%
) else (
echo Required License files not found in %SysPath%\spp\tokens\skus\
echo Required license files not found in %SysPath%\spp\tokens\skus\
set fixes=%fixes% %mas%troubleshoot
call :dk_color2 %Blue% "Help - " %_Yellow% " %mas%troubleshoot"
)
@@ -475,12 +479,12 @@ if defined notworking set error=1
echo:
if defined changekey (
call :dk_color %Blue% "[%altedition%] Edition product key will be used to enable HWID activation."
call :dk_color %Blue% "[%altedition%] edition product key will be used to enable HWID activation."
echo:
)
if defined winsub (
call :dk_color %Blue% "Windows Subscription [SKU ID-%slcSKU%] found. Script will activate base edition [SKU ID-%regSKU%]."
call :dk_color %Blue% "Windows Subscription [SKU ID-%slcSKU%] detected. Script will activate base edition [SKU ID-%regSKU%]."
echo:
)
@@ -522,7 +526,7 @@ call :hwiddata ticket
copy /y /b "%tdir%\GenuineTicket" "%tdir%\GenuineTicket.xml" %nul%
if not exist "%tdir%\GenuineTicket.xml" (
call :dk_color %Red% "Generating GenuineTicket.xml [Failed, aborting the process]"
call :dk_color %Red% "Generating GenuineTicket.xml [Failed, aborting...]"
echo [%encoded%]
if exist "%tdir%\Genuine*" del /f /q "%tdir%\Genuine*" %nul%
goto :dl_final
@@ -540,7 +544,7 @@ set "_xmlexist=if exist "%tdir%\GenuineTicket.xml""
%_xmlexist% (
set error=1
if exist "%tdir%\*.xml" del /f /q "%tdir%\*.xml" %nul%
call :dk_color %Red% "Installing GenuineTicket.xml [Failed With ClipSVC Service Restart, Wait...]"
call :dk_color %Red% "Installing GenuineTicket.xml [Failed with ClipSVC service restart, wait...]"
)
)
@@ -600,7 +604,7 @@ reg delete "%_ident%" /f %nul%
reg query "%_ident%" %nul% && (
echo:
set error=1
call :dk_color %Red% "Deleting an IdentityCRL Registry [Failed] [%_ident%]"
call :dk_color %Red% "Deleting IdentityCRL Registry [Failed] [%_ident%]"
)
for %%# in (wlidsvc LicenseManager sppsvc) do (%psc% "Start-Job { Restart-Service %%# } | Wait-Job -Timeout 10 | Out-Null")
call :dk_refresh
@@ -635,7 +639,7 @@ if not defined resfail (
if defined resfail (
set error=1
echo:
call :dk_color %Red% "Checking Licensing Servers [Failed To Connect]"
call :dk_color %Red% "Checking Licensing Servers [Failed to Connect]"
set fixes=%fixes% %mas%licensing-servers-issue
call :dk_color2 %Blue% "Help - " %_Yellow% " %mas%licensing-servers-issue"
)
@@ -698,8 +702,8 @@ call :dk_color %Green% "%winos% is permanently activated with a digital license.
) else (
call :dk_color %Red% "Activation Failed %error_code%"
if defined notworking (
call :dk_color %Blue% "At the time of writing this, HWID Activation was not supported for this product."
call :dk_color %Blue% "Use KMS38 Activation option."
call :dk_color %Blue% "At the time of writing, HWID Activation is not supported for this product."
call :dk_color %Blue% "Use KMS38 activation option instead."
) else (
if not defined error call :dk_color %Blue% "%_fixmsg%"
set fixes=%fixes% %mas%troubleshoot
@@ -751,6 +755,7 @@ set "Red="41;97m""
set "Gray="100;97m""
set "Green="42;97m""
set "Blue="44;97m""
set "_Red="40;91m""
set "_White="40;37m""
set "_Green="40;92m""
set "_Yellow="40;93m""
@@ -759,6 +764,7 @@ set "Red="Red" "white""
set "Gray="Darkgray" "white""
set "Green="DarkGreen" "white""
set "Blue="Blue" "white""
set "_Red="Black" "Red""
set "_White="Black" "Gray""
set "_Green="Black" "Green""
set "_Yellow="Black" "Yellow""
@@ -986,7 +992,7 @@ function ReinstallLicenses() {
set _wmic=0
for %%# in (wmic.exe) do @if not "%%~$PATH:#"=="" (
wmic path Win32_ComputerSystem get CreationClassName /value %nul2% | find /i "computersystem" %nul1% && set _wmic=1
cmd /c "wmic path Win32_ComputerSystem get CreationClassName /value" %nul2% | find /i "computersystem" %nul1% && set _wmic=1
)
exit /b
@@ -994,7 +1000,6 @@ exit /b
:dk_sppissue
set w=
sc start sppsvc %nul%
set spperror=%errorlevel%
@@ -1003,14 +1008,6 @@ if %spperror% NEQ 1056 if %spperror% NEQ 0 (
echo sc start sppsvc [Error Code: %spperror%]
)
echo "%spperror%" | findstr "577 225" %nul% && (
echo:
echo Your system is most likely infected with Mal%w%ware.
echo:
set fixes=%fixes% %mas%remove_mal%w%ware
call :dk_color2 %Blue% "Help - " %_Yellow% " %mas%remove_mal%w%ware"
)
echo:
%psc% "$job = Start-Job { (Get-WmiObject -Query 'SELECT * FROM %sps%').Version }; if (-not (Wait-Job $job -Timeout 20)) {write-host 'sppsvc is not working correctly. Help - %mas%troubleshoot'}"
exit /b
@@ -1075,7 +1072,7 @@ set pupfound=%pupfound1%%pupfound2%
set hcount=0
for %%# in (avira.com kaspersky.com virustotal.com mcafee.com) do (
find /i "%%#" %SysPath%\drivers\etc\hosts %nul% && set /a hcount+=1)
if %hcount%==4 set "results=[AV URLs are blocked in hosts]"
if %hcount%==4 set "results=[Antivirus URLs are blocked in hosts]"
set wucount=0
for %%# in (wuauserv) do (
@@ -1084,14 +1081,19 @@ for %%G in (DependOnService Description DisplayName ErrorControl ImagePath Objec
reg query HKLM\SYSTEM\CurrentControlSet\Services\%%# /v %%G %nul% || (set _corrupt=1 & set /a wucount+=1)
)
)
if %wucount% GEQ 1 set "results=%results%[WU registry is corrupt]"
if %wucount% GEQ 1 set "results=%results%[Windows Update registry is corrupt]"
sc start sppsvc %nul%
echo "%errorlevel%" | findstr "577 225" %nul% && set "results=%results%[Likely File Infector]"
echo "%errorlevel%" | findstr "577 225" %nul% && (
set "results=%results%[Likely File Infector]"
) || (
if not exist %SysPath%\sppsvc.exe if not exist %SysPath%\alg.exe (set "results=%results%[Likely File Infector]")
)
if not "%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 %results%"
if defined results call :dk_color %Red% "Checking Probable Mal%w%ware Infection..."
if defined results call :dk_color %Red% "%results%"
set fixes=%fixes% %mas%remove_mal%w%ware
call :dk_color2 %Blue% "Help - " %_Yellow% " %mas%remove_mal%w%ware"
echo:
@@ -1105,6 +1107,18 @@ exit /b
set showfix=
call :dk_chkmal
:: Check Sandboxing
sc query Null %nul% || (
set error=1
set showfix=1
call :dk_color %Red% "Checking Sandboxing [Found, script may not work properly.]"
call :dk_color %Blue% "If you are using any third-party antivirus, check if it is blocking the script."
echo:
)
::========================================================================================================================================
:: Check corrupt services
set serv_cor=
@@ -1122,6 +1136,7 @@ if defined _corrupt (if defined serv_cor (set "serv_cor=!serv_cor! %%#") else (s
if defined serv_cor (
set error=1
set showfix=1
call :dk_color %Red% "Checking Corrupt Services [%serv_cor%]"
)
@@ -1188,7 +1203,7 @@ if defined serv_e (
set error=1
call :dk_color %Red% "Starting Services [Failed] [%serv_e%]"
echo %serv_e% | findstr /i "ClipSVC-1058 sppsvc-1058" %nul% && (
call :dk_color %Blue% "Restart the system to fix this error."
call :dk_color %Blue% "Reboot your machine using the restart option to fix this error."
set showfix=1
)
)
@@ -1228,7 +1243,7 @@ for /f "delims=" %%a in ('%psc% "$f=[io.file]::ReadAllText('!_batp!') -split ':w
echo "%wpainfo%" | find /i "Error Found" %nul% && (
set error=1
set wpaerror=1
call :dk_color %Red% "Checking WPA Registry Error [%wpainfo%]"
call :dk_color %Red% "Checking WPA Registry Errors [%wpainfo%]"
) || (
echo Checking WPA Registry Count [%wpainfo%]
)
@@ -1238,8 +1253,8 @@ if not defined officeact if exist "%SystemRoot%\Servicing\Packages\Microsoft-Win
reg query "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion" /v EditionID %nul2% | find /i "Eval" %nul1% || (
set error=1
call :dk_color %Red% "Checking Eval Packages [Non-Eval Licenses are installed in Eval Windows]"
set fixes=%fixes% %mas%evaluation-editions
call :dk_color2 %Blue% "Help - " %_Yellow% " %mas%evaluation-editions"
set fixes=%fixes% %mas%evaluation_editions
call :dk_color2 %Blue% "Help - " %_Yellow% " %mas%evaluation_editions"
)
)
@@ -1267,7 +1282,7 @@ call :dk_color %Red% "Checking License Files [Not Found] [%osed
if not exist "%SystemRoot%\Servicing\Packages\Microsoft-Windows-*-%osedition%-*.mum" (
set error=1
call :dk_color %Red% "Checking Package File [Not Found] [%osedition%]"
call :dk_color %Red% "Checking Package Files [Not Found] [%osedition%]"
)
)
)
@@ -1292,7 +1307,7 @@ echo "%error_code%" | findstr /i "0x800410 0x800440" %nul1% && set wmifailed=1&
if defined wmifailed (
set error=1
call :dk_color %Red% "Checking WMI [Not Working]"
call :dk_color %Blue% "Go back to Main Menu, select Troubleshoot and run Fix WMI option."
if not defined showfix call :dk_color %Blue% "Go back to Main Menu, select Troubleshoot and run Fix WMI option."
set showfix=1
)
@@ -1336,26 +1351,25 @@ echo Checking Eval WLMS Service [Found]
)
reg query "HKU\S-1-5-20" %nul% && (
if %winbuild% GEQ 15063 reg query "HKU\S-1-5-20\Software\Microsoft\Windows NT\CurrentVersion\SoftwareProtectionPlatform" %nul% || (
reg query "HKU\S-1-5-20\Software\Microsoft\Windows NT\CurrentVersion" %nul% || (
set error=1
call :dk_color %Red% "Checking S-1-5-20 SPP Reg [Not Found]"
set fixes=%fixes% %mas%troubleshoot
call :dk_color2 %Blue% "Help - " %_Yellow% " %mas%troubleshoot"
)
) || (
set error=1
call :dk_color %Red% "Checking HKU\S-1-5-20 Reg [Not Found]"
call :dk_color %Red% "Checking HKU\S-1-5-20 Registry [Not Found]"
set fixes=%fixes% %mas%troubleshoot
call :dk_color2 %Blue% "Help - " %_Yellow% " %mas%troubleshoot"
)
for %%# in (SppEx%w%tComObj.exe sppsvc.exe) do (
for %%# in (SppEx%w%tComObj.exe sppsvc.exe sppsvc.exe\PerfOptions) do (
reg query "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Ima%w%ge File Execu%w%tion Options\%%#" %nul% && (if defined _sppint (set "_sppint=!_sppint!, %%#") else (set "_sppint=%%#"))
)
if defined _sppint (
echo Checking SPP Interference In IFEO [%_sppint%]
echo %_sppint% | find /i "PerfOptions" %nul% && (
call :dk_color %Red% "Checking SPP Interference In IFEO [%_sppint% - System might deactivate later]"
if not defined showfix call :dk_color %Blue% "%_fixmsg%"
set showfix=1
) || (
echo Checking SPP In IFEO [%_sppint%]
)
)
@@ -1370,7 +1384,7 @@ set error=1
reg query "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\SoftwareProtectionPlatform\Plugins\Objects\msft:rm/algorithm/hwid/4.0" /f ba02fed39662 /d %nul% || (
call :dk_color %Red% "Checking SPP Registry Key [Incorrect ModuleId Found]"
set fixes=%fixes% %mas%issues_due_to_gaming_spoofers
call :dk_color2 %Blue% "Possibly Caused By Gaming Spoofers. Help - " %_Yellow% " %mas%issues_due_to_gaming_spoofers"
call :dk_color2 %Blue% "Most likely caused by HWID spoofers. Help - " %_Yellow% " %mas%issues_due_to_gaming_spoofers"
set error=1
set showfix=1
)
@@ -1400,10 +1414,11 @@ set "d=!d! $AclObject.SetSecurityDescriptorSddlForm($sddl);"
set "d=!d! Set-Acl -Path %tokenstore% -AclObject $AclObject;"
%psc% "!d!" %nul%
if exist "%tokenstore%\" (
call :dk_color %Gray% "Checking SPP Token Folder [Not Found. Created Now] [%tokenstore%\]"
call :dk_color %Gray% "Checking SPP Token Folder [Not Found, Created Now] [%tokenstore%\]"
) else (
call :dk_color %Red% "Checking SPP Token Folder [Not Found. Failed To Create] [%tokenstore%\]"
call :dk_color %Red% "Checking SPP Token Folder [Not Found, Failed to Create] [%tokenstore%\]"
set error=1
set showfix=1
)
)
@@ -1435,30 +1450,48 @@ for /f "delims=" %%a in ('%psc% "(Get-ScheduledTask -TaskName 'SvcRestartTask' -
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
call :dk_color %Red% "Checking SvcRestartTask Status [!taskinfo!]"
call :dk_color %Red% "Checking SvcRestartTask Status [!taskinfo!, System might deactivate later]"
)
)
:: This code checks if NT SERVICE\sppsvc has permission access to tokens folder and required registry keys. It's often caused by gaming spoofers.
:: This code checks if SPP has permission access to tokens folder and required registry keys. It's often caused by gaming spoofers.
set permerror=
if not exist "%tokenstore%\" set permerror=1
if %winbuild% GEQ 9200 for %%# in (
if %winbuild% GEQ 9200 (
for %%# in (
"%tokenstore%+FullControl"
"HKLM:\SYSTEM\WPA+QueryValues, EnumerateSubKeys, WriteKey"
"HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion\SoftwareProtectionPlatform+SetValue"
) do for /f "tokens=1,2 delims=+" %%A in (%%#) do if not defined permerror (
%psc% "$acl = (Get-Acl '%%A' | fl | Out-String); if (-not ($acl -match 'NT SERVICE\\sppsvc Allow %%B') -or ($acl -match 'NT SERVICE\\sppsvc Deny')) {Exit 2}" %nul%
if !errorlevel!==2 set permerror=1
if !errorlevel!==2 (
if "%%A"=="%tokenstore%" (
set "permerror=Error Found In Token Folder"
) else (
set "permerror=Error Found In SPP Registries"
)
)
)
if %winbuild% GEQ 9200 if defined permerror (
REM https://learn.microsoft.com/office/troubleshoot/activation/license-issue-when-start-office-application
if not defined permerror (
reg query "HKU\S-1-5-20\Software\Microsoft\Windows NT\CurrentVersion" %nul% && (
set "pol=HKU\S-1-5-20\Software\Microsoft\Windows NT\CurrentVersion\SoftwareProtectionPlatform\Policies"
reg query "!pol!" %nul% || reg add "!pol!" %nul%
%psc% "$netServ = (New-Object Security.Principal.SecurityIdentifier('S-1-5-20')).Translate([Security.Principal.NTAccount]).Value; $aclString = Get-Acl 'Registry::!pol!' | Format-List | Out-String; if (-not ($aclString.Contains($netServ + ' Allow FullControl') -or $aclString.Contains('NT SERVICE\sppsvc Allow FullControl')) -or ($aclString.Contains('Deny'))) {Exit 3}" %nul%
if !errorlevel!==3 set "permerror=Error Found In S-1-5-20 SPP"
)
)
if defined permerror (
set error=1
call :dk_color %Red% "Checking SPP Permissions [Error Found]"
call :dk_color %Red% "Checking SPP Permissions [!permerror!]"
if not defined showfix call :dk_color %Blue% "%_fixmsg%"
set showfix=1
)
)
:: If required services are not disabled or corrupted + if there is any error + SoftwareLicensingService errorlevel is not Zero + no fix was shown before
@@ -1501,7 +1534,7 @@ if ($osVersion.Build -ge $minBuildNumber) {
}
for ($i=1; $i -le $count; $i++) {
if (-not $subkeyHashTable.ContainsKey("$i")) {
Write-Output "Total Keys $count. Error Found- $i key does not exist"
Write-Output "Total Keys $count. Error Found - $i key does not exist."
$wpaKey.Close()
exit
}
@@ -1512,7 +1545,7 @@ $wpaKey.GetSubKeyNames() | ForEach-Object {
if ($PSVersionTable.PSVersion.Major -lt 3) {
cmd /c "reg query "HKLM\SYSTEM\WPA\$_" /ve /t REG_BINARY >nul 2>&1"
if ($LASTEXITCODE -ne 0) {
Write-Host "Total Keys $count. Error Found- Binary Data is corrupt"
Write-Host "Total Keys $count. Error Found - Binary Data is corrupt."
$wpaKey.Close()
exit
}
@@ -1520,7 +1553,7 @@ $wpaKey.GetSubKeyNames() | ForEach-Object {
$subkey = $wpaKey.OpenSubKey($_)
$p = $subkey.GetValueNames()
if (($p | Where-Object { $subkey.GetValueKind($_) -eq [Microsoft.Win32.RegistryValueKind]::Binary }).Count -eq 0) {
Write-Host "Total Keys $count. Error Found- Binary Data is corrupt"
Write-Host "Total Keys $count. Error Found - Binary Data is corrupt."
$wpaKey.Close()
exit
}
@@ -1559,13 +1592,13 @@ echo:
if %_unattended%==1 timeout /t 2 & exit /b
if defined fixes (
call :dk_color2 %Blue% "Press [1] To Open Troubleshoot Page " %Gray% " Press [0] To Ignore"
call :dk_color2 %Blue% "Press [1] to Open Troubleshoot Page " %Gray% " Press [0] to Ignore"
choice /C:10 /N
if !errorlevel!==1 (for %%# in (%fixes%) do (start %%#))
)
if defined terminal (
call :dk_color %_Yellow% "Press 0 key to %_exitmsg%..."
call :dk_color %_Yellow% "Press [0] key to %_exitmsg%..."
choice /c 0 /n
) else (
call :dk_color %_Yellow% "Press any key to %_exitmsg%..."

View File

@@ -1,4 +1,4 @@
@set masver=2.6
@set masver=2.7
@echo off
@@ -30,7 +30,7 @@ set "_debug=0"
::========================================================================================================================================
:: Set Environment variables, it helps if they are misconfigured in the system
:: Set environment variables, it helps if they are misconfigured in the system
setlocal EnableExtensions
setlocal DisableDelayedExpansion
@@ -166,13 +166,19 @@ set "specific_kms=SOFTWARE\Microsoft\Windows NT\CurrentVersion\SoftwareProtectio
if %winbuild% LSS 14393 (
%eline%
echo Unsupported OS version detected [%winbuild%].
echo KMS38 Activation is supported for Windows 10/11/Server, build 14393 and later.
echo KMS38 activation is only supported on Windows 10/11/Server, build 14393 and later.
echo:
if %winbuild% LSS 10240 (
call :dk_color %Blue% "Use Online KMS activation option."
) else (
call :dk_color %Blue% "Use HWID activation option."
)
goto dk_done
)
::========================================================================================================================================
:: Fix special characters limitation in path name
:: Fix special character limitations in path name
set "_work=%~dp0"
if "%_work:~-1%"=="\" set "_work=%_work:~0,-1%"
@@ -192,8 +198,8 @@ setlocal EnableDelayedExpansion
echo "!_batf!" | find /i "!_ttemp!" %nul1% && (
if /i not "!_work!"=="!_ttemp!" (
%eline%
echo Script is launched from the temp folder,
echo Most likely you are running the script directly from the archive file.
echo The script was launched from the temp folder.
echo You are most likely running the script directly from the archive file.
echo:
echo Extract the archive file and launch the script from the extracted folder.
goto dk_done
@@ -213,13 +219,16 @@ echo:
cmd /c "%psc% "$ExecutionContext.SessionState.LanguageMode"" | find /i "FullLanguage" %nul1% && (
echo Failed to run Powershell command but Powershell is working.
call :dk_color %Blue% "Check if your antivirus is blocking the script."
) || (
echo PowerShell is not working. Aborting...
echo If you have applied restrictions on Powershell then undo those changes.
)
echo:
set fixes=%fixes% %mas%troubleshoot
call :dk_color2 %Blue% "Help - " %_Yellow% " %mas%troubleshoot"
) || (
echo PowerShell is not working. Aborting...
echo If you have applied restrictions on Powershell then undo those changes.
echo:
set fixes=%fixes% %mas%fix_powershell
call :dk_color2 %Blue% "Help - " %_Yellow% " %mas%fix_powershell"
)
goto dk_done
)
@@ -231,7 +240,7 @@ goto dk_done
if not defined _elev %psc% "start cmd.exe -arg '/c \"!_PSarg!\"' -verb runas" && exit /b
%eline%
echo This script needs admin rights.
echo To do so, right click on this script and select 'Run as administrator'.
echo Right click on this script and select 'Run as administrator'.
goto dk_done
)
@@ -284,20 +293,20 @@ set -=
set old=
for /f "delims=[] tokens=2" %%# in ('ping -4 -n 1 updatecheck.mass%-%grave.dev') do (
if not [%%#]==[] (echo "%%#" | find "127.69" %nul1% && (echo "%%#" | find "127.69.%masver%" %nul1% || set old=1))
if not "%%#"=="" (echo "%%#" | find "127.69" %nul1% && (echo "%%#" | find "127.69.%masver%" %nul1% || set old=1))
)
if defined old (
echo ________________________________________________
%eline%
echo Version %masver% of MAS is outdated.
echo Your version of MAS [%masver%] is outdated.
echo ________________________________________________
echo:
if not %_unattended%==1 (
echo [1] Get Latest MAS
echo [0] Continue Anyway
echo:
call :dk_color %_Green% "Enter a menu option in the Keyboard [1,0] :"
call :dk_color %_Green% "Choose a menu option using your keyboard [1,0] :"
choice /C:10 /N
if !errorlevel!==2 rem
if !errorlevel!==1 (start ht%-%tps://github.com/mass%-%gravel/Microsoft-Acti%-%vation-Scripts & start %mas% & exit /b)
@@ -320,7 +329,7 @@ echo:
echo:
echo:
echo:
echo ____________________________________________________________
echo: ______________________________________________________
echo:
echo [1] KMS38 Activation
echo ____________________________________________
@@ -328,9 +337,9 @@ echo:
echo [2] Remove KM38 Protection
echo:
echo [0] %_exitmsg%
echo ____________________________________________________________
echo: ______________________________________________________
echo:
call :dk_color2 %_White% " " %_Green% "Enter a menu option in the Keyboard [1,2,0]"
call :dk_color2 %_White% " " %_Green% "Choose a menu option using your keyboard [1,2,0]"
choice /C:120 /N
set _el=!errorlevel!
if !_el!==3 exit /b
@@ -360,7 +369,7 @@ if not exist %SysPath%\ClipUp.exe if not defined a_cor (set _fmiss=%_fmiss%ClipU
if defined _fmiss (
%eline%
echo [%_fmiss%] file is missing. Aborting...
echo [%_fmiss%] file is missing, aborting...
echo:
set fixes=%fixes% %mas%troubleshoot
call :dk_color2 %Blue% "Help - " %_Yellow% " %mas%troubleshoot"
@@ -386,12 +395,12 @@ if defined _perm (
cls
echo ___________________________________________________________________________________________
echo:
call :dk_color2 %_White% " " %Green% "Checking: %winos% is Permanently Activated."
call :dk_color2 %_White% " " %Green% "%winos% is already permanently activated."
call :dk_color2 %_White% " " %Gray% "Activation is not required."
echo ___________________________________________________________________________________________
if %_unattended%==1 goto dk_done
echo:
choice /C:10 /N /M "> [1] Activate [0] %_exitmsg% : "
choice /C:10 /N /M "> [1] Activate Anyway [0] %_exitmsg% : "
if errorlevel 2 exit /b
)
cls
@@ -416,10 +425,10 @@ echo Server Evaluation cannot be activated. Convert it to full Server OS.
echo:
call :dk_color %Blue% "Go Back to main menu and use [Change Edition] option."
) else (
echo Evaluation Editions cannot be activated outside of evaluation period.
echo Evaluation editions cannot be activated outside of their evaluation period.
echo:
set fixes=%fixes% %mas%evaluation-editions
call :dk_color2 %Blue% "Help - " %_Yellow% " %mas%evaluation-editions"
set fixes=%fixes% %mas%evaluation_editions
call :dk_color2 %Blue% "Help - " %_Yellow% " %mas%evaluation_editions"
)
goto dk_done
)
@@ -432,11 +441,22 @@ goto dk_done
if defined a_cor (
if not exist "!_work!\clipup.exe" (
%eline%
echo clipup.exe doesn't exist in Server Cor/Acor [No GUI] version.
echo It's required for KMS38 Activation.
echo Check below page on how to activate it.
set fixes=%fixes% %mas%kms38
echo %mas%kms38
echo clipup.exe doesn't exist in Server Cor/Acor [No GUI] versions.
echo The file is required for KMS38 activation.
echo Check the below page for instructions on how to activate it.
call :dk_color2 %Blue% "Help - " %_Yellow% " %mas%kms38"
goto dk_done
)
)
:: Check file signature
if defined a_cor (
%psc% "if (-not (Get-AuthenticodeSignature -FilePath '!_work!\clipup.exe').IsOSBinary) {Exit 3}" %nul%
if !errorlevel!==3 (
%eline%
echo Valid digital signature not found in clipup.exe file.
call :dk_color2 %Blue% "Help - " %_Yellow% " %mas%troubleshoot"
goto dk_done
)
)
@@ -487,24 +507,24 @@ set /a UBR=0
if %osSKU%==191 if defined altkey if defined altedition (
for /f "skip=2 tokens=2*" %%a in ('reg query "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion" /v UBR %nul6%') do if not errorlevel 1 set /a UBR=%%b
if %winbuild% LSS 22598 if !UBR! LSS 2788 (
call :dk_color %Blue% "Windows must to be updated to build 19044.2788 or higher for IotEnterpriseS KMS38 activation."
call :dk_color %Blue% "Windows must be updated to build 19044.2788 or higher for IotEnterpriseS KMS38 activation."
)
)
if not defined key if defined notfoundaltactID (
call :dk_color %Red% "Checking Alternate Edition For KMS38 [%altedition% Activation ID Not Found]"
call :dk_color %Red% "Checking Alternate Edition for KMS38 [%altedition% Activation ID Not Found]"
)
if not defined key if not defined _gvlk (
%eline%
echo [%winos% ^| %winbuild% ^| SKU:%osSKU%]
if not defined skunotfound (
echo This product does not support KMS38 Activation.
echo Make sure you are using updated version of the script.
echo This product does not support KMS38 activation.
echo Make sure you are using the latest version of the script.
set fixes=%fixes% %mas%
echo %mas%
) else (
echo Required License files not found in %SysPath%\spp\tokens\skus\
echo Required license files were not found in %SysPath%\spp\tokens\skus\
set fixes=%fixes% %mas%troubleshoot
call :dk_color2 %Blue% "Help - " %_Yellow% " %mas%troubleshoot"
)
@@ -518,12 +538,12 @@ goto dk_done
echo:
if defined changekey (
call :dk_color %Blue% "[%altedition%] Edition product key will be used to enable KMS38 activation."
call :dk_color %Blue% "[%altedition%] edition product key will be used to enable KMS38 activation."
echo:
)
if defined winsub (
call :dk_color %Blue% "Windows Subscription [SKU ID-%slcSKU%] found. Script will activate base edition [SKU ID-%regSKU%]."
call :dk_color %Blue% "Windows Subscription edition [SKU ID-%slcSKU%] found. Script will activate the base edition [SKU ID-%regSKU%]."
echo:
)
@@ -620,7 +640,7 @@ set "sessionId=TwBTAE0AYQBqAG8AcgBWAGUAcgBzAGkAbwBuAD0ANQA7AE8AUwBNAGkAbgBvAHIAV
copy /y /b "%tdir%\GenuineTicket" "%tdir%\GenuineTicket.xml" %nul%
if not exist "%tdir%\GenuineTicket.xml" (
call :dk_color %Red% "Generating GenuineTicket.xml [Failed, aborting the process]"
call :dk_color %Red% "Generating GenuineTicket.xml [Failed, aborting...]"
if exist "%tdir%\Genuine*" del /f /q "%tdir%\Genuine*" %nul%
goto :k_final
) else (
@@ -647,7 +667,7 @@ call :dk_color %Gray% "Stopping sppsvc Service [Failed]"
%_xmlexist% (
set error=1
if exist "%tdir%\*.xml" del /f /q "%tdir%\*.xml" %nul%
call :dk_color %Red% "Installing GenuineTicket.xml [Failed With ClipSVC Service Restart, Wait...]"
call :dk_color %Red% "Installing GenuineTicket.xml [Failed with ClipSVC service restart, wait...]"
)
)
@@ -723,16 +743,16 @@ call :dk_color2 %Blue% "Help - " %_Yellow% " %mas%troubleshoot"
:k_final
:: Remove the added Specific KMS Host (Local Host) if activation is not completed
:: Remove the specific KMS host (LocalHost) added by the script if activation is not completed
echo:
if not defined _k38 (
%nul% reg delete "HKLM\%specific_kms%" /f
%nul% reg delete "HKU\S-1-5-20\%specific_kms%" /f
%nul% reg query "HKLM\%specific_kms%" && (
call :dk_color %Red% "Removing The Added Specific KMS Host [Failed]"
call :dk_color %Red% "Removing the Added Specific KMS Host [Failed]"
) || (
echo Removing The Added Specific KMS Host [Successful]
echo Removing the Added Specific KMS Host [Successful]
)
)
@@ -742,9 +762,9 @@ if defined _k38 (
%psc% "$f=[io.file]::ReadAllText('!_batp!') -split ':regdel\:.*';& ([ScriptBlock]::Create($f[1])) -protect"
%nul% reg delete "HKLM\%specific_kms%" /f
%nul% reg query "HKLM\%specific_kms%" && (
echo Protect KMS38 From KMS [Successful] [Locked A Registry Key]
echo Protect KMS38 From KMS [Successful] [Locked a Registry Key]
) || (
call :dk_color %Red% "Protect KMS38 From KMS [Failed To Lock A Registry Key]"
call :dk_color %Red% "Protect KMS38 From KMS [Failed to Lock a Registry Key]"
)
)
@@ -754,9 +774,9 @@ if defined a_cor if exist "%_clipup%" del /f /q "%_clipup%" %nul%
if defined a_cor (
if exist "%_clipup%" (
call :dk_color %Red% "Deleting copied clipup.exe file [Failed]"
call :dk_color %Red% "Deleting Copied clipup.exe File [Failed]"
) else (
echo Deleting copied clipup.exe file [Successful]
echo Deleting Copied clipup.exe File [Successful]
)
)
@@ -846,6 +866,7 @@ set "Red="41;97m""
set "Gray="100;97m""
set "Green="42;97m""
set "Blue="44;97m""
set "_Red="40;91m""
set "_White="40;37m""
set "_Green="40;92m""
set "_Yellow="40;93m""
@@ -854,6 +875,7 @@ set "Red="Red" "white""
set "Gray="Darkgray" "white""
set "Green="DarkGreen" "white""
set "Blue="Blue" "white""
set "_Red="Black" "Red""
set "_White="Black" "Gray""
set "_Green="Black" "Green""
set "_Yellow="Black" "Yellow""
@@ -1079,7 +1101,7 @@ function ReinstallLicenses() {
set _wmic=0
for %%# in (wmic.exe) do @if not "%%~$PATH:#"=="" (
wmic path Win32_ComputerSystem get CreationClassName /value %nul2% | find /i "computersystem" %nul1% && set _wmic=1
cmd /c "wmic path Win32_ComputerSystem get CreationClassName /value" %nul2% | find /i "computersystem" %nul1% && set _wmic=1
)
exit /b
@@ -1087,7 +1109,6 @@ exit /b
:dk_sppissue
set w=
sc start sppsvc %nul%
set spperror=%errorlevel%
@@ -1096,14 +1117,6 @@ if %spperror% NEQ 1056 if %spperror% NEQ 0 (
echo sc start sppsvc [Error Code: %spperror%]
)
echo "%spperror%" | findstr "577 225" %nul% && (
echo:
echo Your system is most likely infected with Mal%w%ware.
echo:
set fixes=%fixes% %mas%remove_mal%w%ware
call :dk_color2 %Blue% "Help - " %_Yellow% " %mas%remove_mal%w%ware"
)
echo:
%psc% "$job = Start-Job { (Get-WmiObject -Query 'SELECT * FROM %sps%').Version }; if (-not (Wait-Job $job -Timeout 20)) {write-host 'sppsvc is not working correctly. Help - %mas%troubleshoot'}"
exit /b
@@ -1188,7 +1201,7 @@ for %%# in (pkeyhelper.dll) do @if "%%~$PATH:#"=="" exit /b
for %%# in (Volume:GVLK) do (
call :k_pkey %osSKU% '%%#'
if defined pkey call :k_pkeychannel !pkey!
if /i [!pkeychannel!]==[%%#] (
if /i "!pkeychannel!"=="%%#" (
set key=!pkey!
exit /b
)
@@ -1213,7 +1226,7 @@ set pupfound=%pupfound1%%pupfound2%
set hcount=0
for %%# in (avira.com kaspersky.com virustotal.com mcafee.com) do (
find /i "%%#" %SysPath%\drivers\etc\hosts %nul% && set /a hcount+=1)
if %hcount%==4 set "results=[AV URLs are blocked in hosts]"
if %hcount%==4 set "results=[Antivirus URLs are blocked in hosts]"
set wucount=0
for %%# in (wuauserv) do (
@@ -1222,14 +1235,19 @@ for %%G in (DependOnService Description DisplayName ErrorControl ImagePath Objec
reg query HKLM\SYSTEM\CurrentControlSet\Services\%%# /v %%G %nul% || (set _corrupt=1 & set /a wucount+=1)
)
)
if %wucount% GEQ 1 set "results=%results%[WU registry is corrupt]"
if %wucount% GEQ 1 set "results=%results%[Windows Update registry is corrupt]"
sc start sppsvc %nul%
echo "%errorlevel%" | findstr "577 225" %nul% && set "results=%results%[Likely File Infector]"
echo "%errorlevel%" | findstr "577 225" %nul% && (
set "results=%results%[Likely File Infector]"
) || (
if not exist %SysPath%\sppsvc.exe if not exist %SysPath%\alg.exe (set "results=%results%[Likely File Infector]")
)
if not "%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 %results%"
if defined results call :dk_color %Red% "Checking Probable Mal%w%ware Infection..."
if defined results call :dk_color %Red% "%results%"
set fixes=%fixes% %mas%remove_mal%w%ware
call :dk_color2 %Blue% "Help - " %_Yellow% " %mas%remove_mal%w%ware"
echo:
@@ -1243,6 +1261,18 @@ exit /b
set showfix=
call :dk_chkmal
:: Check Sandboxing
sc query Null %nul% || (
set error=1
set showfix=1
call :dk_color %Red% "Checking Sandboxing [Found, script may not work properly.]"
call :dk_color %Blue% "If you are using any third-party antivirus, check if it is blocking the script."
echo:
)
::========================================================================================================================================
:: Check corrupt services
set serv_cor=
@@ -1260,6 +1290,7 @@ if defined _corrupt (if defined serv_cor (set "serv_cor=!serv_cor! %%#") else (s
if defined serv_cor (
set error=1
set showfix=1
call :dk_color %Red% "Checking Corrupt Services [%serv_cor%]"
)
@@ -1326,7 +1357,7 @@ if defined serv_e (
set error=1
call :dk_color %Red% "Starting Services [Failed] [%serv_e%]"
echo %serv_e% | findstr /i "ClipSVC-1058 sppsvc-1058" %nul% && (
call :dk_color %Blue% "Restart the system to fix this error."
call :dk_color %Blue% "Reboot your machine using the restart option to fix this error."
set showfix=1
)
)
@@ -1366,7 +1397,7 @@ for /f "delims=" %%a in ('%psc% "$f=[io.file]::ReadAllText('!_batp!') -split ':w
echo "%wpainfo%" | find /i "Error Found" %nul% && (
set error=1
set wpaerror=1
call :dk_color %Red% "Checking WPA Registry Error [%wpainfo%]"
call :dk_color %Red% "Checking WPA Registry Errors [%wpainfo%]"
) || (
echo Checking WPA Registry Count [%wpainfo%]
)
@@ -1376,8 +1407,8 @@ if not defined officeact if exist "%SystemRoot%\Servicing\Packages\Microsoft-Win
reg query "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion" /v EditionID %nul2% | find /i "Eval" %nul1% || (
set error=1
call :dk_color %Red% "Checking Eval Packages [Non-Eval Licenses are installed in Eval Windows]"
set fixes=%fixes% %mas%evaluation-editions
call :dk_color2 %Blue% "Help - " %_Yellow% " %mas%evaluation-editions"
set fixes=%fixes% %mas%evaluation_editions
call :dk_color2 %Blue% "Help - " %_Yellow% " %mas%evaluation_editions"
)
)
@@ -1405,7 +1436,7 @@ call :dk_color %Red% "Checking License Files [Not Found] [%osed
if not exist "%SystemRoot%\Servicing\Packages\Microsoft-Windows-*-%osedition%-*.mum" (
set error=1
call :dk_color %Red% "Checking Package File [Not Found] [%osedition%]"
call :dk_color %Red% "Checking Package Files [Not Found] [%osedition%]"
)
)
)
@@ -1430,7 +1461,7 @@ echo "%error_code%" | findstr /i "0x800410 0x800440" %nul1% && set wmifailed=1&
if defined wmifailed (
set error=1
call :dk_color %Red% "Checking WMI [Not Working]"
call :dk_color %Blue% "Go back to Main Menu, select Troubleshoot and run Fix WMI option."
if not defined showfix call :dk_color %Blue% "Go back to Main Menu, select Troubleshoot and run Fix WMI option."
set showfix=1
)
@@ -1474,26 +1505,25 @@ echo Checking Eval WLMS Service [Found]
)
reg query "HKU\S-1-5-20" %nul% && (
if %winbuild% GEQ 15063 reg query "HKU\S-1-5-20\Software\Microsoft\Windows NT\CurrentVersion\SoftwareProtectionPlatform" %nul% || (
reg query "HKU\S-1-5-20\Software\Microsoft\Windows NT\CurrentVersion" %nul% || (
set error=1
call :dk_color %Red% "Checking S-1-5-20 SPP Reg [Not Found]"
set fixes=%fixes% %mas%troubleshoot
call :dk_color2 %Blue% "Help - " %_Yellow% " %mas%troubleshoot"
)
) || (
set error=1
call :dk_color %Red% "Checking HKU\S-1-5-20 Reg [Not Found]"
call :dk_color %Red% "Checking HKU\S-1-5-20 Registry [Not Found]"
set fixes=%fixes% %mas%troubleshoot
call :dk_color2 %Blue% "Help - " %_Yellow% " %mas%troubleshoot"
)
for %%# in (SppEx%w%tComObj.exe sppsvc.exe) do (
for %%# in (SppEx%w%tComObj.exe sppsvc.exe sppsvc.exe\PerfOptions) do (
reg query "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Ima%w%ge File Execu%w%tion Options\%%#" %nul% && (if defined _sppint (set "_sppint=!_sppint!, %%#") else (set "_sppint=%%#"))
)
if defined _sppint (
echo Checking SPP Interference In IFEO [%_sppint%]
echo %_sppint% | find /i "PerfOptions" %nul% && (
call :dk_color %Red% "Checking SPP Interference In IFEO [%_sppint% - System might deactivate later]"
if not defined showfix call :dk_color %Blue% "%_fixmsg%"
set showfix=1
) || (
echo Checking SPP In IFEO [%_sppint%]
)
)
@@ -1508,7 +1538,7 @@ set error=1
reg query "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\SoftwareProtectionPlatform\Plugins\Objects\msft:rm/algorithm/hwid/4.0" /f ba02fed39662 /d %nul% || (
call :dk_color %Red% "Checking SPP Registry Key [Incorrect ModuleId Found]"
set fixes=%fixes% %mas%issues_due_to_gaming_spoofers
call :dk_color2 %Blue% "Possibly Caused By Gaming Spoofers. Help - " %_Yellow% " %mas%issues_due_to_gaming_spoofers"
call :dk_color2 %Blue% "Most likely caused by HWID spoofers. Help - " %_Yellow% " %mas%issues_due_to_gaming_spoofers"
set error=1
set showfix=1
)
@@ -1538,10 +1568,11 @@ set "d=!d! $AclObject.SetSecurityDescriptorSddlForm($sddl);"
set "d=!d! Set-Acl -Path %tokenstore% -AclObject $AclObject;"
%psc% "!d!" %nul%
if exist "%tokenstore%\" (
call :dk_color %Gray% "Checking SPP Token Folder [Not Found. Created Now] [%tokenstore%\]"
call :dk_color %Gray% "Checking SPP Token Folder [Not Found, Created Now] [%tokenstore%\]"
) else (
call :dk_color %Red% "Checking SPP Token Folder [Not Found. Failed To Create] [%tokenstore%\]"
call :dk_color %Red% "Checking SPP Token Folder [Not Found, Failed to Create] [%tokenstore%\]"
set error=1
set showfix=1
)
)
@@ -1573,30 +1604,48 @@ for /f "delims=" %%a in ('%psc% "(Get-ScheduledTask -TaskName 'SvcRestartTask' -
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
call :dk_color %Red% "Checking SvcRestartTask Status [!taskinfo!]"
call :dk_color %Red% "Checking SvcRestartTask Status [!taskinfo!, System might deactivate later]"
)
)
:: This code checks if NT SERVICE\sppsvc has permission access to tokens folder and required registry keys. It's often caused by gaming spoofers.
:: This code checks if SPP has permission access to tokens folder and required registry keys. It's often caused by gaming spoofers.
set permerror=
if not exist "%tokenstore%\" set permerror=1
if %winbuild% GEQ 9200 for %%# in (
if %winbuild% GEQ 9200 (
for %%# in (
"%tokenstore%+FullControl"
"HKLM:\SYSTEM\WPA+QueryValues, EnumerateSubKeys, WriteKey"
"HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion\SoftwareProtectionPlatform+SetValue"
) do for /f "tokens=1,2 delims=+" %%A in (%%#) do if not defined permerror (
%psc% "$acl = (Get-Acl '%%A' | fl | Out-String); if (-not ($acl -match 'NT SERVICE\\sppsvc Allow %%B') -or ($acl -match 'NT SERVICE\\sppsvc Deny')) {Exit 2}" %nul%
if !errorlevel!==2 set permerror=1
if !errorlevel!==2 (
if "%%A"=="%tokenstore%" (
set "permerror=Error Found In Token Folder"
) else (
set "permerror=Error Found In SPP Registries"
)
)
)
if %winbuild% GEQ 9200 if defined permerror (
REM https://learn.microsoft.com/office/troubleshoot/activation/license-issue-when-start-office-application
if not defined permerror (
reg query "HKU\S-1-5-20\Software\Microsoft\Windows NT\CurrentVersion" %nul% && (
set "pol=HKU\S-1-5-20\Software\Microsoft\Windows NT\CurrentVersion\SoftwareProtectionPlatform\Policies"
reg query "!pol!" %nul% || reg add "!pol!" %nul%
%psc% "$netServ = (New-Object Security.Principal.SecurityIdentifier('S-1-5-20')).Translate([Security.Principal.NTAccount]).Value; $aclString = Get-Acl 'Registry::!pol!' | Format-List | Out-String; if (-not ($aclString.Contains($netServ + ' Allow FullControl') -or $aclString.Contains('NT SERVICE\sppsvc Allow FullControl')) -or ($aclString.Contains('Deny'))) {Exit 3}" %nul%
if !errorlevel!==3 set "permerror=Error Found In S-1-5-20 SPP"
)
)
if defined permerror (
set error=1
call :dk_color %Red% "Checking SPP Permissions [Error Found]"
call :dk_color %Red% "Checking SPP Permissions [!permerror!]"
if not defined showfix call :dk_color %Blue% "%_fixmsg%"
set showfix=1
)
)
:: If required services are not disabled or corrupted + if there is any error + SoftwareLicensingService errorlevel is not Zero + no fix was shown before
@@ -1639,7 +1688,7 @@ if ($osVersion.Build -ge $minBuildNumber) {
}
for ($i=1; $i -le $count; $i++) {
if (-not $subkeyHashTable.ContainsKey("$i")) {
Write-Output "Total Keys $count. Error Found- $i key does not exist"
Write-Output "Total Keys $count. Error Found - $i key does not exist."
$wpaKey.Close()
exit
}
@@ -1650,7 +1699,7 @@ $wpaKey.GetSubKeyNames() | ForEach-Object {
if ($PSVersionTable.PSVersion.Major -lt 3) {
cmd /c "reg query "HKLM\SYSTEM\WPA\$_" /ve /t REG_BINARY >nul 2>&1"
if ($LASTEXITCODE -ne 0) {
Write-Host "Total Keys $count. Error Found- Binary Data is corrupt"
Write-Host "Total Keys $count. Error Found - Binary Data is corrupt."
$wpaKey.Close()
exit
}
@@ -1658,7 +1707,7 @@ $wpaKey.GetSubKeyNames() | ForEach-Object {
$subkey = $wpaKey.OpenSubKey($_)
$p = $subkey.GetValueNames()
if (($p | Where-Object { $subkey.GetValueKind($_) -eq [Microsoft.Win32.RegistryValueKind]::Binary }).Count -eq 0) {
Write-Host "Total Keys $count. Error Found- Binary Data is corrupt"
Write-Host "Total Keys $count. Error Found - Binary Data is corrupt."
$wpaKey.Close()
exit
}
@@ -1697,13 +1746,13 @@ echo:
if %_unattended%==1 timeout /t 2 & exit /b
if defined fixes (
call :dk_color2 %Blue% "Press [1] To Open Troubleshoot Page " %Gray% " Press [0] To Ignore"
call :dk_color2 %Blue% "Press [1] to Open Troubleshoot Page " %Gray% " Press [0] to Ignore"
choice /C:10 /N
if !errorlevel!==1 (for %%# in (%fixes%) do (start %%#))
)
if defined terminal (
call :dk_color %_Yellow% "Press 0 key to %_exitmsg%..."
call :dk_color %_Yellow% "Press [0] key to %_exitmsg%..."
choice /c 0 /n
) else (
call :dk_color %_Yellow% "Press any key to %_exitmsg%..."

View File

@@ -1,4 +1,4 @@
@set masver=2.6
@set masver=2.7
@echo off
@@ -27,7 +27,7 @@ set "_debug=0"
::========================================================================================================================================
:: Set Environment variables, it helps if they are misconfigured in the system
:: Set environment variables, it helps if they are misconfigured in the system
setlocal EnableExtensions
setlocal DisableDelayedExpansion
@@ -160,13 +160,15 @@ call :dk_setvar
if %winbuild% LSS 9200 (
%eline%
echo Unsupported OS version detected [%winbuild%].
echo Ohook Activation is supported on Windows 8 and later and their server equivalent.
echo Ohook Activation is supported only on Windows 8/10/11 and their server equivalents.
echo:
call :dk_color %Blue% "Use Online KMS activation option instead."
goto dk_done
)
::========================================================================================================================================
:: Fix special characters limitation in path name
:: Fix special character limitations in path name
set "_work=%~dp0"
if "%_work:~-1%"=="\" set "_work=%_work:~0,-1%"
@@ -186,8 +188,8 @@ setlocal EnableDelayedExpansion
echo "!_batf!" | find /i "!_ttemp!" %nul1% && (
if /i not "!_work!"=="!_ttemp!" (
%eline%
echo Script is launched from the temp folder,
echo Most likely you are running the script directly from the archive file.
echo The script was launched from the temp folder.
echo You are most likely running the script directly from the archive file.
echo:
echo Extract the archive file and launch the script from the extracted folder.
goto dk_done
@@ -207,13 +209,16 @@ echo:
cmd /c "%psc% "$ExecutionContext.SessionState.LanguageMode"" | find /i "FullLanguage" %nul1% && (
echo Failed to run Powershell command but Powershell is working.
call :dk_color %Blue% "Check if your antivirus is blocking the script."
) || (
echo PowerShell is not working. Aborting...
echo If you have applied restrictions on Powershell then undo those changes.
)
echo:
set fixes=%fixes% %mas%troubleshoot
call :dk_color2 %Blue% "Help - " %_Yellow% " %mas%troubleshoot"
) || (
echo PowerShell is not working. Aborting...
echo If you have applied restrictions on Powershell then undo those changes.
echo:
set fixes=%fixes% %mas%fix_powershell
call :dk_color2 %Blue% "Help - " %_Yellow% " %mas%fix_powershell"
)
goto dk_done
)
@@ -225,7 +230,7 @@ goto dk_done
if not defined _elev %psc% "start cmd.exe -arg '/c \"!_PSarg!\"' -verb runas" && exit /b
%eline%
echo This script needs admin rights.
echo To do so, right click on this script and select 'Run as administrator'.
echo Right click on this script and select 'Run as administrator'.
goto dk_done
)
@@ -278,20 +283,20 @@ set -=
set old=
for /f "delims=[] tokens=2" %%# in ('ping -4 -n 1 updatecheck.mass%-%grave.dev') do (
if not [%%#]==[] (echo "%%#" | find "127.69" %nul1% && (echo "%%#" | find "127.69.%masver%" %nul1% || set old=1))
if not "%%#"=="" (echo "%%#" | find "127.69" %nul1% && (echo "%%#" | find "127.69.%masver%" %nul1% || set old=1))
)
if defined old (
echo ________________________________________________
%eline%
echo Version %masver% of MAS is outdated.
echo Your version of MAS [%masver%] is outdated.
echo ________________________________________________
echo:
if not %_unattended%==1 (
echo [1] Get Latest MAS
echo [0] Continue Anyway
echo:
call :dk_color %_Green% "Enter a menu option in the Keyboard [1,0] :"
call :dk_color %_Green% "Choose a menu option using your keyboard [1,0] :"
choice /C:10 /N
if !errorlevel!==2 rem
if !errorlevel!==1 (start ht%-%tps://github.com/mass%-%gravel/Microsoft-Acti%-%vation-Scripts & start %mas% & exit /b)
@@ -327,7 +332,7 @@ echo:
echo [0] %_exitmsg%
echo ____________________________________________________________
echo:
call :dk_color2 %_White% " " %_Green% "Enter a menu option in the Keyboard [1,2,3,0]"
call :dk_color2 %_White% " " %_Green% "Choose a menu option using your keyboard [1,2,3,0]"
choice /C:1230 /N
set _el=!errorlevel!
if !_el!==4 exit /b
@@ -355,7 +360,7 @@ call :dk_chkmal
if not exist %SysPath%\sppsvc.exe (
%eline%
echo [%SysPath%\sppsvc.exe] file is missing. Aborting...
echo [%SysPath%\sppsvc.exe] file is missing, aborting...
echo:
set fixes=%fixes% %mas%troubleshoot
call :dk_color2 %Blue% "Help - " %_Yellow% " %mas%troubleshoot"
@@ -451,10 +456,10 @@ call :dk_color %Red% "Checking Installed Office [Not Found]"
if defined ohub (
echo:
echo You have only Office dashboard app installed, you need to install full Office version.
echo You only have the Office dashboard app installed, you need to install the full version of Office.
)
echo:
call :dk_color %Blue% "Download and install Office from below URL and try again."
call :dk_color %Blue% "Download and install Office from the below URL and then try again."
echo:
set fixes=%fixes% %mas%genuine-installation-media
call :dk_color %_Yellow% "%mas%genuine-installation-media"
@@ -466,7 +471,7 @@ if not "%o16c2r%%o15c2r%%o16msi%%o15msi%"=="1" set multioffice=1
if not "%o14msi%%o14c2r%%o16uwp%"=="" set multioffice=1
if defined multioffice (
call :dk_color %Gray% "Checking Multiple Office Install [Found. Recommended to install one version only]"
call :dk_color %Gray% "Checking Multiple Office Install [Found, its recommended to install only one version]"
)
::========================================================================================================================================
@@ -515,11 +520,11 @@ echo "!_oIds!" | find /i " %%a " %nul1% || (set "_oIds= !_oIds! %%a ")
set "_oLPath=%_oRoot%\Licenses"
set "_oIntegrator=%_oRoot%\integration\integrator.exe"
if [%_oArch%]==[x64] (set "_hookPath=%_oRoot%\vfs\System" & set "_hook=sppc64.dll")
if [%_oArch%]==[x86] (set "_hookPath=%_oRoot%\vfs\SystemX86" & set "_hook=sppc32.dll")
if not [%osarch%]==[x86] (
if [%_oArch%]==[x64] set "_sppcPath=%SystemRoot%\System32\sppc.dll"
if [%_oArch%]==[x86] set "_sppcPath=%SystemRoot%\SysWOW64\sppc.dll"
if "%_oArch%"=="x64" (set "_hookPath=%_oRoot%\vfs\System" & set "_hook=sppc64.dll")
if "%_oArch%"=="x86" (set "_hookPath=%_oRoot%\vfs\SystemX86" & set "_hook=sppc32.dll")
if not "%osarch%"=="x86" (
if "%_oArch%"=="x64" set "_sppcPath=%SystemRoot%\System32\sppc.dll"
if "%_oArch%"=="x86" set "_sppcPath=%SystemRoot%\SysWOW64\sppc.dll"
) else (
set "_sppcPath=%SystemRoot%\System32\sppc.dll"
)
@@ -565,11 +570,11 @@ set _o16c2rIds=%_oIds%
set "_oLPath=%_oRoot%\Licenses16"
set "_oIntegrator=%_oRoot%\integration\integrator.exe"
if [%_oArch%]==[x64] (set "_hookPath=%_oRoot%\vfs\System" & set "_hook=sppc64.dll")
if [%_oArch%]==[x86] (set "_hookPath=%_oRoot%\vfs\SystemX86" & set "_hook=sppc32.dll")
if not [%osarch%]==[x86] (
if [%_oArch%]==[x64] set "_sppcPath=%SystemRoot%\System32\sppc.dll"
if [%_oArch%]==[x86] set "_sppcPath=%SystemRoot%\SysWOW64\sppc.dll"
if "%_oArch%"=="x64" (set "_hookPath=%_oRoot%\vfs\System" & set "_hook=sppc64.dll")
if "%_oArch%"=="x86" (set "_hookPath=%_oRoot%\vfs\SystemX86" & set "_hook=sppc32.dll")
if not "%osarch%"=="x86" (
if "%_oArch%"=="x64" set "_sppcPath=%SystemRoot%\System32\sppc.dll"
if "%_oArch%"=="x86" set "_sppcPath=%SystemRoot%\SysWOW64\sppc.dll"
) else (
set "_sppcPath=%SystemRoot%\System32\sppc.dll"
)
@@ -608,13 +613,13 @@ call :dk_color %Gray% "Checking Old Office With Sub License [Found. Update Of
set "kmskey=HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\SoftwareProtectionPlatform\0ff1ce15-a989-479d-af46-f275c6370663"
echo "%_oIds%" | find /i "Volume" %nul1% && (
if %winbuild% GEQ 9200 (
if not [%osarch%]==[x86] (
if not "%osarch%"=="x86" (
reg delete "%kmskey%" /f /reg:32 %nul%
reg add "%kmskey%" /f /v KeyManagementServiceName /t REG_SZ /d "10.0.0.10" /reg:32 %nul%
)
reg delete "%kmskey%" /f %nul%
reg add "%kmskey%" /f /v KeyManagementServiceName /t REG_SZ /d "10.0.0.10" %nul%
echo Adding a Reg To Prevent Banner [Successful]
echo Adding a Registry to Prevent Banner [Successful]
)
)
@@ -636,7 +641,7 @@ call :oh_licrefresh
echo:
if not defined error (
call :dk_color %Green% "Office is permanently activated."
REM if defined ohub call :dk_color %Gray% "Office apps such as Word, Excel are activated. Ignore 'Buy Microsoft 365' button in Office dashboard app."
if defined ohub call :dk_color %Gray% "Office apps such as Word, Excel are activated, use them directly. Ignore 'Buy' button in Office dashboard app."
echo Help: %mas%troubleshoot
) else (
call :dk_color %Red% "Some errors were detected."
@@ -662,7 +667,7 @@ call :oh_reset
call :oh_getpath
echo:
echo Uninstalling Ohook Activation...
echo Uninstalling Ohook activation...
echo:
if defined o16c2r_reg (for /f "skip=2 tokens=2*" %%a in ('"reg query %o16c2r_reg% /v InstallPath" %nul6%') do (set "_16CHook=%%b\root\vfs"))
@@ -693,7 +698,7 @@ if exist "%%~A\Microsoft %%~G\root\vfs\%%#\sppc*dll" (set _present=1& del /s /f
reg query HKCU\Software\Microsoft\Office\16.0\Common\Licensing\Resiliency %nul% && (
echo:
echo Deleting - Registry keys to skip license check from all ^& future new useraccounts
echo Deleting - Registry keys for skipping license check
reg load HKU\DEF_TEMP %SystemDrive%\Users\Default\NTUSER.DAT %nul%
reg query HKU\DEF_TEMP\Software\Microsoft\Office\16.0\Common\Licensing\Resiliency %nul% && reg delete HKU\DEF_TEMP\Software\Microsoft\Office\16.0\Common\Licensing\Resiliency /f
@@ -718,7 +723,7 @@ reg unload HKU\%%# %nul%
set "kmskey=HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\SoftwareProtectionPlatform\0ff1ce15-a989-479d-af46-f275c6370663"
reg query "%kmskey%" %nul% && (
echo:
echo Deleting - Registry keys to prevent non-genuine banner
echo Deleting - Registry keys for preventing non-genuine banner
reg delete "%kmskey%" /f
)
@@ -730,16 +735,16 @@ echo ___________________________________________________________________________
echo:
if not defined _present (
echo Ohook Activation is not installed.
echo Ohook activation is not installed.
) else (
if defined _unerror (
call :dk_color %Red% "Failed to uninstall Ohook activation."
call :oh_checkapps
if defined checknames (
call :dk_color %Blue% "Close [!checknames!] and try again."
call :dk_color %Blue% "If its still not resolved then restart system and try again."
call :dk_color %Blue% "If it is still not fixed, reboot your machine using the restart option and try again."
) else (
call :dk_color %Blue% "Restart system and try again."
call :dk_color %Blue% "Reboot your machine using the restart option and try again."
)
) else (
call :dk_color %Green% "Successfully uninstalled Ohook activation."
@@ -914,11 +919,11 @@ if not exist "%_hookPath%\sppc.dll" (if not defined ierror set ierror=Copy)
echo:
if not defined ierror (
echo Symlinking System's sppc.dll To ["%_hookPath%\sppcs.dll"] [Successful]
echo Symlinking System's sppc.dll to ["%_hookPath%\sppcs.dll"] [Successful]
if defined exhook (
echo Copying Custom %_hook% To ["%_hookPath%\sppc.dll"] [Successful]
echo Copying Custom %_hook% to ["%_hookPath%\sppc.dll"] [Successful]
) else (
echo Extracting Custom %_hook% To ["%_hookPath%\sppc.dll"] [Successful]
echo Extracting Custom %_hook% to ["%_hookPath%\sppc.dll"] [Successful]
)
) else (
set error=1
@@ -927,9 +932,10 @@ echo:
call :oh_checkapps
if defined checknames (
call :dk_color %Blue% "Close [!checknames!] and try again."
call :dk_color %Blue% "If its still not resolved then restart system and try again."
call :dk_color %Blue% "If it is still not fixed, reboot your machine using the restart option and try again."
) else (
if /i not "%ierror%"=="Copy" call :dk_color %Blue% "Restart system and try again."
if /i not "%ierror%"=="Copy" call :dk_color %Blue% "Reboot your machine using the restart option and try again."
if /i "%ierror%"=="Copy" call :dk_color %Blue% "If you are using any third-party antivirus, check if it is blocking the script."
)
echo:
)
@@ -970,13 +976,13 @@ set _prod=%%#!_preview!
call :ohookdata getinfo !_prod!
if not [!key!]==[] (
if not "!key!"=="" (
echo "!allapps!" | find /i "!_actid!" %nul1% || call :oh_installlic
call :dk_inskey "[!key!] [!_prod!] [!_lic!]"
) else (
set error=1
call :dk_color %Red% "Checking Product In Script [Office %oVer%.0 !_prod! not found in script]"
call :dk_color %Blue% "Make sure you are using Latest MAS script."
call :dk_color %Blue% "Make sure you are using the latest version of MAS."
set fixes=%fixes% %mas%
call :dk_color %_Yellow% "%mas%"
)
@@ -990,7 +996,7 @@ if defined winserver if defined _config (
echo %_oIds% | find /i "Retail" %nul1% && (
set scaIsNeeded=1
reg add %_config% /v SharedComputerLicensing /t REG_SZ /d "1" /f %nul1%
echo Adding SharedComputerLicensing Reg [Successful] [Needed On Server With Retail Office]"
echo Adding SharedComputerLicensing Reg [Successful] [Needed on Server With Retail Office]"
)
)
@@ -1011,14 +1017,14 @@ for /f "skip=2 tokens=2*" %%a in ('"reg query %2\Common\ProductVersion /v LastPr
if "%_oRoot:~-1%"=="\" set "_oRoot=%_oRoot:~0,-1%"
echo "%2" | find /i "Wow6432Node" %nul1% && set _oArch=x86
if not [%osarch%]==[x86] if not defined _oArch set _oArch=x64
if [%osarch%]==[x86] set _oArch=x86
if not "%osarch%"=="x86" if not defined _oArch set _oArch=x64
if "%osarch%"=="x86" set _oArch=x86
if [%_oArch%]==[x64] (set "_hookPath=%_oRoot%" & set "_hook=sppc64.dll")
if [%_oArch%]==[x86] (set "_hookPath=%_oRoot%" & set "_hook=sppc32.dll")
if not [%osarch%]==[x86] (
if [%_oArch%]==[x64] set "_sppcPath=%SystemRoot%\System32\sppc.dll"
if [%_oArch%]==[x86] set "_sppcPath=%SystemRoot%\SysWOW64\sppc.dll"
if "%_oArch%"=="x64" (set "_hookPath=%_oRoot%" & set "_hook=sppc64.dll")
if "%_oArch%"=="x86" (set "_hookPath=%_oRoot%" & set "_hook=sppc32.dll")
if not "%osarch%"=="x86" (
if "%_oArch%"=="x64" set "_sppcPath=%SystemRoot%\System32\sppc.dll"
if "%_oArch%"=="x86" set "_sppcPath=%SystemRoot%\SysWOW64\sppc.dll"
) else (
set "_sppcPath=%SystemRoot%\System32\sppc.dll"
)
@@ -1037,13 +1043,13 @@ echo Activating Office... [MSI ^| %_version% ^| %_oArch%]
if not defined _oBranding (
set error=1
call :dk_color %Red% "Checking BRANDING.XML [Not Found. Aborting activation...]"
call :dk_color %Red% "Checking BRANDING.XML [Not Found, aborting activation...]"
exit /b
)
if not defined _oIds (
set error=1
call :dk_color %Red% "Checking Installed Products [Product IDs not found. Aborting activation...]"
call :dk_color %Red% "Checking Installed Products [Product IDs not found, aborting activation...]"
exit /b
)
@@ -1100,7 +1106,7 @@ set _sortIds=!_sortIds:PreInstallR_=Retail_!
:: https://learn.microsoft.com/office/troubleshoot/activation/reset-office-365-proplus-activation-state
set _sidlist=
for /f "tokens=* delims=" %%a in ('%psc% "$p = 'HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion\ProfileList'; Get-ChildItem $p | ForEach-Object { $pi = (Get-ItemProperty $('{0}\{1}' -f $p, $_.PSChildName)).ProfileImagePath; if ($pi -like $('{0}\Users\*' -f $Env:SystemDrive)) { Split-Path $_.PSPath -Leaf } }" %nul6%') do (if defined _sidlist (set _sidlist=!_sidlist! %%a) else (set _sidlist=%%a))
for /f "tokens=* delims=" %%a in ('%psc% "$p = 'HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion\ProfileList'; Get-ChildItem $p | ForEach-Object { $pi = (Get-ItemProperty """"$p\$($_.PSChildName)"""").ProfileImagePath; if ($pi -like """"$Env:SystemDrive\Users\*"""" -and (Test-Path """"$pi\NTUSER.DAT"""") -and -not ($_ -match '\.bak$')) { Split-Path $_.PSPath -Leaf } }" %nul6%') do (if defined _sidlist (set _sidlist=!_sidlist! %%a) else (set _sidlist=%%a))
if not defined _sidlist (
set error=1
@@ -1170,9 +1176,7 @@ reg delete HKLM\SOFTWARE\Microsoft\Office\15.0\ClickToRun\Configuration /v Share
:: Clear device-based-licensing
:: https://learn.microsoft.com/deployoffice/device-based-licensing
for %%# in (%_o16c2rIds%) do (
reg delete %o16c2r_reg%\Configuration /v %%#.DeviceBasedLicensing /f %nul%
)
for /f %%# in ('reg query "%o16c2r_reg%\Configuration" /f *.DeviceBasedLicensing %nul6% ^| findstr REG_') do reg delete "%o16c2r_reg%\Configuration" /v %%# /f %nul%
:: Remove OEM registry key
:: https://support.microsoft.com/office/office-repeatedly-prompts-you-to-activate-on-a-new-pc-a9a6b05f-f6ce-4d1f-8d49-eb5007b64ba1
@@ -1183,8 +1187,10 @@ reg delete "HKLM\SOFTWARE\Microsoft\Office\%%#.0\Common\OEM" /f /reg:32 %nul%
)
reg delete "HKU\S-1-5-20\Software\Microsoft\Windows NT\CurrentVersion\SoftwareProtectionPlatform\Policies\0ff1ce15-a989-479d-af46-f275c6370663" /f %nul%
reg delete "HKU\S-1-5-20\Software\Microsoft\OfficeSoftwareProtectionPlatform\Policies\0ff1ce15-a989-479d-af46-f275c6370663" /f %nul%
reg delete "HKU\S-1-5-20\Software\Microsoft\OfficeSoftwareProtectionPlatform\Policies\59a52881-a989-479d-af46-f275c6370663" /f %nul%
echo Clearing Office License Blocks [Successfully Cleared From All %counter% Useraccounts]
echo Clearing Office License Blocks [Successfully cleared from all %counter% user accounts]
::==========================
@@ -1202,7 +1208,7 @@ for %%# in (%_sidlist%) do (
reg delete HKU\%%#\Software\Microsoft\Office\16.0\Common\Licensing\Resiliency /f %nul%
reg add HKU\%%#\Software\Microsoft\Office\16.0\Common\Licensing\Resiliency /v "TimeOfLastHeartbeatFailure" /t REG_SZ /d "2040-01-01T00:00:00Z" /f %nul%
)
echo Adding Reg Keys To Skip License Check [Successfully Added To All %counter% ^& Future New Useraccounts]
echo Adding Reg Keys to Skip License Check [Successfully added to all %counter% ^& future new user accounts]
)
::==========================
@@ -1216,14 +1222,14 @@ reg query HKU\%%# %nul% && set failedtounload=1
if defined failedtoload (
set error=1
call :dk_color %Red% "Loading Unloaded accounts Registry [Failed For Some Useraccounts]"
call :dk_color %Blue% "Restart the system and try again."
call :dk_color %Red% "Loading Unloaded Accounts Registry [Failed for some user accounts]"
call :dk_color %Blue% "Reboot your machine using the restart option and try again."
)
if defined failedtounload (
set error=1
call :dk_color %Red% "Unloading loaded accounts Registry [Failed For Some Useraccounts]"
call :dk_color %Blue% "Restart the system and try again."
call :dk_color %Red% "Unloading Loaded Account Registries [Failed for some user accounts]"
call :dk_color %Blue% "Reboot your machine using the restart option and try again."
)
exit /b
@@ -1286,7 +1292,7 @@ exit /b
set checkapps=
set checknames=
for /f "tokens=1" %%i in ('tasklist ^| findstr /I ".exe" %nul6%') do (set "checkapps=!checkapps! %%i")
for /f "tokens=1" %%i in ('tasklist ^| findstr /I ".exe" %nul6%') do (set "checkapps=!checkapps! -%%i-")
for %%# in (
Access_msaccess.exe
@@ -1303,7 +1309,7 @@ Word_winword.exe
Lime_lime.exe
) do (
for /f "tokens=1-2 delims=_" %%A in ("%%#") do (
echo !checkapps! | find /i "%%B" %nul1% && (if defined checknames (set "checknames=!checknames! %%A") else (set "checknames=%%A"))
echo !checkapps! | find /i "-%%B-" %nul1% && (if defined checknames (set "checknames=!checknames! %%A") else (set "checknames=%%A"))
)
)
exit /b
@@ -1326,6 +1332,7 @@ set "Red="41;97m""
set "Gray="100;97m""
set "Green="42;97m""
set "Blue="44;97m""
set "_Red="40;91m""
set "_White="40;37m""
set "_Green="40;92m""
set "_Yellow="40;93m""
@@ -1334,6 +1341,7 @@ set "Red="Red" "white""
set "Gray="Darkgray" "white""
set "Green="DarkGreen" "white""
set "Blue="Blue" "white""
set "_Red="Black" "Red""
set "_White="Black" "Gray""
set "_Green="Black" "Green""
set "_Yellow="Black" "Yellow""
@@ -1452,7 +1460,7 @@ function ReinstallLicenses() {
set _wmic=0
for %%# in (wmic.exe) do @if not "%%~$PATH:#"=="" (
wmic path Win32_ComputerSystem get CreationClassName /value %nul2% | find /i "computersystem" %nul1% && set _wmic=1
cmd /c "wmic path Win32_ComputerSystem get CreationClassName /value" %nul2% | find /i "computersystem" %nul1% && set _wmic=1
)
exit /b
@@ -1460,7 +1468,6 @@ exit /b
:dk_sppissue
set w=
sc start sppsvc %nul%
set spperror=%errorlevel%
@@ -1469,14 +1476,6 @@ if %spperror% NEQ 1056 if %spperror% NEQ 0 (
echo sc start sppsvc [Error Code: %spperror%]
)
echo "%spperror%" | findstr "577 225" %nul% && (
echo:
echo Your system is most likely infected with Mal%w%ware.
echo:
set fixes=%fixes% %mas%remove_mal%w%ware
call :dk_color2 %Blue% "Help - " %_Yellow% " %mas%remove_mal%w%ware"
)
echo:
%psc% "$job = Start-Job { (Get-WmiObject -Query 'SELECT * FROM %sps%').Version }; if (-not (Wait-Job $job -Timeout 20)) {write-host 'sppsvc is not working correctly. Help - %mas%troubleshoot'}"
exit /b
@@ -1525,7 +1524,7 @@ set pupfound=%pupfound1%%pupfound2%
set hcount=0
for %%# in (avira.com kaspersky.com virustotal.com mcafee.com) do (
find /i "%%#" %SysPath%\drivers\etc\hosts %nul% && set /a hcount+=1)
if %hcount%==4 set "results=[AV URLs are blocked in hosts]"
if %hcount%==4 set "results=[Antivirus URLs are blocked in hosts]"
set wucount=0
for %%# in (wuauserv) do (
@@ -1534,14 +1533,19 @@ for %%G in (DependOnService Description DisplayName ErrorControl ImagePath Objec
reg query HKLM\SYSTEM\CurrentControlSet\Services\%%# /v %%G %nul% || (set _corrupt=1 & set /a wucount+=1)
)
)
if %wucount% GEQ 1 set "results=%results%[WU registry is corrupt]"
if %wucount% GEQ 1 set "results=%results%[Windows Update registry is corrupt]"
sc start sppsvc %nul%
echo "%errorlevel%" | findstr "577 225" %nul% && set "results=%results%[Likely File Infector]"
echo "%errorlevel%" | findstr "577 225" %nul% && (
set "results=%results%[Likely File Infector]"
) || (
if not exist %SysPath%\sppsvc.exe if not exist %SysPath%\alg.exe (set "results=%results%[Likely File Infector]")
)
if not "%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 %results%"
if defined results call :dk_color %Red% "Checking Probable Mal%w%ware Infection..."
if defined results call :dk_color %Red% "%results%"
set fixes=%fixes% %mas%remove_mal%w%ware
call :dk_color2 %Blue% "Help - " %_Yellow% " %mas%remove_mal%w%ware"
echo:
@@ -1555,6 +1559,18 @@ exit /b
set showfix=
call :dk_chkmal
:: Check Sandboxing
sc query Null %nul% || (
set error=1
set showfix=1
call :dk_color %Red% "Checking Sandboxing [Found, script may not work properly.]"
call :dk_color %Blue% "If you are using any third-party antivirus, check if it is blocking the script."
echo:
)
::========================================================================================================================================
:: Check corrupt services
set serv_cor=
@@ -1572,6 +1588,7 @@ if defined _corrupt (if defined serv_cor (set "serv_cor=!serv_cor! %%#") else (s
if defined serv_cor (
set error=1
set showfix=1
call :dk_color %Red% "Checking Corrupt Services [%serv_cor%]"
)
@@ -1638,7 +1655,7 @@ if defined serv_e (
set error=1
call :dk_color %Red% "Starting Services [Failed] [%serv_e%]"
echo %serv_e% | findstr /i "ClipSVC-1058 sppsvc-1058" %nul% && (
call :dk_color %Blue% "Restart the system to fix this error."
call :dk_color %Blue% "Reboot your machine using the restart option to fix this error."
set showfix=1
)
)
@@ -1678,7 +1695,7 @@ for /f "delims=" %%a in ('%psc% "$f=[io.file]::ReadAllText('!_batp!') -split ':w
echo "%wpainfo%" | find /i "Error Found" %nul% && (
set error=1
set wpaerror=1
call :dk_color %Red% "Checking WPA Registry Error [%wpainfo%]"
call :dk_color %Red% "Checking WPA Registry Errors [%wpainfo%]"
) || (
echo Checking WPA Registry Count [%wpainfo%]
)
@@ -1688,8 +1705,8 @@ if not defined officeact if exist "%SystemRoot%\Servicing\Packages\Microsoft-Win
reg query "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion" /v EditionID %nul2% | find /i "Eval" %nul1% || (
set error=1
call :dk_color %Red% "Checking Eval Packages [Non-Eval Licenses are installed in Eval Windows]"
set fixes=%fixes% %mas%evaluation-editions
call :dk_color2 %Blue% "Help - " %_Yellow% " %mas%evaluation-editions"
set fixes=%fixes% %mas%evaluation_editions
call :dk_color2 %Blue% "Help - " %_Yellow% " %mas%evaluation_editions"
)
)
@@ -1717,7 +1734,7 @@ call :dk_color %Red% "Checking License Files [Not Found] [%osed
if not exist "%SystemRoot%\Servicing\Packages\Microsoft-Windows-*-%osedition%-*.mum" (
set error=1
call :dk_color %Red% "Checking Package File [Not Found] [%osedition%]"
call :dk_color %Red% "Checking Package Files [Not Found] [%osedition%]"
)
)
)
@@ -1742,7 +1759,7 @@ echo "%error_code%" | findstr /i "0x800410 0x800440" %nul1% && set wmifailed=1&
if defined wmifailed (
set error=1
call :dk_color %Red% "Checking WMI [Not Working]"
call :dk_color %Blue% "Go back to Main Menu, select Troubleshoot and run Fix WMI option."
if not defined showfix call :dk_color %Blue% "Go back to Main Menu, select Troubleshoot and run Fix WMI option."
set showfix=1
)
@@ -1786,26 +1803,25 @@ echo Checking Eval WLMS Service [Found]
)
reg query "HKU\S-1-5-20" %nul% && (
if %winbuild% GEQ 15063 reg query "HKU\S-1-5-20\Software\Microsoft\Windows NT\CurrentVersion\SoftwareProtectionPlatform" %nul% || (
reg query "HKU\S-1-5-20\Software\Microsoft\Windows NT\CurrentVersion" %nul% || (
set error=1
call :dk_color %Red% "Checking S-1-5-20 SPP Reg [Not Found]"
set fixes=%fixes% %mas%troubleshoot
call :dk_color2 %Blue% "Help - " %_Yellow% " %mas%troubleshoot"
)
) || (
set error=1
call :dk_color %Red% "Checking HKU\S-1-5-20 Reg [Not Found]"
call :dk_color %Red% "Checking HKU\S-1-5-20 Registry [Not Found]"
set fixes=%fixes% %mas%troubleshoot
call :dk_color2 %Blue% "Help - " %_Yellow% " %mas%troubleshoot"
)
for %%# in (SppEx%w%tComObj.exe sppsvc.exe) do (
for %%# in (SppEx%w%tComObj.exe sppsvc.exe sppsvc.exe\PerfOptions) do (
reg query "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Ima%w%ge File Execu%w%tion Options\%%#" %nul% && (if defined _sppint (set "_sppint=!_sppint!, %%#") else (set "_sppint=%%#"))
)
if defined _sppint (
echo Checking SPP Interference In IFEO [%_sppint%]
echo %_sppint% | find /i "PerfOptions" %nul% && (
call :dk_color %Red% "Checking SPP Interference In IFEO [%_sppint% - System might deactivate later]"
if not defined showfix call :dk_color %Blue% "%_fixmsg%"
set showfix=1
) || (
echo Checking SPP In IFEO [%_sppint%]
)
)
@@ -1820,7 +1836,7 @@ set error=1
reg query "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\SoftwareProtectionPlatform\Plugins\Objects\msft:rm/algorithm/hwid/4.0" /f ba02fed39662 /d %nul% || (
call :dk_color %Red% "Checking SPP Registry Key [Incorrect ModuleId Found]"
set fixes=%fixes% %mas%issues_due_to_gaming_spoofers
call :dk_color2 %Blue% "Possibly Caused By Gaming Spoofers. Help - " %_Yellow% " %mas%issues_due_to_gaming_spoofers"
call :dk_color2 %Blue% "Most likely caused by HWID spoofers. Help - " %_Yellow% " %mas%issues_due_to_gaming_spoofers"
set error=1
set showfix=1
)
@@ -1850,10 +1866,11 @@ set "d=!d! $AclObject.SetSecurityDescriptorSddlForm($sddl);"
set "d=!d! Set-Acl -Path %tokenstore% -AclObject $AclObject;"
%psc% "!d!" %nul%
if exist "%tokenstore%\" (
call :dk_color %Gray% "Checking SPP Token Folder [Not Found. Created Now] [%tokenstore%\]"
call :dk_color %Gray% "Checking SPP Token Folder [Not Found, Created Now] [%tokenstore%\]"
) else (
call :dk_color %Red% "Checking SPP Token Folder [Not Found. Failed To Create] [%tokenstore%\]"
call :dk_color %Red% "Checking SPP Token Folder [Not Found, Failed to Create] [%tokenstore%\]"
set error=1
set showfix=1
)
)
@@ -1885,30 +1902,48 @@ for /f "delims=" %%a in ('%psc% "(Get-ScheduledTask -TaskName 'SvcRestartTask' -
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
call :dk_color %Red% "Checking SvcRestartTask Status [!taskinfo!]"
call :dk_color %Red% "Checking SvcRestartTask Status [!taskinfo!, System might deactivate later]"
)
)
:: This code checks if NT SERVICE\sppsvc has permission access to tokens folder and required registry keys. It's often caused by gaming spoofers.
:: This code checks if SPP has permission access to tokens folder and required registry keys. It's often caused by gaming spoofers.
set permerror=
if not exist "%tokenstore%\" set permerror=1
if %winbuild% GEQ 9200 for %%# in (
if %winbuild% GEQ 9200 (
for %%# in (
"%tokenstore%+FullControl"
"HKLM:\SYSTEM\WPA+QueryValues, EnumerateSubKeys, WriteKey"
"HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion\SoftwareProtectionPlatform+SetValue"
) do for /f "tokens=1,2 delims=+" %%A in (%%#) do if not defined permerror (
%psc% "$acl = (Get-Acl '%%A' | fl | Out-String); if (-not ($acl -match 'NT SERVICE\\sppsvc Allow %%B') -or ($acl -match 'NT SERVICE\\sppsvc Deny')) {Exit 2}" %nul%
if !errorlevel!==2 set permerror=1
if !errorlevel!==2 (
if "%%A"=="%tokenstore%" (
set "permerror=Error Found In Token Folder"
) else (
set "permerror=Error Found In SPP Registries"
)
)
)
if %winbuild% GEQ 9200 if defined permerror (
REM https://learn.microsoft.com/office/troubleshoot/activation/license-issue-when-start-office-application
if not defined permerror (
reg query "HKU\S-1-5-20\Software\Microsoft\Windows NT\CurrentVersion" %nul% && (
set "pol=HKU\S-1-5-20\Software\Microsoft\Windows NT\CurrentVersion\SoftwareProtectionPlatform\Policies"
reg query "!pol!" %nul% || reg add "!pol!" %nul%
%psc% "$netServ = (New-Object Security.Principal.SecurityIdentifier('S-1-5-20')).Translate([Security.Principal.NTAccount]).Value; $aclString = Get-Acl 'Registry::!pol!' | Format-List | Out-String; if (-not ($aclString.Contains($netServ + ' Allow FullControl') -or $aclString.Contains('NT SERVICE\sppsvc Allow FullControl')) -or ($aclString.Contains('Deny'))) {Exit 3}" %nul%
if !errorlevel!==3 set "permerror=Error Found In S-1-5-20 SPP"
)
)
if defined permerror (
set error=1
call :dk_color %Red% "Checking SPP Permissions [Error Found]"
call :dk_color %Red% "Checking SPP Permissions [!permerror!]"
if not defined showfix call :dk_color %Blue% "%_fixmsg%"
set showfix=1
)
)
:: If required services are not disabled or corrupted + if there is any error + SoftwareLicensingService errorlevel is not Zero + no fix was shown before
@@ -1951,7 +1986,7 @@ if ($osVersion.Build -ge $minBuildNumber) {
}
for ($i=1; $i -le $count; $i++) {
if (-not $subkeyHashTable.ContainsKey("$i")) {
Write-Output "Total Keys $count. Error Found- $i key does not exist"
Write-Output "Total Keys $count. Error Found - $i key does not exist."
$wpaKey.Close()
exit
}
@@ -1962,7 +1997,7 @@ $wpaKey.GetSubKeyNames() | ForEach-Object {
if ($PSVersionTable.PSVersion.Major -lt 3) {
cmd /c "reg query "HKLM\SYSTEM\WPA\$_" /ve /t REG_BINARY >nul 2>&1"
if ($LASTEXITCODE -ne 0) {
Write-Host "Total Keys $count. Error Found- Binary Data is corrupt"
Write-Host "Total Keys $count. Error Found - Binary Data is corrupt."
$wpaKey.Close()
exit
}
@@ -1970,7 +2005,7 @@ $wpaKey.GetSubKeyNames() | ForEach-Object {
$subkey = $wpaKey.OpenSubKey($_)
$p = $subkey.GetValueNames()
if (($p | Where-Object { $subkey.GetValueKind($_) -eq [Microsoft.Win32.RegistryValueKind]::Binary }).Count -eq 0) {
Write-Host "Total Keys $count. Error Found- Binary Data is corrupt"
Write-Host "Total Keys $count. Error Found - Binary Data is corrupt."
$wpaKey.Close()
exit
}
@@ -2009,13 +2044,13 @@ echo:
if %_unattended%==1 timeout /t 2 & exit /b
if defined fixes (
call :dk_color2 %Blue% "Press [1] To Open Troubleshoot Page " %Gray% " Press [0] To Ignore"
call :dk_color2 %Blue% "Press [1] to Open Troubleshoot Page " %Gray% " Press [0] to Ignore"
choice /C:10 /N
if !errorlevel!==1 (for %%# in (%fixes%) do (start %%#))
)
if defined terminal (
call :dk_color %_Yellow% "Press 0 key to %_exitmsg%..."
call :dk_color %_Yellow% "Press [0] key to %_exitmsg%..."
choice /c 0 /n
) else (
call :dk_color %_Yellow% "Press any key to %_exitmsg%..."
@@ -2370,7 +2405,13 @@ $MemoryStream.Close()
:: For any further question, feel free to contact us on mass grave[.]dev/contactus
::
::========================================================================================================================================
::
:: If you want to use a different sppc.dll or without base64 format, then create a folder named "BIN" where this script is located and
:: place these two files in that "BIN" folder. sppc32.dll, sppc64.dll
:: Script will auto pick that instead of using the below from base64 section. You can also delete the below code in that case.
::
::========================================================================================================================================
::
:: Replace "-" with "A" and "_" with "a" before base64 conversion
:: It was changed to prevent antiviruses from detecting and flagging base64 encoding

View File

@@ -1,4 +1,4 @@
@set masver=2.6
@set masver=2.7
@echo off
@@ -46,13 +46,13 @@ set _port=
:: To run the script in debug mode, change 0 to any parameter above that you want to run, in below line
set "_debug=0"
:: If value is changed in above lines or any parameter is used then script will run in unattended mode
:: Script will run in unattended mode if parameters are used OR value is changed in above lines FOR activation or uninstall.
::========================================================================================================================================
:: Set Environment variables, it helps if they are misconfigured in the system
:: Set environment variables, it helps if they are misconfigured in the system
setlocal EnableExtensions
setlocal DisableDelayedExpansion
@@ -191,13 +191,13 @@ call :dk_setvar
if %winbuild% LSS 7600 (
%nceline%
echo Unsupported OS version detected [%winbuild%].
echo Project is supported for Windows 7/8/8.1/10/11 and their Server equivalent.
echo MAS only supports Windows 7/8/8.1/10/11 and their Server equivalents.
goto dk_done
)
::========================================================================================================================================
:: Fix special characters limitation in path name
:: Fix special character limitations in path name
set "_work=%~dp0"
if "%_work:~-1%"=="\" set "_work=%_work:~0,-1%"
@@ -217,8 +217,8 @@ setlocal EnableDelayedExpansion
echo "!_batf!" | find /i "!_ttemp!" %nul1% && (
if /i not "!_work!"=="!_ttemp!" (
%eline%
echo Script is launched from the temp folder,
echo Most likely you are running the script directly from the archive file.
echo The script was launched from the temp folder.
echo You are most likely running the script directly from the archive file.
echo:
echo Extract the archive file and launch the script from the extracted folder.
goto dk_done
@@ -238,13 +238,16 @@ echo:
cmd /c "%psc% "$ExecutionContext.SessionState.LanguageMode"" | find /i "FullLanguage" %nul1% && (
echo Failed to run Powershell command but Powershell is working.
call :dk_color %Blue% "Check if your antivirus is blocking the script."
) || (
echo PowerShell is not working. Aborting...
echo If you have applied restrictions on Powershell then undo those changes.
)
echo:
set fixes=%fixes% %mas%troubleshoot
call :dk_color2 %Blue% "Help - " %_Yellow% " %mas%troubleshoot"
) || (
echo PowerShell is not working. Aborting...
echo If you have applied restrictions on Powershell then undo those changes.
echo:
set fixes=%fixes% %mas%fix_powershell
call :dk_color2 %Blue% "Help - " %_Yellow% " %mas%fix_powershell"
)
goto dk_done
)
@@ -256,7 +259,7 @@ goto dk_done
if not defined _elev %psc% "start cmd.exe -arg '/c \"!_PSarg!\"' -verb runas" && exit /b
%eline%
echo This script needs admin rights.
echo To do so, right click on this script and select 'Run as administrator'.
echo Right click on this script and select 'Run as administrator'.
goto dk_done
)
@@ -309,20 +312,20 @@ set -=
set old=
for /f "delims=[] tokens=2" %%# in ('ping -4 -n 1 updatecheck.mass%-%grave.dev') do (
if not [%%#]==[] (echo "%%#" | find "127.69" %nul1% && (echo "%%#" | find "127.69.%masver%" %nul1% || set old=1))
if not "%%#"=="" (echo "%%#" | find "127.69" %nul1% && (echo "%%#" | find "127.69.%masver%" %nul1% || set old=1))
)
if defined old (
echo ________________________________________________
%eline%
echo Version %masver% of MAS is outdated.
echo Your version of MAS [%masver%] is outdated.
echo ________________________________________________
echo:
if not %_unattended%==1 (
echo [1] Get Latest MAS
echo [0] Continue Anyway
echo:
call :dk_color %_Green% "Enter a menu option in the Keyboard [1,0] :"
call :dk_color %_Green% "Choose a menu option using your keyboard [1,0] :"
choice /C:10 /N
if !errorlevel!==2 rem
if !errorlevel!==1 (start ht%-%tps://github.com/mass%-%gravel/Microsoft-Acti%-%vation-Scripts & start %mas% & exit /b)
@@ -347,6 +350,11 @@ echo:
echo:
echo:
echo:
if exist "%ProgramFiles%\Activation-Renewal\Activation_task.cmd" (
find /i "Ver:2.7" "%ProgramFiles%\Activation-Renewal\Activation_task.cmd" %nul% || (
call :dk_color %_Yellow% " Old renewal task found, run activation to update it."
)
)
echo ______________________________________________________________
echo:
echo [1] Activate - Windows
@@ -377,7 +385,7 @@ echo [9] Download Office
echo [0] %_exitmsg%
echo ______________________________________________________________
echo:
call :dk_color2 %_White% " " %_Green% "Enter a menu option in the Keyboard [1,2,3,4,5,6,7,8,9,0]"
call :dk_color2 %_White% " " %_Green% "Choose a menu option using your keyboard [1,2,3,4,5,6,7,8,9,0]"
choice /C:1234567890 /N
set _el=!errorlevel!
@@ -412,7 +420,7 @@ call :dk_chkmal
if not exist %SysPath%\sppsvc.exe (
%eline%
echo [%SysPath%\sppsvc.exe] file is missing. Aborting...
echo [%SysPath%\sppsvc.exe] file is missing, aborting...
echo:
set fixes=%fixes% %mas%troubleshoot
call :dk_color2 %Blue% "Help - " %_Yellow% " %mas%troubleshoot"
@@ -444,7 +452,7 @@ call :dk_showosinfo
set _int=
for %%a in (l.root-servers.net resolver1.opendns.com download.windowsupdate.com google.com) do if not defined _int (
for /f "delims=[] tokens=2" %%# in ('ping -n 1 %%a') do (if not [%%#]==[] set _int=1)
for /f "delims=[] tokens=2" %%# in ('ping -n 1 %%a') do (if not "%%#"=="" set _int=1)
)
if not defined _int (
@@ -500,13 +508,13 @@ if exist "%SystemRoot%\Servicing\Packages\Microsoft-Windows-Server*EvalCorEditio
if defined _eval (
reg query "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion" /v EditionID %nul2% | find /i "Eval" %nul1% && (
call :dk_color %Red% "Checking Eval Edition [Evaluation Editions cannot be activated outside of evaluation period.]"
call :dk_color %Red% "Checking Evaluation Edition [Evaluation editions cannot be activated outside of evaluation period.]"
if defined _evalserv (
call :dk_color %Blue% "Go back to main menu and use [Change Edition] option."
) else (
set fixes=%fixes% %mas%evaluation-editions
call :dk_color2 %Blue% "Help - " %_Yellow% " %mas%evaluation-editions"
set fixes=%fixes% %mas%evaluation_editions
call :dk_color2 %Blue% "Help - " %_Yellow% " %mas%evaluation_editions"
)
goto :ks_office
@@ -538,7 +546,7 @@ set /a UBR=0
if %osSKU%==191 if defined altkey if defined altedition (
for /f "skip=2 tokens=2*" %%a in ('reg query "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion" /v UBR %nul6%') do if not errorlevel 1 set /a UBR=%%b
if %winbuild% LSS 22598 if !UBR! LSS 2788 (
call :dk_color %Blue% "Windows must to be updated to build 19044.2788 or higher for IotEnterpriseS %KS% activation."
call :dk_color %Blue% "Windows must be updated to build 19044.2788 or higher for IotEnterpriseS %KS% activation."
)
)
@@ -549,11 +557,11 @@ call :dk_color %Red% "Checking Alternate Edition For %KS% [%altedition% Act
if not defined key if not defined _gvlk (
echo [%winos% ^| %winbuild% ^| SKU:%osSKU%]
if not defined skunotfound (
echo This product does not support %KS% Activation.
echo This product does not support %KS% activation.
set fixes=%fixes% %mas%unsupported_products_activation
call :dk_color2 %Blue% "Help - " %_Yellow% " %mas%unsupported_products_activation"
) else (
echo Required License files not found in %SysPath%\spp\tokens\skus\
echo Required license files not found in %SysPath%\spp\tokens\skus\
set fixes=%fixes% %mas%troubleshoot
call :dk_color2 %Blue% "Help - " %_Yellow% " %mas%troubleshoot"
)
@@ -566,7 +574,7 @@ goto :ks_office
:: Install key
if defined changekey (
call :dk_color %Blue% "[%altedition%] Edition product key will be used to enable %KS% activation."
call :dk_color %Blue% "[%altedition%] edition product key will be used to enable %KS% activation."
echo:
)
@@ -594,6 +602,28 @@ if not %_actoff%==1 goto :ks_activate
call :ks_setspp
:: Check ohook install
set ohook=
for %%# in (15 16) do (
for %%A in ("%ProgramFiles%" "%ProgramW6432%" "%ProgramFiles(x86)%") do (
if exist "%%~A\Microsoft Office\Office%%#\sppc*dll" set ohook=1
)
)
for %%# in (System SystemX86) do (
for %%G in ("Office 15" "Office") do (
for %%A in ("%ProgramFiles%" "%ProgramW6432%" "%ProgramFiles(x86)%") do (
if exist "%%~A\Microsoft %%~G\root\vfs\%%#\sppc*dll" set ohook=1
)
)
)
if defined ohook (
echo:
call :dk_color %Gray% "Checking Ohook [Ohook activation is already installed for Office]"
)
:: Check unsupported office versions
set o14c2r=
@@ -799,9 +829,25 @@ call :_taskregserv
call :_taskact
if not defined showfix if defined _tserror (call :dk_color %Blue% "%_fixmsg%" & set showfix=1)
if %_norentsk%==0 (
:: Don't create renewal task if Windows/Office volume IDs are not found, even if script is set to create it by default
:: Don't create renewal task if only Windows volume ID is found and OEM BIOS error is present on Windows 7, even if script is set to create it by default
set _deltask=
if not %_norentsk%==0 set _deltask=1
if not defined _deltask (
if %_actwin%==0 call :_taskgetids sppwid %slp% windows
if %_actoff%==0 call :_taskgetids sppoid %slp% office
if %_actoff%==0 call :_taskgetids osppid %ospp% office
)
if not defined sppwid if not defined sppoid if not defined osppid (set _deltask=1)
if defined oemerr if not defined sppoid if not defined osppid (set _deltask=1)
if not defined _deltask (
call :ks_renewal
) else (
if exist "%ProgramFiles%\Activation-Renewal\Activation_task.cmd" call :dk_color %Gray% "Deleting activation renewal task..."
call :dk_color %Gray% "Skipping creation of activation renewal task..."
call :ks_clearstuff %nul%
if not defined _server (
if %winbuild% GEQ 9200 (
@@ -827,6 +873,11 @@ if %_actwin%==1 for %%# in (407) do if %osSKU%==%%# (
call :dk_color %Red% "%winos% does not support activation on non-azure platforms."
)
if %_actoff%==1 if defined sppoid if not defined _tserror if %_NoEditionChange%==0 if defined ohub (
echo:
call :dk_color %Gray% "Office apps such as Word, Excel are activated, use them directly. Ignore 'Buy' button in Office dashboard app."
)
:: Trigger reevaluation of SPP's Scheduled Tasks
call :dk_reeval %nul%
@@ -984,9 +1035,11 @@ for %%# in (%_oIds%) do (
set skipprocess=
if %_NoEditionChange%==1 if not defined _oBranding (
echo %%# | findstr /i "Retail" %nul% && (
set foundprod=
call :ksdata chkprod %%#
if not defined foundprod (
set skipprocess=1
echo Skipping Because NoEditionChange Mode [%%#]
call :dk_color %Gray% "Skipping Because NoEditionChange Mode [%%#]"
)
)
@@ -994,7 +1047,7 @@ echo Skipping Because NoEditionChange Mode [%%#]
if "%_actprojvis%"=="1" if not defined skipprocess (
echo %%# | findstr /i "Project Visio" %nul% || (
set skipprocess=1
echo Skipping Because Project/Visio Mode [%%#]
call :dk_color %Gray% "Skipping Because Project/Visio Mode [%%#]"
)
)
@@ -1026,7 +1079,7 @@ set _prod=!_altoffid!
call :ks_osppready
)
if not [!key!]==[] (
if not "!key!"=="" (
echo "!allapps!" | find /i "!_actid!" %nul1% || call :oh_installlic
call :dk_inskey "[!key!] [!_prod!]"
) else (
@@ -1066,8 +1119,8 @@ for /f "skip=2 tokens=2*" %%a in ('"reg query %2\Common\ProductVersion /v LastPr
if "%_oRoot:~-1%"=="\" set "_oRoot=%_oRoot:~0,-1%"
echo "%2" | find /i "Wow6432Node" %nul1% && set _oArch=x86
if not [%osarch%]==[x86] if not defined _oArch set _oArch=x64
if [%osarch%]==[x86] set _oArch=x86
if not "%osarch%"=="x86" if not defined _oArch set _oArch=x64
if "%osarch%"=="x86" set _oArch=x86
set "_common=%CommonProgramFiles%"
if defined PROCESSOR_ARCHITEW6432 set "_common=%CommonProgramW6432%"
@@ -1154,7 +1207,7 @@ exit /b
:: https://learn.microsoft.com/office/troubleshoot/activation/reset-office-365-proplus-activation-state
set _sidlist=
for /f "tokens=* delims=" %%a in ('%psc% "$p = 'HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion\ProfileList'; Get-ChildItem $p | ForEach-Object { $pi = (Get-ItemProperty $('{0}\{1}' -f $p, $_.PSChildName)).ProfileImagePath; if ($pi -like $('{0}\Users\*' -f $Env:SystemDrive)) { Split-Path $_.PSPath -Leaf } }" %nul6%') do (if defined _sidlist (set _sidlist=!_sidlist! %%a) else (set _sidlist=%%a))
for /f "tokens=* delims=" %%a in ('%psc% "$p = 'HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion\ProfileList'; Get-ChildItem $p | ForEach-Object { $pi = (Get-ItemProperty """"$p\$($_.PSChildName)"""").ProfileImagePath; if ($pi -like """"$Env:SystemDrive\Users\*"""" -and (Test-Path """"$pi\NTUSER.DAT"""") -and -not ($_ -match '\.bak$')) { Split-Path $_.PSPath -Leaf } }" %nul6%') do (if defined _sidlist (set _sidlist=!_sidlist! %%a) else (set _sidlist=%%a))
if not defined _sidlist (
set error=1
@@ -1224,9 +1277,7 @@ reg delete HKLM\SOFTWARE\Microsoft\Office\15.0\ClickToRun\Configuration /v Share
:: Clear device-based-licensing
:: https://learn.microsoft.com/deployoffice/device-based-licensing
for %%# in (%_o16c2rIds%) do (
reg delete %o16c2r_reg%\Configuration /v %%#.DeviceBasedLicensing /f %nul%
)
for /f %%# in ('reg query "%o16c2r_reg%\Configuration" /f *.DeviceBasedLicensing %nul6% ^| findstr REG_') do reg delete "%o16c2r_reg%\Configuration" /v %%# /f %nul%
:: Remove OEM registry key
:: https://support.microsoft.com/office/office-repeatedly-prompts-you-to-activate-on-a-new-pc-a9a6b05f-f6ce-4d1f-8d49-eb5007b64ba1
@@ -1237,8 +1288,10 @@ reg delete "HKLM\SOFTWARE\Microsoft\Office\%%#.0\Common\OEM" /f /reg:32 %nul%
)
reg delete "HKU\S-1-5-20\Software\Microsoft\Windows NT\CurrentVersion\SoftwareProtectionPlatform\Policies\0ff1ce15-a989-479d-af46-f275c6370663" /f %nul%
reg delete "HKU\S-1-5-20\Software\Microsoft\OfficeSoftwareProtectionPlatform\Policies\0ff1ce15-a989-479d-af46-f275c6370663" /f %nul%
reg delete "HKU\S-1-5-20\Software\Microsoft\OfficeSoftwareProtectionPlatform\Policies\59a52881-a989-479d-af46-f275c6370663" /f %nul%
echo Clearing Office License Blocks [Successfully Cleared From All %counter% Useraccounts]
echo Clearing Office License Blocks [Successfully cleared from all %counter% user accounts]
::==========================
@@ -1256,7 +1309,7 @@ for %%# in (%_sidlist%) do (
reg delete HKU\%%#\Software\Microsoft\Office\16.0\Common\Licensing\Resiliency /f %nul%
reg add HKU\%%#\Software\Microsoft\Office\16.0\Common\Licensing\Resiliency /v "TimeOfLastHeartbeatFailure" /t REG_SZ /d "2040-01-01T00:00:00Z" /f %nul%
)
echo Adding Reg Keys To Skip License Check [Successfully Added To All %counter% ^& Future New Useraccounts]
echo Adding Reg Keys to Skip License Check [Successfully added to all %counter% ^& future new user accounts]
)
::==========================
@@ -1270,14 +1323,14 @@ reg query HKU\%%# %nul% && set failedtounload=1
if defined failedtoload (
set error=1
call :dk_color %Red% "Loading Unloaded accounts Registry [Failed For Some Useraccounts]"
call :dk_color %Blue% "Restart the system and try again."
call :dk_color %Red% "Loading Unloaded Accounts Registry [Failed for some user accounts]"
call :dk_color %Blue% "Reboot your machine using the restart option and try again."
)
if defined failedtounload (
set error=1
call :dk_color %Red% "Unloading loaded accounts Registry [Failed For Some Useraccounts]"
call :dk_color %Blue% "Restart the system and try again."
call :dk_color %Red% "Unloading Loaded Account Registries [Failed for some user accounts]"
call :dk_color %Blue% "Reboot your machine using the restart option and try again."
)
exit /b
@@ -1489,7 +1542,7 @@ set t_name=Run Once Task
set _wmic=0
for %%# in (wmic.exe) do @if not "%%~$PATH:#"=="" (
wmic path Win32_ComputerSystem get CreationClassName /value 2>nul | find /i "computersystem" 1>nul && set _wmic=1
cmd /c "wmic path Win32_ComputerSystem get CreationClassName /value" 2>nul | find /i "computersystem" 1>nul && set _wmic=1
)
setlocal EnableDelayedExpansion
@@ -1514,12 +1567,12 @@ call :_tasksetserv
for %%a in (%srvlist%) do (
for /f "delims=[] tokens=2" %%# in ('ping -n 1 %%a') do (
if not [%%#]==[] goto _taskIntConnected
if not "%%#"=="" goto _taskIntConnected
)
)
nslookup dns.msftncsi.com 2>nul | find "131.107.255.255" 1>nul
if [%errorlevel%]==[0] goto _taskIntConnected
if "%errorlevel%"=="0" goto _taskIntConnected
if %loop%==%max_loop% (
set _tserror=1
@@ -1630,14 +1683,14 @@ set /a act_attempt=0
if %act_attempt% GTR 4 exit /b
if not [%act_ok%]==[1] (
if not "%act_ok%"=="1" (
if not defined _server call :_taskgetserv
call :_taskregserv
)
if not !server_num! GTR %max_servers% (
if [%1]==[act_win] if %_kms38% EQU 1 (
if "%1"=="act_win" if %_kms38% EQU 1 (
set act_ok=1
exit /b
)
@@ -1651,7 +1704,7 @@ if !errorcode! EQU 0 (
set act_ok=1
exit /b
)
if [%1]==[act_win] if !errorcode! EQU -1073418187 if %winbuild% LSS 9200 (
if "%1"=="act_win" if !errorcode! EQU -1073418187 if %winbuild% LSS 9200 (
set act_ok=1
exit /b
)
@@ -1666,9 +1719,9 @@ exit /b
:_actinfo
if [%1]==[act_win] if not defined t_name (set prodname=%winos%)
if "%1"=="act_win" if not defined t_name (set prodname=%winos%)
if [%1]==[act_win] if %_kms38% EQU 1 (
if "%1"=="act_win" if %_kms38% EQU 1 (
if defined t_name (
echo %prodname% is already activated with KMS38.
) else (
@@ -1688,7 +1741,7 @@ set _tserror=1
exit /b
)
if %errorcode% EQU -1073418187 if [%1]==[act_win] if %winbuild% LSS 9200 (
if %errorcode% EQU -1073418187 if "%1"=="act_win" if %winbuild% LSS 9200 (
if defined t_name (
echo %prodname% cannot be KMS-activated on this computer due to unqualified OEM BIOS [0xC004F035].
) else (
@@ -1696,6 +1749,7 @@ call :dk_color %Red% "%prodname% cannot be KMS-activated on this computer due to
set fixes=%fixes% %mas%unsupported_products_activation
call :dk_color2 %Blue% "Help - " %_Yellow% " %mas%unsupported_products_activation"
)
set oemerr=1
set showfix=1
exit /b
)
@@ -1732,9 +1786,9 @@ exit /b
)
set _actpass=1
if %gpr% EQU 43200 if [%1]==[act_win] if %winbuild% GEQ 9200 set _actpass=0
if %gpr% EQU 43200 if "%1"=="act_win" if %winbuild% GEQ 9200 set _actpass=0
if %gpr% EQU 64800 set _actpass=0
if %gpr% GTR 259200 if [%1]==[act_win] call :_taskchkEnterpriseG _actpass
if %gpr% GTR 259200 if "%1"=="act_win" call :_taskchkEnterpriseG _actpass
if %gpr% EQU 259200 set _actpass=0
if %errorcode% EQU 0 if %_actpass% EQU 0 (
@@ -1938,10 +1992,11 @@ set !server%rand%!=1
set /a server_num+=1
(for /f "delims=[] tokens=2" %%a in ('ping -4 -n 1 %KMS_IP% 2^>nul') do set "KMS_IP=%%a"
if [%KMS_IP%]==[!KMS_IP!] for /f "delims=[] tokens=2" %%# in ('pathping -4 -h 1 -n -p 1 -q 1 -w 1 %KMS_IP% 2^>nul') do set "KMS_IP=%%#"
if not [%KMS_IP%]==[!KMS_IP!] exit /b
if "%KMS_IP%"=="!KMS_IP!" for /f "delims=[] tokens=2" %%# in ('pathping -4 -h 1 -n -p 1 -q 1 -w 1 %KMS_IP% 2^>nul') do set "KMS_IP=%%#"
if not "%KMS_IP%"=="!KMS_IP!" exit /b
goto :_taskgetserv
)
::Ver:2.7
:_extracttask:
::========================================================================================================================================
@@ -1961,7 +2016,8 @@ exit /b
)
if not exist "%_dest%\" md "%_dest%\" %nul%
set "_temp=%SystemRoot%\Temp\_taskwork_%Random%"
for /f %%G in ('%psc% "[Guid]::NewGuid().Guid"') do set "randguid=%%G"
set "_temp=%SystemRoot%\Temp\%Random%%randguid%"
set nil=
if exist "%_temp%\.*" rmdir /s /q "%_temp%\" %nul%
@@ -1973,7 +2029,7 @@ if not defined _int (s%nil%cht%nil%asks /cre%nil%ate /tn "Activation-Run_Once" /
if exist "%_temp%\.*" rmdir /s /q "%_temp%\" %nul%
call :ks_createInfo.txt
%psc% "$f=[io.file]::ReadAllText('!_batp!') -split \":_extracttask\:.*`r`n\"; [io.file]::WriteAllText('%_dest%\Activation_task.cmd', '@REM MASver %masver%' + ' - Dummy%random%' + [Environment]::NewLine + $f[1].Trim(), [System.Text.Encoding]::ASCII)"
%psc% "$f=[io.file]::ReadAllText('!_batp!') -split \":_extracttask\:.*`r`n\"; [io.file]::WriteAllText('%_dest%\Activation_task.cmd', '@::%randguid%' + [Environment]::NewLine + $f[1].Trim(), [System.Text.Encoding]::ASCII)"
::========================================================================================================================================
@@ -2176,6 +2232,7 @@ set "Red="41;97m""
set "Gray="100;97m""
set "Green="42;97m""
set "Blue="44;97m""
set "_Red="40;91m""
set "_White="40;37m""
set "_Green="40;92m""
set "_Yellow="40;93m""
@@ -2184,6 +2241,7 @@ set "Red="Red" "white""
set "Gray="Darkgray" "white""
set "Green="DarkGreen" "white""
set "Blue="Blue" "white""
set "_Red="Black" "Red""
set "_White="Black" "Gray""
set "_Green="Black" "Green""
set "_Yellow="Black" "Yellow""
@@ -2390,7 +2448,7 @@ function ReinstallLicenses() {
set _wmic=0
for %%# in (wmic.exe) do @if not "%%~$PATH:#"=="" (
wmic path Win32_ComputerSystem get CreationClassName /value %nul2% | find /i "computersystem" %nul1% && set _wmic=1
cmd /c "wmic path Win32_ComputerSystem get CreationClassName /value" %nul2% | find /i "computersystem" %nul1% && set _wmic=1
)
exit /b
@@ -2398,7 +2456,6 @@ exit /b
:dk_sppissue
set w=
sc start sppsvc %nul%
set spperror=%errorlevel%
@@ -2407,14 +2464,6 @@ if %spperror% NEQ 1056 if %spperror% NEQ 0 (
echo sc start sppsvc [Error Code: %spperror%]
)
echo "%spperror%" | findstr "577 225" %nul% && (
echo:
echo Your system is most likely infected with Mal%w%ware.
echo:
set fixes=%fixes% %mas%remove_mal%w%ware
call :dk_color2 %Blue% "Help - " %_Yellow% " %mas%remove_mal%w%ware"
)
echo:
%psc% "$job = Start-Job { (Get-WmiObject -Query 'SELECT * FROM %sps%').Version }; if (-not (Wait-Job $job -Timeout 20)) {write-host 'sppsvc is not working correctly. Help - %mas%troubleshoot'}"
exit /b
@@ -2499,7 +2548,7 @@ for %%# in (pkeyhelper.dll) do @if "%%~$PATH:#"=="" exit /b
for %%# in (Volume:GVLK) do (
call :k_pkey %osSKU% '%%#'
if defined pkey call :k_pkeychannel !pkey!
if /i [!pkeychannel!]==[%%#] (
if /i "!pkeychannel!"=="%%#" (
set key=!pkey!
exit /b
)
@@ -2524,7 +2573,7 @@ set pupfound=%pupfound1%%pupfound2%
set hcount=0
for %%# in (avira.com kaspersky.com virustotal.com mcafee.com) do (
find /i "%%#" %SysPath%\drivers\etc\hosts %nul% && set /a hcount+=1)
if %hcount%==4 set "results=[AV URLs are blocked in hosts]"
if %hcount%==4 set "results=[Antivirus URLs are blocked in hosts]"
set wucount=0
for %%# in (wuauserv) do (
@@ -2533,14 +2582,19 @@ for %%G in (DependOnService Description DisplayName ErrorControl ImagePath Objec
reg query HKLM\SYSTEM\CurrentControlSet\Services\%%# /v %%G %nul% || (set _corrupt=1 & set /a wucount+=1)
)
)
if %wucount% GEQ 1 set "results=%results%[WU registry is corrupt]"
if %wucount% GEQ 1 set "results=%results%[Windows Update registry is corrupt]"
sc start sppsvc %nul%
echo "%errorlevel%" | findstr "577 225" %nul% && set "results=%results%[Likely File Infector]"
echo "%errorlevel%" | findstr "577 225" %nul% && (
set "results=%results%[Likely File Infector]"
) || (
if not exist %SysPath%\sppsvc.exe if not exist %SysPath%\alg.exe (set "results=%results%[Likely File Infector]")
)
if not "%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 %results%"
if defined results call :dk_color %Red% "Checking Probable Mal%w%ware Infection..."
if defined results call :dk_color %Red% "%results%"
set fixes=%fixes% %mas%remove_mal%w%ware
call :dk_color2 %Blue% "Help - " %_Yellow% " %mas%remove_mal%w%ware"
echo:
@@ -2554,6 +2608,18 @@ exit /b
set showfix=
call :dk_chkmal
:: Check Sandboxing
sc query Null %nul% || (
set error=1
set showfix=1
call :dk_color %Red% "Checking Sandboxing [Found, script may not work properly.]"
call :dk_color %Blue% "If you are using any third-party antivirus, check if it is blocking the script."
echo:
)
::========================================================================================================================================
:: Check corrupt services
set serv_cor=
@@ -2571,6 +2637,7 @@ if defined _corrupt (if defined serv_cor (set "serv_cor=!serv_cor! %%#") else (s
if defined serv_cor (
set error=1
set showfix=1
call :dk_color %Red% "Checking Corrupt Services [%serv_cor%]"
)
@@ -2637,7 +2704,7 @@ if defined serv_e (
set error=1
call :dk_color %Red% "Starting Services [Failed] [%serv_e%]"
echo %serv_e% | findstr /i "ClipSVC-1058 sppsvc-1058" %nul% && (
call :dk_color %Blue% "Restart the system to fix this error."
call :dk_color %Blue% "Reboot your machine using the restart option to fix this error."
set showfix=1
)
)
@@ -2677,7 +2744,7 @@ for /f "delims=" %%a in ('%psc% "$f=[io.file]::ReadAllText('!_batp!') -split ':w
echo "%wpainfo%" | find /i "Error Found" %nul% && (
set error=1
set wpaerror=1
call :dk_color %Red% "Checking WPA Registry Error [%wpainfo%]"
call :dk_color %Red% "Checking WPA Registry Errors [%wpainfo%]"
) || (
echo Checking WPA Registry Count [%wpainfo%]
)
@@ -2687,8 +2754,8 @@ if not defined officeact if exist "%SystemRoot%\Servicing\Packages\Microsoft-Win
reg query "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion" /v EditionID %nul2% | find /i "Eval" %nul1% || (
set error=1
call :dk_color %Red% "Checking Eval Packages [Non-Eval Licenses are installed in Eval Windows]"
set fixes=%fixes% %mas%evaluation-editions
call :dk_color2 %Blue% "Help - " %_Yellow% " %mas%evaluation-editions"
set fixes=%fixes% %mas%evaluation_editions
call :dk_color2 %Blue% "Help - " %_Yellow% " %mas%evaluation_editions"
)
)
@@ -2716,7 +2783,7 @@ call :dk_color %Red% "Checking License Files [Not Found] [%osed
if not exist "%SystemRoot%\Servicing\Packages\Microsoft-Windows-*-%osedition%-*.mum" (
set error=1
call :dk_color %Red% "Checking Package File [Not Found] [%osedition%]"
call :dk_color %Red% "Checking Package Files [Not Found] [%osedition%]"
)
)
)
@@ -2741,7 +2808,7 @@ echo "%error_code%" | findstr /i "0x800410 0x800440" %nul1% && set wmifailed=1&
if defined wmifailed (
set error=1
call :dk_color %Red% "Checking WMI [Not Working]"
call :dk_color %Blue% "Go back to Main Menu, select Troubleshoot and run Fix WMI option."
if not defined showfix call :dk_color %Blue% "Go back to Main Menu, select Troubleshoot and run Fix WMI option."
set showfix=1
)
@@ -2785,26 +2852,25 @@ echo Checking Eval WLMS Service [Found]
)
reg query "HKU\S-1-5-20" %nul% && (
if %winbuild% GEQ 15063 reg query "HKU\S-1-5-20\Software\Microsoft\Windows NT\CurrentVersion\SoftwareProtectionPlatform" %nul% || (
reg query "HKU\S-1-5-20\Software\Microsoft\Windows NT\CurrentVersion" %nul% || (
set error=1
call :dk_color %Red% "Checking S-1-5-20 SPP Reg [Not Found]"
set fixes=%fixes% %mas%troubleshoot
call :dk_color2 %Blue% "Help - " %_Yellow% " %mas%troubleshoot"
)
) || (
set error=1
call :dk_color %Red% "Checking HKU\S-1-5-20 Reg [Not Found]"
call :dk_color %Red% "Checking HKU\S-1-5-20 Registry [Not Found]"
set fixes=%fixes% %mas%troubleshoot
call :dk_color2 %Blue% "Help - " %_Yellow% " %mas%troubleshoot"
)
for %%# in (SppEx%w%tComObj.exe sppsvc.exe) do (
for %%# in (SppEx%w%tComObj.exe sppsvc.exe sppsvc.exe\PerfOptions) do (
reg query "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Ima%w%ge File Execu%w%tion Options\%%#" %nul% && (if defined _sppint (set "_sppint=!_sppint!, %%#") else (set "_sppint=%%#"))
)
if defined _sppint (
echo Checking SPP Interference In IFEO [%_sppint%]
echo %_sppint% | find /i "PerfOptions" %nul% && (
call :dk_color %Red% "Checking SPP Interference In IFEO [%_sppint% - System might deactivate later]"
if not defined showfix call :dk_color %Blue% "%_fixmsg%"
set showfix=1
) || (
echo Checking SPP In IFEO [%_sppint%]
)
)
@@ -2819,7 +2885,7 @@ set error=1
reg query "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\SoftwareProtectionPlatform\Plugins\Objects\msft:rm/algorithm/hwid/4.0" /f ba02fed39662 /d %nul% || (
call :dk_color %Red% "Checking SPP Registry Key [Incorrect ModuleId Found]"
set fixes=%fixes% %mas%issues_due_to_gaming_spoofers
call :dk_color2 %Blue% "Possibly Caused By Gaming Spoofers. Help - " %_Yellow% " %mas%issues_due_to_gaming_spoofers"
call :dk_color2 %Blue% "Most likely caused by HWID spoofers. Help - " %_Yellow% " %mas%issues_due_to_gaming_spoofers"
set error=1
set showfix=1
)
@@ -2849,10 +2915,11 @@ set "d=!d! $AclObject.SetSecurityDescriptorSddlForm($sddl);"
set "d=!d! Set-Acl -Path %tokenstore% -AclObject $AclObject;"
%psc% "!d!" %nul%
if exist "%tokenstore%\" (
call :dk_color %Gray% "Checking SPP Token Folder [Not Found. Created Now] [%tokenstore%\]"
call :dk_color %Gray% "Checking SPP Token Folder [Not Found, Created Now] [%tokenstore%\]"
) else (
call :dk_color %Red% "Checking SPP Token Folder [Not Found. Failed To Create] [%tokenstore%\]"
call :dk_color %Red% "Checking SPP Token Folder [Not Found, Failed to Create] [%tokenstore%\]"
set error=1
set showfix=1
)
)
@@ -2884,30 +2951,48 @@ for /f "delims=" %%a in ('%psc% "(Get-ScheduledTask -TaskName 'SvcRestartTask' -
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
call :dk_color %Red% "Checking SvcRestartTask Status [!taskinfo!]"
call :dk_color %Red% "Checking SvcRestartTask Status [!taskinfo!, System might deactivate later]"
)
)
:: This code checks if NT SERVICE\sppsvc has permission access to tokens folder and required registry keys. It's often caused by gaming spoofers.
:: This code checks if SPP has permission access to tokens folder and required registry keys. It's often caused by gaming spoofers.
set permerror=
if not exist "%tokenstore%\" set permerror=1
if %winbuild% GEQ 9200 for %%# in (
if %winbuild% GEQ 9200 (
for %%# in (
"%tokenstore%+FullControl"
"HKLM:\SYSTEM\WPA+QueryValues, EnumerateSubKeys, WriteKey"
"HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion\SoftwareProtectionPlatform+SetValue"
) do for /f "tokens=1,2 delims=+" %%A in (%%#) do if not defined permerror (
%psc% "$acl = (Get-Acl '%%A' | fl | Out-String); if (-not ($acl -match 'NT SERVICE\\sppsvc Allow %%B') -or ($acl -match 'NT SERVICE\\sppsvc Deny')) {Exit 2}" %nul%
if !errorlevel!==2 set permerror=1
if !errorlevel!==2 (
if "%%A"=="%tokenstore%" (
set "permerror=Error Found In Token Folder"
) else (
set "permerror=Error Found In SPP Registries"
)
)
)
if %winbuild% GEQ 9200 if defined permerror (
REM https://learn.microsoft.com/office/troubleshoot/activation/license-issue-when-start-office-application
if not defined permerror (
reg query "HKU\S-1-5-20\Software\Microsoft\Windows NT\CurrentVersion" %nul% && (
set "pol=HKU\S-1-5-20\Software\Microsoft\Windows NT\CurrentVersion\SoftwareProtectionPlatform\Policies"
reg query "!pol!" %nul% || reg add "!pol!" %nul%
%psc% "$netServ = (New-Object Security.Principal.SecurityIdentifier('S-1-5-20')).Translate([Security.Principal.NTAccount]).Value; $aclString = Get-Acl 'Registry::!pol!' | Format-List | Out-String; if (-not ($aclString.Contains($netServ + ' Allow FullControl') -or $aclString.Contains('NT SERVICE\sppsvc Allow FullControl')) -or ($aclString.Contains('Deny'))) {Exit 3}" %nul%
if !errorlevel!==3 set "permerror=Error Found In S-1-5-20 SPP"
)
)
if defined permerror (
set error=1
call :dk_color %Red% "Checking SPP Permissions [Error Found]"
call :dk_color %Red% "Checking SPP Permissions [!permerror!]"
if not defined showfix call :dk_color %Blue% "%_fixmsg%"
set showfix=1
)
)
:: If required services are not disabled or corrupted + if there is any error + SoftwareLicensingService errorlevel is not Zero + no fix was shown before
@@ -2950,7 +3035,7 @@ if ($osVersion.Build -ge $minBuildNumber) {
}
for ($i=1; $i -le $count; $i++) {
if (-not $subkeyHashTable.ContainsKey("$i")) {
Write-Output "Total Keys $count. Error Found- $i key does not exist"
Write-Output "Total Keys $count. Error Found - $i key does not exist."
$wpaKey.Close()
exit
}
@@ -2961,7 +3046,7 @@ $wpaKey.GetSubKeyNames() | ForEach-Object {
if ($PSVersionTable.PSVersion.Major -lt 3) {
cmd /c "reg query "HKLM\SYSTEM\WPA\$_" /ve /t REG_BINARY >nul 2>&1"
if ($LASTEXITCODE -ne 0) {
Write-Host "Total Keys $count. Error Found- Binary Data is corrupt"
Write-Host "Total Keys $count. Error Found - Binary Data is corrupt."
$wpaKey.Close()
exit
}
@@ -2969,7 +3054,7 @@ $wpaKey.GetSubKeyNames() | ForEach-Object {
$subkey = $wpaKey.OpenSubKey($_)
$p = $subkey.GetValueNames()
if (($p | Where-Object { $subkey.GetValueKind($_) -eq [Microsoft.Win32.RegistryValueKind]::Binary }).Count -eq 0) {
Write-Host "Total Keys $count. Error Found- Binary Data is corrupt"
Write-Host "Total Keys $count. Error Found - Binary Data is corrupt."
$wpaKey.Close()
exit
}
@@ -3008,13 +3093,13 @@ echo:
if %_unattended%==1 timeout /t 2 & exit /b
if defined fixes (
call :dk_color2 %Blue% "Press [1] To Open Troubleshoot Page " %Gray% " Press [0] To Ignore"
call :dk_color2 %Blue% "Press [1] to Open Troubleshoot Page " %Gray% " Press [0] to Ignore"
choice /C:10 /N
if !errorlevel!==1 (for %%# in (%fixes%) do (start %%#))
)
if defined terminal (
call :dk_color %_Yellow% "Press 0 key to %_exitmsg%..."
call :dk_color %_Yellow% "Press [0] key to %_exitmsg%..."
choice /c 0 /n
) else (
call :dk_color %_Yellow% "Press any key to %_exitmsg%..."
@@ -3162,7 +3247,7 @@ exit /b
:: 2nd column = GVLK / Free Office products keys
:: 3rd column = In case of Windows, its SKU ID. In case of Office, its Office version
:: 4th column = Edition ID
:: 5th column = In case of Windows, its Build Branch name incase same Edition ID is used in different OS versions with different key (For reference only)
:: 5th column = In case of Windows, its Build Branch name in case same Edition ID is used in different OS versions with different key (For reference only)
:: In case of Office, its either a key type if its a free Office product or Retail product names that needs to be converted to the Edition ID mentioned in 4th column
:: In Office 2010, one highest VL edition from each primary product ID is selected, that's why Visio Prem key is mentioned but not for Visio Pro, Std
:: Separator = "_"
@@ -3292,6 +3377,7 @@ a78b8bd9-8017-4df5-b86a-09f756affa7c_6TPJF-RBVHG-WBW2R-86QPH-6R%f%TM4__17_Server
cda18cf3-c196-46ad-b289-60c072869994_TT8MH-CG224-D3D7Q-498W2-9Q%f%CTX__18_ServerHPC
a78b8bd9-8017-4df5-b86a-09f756affa7c_6TPJF-RBVHG-WBW2R-86QPH-6R%f%TM4__29_ServerWebCore
f772515c-0e87-48d5-a676-e6962c3e1195_736RG-XDKJK-V34PF-BHK87-J6%f%X3K__56_ServerEmbeddedSolution
::========================================================================================================================================
:: Office 2010
8ce7e872-188c-4b98-9d90-f8f90b7aad02_V7Y44-9T38C-R2VJK-666HK-T7%f%DDX__14_AccessVL
cee5d470-6e3b-4fcc-8c2b-d17428568a9f_H62QG-HXVKF-PP4HP-66KMR-CW%f%9BM__14_ExcelVL
@@ -3410,6 +3496,10 @@ if %1==winkey if %osSKU%==%%C if not defined key (
echo "!allapps!" | find /i "%%A" %nul1% && set key=%%B
)
if %1==chkprod if "%oVer%"=="%%C" if not defined foundprod (
echo "%%D" | findstr /I "\<%2.*" %nul% && set foundprod=1
)
if %1==getinfo if not defined key if "%oVer%"=="%%C" (
if /i "%2"=="%%D" (
set key=%%B

File diff suppressed because it is too large Load Diff

View File

@@ -6,10 +6,23 @@
:: https://gravesoft.dev/cas
:: Set Environment variables, it helps if they are misconfigured in the system
setlocal EnableExtensions
setlocal DisableDelayedExpansion
set "PathExt=.COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH;.MSC"
set "SysPath=%SystemRoot%\System32"
set "Path=%SystemRoot%\System32;%SystemRoot%;%SystemRoot%\System32\Wbem;%SystemRoot%\System32\WindowsPowerShell\v1.0\"
if exist "%SystemRoot%\Sysnative\reg.exe" (
set "SysPath=%SystemRoot%\Sysnative"
set "Path=%SystemRoot%\Sysnative;%SystemRoot%;%SystemRoot%\Sysnative\Wbem;%SystemRoot%\Sysnative\WindowsPowerShell\v1.0\;%Path%"
)
set "ComSpec=%SysPath%\cmd.exe"
set "PSModulePath=%ProgramFiles%\WindowsPowerShell\Modules;%SysPath%\WindowsPowerShell\v1.0\Modules"
set "_psc=powershell -nop -c"
set "_err===== ERROR ===="
set _pwsh=1
@@ -29,8 +42,8 @@ setlocal EnableDelayedExpansion
:E_Exit
echo.
echo Press any key to exit.
pause >nul
echo Press 0 key to exit.
choice /c 0 /n
exit /b
:sppmgr:

View File

@@ -1,15 +1,12 @@
@set masver=2.6
@setlocal DisableDelayedExpansion
@set masver=2.7
@echo off
::============================================================================
::
:: This script is a part of 'Microsoft-Activation-Scripts' (MAS) project.
::
:: Homepage: mass grave[.]dev
:: Email: windowsaddict@protonmail.com
:: Email: mas.help@outlook.com
::
::============================================================================
@@ -17,26 +14,32 @@
::========================================================================================================================================
:: Set Path variable, it helps if it is misconfigured in the system
:: Set environment variables, it helps if they are misconfigured in the system
set "PATH=%SystemRoot%\System32;%SystemRoot%\System32\wbem;%SystemRoot%\System32\WindowsPowerShell\v1.0\"
setlocal EnableExtensions
setlocal DisableDelayedExpansion
set "PathExt=.COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH;.MSC"
set "SysPath=%SystemRoot%\System32"
set "Path=%SystemRoot%\System32;%SystemRoot%;%SystemRoot%\System32\Wbem;%SystemRoot%\System32\WindowsPowerShell\v1.0\"
if exist "%SystemRoot%\Sysnative\reg.exe" (
set "PATH=%SystemRoot%\Sysnative;%SystemRoot%\Sysnative\wbem;%SystemRoot%\Sysnative\WindowsPowerShell\v1.0\;%PATH%"
set "SysPath=%SystemRoot%\Sysnative"
set "Path=%SystemRoot%\Sysnative;%SystemRoot%;%SystemRoot%\Sysnative\Wbem;%SystemRoot%\Sysnative\WindowsPowerShell\v1.0\;%Path%"
)
:: Re-launch the script with x64 process if it was initiated by x86 process on x64 bit Windows
:: or with ARM64 process if it was initiated by x86/ARM32 process on ARM64 Windows
set "ComSpec=%SysPath%\cmd.exe"
set "PSModulePath=%ProgramFiles%\WindowsPowerShell\Modules;%SysPath%\WindowsPowerShell\v1.0\Modules"
set "_cmdf=%~f0"
for %%# in (%*) do (
if /i "%%#"=="r1" set r1=1
if /i "%%#"=="r2" set r2=1
if /i "%%#"=="-qedit" (
reg add HKCU\Console /v QuickEdit /t REG_DWORD /d "1" /f %nul1%
rem check the code below admin elevation to understand why it's here
)
)
:: Re-launch the script with x64 process if it was initiated by x86 process on x64 bit Windows
:: or with ARM64 process if it was initiated by x86/ARM32 process on ARM64 Windows
if exist %SystemRoot%\Sysnative\cmd.exe if not defined r1 (
setlocal EnableDelayedExpansion
start %SystemRoot%\Sysnative\cmd.exe /c ""!_cmdf!" %* r1"
@@ -64,10 +67,10 @@ echo:
echo Null service is not running, script may crash...
echo:
echo:
echo Help - %mas%troubleshoot.html
echo Help - %mas%troubleshoot
echo:
echo:
ping 127.0.0.1 -n 10
ping 127.0.0.1 -n 20
)
cls
@@ -76,9 +79,13 @@ cls
pushd "%~dp0"
>nul findstr /v "$" "%~nx0" && (
echo:
echo Error: Script either has LF line ending issue or an empty line at the end of the script is missing.
echo Error - Script either has LF line ending issue or an empty line at the end of the script is missing.
echo:
ping 127.0.0.1 -n 6 >nul
echo:
echo Help - %mas%troubleshoot
echo:
echo:
ping 127.0.0.1 -n 20 >nul
popd
exit /b
)
@@ -88,10 +95,11 @@ popd
cls
color 07
title Extract $OEM$ Folder %masver%
title Extract $OEM$ Folder %masver%
set _args=
set _elev=
set _unattended=0
set _args=%*
if defined _args set _args=%_args:"=%
@@ -106,54 +114,20 @@ set "nul2=2>nul"
set "nul6=2^>nul"
set "nul=>nul 2>&1"
set psc=powershell.exe
set winbuild=1
for /f "tokens=6 delims=[]. " %%G in ('ver') do set winbuild=%%G
set _NCS=1
if %winbuild% LSS 10586 set _NCS=0
if %winbuild% GEQ 10586 reg query "HKCU\Console" /v ForceV2 %nul2% | find /i "0x0" %nul1% && (set _NCS=0)
if %_NCS% EQU 1 (
for /F %%a in ('echo prompt $E ^| cmd') do set "esc=%%a"
set "Red="41;97m""
set "Gray="100;97m""
set "Green="42;97m""
set "Blue="44;97m""
set "_White="40;37m""
set "_Green="40;92m""
set "_Yellow="40;93m""
) else (
set "Red="Red" "white""
set "Gray="Darkgray" "white""
set "Green="DarkGreen" "white""
set "Blue="Blue" "white""
set "_White="Black" "Gray""
set "_Green="Black" "Green""
set "_Yellow="Black" "Yellow""
)
set "nceline=echo: &echo ==== ERROR ==== &echo:"
set "eline=echo: &call :ex_color %Red% "==== ERROR ====" &echo:"
call :dk_setvar
::========================================================================================================================================
if %winbuild% LSS 7600 (
%nceline%
echo Unsupported OS version detected [%winbuild%].
echo Project is supported only for Windows 7/8/8.1/10/11 and their Server equivalent.
goto done2
)
for %%# in (powershell.exe) do @if "%%~$PATH:#"=="" (
%nceline%
echo Unable to find powershell.exe in the system.
echo Project is supported only for Windows 7/8/8.1/10/11 and their Server equivalents.
goto done2
)
::========================================================================================================================================
:: Fix special characters limitation in path name
:: Fix special character limitations in path name
set "_work=%~dp0"
if "%_work:~-1%"=="\" set "_work=%_work:~0,-1%"
@@ -162,6 +136,8 @@ set "_batf=%~f0"
set "_batp=%_batf:'=''%"
set _PSarg="""%~f0""" -el %_args%
set _PSarg=%_PSarg:'=''%
set "_ttemp=%userprofile%\AppData\Local\Temp"
setlocal EnableDelayedExpansion
@@ -171,8 +147,8 @@ setlocal EnableDelayedExpansion
echo "!_batf!" | find /i "!_ttemp!" %nul1% && (
if /i not "!_work!"=="!_ttemp!" (
%eline%
echo Script is launched from the temp folder,
echo Most likely you are running the script directly from the archive file.
echo The script was launched from the temp folder.
echo You are most likely running the script directly from the archive file.
echo:
echo Extract the archive file and launch the script from the extracted folder.
goto done2
@@ -181,56 +157,110 @@ goto done2
::========================================================================================================================================
:: Elevate script as admin and pass arguments and preventing loop
:: Check PowerShell
%nul1% fltmc || (
if not defined _elev %psc% "start cmd.exe -arg '/c \"!_PSarg:'=''!\"' -verb runas" && exit /b
REM :PowerShellTest: $ExecutionContext.SessionState.LanguageMode :PowerShellTest:
cmd /c "%psc% "$f=[io.file]::ReadAllText('!_batp!') -split ':PowerShellTest:\s*';iex ($f[1])"" | find /i "FullLanguage" %nul1% || (
%eline%
echo This script needs admin rights.
echo To do so, right click on this script and select 'Run as administrator'.
cmd /c "%psc% "$ExecutionContext.SessionState.LanguageMode""
echo:
cmd /c "%psc% "$ExecutionContext.SessionState.LanguageMode"" | find /i "FullLanguage" %nul1% && (
echo Failed to run Powershell command but Powershell is working.
call :dk_color %Blue% "Check if your antivirus is blocking the script."
echo:
set fixes=%fixes% %mas%troubleshoot
call :dk_color2 %Blue% "Help - " %_Yellow% " %mas%troubleshoot"
) || (
echo PowerShell is not working. Aborting...
echo If you have applied restrictions on Powershell then undo those changes.
echo:
set fixes=%fixes% %mas%fix_powershell
call :dk_color2 %Blue% "Help - " %_Yellow% " %mas%fix_powershell"
)
goto done2
)
::========================================================================================================================================
:: This code disables QuickEdit for this cmd.exe session only without making permanent changes to the registry
:: It is added because clicking on the script window pauses the operation and leads to the confusion that script stopped due to an error
:: Elevate script as admin and pass arguments and preventing loop
for %%# in (%_args%) do (if /i "%%#"=="-qedit" set quedit=1)
reg query HKCU\Console /v QuickEdit %nul2% | find /i "0x0" %nul1% || if not defined quedit (
reg add HKCU\Console /v QuickEdit /t REG_DWORD /d "0" /f %nul1%
start cmd.exe /c ""!_batf!" %_args% -qedit"
rem quickedit reset code is added at the starting of the script instead of here because it takes time to reflect in some cases
exit /b
%nul1% fltmc || (
if not defined _elev %psc% "start cmd.exe -arg '/c \"!_PSarg!\"' -verb runas" && exit /b
%eline%
echo This script needs admin rights.
echo Right click on this script and select 'Run as administrator'.
goto done2
)
::========================================================================================================================================
:: Disable QuickEdit and launch from conhost.exe to avoid Terminal app
if %winbuild% GEQ 17763 (
set terminal=1
) else (
set terminal=
)
:: Check if script is running in Terminal app
set r1=$TB = [AppDomain]::CurrentDomain.DefineDynamicAssembly(4, 1).DefineDynamicModule(2, $False).DefineType(0);
set r2=%r1% [void]$TB.DefinePInvokeMethod('GetConsoleWindow', 'kernel32.dll', 22, 1, [IntPtr], @(), 1, 3).SetImplementationFlags(128);
set r3=%r2% [void]$TB.DefinePInvokeMethod('SendMessageW', 'user32.dll', 22, 1, [IntPtr], @([IntPtr], [UInt32], [IntPtr], [IntPtr]), 1, 3).SetImplementationFlags(128);
set d1=%r3% $hIcon = $TB.CreateType(); $hWnd = $hIcon::GetConsoleWindow();
set d2=%d1% echo $($hIcon::SendMessageW($hWnd, 127, 0, 0) -ne [IntPtr]::Zero);
if defined terminal (
%psc% "%d2%" %nul2% | find /i "True" %nul1% && set terminal=
)
if %_unattended%==1 goto :skipQE
for %%# in (%_args%) do (if /i "%%#"=="-qedit" goto :skipQE)
if defined terminal (
set "launchcmd=start conhost.exe %psc%"
) else (
set "launchcmd=%psc%"
)
:: Disable QuickEdit in current session
set "d1=$t=[AppDomain]::CurrentDomain.DefineDynamicAssembly(4, 1).DefineDynamicModule(2, $False).DefineType(0);"
set "d2=$t.DefinePInvokeMethod('GetStdHandle', 'kernel32.dll', 22, 1, [IntPtr], @([Int32]), 1, 3).SetImplementationFlags(128);"
set "d3=$t.DefinePInvokeMethod('SetConsoleMode', 'kernel32.dll', 22, 1, [Boolean], @([IntPtr], [Int32]), 1, 3).SetImplementationFlags(128);"
set "d4=$k=$t.CreateType(); $b=$k::SetConsoleMode($k::GetStdHandle(-10), 0x0080);"
%launchcmd% "%d1% %d2% %d3% %d4% & cmd.exe '/c' '!_PSarg! -qedit'" && (exit /b) || (set terminal=1)
:skipQE
::========================================================================================================================================
:: Check for updates
set -=
set old=
for /f "delims=[] tokens=2" %%# in ('ping -4 -n 1 updatecheck.mass%-%grave.dev') do (
if not [%%#]==[] (echo "%%#" | find "127.69" %nul1% && (echo "%%#" | find "127.69.%masver%" %nul1% || set old=1))
if not "%%#"=="" (echo "%%#" | find "127.69" %nul1% && (echo "%%#" | find "127.69.%masver%" %nul1% || set old=1))
)
if defined old (
echo ________________________________________________
%eline%
echo You are running outdated version MAS %masver%
echo Your version of MAS [%masver%] is outdated.
echo ________________________________________________
echo:
if not %_unattended%==1 (
echo [1] Get Latest MAS
echo [0] Continue Anyway
echo:
call :ex_color %_Green% "Enter a menu option in the Keyboard [1,0] :"
call :dk_color %_Green% "Choose a menu option using your keyboard [1,0] :"
choice /C:10 /N
if !errorlevel!==2 rem
if !errorlevel!==1 (start ht%-%tps://github.com/mass%-%gravel/Microsoft-Acti%-%vation-Scripts & start %mas% & exit /b)
)
cls
)
::========================================================================================================================================
@@ -247,7 +277,7 @@ set "_dir=%desktop%\$OEM$\$$\Setup\Scripts"
if exist "!desktop!\" (
%eline%
echo Desktop location was not detected, aborting...
echo Unable to detect Desktop location, aborting...
goto done2
)
@@ -255,12 +285,12 @@ setlocal EnableDelayedExpansion
::========================================================================================================================================
mode con cols=78 lines=30
if not defined terminal mode 78, 30
if exist "!desktop!\$OEM$\" (
echo _____________________________________________________
%eline%
echo $OEM$ folder already exists on the Desktop.
echo The $OEM$ folder already exists on your Desktop.
echo _____________________________________________________
goto done2
)
@@ -296,7 +326,7 @@ goto done2
:Menu
cls
mode con cols=78 lines=30
if not defined terminal mode 78, 30
echo:
echo:
echo:
@@ -315,16 +345,16 @@ echo: [7] KMS38 ^(Windows^) ^+ Ohook ^(Office^)
echo: [8] KMS38 ^(Windows^) ^+ Online KMS ^(Office^)
echo: [9] Online KMS ^(Windows^) ^+ Ohook ^(Office^)
echo:
call :ex_color2 %_White% " [R] " %_Green% "ReadMe"
call :dk_color2 %_White% " [R] " %_Green% "ReadMe"
echo: [0] Exit
echo: ________________________________________________________
echo:
call :ex_color2 %_White% " " %_Green% "Enter a menu option in the Keyboard :"
call :dk_color2 %_White% " " %_Green% "Choose a menu option using your keyboard :"
choice /C:123456789R0 /N
set _erl=%errorlevel%
if %_erl%==11 exit /b
if %_erl%==10 start %mas%oem-folder.html &goto :Menu
if %_erl%==10 start %mas%oem-folder &goto :Menu
if %_erl%==9 goto:kms_ohook
if %_erl%==8 goto:kms38_kms
if %_erl%==7 goto:kms38_ohook
@@ -450,7 +480,7 @@ goto done
fltmc >nul || exit /b
call "%~dp0Online_KMS_Activation.cmd" /KMS-ActAndRenewalTask /KMS-WindowsOffice
call "%~dp0Online_KMS_Activation.cmd" /K-WindowsOffice
cd \
(goto) 2>nul & (if "%~dp0"=="%SystemRoot%\Setup\Scripts\" rd /s /q "%~dp0")
@@ -525,7 +555,7 @@ call "%~dp0HWID_Activation.cmd" /HWID
endlocal
setlocal
call "%~dp0Online_KMS_Activation.cmd" /KMS-ActAndRenewalTask /KMS-Office
call "%~dp0Online_KMS_Activation.cmd" /K-Office
endlocal
cd \
@@ -601,7 +631,7 @@ call "%~dp0KMS38_Activation.cmd" /KMS38
endlocal
setlocal
call "%~dp0Online_KMS_Activation.cmd" /KMS-ActAndRenewalTask /KMS-Office
call "%~dp0Online_KMS_Activation.cmd" /K-Office
endlocal
cd \
@@ -635,7 +665,7 @@ goto done
fltmc >nul || exit /b
setlocal
call "%~dp0Online_KMS_Activation.cmd" /KMS-ActAndRenewalTask /KMS-Windows
call "%~dp0Online_KMS_Activation.cmd" /K-Windows
endlocal
setlocal
@@ -651,15 +681,15 @@ cd \
:errorfound
%eline%
echo $OEM$ Folder was not created successfully...
echo The script failed to create the $OEM$ folder.
goto :done2
:done
echo ______________________________________________________________
echo:
call :ex_color %Blue% "%oem%"
call :ex_color %Green% "$OEM$ folder is successfully created on the Desktop."
call :dk_color %Blue% "%oem%"
call :dk_color %Green% "$OEM$ folder was successfully created on your Desktop."
echo "%oem%" | find /i "38" %nul% && (
echo:
echo To KMS38 activate Server Cor/Acor editions ^(No GUI Versions^),
@@ -670,8 +700,65 @@ echo ______________________________________________________________
:done2
echo:
call :ex_color %_Yellow% "Press any key to exit..."
if defined fixes (
call :dk_color2 %Blue% "Press [1] to Open Troubleshoot Page " %Gray% " Press [0] to Ignore"
choice /C:10 /N
if !errorlevel!==1 (for %%# in (%fixes%) do (start %%#))
)
if defined terminal (
call :dk_color %_Yellow% "Press [0] key to %_exitmsg%..."
choice /c 0 /n
) else (
call :dk_color %_Yellow% "Press any key to %_exitmsg%..."
pause %nul1%
)
exit /b
::========================================================================================================================================
:: Set variables
:dk_setvar
set psc=powershell.exe
set winbuild=1
for /f "tokens=6 delims=[]. " %%G in ('ver') do set winbuild=%%G
set _NCS=1
if %winbuild% LSS 10586 set _NCS=0
if %winbuild% GEQ 10586 reg query "HKCU\Console" /v ForceV2 %nul2% | find /i "0x0" %nul1% && (set _NCS=0)
if %_NCS% EQU 1 (
for /F %%a in ('echo prompt $E ^| cmd') do set "esc=%%a"
set "Red="41;97m""
set "Gray="100;97m""
set "Green="42;97m""
set "Blue="44;97m""
set "_Red="40;91m""
set "_White="40;37m""
set "_Green="40;92m""
set "_Yellow="40;93m""
) else (
set "Red="Red" "white""
set "Gray="Darkgray" "white""
set "Green="DarkGreen" "white""
set "Blue="Blue" "white""
set "_Red="Black" "Red""
set "_White="Black" "Gray""
set "_Green="Black" "Green""
set "_Yellow="Black" "Yellow""
)
set "nceline=echo: &echo ==== ERROR ==== &echo:"
set "eline=echo: &call :dk_color %Red% "==== ERROR ====" &echo:"
if %~z0 GEQ 200000 (
set "_exitmsg=Go back"
set "_fixmsg=Go back to Main Menu, select Troubleshoot and run Fix Licensing option."
) else (
set "_exitmsg=Exit"
set "_fixmsg=In MAS folder, run Troubleshoot script and select Fix Licensing option."
)
exit /b
::========================================================================================================================================
@@ -685,21 +772,21 @@ exit /b
::========================================================================================================================================
:ex_color
:dk_color
if %_NCS% EQU 1 (
echo %esc%[%~1%~2%esc%[0m
) else (
if not exist %psc% (echo %~3) else (%psc% write-host -back '%1' -fore '%2' '%3')
%psc% write-host -back '%1' -fore '%2' '%3'
)
exit /b
:ex_color2
:dk_color2
if %_NCS% EQU 1 (
echo %esc%[%~1%~2%esc%[%~3%~4%esc%[0m
) else (
if not exist %psc% (echo %~3%~6) else (%psc% write-host -back '%1' -fore '%2' '%3' -NoNewline; write-host -back '%4' -fore '%5' '%6')
%psc% write-host -back '%1' -fore '%2' '%3' -NoNewline; write-host -back '%4' -fore '%5' '%6'
)
exit /b

File diff suppressed because it is too large Load Diff

View File

@@ -14,19 +14,19 @@
## Download / How to use it?
### Method 1 - PowerShell (Recommended)
### Method 1 - PowerShell (Windows 8 and later) ❤️
- Right-click on the Windows start menu and select PowerShell or Terminal (Not CMD).
- Copy and paste the code below and press enter
1. Open PowerShell (Not CMD). To do that, right-click on the Windows start menu and select PowerShell or Terminal.
2. Copy and paste the code below and press enter
```
irm https://get.activated.win | iex
```
or (deprecated, will be retired on Aug 31 2024, use above instead)
or (deprecated, will be retired on Dec 31 2024, use above instead)
```
irm https://massgrave.dev/get | iex
```
- You will see the activation options. Follow the on-screen instructions.
- That's all.
3. You will see the activation options. Choose [1] HWID for Windows activation. Choose [2] Ohook for Office activation.
4. That's all.
---
@@ -35,22 +35,22 @@ irm https://massgrave.dev/get | iex
- The Powershell method does not work on Windows 7. Use the Method 2 - Traditional instead.
- The URL get.activated.win may be blocked by some DNS services because it is a new domain.
### Method 2 - Traditional
### Method 2 - Traditional (Windows 7 and later)
- Download the file under the code button from [GitHub](https://github.com/massgravel/Microsoft-Activation-Scripts) or [Bitbucket](https://bitbucket.org/WindowsAddict/microsoft-activation-scripts)
- Right-click on the downloaded zip file and extract
- In the extracted folder, find the folder named `All-In-One-Version`
- Run the file named `MAS_AIO-CRC32_XXXXXXXX.cmd`
- You will see the activation options, follow the on-screen instructions.
- That's all.
1. Download the file under the code button from [GitHub](https://github.com/massgravel/Microsoft-Activation-Scripts) or [Bitbucket](https://bitbucket.org/WindowsAddict/microsoft-activation-scripts) or [Codeberg](https://codeberg.org/massgravel/Microsoft-Activation-Scripts)
2. Right-click on the downloaded zip file and extract
3. In the extracted folder, find the folder named `All-In-One-Version`
4. Run the file named `MAS_AIO.cmd`
5. You will see the activation options, follow the on-screen instructions.
6. That's all.
To run the scripts in unattended mode, check [here](https://massgrave.dev/command_line_switches)
</br>
```
Latest Version: 2.6
Release date: 20-Apr-2024
Latest Version: 2.7
Release date: 6-Sep-2024
```
### [Troubleshooting / Help](https://massgrave.dev/troubleshoot)