aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWindowsAddict <windowsaddict@protonmail.com>2023-09-25 19:16:19 +0530
committerWindowsAddict <windowsaddict@protonmail.com>2023-09-25 19:16:19 +0530
commite81490b89c55d7b0477da6e72db36e13f2b15f63 (patch)
treef023e744df4fd0d940036b41bed45b1a7ee337bb
parent306372d5a252ab705282ba7c69985031badcae1f (diff)
1.91.9
-rw-r--r--MAS/All-In-One-Version/MAS_AIO.cmd2845
-rw-r--r--MAS/Separate-Files-Version/Activators/HWID_Activation.cmd494
-rw-r--r--MAS/Separate-Files-Version/Activators/KMS38_Activation.cmd414
-rw-r--r--MAS/Separate-Files-Version/Activators/Ohook_Activation/BIN/Info.html3
-rw-r--r--MAS/Separate-Files-Version/Activators/Ohook_Activation/BIN/sppc32.dllbin0 -> 9216 bytes
-rw-r--r--MAS/Separate-Files-Version/Activators/Ohook_Activation/BIN/sppc64.dllbin0 -> 9216 bytes
-rw-r--r--MAS/Separate-Files-Version/Activators/Ohook_Activation/Ohook_Activation.cmd1536
-rw-r--r--MAS/Separate-Files-Version/Activators/Ohook_Activation/Ohook_Activation_AIO.cmd1682
-rw-r--r--MAS/Separate-Files-Version/Activators/Online_KMS_Activation.cmd117
-rw-r--r--MAS/Separate-Files-Version/Change_Edition.cmd538
-rw-r--r--MAS/Separate-Files-Version/Check-Activation-Status-vbs.cmd10
-rw-r--r--MAS/Separate-Files-Version/Check-Activation-Status-wmi.cmd10
-rw-r--r--MAS/Separate-Files-Version/Extract_OEM_Folder.cmd319
-rw-r--r--MAS/Separate-Files-Version/Install_HWID_Key.cmd439
-rw-r--r--MAS/Separate-Files-Version/Troubleshoot.cmd238
-rw-r--r--README.md13
16 files changed, 6723 insertions, 1935 deletions
diff --git a/MAS/All-In-One-Version/MAS_AIO.cmd b/MAS/All-In-One-Version/MAS_AIO.cmd
index aae18da..4265268 100644
--- a/MAS/All-In-One-Version/MAS_AIO.cmd
+++ b/MAS/All-In-One-Version/MAS_AIO.cmd
@@ -1,9 +1,11 @@
1@setlocal DisableDelayedExpansion 1@setlocal DisableDelayedExpansion
2@echo off 2@echo off
3 3
4:: For command line switches, check https://massgrave.dev/command_line_switches.html 4
5:: For command line switches, check mass grave[.]dev/command_line_switches.html
5:: If you want to better understand script, read from MAS separate files version. 6:: If you want to better understand script, read from MAS separate files version.
6 7
8
7::============================================================================ 9::============================================================================
8:: 10::
9:: This script is a part of 'Microsoft_Activation_Scripts' (MAS) project. 11:: This script is a part of 'Microsoft_Activation_Scripts' (MAS) project.
@@ -18,6 +20,13 @@
18 20
19::======================================================================================================================================== 21::========================================================================================================================================
20 22
23:: Set Path variable, it helps if it is misconfigured in the system
24
25set "PATH=%SystemRoot%\System32;%SystemRoot%\System32\wbem;%SystemRoot%\System32\WindowsPowerShell\v1.0\"
26if exist "%SystemRoot%\Sysnative\reg.exe" (
27set "PATH=%SystemRoot%\Sysnative;%SystemRoot%\Sysnative\wbem;%SystemRoot%\Sysnative\WindowsPowerShell\v1.0\;%PATH%"
28)
29
21:: Re-launch the script with x64 process if it was initiated by x86 process on x64 bit Windows 30:: Re-launch the script with x64 process if it was initiated by x86 process on x64 bit Windows
22:: or with ARM64 process if it was initiated by x86/ARM32 process on ARM64 Windows 31:: or with ARM64 process if it was initiated by x86/ARM32 process on ARM64 Windows
23 32
@@ -25,6 +34,10 @@ set "_cmdf=%~f0"
25for %%# in (%*) do ( 34for %%# in (%*) do (
26if /i "%%#"=="r1" set r1=1 35if /i "%%#"=="r1" set r1=1
27if /i "%%#"=="r2" set r2=1 36if /i "%%#"=="r2" set r2=1
37if /i "%%#"=="-qedit" (
38reg add HKCU\Console /v QuickEdit /t REG_DWORD /d "1" /f 1>nul
39rem check the code below admin elevation to understand why it's here
40)
28) 41)
29 42
30if exist %SystemRoot%\Sysnative\cmd.exe if not defined r1 ( 43if exist %SystemRoot%\Sysnative\cmd.exe if not defined r1 (
@@ -41,23 +54,35 @@ start %SystemRoot%\SysArm32\cmd.exe /c ""!_cmdf!" %* r2"
41exit /b 54exit /b
42) 55)
43 56
44:: Set Path variable, it helps if it is misconfigured in the system 57::========================================================================================================================================
45 58
46set "PATH=%SystemRoot%\System32;%SystemRoot%\System32\wbem;%SystemRoot%\System32\WindowsPowerShell\v1.0\" 59set "blank="
47if exist "%SystemRoot%\Sysnative\reg.exe" ( 60set "mas=mass%blank%grave.dev"
48set "PATH=%SystemRoot%\Sysnative;%SystemRoot%\Sysnative\wbem;%SystemRoot%\Sysnative\WindowsPowerShell\v1.0\;%PATH%" 61
62:: Check if Null service is working, it's important for the batch script
63
64sc query Null | find /i "RUNNING"
65if %errorlevel% NEQ 0 (
66echo:
67echo Null service is not running, script may crash...
68echo:
69echo:
70echo Help - https://%mas%/troubleshoot.html
71echo:
72echo:
73ping 127.0.0.1 -n 10
49) 74)
75cls
50 76
51:: Check LF line ending 77:: Check LF line ending
52 78
53pushd "%~dp0" 79pushd "%~dp0"
54>nul findstr /rxc:".*" "%~nx0" 80>nul findstr /v "$" "%~nx0" && (
55if not %errorlevel%==0 (
56echo: 81echo:
57echo Error: Script either has LF line ending issue, or it failed to read itself. 82echo Error: Script either has LF line ending issue or an empty line at the end of the script is missing.
58echo: 83echo:
84ping 127.0.0.1 -n 6 >nul
59popd 85popd
60ping 127.0.0.1 -n 6 > nul
61exit /b 86exit /b
62) 87)
63popd 88popd
@@ -102,7 +127,7 @@ set "eline=echo: &call :_color %Red% "==== ERROR ====" &echo:"
102 127
103if %winbuild% LSS 7600 ( 128if %winbuild% LSS 7600 (
104%nceline% 129%nceline%
105echo Unsupported OS version detected. 130echo Unsupported OS version detected [%winbuild%].
106echo Project is supported only for Windows 7/8/8.1/10/11 and their Server equivalent. 131echo Project is supported only for Windows 7/8/8.1/10/11 and their Server equivalent.
107goto MASend 132goto MASend
108) 133)
@@ -148,9 +173,9 @@ goto MASend
148:: Elevate script as admin and pass arguments and preventing loop 173:: Elevate script as admin and pass arguments and preventing loop
149 174
150>nul fltmc || ( 175>nul fltmc || (
151if not defined _elev %nul% %psc% "start cmd.exe -arg '/c \"!_PSarg:'=''!\"' -verb runas" && exit /b 176if not defined _elev %psc% "start cmd.exe -arg '/c \"!_PSarg:'=''!\"' -verb runas" && exit /b
152%nceline% 177%nceline%
153echo This script require administrator privileges. 178echo This script require admin privileges.
154echo To do so, right click on this script and select 'Run as administrator'. 179echo To do so, right click on this script and select 'Run as administrator'.
155goto MASend 180goto MASend
156) 181)
@@ -159,15 +184,30 @@ if not exist "%SystemRoot%\Temp\" mkdir "%SystemRoot%\Temp" 1>nul 2>nul
159 184
160::======================================================================================================================================== 185::========================================================================================================================================
161 186
187:: This code disables QuickEdit for this cmd.exe session only without making permanent changes to the registry
188:: It is added because clicking on the script window pauses the operation and leads to the confusion that script stopped due to an error
189
190if defined _MASunattended set quedit=1
191for %%# in (%_args%) do (if /i "%%#"=="-qedit" set quedit=1)
192
193reg query HKCU\Console /v QuickEdit %nul2% | find /i "0x0" %nul1% || if not defined quedit (
194reg add HKCU\Console /v QuickEdit /t REG_DWORD /d "0" /f %nul1%
195start cmd.exe /c ""!_batf!" %_args% -qedit"
196rem quickedit reset code is added at the starting of the script instead of here because it takes time to reflect in some cases
197exit /b
198)
199
200::========================================================================================================================================
201
162:: Run script with parameters in unattended mode 202:: Run script with parameters in unattended mode
163 203
164set _elev= 204set _elev=
165if defined _args echo "%_args%" | find /i "/S" %nul% && (set "_silent=%nul%") || (set _silent=) 205if defined _args echo "%_args%" | find /i "/S" %nul% && (set "_silent=%nul%") || (set _silent=)
166if defined _args echo "%_args%" | find /i "/" %nul% && ( 206if defined _args echo "%_args%" | find /i "/" %nul% && (
167echo "%_args%" | find /i "/HWID" %nul% && (setlocal & (call :HWIDActivation %_args% %_silent%) & cls & endlocal) 207echo "%_args%" | find /i "/HWID" %nul% && (setlocal & cls & (call :HWIDActivation %_args% %_silent%) & endlocal)
168echo "%_args%" | find /i "/KMS38" %nul% && (setlocal & (call :KMS38Activation %_args% %_silent%) & cls & endlocal) 208echo "%_args%" | find /i "/KMS38" %nul% && (setlocal & cls & (call :KMS38Activation %_args% %_silent%) & endlocal)
169echo "%_args%" | find /i "/KMS-" %nul% && (setlocal & (call :KMSActivation %_args% %_silent%) & cls & endlocal) 209echo "%_args%" | find /i "/KMS-" %nul% && (setlocal & cls & (call :KMSActivation %_args% %_silent%) & endlocal)
170echo "%_args%" | find /i "/Insert" %nul% && (setlocal & (call :insert_hwidkey %_args% %_silent%) & cls & endlocal) 210echo "%_args%" | find /i "/Ohook" %nul% && (setlocal & cls & (call :OhookActivation %_args% %_silent%) & endlocal)
171exit /b 211exit /b
172) 212)
173 213
@@ -181,7 +221,6 @@ set _desktop_=
181for /f "skip=2 tokens=2*" %%a in ('reg query "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders" /v Desktop') do call set "_desktop_=%%b" 221for /f "skip=2 tokens=2*" %%a in ('reg query "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders" /v Desktop') do call set "_desktop_=%%b"
182if not defined _desktop_ for /f "delims=" %%a in ('%psc% "& {write-host $([Environment]::GetFolderPath('Desktop'))}"') do call set "_desktop_=%%a" 222if not defined _desktop_ for /f "delims=" %%a in ('%psc% "& {write-host $([Environment]::GetFolderPath('Desktop'))}"') do call set "_desktop_=%%a"
183 223
184set "_pdesk=%_desktop_:'=''%"
185setlocal EnableDelayedExpansion 224setlocal EnableDelayedExpansion
186 225
187::======================================================================================================================================== 226::========================================================================================================================================
@@ -190,43 +229,42 @@ setlocal EnableDelayedExpansion
190 229
191cls 230cls
192color 07 231color 07
193title Microsoft_Activation_Scripts 1.8 232title Microsoft_Activation_Scripts 1.9
194mode 76, 30 233mode 76, 30
195set "mastemp=%SystemRoot%\Temp\__MAS"
196if exist "%mastemp%\.*" rmdir /s /q "%mastemp%\" %nul%
197 234
198echo: 235echo:
199echo: 236echo:
200echo: 237echo:
201echo: 238echo:
202echo:
203echo: ______________________________________________________________ 239echo: ______________________________________________________________
204echo: 240echo:
205echo: Activation Methods: 241echo: Activation Methods:
206echo: 242echo:
207echo: [1] HWID ^| Windows ^| Permanent 243echo: [1] HWID ^| Windows ^| Permanent
208echo: [2] KMS38 ^| Windows ^| 2038 Year 244echo: [2] Ohook ^| Office ^| Permanent
209echo: [3] Online KMS ^| Windows / Office ^| 180 Days 245echo: [3] KMS38 ^| Windows ^| Year 2038
246echo: [4] Online KMS ^| Windows / Office ^| 180 Days
210echo: __________________________________________________ 247echo: __________________________________________________
211echo: 248echo:
212echo: [4] Activation Status 249echo: [5] Activation Status
213echo: [5] Troubleshoot 250echo: [6] Troubleshoot
214echo: [6] Extras 251echo: [7] Extras
215echo: [7] Help 252echo: [8] Help
216echo: [0] Exit 253echo: [0] Exit
217echo: ______________________________________________________________ 254echo: ______________________________________________________________
218echo: 255echo:
219call :_color2 %_White% " " %_Green% "Enter a menu option in the Keyboard [1,2,3,4,5,6,7,0] :" 256call :_color2 %_White% " " %_Green% "Enter a menu option in the Keyboard [1,2,3,4,5,6,7,8,0] :"
220choice /C:12345670 /N 257choice /C:123456780 /N
221set _erl=%errorlevel% 258set _erl=%errorlevel%
222 259
223if %_erl%==8 exit /b 260if %_erl%==9 exit /b
224if %_erl%==7 start https://massgrave.dev & goto :MainMenu 261if %_erl%==8 start https://%mas%/troubleshoot.html & goto :MainMenu
225if %_erl%==6 goto:Extras 262if %_erl%==7 goto:Extras
226if %_erl%==5 setlocal & call :troubleshoot & cls & endlocal & goto :MainMenu 263if %_erl%==6 setlocal & call :troubleshoot & cls & endlocal & goto :MainMenu
227if %_erl%==4 setlocal & call :_Check_Status_wmi & cls & endlocal & goto :MainMenu 264if %_erl%==5 setlocal & call :_Check_Status_wmi & cls & endlocal & goto :MainMenu
228if %_erl%==3 setlocal & call :KMSActivation & cls & endlocal & goto :MainMenu 265if %_erl%==4 setlocal & call :KMSActivation & cls & endlocal & goto :MainMenu
229if %_erl%==2 setlocal & call :KMS38Activation & cls & endlocal & goto :MainMenu 266if %_erl%==3 setlocal & call :KMS38Activation & cls & endlocal & goto :MainMenu
267if %_erl%==2 setlocal & call :OhookActivation & cls & endlocal & goto :MainMenu
230if %_erl%==1 setlocal & call :HWIDActivation & cls & endlocal & goto :MainMenu 268if %_erl%==1 setlocal & call :HWIDActivation & cls & endlocal & goto :MainMenu
231goto :MainMenu 269goto :MainMenu
232 270
@@ -242,14 +280,15 @@ echo:
242echo: 280echo:
243echo: 281echo:
244echo: 282echo:
245echo:
246echo: ______________________________________________________________ 283echo: ______________________________________________________________
247echo: 284echo:
248echo: [1] Change Windows Edition 285echo: [1] Change Windows Edition
249echo: 286echo:
250echo: [2] Extract $OEM$ Folder 287echo: [2] Extract $OEM$ Folder
251echo: [3] Insert Windows HWID Key 288echo:
252echo: [4] Activation Status [vbs] 289echo: [3] Activation Status [vbs]
290echo:
291echo: [4] Download Genuine Windows / Office
253echo: __________________________________________________ 292echo: __________________________________________________
254echo: 293echo:
255echo: [0] Go to Main Menu 294echo: [0] Go to Main Menu
@@ -260,8 +299,8 @@ choice /C:12340 /N
260set _erl=%errorlevel% 299set _erl=%errorlevel%
261 300
262if %_erl%==5 goto :MainMenu 301if %_erl%==5 goto :MainMenu
263if %_erl%==4 setlocal & call :_Check_Status_vbs & cls & endlocal & goto :Extras 302if %_erl%==4 start https://%mas%/genuine-installation-media.html & goto :Extras
264if %_erl%==3 setlocal & call :insert_hwidkey & cls & endlocal & goto :Extras 303if %_erl%==3 setlocal & call :_Check_Status_vbs & cls & endlocal & goto :Extras
265if %_erl%==2 goto:Extract$OEM$ 304if %_erl%==2 goto:Extract$OEM$
266if %_erl%==1 setlocal & call :change_edition & cls & endlocal & goto :Extras 305if %_erl%==1 setlocal & call :change_edition & cls & endlocal & goto :Extras
267goto :Extras 306goto :Extras
@@ -298,36 +337,43 @@ goto Extras
298 337
299cls 338cls
300title Extract $OEM$ Folder 339title Extract $OEM$ Folder
301mode 76, 30 340mode 78, 30
302
303echo: 341echo:
304echo: 342echo:
305echo: 343echo:
306echo: 344echo:
345echo: Extract $OEM$ folder on the desktop
346echo: ________________________________________________________
307echo: 347echo:
308echo: Extract $OEM$ folder on the desktop 348echo: [1] HWID
309echo: ______________________________________________________________ 349echo: [2] Ohook
310echo: 350echo: [3] KMS38
311echo: [1] HWID 351echo: [4] Online KMS
312echo: [2] KMS38 352echo:
313echo: [3] Online KMS 353echo: [5] HWID ^(Windows^) ^+ Ohook ^(Office^)
314echo: 354echo: [6] HWID ^(Windows^) ^+ Online KMS ^(Office^)
315echo: [4] HWID ^(Windows^) ^+ Online KMS ^(Office^) 355echo: [7] KMS38 ^(Windows^) ^+ Ohook ^(Office^)
316echo: [5] KMS38 ^(Windows^) ^+ Online KMS ^(Office^) 356echo: [8] KMS38 ^(Windows^) ^+ Online KMS ^(Office^)
317echo: __________________________________________________ 357echo: [9] Online KMS ^(Windows^) ^+ Ohook ^(Office^)
318echo: 358echo:
319echo: [0] Go Back 359call :_color2 %_White% " [R] " %_Green% "ReadMe"
320echo: ______________________________________________________________ 360echo: [0] Go Back
361echo: ________________________________________________________
321echo: 362echo:
322call :_color2 %_White% " " %_Green% "Enter a menu option in the Keyboard:" 363call :_color2 %_White% " " %_Green% "Enter a menu option in the Keyboard:"
323choice /C:123450 /N 364choice /C:123456789R0 /N
324set _erl=%errorlevel% 365set _erl=%errorlevel%
325 366
326if %_erl%==6 goto:Extras 367if %_erl%==11 goto:Extras
327if %_erl%==5 (set "_oem=KMS38 [Windows] + Online KMS [Office]" & set "para=/KMS38 /KMS-ActAndRenewalTask /KMS-Office" &goto:Extract$OEM$3) 368if %_erl%==10 start https://%mas%/oem-folder.html &goto:Extract$OEM$2
328if %_erl%==4 (set "_oem=HWID [Windows] + Online KMS [Office]" & set "para=/HWID /KMS-ActAndRenewalTask /KMS-Office" &goto:Extract$OEM$3) 369if %_erl%==9 (set "_oem=Online KMS [Windows] + Ohook [Office]" & set "para=/KMS-ActAndRenewalTask /KMS-Windows /Ohook" &goto:Extract$OEM$3)
329if %_erl%==3 (set "_oem=Online KMS" & set "para=/KMS-ActAndRenewalTask /KMS-WindowsOffice" &goto:Extract$OEM$3) 370if %_erl%==8 (set "_oem=KMS38 [Windows] + Online KMS [Office]" & set "para=/KMS38 /KMS-ActAndRenewalTask /KMS-Office" &goto:Extract$OEM$3)
330if %_erl%==2 (set "_oem=KMS38" & set "para=/KMS38" &goto:Extract$OEM$3) 371if %_erl%==7 (set "_oem=KMS38 [Windows] + Ohook [Office]" & set "para=/KMS38 /Ohook" &goto:Extract$OEM$3)
372if %_erl%==6 (set "_oem=HWID [Windows] + Online KMS [Office]" & set "para=/HWID /KMS-ActAndRenewalTask /KMS-Office" &goto:Extract$OEM$3)
373if %_erl%==5 (set "_oem=HWID [Windows] + Ohook [Office]" & set "para=/HWID /Ohook" &goto:Extract$OEM$3)
374if %_erl%==4 (set "_oem=Online KMS" & set "para=/KMS-ActAndRenewalTask /KMS-WindowsOffice" &goto:Extract$OEM$3)
375if %_erl%==3 (set "_oem=KMS38" & set "para=/KMS38" &goto:Extract$OEM$3)
376if %_erl%==2 (set "_oem=Ohook" & set "para=/Ohook" &goto:Extract$OEM$3)
331if %_erl%==1 (set "_oem=HWID" & set "para=/HWID" &goto:Extract$OEM$3) 377if %_erl%==1 (set "_oem=HWID" & set "para=/HWID" &goto:Extract$OEM$3)
332goto :Extract$OEM$2 378goto :Extract$OEM$2
333 379
@@ -357,13 +403,13 @@ if defined _error (
357echo Failed to extract $OEM$ folder on the Desktop. 403echo Failed to extract $OEM$ folder on the Desktop.
358) else ( 404) else (
359echo: 405echo:
360call :_color %Magenta% "%_oem%" 406call :_color %Blue% "%_oem%"
361call :_color %Green% "$OEM$ folder is successfully created on the Desktop." 407call :_color %Green% "$OEM$ folder is successfully created on the Desktop."
362) 408)
363echo "%_oem%" | find /i "KMS38" 1>nul && ( 409echo "%_oem%" | find /i "KMS38" 1>nul && (
364echo: 410echo:
365echo To KMS38 activate Server Cor/Acor editions ^(No GUI Versions^), 411echo To KMS38 activate Server Cor/Acor editions ^(No GUI Versions^),
366echo Check this page https://massgrave.dev/oem-folder 412echo Check this page https://%mas%/oem-folder
367) 413)
368echo ___________________________________________________________________ 414echo ___________________________________________________________________
369echo: 415echo:
@@ -385,8 +431,6 @@ set _NoEditionChange=0
385 431
386:: If value is changed in above lines or parameter is used then script will run in unattended mode 432:: If value is changed in above lines or parameter is used then script will run in unattended mode
387 433
388
389
390::======================================================================================================================================== 434::========================================================================================================================================
391 435
392cls 436cls
@@ -411,21 +455,25 @@ for %%A in (%_act% %_NoEditionChange%) do (if "%%A"=="1" set _unattended=1)
411 455
412::======================================================================================================================================== 456::========================================================================================================================================
413 457
414set winbuild=1 458set "nul1=1>nul"
459set "nul2=2>nul"
460set "nul6=2^>nul"
415set "nul=>nul 2>&1" 461set "nul=>nul 2>&1"
462
416set psc=powershell.exe 463set psc=powershell.exe
464set winbuild=1
417for /f "tokens=6 delims=[]. " %%G in ('ver') do set winbuild=%%G 465for /f "tokens=6 delims=[]. " %%G in ('ver') do set winbuild=%%G
418 466
419set _NCS=1 467set _NCS=1
420if %winbuild% LSS 10586 set _NCS=0 468if %winbuild% LSS 10586 set _NCS=0
421if %winbuild% GEQ 10586 reg query "HKCU\Console" /v ForceV2 2>nul | find /i "0x0" 1>nul && (set _NCS=0) 469if %winbuild% GEQ 10586 reg query "HKCU\Console" /v ForceV2 %nul2% | find /i "0x0" %nul1% && (set _NCS=0)
422 470
423if %_NCS% EQU 1 ( 471if %_NCS% EQU 1 (
424for /F %%a in ('echo prompt $E ^| cmd') do set "esc=%%a" 472for /F %%a in ('echo prompt $E ^| cmd') do set "esc=%%a"
425set "Red="41;97m"" 473set "Red="41;97m""
426set "Gray="100;97m"" 474set "Gray="100;97m""
427set "Green="42;97m"" 475set "Green="42;97m""
428set "Magenta="45;97m"" 476set "Blue="44;97m""
429set "_White="40;37m"" 477set "_White="40;37m""
430set "_Green="40;92m"" 478set "_Green="40;92m""
431set "_Yellow="40;93m"" 479set "_Yellow="40;93m""
@@ -433,7 +481,7 @@ set "_Yellow="40;93m""
433set "Red="Red" "white"" 481set "Red="Red" "white""
434set "Gray="Darkgray" "white"" 482set "Gray="Darkgray" "white""
435set "Green="DarkGreen" "white"" 483set "Green="DarkGreen" "white""
436set "Magenta="Darkmagenta" "white"" 484set "Blue="Blue" "white""
437set "_White="Black" "Gray"" 485set "_White="Black" "Gray""
438set "_Green="Black" "Green"" 486set "_Green="Black" "Green""
439set "_Yellow="Black" "Yellow"" 487set "_Yellow="Black" "Yellow""
@@ -441,13 +489,19 @@ set "_Yellow="Black" "Yellow""
441 489
442set "nceline=echo: &echo ==== ERROR ==== &echo:" 490set "nceline=echo: &echo ==== ERROR ==== &echo:"
443set "eline=echo: &call :dk_color %Red% "==== ERROR ====" &echo:" 491set "eline=echo: &call :dk_color %Red% "==== ERROR ====" &echo:"
444if %~z0 GEQ 200000 (set "_exitmsg=Go back") else (set "_exitmsg=Exit") 492if %~z0 GEQ 200000 (
493set "_exitmsg=Go back"
494set "_fixmsg=Go back to Main Menu, select Troubleshoot and run Fix Licensing option."
495) else (
496set "_exitmsg=Exit"
497set "_fixmsg=In MAS folder, run Troubleshoot script and select Fix Licensing option."
498)
445 499
446::======================================================================================================================================== 500::========================================================================================================================================
447 501
448if %winbuild% LSS 10240 ( 502if %winbuild% LSS 10240 (
449%eline% 503%eline%
450echo Unsupported OS version detected. 504echo Unsupported OS version detected [%winbuild%].
451echo HWID Activation is supported only for Windows 10/11. 505echo HWID Activation is supported only for Windows 10/11.
452echo Use Online KMS Activation option. 506echo Use Online KMS Activation option.
453goto dk_done 507goto dk_done
@@ -479,9 +533,13 @@ setlocal EnableDelayedExpansion
479::======================================================================================================================================== 533::========================================================================================================================================
480 534
481cls 535cls
482mode 102, 34 536mode 108, 34
483title HWID Activation 537title HWID Activation
484 538
539:: Start Windows update service at the beginning and in later checks as well, because in some normal conditions one kick is not enough
540
541sc start wuauserv %nul%
542
485echo: 543echo:
486echo Initializing... 544echo Initializing...
487call :dk_product 545call :dk_product
@@ -521,7 +579,7 @@ cls
521:: Check Evaluation version 579:: Check Evaluation version
522 580
523if exist "%SystemRoot%\Servicing\Packages\Microsoft-Windows-*EvalEdition~*.mum" ( 581if exist "%SystemRoot%\Servicing\Packages\Microsoft-Windows-*EvalEdition~*.mum" (
524reg query "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion" /v EditionID 2>nul | find /i "Eval" 1>nul && ( 582reg query "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion" /v EditionID %nul2% | find /i "Eval" %nul1% && (
525%eline% 583%eline%
526echo [%winos% ^| %winbuild%] 584echo [%winos% ^| %winbuild%]
527echo: 585echo:
@@ -529,7 +587,7 @@ echo Evaluation Editions cannot be activated.
529echo You need to install full version of %winos% 587echo You need to install full version of %winos%
530echo: 588echo:
531echo Download it from here, 589echo Download it from here,
532echo https://massgrave.dev/genuine-installation-media.html 590echo https://%mas%/genuine-installation-media.html
533goto dk_done 591goto dk_done
534) 592)
535) 593)
@@ -539,14 +597,23 @@ goto dk_done
539:: Check SKU value / Check in multiple places to find Edition change corruption 597:: Check SKU value / Check in multiple places to find Edition change corruption
540 598
541set osSKU= 599set osSKU=
542set regSKU= 600set slcSKU=
543set wmiSKU= 601set wmiSKU=
602set regSKU=
544 603
545for /f "tokens=3 delims=." %%a in ('reg query "HKLM\SYSTEM\CurrentControlSet\Control\ProductOptions" /v OSProductPfn 2^>nul') do set "regSKU=%%a" 604if %winbuild% GEQ 14393 (set info=Kernel-BrandingInfo) else (set info=Kernel-ProductInfo)
546if %_wmic% EQU 1 for /f "tokens=2 delims==" %%a in ('"wmic Path Win32_OperatingSystem Get OperatingSystemSKU /format:LIST" 2^>nul') do if not errorlevel 1 set "wmiSKU=%%a" 605set d1=%ref% [void]$TypeBuilder.DefinePInvokeMethod('SLGetWindowsInformationDWORD', 'slc.dll', 'Public, Static', 1, [int], @([String], [int].MakeByRefType()), 1, 3);
547if %_wmic% EQU 0 for /f "tokens=1" %%a in ('%psc% "([WMI]'Win32_OperatingSystem=@').OperatingSystemSKU" 2^>nul') do if not errorlevel 1 set "wmiSKU=%%a" 606set d1=%d1% $Sku = 0; [void]$TypeBuilder.CreateType()::SLGetWindowsInformationDWORD('%info%', [ref]$Sku); $Sku
607for /f "delims=" %%s in ('"%psc% %d1%"') do if not errorlevel 1 (set slcSKU=%%s)
608if "%slcSKU%"=="0" set slcSKU=
609if 1%slcSKU% NEQ +1%slcSKU% set slcSKU=
548 610
549set osSKU=%wmiSKU% 611for /f "tokens=3 delims=." %%a in ('reg query "HKLM\SYSTEM\CurrentControlSet\Control\ProductOptions" /v OSProductPfn %nul6%') do set "regSKU=%%a"
612if %_wmic% EQU 1 for /f "tokens=2 delims==" %%a in ('"wmic Path Win32_OperatingSystem Get OperatingSystemSKU /format:LIST" %nul6%') do if not errorlevel 1 set "wmiSKU=%%a"
613if %_wmic% EQU 0 for /f "tokens=1" %%a in ('%psc% "([WMI]'Win32_OperatingSystem=@').OperatingSystemSKU" %nul6%') do if not errorlevel 1 set "wmiSKU=%%a"
614
615set osSKU=%slcSKU%
616if not defined osSKU set osSKU=%wmiSKU%
550if not defined osSKU set osSKU=%regSKU% 617if not defined osSKU set osSKU=%regSKU%
551 618
552if not defined osSKU ( 619if not defined osSKU (
@@ -562,7 +629,8 @@ set error=
562cls 629cls
563echo: 630echo:
564for /f "skip=2 tokens=2*" %%a in ('reg query "HKLM\SYSTEM\CurrentControlSet\Control\Session Manager\Environment" /v PROCESSOR_ARCHITECTURE') do set arch=%%b 631for /f "skip=2 tokens=2*" %%a in ('reg query "HKLM\SYSTEM\CurrentControlSet\Control\Session Manager\Environment" /v PROCESSOR_ARCHITECTURE') do set arch=%%b
565echo Checking OS Info [%winos% ^| %winbuild% ^| %arch%] 632for /f "tokens=6-7 delims=[]. " %%i in ('ver') do if "%%j"=="" (set fullbuild=%%i) else (set fullbuild=%%i.%%j)
633echo Checking OS Info [%winos% ^| %fullbuild% ^| %arch%]
566 634
567:: Check Internet connection 635:: Check Internet connection
568 636
@@ -588,8 +656,8 @@ call :dk_color %Red% "Checking Internet Connection [Not Connected]"
588:: Check Windows Script Host 656:: Check Windows Script Host
589 657
590set _WSH=1 658set _WSH=1
591reg query "HKCU\SOFTWARE\Microsoft\Windows Script Host\Settings" /v Enabled 2>nul | find /i "0x0" 1>nul && (set _WSH=0) 659reg query "HKCU\SOFTWARE\Microsoft\Windows Script Host\Settings" /v Enabled %nul2% | find /i "0x0" %nul1% && (set _WSH=0)
592reg query "HKLM\SOFTWARE\Microsoft\Windows Script Host\Settings" /v Enabled 2>nul | find /i "0x0" 1>nul && (set _WSH=0) 660reg query "HKLM\SOFTWARE\Microsoft\Windows Script Host\Settings" /v Enabled %nul2% | find /i "0x0" %nul1% && (set _WSH=0)
593 661
594if %_WSH% EQU 0 ( 662if %_WSH% EQU 0 (
595reg add "HKLM\Software\Microsoft\Windows Script Host\Settings" /v Enabled /t REG_DWORD /d 1 /f %nul% 663reg add "HKLM\Software\Microsoft\Windows Script Host\Settings" /v Enabled /t REG_DWORD /d 1 /f %nul%
@@ -617,24 +685,29 @@ call :dk_errorcheck
617:: Check Windows updates and store app blockers 685:: Check Windows updates and store app blockers
618 686
619set updatesblock= 687set updatesblock=
620echo: %serv_ste% | findstr /i "wuauserv" %nul% && set updatesblock=1 688echo: %serv_cor% %serv_ste% | findstr /i "wuauserv" %nul% && set updatesblock=1
621for /f "skip=2 tokens=2*" %%a in ('reg query HKLM\SYSTEM\CurrentControlSet\Services\UsoSvc /v Start 2^>nul') do if /i %%b equ 0x4 set updatesblock=1 689
622if exist "%SystemRoot%\System32\WaaSMedicSvc.dll" ( 690sc start UsoSvc %nul%
623for /f "skip=2 tokens=2*" %%a in ('reg query HKLM\SYSTEM\CurrentControlSet\Services\WaaSMedicSvc /v Start 2^>nul') do if /i %%b equ 0x4 set updatesblock=1 691if %errorlevel% NEQ 1056 if %errorlevel% NEQ 0 set updatesblock=1
692
693if %winbuild% GEQ 17134 (
694sc start WaaSMedicSvc %nul%
695if !errorlevel! NEQ 1056 if !errorlevel! NEQ 0 set updatesblock=1
624) 696)
625 697
626reg query HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer /v SettingsPageVisibility 2>nul | find /i "windowsupdate" %nul% && set updatesblock=1 698reg query HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer /v SettingsPageVisibility %nul2% | find /i "windowsupdate" %nul% && set updatesblock=1
627reg query HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\WindowsUpdateSysprepInProgress %nul% && set updatesblock=1 699reg query HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\WindowsUpdateSysprepInProgress %nul% && set updatesblock=1
628reg query HKLM\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate /s 2>nul | findstr /i "NoAutoUpdate DisableWindowsUpdateAccess" %nul% && set updatesblock=1 700reg query HKLM\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate /s %nul2% | findstr /i "NoAutoUpdate DisableWindowsUpdateAccess" %nul% && set updatesblock=1
629 701
630if defined updatesblock ( 702if defined updatesblock (
631call :dk_color %Gray% "Checking Windows Update Blockers [Found]" 703call :dk_color %Gray% "Checking Windows Update Blockers [Found]"
632if defined applist echo: %serv_e% | find /i "wuauserv" %nul% && ( 704if defined applist echo: %serv_e% | find /i "wuauserv" %nul% && (
633call :dk_color %Magenta% "Windows Update Service [wuauserv] is not working. Enable it incase if you have disabled it." 705call :dk_color %Blue% "Windows Update is not working. Enable it incase if you have disabled it."
706reg query HKLM\SYSTEM\CurrentControlSet\Services\wuauserv /v WubLock %nul% && call :dk_color %Blue% "Sordum Windows Update Blocker tool has been used to block updates."
634) 707)
635) 708)
636 709
637reg query "HKLM\SOFTWARE\Policies\Microsoft\WindowsStore" /v DisableStoreApps 2>nul | find /i "0x1" %nul% && ( 710reg query "HKLM\SOFTWARE\Policies\Microsoft\WindowsStore" /v DisableStoreApps %nul2% | find /i "0x1" %nul% && (
638call :dk_color %Gray% "Checking Store App Blocker [Found]" 711call :dk_color %Gray% "Checking Store App Blocker [Found]"
639) 712)
640 713
@@ -645,15 +718,15 @@ call :dk_color %Gray% "Checking Store App Blocker [Found]"
645set key= 718set key=
646set altkey= 719set altkey=
647set changekey= 720set changekey=
648set curedition= 721set altapplist=
649set altedition= 722set altedition=
650set notworking= 723set notworking=
651set actidnotfound=
652
653for /f "skip=2 tokens=2*" %%a in ('reg query "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion" /v BuildBranch 2^>nul') do set "branch=%%b"
654 724
655if defined applist call :hwiddata key attempt1 725if defined applist call :hwiddata key
656if not defined key call :hwiddata key attempt2 726if not defined key (
727for /f "delims=" %%a in ('%psc% "$f=[io.file]::ReadAllText('!_batp!') -split ':getactivationid\:.*';iex ($f[1]);"') do (set altapplist=%%a)
728if defined altapplist call :hwiddata key
729)
657 730
658if defined notworking call :hwidfallback 731if defined notworking call :hwidfallback
659if not defined key call :hwidfallback 732if not defined key call :hwidfallback
@@ -662,10 +735,6 @@ if defined altkey (set key=%altkey%&set changekey=1&set notworking=)
662 735
663if defined notworking if defined notfoundaltactID ( 736if defined notworking if defined notfoundaltactID (
664call :dk_color %Red% "Checking Alternate Edition For HWID [%altedition% Activation ID Not Found]" 737call :dk_color %Red% "Checking Alternate Edition For HWID [%altedition% Activation ID Not Found]"
665if exist "%SystemRoot%\Servicing\Packages\Microsoft-Windows-*EvalEdition~*.mum" (
666call :dk_color %Magenta% "Evaluation Windows Found. Install Full version of %winos%"
667call :dk_color %Magenta% "Download it from https://massgrave.dev/genuine-installation-media.html"
668)
669) 738)
670 739
671if not defined key ( 740if not defined key (
@@ -673,7 +742,7 @@ if not defined key (
673echo [%winos% ^| %winbuild% ^| SKU:%osSKU%] 742echo [%winos% ^| %winbuild% ^| SKU:%osSKU%]
674echo Unable to find this product in the supported product list. 743echo Unable to find this product in the supported product list.
675echo Make sure you are using updated version of the script. 744echo Make sure you are using updated version of the script.
676echo https://massgrave.dev 745echo https://%mas%
677echo: 746echo:
678goto dk_done 747goto dk_done
679) 748)
@@ -686,7 +755,7 @@ if defined notworking set error=1
686 755
687echo: 756echo:
688if defined changekey ( 757if defined changekey (
689call :dk_color %Magenta% "[%altedition%] Edition product key will be used to enable HWID activation." 758call :dk_color %Blue% "[%altedition%] Edition product key will be used to enable HWID activation."
690echo: 759echo:
691) 760)
692 761
@@ -703,8 +772,8 @@ echo Installing Generic Product Key [%key%] [Successful]
703) else ( 772) else (
704call :dk_color %Red% "Installing Generic Product Key [%key%] [Failed] %errorcode%" 773call :dk_color %Red% "Installing Generic Product Key [%key%] [Failed] %errorcode%"
705if not defined error ( 774if not defined error (
706call :dk_color %Magenta% "In MAS, Goto Troubleshoot and run Fix Licensing option." 775if defined altapplist call :dk_color %Red% "Activation ID not found for this key."
707if defined actidnotfound call :dk_color %Red% "Activation ID not found for this key. Make sure you are using updated version of MAS." 776call :dk_color %Blue% "%_fixmsg%"
708set showfix=1 777set showfix=1
709) 778)
710set error=1 779set error=1
@@ -714,8 +783,8 @@ set error=1
714 783
715:: Change Windows region to USA to avoid activation issues as Windows store license is not available in many countries 784:: Change Windows region to USA to avoid activation issues as Windows store license is not available in many countries
716 785
717for /f "skip=2 tokens=2*" %%a in ('reg query "HKCU\Control Panel\International\Geo" /v Name 2^>nul') do set "name=%%b" 786for /f "skip=2 tokens=2*" %%a in ('reg query "HKCU\Control Panel\International\Geo" /v Name %nul6%') do set "name=%%b"
718for /f "skip=2 tokens=2*" %%a in ('reg query "HKCU\Control Panel\International\Geo" /v Nation 2^>nul') do set "nation=%%b" 787for /f "skip=2 tokens=2*" %%a in ('reg query "HKCU\Control Panel\International\Geo" /v Nation %nul6%') do set "nation=%%b"
719 788
720set regionchange= 789set regionchange=
721if not "%name%"=="US" ( 790if not "%name%"=="US" (
@@ -734,6 +803,11 @@ call :dk_color %Red% "Changing Windows Region To USA [Failed]"
734:: In some cases clipup -v -o method fails and in some cases service restart method fails as well 803:: In some cases clipup -v -o method fails and in some cases service restart method fails as well
735:: To maximize success rate and get better error details, script will install tickets two times (service restart + clipup -v -o) 804:: To maximize success rate and get better error details, script will install tickets two times (service restart + clipup -v -o)
736 805
806if not exist %SystemRoot%\system32\ClipUp.exe (
807call :dk_color %Red% "Checking ClipUp.exe File [Not found, aborting the process]"
808goto :dl_final
809)
810
737set "tdir=%ProgramData%\Microsoft\Windows\ClipSVC\GenuineTicket" 811set "tdir=%ProgramData%\Microsoft\Windows\ClipSVC\GenuineTicket"
738if not exist "%tdir%\" md "%tdir%\" %nul% 812if not exist "%tdir%\" md "%tdir%\" %nul%
739 813
@@ -746,7 +820,7 @@ call :hwiddata ticket
746copy /y /b "%tdir%\GenuineTicket" "%tdir%\GenuineTicket.xml" %nul% 820copy /y /b "%tdir%\GenuineTicket" "%tdir%\GenuineTicket.xml" %nul%
747 821
748if not exist "%tdir%\GenuineTicket.xml" ( 822if not exist "%tdir%\GenuineTicket.xml" (
749call :dk_color %Red% "Generating GenuineTicket.xml [Failed]" 823call :dk_color %Red% "Generating GenuineTicket.xml [Failed, aborting the process]"
750echo [%encoded%] 824echo [%encoded%]
751if exist "%tdir%\Genuine*" del /f /q "%tdir%\Genuine*" %nul% 825if exist "%tdir%\Genuine*" del /f /q "%tdir%\Genuine*" %nul%
752goto :dl_final 826goto :dl_final
@@ -774,6 +848,12 @@ clipup -v -o
774 848
775set rebuildinfo= 849set rebuildinfo=
776 850
851if not exist %ProgramData%\Microsoft\Windows\ClipSVC\tokens.dat (
852set error=1
853set rebuildinfo=1
854call :dk_color %Red% "Checking ClipSVC tokens.dat [Not Found]"
855)
856
777%_xmlexist% ( 857%_xmlexist% (
778set error=1 858set error=1
779set rebuildinfo=1 859set rebuildinfo=1
@@ -788,7 +868,7 @@ call :dk_color %Red% "Checking Ticket Migration [Failed]"
788 868
789if defined applist if not defined showfix if defined rebuildinfo ( 869if defined applist if not defined showfix if defined rebuildinfo (
790set showfix=1 870set showfix=1
791call :dk_color %Magenta% "In MAS, Goto Troubleshoot and run Fix Licensing option." 871call :dk_color %Blue% "%_fixmsg%"
792) 872)
793 873
794if exist "%tdir%\Genuine*" del /f /q "%tdir%\Genuine*" %nul% 874if exist "%tdir%\Genuine*" del /f /q "%tdir%\Genuine*" %nul%
@@ -808,6 +888,8 @@ call :dk_color %Green% "%winos% is permanently activated with a digital license.
808goto :dl_final 888goto :dl_final
809) 889)
810 890
891::==========================================================================================================================================
892
811:: Extended licensing servers tests incase error not found and activation failed 893:: Extended licensing servers tests incase error not found and activation failed
812 894
813set resfail= 895set resfail=
@@ -824,21 +906,23 @@ set "d1=Add-Type -AssemblyName System.Net.Http;"
824set "d1=!d1! $client = [System.Net.Http.HttpClient]::new();" 906set "d1=!d1! $client = [System.Net.Http.HttpClient]::new();"
825set "d1=!d1! $response = $client.GetAsync('https://%%#').GetAwaiter().GetResult();" 907set "d1=!d1! $response = $client.GetAsync('https://%%#').GetAwaiter().GetResult();"
826set "d1=!d1! $response.Content.ReadAsStringAsync().GetAwaiter().GetResult()" 908set "d1=!d1! $response.Content.ReadAsStringAsync().GetAwaiter().GetResult()"
827%psc% "!tls! !d1!" 2>nul | findstr /i "PurchaseFD DeviceAddResponse" 1>nul || set resfail=1 909%psc% "!tls! !d1!" %nul2% | findstr /i "PurchaseFD DeviceAddResponse" %nul1% || set resfail=1
828) 910)
829 911
830if not defined resfail ( 912if not defined resfail (
831%psc% "!tls! irm https://licensing.mp.microsoft.com/v7.0/licenses/content -Method POST" | find /i "traceId" 1>nul || set resfail=1 913%psc% "!tls! irm https://licensing.mp.microsoft.com/v7.0/licenses/content -Method POST" | find /i "traceId" %nul1% || set resfail=1
832) 914)
833 915
834if defined resfail ( 916if defined resfail (
835set error=1 917set error=1
836echo: 918echo:
837call :dk_color %Red% "Checking Licensing Servers [Failed To Connect]" 919call :dk_color %Red% "Checking Licensing Servers [Failed To Connect]"
838call :dk_color2 %Magenta% "Check this page for help" %_Yellow% " https://massgrave.dev/licensing-servers-issue" 920call :dk_color2 %Blue% "Check this page for help" %_Yellow% " https://%mas%/licensing-servers-issue"
839) 921)
840) 922)
841 923
924::==========================================================================================================================================
925
842:: Clear store ID related registry to fix activation incase error not found 926:: Clear store ID related registry to fix activation incase error not found
843 927
844if not defined error ( 928if not defined error (
@@ -859,17 +943,30 @@ call :dk_act
859call :dk_checkperm 943call :dk_checkperm
860) 944)
861 945
946REM Check Internet related error codes
947
948if not defined error if not defined _perm (
949echo "%error_code%" | findstr /i "0x80072e 0x80072f" %nul% && (
950set error=1
951echo:
952call :dk_color %Red% "Checking Internet Issues [Found] [%error_code%]"
953call :dk_color2 %Blue% "Check this page for help" %_Yellow% " https://%mas%/licensing-servers-issue"
954)
955)
956
957::==========================================================================================================================================
958
862echo: 959echo:
863if defined _perm ( 960if defined _perm (
864call :dk_color %Green% "%winos% is permanently activated with a digital license." 961call :dk_color %Green% "%winos% is permanently activated with a digital license."
865) else ( 962) else (
866call :dk_color %Red% "Activation Failed %error_code%" 963call :dk_color %Red% "Activation Failed %error_code%"
867if defined notworking ( 964if defined notworking (
868call :dk_color %Magenta% "At the time of writing this, HWID Activation was not supported for this product." 965call :dk_color %Blue% "At the time of writing this, HWID Activation was not supported for this product."
869call :dk_color %Magenta% "Use KMS38 Activation option." 966call :dk_color %Blue% "Use KMS38 Activation option."
870) else ( 967) else (
871if not defined error call :dk_color %Magenta% "In MAS, Goto Troubleshoot and run Fix Licensing option." 968if not defined error call :dk_color %Blue% "%_fixmsg%"
872call :dk_color2 %Magenta% "Check this page for help" %_Yellow% " https://massgrave.dev/troubleshoot" 969call :dk_color2 %Blue% "Check this page for help" %_Yellow% " https://%mas%/troubleshoot"
873) 970)
874) 971)
875 972
@@ -898,8 +995,8 @@ goto :dk_done
898 995
899:dk_checkperm 996:dk_checkperm
900 997
901if %_wmic% EQU 1 wmic path SoftwareLicensingProduct where (LicenseStatus='1' and GracePeriodRemaining='0' and PartialProductKey is not NULL) get Name /value 2>nul | findstr /i "Windows" 1>nul && set _perm=1||set _perm= 998if %_wmic% EQU 1 wmic path SoftwareLicensingProduct where (LicenseStatus='1' and GracePeriodRemaining='0' and PartialProductKey is not NULL) get Name /value %nul2% | findstr /i "Windows" %nul1% && set _perm=1||set _perm=
902if %_wmic% EQU 0 %psc% "(([WMISEARCHER]'SELECT Name FROM SoftwareLicensingProduct WHERE LicenseStatus=1 AND GracePeriodRemaining=0 AND PartialProductKey IS NOT NULL').Get()).Name | %% {echo ('Name='+$_)}" 2>nul | findstr /i "Windows" 1>nul && set _perm=1||set _perm= 999if %_wmic% EQU 0 %psc% "(([WMISEARCHER]'SELECT Name FROM SoftwareLicensingProduct WHERE LicenseStatus=1 AND GracePeriodRemaining=0 AND PartialProductKey IS NOT NULL').Get()).Name | %% {echo ('Name='+$_)}" %nul2% | findstr /i "Windows" %nul1% && set _perm=1||set _perm=
903exit /b 1000exit /b
904 1001
905:: Refresh license status 1002:: Refresh license status
@@ -928,18 +1025,49 @@ exit /b
928:dk_actids 1025:dk_actids
929 1026
930set applist= 1027set applist=
931if %_wmic% EQU 1 set "chkapp=for /f "tokens=2 delims==" %%a in ('"wmic path SoftwareLicensingProduct where (ApplicationID='55c92734-d682-4d71-983e-d6ec3f16059f') get ID /VALUE" 2^>nul')" 1028if %_wmic% EQU 1 set "chkapp=for /f "tokens=2 delims==" %%a in ('"wmic path SoftwareLicensingProduct where (ApplicationID='55c92734-d682-4d71-983e-d6ec3f16059f') get ID /VALUE" %nul6%')"
932if %_wmic% EQU 0 set "chkapp=for /f "tokens=2 delims==" %%a in ('%psc% "(([WMISEARCHER]'SELECT ID FROM SoftwareLicensingProduct WHERE ApplicationID=''55c92734-d682-4d71-983e-d6ec3f16059f''').Get()).ID ^| %% {echo ('ID='+$_)}" 2^>nul')" 1029if %_wmic% EQU 0 set "chkapp=for /f "tokens=2 delims==" %%a in ('%psc% "(([WMISEARCHER]'SELECT ID FROM SoftwareLicensingProduct WHERE ApplicationID=''55c92734-d682-4d71-983e-d6ec3f16059f''').Get()).ID ^| %% {echo ('ID='+$_)}" %nul6%')"
933%chkapp% do (if defined applist (call set "applist=!applist! %%a") else (call set "applist=%%a")) 1030%chkapp% do (if defined applist (call set "applist=!applist! %%a") else (call set "applist=%%a"))
934exit /b 1031exit /b
935 1032
1033:: Get Activation IDs from licensing files if not found through WMI
1034
1035:getactivationid:
1036$folderPath = "$env:windir\System32\spp\tokens\skus"
1037$files = Get-ChildItem -Path $folderPath -Recurse -Filter "*.xrm-ms"
1038$guids = @()
1039foreach ($file in $files) {
1040 $content = Get-Content -Path $file.FullName -Raw
1041 $matches = [regex]::Matches($content, 'name="productSkuId">\{([0-9a-fA-F\-]+)\}')
1042 foreach ($match in $matches) {
1043 $guids += $match.Groups[1].Value
1044 }
1045}
1046$guids = $guids | Select-Object -Unique
1047$guidsString = $guids -join " "
1048$guidsString
1049:getactivationid:
1050
1051:: Get SvcRestartTask info
1052
1053:gettaskinfo:
1054$task = Get-ScheduledTask | Where-Object { $_.TaskName -eq 'SvcRestartTask' -and $_.TaskPath -eq '\Microsoft\Windows\SoftwareProtectionPlatform\' }
1055$info = $task | Get-ScheduledTaskInfo
1056if ($info.LastRunTime -match 99) {
1057$task | Start-ScheduledTask
1058Start-Sleep -Seconds 3
1059$info = $task | Get-ScheduledTaskInfo
1060}
1061"$($task.State) $($info.LastTaskResult) $($info.LastRunTime)"
1062:gettaskinfo:
1063
936:: Check wmic.exe 1064:: Check wmic.exe
937 1065
938:dk_ckeckwmic 1066:dk_ckeckwmic
939 1067
940set _wmic=0 1068set _wmic=0
941for %%# in (wmic.exe) do @if not "%%~$PATH:#"=="" ( 1069for %%# in (wmic.exe) do @if not "%%~$PATH:#"=="" (
942wmic path Win32_ComputerSystem get CreationClassName /value 2>nul | find /i "computersystem" 1>nul && set _wmic=1 1070wmic path Win32_ComputerSystem get CreationClassName /value %nul2% | find /i "computersystem" %nul1% && set _wmic=1
943) 1071)
944exit /b 1072exit /b
945 1073
@@ -954,8 +1082,8 @@ set d1=%d1% $meth.SetImplementationFlags(128); $TypeBuilder.CreateType()::Brandi
954 1082
955set winos= 1083set winos=
956for /f "delims=" %%s in ('"%psc% %d1%"') do if not errorlevel 1 (set winos=%%s) 1084for /f "delims=" %%s in ('"%psc% %d1%"') do if not errorlevel 1 (set winos=%%s)
957echo "%winos%" | find /i "Windows" 1>nul || ( 1085echo "%winos%" | find /i "Windows" %nul1% || (
958for /f "skip=2 tokens=2*" %%a in ('reg query "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion" /v ProductName 2^>nul') do set "winos=%%b" 1086for /f "skip=2 tokens=2*" %%a in ('reg query "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion" /v ProductName %nul6%') do set "winos=%%b"
959if %winbuild% GEQ 22000 ( 1087if %winbuild% GEQ 22000 (
960set winos=!winos:Windows 10=Windows 11! 1088set winos=!winos:Windows 10=Windows 11!
961) 1089)
@@ -975,17 +1103,33 @@ exit /b
975 1103
976:dk_errorcheck 1104:dk_errorcheck
977 1105
1106set showfix=
1107
1108:: Check corrupt services
1109
1110set serv_cor=
1111for %%# in (%_serv%) do (
1112set _corrupt=
1113sc start %%# %nul%
1114if !errorlevel! EQU 1060 set _corrupt=1
1115sc query %%# %nul% || set _corrupt=1
1116for %%G in (DependOnService Description DisplayName ErrorControl ImagePath ObjectName Start Type) do if not defined _corrupt (reg query HKLM\SYSTEM\CurrentControlSet\Services\%%# /v %%G %nul% || set _corrupt=1)
1117if defined _corrupt (if defined serv_cor (set "serv_cor=!serv_cor! %%#") else (set "serv_cor=%%#"))
1118)
1119
1120if defined serv_cor (
1121set error=1
1122call :dk_color %Red% "Checking Corrupt Services [%serv_cor%]"
1123)
1124
1125::========================================================================================================================================
1126
978:: Check disabled services 1127:: Check disabled services
979 1128
980set serv_ste= 1129set serv_ste=
981for %%# in (%_serv%) do ( 1130for %%# in (%_serv%) do (
982set serv_dis=
983reg query HKLM\SYSTEM\CurrentControlSet\Services\%%# /v ImagePath %nul% || set serv_dis=1
984for /f "skip=2 tokens=2*" %%a in ('reg query HKLM\SYSTEM\CurrentControlSet\Services\%%# /v Start 2^>nul') do if /i %%b equ 0x4 set serv_dis=1
985sc start %%# %nul% 1131sc start %%# %nul%
986if !errorlevel! EQU 1058 set serv_dis=1 1132if !errorlevel! EQU 1058 (if defined serv_ste (set "serv_ste=!serv_ste! %%#") else (set "serv_ste=%%#"))
987sc query %%# %nul% || set serv_dis=1
988if defined serv_dis (if defined serv_ste (set "serv_ste=!serv_ste! %%#") else (set "serv_ste=%%#"))
989) 1133)
990 1134
991:: Change disabled services startup type to default 1135:: Change disabled services startup type to default
@@ -1028,7 +1172,7 @@ set errorcode=
1028set checkerror= 1172set checkerror=
1029net start %%# /y %nul% 1173net start %%# /y %nul%
1030set errorcode=!errorlevel! 1174set errorcode=!errorlevel!
1031sc query %%# | find /i "4 RUNNING" %nul% || set checkerror=1 1175sc query %%# | find /i "RUNNING" %nul% || set checkerror=1
1032 1176
1033sc start %%# %nul% 1177sc start %%# %nul%
1034if !errorlevel! NEQ 1056 if !errorlevel! NEQ 0 (set errorcode=!errorlevel!&set checkerror=1) 1178if !errorlevel! NEQ 1056 if !errorlevel! NEQ 0 (set errorcode=!errorlevel!&set checkerror=1)
@@ -1039,7 +1183,8 @@ if defined serv_e (
1039set error=1 1183set error=1
1040call :dk_color %Red% "Starting Services [Failed] [%serv_e%]" 1184call :dk_color %Red% "Starting Services [Failed] [%serv_e%]"
1041echo %serv_e% | findstr /i "ClipSVC-1058 sppsvc-1058" %nul% && ( 1185echo %serv_e% | findstr /i "ClipSVC-1058 sppsvc-1058" %nul% && (
1042call :dk_color %Magenta% "Restart the system to fix disabled service error 1058." 1186call :dk_color %Blue% "Restart the system to fix disabled service error 1058."
1187set showfix=1
1043) 1188)
1044) 1189)
1045 1190
@@ -1049,61 +1194,51 @@ call :dk_color %Magenta% "Restart the system to fix disabled service error 1058.
1049 1194
1050if defined safeboot_option ( 1195if defined safeboot_option (
1051set error=1 1196set error=1
1052call :dk_color2 %Red% "Checking Boot Mode " %Magenta% "[System is running in safe mode. Run in normal mode.]" 1197set showfix=1
1198call :dk_color2 %Red% "Checking Boot Mode " %Blue% "[System is running in safe mode. Run in normal mode.]"
1053) 1199)
1054 1200
1055 1201
1056reg query "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Setup\State" 2>nul | find /i "IMAGE_STATE_COMPLETE" 1>nul || ( 1202reg query "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Setup\State" %nul2% | find /i "IMAGE_STATE_COMPLETE" %nul1% || (
1057set error=1 1203set error=1
1058call :dk_color2 %Red% "Checking Audit Mode " %Magenta% "[System is running in Audit mode. Run in normal mode.]" 1204set showfix=1
1205call :dk_color2 %Red% "Checking Audit Mode " %Blue% "[IMAGE_STATE_COMPLETE status not found. Run in normal mode.]"
1059) 1206)
1060 1207
1061 1208
1062reg query "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\WinPE" /v InstRoot %nul% && ( 1209reg query "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\WinPE" /v InstRoot %nul% && (
1063set error=1 1210set error=1
1064call :dk_color2 %Red% "Checking WinPE " %Magenta% "[System is running in WinPE mode. Run in normal mode.]" 1211set showfix=1
1065) 1212call :dk_color2 %Red% "Checking WinPE " %Blue% "[System is running in WinPE mode. Run in normal mode.]"
1066
1067
1068for %%# in (wmic.exe) do @if "%%~$PATH:#"=="" (
1069call :dk_color %Gray% "Checking WMIC.exe [Not Found]"
1070) 1213)
1071 1214
1072 1215
1073%psc% $ExecutionContext.SessionState.LanguageMode 2>nul | find /i "Full" 1>nul || ( 1216%psc% $ExecutionContext.SessionState.LanguageMode %nul2% | find /i "Full" %nul1% || (
1074set error=1 1217set error=1
1075call :dk_color %Red% "Checking Powershell [Not Responding]" 1218call :dk_color %Red% "Checking Powershell [Not Responding]"
1076) 1219)
1077 1220
1078 1221
1079set wmifailed=
1080if %_wmic% EQU 1 wmic path Win32_ComputerSystem get CreationClassName /value 2>nul | find /i "computersystem" 1>nul
1081if %_wmic% EQU 0 %psc% "Get-CIMInstance -Class Win32_ComputerSystem | Select-Object -Property CreationClassName" 2>nul | find /i "computersystem" 1>nul
1082if %errorlevel% NEQ 0 (
1083set error=1
1084set wmifailed=1
1085call :dk_color %Red% "Checking WMI [Not Responding] %_wmic%"
1086call :dk_color %Magenta% "In MAS, Goto Troubleshoot and run Fix WMI option."
1087)
1088
1089
1090if not "%regSKU%"=="%wmiSKU%" (
1091call :dk_color %Red% "Checking WMI/REG SKU [Difference Found - WMI:%wmiSKU% Reg:%regSKU%]"
1092)
1093
1094
1095DISM /English /Online /Get-CurrentEdition %nul% 1222DISM /English /Online /Get-CurrentEdition %nul%
1096set error_code=%errorlevel% 1223set dism_error=%errorlevel%
1097cmd /c exit /b %error_code% 1224cmd /c exit /b %dism_error%
1098if %error_code% NEQ 0 set "error_code=[0x%=ExitCode%]" 1225if %dism_error% NEQ 0 set "dism_error=[0x%=ExitCode%]"
1099if %error_code% NEQ 0 ( 1226if %dism_error% NEQ 0 (
1100call :dk_color %Red% "Checking DISM [Not Responding] %error_code%" 1227call :dk_color %Red% "Checking DISM [Not Responding] %dism_error%"
1101) 1228)
1102 1229
1103 1230
1104if exist "%SystemRoot%\Servicing\Packages\Microsoft-Windows-*EvalEdition~*.mum" ( 1231if not defined officeact if exist "%SystemRoot%\Servicing\Packages\Microsoft-Windows-*EvalEdition~*.mum" (
1105set error=1 1232set error=1
1106call :dk_color %Red% "Checking Eval Packages [Non-Eval Licenses are installed in Eval Windows]" 1233call :dk_color %Red% "Checking Eval Packages [Non-Eval Licenses are installed in Eval Windows]"
1234if /i %dism_error%==[0x800F0805] (
1235for %%# in (4 125 126 188 191 205) do if "%osSKU%"=="%%#" (
1236call :dk_color %Blue% "Evaluation Windows can not be activated and different License install may lead to errors."
1237call :dk_color %Blue% "It is recommended to install full version of %winos%."
1238call :dk_color %Blue% "You can download it from https://%mas%/genuine-installation-media.html"
1239set showfix=1
1240)
1241)
1107) 1242)
1108 1243
1109 1244
@@ -1117,21 +1252,49 @@ call :dk_color %Red% "Checking slmgr /dlv [Not Responding] %
1117) 1252)
1118 1253
1119 1254
1255for %%# in (wmic.exe) do @if "%%~$PATH:#"=="" (
1256call :dk_color %Gray% "Checking WMIC.exe [Not Found]"
1257)
1258
1259
1260set wmifailed=
1261if %_wmic% EQU 1 wmic path Win32_ComputerSystem get CreationClassName /value %nul2% | find /i "computersystem" %nul1%
1262if %_wmic% EQU 0 %psc% "Get-CIMInstance -Class Win32_ComputerSystem | Select-Object -Property CreationClassName" %nul2% | find /i "computersystem" %nul1%
1263
1264if %errorlevel% NEQ 0 set wmifailed=1
1265echo "%error_code%" | findstr /i "0x800410 0x800440" %nul1% && set wmifailed=1& :: https://learn.microsoft.com/en-us/windows/win32/wmisdk/wmi-error-constants
1266if defined wmifailed (
1267set error=1
1268call :dk_color %Red% "Checking WMI [Not Responding]"
1269call :dk_color %Blue% "In MAS, Goto Troubleshoot and run Fix WMI option."
1270set showfix=1
1271)
1272
1273
1274%nul% set /a "sum=%slcSKU%+%regSKU%+%wmiSKU%"
1275set /a "sum/=3"
1276if not defined officeact if not "%sum%"=="%slcSKU%" (
1277call :dk_color %Red% "Checking SLC/WMI/REG SKU [Difference Found - SLC:%slcSKU% WMI:%wmiSKU% Reg:%regSKU%]"
1278)
1279
1280
1120reg query "HKU\S-1-5-20\Software\Microsoft\Windows NT\CurrentVersion\SoftwareProtectionPlatform\PersistedTSReArmed" %nul% && ( 1281reg query "HKU\S-1-5-20\Software\Microsoft\Windows NT\CurrentVersion\SoftwareProtectionPlatform\PersistedTSReArmed" %nul% && (
1121set error=1 1282set error=1
1122call :dk_color2 %Red% "Checking Rearm " %Magenta% "[System Restart Is Required]" 1283set showfix=1
1284call :dk_color2 %Red% "Checking Rearm " %Blue% "[System Restart Is Required]"
1123) 1285)
1124 1286
1125 1287
1126reg query "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\ClipSVC\Volatile\PersistedSystemState" %nul% && ( 1288reg query "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\ClipSVC\Volatile\PersistedSystemState" %nul% && (
1127set error=1 1289set error=1
1128call :dk_color2 %Red% "Checking ClipSVC " %Magenta% "[System Restart Is Required]" 1290set showfix=1
1291call :dk_color2 %Red% "Checking ClipSVC " %Blue% "[System Restart Is Required]"
1129) 1292)
1130 1293
1131 1294
1132for /f "skip=2 tokens=2*" %%a in ('reg query "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\SoftwareProtectionPlatform" /v "SkipRearm" 2^>nul') do if /i %%b NEQ 0x0 ( 1295for /f "skip=2 tokens=2*" %%a in ('reg query "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\SoftwareProtectionPlatform" /v "SkipRearm" %nul6%') do if /i %%b NEQ 0x0 (
1133reg add "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\SoftwareProtectionPlatform" /v "SkipRearm" /t REG_DWORD /d "0" /f %nul% 1296reg add "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\SoftwareProtectionPlatform" /v "SkipRearm" /t REG_DWORD /d "0" /f %nul%
1134call :dk_color %Red% "Checking SkipRearm [Default 0 Value Not Found, Changing To 0]" 1297call :dk_color %Red% "Checking SkipRearm [Default 0 Value Not Found. Changing To 0]"
1135net stop sppsvc /y %nul% 1298net stop sppsvc /y %nul%
1136net start sppsvc /y %nul% 1299net start sppsvc /y %nul%
1137set error=1 1300set error=1
@@ -1140,7 +1303,24 @@ set error=1
1140 1303
1141reg query "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\SoftwareProtectionPlatform\Plugins\Objects\msft:rm/algorithm/hwid/4.0" /f ba02fed39662 /d %nul% || ( 1304reg query "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\SoftwareProtectionPlatform\Plugins\Objects\msft:rm/algorithm/hwid/4.0" /f ba02fed39662 /d %nul% || (
1142call :dk_color %Red% "Checking SPP Registry Key [Incorrect ModuleId Found]" 1305call :dk_color %Red% "Checking SPP Registry Key [Incorrect ModuleId Found]"
1306call :dk_color %Blue% "Possibly Caused By Gaming Spoofers. Help: https://%mas%/troubleshoot"
1143set error=1 1307set error=1
1308set showfix=1
1309)
1310
1311
1312set tokenstore=
1313for /f "skip=2 tokens=2*" %%a in ('reg query "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\SoftwareProtectionPlatform" /v TokenStore %nul6%') do call set "tokenstore=%%b"
1314if not exist "%tokenstore%\" (
1315set error=1
1316REM This code creates token folder only if it's missing and sets default permission for it
1317mkdir "%tokenstore%" %nul%
1318set "d=$sddl = 'O:BAG:BAD:PAI(A;OICI;FA;;;SY)(A;OICI;FA;;;BA)(A;OICIIO;GR;;;BU)(A;;FR;;;BU)(A;OICI;FA;;;S-1-5-80-123231216-2592883651-3715271367-3753151631-4175906628)';"
1319set "d=!d! $AclObject = New-Object System.Security.AccessControl.DirectorySecurity;"
1320set "d=!d! $AclObject.SetSecurityDescriptorSddlForm($sddl);"
1321set "d=!d! Set-Acl -Path %tokenstore% -AclObject $AclObject;"
1322%psc% "!d!" %nul%
1323call :dk_color %Gray% "Checking SPP Token Folder [Not Found. Creating Now] [%tokenstore%\]"
1144) 1324)
1145 1325
1146 1326
@@ -1158,44 +1338,43 @@ call :dk_color %Red% "Checking Activation IDs [Not Found]"
1158) 1338)
1159 1339
1160 1340
1161set tokenstore=
1162for /f "skip=2 tokens=2*" %%a in ('reg query "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\SoftwareProtectionPlatform" /v TokenStore 2^>nul') do call set "tokenstore=%%b"
1163if not exist "%tokenstore%\" (
1164set error=1
1165call :dk_color %Red% "Checking SPP Token Folder [Not Found] [%tokenstore%\]"
1166)
1167
1168
1169if exist "%tokenstore%\" if not exist "%tokenstore%\tokens.dat" ( 1341if exist "%tokenstore%\" if not exist "%tokenstore%\tokens.dat" (
1170set error=1 1342set error=1
1171call :dk_color %Red% "Checking SPP tokens.dat [Not Found] [%tokenstore%\]" 1343call :dk_color %Red% "Checking SPP tokens.dat [Not Found] [%tokenstore%\]"
1172) 1344)
1173 1345
1174 1346
1175if not exist %ProgramData%\Microsoft\Windows\ClipSVC\tokens.dat ( 1347if not exist %SystemRoot%\system32\sppsvc.exe (
1176set error=1 1348set error=1
1177call :dk_color %Red% "Checking ClipSVC tokens.dat [Not Found]" 1349set showfix=1
1350call :dk_color %Red% "Checking sppsvc.exe File [Not Found]"
1178) 1351)
1179 1352
1180 1353
1181if not exist %SystemRoot%\system32\sppsvc.exe ( 1354set task=
1182set error=1 1355set taskerror=
1183call :dk_color %Red% "Checking sppsvc.exe File [Not Found]" 1356if not defined wmifailed if not defined officeact (
1357for /f "delims=" %%a in ('%psc% "$f=[io.file]::ReadAllText('!_batp!') -split ':gettaskinfo\:.*';iex ($f[1]);"') do (set task=%%a)
1358echo "!task!" | find /i "Ready 0 " %nul% || set taskerror=1
1359echo "!task!" | find "99" %nul% && set taskerror=1
1360if defined taskerror (
1361call :dk_color %Gray% "Checking SvcRestartTask Last Run [Issues Found, !task!]"
1362call :dk_color %Gray% "Windows may face issues in keeping activation. Help: https://%mas%/troubleshoot"
1363)
1184) 1364)
1185 1365
1186 1366
1187:: Below checks are performed if required services are not disabled + slmgr /dlv errorlevel is not Zero + Rearm restart is not required + WMI is working fine 1367:: Below checks are performed if required services are not disabled or corrupted + if there is any error + slmgr /dlv errorlevel is not Zero + no fix was shown before
1188 1368
1189set showfix=
1190set wpaerror= 1369set wpaerror=
1191set permerror= 1370set permerror=
1192if not defined serv_cste if /i not %error_code%==0 if /i not %error_code%==0xC004D302 if not defined wmifailed ( 1371if not defined serv_cor if not defined serv_cste if defined error if /i not %error_code%==0 if not defined showfix (
1193 1372
1194REM This code checks for invalid registry keys in HKLM\SYSTEM\WPA. This issue may appear even on healthy systems. 1373REM This code checks for invalid registry keys in HKLM\SYSTEM\WPA. This issue may appear even on healthy systems.
1195 1374
1196if %winbuild% GEQ 14393 ( 1375if %winbuild% GEQ 14393 (
1197set /a count=0 1376set /a count=0
1198for /f %%a in ('reg query "HKLM\SYSTEM\WPA" 2^>nul') do set /a count+=1 1377for /f %%a in ('reg query "HKLM\SYSTEM\WPA" %nul6%') do set /a count+=1
1199for /L %%# in (1,1,!count!) do ( 1378for /L %%# in (1,1,!count!) do (
1200reg query "HKLM\SYSTEM\WPA\8DEC0AF1-0341-4b93-85CD-72606C2DF94C-7P-%%#" /ve /t REG_BINARY %nul% || set wpaerror=1 1379reg query "HKLM\SYSTEM\WPA\8DEC0AF1-0341-4b93-85CD-72606C2DF94C-7P-%%#" /ve /t REG_BINARY %nul% || set wpaerror=1
1201) 1380)
@@ -1217,8 +1396,8 @@ if !errorlevel!==2 set permerror=1
1217if defined permerror call :dk_color %Red% "Checking SPP Permissions [Error Found]" 1396if defined permerror call :dk_color %Red% "Checking SPP Permissions [Error Found]"
1218 1397
1219set showfix=1 1398set showfix=1
1220call :dk_color %Magenta% "In MAS, Goto Troubleshoot and run Fix Licensing option." 1399call :dk_color %Blue% "%_fixmsg%"
1221if not defined permerror call :dk_color %Magenta% "If activation still fails then run Fix WPA Registry option." 1400if not defined permerror call :dk_color %Blue% "If activation still fails then run Fix WPA Registry option."
1222) 1401)
1223 1402
1224exit /b 1403exit /b
@@ -1250,7 +1429,7 @@ exit /b
1250echo: 1429echo:
1251if %_unattended%==1 timeout /t 2 & exit /b 1430if %_unattended%==1 timeout /t 2 & exit /b
1252call :dk_color %_Yellow% "Press any key to %_exitmsg%..." 1431call :dk_color %_Yellow% "Press any key to %_exitmsg%..."
1253pause >nul 1432pause %nul1%
1254exit /b 1433exit /b
1255 1434
1256::======================================================================================================================================== 1435::========================================================================================================================================
@@ -1259,10 +1438,10 @@ exit /b
1259:: 2nd column = Generic Retail/OEM/MAK Key 1438:: 2nd column = Generic Retail/OEM/MAK Key
1260:: 3rd column = SKU ID 1439:: 3rd column = SKU ID
1261:: 4th column = Key part number 1440:: 4th column = Key part number
1262:: 5th column = Ticket signature value. It's as it is, it's not encoded. (Check https://massgrave.dev/hwid.html#Manual_Activation to see how it's generated) 1441:: 5th column = Ticket signature value. It's as it is, it's not encoded. (Check mass grave[.]dev/hwid.html#Manual_Activation to see how it's generated)
1263:: 6th column = 1 = activation is not working (at the time of writing this), 0 = activation is working 1442:: 6th column = 1 = activation is not working (at the time of writing this), 0 = activation is working
1264:: 7th column = Key Type 1443:: 7th column = Key Type
1265:: 8th column = WMI Edition ID 1444:: 8th column = WMI Edition ID (For reference only)
1266:: 9th column = Version name incase same Edition ID is used in different OS versions with different key 1445:: 9th column = Version name incase same Edition ID is used in different OS versions with different key
1267:: Separator = _ 1446:: Separator = _
1268 1447
@@ -1282,14 +1461,17 @@ f742e4ff-909d-4fe9-aacb-3231d24a0c58_4CP%f%RK-NM%f%3K3-X6X%f%XQ-RX%f%X86-WX%f%CH
12822a6137f3-75c0-4f26-8e3e-d83d802865a4_XKC%f%NC-J2%f%6Q9-KFH%f%D2-FK%f%THY-KD%f%72Y_119_X19-99606_gtywgqIP3j+bliKdunuseeZWtsOzWhj+DmSBq7nqeNarHutgbWEwvcRiGo+nwxONt9Ak/VyuO76ZWH/db3iRVTk1y61vFv15gVlOy1ovLjVHBvmPVdQXIne2N+pIMb0eBhZWHRX63mYdkZRZ0wg/+bj4xsjJv+qLpWhVCzNMge4_0_OEM:NONSLP_PPIPro 14612a6137f3-75c0-4f26-8e3e-d83d802865a4_XKC%f%NC-J2%f%6Q9-KFH%f%D2-FK%f%THY-KD%f%72Y_119_X19-99606_gtywgqIP3j+bliKdunuseeZWtsOzWhj+DmSBq7nqeNarHutgbWEwvcRiGo+nwxONt9Ak/VyuO76ZWH/db3iRVTk1y61vFv15gVlOy1ovLjVHBvmPVdQXIne2N+pIMb0eBhZWHRX63mYdkZRZ0wg/+bj4xsjJv+qLpWhVCzNMge4_0_OEM:NONSLP_PPIPro
1283e558417a-5123-4f6f-91e7-385c1c7ca9d4_YNM%f%GQ-8R%f%YV3-4PG%f%Q3-C8%f%XTP-7C%f%FBY_121_X19-98886_VuBmoSUdF63Cvwm9wNlc2yhD2tP9B72iVVWFNcbAwDGXF6o06oNMsIJ0VqGJDdBzZjVGw2wHokMabxZNDyIl90CO7trwgV8S0lLJVLymxyUaE3ThvN3YUsi9Q3H+5Kr0RpsojCWb+UQd/GY4bSXfyStXFylj6im7yv0db/ZWGbw_0_____Retail_Education 1462e558417a-5123-4f6f-91e7-385c1c7ca9d4_YNM%f%GQ-8R%f%YV3-4PG%f%Q3-C8%f%XTP-7C%f%FBY_121_X19-98886_VuBmoSUdF63Cvwm9wNlc2yhD2tP9B72iVVWFNcbAwDGXF6o06oNMsIJ0VqGJDdBzZjVGw2wHokMabxZNDyIl90CO7trwgV8S0lLJVLymxyUaE3ThvN3YUsi9Q3H+5Kr0RpsojCWb+UQd/GY4bSXfyStXFylj6im7yv0db/ZWGbw_0_____Retail_Education
1284c5198a66-e435-4432-89cf-ec777c9d0352_84N%f%GF-MH%f%BT6-FXB%f%X8-QW%f%JK7-DR%f%R8H_122_X19-98892_jQ6S2bbNoVrp/zvi8BEUwCf7fge1nAdspcjXyTeTySUiR+hXPiKQEWgyLqAdZ5Or+X2JGT/LZN1/eZ9P+REmzG/WQotZ+fyyPguoSsES+d312RkfmQoI5gVanEkGjZSU4YohREM/Vyf9MOO7dbH9MMEpFm2mje6OnhyJo2gux0g_0_____Retail_EducationN 1463c5198a66-e435-4432-89cf-ec777c9d0352_84N%f%GF-MH%f%BT6-FXB%f%X8-QW%f%JK7-DR%f%R8H_122_X19-98892_jQ6S2bbNoVrp/zvi8BEUwCf7fge1nAdspcjXyTeTySUiR+hXPiKQEWgyLqAdZ5Or+X2JGT/LZN1/eZ9P+REmzG/WQotZ+fyyPguoSsES+d312RkfmQoI5gVanEkGjZSU4YohREM/Vyf9MOO7dbH9MMEpFm2mje6OnhyJo2gux0g_0_____Retail_EducationN
1464f6e29426-a256-4316-88bf-cc5b0f95ec0c_PJB%f%47-8P%f%N2T-MCG%f%DY-JT%f%Y3D-CB%f%CPV_125_X23-50331_Txrh+25Ej9T5ZZXUNxSh/t9ZV18K112m3pOtVVwAeXk4rqjovoYEKcR4DZxUrQ85tNnqSJ+mLlCfnHa9ghb7OTLCaba+d+LA8HBrFfG0g1Ya1gBBL3ZsACHBRPdDiXOGl8uil+5EkOx2sKX941S5fnNK/278XBFRm2NKwfJ7hhI_1_Volume:MAK_EnterpriseS_Ge
1285cce9d2de-98ee-4ce2-8113-222620c64a27_KCN%f%VH-YK%f%WX8-GJJ%f%B9-H9%f%FDT-6F%f%7W2_125_X22-66075_wJ/BPDFz+13PVJtBqBo+E4LCm3LoMVALCQUun9kXGBULr7V8FQ5nKUudUGHDLNNVIIicdw9Uh26BKAt0/hnE7BpBkzwdi4qAdZgKXQ1t06Ek4+zXmoT225NvpaHsuhDkE687TtCB1ZWvAulA8G9ehE3HTJSoNm4wCFOQyIQQtqQ_1_Volume:MAK_EnterpriseS_VB 1465cce9d2de-98ee-4ce2-8113-222620c64a27_KCN%f%VH-YK%f%WX8-GJJ%f%B9-H9%f%FDT-6F%f%7W2_125_X22-66075_wJ/BPDFz+13PVJtBqBo+E4LCm3LoMVALCQUun9kXGBULr7V8FQ5nKUudUGHDLNNVIIicdw9Uh26BKAt0/hnE7BpBkzwdi4qAdZgKXQ1t06Ek4+zXmoT225NvpaHsuhDkE687TtCB1ZWvAulA8G9ehE3HTJSoNm4wCFOQyIQQtqQ_1_Volume:MAK_EnterpriseS_VB
1286d06934ee-5448-4fd1-964a-cd077618aa06_43T%f%BQ-NH%f%92J-XKT%f%M7-KT%f%3KK-P3%f%9PB_125_X21-83233_V+y0SFmAnGwRwgNz+0sO0mj+XxSjbdRDpom1Iqx2BJcsf96Q5ittJOcMhKiNswyKuq5suM5vy60tA/AUdb1mrnnrnXfmz7nFam/BIOOfa18GA7vd1aNFufhpmCiMWxoGSewH/T1pnCZrsvGYIj//qC7aiQVKYBngO7UYWGaytgc_0_OEM:NONSLP_EnterpriseS_RS5 1466d06934ee-5448-4fd1-964a-cd077618aa06_43T%f%BQ-NH%f%92J-XKT%f%M7-KT%f%3KK-P3%f%9PB_125_X21-83233_V+y0SFmAnGwRwgNz+0sO0mj+XxSjbdRDpom1Iqx2BJcsf96Q5ittJOcMhKiNswyKuq5suM5vy60tA/AUdb1mrnnrnXfmz7nFam/BIOOfa18GA7vd1aNFufhpmCiMWxoGSewH/T1pnCZrsvGYIj//qC7aiQVKYBngO7UYWGaytgc_0_OEM:NONSLP_EnterpriseS_RS5
1287706e0cfd-23f4-43bb-a9af-1a492b9f1302_NK9%f%6Y-D9%f%CD8-W44%f%CQ-R8%f%YTK-DY%f%JWX_125_X21-05035_U2DIv+LAhSGz0rNbTiMQYaP3M41+0+ZioF7vh0COeeJSIruDFCZ3Li7ZM3dSleg6QTCxG04uZ3i3r1bCZv0+WAfU9rG+3BqLAwKlJS/31rETeRWvrxB1UK4mTMHwAJc9txDAc15ureqF+2b9pIIpwLljmFer6fI7z0iI6I/ZuTU_0_OEM:NONSLP_EnterpriseS_RS1 1467706e0cfd-23f4-43bb-a9af-1a492b9f1302_NK9%f%6Y-D9%f%CD8-W44%f%CQ-R8%f%YTK-DY%f%JWX_125_X21-05035_U2DIv+LAhSGz0rNbTiMQYaP3M41+0+ZioF7vh0COeeJSIruDFCZ3Li7ZM3dSleg6QTCxG04uZ3i3r1bCZv0+WAfU9rG+3BqLAwKlJS/31rETeRWvrxB1UK4mTMHwAJc9txDAc15ureqF+2b9pIIpwLljmFer6fI7z0iI6I/ZuTU_0_OEM:NONSLP_EnterpriseS_RS1
1288faa57748-75c8-40a2-b851-71ce92aa8b45_FWN%f%7H-PF%f%93Q-4GG%f%P8-M8%f%RF3-MD%f%WWW_125_X19-99617_0frpwr4N/wBVRA/nOvAMqkxmRj6Vv9mA+jVNtnurAL1TjkPN/y+6YVUd5MP/Y4As4kddHoHiZXI+2siKHJsaV95ppXoHKR8d7FRVitr1F+82TbB7OVvdCclGrRZymnq25HvtSC3BROHt7ZXTgSCWMyB7MlbLiqHiTymOj5OMX1g_0_OEM:NONSLP_EnterpriseS_TH 1468faa57748-75c8-40a2-b851-71ce92aa8b45_FWN%f%7H-PF%f%93Q-4GG%f%P8-M8%f%RF3-MD%f%WWW_125_X19-99617_0frpwr4N/wBVRA/nOvAMqkxmRj6Vv9mA+jVNtnurAL1TjkPN/y+6YVUd5MP/Y4As4kddHoHiZXI+2siKHJsaV95ppXoHKR8d7FRVitr1F+82TbB7OVvdCclGrRZymnq25HvtSC3BROHt7ZXTgSCWMyB7MlbLiqHiTymOj5OMX1g_0_OEM:NONSLP_EnterpriseS_TH
1469837766ff-61c5-427d-87c3-a2acbd44767a_XFC%f%77-XN%f%RXM-2Q3%f%6W-FC%f%M9T-YH%f%DJ9_126_X23-50304_fIijy15jUocqsDIBLyz5/6FKqkNU1uoYYTqqnbBnk5bPUHKzjIbMGldJEjNgd7lKnHG9qhIjl0q1OHyTna4eY0ydD/b9MfLtD2hmfVvG7gJL8PNaZDa0MuGorxbQilR3nczXmeL/5gsvw5Q/uCfSY5p4UuPnjasKV8eITIPfu1k_1_Volume:MAK_EnterpriseSN_Ge
12892c060131-0e43-4e01-adc1-cf5ad1100da8_RQF%f%NW-9T%f%PM3-JQ7%f%3T-QV%f%4VQ-DV%f%9PT_126_X22-66108_UeA6O2iIW6zFMJzLMCQjVA7gUHOGRTiFB6LPrgjhgfJEXSZnDjxw8wsR+tp+JQWeaQDsVt06c2byH3z7Ft2wNk8n3gcXUknIjlcCckNjw05WDI64/wCqz+gtf1RajMEoV/mODpBx7rdLtCg03FyV7Z9LOib4/WLSmnxjDPKMG7s_1_Volume:MAK_EnterpriseSN_VB 14702c060131-0e43-4e01-adc1-cf5ad1100da8_RQF%f%NW-9T%f%PM3-JQ7%f%3T-QV%f%4VQ-DV%f%9PT_126_X22-66108_UeA6O2iIW6zFMJzLMCQjVA7gUHOGRTiFB6LPrgjhgfJEXSZnDjxw8wsR+tp+JQWeaQDsVt06c2byH3z7Ft2wNk8n3gcXUknIjlcCckNjw05WDI64/wCqz+gtf1RajMEoV/mODpBx7rdLtCg03FyV7Z9LOib4/WLSmnxjDPKMG7s_1_Volume:MAK_EnterpriseSN_VB
1290e8f74caa-03fb-4839-8bcc-2e442b317e53_M33%f%WV-NH%f%Y3C-R7F%f%PM-BQ%f%GPT-23%f%9PG_126_X21-83264_NtP6sMWmOTCdABAbgIZfxZzRs8zaqzfaabLeFXQJvfJvQPLQPk2UxMliASJG+7YwwbTD8pyhUoQqUYrlCzJZ6jDSDyUTJkXgo9akR4fBOg6Z5wn5fW8NGAMDcLND5d9XxHl0gWH/HZNIs/GZaPJsCVVqPr7X8bk/y0DeIofxICU_1_Volume:MAK_EnterpriseSN_RS5 1471e8f74caa-03fb-4839-8bcc-2e442b317e53_M33%f%WV-NH%f%Y3C-R7F%f%PM-BQ%f%GPT-23%f%9PG_126_X21-83264_NtP6sMWmOTCdABAbgIZfxZzRs8zaqzfaabLeFXQJvfJvQPLQPk2UxMliASJG+7YwwbTD8pyhUoQqUYrlCzJZ6jDSDyUTJkXgo9akR4fBOg6Z5wn5fW8NGAMDcLND5d9XxHl0gWH/HZNIs/GZaPJsCVVqPr7X8bk/y0DeIofxICU_1_Volume:MAK_EnterpriseSN_RS5
12913d1022d8-969f-4222-b54b-327f5a5af4c9_2DB%f%W3-N2%f%PJG-MVH%f%W3-G7%f%TDK-9H%f%KR4_126_X21-04921_WeNSkuiC3iyNT9tDqlj6KvM17UYMsYjEelyyMEyPEXSAbYA08lYtYJjCzxSE9T30p9dxqPIuj370OwHhAxG8a51/HoLNWR0grj08HmdOXUA8Ap4clEivxKM0zRvwPR6L2M2HQP0nN54c9It7ikzweJ0X2HHOb58oEw9LbMeUM/Y_0_Volume:MAK_EnterpriseSN_RS1 14723d1022d8-969f-4222-b54b-327f5a5af4c9_2DB%f%W3-N2%f%PJG-MVH%f%W3-G7%f%TDK-9H%f%KR4_126_X21-04921_WeNSkuiC3iyNT9tDqlj6KvM17UYMsYjEelyyMEyPEXSAbYA08lYtYJjCzxSE9T30p9dxqPIuj370OwHhAxG8a51/HoLNWR0grj08HmdOXUA8Ap4clEivxKM0zRvwPR6L2M2HQP0nN54c9It7ikzweJ0X2HHOb58oEw9LbMeUM/Y_0_Volume:MAK_EnterpriseSN_RS1
129260c243e1-f90b-4a1b-ba89-387294948fb6_NTX%f%6B-BR%f%YC2-K67%f%86-F6%f%MVQ-M7%f%V2X_126_X19-98770_QLG40WW/TtUqtir9K6FJCQXU1mfn27uutdOunHJ3gXk6v0Mbxaqu9GKqpg5xFzdFiOPb/8Bmk/ylwceXgoaUx1nKcBGb/Bg+jICiNMEYIbGyMuYiHb0iJeVbjbBLLfWuAAuUPftfnKPH3dAu1YvhaS5nv7a5wICrXdJWeVNpBxk_0_Volume:MAK_EnterpriseSN_TH 147360c243e1-f90b-4a1b-ba89-387294948fb6_NTX%f%6B-BR%f%YC2-K67%f%86-F6%f%MVQ-M7%f%V2X_126_X19-98770_QLG40WW/TtUqtir9K6FJCQXU1mfn27uutdOunHJ3gXk6v0Mbxaqu9GKqpg5xFzdFiOPb/8Bmk/ylwceXgoaUx1nKcBGb/Bg+jICiNMEYIbGyMuYiHb0iJeVbjbBLLfWuAAuUPftfnKPH3dAu1YvhaS5nv7a5wICrXdJWeVNpBxk_0_Volume:MAK_EnterpriseSN_TH
147401eb852c-424d-4060-94b8-c10d799d7364_3XP%f%6D-CR%f%ND4-DRY%f%M2-GM%f%84D-4G%f%G8Y_139_X23-37869_bpWJRMPuEeHIx4X+imsfTHaUXtdSGX9/+kuFDpkJ0rIQXKBf+pprkICUG/FJVciv60VXAMaQPBgn4zGfpfVTvJ0DTPxdRcS4WltLnz5L3fG6jXPjI5lArAFWlx7m93ch1zINoxbroU3inMo5JjsJaMZt01Gae6Of4k9DrgYC8U0_1_____Retail_ProfessionalCountrySpecific_Zn
1293eb6d346f-1c60-4643-b960-40ec31596c45_DXG%f%7C-N3%f%6C4-C4H%f%TG-X4%f%T3X-2Y%f%V77_161_X21-43626_vHO/5UEtrsDzGC30A2Ya5DYXlNMs7hVYiLvM7X31xkaFMxogbiy3ZDxBbjRku3VXyW+TYsFX/D/wdJgFmMrhsNrObkxqzYMMRjx+BpwOx2PspKpS2RyzovyRl8v93SvHB5IyoO2/3pm2YqJDK1hXLhms6+DDPuiofQt36q47reQ_0_____Retail_ProfessionalWorkstation 1475eb6d346f-1c60-4643-b960-40ec31596c45_DXG%f%7C-N3%f%6C4-C4H%f%TG-X4%f%T3X-2Y%f%V77_161_X21-43626_vHO/5UEtrsDzGC30A2Ya5DYXlNMs7hVYiLvM7X31xkaFMxogbiy3ZDxBbjRku3VXyW+TYsFX/D/wdJgFmMrhsNrObkxqzYMMRjx+BpwOx2PspKpS2RyzovyRl8v93SvHB5IyoO2/3pm2YqJDK1hXLhms6+DDPuiofQt36q47reQ_0_____Retail_ProfessionalWorkstation
129489e87510-ba92-45f6-8329-3afa905e3e83_WYP%f%NQ-8C%f%467-V2W%f%6J-TX%f%4WX-WT%f%2RQ_162_X21-43644_phlxNLr+sk8cCCmAVU3k3XrtD6sFDeoaODc+21soKqePbVQbzPHgokS73ccok6/gDfu/u5UKc7omL8pm2IhIhf70oC+8M/FFp0zRFeC/ZFXdF2tL23oKWI9kZbvcaoZBiqaDGc1bNYi5KAZYaJU8wwqw16ZnohQJZ7QR9cgUfFQ_0_____Retail_ProfessionalWorkstationN 147689e87510-ba92-45f6-8329-3afa905e3e83_WYP%f%NQ-8C%f%467-V2W%f%6J-TX%f%4WX-WT%f%2RQ_162_X21-43644_phlxNLr+sk8cCCmAVU3k3XrtD6sFDeoaODc+21soKqePbVQbzPHgokS73ccok6/gDfu/u5UKc7omL8pm2IhIhf70oC+8M/FFp0zRFeC/ZFXdF2tL23oKWI9kZbvcaoZBiqaDGc1bNYi5KAZYaJU8wwqw16ZnohQJZ7QR9cgUfFQ_0_____Retail_ProfessionalWorkstationN
129562f0c100-9c53-4e02-b886-a3528ddfe7f6_8PT%f%T6-RN%f%W4C-6V7%f%J2-C2%f%D3X-MH%f%BPB_164_X21-04955_Px7QWdfy0esrMzQoydKlmIcGdfV0pQvbnumyrh4evDNF9gpENm8OIfZfljIynury0qZAkw4AG3uGyp+5IxZGIh6U3dz41uNVfEcA9NZ34OEBXMtjEOU1ZbJ8wp8JecQKwlORclvsri9OOi0GbGc0TYRanlci2jJL/3x/gSuWXCs_0_____Retail_ProfessionalEducation 147762f0c100-9c53-4e02-b886-a3528ddfe7f6_8PT%f%T6-RN%f%W4C-6V7%f%J2-C2%f%D3X-MH%f%BPB_164_X21-04955_Px7QWdfy0esrMzQoydKlmIcGdfV0pQvbnumyrh4evDNF9gpENm8OIfZfljIynury0qZAkw4AG3uGyp+5IxZGIh6U3dz41uNVfEcA9NZ34OEBXMtjEOU1ZbJ8wp8JecQKwlORclvsri9OOi0GbGc0TYRanlci2jJL/3x/gSuWXCs_0_____Retail_ProfessionalEducation
@@ -1299,37 +1481,19 @@ d4ef7282-3d2c-4cf0-9976-8854e64a8d1e_V3W%f%VW-N2%f%PV2-CGW%f%C3-34%f%QGF-VM%f%J2
1299af5c9381-9240-417d-8d35-eb40cd03e484_NH9%f%J3-68%f%WK7-6FB%f%93-4K%f%3DF-DJ%f%4F6_179_X21-32987_H0qrFdf+FQxcSRJDtEwd8OfwC4iH/25Q01jz3QuB9yhEqB0W1i83u0WDpVK04pvU1EDCCRRI/DhXynbkWpLC0chdTOW4k5jIy+aa0cD3fccz9ChSjVHMzyTg3abEVFAvy9rttUyxcFIOKcINXHTxTRp5cZPwOa393tlJyBiliAo_0_____Retail_CloudN 1481af5c9381-9240-417d-8d35-eb40cd03e484_NH9%f%J3-68%f%WK7-6FB%f%93-4K%f%3DF-DJ%f%4F6_179_X21-32987_H0qrFdf+FQxcSRJDtEwd8OfwC4iH/25Q01jz3QuB9yhEqB0W1i83u0WDpVK04pvU1EDCCRRI/DhXynbkWpLC0chdTOW4k5jIy+aa0cD3fccz9ChSjVHMzyTg3abEVFAvy9rttUyxcFIOKcINXHTxTRp5cZPwOa393tlJyBiliAo_0_____Retail_CloudN
13008ab9bdd1-1f67-4997-82d9-8878520837d9_XQQ%f%YW-NF%f%FMW-XJP%f%BH-K8%f%732-CK%f%FFD_188_X21-99378_Bwx3E7qmE6M8UR6+KPqLnnavI6ThNHHUO717RJY9di2YI9rzC3O0LceXOHjshSKwfwxosqFsD/p/inrJmabed1yA/ZWwISyGtAIGTtRgpuSE4TAfW6KEW0v7rcr2wwwDq7DHSuz4QN4odEGe9bvtx4zIZKufQzzN4TN2rd/BJkE_0_____OEM:DM_IoTEnterprise 14828ab9bdd1-1f67-4997-82d9-8878520837d9_XQQ%f%YW-NF%f%FMW-XJP%f%BH-K8%f%732-CK%f%FFD_188_X21-99378_Bwx3E7qmE6M8UR6+KPqLnnavI6ThNHHUO717RJY9di2YI9rzC3O0LceXOHjshSKwfwxosqFsD/p/inrJmabed1yA/ZWwISyGtAIGTtRgpuSE4TAfW6KEW0v7rcr2wwwDq7DHSuz4QN4odEGe9bvtx4zIZKufQzzN4TN2rd/BJkE_0_____OEM:DM_IoTEnterprise
1301ed655016-a9e8-4434-95d9-4345352c2552_QPM%f%6N-7J%f%2WJ-P88%f%HH-P3%f%YRH-YY%f%74H_191_X21-99682_lE8qL1p4m68mv9wcxU2sdKZPIccybtOjr+aMAdV+sLHs9wzE26oz5GiSZ3UzpU7yoYrNMqwGkKX6mrCEGRLh+XR2Ricp7ELA1PkzaGm0FLUqaK2GNVQ00i+s6KcA2XRr/gWOhhGTqSCjpSi9cMiqMbftf9Bo/BJVK3ib9xU4OQw_0_OEM:NONSLP_IoTEnterpriseS_VB 1483ed655016-a9e8-4434-95d9-4345352c2552_QPM%f%6N-7J%f%2WJ-P88%f%HH-P3%f%YRH-YY%f%74H_191_X21-99682_lE8qL1p4m68mv9wcxU2sdKZPIccybtOjr+aMAdV+sLHs9wzE26oz5GiSZ3UzpU7yoYrNMqwGkKX6mrCEGRLh+XR2Ricp7ELA1PkzaGm0FLUqaK2GNVQ00i+s6KcA2XRr/gWOhhGTqSCjpSi9cMiqMbftf9Bo/BJVK3ib9xU4OQw_0_OEM:NONSLP_IoTEnterpriseS_VB
14846c4de1b8-24bb-4c17-9a77-7b939414c298_CGK%f%42-GY%f%N6Y-VD2%f%2B-BX%f%98W-J8%f%JXD_191_X23-12617_QEqj4TJNDYZnR8WdPp2TYu5UyiJtUmKER75/DuR5L5SZ1Qg/LUff0Nse+iT+cDVld/YA8RS1CxeMF1W/SLuPHqZvEzkPmYxGVy2U1iCbztfonAA2FZ3v76gbroMOr6bqMmeKNkhsUMG5sEz5uYXW0+K7Ke2z5GSMiEQHQN2yDA4_0_OEM:NONSLP_IoTEnterpriseS_Ge
1302d4bdc678-0a4b-4a32-a5b3-aaa24c3b0f24_K9V%f%KN-3B%f%GWV-Y62%f%4W-MC%f%RMQ-BH%f%DCD_202_X22-53884_hPcIn0dF9Dq6zlXd3RxBqVDPDnf5sTasTjUqhD6lGc9IkTc8476NHd1PV1Ds++VO34/dw2H2PWk33LT5Es6PnUi32Ypva4POy4QJo5W3qyduiJiHUOM5GS9yAkKfdHFgUXaUVwopYKq+EwmgxFmEvHYdWgREHgIMyNoKAZQK0Ok_0_____Retail_CloudEditionN 1485d4bdc678-0a4b-4a32-a5b3-aaa24c3b0f24_K9V%f%KN-3B%f%GWV-Y62%f%4W-MC%f%RMQ-BH%f%DCD_202_X22-53884_hPcIn0dF9Dq6zlXd3RxBqVDPDnf5sTasTjUqhD6lGc9IkTc8476NHd1PV1Ds++VO34/dw2H2PWk33LT5Es6PnUi32Ypva4POy4QJo5W3qyduiJiHUOM5GS9yAkKfdHFgUXaUVwopYKq+EwmgxFmEvHYdWgREHgIMyNoKAZQK0Ok_0_____Retail_CloudEditionN
130392fb8726-92a8-4ffc-94ce-f82e07444653_KY7%f%PN-VR%f%6RX-83W%f%6Y-6D%f%DYQ-T6%f%R4W_203_X22-53847_DCP6QzPj+BD1EEmlBelBt7x9AmvQOfd7kdkUB0b0x6/TNHRnZtdyix3pNX2IDQtJbLnNLc2ZlMmupbZQrtyxe3xl8+xlCnHByXZpzFty9sGzq3MozHHA9u9WsJEf5R7tnFDplNM1UitlTVTAyuCGk83brY4zjmz/52pUQyQHzjI_0_____Retail_CloudEdition 148692fb8726-92a8-4ffc-94ce-f82e07444653_KY7%f%PN-VR%f%6RX-83W%f%6Y-6D%f%DYQ-T6%f%R4W_203_X22-53847_DCP6QzPj+BD1EEmlBelBt7x9AmvQOfd7kdkUB0b0x6/TNHRnZtdyix3pNX2IDQtJbLnNLc2ZlMmupbZQrtyxe3xl8+xlCnHByXZpzFty9sGzq3MozHHA9u9WsJEf5R7tnFDplNM1UitlTVTAyuCGk83brY4zjmz/52pUQyQHzjI_0_____Retail_CloudEdition
1304d4f9b41f-205c-405e-8e08-3d16e88e02be_J7N%f%JW-V6%f%KBM-CC8%f%RW-Y2%f%9Y4-HQ%f%2MJ_205_X23-15027_U9eyfIBXrs++lyP6OjHHaF/wjieAxQeSKwzSkGBeTTpyCDcenq8t4cKvqDHnauSZzaVPWNoVcASkMCdlJi3EkR29KSgvx9/K2OB8LVH2PPpqvwjm1ZZdrvLMGhW83A/KRrtN9AOx7bnPC8MNLErnzbRRS9/aOrmp4Uzo8EIVagI_0_OEM:NONSLP_IoTEnterpriseSK 1487d4f9b41f-205c-405e-8e08-3d16e88e02be_J7N%f%JW-V6%f%KBM-CC8%f%RW-Y2%f%9Y4-HQ%f%2MJ_205_X23-15027_U9eyfIBXrs++lyP6OjHHaF/wjieAxQeSKwzSkGBeTTpyCDcenq8t4cKvqDHnauSZzaVPWNoVcASkMCdlJi3EkR29KSgvx9/K2OB8LVH2PPpqvwjm1ZZdrvLMGhW83A/KRrtN9AOx7bnPC8MNLErnzbRRS9/aOrmp4Uzo8EIVagI_0_OEM:NONSLP_IoTEnterpriseSK
1305) do ( 1488) do (
1306for /f "tokens=1-10 delims=_" %%A in ("%%#") do ( 1489for /f "tokens=1-9 delims=_" %%A in ("%%#") do (
1307
1308if %1==key if %osSKU%==%%C (
1309
1310REM Detect key attempt 1
1311
1312if "%2"=="attempt1" if not defined key (
1313echo "!applist!" | find /i "%%A" 1>nul && (
1314if %%F==1 set notworking=1
1315set key=%%B
1316)
1317)
1318 1490
1319REM Detect key attempt 2 1491REM Detect key
1320 1492
1321if "%2"=="attempt2" if not defined key ( 1493if %1==key if %osSKU%==%%C if not defined key (
1322set actidnotfound=1 1494echo "!applist! !altapplist!" | find /i "%%A" %nul1% && (
1323set 9th=%%I
1324if not defined 9th (
1325if %%F==1 set notworking=1 1495if %%F==1 set notworking=1
1326set key=%%B 1496set key=%%B
1327) else (
1328echo "%branch%" | find /i "%%I" 1>nul && (
1329if %%F==1 set notworking=1
1330set key=%%B
1331)
1332)
1333) 1497)
1334) 1498)
1335 1499
@@ -1338,7 +1502,7 @@ REM Generate ticket
1338if %1==ticket if "%key%"=="%%B" ( 1502if %1==ticket if "%key%"=="%%B" (
1339set "string=OSMajorVersion=5;OSMinorVersion=1;OSPlatformId=2;PP=0;Pfn=Microsoft.Windows.%%C.%%D_8wekyb3d8bbwe;DownlevelGenuineState=1;$([char]0)" 1503set "string=OSMajorVersion=5;OSMinorVersion=1;OSPlatformId=2;PP=0;Pfn=Microsoft.Windows.%%C.%%D_8wekyb3d8bbwe;DownlevelGenuineState=1;$([char]0)"
1340for /f "tokens=* delims=" %%i in ('%psc% [conv%f%ert]::ToBas%f%e64String([Text.En%f%coding]::Uni%f%code.GetBytes("""!string!"""^)^)') do set "encoded=%%i" 1504for /f "tokens=* delims=" %%i in ('%psc% [conv%f%ert]::ToBas%f%e64String([Text.En%f%coding]::Uni%f%code.GetBytes("""!string!"""^)^)') do set "encoded=%%i"
1341echo "!encoded!" | find "AAAA" 1>nul || exit /b 1505echo "!encoded!" | find "AAAA" %nul1% || exit /b
1342 1506
1343<nul set /p "=<?xml version="1.0" encoding="utf-8"?><genuineAuthorization xmlns="http://www.microsoft.com/DRM/SL/GenuineAuthorization/1.0"><version>1.0</version><genuineProperties origin="sppclient"><properties>OA3xOriginalProductId=;OA3xOriginalProductKey=;SessionId=!encoded!;TimeStampClient=2022-10-11T12:00:00Z</properties><signatures><signature name="clientLockboxKey" method="rsa-sha256">%%E=</signature></signatures></genuineProperties></genuineAuthorization>" >"%tdir%\GenuineTicket" 1507<nul set /p "=<?xml version="1.0" encoding="utf-8"?><genuineAuthorization xmlns="http://www.microsoft.com/DRM/SL/GenuineAuthorization/1.0"><version>1.0</version><genuineProperties origin="sppclient"><properties>OA3xOriginalProductId=;OA3xOriginalProductKey=;SessionId=!encoded!;TimeStampClient=2022-10-11T12:00:00Z</properties><signatures><signature name="clientLockboxKey" method="rsa-sha256">%%E=</signature></signatures></genuineProperties></genuineAuthorization>" >"%tdir%\GenuineTicket"
1344) 1508)
@@ -1351,8 +1515,6 @@ exit /b
1351 1515
1352:: Below code is used to get alternate edition name and key if current edition doesn't support HWID activation 1516:: Below code is used to get alternate edition name and key if current edition doesn't support HWID activation
1353 1517
1354:: ProfessionalCountrySpecific won't be converted because it's not a good idea to change CountrySpecific editions
1355
1356:: 1st column = Current SKU ID 1518:: 1st column = Current SKU ID
1357:: 2nd column = Current Edition Name 1519:: 2nd column = Current Edition Name
1358:: 3rd column = Current Edition Activation ID 1520:: 3rd column = Current Edition Activation ID
@@ -1368,15 +1530,16 @@ set notfoundaltactID=
1368if %_NoEditionChange%==1 exit /b 1530if %_NoEditionChange%==1 exit /b
1369 1531
1370for %%# in ( 1532for %%# in (
1371125_EnterpriseS-2021___________cce9d2de-98ee-4ce2-8113-222620c64a27_ed655016-a9e8-4434-95d9-4345352c2552_QPM%f%6N-7J2%f%WJ-P8%f%8HH-P3Y%f%RH-YY%f%74H_IoTEnterpriseS-2021 1533125_EnterpriseS-2021_______________cce9d2de-98ee-4ce2-8113-222620c64a27_ed655016-a9e8-4434-95d9-4345352c2552_QPM%f%6N-7J2%f%WJ-P8%f%8HH-P3Y%f%RH-YY%f%74H_IoTEnterpriseS-2021
1372191_IoTEnterpriseS-Win11_______59eb965c-9150-42b7-a0ec-22151b9897c5_d4f9b41f-205c-405e-8e08-3d16e88e02be_J7N%f%JW-V6K%f%BM-CC%f%8RW-Y29%f%Y4-HQ%f%2MJ_IoTEnterpriseSK-Win11 1534125_EnterpriseS-2024_______________f6e29426-a256-4316-88bf-cc5b0f95ec0c_6c4de1b8-24bb-4c17-9a77-7b939414c298_CGK%f%42-GYN%f%6Y-VD%f%22B-BX9%f%8W-J8%f%JXD_IoTEnterpriseS-2024
1373138_ProfessionalSingleLanguage_a48938aa-62fa-4966-9d44-9f04da3f72f2_4de7cb65-cdf1-4de9-8ae8-e3cce27b9f2c_VK7%f%JG-NPH%f%TM-C9%f%7JM-9MP%f%GT-3V%f%66T_Professional 1535138_ProfessionalSingleLanguage_____a48938aa-62fa-4966-9d44-9f04da3f72f2_4de7cb65-cdf1-4de9-8ae8-e3cce27b9f2c_VK7%f%JG-NPH%f%TM-C9%f%7JM-9MP%f%GT-3V%f%66T_Professional
1536139_ProfessionalCountrySpecific____f7af7d09-40e4-419c-a49b-eae366689ebd_4de7cb65-cdf1-4de9-8ae8-e3cce27b9f2c_VK7%f%JG-NPH%f%TM-C9%f%7JM-9MP%f%GT-3V%f%66T_Professional
1537139_ProfessionalCountrySpecific-Zn_01eb852c-424d-4060-94b8-c10d799d7364_4de7cb65-cdf1-4de9-8ae8-e3cce27b9f2c_VK7%f%JG-NPH%f%TM-C9%f%7JM-9MP%f%GT-3V%f%66T_Professional
1374) do ( 1538) do (
1375for /f "tokens=1-6 delims=_" %%A in ("%%#") do if %osSKU%==%%A ( 1539for /f "tokens=1-6 delims=_" %%A in ("%%#") do if %osSKU%==%%A (
1376echo "!applist!" | find /i "%%C" 1>nul && ( 1540echo "!applist! !altapplist!" | find /i "%%C" %nul1% && (
1377echo "!applist!" | find /i "%%D" 1>nul && ( 1541echo "!applist!" | find /i "%%D" %nul1% && (
1378set altkey=%%E 1542set altkey=%%E
1379set curedition=%%B
1380set altedition=%%F 1543set altedition=%%F
1381) || ( 1544) || (
1382set altedition=%%F 1545set altedition=%%F
@@ -1389,7 +1552,1206 @@ exit /b
1389 1552
1390:+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1553:+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
1391 1554
1555:OhookActivation
1556@setlocal DisableDelayedExpansion
1557@echo off
1558
1559:: To activate Office with Ohook activation, run the script with "/Ohook" parameter or change 0 to 1 in below line
1560set _act=0
1561
1562:: To remove Ohook activation, run the script with /Ohook-Uninstall parameter or change 0 to 1 in below line
1563set _rem=0
1564
1565:: If value is changed in above lines or parameter is used then script will run in unattended mode
1566
1567::========================================================================================================================================
1568
1569cls
1570color 07
1571title Ohook Activation
1572
1573set _args=
1574set _elev=
1575set _unattended=0
1576
1577set _args=%*
1578if defined _args set _args=%_args:"=%
1579if defined _args (
1580for %%A in (%_args%) do (
1581if /i "%%A"=="/Ohook" set _act=1
1582if /i "%%A"=="/Ohook-Uninstall" set _rem=1
1583if /i "%%A"=="-el" set _elev=1
1584)
1585)
1586
1587for %%A in (%_act% %_rem%) do (if "%%A"=="1" set _unattended=1)
1588
1589::========================================================================================================================================
1590
1591set "nul1=1>nul"
1592set "nul2=2>nul"
1593set "nul6=2^>nul"
1594set "nul=>nul 2>&1"
1595
1596set psc=powershell.exe
1597set winbuild=1
1598for /f "tokens=6 delims=[]. " %%G in ('ver') do set winbuild=%%G
1599
1600set _NCS=1
1601if %winbuild% LSS 10586 set _NCS=0
1602if %winbuild% GEQ 10586 reg query "HKCU\Console" /v ForceV2 %nul2% | find /i "0x0" %nul1% && (set _NCS=0)
1603
1604if %_NCS% EQU 1 (
1605for /F %%a in ('echo prompt $E ^| cmd') do set "esc=%%a"
1606set "Red="41;97m""
1607set "Gray="100;97m""
1608set "Green="42;97m""
1609set "Blue="44;97m""
1610set "_White="40;37m""
1611set "_Green="40;92m""
1612set "_Yellow="40;93m""
1613) else (
1614set "Red="Red" "white""
1615set "Gray="Darkgray" "white""
1616set "Green="DarkGreen" "white""
1617set "Blue="Blue" "white""
1618set "_White="Black" "Gray""
1619set "_Green="Black" "Green""
1620set "_Yellow="Black" "Yellow""
1621)
1622
1623set "nceline=echo: &echo ==== ERROR ==== &echo:"
1624set "eline=echo: &call :dk_color %Red% "==== ERROR ====" &echo:"
1625if %~z0 GEQ 200000 (
1626set "_exitmsg=Go back"
1627set "_fixmsg=Go back to Main Menu, select Troubleshoot and run Fix Licensing option."
1628) else (
1629set "_exitmsg=Exit"
1630set "_fixmsg=In MAS folder, run Troubleshoot script and select Fix Licensing option."
1631)
1632
1633::========================================================================================================================================
1634
1635if %winbuild% LSS 9200 (
1636%eline%
1637echo Unsupported OS version detected [%winbuild%].
1638echo Ohook Activation is supported on Windows 8 and later and their server equivalent.
1639goto dk_done
1640)
1641
1642::========================================================================================================================================
1643
1644:: Fix for the special characters limitation in path name
1645
1646set "_work=%~dp0"
1647if "%_work:~-1%"=="\" set "_work=%_work:~0,-1%"
1648
1649set "_batf=%~f0"
1650set "_batp=%_batf:'=''%"
1651
1652set _PSarg="""%~f0""" -el %_args%
1653
1654set "_ttemp=%temp%"
1655
1656setlocal EnableDelayedExpansion
1657
1658::========================================================================================================================================
1659
1660if %_rem%==1 goto :oh_uninstall
1661
1662:oh_menu
1663
1664if %_unattended%==0 (
1665cls
1666mode 76, 25
1667title Ohook Activation
1668
1669echo:
1670echo:
1671echo:
1672echo:
1673echo ____________________________________________________________
1674echo:
1675echo [1] Install Ohook Office Activation
1676echo:
1677echo [2] Uninstall
1678echo ____________________________________________
1679echo:
1680echo [3] Download Office
1681echo:
1682echo [0] %_exitmsg%
1683echo ____________________________________________________________
1684echo:
1685call :dk_color2 %_White% " " %_Green% "Enter a menu option in the Keyboard [1,2,3,0]"
1686choice /C:1230 /N
1687set _el=!errorlevel!
1688if !_el!==4 exit /b
1689if !_el!==3 start https://%mas%/genuine-installation-media.html &goto :oh_menu
1690if !_el!==2 goto :oh_uninstall
1691if !_el!==1 goto :oh_menu2
1692goto :oh_menu
1693)
1694
1695::========================================================================================================================================
1696
1697:oh_menu2
1698
1699cls
1700mode 128, 32
1701%psc% "&{$W=$Host.UI.RawUI.WindowSize;$B=$Host.UI.RawUI.BufferSize;$W.Height=32;$B.Height=300;$Host.UI.RawUI.WindowSize=$W;$Host.UI.RawUI.BufferSize=$B;}"
1702
1703title Ohook Activation
1704
1705echo:
1706echo Initializing...
1707call :dk_product
1708call :dk_ckeckwmic
1709
1710:: Show info for potential script stuck scenario
1711
1712sc start sppsvc %nul%
1713if %errorlevel% NEQ 1056 if %errorlevel% NEQ 0 (
1714echo:
1715echo Error code: %errorlevel%
1716call :dk_color %Red% "Failed to start [sppsvc] service, rest of the process may take a long time..."
1717echo:
1718)
1719
1720::========================================================================================================================================
1721
1722set error=
1723
1724cls
1725echo:
1726for /f "skip=2 tokens=2*" %%a in ('reg query "HKLM\SYSTEM\CurrentControlSet\Control\Session Manager\Environment" /v PROCESSOR_ARCHITECTURE') do set osarch=%%b
1727for /f "tokens=6-7 delims=[]. " %%i in ('ver') do if "%%j"=="" (set fullbuild=%%i) else (set fullbuild=%%i.%%j)
1728echo Checking OS Info [%winos% ^| %fullbuild% ^| %osarch%]
1729
1730::========================================================================================================================================
1731
1732:: Check Windows Script Host
1733
1734set _WSH=1
1735reg query "HKCU\SOFTWARE\Microsoft\Windows Script Host\Settings" /v Enabled %nul2% | find /i "0x0" %nul1% && (set _WSH=0)
1736reg query "HKLM\SOFTWARE\Microsoft\Windows Script Host\Settings" /v Enabled %nul2% | find /i "0x0" %nul1% && (set _WSH=0)
1737
1738if %_WSH% EQU 0 (
1739reg add "HKLM\Software\Microsoft\Windows Script Host\Settings" /v Enabled /t REG_DWORD /d 1 /f %nul%
1740reg add "HKCU\Software\Microsoft\Windows Script Host\Settings" /v Enabled /t REG_DWORD /d 1 /f %nul%
1741if not "%arch%"=="x86" reg add "HKLM\Software\Microsoft\Windows Script Host\Settings" /v Enabled /t REG_DWORD /d 1 /f /reg:32 %nul%
1742echo Enabling Windows Script Host [Successful]
1743)
1744
1745::========================================================================================================================================
1746
1747echo Initiating Diagnostic Tests...
1748
1749set "_serv=sppsvc Winmgmt"
1750set officeact=1
1751call :dk_errorcheck
1752
1753:: Check unsupported office versions
1754
1755set o14msi=
1756set o14c2r=
1757set o16uwp=
1758
1759set _68=HKLM\SOFTWARE\Microsoft\Office
1760set _86=HKLM\SOFTWARE\Wow6432Node\Microsoft\Office
1761%nul% reg query %_68%\14.0\Common\InstallRoot /v Path && set o14msi=Office 2010 MSI
1762%nul% reg query %_86%\14.0\Common\InstallRoot /v Path && set o14msi=Office 2010 MSI
1763%nul% reg query %_68%\14.0\CVH /f Click2run /k && set o14c2r=Office 2010 C2R
1764%nul% reg query %_86%\14.0\CVH /f Click2run /k && set o14c2r=Office 2010 C2R
1765
1766if %winbuild% GEQ 10240 %psc% "Get-AppxPackage -name "Microsoft.Office.Desktop"" | find /i "Office" %nul1% && set o16uwp=Office UWP
1767
1768if not "%o14msi%%o14c2r%%o16uwp%"=="" (
1769echo:
1770set error=1
1771call :dk_color %Red% "Checking Unsupported Office Install [ %o14msi%%o14c2r%%o16uwp%]"
1772)
1773
1774::========================================================================================================================================
1775
1776:: Check supported office versions
1777
1778call :oh_getpath
1779
1780sc query ClickToRunSvc %nul%
1781set error1=%errorlevel%
1782
1783if defined o16c2r if %error1% EQU 1060 (
1784call :dk_color %Red% "Checking ClickToRun Service [Not found, Office 16.0 files found]"
1785set o16c2r=
1786set error=1
1787)
1788
1789sc query OfficeSvc %nul%
1790set error2=%errorlevel%
1791
1792if defined o15c2r if %error1% EQU 1060 if %error2% EQU 1060 (
1793call :dk_color %Red% "Checking ClickToRun Service [Not found, Office 15.0 files found]"
1794set o15c2r=
1795set error=1
1796)
1797
1798if "%o16c2r%%o15c2r%%o16msi%%o15msi%"=="" (
1799set error=1
1800echo:
1801if not "%o14msi%%o14c2r%%o16uwp%"=="" (
1802call :dk_color %Red% "Checking Supported Office Install [Not Found]"
1803) else (
1804call :dk_color %Red% "Checking Installed Office [Not Found]"
1805)
1806
1807if %winbuild% GEQ 10240 %psc% "Get-AppxPackage -name "Microsoft.MicrosoftOfficeHub"" | find /i "Office" %nul1% && (
1808echo:
1809echo You have only Office dashboard app installed, you need to install full Office version.
1810)
1811echo:
1812call :dk_color %Blue% "Download and install Office from below URL and try again."
1813echo:
1814echo https://%mas%/genuine-installation-media.html
1815goto dk_done
1816)
1817
1818set multioffice=
1819if not "%o16c2r%%o15c2r%%o16msi%%o15msi%"=="1" set multioffice=1
1820if not "%o14msi%%o14c2r%%o16uwp%"=="" set multioffice=1
1821
1822if defined multioffice (
1823call :dk_color %Gray% "Checking Multiple Office Install [Found. Its best to install only one version]"
1824)
1825
1826::========================================================================================================================================
1827
1828:: Process Office 15.0 C2R
1829
1830if not defined o15c2r goto :starto16c2r
1831
1832call :oh_reset
1833call :oh_actids
1834
1835set oVer=15
1836for /f "skip=2 tokens=2*" %%a in ('"reg query %o15c2r_reg% /v InstallPath" %nul6%') do (set "_oRoot=%%b\root")
1837for /f "skip=2 tokens=2*" %%a in ('"reg query %o15c2r_reg%\Configuration /v Platform" %nul6%') do (set "_oArch=%%b")
1838if not defined _oArch for /f "skip=2 tokens=2*" %%a in ('"reg query %o15c2r_reg%\propertyBag /v Platform" %nul6%') do (set "_oArch=%%b")
1839
1840echo "%o15c2r_reg%" | find /i "Wow6432Node" %nul1% && (set _tok=10) || (set _tok=9)
1841for /f "tokens=%_tok% delims=\" %%a in ('reg query %o15c2r_reg%\ProductReleaseIDs\Active %nul6% ^| findstr /i "Retail Volume"') do (
1842if not defined _oIds (set "_oIds=%%a") else (set "_oIds=!_oIds! %%a")
1843)
1844
1845set "_oLPath=%_oRoot%\Licenses"
1846
1847if [%_oArch%]==[x64] (set "_hookPath=%_oRoot%\vfs\System" & set "_hook=sppc64.dll")
1848if [%_oArch%]==[x86] (set "_hookPath=%_oRoot%\vfs\SystemX86" & set "_hook=sppc32.dll")
1849if not [%osarch%]==[x86] (
1850if [%_oArch%]==[x64] set "_sppcPath=%SystemRoot%\System32\sppc.dll"
1851if [%_oArch%]==[x86] set "_sppcPath=%SystemRoot%\SysWOW64\sppc.dll"
1852) else (
1853set "_sppcPath=%SystemRoot%\System32\sppc.dll"
1854)
1855
1856echo:
1857echo Activating Office 15.0 %_oArch% C2R...
1858
1859if not defined _oIds (
1860call :dk_color %Red% "Checking Installed Products [Product IDs not found. Aborting activation...]"
1861set error=1
1862goto :starto16c2r
1863)
1864
1865call :oh_process
1866call :oh_hookinstall
1867
1868::========================================================================================================================================
1869
1870:starto16c2r
1871
1872:: Process Office 16.0 C2R
1873
1874if not defined o16c2r goto :startmsi
1875
1876call :oh_reset
1877call :oh_actids
1878
1879set oVer=16
1880for /f "skip=2 tokens=2*" %%a in ('"reg query %o16c2r_reg% /v InstallPath" %nul6%') do (set "_oRoot=%%b\root")
1881for /f "skip=2 tokens=2*" %%a in ('"reg query %o16c2r_reg%\Configuration /v Platform" %nul6%') do (set "_oArch=%%b")
1882
1883echo "%o16c2r_reg%" | find /i "Wow6432Node" %nul1% && (set _tok=9) || (set _tok=8)
1884for /f "tokens=%_tok% delims=\" %%a in ('reg query "%o16c2r_reg%\ProductReleaseIDs" /s /f ".16" /k %nul6% ^| findstr /i "Retail Volume"') do (
1885if not defined _oIds (set "_oIds=%%a") else (set "_oIds=!_oIds! %%a")
1886)
1887set _oIds=%_oIds:.16=%
1888
1889set "_oLPath=%_oRoot%\Licenses16"
1890
1891if [%_oArch%]==[x64] (set "_hookPath=%_oRoot%\vfs\System" & set "_hook=sppc64.dll")
1892if [%_oArch%]==[x86] (set "_hookPath=%_oRoot%\vfs\SystemX86" & set "_hook=sppc32.dll")
1893if not [%osarch%]==[x86] (
1894if [%_oArch%]==[x64] set "_sppcPath=%SystemRoot%\System32\sppc.dll"
1895if [%_oArch%]==[x86] set "_sppcPath=%SystemRoot%\SysWOW64\sppc.dll"
1896) else (
1897set "_sppcPath=%SystemRoot%\System32\sppc.dll"
1898)
1899
1900echo:
1901echo Activating Office 16.0 %_oArch% C2R...
1902
1903if not defined _oIds (
1904call :dk_color %Red% "Checking Installed Products [Product IDs not found. Aborting activation...]"
1905set error=1
1906goto :startmsi
1907)
1908
1909call :oh_process
1910call :oh_hookinstall
1911
1912::========================================================================================================================================
1913
1914:: Find remnants of Office vNext license block and remove it because it stops non vNext licenses from appearing
1915
1916set sub_next=
1917set kNext=HKCU\SOFTWARE\Microsoft\Office\16.0\Common\Licensing
1918
1919reg query %kNext%\LicensingNext /v MigrationToV5Done %nul2% | find /i "0x1" %nul% && (
1920reg query %kNext%\LicensingNext %nul2% | findstr /i "volume retail" %nul2% | findstr /i "0x2 0x3" %nul% && (
1921set sub_next=1
1922reg delete %kNext% /f %nul%
1923)
1924)
1925
1926if defined sub_next (
1927reg query %kNext%\LicensingNext %nul% && (
1928call :dk_color %Red% "Removing Office vNext Block [Failed]"
1929) || (
1930echo Removing Office vNext Block [Successful]
1931)
1932)
1933
1934::========================================================================================================================================
1935
1936:: O365 products attempt to validate the license and may show a banner "There was a problem checking this device's license status.", other products don't do that.
1937:: A simple registry entry can skip this check
1938
1939echo "%_lic%" | find /i "Subscription" %nul% && (
1940echo Adding a Reg To Skip License Check [Successful]
1941reg add HKCU\Software\Microsoft\Office\16.0\Common\Licensing\Resiliency /v "TimeOfLastHeartbeatFailure" /t REG_SZ /d "2033-08-18T22:18:45Z" /f %nul%
1942)
1943
1944::========================================================================================================================================
1945
1946:: mass grave[.]dev/office-license-is-not-genuine.html
1947:: Add registry keys for volume products so that 'non-genuine' banner won't appear
1948:: Script already is using MAK instead of GVLK so it won't appear anyway, but registry keys are added incase Office installs default GVLK grace key for volume products
1949
1950echo "%_oIds%" | find /i "Volume" %nul1% && (
1951if %winbuild% GEQ 9200 (
1952if not [%osarch%]==[x86] (
1953reg delete "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\SoftwareProtectionPlatform\0ff1ce15-a989-479d-af46-f275c6370663" /f /reg:32 %nul%
1954reg add "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\SoftwareProtectionPlatform\0ff1ce15-a989-479d-af46-f275c6370663" /f /v KeyManagementServiceName /t REG_SZ /d "10.0.0.10" /reg:32 %nul%
1955)
1956reg delete "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\SoftwareProtectionPlatform\0ff1ce15-a989-479d-af46-f275c6370663" /f %nul%
1957reg add "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\SoftwareProtectionPlatform\0ff1ce15-a989-479d-af46-f275c6370663" /f /v KeyManagementServiceName /t REG_SZ /d "10.0.0.10" %nul%
1958echo Adding a Reg To Prevent Banner [Successful]
1959)
1960)
1961
1962::========================================================================================================================================
1963
1964:startmsi
1965
1966if defined o15msi call :oh_processmsi 15 %o15msi_reg%
1967if defined o16msi call :oh_processmsi 16 %o16msi_reg%
1968
1969::========================================================================================================================================
1970
1971:: Uninstall other / grace Keys
1972
1973set upk_result=0
1974set allapplist=
1975
1976if %_wmic% EQU 1 set "chkapp=for /f "tokens=2 delims==" %%a in ('"wmic path SoftwareLicensingProduct where (ApplicationID='0ff1ce15-a989-479d-af46-f275c6370663' and PartialProductKey is not null) get ID /VALUE" %nul6%')"
1977if %_wmic% EQU 0 set "chkapp=for /f "tokens=2 delims==" %%a in ('%psc% "(([WMISEARCHER]'SELECT ID FROM SoftwareLicensingProduct WHERE ApplicationID=''0ff1ce15-a989-479d-af46-f275c6370663'' AND PartialProductKey IS NOT NULL').Get()).ID ^| %% {echo ('ID='+$_)}" %nul6%')"
1978%chkapp% do (if defined allapplist (call set "allapplist=!allapplist! %%a") else (call set "allapplist=%%a"))
1979
1980for %%# in (%allapplist%) do (
1981echo "%_allactid%" | find /i "%%#" %nul1% || (
1982cscript //nologo %windir%\system32\slmgr.vbs /upk %%# %nul% && (
1983set upk_result=1
1984) || (
1985set error=1
1986set upk_result=2
1987)
1988)
1989)
1990
1991if not %upk_result%==0 echo:
1992if %upk_result%==1 echo Uninstalling Other/Grace Keys [Successful]
1993if %upk_result%==2 call :dk_color %Red% "Uninstalling Other/Grace Keys [Failed]"
1994
1995::========================================================================================================================================
1996
1997:: Refresh Windows Insider Preview Licenses
1998:: It required in Insider versions otherwise office may not activate
1999
2000if exist "%windir%\system32\spp\store_test\2.0\tokens.dat" (
2001cscript //nologo %windir%\system32\slmgr.vbs /rilc %nul%
2002if !errorlevel! NEQ 0 cscript //nologo %windir%\system32\slmgr.vbs /rilc %nul%
2003)
2004
2005::========================================================================================================================================
2006
2007echo:
2008if not defined error (
2009call :dk_color %Green% "Office is permanently activated."
2010echo Help: https://%mas%/troubleshoot
2011) else (
2012call :dk_color %Red% "Some errors were detected."
2013if not defined ierror if not defined showfix if not defined serv_cor if not defined serv_cste call :dk_color %Blue% "%_fixmsg%"
2014echo:
2015call :dk_color2 %Blue% "Check this page for help" %_Yellow% " https://%mas%/troubleshoot"
2016)
2017
2018goto :dk_done
2019
2020::========================================================================================================================================
2021
2022:oh_uninstall
2023
2024cls
2025mode 99, 28
2026title Uninstall Ohook Activation
2027
2028set _present=
2029set _unerror=
2030call :oh_reset
2031call :oh_getpath
2032
2033echo:
2034echo Uninstalling Ohook Activation...
2035echo:
2036
2037if defined o16c2r_reg (for /f "skip=2 tokens=2*" %%a in ('"reg query %o16c2r_reg% /v InstallPath" %nul6%') do (set "_16CHook=%%b\root\vfs"))
2038if defined o15c2r_reg (for /f "skip=2 tokens=2*" %%a in ('"reg query %o15c2r_reg% /v InstallPath" %nul6%') do (set "_15CHook=%%b\root\vfs"))
2039if defined o16msi_reg (for /f "skip=2 tokens=2*" %%a in ('"reg query %o16msi_reg%\Common\InstallRoot /v Path" %nul6%') do (set "_16MHook=%%b"))
2040if defined o15msi_reg (for /f "skip=2 tokens=2*" %%a in ('"reg query %o15msi_reg%\Common\InstallRoot /v Path" %nul6%') do (set "_15MHook=%%b"))
2041
2042if defined _16CHook (if exist "%_16CHook%\System\sppc*dll" (set _present=1& del /s /f /q "%_16CHook%\System\sppc*dll" & if exist "%_16CHook%\System\sppc*dll" set _unerror=1))
2043if defined _16CHook (if exist "%_16CHook%\SystemX86\sppc*dll" (set _present=1& del /s /f /q "%_16CHook%\SystemX86\sppc*dll" & if exist "%_16CHook%\SystemX86\sppc*dll" set _unerror=1))
2044if defined _15CHook (if exist "%_15CHook%\System\sppc*dll" (set _present=1& del /s /f /q "%_15CHook%\System\sppc*dll" & if exist "%_15CHook%\System\sppc*dll" set _unerror=1))
2045if defined _15CHook (if exist "%_15CHook%\SystemX86\sppc*dll" (set _present=1& del /s /f /q "%_15CHook%\SystemX86\sppc*dll" & if exist "%_15CHook%\SystemX86\sppc*dll" set _unerror=1))
2046if defined _16MHook (if exist "%_16MHook%sppc*dll" (set _present=1& del /s /f /q "%_16MHook%sppc*dll" & if exist "%_16MHook%sppc*dll" set _unerror=1))
2047if defined _15MHook (if exist "%_15MHook%sppc*dll" (set _present=1& del /s /f /q "%_15MHook%sppc*dll" & if exist "%_15MHook%sppc*dll" set _unerror=1))
2048
2049for %%# in (15 16) do (
2050for %%A in ("%ProgramFiles%" "%ProgramW6432%" "%ProgramFiles(x86)%") do (
2051if exist "%%~A\Microsoft Office\Office%%#\sppc*dll" (set _present=1& del /s /f /q "%%~A\Microsoft Office\Office%%#\sppc*dll" & if exist "%%~A\Microsoft Office\Office%%#\sppc*dll" set _unerror=1)
2052)
2053)
2054
2055for %%# in (System SystemX86) do (
2056for %%G in ("Office 15" "Office") do (
2057for %%A in ("%ProgramFiles%" "%ProgramW6432%" "%ProgramFiles(x86)%") do (
2058if exist "%%~A\Microsoft %%~G\root\vfs\%%#\sppc*dll" (set _present=1& del /s /f /q "%%~A\Microsoft %%~G\root\vfs\%%#\sppc*dll" & if exist "%%~A\Microsoft %%~G\root\vfs\%%#\sppc*dll" set _unerror=1)
2059)
2060)
2061)
2062
2063reg query HKCU\Software\Microsoft\Office\16.0\Common\Licensing\Resiliency /s %nul2% | find /i "2033" %nul% && (
2064echo:
2065echo Deleting - HKCU\Software\Microsoft\Office\16.0\Common\Licensing\Resiliency
2066reg delete HKCU\Software\Microsoft\Office\16.0\Common\Licensing\Resiliency /f
2067)
2068
2069reg query "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\SoftwareProtectionPlatform\0ff1ce15-a989-479d-af46-f275c6370663" %nul% && (
2070echo:
2071echo Deleting - Registry key to prevent non-genuine banner
2072reg delete "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\SoftwareProtectionPlatform\0ff1ce15-a989-479d-af46-f275c6370663" /f
2073)
2074
2075reg query "HKLM\SOFTWARE\Wow6432Node\Microsoft\Windows NT\CurrentVersion\SoftwareProtectionPlatform\0ff1ce15-a989-479d-af46-f275c6370663" %nul% && (
2076reg delete "HKLM\SOFTWARE\Wow6432Node\Microsoft\Windows NT\CurrentVersion\SoftwareProtectionPlatform\0ff1ce15-a989-479d-af46-f275c6370663" /f
2077)
2078
2079echo __________________________________________________________________________________________
2080echo:
2081
2082if not defined _present (
2083echo Ohook Activation is not installed.
2084) else (
2085if defined _unerror (
2086call :dk_color %Red% "Failed to uninstall Ohook activation."
2087call :dk_color %Blue% "Close Office apps if they are running and try again."
2088) else (
2089call :dk_color %Green% "Successfully uninstalled Ohook activation."
2090)
2091)
2092echo __________________________________________________________________________________________
2093
2094goto :dk_done
2095
2096::========================================================================================================================================
2097
2098:oh_reset
2099
2100set _oRoot=
2101set _oArch=
2102set _oIds=
2103set _oLPath=
2104set _hookPath=
2105set _hook=
2106set _sppcPath=
2107set _key=
2108set _actid=
2109set _prod=
2110set _lic=
2111set _License=
2112exit /b
2113
2114::========================================================================================================================================
2115
2116:oh_getpath
2117
2118set o16c2r=
2119set o15c2r=
2120set o16msi=
2121set o15msi=
2122
2123set _68=HKLM\SOFTWARE\Microsoft\Office
2124set _86=HKLM\SOFTWARE\Wow6432Node\Microsoft\Office
2125
2126for /f "skip=2 tokens=2*" %%a in ('"reg query %_86%\ClickToRun /v InstallPath" %nul6%') do if exist "%%b\root\Licenses16\ProPlus*.xrm-ms" (set o16c2r=1&set o16c2r_reg=%_86%\ClickToRun)
2127for /f "skip=2 tokens=2*" %%a in ('"reg query %_68%\ClickToRun /v InstallPath" %nul6%') do if exist "%%b\root\Licenses16\ProPlus*.xrm-ms" (set o16c2r=1&set o16c2r_reg=%_68%\ClickToRun)
2128for /f "skip=2 tokens=2*" %%a in ('"reg query %_86%\15.0\ClickToRun /v InstallPath" %nul6%') do if exist "%%b\root\Licenses\ProPlus*.xrm-ms" (set o15c2r=1&set o15c2r_reg=%_86%\15.0\ClickToRun)
2129for /f "skip=2 tokens=2*" %%a in ('"reg query %_68%\15.0\ClickToRun /v InstallPath" %nul6%') do if exist "%%b\root\Licenses\ProPlus*.xrm-ms" (set o15c2r=1&set o15c2r_reg=%_68%\15.0\ClickToRun)
2130
2131for /f "skip=2 tokens=2*" %%a in ('"reg query %_86%\16.0\Common\InstallRoot /v Path" %nul6%') do if exist "%%b\OSPP.VBS" (set o16msi=1&set o16msi_reg=%_86%\16.0)
2132for /f "skip=2 tokens=2*" %%a in ('"reg query %_68%\16.0\Common\InstallRoot /v Path" %nul6%') do if exist "%%b\OSPP.VBS" (set o16msi=1&set o16msi_reg=%_68%\16.0)
2133for /f "skip=2 tokens=2*" %%a in ('"reg query %_86%\15.0\Common\InstallRoot /v Path" %nul6%') do if exist "%%b\OSPP.VBS" (set o15msi=1&set o15msi_reg=%_86%\15.0)
2134for /f "skip=2 tokens=2*" %%a in ('"reg query %_68%\15.0\Common\InstallRoot /v Path" %nul6%') do if exist "%%b\OSPP.VBS" (set o15msi=1&set o15msi_reg=%_68%\15.0)
2135
2136exit /b
2137
2138::========================================================================================================================================
2139
2140:oh_installkey
2141
2142if %_wmic% EQU 1 wmic path SoftwareLicensingService where __CLASS='SoftwareLicensingService' call InstallProductKey ProductKey="%_key%" %nul%
2143if %_wmic% EQU 0 %psc% "(([WMISEARCHER]'SELECT Version FROM SoftwareLicensingService').Get()).InstallProductKey('%_key%')" %nul%
2144if not %errorlevel%==0 cscript //nologo %windir%\system32\slmgr.vbs /ipk %_key% %nul%
2145set errorcode=%errorlevel%
2146cmd /c exit /b %errorcode%
2147if %errorcode% NEQ 0 set "errorcode=[0x%=ExitCode%]"
2148
2149if %errorcode% EQU 0 (
2150call :dk_refresh
2151echo Installing Generic Product Key [%_key%] [%_prod%] [%_lic%] [Successful]
2152) else (
2153call :dk_color %Red% "Installing Generic Product Key [%_key%] [%_prod%] [%_lic%] [Failed] %errorcode%"
2154if not defined error (
2155call :dk_color %Blue% "%_fixmsg%"
2156set showfix=1
2157)
2158set error=1
2159)
2160
2161exit /b
2162
2163::========================================================================================================================================
2164
2165:oh_installlic
2166
2167if not defined _oLPath exit /b
2168
2169set _License=%_prod:Retail=R_%
2170set _License=%_License:Volume=VL_%
2171
2172for %%# in ("!_oLPath!\client-issuance-*.xrm-ms") do (
2173cscript //nologo %windir%\system32\slmgr.vbs /ilc "!_oLPath!\%%~nx#" %nul%
2174)
2175cscript //nologo %windir%\system32\slmgr.vbs /ilc "!_oLPath!\pkeyconfig-office.xrm-ms" %nul%
2176
2177for %%# in ("!_oLPath!\%_License%*.xrm-ms") do (
2178cscript //nologo %windir%\system32\slmgr.vbs /ilc "!_oLPath!\%%~nx#" %nul%
2179)
2180
2181call :oh_actids
2182
2183echo "!oapplist!" | find /i "!_actid!" %nul1% && (
2184call :dk_color %Gray% "Installing Missing License Files [Office %oVer%.0 %_prod%] [Successful]"
2185) || (
2186set error=1
2187call :dk_color %Red% "Installing Missing License Files [Office %oVer%.0 %_prod%] [Failed]"
2188)
2189
2190exit /b
2191
2192::========================================================================================================================================
2193
2194:oh_hookinstall
2195
2196set ierror=
2197set hasherror=
2198
2199del /s /q "%_hookPath%\sppcs.dll" %nul%
2200del /s /q "%_hookPath%\sppc.dll" %nul%
2201
2202if exist "%_hookPath%\sppcs.dll" set ierror=1
2203if exist "%_hookPath%\sppc.dll" set ierror=1
2204
2205mklink "%_hookPath%\sppcs.dll" "%_sppcPath%" %nul%
2206if not %errorlevel%==0 set ierror=1
2207
2208if not exist "%_hookPath%\sppc.dll" call :oh_extractdll "%_hookPath%\sppc.dll"
2209if not exist "%_hookPath%\sppc.dll" set ierror=1
2210
2211echo:
2212if not defined ierror (
2213echo Symlinking System's sppc.dll To ["%_hookPath%\sppcs.dll"] [Successful]
2214echo Extracting Custom %_hook% To ["%_hookPath%\sppc.dll"] [Successful]
2215) else (
2216set error=1
2217call :dk_color %Red% "Symlinking Systems sppc.dll [Failed]"
2218call :dk_color %Red% "Extracting Custom %_hook% [Failed]"
2219echo ["%_hookPath%\sppc.dll"]
2220call :dk_color %Blue% "Close Office apps if they are running and try again."
2221)
2222
2223if not defined ierror (
2224if defined hasherror (
2225set error=1
2226set ierror=1
2227call :dk_color %Red% "Modifying Hash of Custom %_hook% [Failed]"
2228) else (
2229echo Modifying Hash of Custom %_hook% [Successful]
2230)
2231)
2232
2233exit /b
2234
2235::========================================================================================================================================
2236
2237:oh_process
2238
2239for %%# in (%_oIds%) do (
2240set _key=
2241set _actid=
2242set _lic=
2243set _prod=%%#
2244
2245call :ohookdata getinfo %%#
2246
2247if not [!_key!]==[] (
2248echo "!oapplist!" | find /i "!_actid!" %nul1% || call :oh_installlic
2249call :oh_installkey
2250) else (
2251set error=1
2252call :dk_color %Red% "Checking Product In Script [Office %oVer%.0 %%# not found in script]"
2253echo Make sure you are using Latest MAS script.
2254)
2255)
2256
2257exit /b
2258
2259::========================================================================================================================================
2260
2261:oh_msiproducts
2262
2263set msitemp=%SystemRoot%\Temp\_msitemp.txt
2264
2265if %oVer%==15 set _psmsikey=%o15msi_reg:HKLM\=HKLM:%
2266if %oVer%==16 set _psmsikey=%o16msi_reg:HKLM\=HKLM:%
2267
2268if exist %msitemp% del /f /q %msitemp%
2269%psc% "$Key = '%_psmsikey%\Registration\{*FF1CE}'; $keydata = Get-ItemProperty -Path $Key -Name "DigitalProductID"; $binaryData = $keydata."DigitalProductID"; $stringData = [System.Text.Encoding]::Unicode.GetString($binaryData);$stringData" >>%msitemp%
2270
2271if exist %msitemp% call :ohookdata getmsiprod
2272if exist %msitemp% del /f /q %msitemp%
2273
2274exit /b
2275
2276::========================================================================================================================================
2277
2278:oh_processmsi
2279
2280:: Process Office MSI Version
2281
2282call :oh_reset
2283call :oh_actids
2284
2285set oVer=%1
2286for /f "skip=2 tokens=2*" %%a in ('"reg query %2\Common\InstallRoot /v Path" %nul6%') do (set "_oRoot=%%b")
2287if "%_oRoot:~-1%"=="\" set "_oRoot=%_oRoot:~0,-1%"
2288
2289echo "%2" | find /i "Wow6432Node" %nul1% && set _oArch=x86
2290if not [%osarch%]==[x86] if not defined _oArch set _oArch=x64
2291if [%osarch%]==[x86] set _oArch=x86
2292
2293if [%_oArch%]==[x64] (set "_hookPath=%_oRoot%" & set "_hook=sppc64.dll")
2294if [%_oArch%]==[x86] (set "_hookPath=%_oRoot%" & set "_hook=sppc32.dll")
2295if not [%osarch%]==[x86] (
2296if [%_oArch%]==[x64] set "_sppcPath=%SystemRoot%\System32\sppc.dll"
2297if [%_oArch%]==[x86] set "_sppcPath=%SystemRoot%\SysWOW64\sppc.dll"
2298) else (
2299set "_sppcPath=%SystemRoot%\System32\sppc.dll"
2300)
2301
2302call :oh_msiproducts
2303
2304echo:
2305echo Activating Office %1.0 %_oArch% MSI...
2306
2307if not defined _oIds (
2308set error=1
2309call :dk_color %Red% "Checking Installed Products [Product IDs not found. Aborting activation...]"
2310exit /b
2311)
2312
2313call :oh_process
2314call :oh_hookinstall
2315
2316exit /b
2317
2318::========================================================================================================================================
2319
2320:: Get Office Activation IDs
2321
2322:oh_actids
2323
2324set oapplist=
2325if %_wmic% EQU 1 set "chkapp=for /f "tokens=2 delims==" %%a in ('"wmic path SoftwareLicensingProduct where (ApplicationID='0ff1ce15-a989-479d-af46-f275c6370663') get ID /VALUE" %nul6%')"
2326if %_wmic% EQU 0 set "chkapp=for /f "tokens=2 delims==" %%a in ('%psc% "(([WMISEARCHER]'SELECT ID FROM SoftwareLicensingProduct WHERE ApplicationID=''0ff1ce15-a989-479d-af46-f275c6370663''').Get()).ID ^| %% {echo ('ID='+$_)}" %nul6%')"
2327%chkapp% do (if defined oapplist (call set "oapplist=!oapplist! %%a") else (call set "oapplist=%%a"))
2328exit /b
2329
2330::========================================================================================================================================
2331
2332:: 1st column = Office version number
2333:: 2nd column = Activation ID
2334:: 3rd column = Generic key. Preference is given in this order, Retail > OEM:NONSLP > Volume:MAK > Volume:GVLK > Retail:TB:Sub
2335:: 4th column = Last part of license description
2336:: 5th column = Edition
2337:: Separator = "_"
2338
2339:ohookdata
2340
2341set f=
2342for %%# in (
234315_ab4d047b-97cf-4126-a69f-34df08e2f254_B7R%f%FY-7N%f%XPK-Q43%f%42-Y9%f%X2H-3JX%f%4X_Retail________AccessRetail
234415_4374022d-56b8-48c1-9bb7-d8f2fc726343_9MF%f%9G-CN%f%32B-HV7%f%XT-9X%f%J8T-9KV%f%F4_MAK___________AccessVolume
234515_1b1d9bd5-12ea-4063-964c-16e7e87d6e08_NT8%f%89-MB%f%H4X-8MD%f%4H-X8%f%R2D-WQH%f%F8_Retail________ExcelRetail
234615_ac1ae7fd-b949-4e04-a330-849bc40638cf_Y3N%f%36-YC%f%HDK-XYW%f%BG-KY%f%QVV-BDT%f%J2_MAK___________ExcelVolume
234715_cfaf5356-49e3-48a8-ab3c-e729ab791250_BMK%f%4W-6N%f%88B-BP9%f%QR-PH%f%FCK-MG7%f%GF_Retail________GrooveRetail
234815_4825ac28-ce41-45a7-9e6e-1fed74057601_RN8%f%4D-7H%f%CWY-FTC%f%BK-JM%f%XWM-HT7%f%GJ_MAK___________GrooveVolume
234915_c02fb62e-1cd5-4e18-ba25-e0480467ffaa_2WQ%f%NF-GB%f%K4B-XVG%f%6F-BB%f%MX7-M4F%f%2Y_OEM-Perp______HomeBusinessPipcRetail
235015_cd256150-a898-441f-aac0-9f8f33390e45_NVT%f%DK-QB%f%8J9-M28%f%GR-92%f%BPC-BR9%f%6Q_Retail________HomeBusinessRetail
235115_98685d21-78bd-4c62-bc4f-653344a63035_R29%f%WQ-CM%f%NCM-2TH%f%CT-K4%f%H92-FX6%f%KR_Retail________HomeStudentRetail
235215_44984381-406e-4a35-b1c3-e54f499556e2_RV7%f%NQ-HY%f%3WW-7CK%f%WH-QT%f%VMW-29V%f%HC_Retail________InfoPathRetail
235315_9e016989-4007-42a6-8051-64eb97110cf2_C4T%f%GN-QQ%f%W6Y-FYK%f%XC-6W%f%JW7-X73%f%VG_MAK___________InfoPathVolume
235415_9103f3ce-1084-447a-827e-d6097f68c895_6MD%f%N4-WF%f%3FV-4WH%f%3Q-W6%f%99V-RGC%f%MY_PrepidBypass__LyncAcademicRetail
235515_ff693bf4-0276-4ddb-bb42-74ef1a0c9f4d_N42%f%BF-CB%f%Y9F-W2C%f%7R-X3%f%97X-DYF%f%QW_PrepidBypass__LyncEntryRetail
235615_fada6658-bfc6-4c4e-825a-59a89822cda8_89P%f%23-2N%f%K2R-JXM%f%2M-3Q%f%8R8-BWM%f%3Y_Retail________LyncRetail
235715_e1264e10-afaf-4439-a98b-256df8bb156f_3WK%f%CD-RN%f%489-4M7%f%XJ-GJ%f%2GQ-YBF%f%Q6_MAK___________LyncVolume
235815_3169c8df-f659-4f95-9cc6-3115e6596e83_YYH%f%XG-KT%f%NKF-XGR%f%T7-H2%f%99D-8K6%f%MM_Retail________MondoRetail
235915_f33485a0-310b-4b72-9a0e-b1d605510dbd_2YN%f%YQ-FQ%f%MVG-CB8%f%KW-6X%f%KYD-M7R%f%RJ_MAK___________MondoVolume
236015_3391e125-f6e4-4b1e-899c-a25e6092d40d_4TG%f%WV-6N%f%9P6-G2H%f%8Y-2H%f%WKB-B4F%f%F4_Bypass________OneNoteFreeRetail
236115_8b524bcc-67ea-4876-a509-45e46f6347e8_3KX%f%XQ-PV%f%N2C-8P7%f%YY-HC%f%V88-GVG%f%Q6_Retail________OneNoteRetail
236215_b067e965-7521-455b-b9f7-c740204578a2_JDM%f%WF-NJ%f%C7B-HRC%f%HY-WF%f%T8G-BPX%f%D9_MAK___________OneNoteVolume
236315_12004b48-e6c8-4ffa-ad5a-ac8d4467765a_9N4%f%RQ-CF%f%8R2-HBV%f%CB-J3%f%C9V-94P%f%4D_Retail________OutlookRetail
236415_8d577c50-ae5e-47fd-a240-24986f73d503_HNG%f%29-GG%f%WRG-RFC%f%8C-JT%f%FP4-2J9%f%FH_MAK___________OutlookVolume
236515_5aab8561-1686-43f7-9ff5-2c861da58d17_9CY%f%B3-NF%f%MRW-YFD%f%G6-XC%f%7TF-BY3%f%6J_OEM-Perp______PersonalPipcRetail
236615_17e9df2d-ed91-4382-904b-4fed6a12caf0_2NC%f%QJ-MF%f%RMH-TXV%f%83-J7%f%V4C-RVR%f%WC_Retail________PersonalRetail
236715_31743b82-bfbc-44b6-aa12-85d42e644d5b_HVM%f%N2-KP%f%HQH-DVQ%f%MK-7B%f%3CM-FGB%f%FC_Retail________PowerPointRetail
236815_e40dcb44-1d5c-4085-8e8f-943f33c4f004_47D%f%KN-HP%f%JP7-RF9%f%M3-VC%f%YT2-TMQ%f%4G_MAK___________PowerPointVolume
236915_064383fa-1538-491c-859b-0ecab169a0ab_N3Q%f%MM-GK%f%DT3-JQG%f%X6-7X%f%3MQ-4GB%f%G3_Retail________ProPlusRetail
237015_2b88c4f2-ea8f-43cd-805e-4d41346e18a7_QKH%f%NX-M9%f%GGH-T3Q%f%MW-YP%f%K4Q-QRP%f%9V_MAK___________ProPlusVolume
237115_4e26cac1-e15a-4467-9069-cb47b67fe191_CF9%f%DD-6C%f%NW2-BJW%f%JQ-CV%f%CFX-Y7T%f%XD_OEM-Perp______ProfessionalPipcRetail
237215_44bc70e2-fb83-4b09-9082-e5557e0c2ede_MBQ%f%BN-CQ%f%PT6-PXR%f%MC-TY%f%JFR-3C8%f%MY_Retail________ProfessionalRetail
237315_f2435de4-5fc0-4e5b-ac97-34f515ec5ee7_B4R%f%N4-H4%f%JYG-YMQ%f%MC-CY%f%GKH-46W%f%PH_Retail________ProjectProRetail
237415_ed34dc89-1c27-4ecd-8b2f-63d0f4cedc32_WFC%f%T2-NB%f%FQ7-JD7%f%VV-MF%f%JX6-6F2%f%CM_MAK___________ProjectProVolume
237515_5517e6a2-739b-4822-946f-7f0f1c5934b1_2B9%f%6V-X9%f%NJY-WFB%f%RC-Q8%f%MP2-7CC%f%C4_Retail________ProjectStdRetail
237615_2b9e4a37-6230-4b42-bee2-e25ce86c8c7a_3CN%f%QX-T3%f%4TY-99R%f%H4-C4%f%YD2-KWY%f%GV_MAK___________ProjectStdVolume
237715_c3a0814a-70a4-471f-af37-2313a6331111_TWN%f%CJ-YR%f%84W-X7P%f%PF-6D%f%PRP-D67%f%VC_Retail________PublisherRetail
237815_38ea49f6-ad1d-43f1-9888-99a35d7c9409_DJP%f%HV-NC%f%JV6-GWP%f%T6-K2%f%6JX-C7G%f%X6_MAK___________PublisherVolume
237915_ba3e3833-6a7e-445a-89d0-7802a9a68588_3NY%f%6J-WH%f%T3F-47B%f%DV-JH%f%F36-234%f%3W_PrepidBypass__SPDRetail
238015_32255c0a-16b4-4ce2-b388-8a4267e219eb_V6V%f%WN-KC%f%2HR-YYD%f%D6-9V%f%7HQ-7T7%f%VP_Retail________StandardRetail
238115_a24cca51-3d54-4c41-8a76-4031f5338cb2_9TN%f%6B-PC%f%YH4-MCV%f%DQ-KT%f%83C-TMQ%f%7T_MAK___________StandardVolume
238215_15d12ad4-622d-4257-976c-5eb3282fb93d_JRJ%f%NJ-33%f%M7C-R73%f%X3-P9%f%XF7-R89%f%MY_Retail________VisioProRetail
238315_3e4294dd-a765-49bc-8dbd-cf8b62a4bd3d_YN7%f%CF-XR%f%H6R-CGK%f%RY-GK%f%PV3-BG7%f%WF_MAK___________VisioProVolume
238415_dae597ce-5823-4c77-9580-7268b93a4b23_G2N%f%2Q-4Q%f%D2T-DY4%f%TP-GY%f%489-3RQ%f%CG_Retail________VisioStdRetail
238515_44a1f6ff-0876-4edb-9169-dbb43101ee89_RX6%f%3Y-4N%f%FK2-XTY%f%C8-C6%f%B3W-YPX%f%PJ_MAK___________VisioStdVolume
238615_191509f2-6977-456f-ab30-cf0492b1e93a_NB7%f%7V-RP%f%FQ6-PMM%f%KQ-T8%f%7DV-M4D%f%84_Retail________WordRetail
238715_9cedef15-be37-4ff0-a08a-13a045540641_RPH%f%PB-Y7%f%NC4-3VY%f%FM-DW%f%7VD-G8Y%f%J8_MAK___________WordVolume
238815_befee371-a2f5-4648-85db-a2c55fdf324c_JXR%f%8H-NJ%f%3MK-X66%f%W8-78%f%CWD-QRQ%f%6C_Retail________O365BusinessRetail
238915_537ea5b5-7d50-4876-bd38-a53a77caca32_J2W%f%28-TN%f%9C8-26P%f%WV-F7%f%J4G-72X%f%CB_Subscription1_O365HomePremRetail
239015_0c4e5e7a-b436-4776-bb89-88e4b14687e2_T6J%f%JW-DY%f%N99-WK4%f%6B-9M%f%KKV-94P%f%2Y_Retail________O365ProPlusRetail
239115_7a75647f-636f-4607-8e54-e1b7d1ad8930_B9V%f%9Q-F6%f%ND8-T4K%f%4K-88%f%68M-HT7%f%KT_Retail________O365SmallBusPremRetail
239216_bfa358b0-98f1-4125-842e-585fa13032e6_WHK%f%4N-YQ%f%GHB-XWX%f%CC-G3%f%HYC-6JF%f%94_Retail________AccessRetail
239316_9d9faf9e-d345-4b49-afce-68cb0a539c7c_RNB%f%7V-P4%f%8F4-3FY%f%Y6-2P%f%3R3-63B%f%QV_PrepidBypass__AccessRuntimeRetail
239416_3b2fa33f-cd5a-43a5-bd95-f49f3f546b0b_JJ2%f%Y4-N8%f%KM3-Y8K%f%Y3-Y2%f%2FR-R3K%f%VK_MAK___________AccessVolume
239516_424d52ff-7ad2-4bc7-8ac6-748d767b455d_RKJ%f%BN-VW%f%TM2-BDK%f%XX-RK%f%QFD-JTY%f%Q2_Retail________ExcelRetail
239616_685062a7-6024-42e7-8c5f-6bb9e63e697f_FVG%f%NR-X8%f%2B2-6PR%f%JM-YT%f%4W7-8HV%f%36_MAK___________ExcelVolume
239716_c02fb62e-1cd5-4e18-ba25-e0480467ffaa_2WQ%f%NF-GB%f%K4B-XVG%f%6F-BB%f%MX7-M4F%f%2Y_OEM-Perp______HomeBusinessPipcRetail
239816_86834d00-7896-4a38-8fae-32f20b86fa2b_HM6%f%FM-NV%f%F78-KV9%f%PM-F3%f%6B8-D9M%f%XD_Retail________HomeBusinessRetail
239916_c28acdb8-d8b3-4199-baa4-024d09e97c99_PNP%f%RV-F2%f%627-Q8J%f%VC-3D%f%GR9-WTY%f%RK_Retail________HomeStudentRetail
240016_e2127526-b60c-43e0-bed1-3c9dc3d5a468_YWD%f%4R-CN%f%KVT-VG8%f%VJ-93%f%33B-RC3%f%B8_Retail________HomeStudentVNextRetail
240116_b21367df-9545-4f02-9f24-240691da0e58_Y3X%f%PN-P7%f%PC4-MGP%f%TJ-2B%f%Y3Q-RJR%f%FV_Retail________MondoRetail
240216_2cd0ea7e-749f-4288-a05e-567c573b2a6c_FMT%f%QQ-84%f%NR8-274%f%4R-MX%f%F4P-PGY%f%R3_MAK___________MondoVolume
240316_436366de-5579-4f24-96db-3893e4400030_XYN%f%TG-R9%f%6FY-369%f%HX-YF%f%PHY-F9C%f%PM_Bypass________OneNoteFreeRetail
240416_83ac4dd9-1b93-40ed-aa55-ede25bb6af38_FXF%f%6F-CN%f%C26-W64%f%3C-K6%f%KB7-6XX%f%W3_Retail________OneNoteRetail
240516_23b672da-a456-4860-a8f3-e062a501d7e8_9TY%f%VN-D7%f%6HK-BVM%f%WT-Y7%f%G88-9TP%f%PV_MAK___________OneNoteVolume
240616_5a670809-0983-4c2d-8aad-d3c2c5b7d5d1_7N4%f%KG-P2%f%QDH-86V%f%9C-DJ%f%FVF-369%f%W9_Retail________OutlookRetail
240716_50059979-ac6f-4458-9e79-710bcb41721a_7QP%f%NR-3H%f%FDG-YP6%f%T9-JQ%f%CKQ-KKX%f%XC_MAK___________OutlookVolume
240816_5aab8561-1686-43f7-9ff5-2c861da58d17_9CY%f%B3-NF%f%MRW-YFD%f%G6-XC%f%7TF-BY3%f%6J_OEM-Perp______PersonalPipcRetail
240916_a9f645a1-0d6a-4978-926a-abcb363b72a6_FT7%f%VF-XB%f%N92-HPD%f%JV-RH%f%MBY-6VK%f%BF_Retail________PersonalRetail
241016_f32d1284-0792-49da-9ac6-deb2bc9c80b6_N7G%f%CB-WQ%f%T7K-QRH%f%WG-TT%f%PYD-7T9%f%XF_Retail________PowerPointRetail
241116_9b4060c9-a7f5-4a66-b732-faf248b7240f_X3R%f%T9-ND%f%G64-VMK%f%2M-KQ%f%6XY-DPF%f%GV_MAK___________PowerPointVolume
241216_de52bd50-9564-4adc-8fcb-a345c17f84f9_GM4%f%3N-F7%f%42Q-6JD%f%DK-M6%f%22J-J8G%f%DV_Retail________ProPlusRetail
241316_c47456e3-265d-47b6-8ca0-c30abbd0ca36_FNV%f%K8-8D%f%VCJ-F7X%f%3J-KG%f%VQB-RC2%f%QY_MAK___________ProPlusVolume
241416_4e26cac1-e15a-4467-9069-cb47b67fe191_CF9%f%DD-6C%f%NW2-BJW%f%JQ-CV%f%CFX-Y7T%f%XD_OEM-Perp______ProfessionalPipcRetail
241516_d64edc00-7453-4301-8428-197343fafb16_NXF%f%TK-YD%f%9Y7-X9M%f%MJ-9B%f%WM6-J2Q%f%VH_Retail________ProfessionalRetail
241616_0f42f316-00b1-48c5-ada4-2f52b5720ad0_WKK%f%GF-TT%f%N8F-QC9%f%T2-6C%f%2DC-3YH%f%63_Retail________ProjectProRetail
241716_82f502b5-b0b0-4349-bd2c-c560df85b248_PKC%f%3N-8F%f%99H-28M%f%VY-J4%f%RYY-CWG%f%DH_MAK___________ProjectProVolume
241816_16728639-a9ab-4994-b6d8-f81051e69833_JBN%f%PH-YF%f%2F7-Q9Y%f%29-86%f%CTG-C9Y%f%GV_MAKC2R________ProjectProXVolume
241916_e9f0b3fc-962f-4944-ad06-05c10b6bcd5e_4H6%f%NF-QD%f%PG8-83W%f%97-9K%f%8XY-XBT%f%9Y_Retail________ProjectStdRetail
242016_82e6b314-2a62-4e51-9220-61358dd230e6_4TG%f%WV-6N%f%9P6-G2H%f%8Y-2H%f%WKB-B4G%f%93_MAK___________ProjectStdVolume
242116_431058f0-c059-44c5-b9e7-ed2dd46b6789_N3W%f%2Q-69%f%MBT-27R%f%D9-BH%f%8V3-JT2%f%C8_MAKC2R________ProjectStdXVolume
242216_6e0c1d99-c72e-4968-bcb7-ab79e03e201e_WKW%f%ND-X6%f%G9G-CDM%f%TV-CP%f%GYJ-6MV%f%BF_Retail________PublisherRetail
242316_fcc1757b-5d5f-486a-87cf-c4d6dedb6032_9QV%f%N2-PX%f%XRX-8V4%f%W8-Q7%f%926-TJG%f%D8_MAK___________PublisherVolume
242416_9103f3ce-1084-447a-827e-d6097f68c895_6MD%f%N4-WF%f%3FV-4WH%f%3Q-W6%f%99V-RGC%f%MY_PrepidBypass__SkypeServiceBypassRetail
242516_971cd368-f2e1-49c1-aedd-330909ce18b6_4N4%f%D8-3J%f%7Y3-YYW%f%7C-73%f%HD2-V8R%f%HY_PrepidBypass__SkypeforBusinessEntryRetail
242616_418d2b9f-b491-4d7f-84f1-49e27cc66597_PBJ%f%79-77%f%NY4-VRG%f%FG-Y8%f%WYC-CKC%f%RC_Retail________SkypeforBusinessRetail
242716_03ca3b9a-0869-4749-8988-3cbc9d9f51bb_DMT%f%CJ-KN%f%RKR-JV8%f%TQ-V2%f%CR2-VFT%f%FH_MAK___________SkypeforBusinessVolume
242816_4a31c291-3a12-4c64-b8ab-cd79212be45e_2FP%f%WN-4H%f%6CM-KD8%f%QQ-8H%f%CHC-P9X%f%YW_Retail________StandardRetail
242916_0ed94aac-2234-4309-ba29-74bdbb887083_WHG%f%MQ-JN%f%MGT-MDQ%f%VF-WD%f%R69-KQB%f%WC_MAK___________StandardVolume
243016_2dfe2075-2d04-4e43-816a-eb60bbb77574_7TM%f%6H-KN%f%R4K-Q7H%f%BX-72%f%T2Q-H22%f%RV_Retail________VisioProRetail
243116_295b2c03-4b1c-4221-b292-1411f468bd02_NRK%f%T9-C8%f%GP2-XDY%f%XQ-YW%f%72K-MG9%f%2B_MAK___________VisioProVolume
243216_0594dc12-8444-4912-936a-747ca742dbdb_G98%f%Q2-B6%f%N77-CFH%f%9J-K8%f%24G-XQC%f%C4_MAKC2R________VisioProXVolume
243316_c76dbcbc-d71b-4f45-b5b3-b7494cb4e23e_Q8R%f%4N-GJ%f%CPG-CF3%f%2R-JF%f%CYR-K4T%f%F3_Retail________VisioStdRetail
243416_44151c2d-c398-471f-946f-7660542e3369_XNC%f%JB-YY%f%883-JRW%f%64-DP%f%XMX-JXC%f%R6_MAK___________VisioStdVolume
243516_1d1c6879-39a3-47a5-9a6d-aceefa6a289d_B2H%f%TN-JP%f%H8C-J6Y%f%6V-HC%f%HKB-43M%f%GT_MAKC2R________VisioStdXVolume
243616_cacaa1bf-da53-4c3b-9700-11738ef1c2a5_P8K%f%82-NQ%f%7GG-JKY%f%8T-6V%f%HVY-88G%f%GD_Retail________WordRetail
243716_c3000759-551f-4f4a-bcac-a4b42cbf1de2_YHM%f%WC-YN%f%6V9-WJP%f%XD-3W%f%QKP-TMV%f%CV_MAK___________WordVolume
243816_518687bd-dc55-45b9-8fa6-f918e1082e83_WRY%f%J6-G3%f%NP7-7VH%f%94-8X%f%7KP-JB7%f%HC_Retail________Access2019Retail
243916_385b91d6-9c2c-4a2e-86b5-f44d44a48c5f_6FW%f%HX-NK%f%YXK-BW3%f%4Q-7X%f%C9F-Q9P%f%X7_MAK-AE________Access2019Volume
244016_22e6b96c-1011-4cd5-8b35-3c8fb6366b86_FGQ%f%NJ-JW%f%JCG-7Q8%f%MG-RM%f%RGJ-9TQ%f%VF_PrepidBypass__AccessRuntime2019Retail
244116_c201c2b7-02a1-41a8-b496-37c72910cd4a_KBP%f%NW-64%f%CMM-8KW%f%CB-23%f%F44-8B7%f%HM_Retail________Excel2019Retail
244216_05cb4e1d-cc81-45d5-a769-f34b09b9b391_8NT%f%4X-GQ%f%MCK-62X%f%4P-TW%f%6QP-YKP%f%YF_MAK-AE________Excel2019Volume
244316_7fe09eef-5eed-4733-9a60-d7019df11cac_QBN%f%2Y-9B%f%284-9KW%f%78-K4%f%8PB-R62%f%YT_Retail________HomeBusiness2019Retail
244416_4539aa2c-5c31-4d47-9139-543a868e5741_XNW%f%PM-32%f%XQC-Y7Q%f%JC-QG%f%GBV-YY7%f%JK_Retail________HomeStudent2019Retail
244516_20e359d5-927f-47c0-8a27-38adbdd27124_WR4%f%3D-NM%f%WQQ-HCQ%f%R2-VK%f%XDR-37B%f%7H_Retail________Outlook2019Retail
244616_92a99ed8-2923-4cb7-a4c5-31da6b0b8cf3_RN3%f%QB-GT%f%6D7-YB3%f%VH-F3%f%RPB-3GQ%f%YB_MAK-AE________Outlook2019Volume
244716_2747b731-0f1f-413e-a92d-386ec1277dd8_NMB%f%Y8-V3%f%CV7-BX6%f%K6-29%f%22Y-43M%f%7T_Retail________Personal2019Retail
244816_7e63cc20-ba37-42a1-822d-d5f29f33a108_HN2%f%7K-JH%f%J8R-7T7%f%KK-WJ%f%YC3-FM7%f%MM_Retail________PowerPoint2019Retail
244916_13c2d7bf-f10d-42eb-9e93-abf846785434_29G%f%NM-VM%f%33V-WR2%f%3K-HG%f%2DT-KTQ%f%YR_MAK-AE________PowerPoint2019Volume
245016_a3072b8f-adcc-4e75-8d62-fdeb9bdfae57_BN4%f%XJ-R9%f%DYY-96W%f%48-YK%f%8DM-MY7%f%PY_Retail________ProPlus2019Retail
245116_6755c7a7-4dfe-46f5-bce8-427be8e9dc62_T8Y%f%BN-4Y%f%V3X-KK2%f%4Q-QX%f%BD7-T3C%f%63_MAK-AE________ProPlus2019Volume
245216_1717c1e0-47d3-4899-a6d3-1022db7415e0_9NX%f%DK-MR%f%Y98-2VJ%f%V8-GF%f%73J-TQ9%f%FK_Retail________Professional2019Retail
245316_0d270ef7-5aaf-4370-a372-bc806b96adb7_JDT%f%NC-PP%f%77T-T9H%f%2W-G4%f%J2J-VH8%f%JK_Retail________ProjectPro2019Retail
245416_d4ebadd6-401b-40d5-adf4-a5d4accd72d1_TBX%f%BD-FN%f%WKJ-WRH%f%BD-KB%f%PHH-XD9%f%F2_MAK-AE________ProjectPro2019Volume
245516_bb7ffe5f-daf9-4b79-b107-453e1c8427b5_R3J%f%NT-8P%f%BDP-MTW%f%CK-VD%f%2V8-HMK%f%F9_Retail________ProjectStd2019Retail
245616_fdaa3c03-dc27-4a8d-8cbf-c3d843a28ddc_RBR%f%FX-MQ%f%NDJ-4XF%f%HF-7Q%f%VDR-JHX%f%GC_MAK-AE________ProjectStd2019Volume
245716_f053a7c7-f342-4ab8-9526-a1d6e5105823_4QC%f%36-NW%f%3YH-D2Y%f%9D-RJ%f%PC7-VVB%f%9D_Retail________Publisher2019Retail
245816_40055495-be00-444e-99cc-07446729b53e_K8F%f%2D-NB%f%M32-BF2%f%6V-YC%f%KFJ-29Y%f%9W_MAK-AE________Publisher2019Volume
245916_b639e55c-8f3e-47fe-9761-26c6a786ad6b_JBD%f%KF-6N%f%CD6-49K%f%3G-2T%f%V79-BKP%f%73_Retail________SkypeforBusiness2019Retail
246016_15a430d4-5e3f-4e6d-8a0a-14bf3caee4c7_9MN%f%Q7-YP%f%Q3B-6WJ%f%XM-G8%f%3T3-CBB%f%DK_MAK-AE________SkypeforBusiness2019Volume
246116_f88cfdec-94ce-4463-a969-037be92bc0e7_N97%f%22-BV%f%9H6-WTJ%f%TT-FP%f%B93-978%f%MK_PrepidBypass__SkypeforBusinessEntry2019Retail
246216_fdfa34dd-a472-4b85-bee6-cf07bf0aaa1c_NDG%f%VM-MD%f%27H-2XH%f%VC-KD%f%DX2-YKP%f%74_Retail________Standard2019Retail
246316_beb5065c-1872-409e-94e2-403bcfb6a878_NT3%f%V6-XM%f%BK7-Q66%f%MF-VM%f%KR4-FC3%f%3M_MAK-AE________Standard2019Volume
246416_a6f69d68-5590-4e02-80b9-e7233dff204e_2NW%f%VW-QG%f%F4T-9CP%f%MB-WY%f%DQ9-7XP%f%79_Retail________VisioPro2019Retail
246516_f41abf81-f409-4b0d-889d-92b3e3d7d005_33Y%f%F4-GN%f%CQ3-J6G%f%DM-J6%f%7P3-FM7%f%QP_MAK-AE________VisioPro2019Volume
246616_4a582021-18c2-489f-9b3d-5186de48f1cd_263%f%WK-3N%f%797-7R4%f%37-28%f%BKG-3V8%f%M8_Retail________VisioStd2019Retail
246716_933ed0e3-747d-48b0-9c2c-7ceb4c7e473d_BGN%f%HX-QT%f%PRJ-F9C%f%9G-R8%f%QQG-8T2%f%7F_MAK-AE________VisioStd2019Volume
246816_72cee1c2-3376-4377-9f25-4024b6baadf8_JXR%f%8H-NJ%f%3MK-X66%f%W8-78%f%CWD-QRV%f%R2_Retail________Word2019Retail
246916_fe5fe9d5-3b06-4015-aa35-b146f85c4709_9F3%f%6R-PN%f%VHH-3DX%f%GQ-7C%f%D2H-R9D%f%3V_MAK-AE________Word2019Volume
247016_f634398e-af69-48c9-b256-477bea3078b5_P28%f%6B-N3%f%XYP-36Q%f%RQ-29%f%CMP-RVX%f%9M_Retail________Access2021Retail
247116_ae17db74-16b0-430b-912f-4fe456e271db_JBH%f%3N-P9%f%7FP-FRT%f%JD-MG%f%K2C-VFW%f%G6_MAK-AE________Access2021Volume
247216_fb099c19-d48b-4a2f-a160-4383011060aa_V6Q%f%FB-7N%f%7G9-PF7%f%W9-M8%f%FQM-MY8%f%G9_Retail________Excel2021Retail
247316_9da1ecdb-3a62-4273-a234-bf6d43dc0778_WNY%f%R4-KM%f%R9H-KVC%f%8W-7H%f%J8B-K79%f%DQ_MAK-AE________Excel2021Volume
247416_0e878942-3ba1-48ee-a215-f64d10a9f97b_QV2%f%VN-37%f%WPX-DHH%f%4K-B8%f%2H6-PDP%f%3T_Retail1_______HomeBusiness2021Retail
247516_9e7d5312-95fc-4443-a551-69c20624ec6b_3QN%f%G6-8F%f%JTH-88B%f%F9-KB%f%BVM-JMB%f%78_Retail________HomeStudent2021Retail
247616_279706f4-3a4b-4877-949b-f8c299cf0cc5_NB2%f%TQ-3Y%f%79C-77C%f%6M-QM%f%Y7H-7QY%f%8P_Retail________OneNote2021Retail
247716_ecea2cfa-d406-4a7f-be0d-c6163250d126_4NC%f%WR-9V%f%92Y-34V%f%B2-RP%f%THR-YTG%f%R7_Retail________Outlook2021Retail
247816_45bf67f9-0fc8-4335-8b09-9226cef8a576_JQ9%f%MJ-QY%f%N6B-67P%f%X9-GY%f%FVY-QJ6%f%TB_MAK-AE________Outlook2021Volume
247916_8f89391e-eedb-429d-af90-9d36fbf94de6_RRR%f%YB-DN%f%749-GCP%f%W4-9H%f%6VK-HCH%f%PT_Retail________Personal2021Retail
248016_c9bf5e86-f5e3-4ac6-8d52-e114a604d7bf_3KX%f%XQ-PV%f%N2C-8P7%f%YY-HC%f%V88-GVM%f%96_Retail1_______PowerPoint2021Retail
248116_716f2434-41b6-4969-ab73-e61e593a3875_39G%f%2N-3B%f%D9C-C4X%f%CM-BD%f%4QG-FVY%f%DY_MAK-AE________PowerPoint2021Volume
248216_c2f04adf-a5de-45c5-99a5-f5fddbda74a8_8WX%f%TP-MN%f%628-KY4%f%4G-VJ%f%WCK-C7P%f%CF_Retail________ProPlus2021Retail
248316_3f180b30-9b05-4fe2-aa8d-0c1c4790f811_RNH%f%JY-DT%f%FXW-HW9%f%F8-49%f%82D-MD2%f%CW_MAK-AE1_______ProPlus2021Volume
248416_96097a68-b5c5-4b19-8600-2e8d6841a0db_JRJ%f%NJ-33%f%M7C-R73%f%X3-P9%f%XF7-R9F%f%6M_MAK-AE________ProPlusSPLA2021Volume
248516_711e48a6-1a79-4b00-af10-73f4ca3aaac4_DJP%f%HV-NC%f%JV6-GWP%f%T6-K2%f%6JX-C7P%f%BG_Retail________Professional2021Retail
248616_3747d1d5-55a8-4bc3-b53d-19fff1913195_QKH%f%NX-M9%f%GGH-T3Q%f%MW-YP%f%K4Q-QRW%f%MV_Retail________ProjectPro2021Retail
248716_17739068-86c4-4924-8633-1e529abc7efc_HVC%f%34-CV%f%NPG-RVC%f%MT-X2%f%JRF-CR7%f%RK_MAK-AE1_______ProjectPro2021Volume
248816_4ea64dca-227c-436b-813f-b6624be2d54c_2B9%f%6V-X9%f%NJY-WFB%f%RC-Q8%f%MP2-7CH%f%RR_Retail________ProjectStd2021Retail
248916_84313d1e-47c8-4e27-8ced-0476b7ee46c4_3CN%f%QX-T3%f%4TY-99R%f%H4-C4%f%YD2-KW6%f%WH_MAK-AE________ProjectStd2021Volume
249016_b769b746-53b1-4d89-8a68-41944dafe797_CDN%f%FG-77%f%T8D-VKQ%f%JX-B7%f%KT3-KK2%f%8V_Retail1_______Publisher2021Retail
249116_a0234cfe-99bd-4586-a812-4f296323c760_2KX%f%JH-3N%f%HTW-RDB%f%PX-QF%f%RXJ-MTG%f%XF_MAK-AE________Publisher2021Volume
249216_c3fb48b2-1fd4-4dc8-af39-819edf194288_DVB%f%XN-HF%f%T43-CVP%f%RQ-J8%f%9TF-VMM%f%HG_Retail________SkypeforBusiness2021Retail
249316_6029109c-ceb8-4ee5-b324-f8eb2981e99a_R3F%f%CY-NH%f%GC7-CBP%f%VP-8Q%f%934-YTG%f%XG_MAK-AE________SkypeforBusiness2021Volume
249416_9e7e7b8e-a0e7-467b-9749-d0de82fb7297_HXN%f%XB-J4%f%JGM-TCF%f%44-2X%f%2CV-FJV%f%VH_Retail________Standard2021Retail
249516_223a60d8-9002-4a55-abac-593f5b66ca45_2CJ%f%N4-C9%f%XK2-HFP%f%Q6-YH%f%498-82T%f%XH_MAK-AE________Standard2021Volume
249616_b99ba8c4-e257-4b70-a31a-8bd308ce7073_BQW%f%DW-NJ%f%9YF-P7Y%f%79-H6%f%DCT-MKQ%f%9C_MAK-AE________StandardSPLA2021Volume
249716_814014d3-c30b-4f63-a493-3708e0dc0ba8_T6P%f%26-NJ%f%VBR-76B%f%K8-WB%f%CDY-TX3%f%BC_Retail________VisioPro2021Retail
249816_c590605a-a08a-4cc7-8dc2-f1ffb3d06949_JNK%f%BX-MH%f%9P4-K8Y%f%YV-8C%f%G2Y-VQ2%f%C8_MAK-AE________VisioPro2021Volume
249916_16d43989-a5ef-47e2-9ff1-272784caee24_89N%f%YY-KB%f%93R-7X2%f%2F-93%f%QDF-DJ6%f%YM_Retail________VisioStd2021Retail
250016_d55f90ee-4ba2-4d02-b216-1300ee50e2af_BW4%f%3B-4P%f%NFP-V63%f%7F-23%f%TR2-J47%f%TX_MAK-AE________VisioStd2021Volume
250116_fb33d997-4aa3-494e-8b58-03e9ab0f181d_VNC%f%C4-CJ%f%QVK-BKX%f%34-77%f%Y8H-CYX%f%MR_Retail________Word2021Retail
250216_0c728382-95fb-4a55-8f12-62e605f91727_BJG%f%97-NW%f%3GM-8QQ%f%Q7-FH%f%76G-686%f%XM_MAK-AE________Word2021Volume
250316_6337137e-7c07-4197-8986-bece6a76fc33_2P3%f%C9-BQ%f%NJH-VCV%f%PH-YD%f%Y6M-43J%f%PQ_Subscription__O365BusinessRetail
250416_2f5c71b4-5b7a-4005-bb68-f9fac26f2ea3_W62%f%NQ-26%f%7QR-RTF%f%74-PF%f%2MH-JQM%f%TH_Subscription__O365EduCloudRetail
250516_537ea5b5-7d50-4876-bd38-a53a77caca32_J2W%f%28-TN%f%9C8-26P%f%WV-F7%f%J4G-72X%f%CB_Subscription1_O365HomePremRetail
250616_149dbce7-a48e-44db-8364-a53386cd4580_2N3%f%82-D6%f%PKK-QTX%f%4D-2J%f%JYK-M96%f%P2_Subscription1_O365ProPlusRetail
250716_bacd4614-5bef-4a5e-bafc-de4c788037a2_HN8%f%JP-87%f%TQJ-PBF%f%3P-Y6%f%6KC-W2K%f%9V_Subscription1_O365SmallBusPremRetail
2508) do (
2509for /f "tokens=1-5 delims=_" %%A in ("%%#") do (
2510if %1==getinfo if %oVer%==%%A if "%2"=="%%E" (set _key=%%C& set _actid=%%B& set _allactid=!_allactid! %%B&set _lic=%%D)
2511
2512if %1==getmsiprod if %oVer%==%%A (find /i "%%E" %msitemp% %nul% && (if defined _oIds (set _oIds=!_oIds! %%E) else (set _oIds=%%E)))
2513
2514)
2515)
2516exit /b
2517
2518::========================================================================================================================================
2519
2520:: This code is used to modify the timestamp value of sppc dll file in order to change checksums
2521:: It's done to lower the potential false positive detection by antivirus's. On each install, it will install a unique sppc dll file
2522
2523:oh_extractdll
2524
2525set b=
2526%psc% "$f=[io.file]::ReadAllText('!_batp!') -split ':%_hook%\:.*';$bytes = [Con%b%vert]::FromBas%b%e64String($f[1]); $PePath='%1'; $m=[io.file]::ReadAllText('!_batp!') -split ':hexedit\:.*';iex ($m[1]);" %nul2% | find /i "Error found" %nul1% && set hasherror=1
2527exit /b
2528
2529:hexedit:
2530# Use a MemoryStream to perform operations on the bytes
2531$MemoryStream = New-Object System.IO.MemoryStream
2532$Writer = New-Object System.IO.BinaryWriter($MemoryStream)
2533$Writer.Write($bytes)
2534
2535# Define dynamic assembly, module, and type
2536$AssemblyBuilder = [AppDomain]::CurrentDomain.DefineDynamicAssembly(4, 1)
2537$ModuleBuilder = $AssemblyBuilder.DefineDynamicModule(2, $False)
2538$TypeBuilder = $ModuleBuilder.DefineType(0)
2539
2540# Define P/Invoke method
2541[void]$TypeBuilder.DefinePInvokeMethod('MapFileAndCheckSum', 'imagehlp.dll', 'Public, Static', [Reflection.CallingConventions]::Standard, [int], @([string], [int].MakeByRefType(), [int].MakeByRefType()), [Runtime.InteropServices.CallingConvention]::Winapi, [Runtime.InteropServices.CharSet]::Auto)
2542
2543# Create the type
2544$Imagehlp = $TypeBuilder.CreateType()
2545
2546# Offset information
2547$timestampOffset = 136
2548$exportTimestampOffset = 3076
2549$checkSumOffset = 216
2550
2551# Calculate timestamp
2552$currentTimestamp = [DateTime]::UtcNow
2553$unixTimestamp = [int]($currentTimestamp - (Get-Date -Year 1970 -Month 1 -Day 1 -Hour 0 -Minute 0 -Second 0)).TotalSeconds
2554
2555# Change timestamps
2556$Writer.BaseStream.Position = $timestampOffset
2557$Writer.Write($unixTimestamp)
2558
2559$Writer.BaseStream.Position = $exportTimestampOffset
2560$Writer.Write($unixTimestamp)
2561
2562$Writer.Flush()
2563
2564# Write the current state of the MemoryStream to a temporary file
2565$tempFilePath = [System.IO.Path]::Combine($env:windir, "Temp", [System.IO.Path]::GetRandomFileName())
2566[System.IO.File]::WriteAllBytes($tempFilePath, $MemoryStream.ToArray())
2567
2568# Update hash using the temporary file
2569[int]$HeaderSum = 0
2570[int]$CheckSum = 0
2571[void]$Imagehlp::MapFileAndCheckSum($tempFilePath, [ref]$HeaderSum, [ref]$CheckSum)
2572
2573# If the checksums don't match, update the checksum in the MemoryStream
2574if ($HeaderSum -ne $CheckSum) {
2575 $Writer.BaseStream.Position = $checkSumOffset
2576 $Writer.Write($CheckSum)
2577 $Writer.Flush()
2578} else {
2579 Write-host Error found
2580}
2581
2582# Delete the temporary file
2583Remove-Item -Path $tempFilePath -Force
2584
2585# Get the modified bytes
2586$modifiedBytes = $MemoryStream.ToArray()
2587
2588# Write the modified bytes to the final file
2589[System.IO.File]::WriteAllBytes($PePath, $modifiedBytes)
2590
2591[void]$Imagehlp::MapFileAndCheckSum($PePath, [ref]$HeaderSum, [ref]$CheckSum)
2592if ($HeaderSum -ne $CheckSum) {
2593 Write-host Error found
2594}
2595
2596$MemoryStream.Close()
2597:hexedit:
2598
2599::========================================================================================================================================
2600::
2601:: This below blocks of text is encoded in base64 format
2602:: The blocks in labels "sppc64.dll" and "sppc32.dll" contains below files
2603::
2604:: C6DF24DEEF2E83813DEE9C81DDD9793A3D60C117A4E8E231B82E32B3192927E7 *sppc64.dll
2605:: E6AC83560C19EC7EB868C50EA97EA0ED5632A397A9F43C17E24E6DE4A694D118 *sppc32.dll
2606::
2607:: The files are encoded in base64 to make MAS AIO version. Alternatively, you can use MAS separate files version
2608::
2609:: mass grave[.]dev/ohook
2610:: Here you can find the files source code and info on how to rebuild the identical sppc.dll files
2611::
2612:: stackoverflow.com/a/35335273
2613:: Here you can check how to extract sppc.dll files from base64
2614::
2615:: For any further question, feel free to contact us on mass grave[.]dev/contactus
2616::
2617::========================================================================================================================================
2618
2619:sppc32.dll:
2620TVqQAAMAAAAEAAAA//8AALgAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA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AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
2678AAAAAAAQAAAUAAAAOzBQMHEwfjBSMVoxAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
2679AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
2680AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
2681AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
2682:sppc32.dll:
2683
2684:========================================================================================================================================
2685
2686:sppc64.dll:
2687TVqQAAMAAAAEAAAA//8AALgAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAgAAAAA4fug4AtAnNIbgBTM0hVGhpcyBwcm9ncmFtIGNhbm5vdCBiZSBydW4gaW4gRE9TIG1vZGUuDQ0KJAAAAAAAAABQRQAAZIYHAMDc0GQAAAAAAAAAAPAA
2688L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AgADIAMAAyADMAIABBAG4AbwBtAGEAbABvAHUAcwAgAFMAbwBmAHQAdwBhAHIAZQAgAEQAZQB0AGUAcgBpAG8AcgBhAHQAaQBvAG4AIABDAG8AcgBwAG8AcgBhAHQAaQBvAG4A
2746AAA6AAkAAQBPAHIAaQBnAGkAbgBhAGwARgBpAGwAZQBuAGEAbQBlAAAAcwBwAHAAYwAuAGQAbABsAAAAAAAsAAYAAQBQAHIAbwBkAHUAYwB0AE4AYQBtAGUAAAAAAG8AaABvAG8AawAAADQACAABAFAAcgBvAGQAdQBjAHQAVgBlAHIAcwBpAG8AbgAAADAALgAzAC4A
2747MAAuADAAAABEAAAAAQBWAGEAcgBGAGkAbABlAEkAbgBmAG8AAAAAACQABAAAAFQAcgBhAG4AcwBsAGEAdABpAG8AbgAAAAAACQTkBAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
2748AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
2749:sppc64.dll:
2750
2751:+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
2752
1392:KMS38Activation 2753:KMS38Activation
2754
1393@setlocal DisableDelayedExpansion 2755@setlocal DisableDelayedExpansion
1394@echo off 2756@echo off
1395 2757
@@ -1402,10 +2764,6 @@ set _rem=0
1402:: To disable changing edition if current edition doesn't support KMS38 activation, change the value to 1 from 0 or run the script with "/KMS38-NoEditionChange" parameter 2764:: To disable changing edition if current edition doesn't support KMS38 activation, change the value to 1 from 0 or run the script with "/KMS38-NoEditionChange" parameter
1403set _NoEditionChange=0 2765set _NoEditionChange=0
1404 2766
1405:: If value is changed in above lines or parameter is used then script will run in unattended mode
1406
1407
1408
1409::======================================================================================================================================== 2767::========================================================================================================================================
1410 2768
1411cls 2769cls
@@ -1431,21 +2789,25 @@ for %%A in (%_act% %_rem% %_NoEditionChange%) do (if "%%A"=="1" set _unattended=
1431 2789
1432::======================================================================================================================================== 2790::========================================================================================================================================
1433 2791
1434set winbuild=1 2792set "nul1=1>nul"
2793set "nul2=2>nul"
2794set "nul6=2^>nul"
1435set "nul=>nul 2>&1" 2795set "nul=>nul 2>&1"
2796
1436set psc=powershell.exe 2797set psc=powershell.exe
2798set winbuild=1
1437for /f "tokens=6 delims=[]. " %%G in ('ver') do set winbuild=%%G 2799for /f "tokens=6 delims=[]. " %%G in ('ver') do set winbuild=%%G
1438 2800
1439set _NCS=1 2801set _NCS=1
1440if %winbuild% LSS 10586 set _NCS=0 2802if %winbuild% LSS 10586 set _NCS=0
1441if %winbuild% GEQ 10586 reg query "HKCU\Console" /v ForceV2 2>nul | find /i "0x0" 1>nul && (set _NCS=0) 2803if %winbuild% GEQ 10586 reg query "HKCU\Console" /v ForceV2 %nul2% | find /i "0x0" %nul1% && (set _NCS=0)
1442 2804
1443if %_NCS% EQU 1 ( 2805if %_NCS% EQU 1 (
1444for /F %%a in ('echo prompt $E ^| cmd') do set "esc=%%a" 2806for /F %%a in ('echo prompt $E ^| cmd') do set "esc=%%a"
1445set "Red="41;97m"" 2807set "Red="41;97m""
1446set "Gray="100;97m"" 2808set "Gray="100;97m""
1447set "Green="42;97m"" 2809set "Green="42;97m""
1448set "Magenta="45;97m"" 2810set "Blue="44;97m""
1449set "_White="40;37m"" 2811set "_White="40;37m""
1450set "_Green="40;92m"" 2812set "_Green="40;92m""
1451set "_Yellow="40;93m"" 2813set "_Yellow="40;93m""
@@ -1453,7 +2815,7 @@ set "_Yellow="40;93m""
1453set "Red="Red" "white"" 2815set "Red="Red" "white""
1454set "Gray="Darkgray" "white"" 2816set "Gray="Darkgray" "white""
1455set "Green="DarkGreen" "white"" 2817set "Green="DarkGreen" "white""
1456set "Magenta="Darkmagenta" "white"" 2818set "Blue="Blue" "white""
1457set "_White="Black" "Gray"" 2819set "_White="Black" "Gray""
1458set "_Green="Black" "Green"" 2820set "_Green="Black" "Green""
1459set "_Yellow="Black" "Yellow"" 2821set "_Yellow="Black" "Yellow""
@@ -1462,14 +2824,21 @@ set "_Yellow="Black" "Yellow""
1462set _k38= 2824set _k38=
1463set "nceline=echo: &echo ==== ERROR ==== &echo:" 2825set "nceline=echo: &echo ==== ERROR ==== &echo:"
1464set "eline=echo: &call :dk_color %Red% "==== ERROR ====" &echo:" 2826set "eline=echo: &call :dk_color %Red% "==== ERROR ====" &echo:"
1465if %~z0 GEQ 200000 (set "_exitmsg=Go back") else (set "_exitmsg=Exit") 2827if %~z0 GEQ 200000 (
2828set "_exitmsg=Go back"
2829set "_fixmsg=Go back to Main Menu, select Troubleshoot and run Fix Licensing option."
2830) else (
2831set "_exitmsg=Exit"
2832set "_fixmsg=In MAS folder, run Troubleshoot script and select Fix Licensing option."
2833)
2834
1466set "specific_kms=SOFTWARE\Microsoft\Windows NT\CurrentVersion\SoftwareProtectionPlatform\55c92734-d682-4d71-983e-d6ec3f16059f" 2835set "specific_kms=SOFTWARE\Microsoft\Windows NT\CurrentVersion\SoftwareProtectionPlatform\55c92734-d682-4d71-983e-d6ec3f16059f"
1467 2836
1468::======================================================================================================================================== 2837::========================================================================================================================================
1469 2838
1470if %winbuild% LSS 14393 ( 2839if %winbuild% LSS 14393 (
1471%eline% 2840%eline%
1472echo Unsupported OS version detected. 2841echo Unsupported OS version detected [%winbuild%].
1473echo KMS38 Activation is supported for Windows 10/11/Server, build 14393 and later. 2842echo KMS38 Activation is supported for Windows 10/11/Server, build 14393 and later.
1474goto dk_done 2843goto dk_done
1475) 2844)
@@ -1529,7 +2898,7 @@ goto :k_menu
1529:k_menu2 2898:k_menu2
1530 2899
1531cls 2900cls
1532mode 102, 33 2901mode 108, 34
1533title KMS38 Activation 2902title KMS38 Activation
1534 2903
1535echo: 2904echo:
@@ -1578,7 +2947,7 @@ if exist "%SystemRoot%\Servicing\Packages\Microsoft-Windows-Server*EvalEdition~*
1578if exist "%SystemRoot%\Servicing\Packages\Microsoft-Windows-Server*EvalCorEdition~*.mum" set _eval=1 & set _evalserv=1 2947if exist "%SystemRoot%\Servicing\Packages\Microsoft-Windows-Server*EvalCorEdition~*.mum" set _eval=1 & set _evalserv=1
1579 2948
1580if defined _eval ( 2949if defined _eval (
1581reg query "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion" /v EditionID 2>nul | find /i "Eval" 1>nul && ( 2950reg query "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion" /v EditionID %nul2% | find /i "Eval" %nul1% && (
1582%eline% 2951%eline%
1583echo [%winos% ^| %winbuild%] 2952echo [%winos% ^| %winbuild%]
1584if defined _evalserv ( 2953if defined _evalserv (
@@ -1590,7 +2959,7 @@ echo Evaluation Editions cannot be activated.
1590echo You need to install full version of %winos% 2959echo You need to install full version of %winos%
1591echo: 2960echo:
1592echo Download it from here, 2961echo Download it from here,
1593echo https://massgrave.dev/genuine-installation-media.html 2962echo https://%mas%/genuine-installation-media.html
1594) 2963)
1595goto dk_done 2964goto dk_done
1596) 2965)
@@ -1609,7 +2978,7 @@ if not exist "!_work!\clipup.exe" (
1609echo clipup.exe doesn't exist in Server Cor/Acor [No GUI] version. 2978echo clipup.exe doesn't exist in Server Cor/Acor [No GUI] version.
1610echo It's required for KMS38 Activation. 2979echo It's required for KMS38 Activation.
1611echo Check below page on how to activate it. 2980echo Check below page on how to activate it.
1612echo https://massgrave.dev/kms38.html 2981echo https://%mas%/kms38.html
1613goto dk_done 2982goto dk_done
1614) 2983)
1615) 2984)
@@ -1619,14 +2988,23 @@ goto dk_done
1619:: Check SKU value / Check in multiple places to find Edition change corruption 2988:: Check SKU value / Check in multiple places to find Edition change corruption
1620 2989
1621set osSKU= 2990set osSKU=
1622set regSKU= 2991set slcSKU=
1623set wmiSKU= 2992set wmiSKU=
2993set regSKU=
2994
2995if %winbuild% GEQ 14393 (set info=Kernel-BrandingInfo) else (set info=Kernel-ProductInfo)
2996set d1=%ref% [void]$TypeBuilder.DefinePInvokeMethod('SLGetWindowsInformationDWORD', 'slc.dll', 'Public, Static', 1, [int], @([String], [int].MakeByRefType()), 1, 3);
2997set d1=%d1% $Sku = 0; [void]$TypeBuilder.CreateType()::SLGetWindowsInformationDWORD('%info%', [ref]$Sku); $Sku
2998for /f "delims=" %%s in ('"%psc% %d1%"') do if not errorlevel 1 (set slcSKU=%%s)
2999if "%slcSKU%"=="0" set slcSKU=
3000if 1%slcSKU% NEQ +1%slcSKU% set slcSKU=
1624 3001
1625for /f "tokens=3 delims=." %%a in ('reg query "HKLM\SYSTEM\CurrentControlSet\Control\ProductOptions" /v OSProductPfn 2^>nul') do set "regSKU=%%a" 3002for /f "tokens=3 delims=." %%a in ('reg query "HKLM\SYSTEM\CurrentControlSet\Control\ProductOptions" /v OSProductPfn %nul6%') do set "regSKU=%%a"
1626if %_wmic% EQU 1 for /f "tokens=2 delims==" %%a in ('"wmic Path Win32_OperatingSystem Get OperatingSystemSKU /format:LIST" 2^>nul') do if not errorlevel 1 set "wmiSKU=%%a" 3003if %_wmic% EQU 1 for /f "tokens=2 delims==" %%a in ('"wmic Path Win32_OperatingSystem Get OperatingSystemSKU /format:LIST" %nul6%') do if not errorlevel 1 set "wmiSKU=%%a"
1627if %_wmic% EQU 0 for /f "tokens=1" %%a in ('%psc% "([WMI]'Win32_OperatingSystem=@').OperatingSystemSKU" 2^>nul') do if not errorlevel 1 set "wmiSKU=%%a" 3004if %_wmic% EQU 0 for /f "tokens=1" %%a in ('%psc% "([WMI]'Win32_OperatingSystem=@').OperatingSystemSKU" %nul6%') do if not errorlevel 1 set "wmiSKU=%%a"
1628 3005
1629set osSKU=%wmiSKU% 3006set osSKU=%slcSKU%
3007if not defined osSKU set osSKU=%wmiSKU%
1630if not defined osSKU set osSKU=%regSKU% 3008if not defined osSKU set osSKU=%regSKU%
1631 3009
1632if not defined osSKU ( 3010if not defined osSKU (
@@ -1642,15 +3020,16 @@ set error=
1642cls 3020cls
1643echo: 3021echo:
1644for /f "skip=2 tokens=2*" %%a in ('reg query "HKLM\SYSTEM\CurrentControlSet\Control\Session Manager\Environment" /v PROCESSOR_ARCHITECTURE') do set arch=%%b 3022for /f "skip=2 tokens=2*" %%a in ('reg query "HKLM\SYSTEM\CurrentControlSet\Control\Session Manager\Environment" /v PROCESSOR_ARCHITECTURE') do set arch=%%b
1645echo Checking OS Info [%winos% ^| %winbuild% ^| %arch%] 3023for /f "tokens=6-7 delims=[]. " %%i in ('ver') do if "%%j"=="" (set fullbuild=%%i) else (set fullbuild=%%i.%%j)
3024echo Checking OS Info [%winos% ^| %fullbuild% ^| %arch%]
1646 3025
1647::======================================================================================================================================== 3026::========================================================================================================================================
1648 3027
1649:: Check Windows Script Host 3028:: Check Windows Script Host
1650 3029
1651set _WSH=1 3030set _WSH=1
1652reg query "HKCU\SOFTWARE\Microsoft\Windows Script Host\Settings" /v Enabled 2>nul | find /i "0x0" 1>nul && (set _WSH=0) 3031reg query "HKCU\SOFTWARE\Microsoft\Windows Script Host\Settings" /v Enabled %nul2% | find /i "0x0" %nul1% && (set _WSH=0)
1653reg query "HKLM\SOFTWARE\Microsoft\Windows Script Host\Settings" /v Enabled 2>nul | find /i "0x0" 1>nul && (set _WSH=0) 3032reg query "HKLM\SOFTWARE\Microsoft\Windows Script Host\Settings" /v Enabled %nul2% | find /i "0x0" %nul1% && (set _WSH=0)
1654 3033
1655if %_WSH% EQU 0 ( 3034if %_WSH% EQU 0 (
1656reg add "HKLM\Software\Microsoft\Windows Script Host\Settings" /v Enabled /t REG_DWORD /d 1 /f %nul% 3035reg add "HKLM\Software\Microsoft\Windows Script Host\Settings" /v Enabled /t REG_DWORD /d 1 /f %nul%
@@ -1686,7 +3065,6 @@ set key=
1686set pkey= 3065set pkey=
1687set altkey= 3066set altkey=
1688set changekey= 3067set changekey=
1689set curedition=
1690set altedition= 3068set altedition=
1691 3069
1692if defined applist call :kms38data getkey 3070if defined applist call :kms38data getkey
@@ -1696,6 +3074,14 @@ if defined applist if not defined key call :kms38fallback
1696 3074
1697if defined altkey (set key=%altkey%&set changekey=1) 3075if defined altkey (set key=%altkey%&set changekey=1)
1698 3076
3077set /a UBR=0
3078if %osSKU%==191 if defined altkey if defined altedition (
3079for /f "skip=2 tokens=2*" %%a in ('reg query "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion" /v UBR 2^>nul') do if not errorlevel 1 set /a UBR=%%b
3080if %winbuild% GEQ 19044 if !UBR! LSS 2788 (
3081call :dk_color %Blue% "Windows must to be updated to build 19044.2788 or higher for IotEnterpriseS KMS38 activation."
3082)
3083)
3084
1699if not defined key if defined notfoundaltactID ( 3085if not defined key if defined notfoundaltactID (
1700call :dk_color %Red% "Checking Alternate Edition For KMS38 [%altedition% Activation ID Not Found]" 3086call :dk_color %Red% "Checking Alternate Edition For KMS38 [%altedition% Activation ID Not Found]"
1701) 3087)
@@ -1705,7 +3091,7 @@ if not defined key if not defined _gvlk (
1705echo [%winos% ^| %winbuild% ^| SKU:%osSKU%] 3091echo [%winos% ^| %winbuild% ^| SKU:%osSKU%]
1706echo Unable to find this product in the supported product list. 3092echo Unable to find this product in the supported product list.
1707echo Make sure you are using updated version of the script. 3093echo Make sure you are using updated version of the script.
1708echo https://massgrave.dev 3094echo https://%mas%
1709echo: 3095echo:
1710goto dk_done 3096goto dk_done
1711) 3097)
@@ -1716,14 +3102,14 @@ goto dk_done
1716 3102
1717echo: 3103echo:
1718if defined changekey ( 3104if defined changekey (
1719call :dk_color %Magenta% "[%altedition%] Edition product key will be used to enable KMS38 activation." 3105call :dk_color %Blue% "[%altedition%] Edition product key will be used to enable KMS38 activation."
1720echo: 3106echo:
1721) 3107)
1722 3108
1723set _partial= 3109set _partial=
1724if not defined key ( 3110if not defined key (
1725if %_wmic% EQU 1 for /f "tokens=2 delims==" %%# in ('wmic path SoftwareLicensingProduct where "ApplicationID='55c92734-d682-4d71-983e-d6ec3f16059f' and PartialProductKey<>null" Get PartialProductKey /value 2^>nul') do set "_partial=%%#" 3111if %_wmic% EQU 1 for /f "tokens=2 delims==" %%# in ('wmic path SoftwareLicensingProduct where "ApplicationID='55c92734-d682-4d71-983e-d6ec3f16059f' and PartialProductKey<>null" Get PartialProductKey /value %nul6%') do set "_partial=%%#"
1726if %_wmic% EQU 0 for /f "tokens=2 delims==" %%# in ('%psc% "(([WMISEARCHER]'SELECT PartialProductKey FROM SoftwareLicensingProduct WHERE ApplicationID=''55c92734-d682-4d71-983e-d6ec3f16059f'' AND PartialProductKey IS NOT NULL').Get()).PartialProductKey | %% {echo ('PartialProductKey='+$_)}" 2^>nul') do set "_partial=%%#" 3112if %_wmic% EQU 0 for /f "tokens=2 delims==" %%# in ('%psc% "(([WMISEARCHER]'SELECT PartialProductKey FROM SoftwareLicensingProduct WHERE ApplicationID=''55c92734-d682-4d71-983e-d6ec3f16059f'' AND PartialProductKey IS NOT NULL').Get()).PartialProductKey | %% {echo ('PartialProductKey='+$_)}" %nul6%') do set "_partial=%%#"
1727call echo Checking Installed Product Key [Partial Key - %%_partial%%] [Volume:GVLK] 3113call echo Checking Installed Product Key [Partial Key - %%_partial%%] [Volume:GVLK]
1728) 3114)
1729 3115
@@ -1742,7 +3128,7 @@ echo Installing KMS Client Setup Key [%key%] [Successful]
1742) else ( 3128) else (
1743call :dk_color %Red% "Installing KMS Client Setup Key [%key%] [Failed] !error_code!" 3129call :dk_color %Red% "Installing KMS Client Setup Key [%key%] [Failed] !error_code!"
1744if not defined error ( 3130if not defined error (
1745call :dk_color %Magenta% "In MAS, Goto Troubleshoot and run Fix Licensing option." 3131call :dk_color %Blue% "%_fixmsg%"
1746set showfix=1 3132set showfix=1
1747) 3133)
1748set error=1 3134set error=1
@@ -1754,8 +3140,8 @@ set error=1
1754:: Check activation ID for setting specific KMS host 3140:: Check activation ID for setting specific KMS host
1755 3141
1756set app= 3142set app=
1757if %_wmic% EQU 1 for /f "tokens=2 delims==" %%a in ('"wmic path SoftwareLicensingProduct where (ApplicationID='55c92734-d682-4d71-983e-d6ec3f16059f' and Description like '%%KMSCLIENT%%' and PartialProductKey is not NULL) get ID /VALUE" 2^>nul') do call set "app=%%a" 3143if %_wmic% EQU 1 for /f "tokens=2 delims==" %%a in ('"wmic path SoftwareLicensingProduct where (ApplicationID='55c92734-d682-4d71-983e-d6ec3f16059f' and Description like '%%KMSCLIENT%%' and PartialProductKey is not NULL) get ID /VALUE" %nul6%') do call set "app=%%a"
1758if %_wmic% EQU 0 for /f "tokens=2 delims==" %%a in ('%psc% "(([WMISEARCHER]'SELECT ID FROM SoftwareLicensingProduct WHERE ApplicationID=''55c92734-d682-4d71-983e-d6ec3f16059f'' AND Description like ''%%KMSCLIENT%%'' AND PartialProductKey IS NOT NULL').Get()).ID | %% {echo ('ID='+$_)}" 2^>nul') do call set "app=%%a" 3144if %_wmic% EQU 0 for /f "tokens=2 delims==" %%a in ('%psc% "(([WMISEARCHER]'SELECT ID FROM SoftwareLicensingProduct WHERE ApplicationID=''55c92734-d682-4d71-983e-d6ec3f16059f'' AND Description like ''%%KMSCLIENT%%'' AND PartialProductKey IS NOT NULL').Get()).ID | %% {echo ('ID='+$_)}" %nul6%') do call set "app=%%a"
1759 3145
1760if not defined app ( 3146if not defined app (
1761call :dk_color %Red% "Checking Installed GVLK Activation ID [Not Found] Aborting..." 3147call :dk_color %Red% "Checking Installed GVLK Activation ID [Not Found] Aborting..."
@@ -1811,6 +3197,11 @@ goto :k_final
1811:: In some cases clipup -v -o method fails and in some cases service restart method fails as well 3197:: In some cases clipup -v -o method fails and in some cases service restart method fails as well
1812:: To maximize success rate and get better error details, script will install tickets two times (service restart + clipup -v -o) 3198:: To maximize success rate and get better error details, script will install tickets two times (service restart + clipup -v -o)
1813 3199
3200if not exist %SystemRoot%\system32\ClipUp.exe (
3201call :dk_color %Red% "Checking ClipUp.exe File [Not found, aborting the process]"
3202goto :k_final
3203)
3204
1814set "tdir=%ProgramData%\Microsoft\Windows\ClipSVC\GenuineTicket" 3205set "tdir=%ProgramData%\Microsoft\Windows\ClipSVC\GenuineTicket"
1815if not exist "%tdir%\" md "%tdir%\" %nul% 3206if not exist "%tdir%\" md "%tdir%\" %nul%
1816 3207
@@ -1820,7 +3211,7 @@ if exist "%ProgramData%\Microsoft\Windows\ClipSVC\Install\Migration\*" del /f /q
1820 3211
1821:: Signature value is as it is, it's not encoded 3212:: Signature value is as it is, it's not encoded
1822:: Session ID is in Base64 encoded format. It's decoded value is "OSMajorVersion=5;OSMinorVersion=1;OSPlatformId=2;PP=0;GVLKExp=2038-01-19T03:14:07Z;DownlevelGenuineState=1;" 3213:: Session ID is in Base64 encoded format. It's decoded value is "OSMajorVersion=5;OSMinorVersion=1;OSPlatformId=2;PP=0;GVLKExp=2038-01-19T03:14:07Z;DownlevelGenuineState=1;"
1823:: Check https://massgrave.dev/kms38.html#Manual_Activation to see how it's generated 3214:: Check mass grave[.]dev/kms38.html#Manual_Activation to see how it's generated
1824 3215
1825set "signature=C52iGEoH+1VqzI6kEAqOhUyrWuEObnivzaVjyef8WqItVYd/xGDTZZ3bkxAI9hTpobPFNJyJx6a3uriXq3HVd7mlXfSUK9ydeoUdG4eqMeLwkxeb6jQWJzLOz41rFVSMtBL0e+ycCATebTaXS4uvFYaDHDdPw2lKY8ADj3MLgsA=" 3216set "signature=C52iGEoH+1VqzI6kEAqOhUyrWuEObnivzaVjyef8WqItVYd/xGDTZZ3bkxAI9hTpobPFNJyJx6a3uriXq3HVd7mlXfSUK9ydeoUdG4eqMeLwkxeb6jQWJzLOz41rFVSMtBL0e+ycCATebTaXS4uvFYaDHDdPw2lKY8ADj3MLgsA="
1826set "sessionId=TwBTAE0AYQBqAG8AcgBWAGUAcgBzAGkAbwBuAD0ANQA7AE8AUwBNAGkAbgBvAHIAVgBlAHIAcwBpAG8AbgA9ADEAOwBPAFMAUABsAGEAdABmAG8AcgBtAEkAZAA9ADIAOwBQAFAAPQAwADsARwBWAEwASwBFAHgAcAA9ADIAMAAzADgALQAwADEALQAxADkAVAAwADMAOgAxADQAOgAwADcAWgA7AEQAbwB3AG4AbABlAHYAZQBsAEcAZQBuAHUAaQBuAGUAUwB0AGEAdABlAD0AMQA7AAAA" 3217set "sessionId=TwBTAE0AYQBqAG8AcgBWAGUAcgBzAGkAbwBuAD0ANQA7AE8AUwBNAGkAbgBvAHIAVgBlAHIAcwBpAG8AbgA9ADEAOwBPAFMAUABsAGEAdABmAG8AcgBtAEkAZAA9ADIAOwBQAFAAPQAwADsARwBWAEwASwBFAHgAcAA9ADIAMAAzADgALQAwADEALQAxADkAVAAwADMAOgAxADQAOgAwADcAWgA7AEQAbwB3AG4AbABlAHYAZQBsAEcAZQBuAHUAaQBuAGUAUwB0AGEAdABlAD0AMQA7AAAA"
@@ -1829,7 +3220,7 @@ set "sessionId=TwBTAE0AYQBqAG8AcgBWAGUAcgBzAGkAbwBuAD0ANQA7AE8AUwBNAGkAbgBvAHIAV
1829copy /y /b "%tdir%\GenuineTicket" "%tdir%\GenuineTicket.xml" %nul% 3220copy /y /b "%tdir%\GenuineTicket" "%tdir%\GenuineTicket.xml" %nul%
1830 3221
1831if not exist "%tdir%\GenuineTicket.xml" ( 3222if not exist "%tdir%\GenuineTicket.xml" (
1832call :dk_color %Red% "Generating GenuineTicket.xml [Failed]" 3223call :dk_color %Red% "Generating GenuineTicket.xml [Failed, aborting the process]"
1833if exist "%tdir%\Genuine*" del /f /q "%tdir%\Genuine*" %nul% 3224if exist "%tdir%\Genuine*" del /f /q "%tdir%\Genuine*" %nul%
1834goto :k_final 3225goto :k_final
1835) else ( 3226) else (
@@ -1844,10 +3235,10 @@ net stop sppsvc /y %nul%
1844net stop sppsvc /y %nul% 3235net stop sppsvc /y %nul%
1845net stop sppsvc /y %nul% 3236net stop sppsvc /y %nul%
1846 3237
1847sc query sppsvc | find /i "1 STOPPED" %nul% && ( 3238sc query sppsvc | find /i "STOPPED" %nul% && (
1848echo Stopping sppsvc Service [Successful] 3239echo Stopping sppsvc Service [Successful]
1849) || ( 3240) || (
1850call :dk_color %Red% "Stopping sppsvc Service [Failed]" 3241call :dk_color %Gray% "Stopping sppsvc Service [Failed]"
1851) 3242)
1852 3243
1853%_xmlexist% ( 3244%_xmlexist% (
@@ -1868,6 +3259,12 @@ clipup -v -o
1868 3259
1869set rebuildinfo= 3260set rebuildinfo=
1870 3261
3262if not exist %ProgramData%\Microsoft\Windows\ClipSVC\tokens.dat (
3263set error=1
3264set rebuildinfo=1
3265call :dk_color %Red% "Checking ClipSVC tokens.dat [Not Found]"
3266)
3267
1871%_xmlexist% ( 3268%_xmlexist% (
1872set error=1 3269set error=1
1873set rebuildinfo=1 3270set rebuildinfo=1
@@ -1882,7 +3279,7 @@ call :dk_color %Red% "Checking Ticket Migration [Failed]"
1882 3279
1883if defined applist if not defined showfix if defined rebuildinfo ( 3280if defined applist if not defined showfix if defined rebuildinfo (
1884set showfix=1 3281set showfix=1
1885call :dk_color %Magenta% "In MAS, Goto Troubleshoot and run Fix Licensing option." 3282call :dk_color %Blue% "%_fixmsg%"
1886) 3283)
1887 3284
1888if exist "%tdir%\Genuine*" del /f /q "%tdir%\Genuine*" %nul% 3285if exist "%tdir%\Genuine*" del /f /q "%tdir%\Genuine*" %nul%
@@ -1921,8 +3318,8 @@ goto :k_final
1921) 3318)
1922 3319
1923call :dk_color %Red% "Activation Failed" 3320call :dk_color %Red% "Activation Failed"
1924if not defined error call :dk_color %Magenta% "In MAS, Goto Troubleshoot and run Fix Licensing option." 3321if not defined error call :dk_color %Blue% "%_fixmsg%"
1925call :dk_color2 %Magenta% "Check this page for help" %_Yellow% " https://massgrave.dev/troubleshoot" 3322call :dk_color2 %Blue% "Check this page for help" %_Yellow% " https://%mas%/troubleshoot"
1926 3323
1927::======================================================================================================================================== 3324::========================================================================================================================================
1928 3325
@@ -1947,9 +3344,9 @@ if defined _k38 (
1947%psc% "$f=[io.file]::ReadAllText('!_batp!') -split ':regdel\:.*';& ([ScriptBlock]::Create($f[1])) -protect;" 3344%psc% "$f=[io.file]::ReadAllText('!_batp!') -split ':regdel\:.*';& ([ScriptBlock]::Create($f[1])) -protect;"
1948%nul% reg delete "HKLM\%specific_kms%" /f 3345%nul% reg delete "HKLM\%specific_kms%" /f
1949%nul% reg query "HKLM\%specific_kms%" && ( 3346%nul% reg query "HKLM\%specific_kms%" && (
1950call :dk_color %Magenta% "Protect KMS38 By KMS [Successful] [Locked A Registry Key]" 3347call :dk_color %Blue% "Protect KMS38 From KMS [Successful] [Locked A Registry Key]"
1951) || ( 3348) || (
1952call :dk_color %Red% "Protect KMS38 By KMS [Failed To Lock A Registry Key]" 3349call :dk_color %Red% "Protect KMS38 From KMS [Failed To Lock A Registry Key]"
1953) 3350)
1954) 3351)
1955 3352
@@ -2033,7 +3430,7 @@ $key.SetAccessControl($acl)
2033:k_actinfo 3430:k_actinfo
2034 3431
2035set xpr= 3432set xpr=
2036for /f "tokens=* delims=" %%# in ('%psc% "$([DateTime]::Now.addMinutes(%gpr%)).ToString('yyyy-MM-dd HH:mm:ss')" 2^>nul') do set "xpr=%%#" 3433for /f "tokens=* delims=" %%# in ('%psc% "$([DateTime]::Now.addMinutes(%gpr%)).ToString('yyyy-MM-dd HH:mm:ss')" %nul6%') do set "xpr=%%#"
2037call :dk_color %Green% "%winos% is activated till !xpr!" 3434call :dk_color %Green% "%winos% is activated till !xpr!"
2038exit /b 3435exit /b
2039 3436
@@ -2042,8 +3439,8 @@ exit /b
2042:k_checkexp 3439:k_checkexp
2043 3440
2044set gpr=0 3441set gpr=0
2045if %_wmic% EQU 1 for /f "tokens=2 delims==" %%# in ('"wmic path SoftwareLicensingProduct where (ApplicationID='55c92734-d682-4d71-983e-d6ec3f16059f' and Description like '%%KMSCLIENT%%' and PartialProductKey is not NULL) get GracePeriodRemaining /VALUE" 2^>nul') do set "gpr=%%#" 3442if %_wmic% EQU 1 for /f "tokens=2 delims==" %%# in ('"wmic path SoftwareLicensingProduct where (ApplicationID='55c92734-d682-4d71-983e-d6ec3f16059f' and Description like '%%KMSCLIENT%%' and PartialProductKey is not NULL) get GracePeriodRemaining /VALUE" %nul6%') do set "gpr=%%#"
2046if %_wmic% EQU 0 for /f "tokens=2 delims==" %%# in ('%psc% "(([WMISEARCHER]'SELECT GracePeriodRemaining FROM SoftwareLicensingProduct WHERE ApplicationID=''55c92734-d682-4d71-983e-d6ec3f16059f'' AND Description like ''%%KMSCLIENT%%'' AND PartialProductKey IS NOT NULL').Get()).GracePeriodRemaining | %% {echo ('GracePeriodRemaining='+$_)}" 2^>nul') do set "gpr=%%#" 3443if %_wmic% EQU 0 for /f "tokens=2 delims==" %%# in ('%psc% "(([WMISEARCHER]'SELECT GracePeriodRemaining FROM SoftwareLicensingProduct WHERE ApplicationID=''55c92734-d682-4d71-983e-d6ec3f16059f'' AND Description like ''%%KMSCLIENT%%'' AND PartialProductKey IS NOT NULL').Get()).GracePeriodRemaining | %% {echo ('GracePeriodRemaining='+$_)}" %nul6%') do set "gpr=%%#"
2047if %gpr% GTR 259200 (set _k38=1) else (set _k38=) 3444if %gpr% GTR 259200 (set _k38=1) else (set _k38=)
2048exit /b 3445exit /b
2049 3446
@@ -2051,8 +3448,8 @@ exit /b
2051 3448
2052:dk_channel 3449:dk_channel
2053 3450
2054if %_wmic% EQU 1 for /f "tokens=2 delims==" %%# in ('wmic path SoftwareLicensingProduct where "ApplicationID='55c92734-d682-4d71-983e-d6ec3f16059f' and PartialProductKey<>null" Get ProductKeyChannel /value 2^>nul') do set "_channel=%%#" 3451if %_wmic% EQU 1 for /f "tokens=2 delims==" %%# in ('wmic path SoftwareLicensingProduct where "ApplicationID='55c92734-d682-4d71-983e-d6ec3f16059f' and PartialProductKey<>null" Get ProductKeyChannel /value %nul6%') do set "_channel=%%#"
2055if %_wmic% EQU 0 for /f "tokens=2 delims==" %%# in ('%psc% "(([WMISEARCHER]'SELECT ProductKeyChannel FROM SoftwareLicensingProduct WHERE ApplicationID=''55c92734-d682-4d71-983e-d6ec3f16059f'' AND PartialProductKey IS NOT NULL').Get()).ProductKeyChannel | %% {echo ('ProductKeyChannel='+$_)}" 2^>nul') do set "_channel=%%#" 3452if %_wmic% EQU 0 for /f "tokens=2 delims==" %%# in ('%psc% "(([WMISEARCHER]'SELECT ProductKeyChannel FROM SoftwareLicensingProduct WHERE ApplicationID=''55c92734-d682-4d71-983e-d6ec3f16059f'' AND PartialProductKey IS NOT NULL').Get()).ProductKeyChannel | %% {echo ('ProductKeyChannel='+$_)}" %nul6%') do set "_channel=%%#"
2056exit /b 3453exit /b
2057 3454
2058::======================================================================================================================================== 3455::========================================================================================================================================
@@ -2134,10 +3531,10 @@ cd918a57-a41b-4c82-8dce-1a538e221a83_7HN%f%RX-D7%f%KGG-3K4%f%RQ-4W%f%PJ4-YT%f%DF
213443d9af6e-5e86-4be8-a797-d072a046896c_K9F%f%YF-G6%f%NCK-73M%f%32-XM%f%VPY-F9%f%DRR_120_ServerARM64_RS4 353143d9af6e-5e86-4be8-a797-d072a046896c_K9F%f%YF-G6%f%NCK-73M%f%32-XM%f%VPY-F9%f%DRR_120_ServerARM64_RS4
2135e0c42288-980c-4788-a014-c080d2e1926e_NW6%f%C2-QM%f%PVW-D7K%f%KK-3G%f%KT6-VC%f%FB2_121_Education 3532e0c42288-980c-4788-a014-c080d2e1926e_NW6%f%C2-QM%f%PVW-D7K%f%KK-3G%f%KT6-VC%f%FB2_121_Education
21363c102355-d027-42c6-ad23-2e7ef8a02585_2WH%f%4N-8Q%f%GBV-H22%f%JP-CT%f%43Q-MD%f%WWJ_122_EducationN 35333c102355-d027-42c6-ad23-2e7ef8a02585_2WH%f%4N-8Q%f%GBV-H22%f%JP-CT%f%43Q-MD%f%WWJ_122_EducationN
213732d2fab3-e4a8-42c2-923b-4bf4fd13e6ee_M7X%f%TQ-FN%f%8P6-TTK%f%YV-9D%f%4CC-J4%f%62D_125_EnterpriseS_RS5,VB 353432d2fab3-e4a8-42c2-923b-4bf4fd13e6ee_M7X%f%TQ-FN%f%8P6-TTK%f%YV-9D%f%4CC-J4%f%62D_125_EnterpriseS_RS5,VB,Ge
21382d5a5a60-3040-48bf-beb0-fcd770c20ce0_DCP%f%HK-NF%f%MTC-H88%f%MJ-PF%f%HPY-QJ%f%4BJ_125_EnterpriseS_RS1 35352d5a5a60-3040-48bf-beb0-fcd770c20ce0_DCP%f%HK-NF%f%MTC-H88%f%MJ-PF%f%HPY-QJ%f%4BJ_125_EnterpriseS_RS1
21397b51a46c-0c04-4e8f-9af4-8496cca90d5e_WNM%f%TR-4C%f%88C-JK8%f%YV-HQ%f%7T2-76%f%DF9_125_EnterpriseS_TH1 35367b51a46c-0c04-4e8f-9af4-8496cca90d5e_WNM%f%TR-4C%f%88C-JK8%f%YV-HQ%f%7T2-76%f%DF9_125_EnterpriseS_TH1
21407103a333-b8c8-49cc-93ce-d37c09687f92_92N%f%FX-8D%f%JQP-P6B%f%BQ-TH%f%F9C-7C%f%G2H_126_EnterpriseSN_RS5,VB 35377103a333-b8c8-49cc-93ce-d37c09687f92_92N%f%FX-8D%f%JQP-P6B%f%BQ-TH%f%F9C-7C%f%G2H_126_EnterpriseSN_RS5,VB,Ge
21419f776d83-7156-45b2-8a5c-359b9c9f22a3_QFF%f%DN-GR%f%T3P-VKW%f%WX-X7%f%T3R-8B%f%639_126_EnterpriseSN_RS1 35389f776d83-7156-45b2-8a5c-359b9c9f22a3_QFF%f%DN-GR%f%T3P-VKW%f%WX-X7%f%T3R-8B%f%639_126_EnterpriseSN_RS1
214287b838b7-41b6-4590-8318-5797951d8529_2F7%f%7B-TN%f%FGY-69Q%f%QF-B8%f%YKP-D6%f%9TJ_126_EnterpriseSN_TH1 353987b838b7-41b6-4590-8318-5797951d8529_2F7%f%7B-TN%f%FGY-69Q%f%QF-B8%f%YKP-D6%f%9TJ_126_EnterpriseSN_TH1
214339e69c41-42b4-4a0a-abad-8e3c10a797cc_QFN%f%D9-D3%f%Y9C-J3K%f%KY-6R%f%PVP-2D%f%PYV_145_ServerDatacenterACor_FE 354039e69c41-42b4-4a0a-abad-8e3c10a797cc_QFN%f%D9-D3%f%Y9C-J3K%f%KY-6R%f%PVP-2D%f%PYV_145_ServerDatacenterACor_FE
@@ -2158,13 +3555,13 @@ e38454fb-41a4-4f59-a5dc-25080e354730_44R%f%PN-FT%f%Y23-9VT%f%TB-MP%f%9BX-T8%f%4F
2158ec868e65-fadf-4759-b23e-93fe37f2cc29_CPW%f%HC-NT%f%2C7-VYW%f%78-DH%f%DB2-PG%f%3GK_175_ServerRdsh_RS5 3555ec868e65-fadf-4759-b23e-93fe37f2cc29_CPW%f%HC-NT%f%2C7-VYW%f%78-DH%f%DB2-PG%f%3GK_175_ServerRdsh_RS5
2159e4db50ea-bda1-4566-b047-0ca50abc6f07_7NB%f%T4-WG%f%BQX-MP4%f%H7-QX%f%FF8-YP%f%3KX_175_ServerRdsh_RS3 3556e4db50ea-bda1-4566-b047-0ca50abc6f07_7NB%f%T4-WG%f%BQX-MP4%f%H7-QX%f%FF8-YP%f%3KX_175_ServerRdsh_RS3
21600df4f814-3f57-4b8b-9a9d-fddadcd69fac_NBT%f%WJ-3D%f%R69-3C4%f%V8-C2%f%6MC-GQ%f%9M6_183_CloudE 35570df4f814-3f57-4b8b-9a9d-fddadcd69fac_NBT%f%WJ-3D%f%R69-3C4%f%V8-C2%f%6MC-GQ%f%9M6_183_CloudE
216159eb965c-9150-42b7-a0ec-22151b9897c5_KBN%f%8V-HF%f%GQ4-MGX%f%VD-34%f%7P6-PD%f%QGT_191_IoTEnterpriseS_NI 355859eb965c-9150-42b7-a0ec-22151b9897c5_KBN%f%8V-HF%f%GQ4-MGX%f%VD-34%f%7P6-PD%f%QGT_191_IoTEnterpriseS_VB,NI
2162d30136fc-cb4b-416e-a23d-87207abc44a9_6XN%f%7V-PC%f%BDC-BDB%f%RH-8D%f%QY7-G6%f%R44_202_CloudEditionN 3559d30136fc-cb4b-416e-a23d-87207abc44a9_6XN%f%7V-PC%f%BDC-BDB%f%RH-8D%f%QY7-G6%f%R44_202_CloudEditionN
2163ca7df2e3-5ea0-47b8-9ac1-b1be4d8edd69_37D%f%7F-N4%f%9CB-WQR%f%8W-TB%f%J73-FM%f%8RX_203_CloudEdition 3560ca7df2e3-5ea0-47b8-9ac1-b1be4d8edd69_37D%f%7F-N4%f%9CB-WQR%f%8W-TB%f%J73-FM%f%8RX_203_CloudEdition
216419b5e0fb-4431-46bc-bac1-2f1873e4ae73_NTB%f%V8-9K%f%7Q8-V27%f%C6-M2%f%BTV-KH%f%MXV_407_ServerTurbine 356119b5e0fb-4431-46bc-bac1-2f1873e4ae73_NTB%f%V8-9K%f%7Q8-V27%f%C6-M2%f%BTV-KH%f%MXV_407_ServerTurbine
2165) do ( 3562) do (
2166for /f "tokens=1-5 delims=_" %%A in ("%%#") do if %osSKU%==%%C ( 3563for /f "tokens=1-5 delims=_" %%A in ("%%#") do if %osSKU%==%%C (
2167if %1==getkey if not defined key echo "!applist!" | find /i "%%A" >nul && set key=%%B 3564if %1==getkey if not defined key echo "!applist!" | find /i "%%A" %nul1% && set key=%%B
2168) 3565)
2169) 3566)
2170exit /b 3567exit /b
@@ -2172,7 +3569,6 @@ exit /b
2172::======================================================================================================================================== 3569::========================================================================================================================================
2173 3570
2174:: Below code is used to get alternate edition name and key if current edition doesn't support KMS38 activation 3571:: Below code is used to get alternate edition name and key if current edition doesn't support KMS38 activation
2175:: ProfessionalCountrySpecific won't be converted because it's not a good idea to change CountrySpecific editions
2176 3572
2177:: 1st column = Current SKU ID 3573:: 1st column = Current SKU ID
2178:: 2nd column = Current Edition Name 3574:: 2nd column = Current Edition Name
@@ -2189,16 +3585,17 @@ set notfoundaltactID=
2189if %_NoEditionChange%==1 exit /b 3585if %_NoEditionChange%==1 exit /b
2190 3586
2191for %%# in ( 3587for %%# in (
2192188_IoTEnterprise_______________8ab9bdd1-1f67-4997-82d9-8878520837d9_73111121-5638-40f6-bc11-f1d7b0d64300_NPP%f%R9-FWD%f%CX-D2%f%C8J-H872%f%K-2Y%f%T43_Enterprise 3588188_IoTEnterprise__________________8ab9bdd1-1f67-4997-82d9-8878520837d9_73111121-5638-40f6-bc11-f1d7b0d64300_NPP%f%R9-FWD%f%CX-D2%f%C8J-H872%f%K-2Y%f%T43_Enterprise
2193191_IoTEnterpriseS-2021_________ed655016-a9e8-4434-95d9-4345352c2552_32d2fab3-e4a8-42c2-923b-4bf4fd13e6ee_M7X%f%TQ-FN8%f%P6-TT%f%KYV-9D4C%f%C-J4%f%62D_EnterpriseS-2021 3589191_IoTEnterpriseS-2021____________ed655016-a9e8-4434-95d9-4345352c2552_32d2fab3-e4a8-42c2-923b-4bf4fd13e6ee_M7X%f%TQ-FN8%f%P6-TT%f%KYV-9D4C%f%C-J4%f%62D_EnterpriseS-2021
2194205_IoTEnterpriseSK_____________d4f9b41f-205c-405e-8e08-3d16e88e02be_59eb965c-9150-42b7-a0ec-22151b9897c5_KBN%f%8V-HFG%f%Q4-MG%f%XVD-347P%f%6-PD%f%QGT_IoTEnterpriseS-Win11 3590205_IoTEnterpriseSK________________d4f9b41f-205c-405e-8e08-3d16e88e02be_59eb965c-9150-42b7-a0ec-22151b9897c5_KBN%f%8V-HFG%f%Q4-MG%f%XVD-347P%f%6-PD%f%QGT_IoTEnterpriseS
2195138_ProfessionalSingleLanguage__a48938aa-62fa-4966-9d44-9f04da3f72f2_2de67392-b7a7-462a-b1ca-108dd189f588_W26%f%9N-WFG%f%WX-YV%f%C9B-4J6C%f%9-T8%f%3GX_Professional 3591138_ProfessionalSingleLanguage_____a48938aa-62fa-4966-9d44-9f04da3f72f2_2de67392-b7a7-462a-b1ca-108dd189f588_W26%f%9N-WFG%f%WX-YV%f%C9B-4J6C%f%9-T8%f%3GX_Professional
3592139_ProfessionalCountrySpecific____f7af7d09-40e4-419c-a49b-eae366689ebd_2de67392-b7a7-462a-b1ca-108dd189f588_W26%f%9N-WFG%f%WX-YV%f%C9B-4J6C%f%9-T8%f%3GX_Professional
3593139_ProfessionalCountrySpecific-Zn_01eb852c-424d-4060-94b8-c10d799d7364_2de67392-b7a7-462a-b1ca-108dd189f588_W26%f%9N-WFG%f%WX-YV%f%C9B-4J6C%f%9-T8%f%3GX_Professional
2196) do ( 3594) do (
2197for /f "tokens=1-6 delims=_" %%A in ("%%#") do if %osSKU%==%%A ( 3595for /f "tokens=1-6 delims=_" %%A in ("%%#") do if %osSKU%==%%A (
2198echo "!applist!" | find /i "%%C" 1>nul && ( 3596echo "!applist!" | find /i "%%C" %nul1% && (
2199echo "!applist!" | find /i "%%D" 1>nul && ( 3597echo "!applist!" | find /i "%%D" %nul1% && (
2200set altkey=%%E 3598set altkey=%%E
2201set curedition=%%B
2202set altedition=%%F 3599set altedition=%%F
2203) || ( 3600) || (
2204set altedition=%%F 3601set altedition=%%F
@@ -2242,8 +3639,7 @@ set _unattendedact=
2242set _args=%* 3639set _args=%*
2243if defined _args set _args=%_args:"=% 3640if defined _args set _args=%_args:"=%
2244if defined _args ( 3641if defined _args (
2245set _unattended=1 3642echo "%_args%" | find /i "/KMS" >nul && set _unattended=1
2246if "%_args%"=="-el" set _unattended=
2247 3643
2248for %%A in (%_args%) do ( 3644for %%A in (%_args%) do (
2249if /i "%%A"=="-el" (set _elev=1 3645if /i "%%A"=="-el" (set _elev=1
@@ -2262,9 +3658,9 @@ if /i "%%A"=="-el" (set _elev=1
2262 3658
2263::======================================================================================================================================== 3659::========================================================================================================================================
2264 3660
2265set winbuild=1
2266set "nul=>nul 2>&1" 3661set "nul=>nul 2>&1"
2267set psc=powershell.exe 3662set psc=powershell.exe
3663set winbuild=1
2268for /f "tokens=6 delims=[]. " %%G in ('ver') do set winbuild=%%G 3664for /f "tokens=6 delims=[]. " %%G in ('ver') do set winbuild=%%G
2269 3665
2270set _NCS=1 3666set _NCS=1
@@ -2358,7 +3754,7 @@ reg query %kNext% /v MigrationToV5Done 2>nul | find /i "0x1" %nul% && call :offi
2358 3754
2359set _tskinstalled= 3755set _tskinstalled=
2360reg query "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Schedule\taskcache\tasks" /f Path /s | find /i "\Activation-Renewal" >nul && ( 3756reg query "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Schedule\taskcache\tasks" /f Path /s | find /i "\Activation-Renewal" >nul && (
2361find /i "Ver:1.8" %ProgramData%\Activation-Renewal\Activation_task.cmd %nul% && set _tskinstalled=1 3757find /i "Ver:1.9" "%ProgramFiles%\Activation-Renewal\Activation_task.cmd" %nul% && set _tskinstalled=1
2362) 3758)
2363 3759
2364set _oldtsk= 3760set _oldtsk=
@@ -2488,7 +3884,12 @@ set "_log=%~dpn0"
2488set "_work=%~dp0" 3884set "_work=%~dp0"
2489if "%_work:~-1%"=="\" set "_work=%_work:~0,-1%" 3885if "%_work:~-1%"=="\" set "_work=%_work:~0,-1%"
2490set _UNC=0 3886set _UNC=0
2491if "%_work:~0,2%"=="\\" set _UNC=1 3887if "%_work:~0,2%"=="\\" (
3888set _UNC=1
3889) else (
3890net use %~d0 %_Null%
3891if not errorlevel 1 set _UNC=1
3892)
2492for /f "skip=2 tokens=2*" %%a in ('reg query "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders" /v Desktop') do call set "_dsk=%%b" 3893for /f "skip=2 tokens=2*" %%a in ('reg query "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders" /v Desktop') do call set "_dsk=%%b"
2493if exist "%PUBLIC%\Desktop\desktop.ini" set "_dsk=%PUBLIC%\Desktop" 3894if exist "%PUBLIC%\Desktop\desktop.ini" set "_dsk=%PUBLIC%\Desktop"
2494set "_mO21a=Detected Office 2021 C2R Retail is activated" 3895set "_mO21a=Detected Office 2021 C2R Retail is activated"
@@ -2513,6 +3914,8 @@ if exist "%SystemRoot%\Servicing\Packages\Microsoft-Windows-Server*Edition~*.mum
2513set "ESUEditions=ServerDatacenter,ServerDatacenterCore,ServerDatacenterV,ServerDatacenterVCore,ServerStandard,ServerStandardCore,ServerStandardV,ServerStandardVCore,ServerEnterprise,ServerEnterpriseCore,ServerEnterpriseV,ServerEnterpriseVCore" 3914set "ESUEditions=ServerDatacenter,ServerDatacenterCore,ServerDatacenterV,ServerDatacenterVCore,ServerStandard,ServerStandardCore,ServerStandardV,ServerStandardVCore,ServerEnterprise,ServerEnterpriseCore,ServerEnterpriseV,ServerEnterpriseVCore"
2514) 3915)
2515for /f "tokens=6 delims=[]. " %%G in ('ver') do set winbuild=%%G 3916for /f "tokens=6 delims=[]. " %%G in ('ver') do set winbuild=%%G
3917set UBR=0
3918if %winbuild% GEQ 7601 for /f "skip=2 tokens=2*" %%a in ('reg query "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion" /v UBR 2^>nul') do if not errorlevel 1 set /a UBR=%%b
2516set "_csq=cscript.exe //NoLogo //Job:WmiQuery "%~nx0?.wsf"" 3919set "_csq=cscript.exe //NoLogo //Job:WmiQuery "%~nx0?.wsf""
2517set "_csm=cscript.exe //NoLogo //Job:WmiMethod "%~nx0?.wsf"" 3920set "_csm=cscript.exe //NoLogo //Job:WmiMethod "%~nx0?.wsf""
2518set "_csp=cscript.exe //NoLogo //Job:WmiPKey "%~nx0?.wsf"" 3921set "_csp=cscript.exe //NoLogo //Job:WmiPKey "%~nx0?.wsf""
@@ -2543,7 +3946,7 @@ pushd "!_work!"
2543 3946
2544if not defined _unattended ( 3947if not defined _unattended (
2545mode con cols=98 lines=31 3948mode con cols=98 lines=31
2546%nul% %psc% "&%_buf%" 3949%psc% "&%_buf%"
2547title %_title% 3950title %_title%
2548) else ( 3951) else (
2549title Online KMS Activation 3952title Online KMS Activation
@@ -2714,7 +4117,10 @@ IF %winbuild% LSS 14393 (
2714) 4117)
2715IF NOT "%EditionWMI%"=="" SET "EditionID=%EditionWMI%" 4118IF NOT "%EditionWMI%"=="" SET "EditionID=%EditionWMI%"
2716IF /I "%EditionID%"=="IoTEnterprise" SET "EditionID=Enterprise" 4119IF /I "%EditionID%"=="IoTEnterprise" SET "EditionID=Enterprise"
2717IF /I "%EditionID%"=="IoTEnterpriseS" IF %winbuild% LSS 22610 SET "EditionID=EnterpriseS" 4120IF /I "%EditionID%"=="IoTEnterpriseS" IF %winbuild% LSS 22610 (
4121SET "EditionID=EnterpriseS"
4122IF %winbuild% GEQ 19041 IF %UBR% GEQ 2788 SET "EditionID=IoTEnterpriseS"
4123)
2718IF /I "%EditionID%"=="ProfessionalSingleLanguage" SET "EditionID=Professional" 4124IF /I "%EditionID%"=="ProfessionalSingleLanguage" SET "EditionID=Professional"
2719IF /I "%EditionID%"=="ProfessionalCountrySpecific" SET "EditionID=Professional" 4125IF /I "%EditionID%"=="ProfessionalCountrySpecific" SET "EditionID=Professional"
2720IF /I "%EditionID%"=="EnterpriseG" SET Win10Gov=1 4126IF /I "%EditionID%"=="EnterpriseG" SET Win10Gov=1
@@ -4326,6 +5732,7 @@ if %_C16Msg% EQU 1 set _CtRMsg=1
4326if %_C15Msg% EQU 1 set _CtRMsg=1 5732if %_C15Msg% EQU 1 set _CtRMsg=1
4327if %_Office16% EQU 1 ( 5733if %_Office16% EQU 1 (
4328for %%a in (%_RetIds%,ProPlus) do set "_%%a=" 5734for %%a in (%_RetIds%,ProPlus) do set "_%%a="
5735for %%A in (19,21) do call :officeLoc %%A
4329) 5736)
4330if %_Office15% EQU 1 ( 5737if %_Office15% EQU 1 (
4331for %%a in (%_R15Ids%,ProPlus) do set "_%%a=" 5738for %%a in (%_R15Ids%,ProPlus) do set "_%%a="
@@ -5155,7 +6562,7 @@ call :Clear-KMS-Cache
5155 6562
5156if not [%Act_OK%]==[1] ( 6563if not [%Act_OK%]==[1] (
5157echo. 6564echo.
5158echo In case of any issues, check https://massgrave.dev/troubleshoot 6565echo In case of any issues, check https://mass%-%grave.dev/troubleshoot
5159) 6566)
5160 6567
5161if defined _unattended exit /b 6568if defined _unattended exit /b
@@ -5420,6 +6827,11 @@ echo Deleting [Folder] %ProgramData%\Activation-Renewal\
5420rmdir /s /q "%ProgramData%\Activation-Renewal\" %nul% 6827rmdir /s /q "%ProgramData%\Activation-Renewal\" %nul%
5421) 6828)
5422 6829
6830If exist "%ProgramFiles%\Activation-Renewal\" (
6831echo Deleting [Folder] %ProgramFiles%\Activation-Renewal\
6832rmdir /s /q "%ProgramFiles%\Activation-Renewal\" %nul%
6833)
6834
5423reg query "HKCR\DesktopBackground\shell\Activate Windows - Office" %nul% && ( 6835reg query "HKCR\DesktopBackground\shell\Activate Windows - Office" %nul% && (
5424echo Deleting [Registry] HKCR\DesktopBackground\shell\Activate Windows - Office 6836echo Deleting [Registry] HKCR\DesktopBackground\shell\Activate Windows - Office
5425Reg delete "HKCR\DesktopBackground\shell\Activate Windows - Office" /f %nul% 6837Reg delete "HKCR\DesktopBackground\shell\Activate Windows - Office" /f %nul%
@@ -5427,13 +6839,13 @@ Reg delete "HKCR\DesktopBackground\shell\Activate Windows - Office" /f %nul%
5427 6839
5428reg query "%key%" /f Path /s | find /i "\Activation-Renewal" >nul && (set error_=1) 6840reg query "%key%" /f Path /s | find /i "\Activation-Renewal" >nul && (set error_=1)
5429reg query "%key%" /f Path /s | find /i "\Activation-Run_Once" >nul && (set error_=1) 6841reg query "%key%" /f Path /s | find /i "\Activation-Run_Once" >nul && (set error_=1)
5430reg query "%key%" /f Path /s | find /i "\Online_KMS_Activation_Script-Run_Once" >nul && (set error_=1) 6842reg query "%key%" /f Path /s | find /i "\Online_KMS_Activation_Script" >nul && (set error_=1)
5431reg query "%key%" /f Path /s | find /i "\Online_KMS_Activation_Script-Run_Once" >nul && (set error_=1)
5432If exist "%windir%\Online_KMS_Activation_Script\" (set error_=1) 6843If exist "%windir%\Online_KMS_Activation_Script\" (set error_=1)
5433reg query "HKCR\DesktopBackground\shell\Activate Windows - Office" %nul% && (set error_=1) 6844reg query "HKCR\DesktopBackground\shell\Activate Windows - Office" %nul% && (set error_=1)
5434if exist "%ProgramData%\Online_KMS_Activation.cmd" (set error_=1) 6845if exist "%ProgramData%\Online_KMS_Activation.cmd" (set error_=1)
5435if exist "%ProgramData%\Online_KMS_Activation\" (set error_=1) 6846if exist "%ProgramData%\Online_KMS_Activation\" (set error_=1)
5436if exist "%ProgramData%\Activation-Renewal\" (set error_=1) 6847if exist "%ProgramData%\Activation-Renewal\" (set error_=1)
6848if exist "%ProgramFiles%\Activation-Renewal\" (set error_=1)
5437exit /b 6849exit /b
5438 6850
5439:========================================================================================================================================= 6851:=========================================================================================================================================
@@ -5445,7 +6857,7 @@ mode con cols=91 lines=30
5445title Install Activation Auto-Renewal 6857title Install Activation Auto-Renewal
5446 6858
5447set error_= 6859set error_=
5448set "_dest=%ProgramData%\Activation-Renewal" 6860set "_dest=%ProgramFiles%\Activation-Renewal"
5449set "key=HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Schedule\taskcache\tasks" 6861set "key=HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Schedule\taskcache\tasks"
5450 6862
5451call :clearstuff %nul% 6863call :clearstuff %nul%
@@ -5458,7 +6870,7 @@ goto :RenDone
5458) 6870)
5459 6871
5460if not exist "%_dest%\" md "%_dest%\" %nul% 6872if not exist "%_dest%\" md "%_dest%\" %nul%
5461set "_temp=%SystemRoot%\Temp\_taskwork" 6873set "_temp=%SystemRoot%\Temp\_taskwork_%Random%"
5462 6874
5463set nil= 6875set nil=
5464if exist "%_temp%\.*" rmdir /s /q "%_temp%\" %nul% 6876if exist "%_temp%\.*" rmdir /s /q "%_temp%\" %nul%
@@ -5470,7 +6882,7 @@ if defined ActTask (s%nil%cht%nil%asks /cre%nil%ate /tn "Activation-Run_Once" /r
5470if exist "%_temp%\.*" rmdir /s /q "%_temp%\" %nul% 6882if exist "%_temp%\.*" rmdir /s /q "%_temp%\" %nul%
5471 6883
5472call :createInfo.txt 6884call :createInfo.txt
5473%nul% %psc% "$f=[io.file]::ReadAllText('!_batp!') -split \":_extracttask\:.*`r`n\"; [io.file]::WriteAllText('%_dest%\Activation_task.cmd', '@REM Dummy ' + '%random%' + [Environment]::NewLine + $f[1].Trim(), [System.Text.Encoding]::ASCII);" 6885%psc% "$f=[io.file]::ReadAllText('!_batp!') -split \":_extracttask\:.*`r`n\"; [io.file]::WriteAllText('%_dest%\Activation_task.cmd', '@REM Dummy ' + '%random%' + [Environment]::NewLine + $f[1].Trim(), [System.Text.Encoding]::ASCII);"
5474title Install Activation Auto-Renewal 6886title Install Activation Auto-Renewal
5475 6887
5476::======================================================================================================================================== 6888::========================================================================================================================================
@@ -5551,9 +6963,9 @@ echo Activation-Run_Once [Activation Task - deletes itself once activated]
5551echo The scheduled tasks runs only if the system is connected to the Internet. 6963echo The scheduled tasks runs only if the system is connected to the Internet.
5552echo: 6964echo:
5553echo - Files 6965echo - Files
5554echo C:\ProgramData\Activation-Renewal\Activation_task.cmd 6966echo C:\Program Files\Activation-Renewal\Activation_task.cmd
5555echo C:\ProgramData\Activation-Renewal\Info.txt 6967echo C:\Program Files\Activation-Renewal\Info.txt
5556echo C:\ProgramData\Activation-Renewal\Logs.txt 6968echo C:\Program Files\Activation-Renewal\Logs.txt
5557echo ______________________________________________________________________________________________ 6969echo ______________________________________________________________________________________________
5558echo: 6970echo:
5559echo Online KMS Activation Script is a part of 'Microsoft_Activation_Scripts' [MAS] project. 6971echo Online KMS Activation Script is a part of 'Microsoft_Activation_Scripts' [MAS] project.
@@ -5622,7 +7034,7 @@ exit /b
5622 </Settings> 7034 </Settings>
5623 <Actions Context="LocalSystem"> 7035 <Actions Context="LocalSystem">
5624 <Exec> 7036 <Exec>
5625 <Command>%ProgramData%\Activation-Renewal\Activation_task.cmd</Command> 7037 <Command>%ProgramFiles%\Activation-Renewal\Activation_task.cmd</Command>
5626 <Arguments>Task</Arguments> 7038 <Arguments>Task</Arguments>
5627 </Exec> 7039 </Exec>
5628 </Actions> 7040 </Actions>
@@ -5679,7 +7091,7 @@ exit /b
5679 </Settings> 7091 </Settings>
5680 <Actions Context="LocalSystem"> 7092 <Actions Context="LocalSystem">
5681 <Exec> 7093 <Exec>
5682 <Command>%ProgramData%\Activation-Renewal\Activation_task.cmd</Command> 7094 <Command>%ProgramFiles%\Activation-Renewal\Activation_task.cmd</Command>
5683 <Arguments>Task</Arguments> 7095 <Arguments>Task</Arguments>
5684 </Exec> 7096 </Exec>
5685 </Actions> 7097 </Actions>
@@ -5692,7 +7104,7 @@ exit /b
5692 7104
5693:RenExport 7105:RenExport
5694 7106
5695%nul% %psc% "$f=[io.file]::ReadAllText('!_batp!') -split \":%~1\:.*`r`n\"; [io.file]::WriteAllText('%~2',$f[1].Trim(),[System.Text.Encoding]::%~3);" 7107%psc% "$f=[io.file]::ReadAllText('!_batp!') -split \":%~1\:.*`r`n\"; [io.file]::WriteAllText('%~2',$f[1].Trim(),[System.Text.Encoding]::%~3);"
5696exit /b 7108exit /b
5697 7109
5698::======================================================================================================================================== 7110::========================================================================================================================================
@@ -5753,7 +7165,7 @@ wmic path Win32_ComputerSystem get CreationClassName /value 2>nul | find /i "com
5753) 7165)
5754 7166
5755setlocal EnableDelayedExpansion 7167setlocal EnableDelayedExpansion
5756if exist "%ProgramData%\Activation-Renewal\" call :_taskstart>>"%ProgramData%\Activation-Renewal\Logs.txt" & exit 7168if exist "%ProgramFiles%\Activation-Renewal\" call :_taskstart>>"%ProgramFiles%\Activation-Renewal\Logs.txt" & exit
5757 7169
5758::======================================================================================================================================== 7170::========================================================================================================================================
5759 7171
@@ -6153,7 +7565,7 @@ if not [%KMS_IP%]==[!KMS_IP!] exit /b
6153goto :_taskgetserv 7565goto :_taskgetserv
6154) 7566)
6155 7567
6156:: Ver:1.8 7568:: Ver:1.9
6157::======================================================================================================================================== 7569::========================================================================================================================================
6158:_extracttask: 7570:_extracttask:
6159 7571
@@ -6305,7 +7717,7 @@ UninstallLicenses("sppc.dll")
6305@echo off 7717@echo off
6306@cls 7718@cls
6307mode con cols=100 lines=32 7719mode con cols=100 lines=32
6308>nul 2>&1 powershell "&{$W=$Host.UI.RawUI.WindowSize;$B=$Host.UI.RawUI.BufferSize;$W.Height=31;$B.Height=300;$Host.UI.RawUI.WindowSize=$W;$Host.UI.RawUI.BufferSize=$B;}" 7720powershell "&{$W=$Host.UI.RawUI.WindowSize;$B=$Host.UI.RawUI.BufferSize;$W.Height=31;$B.Height=300;$Host.UI.RawUI.WindowSize=$W;$Host.UI.RawUI.BufferSize=$B;}"
6309color 07 7721color 07
6310title Check Activation Status [vbs] 7722title Check Activation Status [vbs]
6311set "SysPath=%SystemRoot%\System32" 7723set "SysPath=%SystemRoot%\System32"
@@ -6504,7 +7916,7 @@ exit /b
6504@setlocal DisableDelayedExpansion 7916@setlocal DisableDelayedExpansion
6505@echo off 7917@echo off
6506mode con cols=100 lines=32 7918mode con cols=100 lines=32
6507>nul 2>&1 powershell "&{$W=$Host.UI.RawUI.WindowSize;$B=$Host.UI.RawUI.BufferSize;$W.Height=31;$B.Height=300;$Host.UI.RawUI.WindowSize=$W;$Host.UI.RawUI.BufferSize=$B;}" 7919powershell "&{$W=$Host.UI.RawUI.WindowSize;$B=$Host.UI.RawUI.BufferSize;$W.Height=31;$B.Height=300;$Host.UI.RawUI.WindowSize=$W;$Host.UI.RawUI.BufferSize=$B;}"
6508color 07 7920color 07
6509title Check Activation Status [wmi] 7921title Check Activation Status [wmi]
6510 7922
@@ -7012,21 +8424,32 @@ cls
7012color 07 8424color 07
7013title Troubleshoot 8425title Troubleshoot
7014 8426
8427set _args=
7015set _elev= 8428set _elev=
7016if /i "%~1"=="-el" set _elev=1
7017 8429
7018set winbuild=1 8430set _args=%*
8431if defined _args set _args=%_args:"=%
8432if defined _args (
8433for %%A in (%_args%) do (
8434if /i "%%A"=="-el" set _elev=1
8435)
8436)
8437
8438set "nul1=1>nul"
8439set "nul2=2>nul"
8440set "nul6=2^>nul"
7019set "nul=>nul 2>&1" 8441set "nul=>nul 2>&1"
8442
7020set psc=powershell.exe 8443set psc=powershell.exe
8444set winbuild=1
7021for /f "tokens=6 delims=[]. " %%G in ('ver') do set winbuild=%%G 8445for /f "tokens=6 delims=[]. " %%G in ('ver') do set winbuild=%%G
7022 8446
7023set _NCS=1 8447set _NCS=1
7024if %winbuild% LSS 10586 set _NCS=0 8448if %winbuild% LSS 10586 set _NCS=0
7025if %winbuild% GEQ 10586 reg query "HKCU\Console" /v ForceV2 2>nul | find /i "0x0" 1>nul && (set _NCS=0) 8449if %winbuild% GEQ 10586 reg query "HKCU\Console" /v ForceV2 %nul2% | find /i "0x0" %nul1% && (set _NCS=0)
7026 8450
7027call :_colorprep 8451call :_colorprep
7028 8452
7029set cbs_log=%SystemRoot%\logs\cbs\cbs.log
7030set "nceline=echo: &echo ==== ERROR ==== &echo:" 8453set "nceline=echo: &echo ==== ERROR ==== &echo:"
7031set "eline=echo: &call :_color %Red% "==== ERROR ====" &echo:" 8454set "eline=echo: &call :_color %Red% "==== ERROR ====" &echo:"
7032set "line=_________________________________________________________________________________________________" 8455set "line=_________________________________________________________________________________________________"
@@ -7094,12 +8517,12 @@ choice /C:1234560 /N
7094set _erl=%errorlevel% 8517set _erl=%errorlevel%
7095 8518
7096if %_erl%==7 exit /b 8519if %_erl%==7 exit /b
7097if %_erl%==6 start https://massgrave.dev/fix-wpa-registry.html &goto at_menu 8520if %_erl%==6 start https://%mas%/fix-wpa-registry.html &goto at_menu
7098if %_erl%==5 goto:retokens 8521if %_erl%==5 goto:retokens
7099if %_erl%==4 goto:fixwmi 8522if %_erl%==4 goto:fixwmi
7100if %_erl%==3 goto:sfcscan 8523if %_erl%==3 goto:sfcscan
7101if %_erl%==2 goto:dism_rest 8524if %_erl%==2 goto:dism_rest
7102if %_erl%==1 start https://massgrave.dev/troubleshoot.html &goto at_menu 8525if %_erl%==1 start https://%mas%/troubleshoot.html &goto at_menu
7103goto :at_menu 8526goto :at_menu
7104 8527
7105::======================================================================================================================================== 8528::========================================================================================================================================
@@ -7147,23 +8570,29 @@ if %errorlevel%==1 goto at_menu
7147 8570
7148cls 8571cls
7149mode 110, 30 8572mode 110, 30
7150echo:
7151
7152call :_stopservice TrustedInstaller 8573call :_stopservice TrustedInstaller
7153del /s /f /q "%SystemRoot%\logs\cbs\*.*"
7154 8574
7155set _time= 8575set _time=
7156for /f %%a in ('%psc% "Get-Date -format HH_mm_ss"') do set _time=%%a 8576for /f %%a in ('%psc% "Get-Date -format HH_mm_ss"') do set _time=%%a
7157echo: 8577echo:
7158echo Applying the command, 8578echo Applying the command,
7159echo dism /english /online /cleanup-image /restorehealth 8579echo dism /english /online /cleanup-image /restorehealth
7160echo: 8580dism /english /online /cleanup-image /restorehealth
7161dism /english /online /cleanup-image /restorehealth /Logpath:"%SystemRoot%\Temp\RHealth_DISM_%_time%.txt" /loglevel:4 8581
8582call :_stopservice TrustedInstaller
7162 8583
7163if not exist "!desktop!\AT_Logs\" md "!desktop!\AT_Logs\" %nul% 8584if not exist "!desktop!\AT_Logs\" md "!desktop!\AT_Logs\" %nul%
7164copy /y /b "%SystemRoot%\Temp\RHealth_DISM_%_time%.txt" "!desktop!\AT_Logs\RHealth_DISM_%_time%.txt" %nul% 8585
7165copy /y /b "%cbs_log%" "!desktop!\AT_Logs\RHealth_CBS_%_time%.txt" %nul% 8586call :compresslog cbs\CBS.log RHealth_CBS %nul%
7166del /f /q "%SystemRoot%\Temp\RHealth_DISM_%_time%.txt" %nul% 8587call :compresslog DISM\dism.log RHealth_DISM %nul%
8588
8589if not exist "!desktop!\AT_Logs\RHealth_CBS_%_time%.cab" (
8590copy /y /b "%SystemRoot%\logs\cbs\cbs.log" "!desktop!\AT_Logs\RHealth_CBS_%_time%.log" %nul%
8591)
8592
8593if not exist "!desktop!\AT_Logs\RHealth_DISM_%_time%.cab" (
8594copy /y /b "%SystemRoot%\logs\DISM\dism.log" "!desktop!\AT_Logs\RHealth_DISM_%_time%.log" %nul%
8595)
7167 8596
7168echo: 8597echo:
7169call :_color %Gray% "CBS and DISM logs are copied to the AT_Logs folder on the dekstop." 8598call :_color %Gray% "CBS and DISM logs are copied to the AT_Logs folder on the dekstop."
@@ -7193,22 +8622,24 @@ choice /C:09 /N /M "> [9] Continue [0] Go back : "
7193if %errorlevel%==1 goto at_menu 8622if %errorlevel%==1 goto at_menu
7194 8623
7195cls 8624cls
7196echo:
7197
7198call :_stopservice TrustedInstaller 8625call :_stopservice TrustedInstaller
7199del /s /f /q "%SystemRoot%\logs\cbs\*.*"
7200 8626
7201set _time= 8627set _time=
7202for /f %%a in ('%psc% "Get-Date -format HH_mm_ss"') do set _time=%%a 8628for /f %%a in ('%psc% "Get-Date -format HH_mm_ss"') do set _time=%%a
7203echo: 8629echo:
7204echo Applying the command, 8630echo Applying the command,
7205echo sfc /scannow 8631echo sfc /scannow
7206echo:
7207sfc /scannow 8632sfc /scannow
7208 8633
8634call :_stopservice TrustedInstaller
8635
7209if not exist "!desktop!\AT_Logs\" md "!desktop!\AT_Logs\" %nul% 8636if not exist "!desktop!\AT_Logs\" md "!desktop!\AT_Logs\" %nul%
7210 8637
7211copy /y /b "%cbs_log%" "!desktop!\AT_Logs\SFC_CBS_%_time%.txt" %nul% 8638call :compresslog cbs\CBS.log SFC_CBS %nul%
8639
8640if not exist "!desktop!\AT_Logs\SFC_CBS_%_time%.cab" (
8641copy /y /b "%SystemRoot%\logs\cbs\cbs.log" "!desktop!\AT_Logs\SFC_CBS_%_time%.log" %nul%
8642)
7212 8643
7213echo: 8644echo:
7214call :_color %Gray% "CBS log is copied to the AT_Logs folder on the dekstop." 8645call :_color %Gray% "CBS log is copied to the AT_Logs folder on the dekstop."
@@ -7220,7 +8651,7 @@ goto :at_back
7220 8651
7221cls 8652cls
7222mode con cols=115 lines=32 8653mode con cols=115 lines=32
7223%nul% %psc% "&{$W=$Host.UI.RawUI.WindowSize;$B=$Host.UI.RawUI.BufferSize;$W.Height=31;$B.Height=200;$Host.UI.RawUI.WindowSize=$W;$Host.UI.RawUI.BufferSize=$B;}" 8654%psc% "&{$W=$Host.UI.RawUI.WindowSize;$B=$Host.UI.RawUI.BufferSize;$W.Height=31;$B.Height=200;$Host.UI.RawUI.WindowSize=$W;$Host.UI.RawUI.BufferSize=$B;}"
7224title Fix Licensing ^(ClipSVC ^+ Office vNext ^+ SPP ^+ OSPP^) 8655title Fix Licensing ^(ClipSVC ^+ Office vNext ^+ SPP ^+ OSPP^)
7225 8656
7226echo: 8657echo:
@@ -7253,7 +8684,7 @@ cls
7253echo: 8684echo:
7254echo %line% 8685echo %line%
7255echo: 8686echo:
7256call :_color %Magenta% "Rebuilding ClipSVC Licences" 8687call :_color %Blue% "Rebuilding ClipSVC Licences"
7257echo: 8688echo:
7258 8689
7259if %winbuild% LSS 10240 ( 8690if %winbuild% LSS 10240 (
@@ -7262,7 +8693,7 @@ echo Skipping...
7262goto :cleanvnext 8693goto :cleanvnext
7263) 8694)
7264 8695
7265%psc% "(([WMISEARCHER]'SELECT Name FROM SoftwareLicensingProduct WHERE LicenseStatus=1 AND GracePeriodRemaining=0 AND PartialProductKey IS NOT NULL').Get()).Name" 2>nul | findstr /i "Windows" 1>nul && ( 8696%psc% "(([WMISEARCHER]'SELECT Name FROM SoftwareLicensingProduct WHERE LicenseStatus=1 AND GracePeriodRemaining=0 AND PartialProductKey IS NOT NULL').Get()).Name" %nul2% | findstr /i "Windows" %nul1% && (
7266echo Windows is permanently activated. 8697echo Windows is permanently activated.
7267echo Skipping rebuilding ClipSVC licences... 8698echo Skipping rebuilding ClipSVC licences...
7268goto :cleanvnext 8699goto :cleanvnext
@@ -7359,7 +8790,7 @@ for %%# in (wlidsvc LicenseManager) do (net stop %%# /y %nul% & net start %%# /y
7359echo: 8790echo:
7360echo %line% 8791echo %line%
7361echo: 8792echo:
7362call :_color %Magenta% "Clearing Office vNext License" 8793call :_color %Blue% "Clearing Office vNext License"
7363echo: 8794echo:
7364 8795
7365setlocal DisableDelayedExpansion 8796setlocal DisableDelayedExpansion
@@ -7414,7 +8845,7 @@ echo Not Found Registry - %%#
7414echo: 8845echo:
7415echo %line% 8846echo %line%
7416echo: 8847echo:
7417call :_color %Magenta% "Rebuilding SPP Licensing Tokens" 8848call :_color %Blue% "Rebuilding SPP Licensing Tokens"
7418echo: 8849echo:
7419 8850
7420call :scandat check 8851call :scandat check
@@ -7428,7 +8859,7 @@ echo tokens.dat file: [%token%]
7428if %winbuild% GEQ 14393 ( 8859if %winbuild% GEQ 14393 (
7429set wpaerror= 8860set wpaerror=
7430set /a count=0 8861set /a count=0
7431for /f %%a in ('reg query "HKLM\SYSTEM\WPA" 2^>nul') do set /a count+=1 8862for /f %%a in ('reg query "HKLM\SYSTEM\WPA" %nul6%') do set /a count+=1
7432for /L %%# in (1,1,!count!) do ( 8863for /L %%# in (1,1,!count!) do (
7433reg query "HKLM\SYSTEM\WPA\8DEC0AF1-0341-4b93-85CD-72606C2DF94C-7P-%%#" /ve /t REG_BINARY %nul% || set wpaerror=1 8864reg query "HKLM\SYSTEM\WPA\8DEC0AF1-0341-4b93-85CD-72606C2DF94C-7P-%%#" /ve /t REG_BINARY %nul% || set wpaerror=1
7434) 8865)
@@ -7441,7 +8872,7 @@ call :_color %Red% "[Error Found] [Registry Count - !count!]"
7441) 8872)
7442 8873
7443set tokenstore= 8874set tokenstore=
7444for /f "skip=2 tokens=2*" %%a in ('reg query "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\SoftwareProtectionPlatform" /v TokenStore 2^>nul') do call set "tokenstore=%%b" 8875for /f "skip=2 tokens=2*" %%a in ('reg query "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\SoftwareProtectionPlatform" /v TokenStore %nul6%') do call set "tokenstore=%%b"
7445 8876
7446:: Check sppsvc permissions and apply fixes 8877:: Check sppsvc permissions and apply fixes
7447 8878
@@ -7479,7 +8910,7 @@ call :_color %Red% "[Failed To Fix]"
7479echo [Successfully Fixed] 8910echo [Successfully Fixed]
7480) 8911)
7481) else ( 8912) else (
7482echo [Error Not Found] 8913echo [No Error Found]
7483) 8914)
7484) 8915)
7485 8916
@@ -7523,7 +8954,7 @@ echo tokens.dat file was rebuilt successfully.
7523echo: 8954echo:
7524echo %line% 8955echo %line%
7525echo: 8956echo:
7526call :_color %Magenta% "Rebuilding OSPP Licensing Tokens" 8957call :_color %Blue% "Rebuilding OSPP Licensing Tokens"
7527echo: 8958echo:
7528 8959
7529sc qc osppsvc %nul% || ( 8960sc qc osppsvc %nul% || (
@@ -7580,7 +9011,7 @@ echo tokens.dat file was rebuilt successfully.
7580echo: 9011echo:
7581echo %line% 9012echo %line%
7582echo: 9013echo:
7583call :_color %Magenta% "Repairing Office Licenses" 9014call :_color %Blue% "Repairing Office Licenses"
7584echo: 9015echo:
7585 9016
7586for /f "skip=2 tokens=2*" %%a in ('reg query "HKLM\SYSTEM\CurrentControlSet\Control\Session Manager\Environment" /v PROCESSOR_ARCHITECTURE') do set arch=%%b 9017for /f "skip=2 tokens=2*" %%a in ('reg query "HKLM\SYSTEM\CurrentControlSet\Control\Session Manager\Environment" /v PROCESSOR_ARCHITECTURE') do set arch=%%b
@@ -7622,10 +9053,7 @@ set _86=HKLM\SOFTWARE\Wow6432Node\Microsoft\Office
7622 9053
7623set uwp16= 9054set uwp16=
7624if %winbuild% GEQ 10240 ( 9055if %winbuild% GEQ 10240 (
7625dir /b "%ProgramFiles%\WindowsApps\Microsoft.Office.Desktop*" %nul% && set uwp16=Office 16.0 UWP 9056%psc% "Get-AppxPackage -name "Microsoft.Office.Desktop"" | find /i "Office" %nul1% && set uwp16=Office 16.0 UWP
7626dir /b "%ProgramW6432%\WindowsApps\Microsoft.Office.Desktop*" %nul% && set uwp16=Office 16.0 UWP
7627dir /b "%ProgramFiles(x86)%\WindowsApps\Microsoft.Office.Desktop*" %nul% && set uwp16=Office 16.0 UWP
7628%psc% "Get-AppxPackage -name "Microsoft.Office.Desktop"" | find /i "Office" 1>nul && set uwp16=Office 16.0 UWP
7629) 9057)
7630 9058
7631set /a counter=0 9059set /a counter=0
@@ -7673,7 +9101,7 @@ echo:
7673call :_color %_Yellow% "A Window will popup, in that Window you need to select [Quick] Repair Option..." 9101call :_color %_Yellow% "A Window will popup, in that Window you need to select [Quick] Repair Option..."
7674call :_color %_Yellow% "Press any key to continue..." 9102call :_color %_Yellow% "Press any key to continue..."
7675echo: 9103echo:
7676pause >nul 9104pause %nul1%
7677) 9105)
7678 9106
7679if defined uwp16 ( 9107if defined uwp16 (
@@ -7742,12 +9170,15 @@ goto :at_back
7742 9170
7743echo: 9171echo:
7744echo Checking WMI 9172echo Checking WMI
9173call :checkwmi
7745 9174
7746set error= 9175:: Apply basic fix first and check
7747wmic path Win32_ComputerSystem get CreationClassName /value 2>nul | find /i "computersystem" 1>nul 9176
7748if %errorlevel% NEQ 0 set error=1 9177if defined error (
7749winmgmt /verifyrepository %nul% 9178call :_stopservice Winmgmt
7750if %errorlevel% NEQ 0 set error=1 9179winmgmt /salvagerepository %nul%
9180call :checkwmi
9181)
7751 9182
7752if not defined error ( 9183if not defined error (
7753echo [Working] 9184echo [Working]
@@ -7757,10 +9188,16 @@ goto :at_back
7757 9188
7758call :_color %Red% "[Not Responding]" 9189call :_color %Red% "[Not Responding]"
7759 9190
9191set _corrupt=
9192sc start Winmgmt %nul%
9193if %errorlevel% EQU 1060 set _corrupt=1
9194sc query Winmgmt %nul% || set _corrupt=1
9195for %%G in (DependOnService Description DisplayName ErrorControl ImagePath ObjectName Start Type) do if not defined _corrupt (reg query HKLM\SYSTEM\CurrentControlSet\Services\Winmgmt /v %%G %nul% || set _corrupt=1)
9196
7760echo: 9197echo:
7761sc query Winmgmt %nul% || ( 9198if defined _corrupt (
7762%eline% 9199%eline%
7763echo Winmgmt service is not installed. Aborting... 9200echo Winmgmt service is corrupted. Aborting...
7764goto :at_back 9201goto :at_back
7765) 9202)
7766 9203
@@ -7779,12 +9216,12 @@ echo Stopping Winmgmt service
7779call :_stopservice Winmgmt 9216call :_stopservice Winmgmt
7780call :_stopservice Winmgmt 9217call :_stopservice Winmgmt
7781call :_stopservice Winmgmt 9218call :_stopservice Winmgmt
7782sc query Winmgmt | find /i "1 STOPPED" %nul% && ( 9219sc query Winmgmt | find /i "STOPPED" %nul% && (
7783echo [Successful] 9220echo [Successful]
7784) || ( 9221) || (
7785call :_color %Red% "[Failed]" 9222call :_color %Red% "[Failed]"
7786echo: 9223echo:
7787call :_color %Magenta% "Its recommended to select [Restart] option and then apply Fix WMI option again." 9224call :_color %Blue% "Its recommended to select [Restart] option and then apply Fix WMI option again."
7788echo %line% 9225echo %line%
7789echo: 9226echo:
7790choice /C:21 /N /M "> [1] Restart [2] Revert Back Changes :" 9227choice /C:21 /N /M "> [1] Restart [2] Revert Back Changes :"
@@ -7813,8 +9250,8 @@ echo [Successful]
7813call :_color %Red% "[Failed]" 9250call :_color %Red% "[Failed]"
7814) 9251)
7815 9252
7816wmic path Win32_ComputerSystem get CreationClassName /value 2>nul | find /i "computersystem" 1>nul 9253call :checkwmi
7817if %errorlevel% EQU 0 ( 9254if not defined error (
7818echo: 9255echo:
7819echo Checking WMI 9256echo Checking WMI
7820call :_color %Green% "[Working]" 9257call :_color %Green% "[Working]"
@@ -7827,8 +9264,8 @@ call :registerobj %nul%
7827 9264
7828echo: 9265echo:
7829echo Checking WMI 9266echo Checking WMI
7830wmic path Win32_ComputerSystem get CreationClassName /value 2>nul | find /i "computersystem" 1>nul 9267call :checkwmi
7831if %errorlevel% NEQ 0 ( 9268if defined error (
7832call :_color %Red% "[Not Responding]" 9269call :_color %Red% "[Not Responding]"
7833echo: 9270echo:
7834echo Run [Dism RestoreHealth] and [SFC Scannow] options and make sure there are no errors. 9271echo Run [Dism RestoreHealth] and [SFC Scannow] options and make sure there are no errors.
@@ -7858,6 +9295,22 @@ winmgmt /salvagerepository
7858winmgmt /resetrepository 9295winmgmt /resetrepository
7859exit /b 9296exit /b
7860 9297
9298:checkwmi
9299
9300:: https://learn.microsoft.com/en-us/windows/win32/wmisdk/wmi-error-constants
9301
9302set error=
9303wmic path Win32_ComputerSystem get CreationClassName /value %nul2% | find /i "computersystem" %nul1%
9304if %errorlevel% NEQ 0 (set error=1& exit /b)
9305winmgmt /verifyrepository %nul%
9306if %errorlevel% NEQ 0 (set error=1& exit /b)
9307
9308cscript //nologo %windir%\system32\slmgr.vbs /dlv %nul%
9309cmd /c exit /b %errorlevel%
9310echo "0x%=ExitCode%" | findstr /i "0x800410 0x800440" %nul1%
9311if %errorlevel% EQU 0 set error=1
9312exit /b
9313
7861::======================================================================================================================================== 9314::========================================================================================================================================
7862 9315
7863:at_back 9316:at_back
@@ -7866,7 +9319,7 @@ echo:
7866echo %line% 9319echo %line%
7867echo: 9320echo:
7868call :_color %_Yellow% "Press any key to go back..." 9321call :_color %_Yellow% "Press any key to go back..."
7869pause >nul 9322pause %nul1%
7870goto :at_menu 9323goto :at_menu
7871 9324
7872::======================================================================================================================================== 9325::========================================================================================================================================
@@ -7875,7 +9328,39 @@ goto :at_menu
7875 9328
7876echo: 9329echo:
7877echo Press any key to %_exitmsg%... 9330echo Press any key to %_exitmsg%...
7878pause >nul 9331pause %nul1%
9332exit /b
9333
9334::========================================================================================================================================
9335
9336:compresslog
9337
9338:: https://stackoverflow.com/a/46268232
9339
9340set "ddf="%SystemRoot%\Temp\ddf""
9341%nul% del /q /f %ddf%
9342echo/.New Cabinet>%ddf%
9343echo/.set Cabinet=ON>>%ddf%
9344echo/.set CabinetFileCountThreshold=0;>>%ddf%
9345echo/.set Compress=ON>>%ddf%
9346echo/.set CompressionType=LZX>>%ddf%
9347echo/.set CompressionLevel=7;>>%ddf%
9348echo/.set CompressionMemory=21;>>%ddf%
9349echo/.set FolderFileCountThreshold=0;>>%ddf%
9350echo/.set FolderSizeThreshold=0;>>%ddf%
9351echo/.set GenerateInf=OFF>>%ddf%
9352echo/.set InfFileName=nul>>%ddf%
9353echo/.set MaxCabinetSize=0;>>%ddf%
9354echo/.set MaxDiskFileCount=0;>>%ddf%
9355echo/.set MaxDiskSize=0;>>%ddf%
9356echo/.set MaxErrors=1;>>%ddf%
9357echo/.set RptFileName=nul>>%ddf%
9358echo/.set UniqueFiles=ON>>%ddf%
9359for /f "tokens=* delims=" %%D in ('dir /a:-D/b/s "%SystemRoot%\logs\%1"') do (
9360 echo/"%%~fD" /inf=no;>>%ddf%
9361)
9362makecab /F %ddf% /D DiskDirectory1="" /D CabinetNameTemplate="!desktop!\AT_Logs\%2_%_time%.cab"
9363del /q /f %ddf%
7879exit /b 9364exit /b
7880 9365
7881::======================================================================================================================================== 9366::========================================================================================================================================
@@ -7998,234 +9483,49 @@ $key.SetAccessControl($acl)
7998 9483
7999:+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 9484:+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
8000 9485
8001:insert_hwidkey 9486:change_edition
8002@setlocal DisableDelayedExpansion 9487@setlocal DisableDelayedExpansion
8003@echo off 9488@echo off
8004 9489
9490:: To stage current edition while changing edition with CBS Upgrade Method, change 0 to 1 in below line
9491set _stg=0
9492
9493::========================================================================================================================================
9494
8005cls 9495cls
8006color 07 9496color 07
8007title Install Windows HWID Key 9497title Change Windows Edition
8008 9498
8009set _args= 9499set _args=
8010set _elev= 9500set _elev=
8011set _unattended=0
8012 9501
8013set _args=%* 9502set _args=%*
8014if defined _args set _args=%_args:"=% 9503if defined _args set _args=%_args:"=%
8015if defined _args ( 9504if defined _args (
8016for %%A in (%_args%) do ( 9505for %%A in (%_args%) do (
8017if /i "%%A"=="-el" set _elev=1 9506if /i "%%A"=="-el" set _elev=1
8018if /i "%%A"=="/Insert-HWID-Key" set _unattended=1
8019) 9507)
8020) 9508)
8021 9509
8022::======================================================================================================================================== 9510set "nul1=1>nul"
8023 9511set "nul2=2>nul"
8024set winbuild=1 9512set "nul6=2^>nul"
8025set "nul=>nul 2>&1" 9513set "nul=>nul 2>&1"
8026set psc=powershell.exe
8027for /f "tokens=6 delims=[]. " %%G in ('ver') do set winbuild=%%G
8028
8029set _NCS=1
8030if %winbuild% LSS 10586 set _NCS=0
8031if %winbuild% GEQ 10586 reg query "HKCU\Console" /v ForceV2 2>nul | find /i "0x0" 1>nul && (set _NCS=0)
8032
8033if %_NCS% EQU 1 (
8034for /F %%a in ('echo prompt $E ^| cmd') do set "esc=%%a"
8035set "Red="41;97m""
8036set "Green="42;97m""
8037set "_Green="40;92m""
8038set "_Yellow="40;93m""
8039) else (
8040set "Red="Red" "white""
8041set "Green="DarkGreen" "white""
8042set "_Green="Black" "Green""
8043set "_Yellow="Black" "Yellow""
8044)
8045
8046set "nceline=echo: &echo ==== ERROR ==== &echo:"
8047set "eline=echo: &call :dk_color %Red% "==== ERROR ====" &echo:"
8048set "line=echo ___________________________________________________________________________________________"
8049if %~z0 GEQ 200000 (set "_exitmsg=Go back") else (set "_exitmsg=Exit")
8050
8051::========================================================================================================================================
8052
8053if %winbuild% LSS 10240 (
8054%eline%
8055echo Unsupported OS version detected.
8056echo This option is supported only for Windows 10/11.
8057goto ins_done
8058)
8059
8060if exist "%SystemRoot%\Servicing\Packages\Microsoft-Windows-Server*Edition~*.mum" (
8061%eline%
8062echo HWID Activation is not supported for Windows Server.
8063goto ins_done
8064)
8065
8066::========================================================================================================================================
8067
8068:: Fix for the special characters limitation in path name
8069 9514
8070set "_work=%~dp0"
8071if "%_work:~-1%"=="\" set "_work=%_work:~0,-1%"
8072
8073set "_batf=%~f0"
8074set "_batp=%_batf:'=''%"
8075
8076set _PSarg="""%~f0""" -el %_args%
8077
8078set "_ttemp=%temp%"
8079
8080setlocal EnableDelayedExpansion
8081
8082::========================================================================================================================================
8083
8084cls
8085mode 98, 30
8086echo:
8087echo Initializing...
8088call :dk_product
8089call :dk_ckeckwmic
8090call :dk_actids
8091
8092::========================================================================================================================================
8093
8094:: Check SKU value / Check in multiple places to find Edition change corruption
8095
8096set osSKU=
8097set regSKU=
8098set wmiSKU=
8099
8100for /f "tokens=3 delims=." %%a in ('reg query "HKLM\SYSTEM\CurrentControlSet\Control\ProductOptions" /v OSProductPfn 2^>nul') do set "regSKU=%%a"
8101if %_wmic% EQU 1 for /f "tokens=2 delims==" %%a in ('"wmic Path Win32_OperatingSystem Get OperatingSystemSKU /format:LIST" 2^>nul') do if not errorlevel 1 set "wmiSKU=%%a"
8102if %_wmic% EQU 0 for /f "tokens=1" %%a in ('%psc% "([WMI]'Win32_OperatingSystem=@').OperatingSystemSKU" 2^>nul') do if not errorlevel 1 set "wmiSKU=%%a"
8103
8104set osSKU=%wmiSKU%
8105if not defined osSKU set osSKU=%regSKU%
8106
8107if not defined osSKU (
8108%eline%
8109echo SKU value was not detected properly. Aborting...
8110goto ins_done
8111)
8112
8113::========================================================================================================================================
8114
8115:: Detect key
8116
8117set key=
8118set _channel=
8119set actidnotfound=
8120
8121for /f "skip=2 tokens=2*" %%a in ('reg query "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion" /v BuildBranch 2^>nul') do set "branch=%%b"
8122
8123if defined applist call :hwiddata key attempt1
8124if not defined key call :hwiddata key attempt2
8125
8126if not defined key (
8127%eline%
8128echo [%winos% ^| %winbuild% ^| SKU:%osSKU%]
8129echo Unable to find this product in the HWID supported product list.
8130echo Make sure you are using updated version of the script.
8131echo https://massgrave.dev
8132goto ins_done
8133)
8134
8135::========================================================================================================================================
8136
8137if %_unattended%==1 goto insertkey
8138
8139cls
8140%line%
8141echo:
8142echo Install [%winos% ^| SKU:%osSKU% ^| %winbuild%] %channel% Key
8143echo [%key%]
8144%line%
8145echo:
8146if not "%regSKU%"=="%wmiSKU%" (
8147echo Note: Difference Found In SKU Value- WMI:%wmiSKU% Reg:%regSKU%
8148echo:
8149)
8150call :dk_color %_Green% "Press [1] to Continue or [0] to %_exitmsg%"
8151choice /C:01 /N
8152if %errorlevel%==1 exit /b
8153
8154::========================================================================================================================================
8155
8156:insertkey
8157
8158cls
8159%line%
8160
8161if %_wmic% EQU 1 wmic path SoftwareLicensingService where __CLASS='SoftwareLicensingService' call InstallProductKey ProductKey="%key%" %nul%
8162if %_wmic% EQU 0 %psc% "(([WMISEARCHER]'SELECT Version FROM SoftwareLicensingService').Get()).InstallProductKey('%key%')" %nul%
8163if not %errorlevel%==0 cscript //nologo %windir%\system32\slmgr.vbs /ipk %key% %nul%
8164
8165set error_code=%errorlevel%
8166cmd /c exit /b %error_code%
8167if %error_code% NEQ 0 set "error_code=[0x%=ExitCode%]"
8168
8169echo:
8170echo [%winos% ^| SKU:%osSKU% ^| %winbuild%]
8171
8172
8173if %error_code% EQU 0 (
8174call :dk_refresh
8175call :dk_channel
8176call echo Installing %%_channel%% [%key%]
8177echo:
8178call :dk_color %Green% "[Successful]"
8179) else (
8180echo Installing [%key%]
8181echo:
8182call :dk_color %Red% "[Unsuccessful] %error_code%"
8183if defined actidnotfound call :dk_color %Red% "Activation ID not found for this key."
8184echo Check this page for help https://massgrave.dev/troubleshoot
8185)
8186%line%
8187
8188::========================================================================================================================================
8189
8190:ins_done
8191
8192echo:
8193if %_unattended%==1 timeout /t 2 & exit /b
8194call :dk_color %_Yellow% "Press any key to %_exitmsg%..."
8195pause >nul
8196exit /b
8197
8198:+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
8199
8200:change_edition
8201@setlocal DisableDelayedExpansion
8202@echo off
8203
8204:: To stage current edition while changing edition with CBS Upgrade Method, change 0 to 1 in below line
8205set _stg=0
8206
8207cls
8208color 07
8209title Change Windows Edition
8210
8211set _elev=
8212if /i "%~1"=="-el" set _elev=1
8213
8214set winbuild=1
8215set "nul=>nul 2>&1"
8216set psc=powershell.exe 9515set psc=powershell.exe
9516set winbuild=1
8217for /f "tokens=6 delims=[]. " %%G in ('ver') do set winbuild=%%G 9517for /f "tokens=6 delims=[]. " %%G in ('ver') do set winbuild=%%G
8218 9518
8219set _NCS=1 9519set _NCS=1
8220if %winbuild% LSS 10586 set _NCS=0 9520if %winbuild% LSS 10586 set _NCS=0
8221if %winbuild% GEQ 10586 reg query "HKCU\Console" /v ForceV2 2>nul | find /i "0x0" 1>nul && (set _NCS=0) 9521if %winbuild% GEQ 10586 reg query "HKCU\Console" /v ForceV2 %nul2% | find /i "0x0" %nul1% && (set _NCS=0)
8222 9522
8223if %_NCS% EQU 1 ( 9523if %_NCS% EQU 1 (
8224for /F %%a in ('echo prompt $E ^| cmd') do set "esc=%%a" 9524for /F %%a in ('echo prompt $E ^| cmd') do set "esc=%%a"
8225set "Red="41;97m"" 9525set "Red="41;97m""
8226set "Gray="100;97m"" 9526set "Gray="100;97m""
8227set "Green="42;97m"" 9527set "Green="42;97m""
8228set "Magenta="45;97m"" 9528set "Blue="44;97m""
8229set "_White="40;37m"" 9529set "_White="40;37m""
8230set "_Green="40;92m"" 9530set "_Green="40;92m""
8231set "_Yellow="40;93m"" 9531set "_Yellow="40;93m""
@@ -8233,7 +9533,7 @@ set "_Yellow="40;93m""
8233set "Red="Red" "white"" 9533set "Red="Red" "white""
8234set "Gray="Darkgray" "white"" 9534set "Gray="Darkgray" "white""
8235set "Green="DarkGreen" "white"" 9535set "Green="DarkGreen" "white""
8236set "Magenta="Darkmagenta" "white"" 9536set "Blue="Blue" "white""
8237set "_White="Black" "Gray"" 9537set "_White="Black" "Gray""
8238set "_Green="Black" "Green"" 9538set "_Green="Black" "Green""
8239set "_Yellow="Black" "Yellow"" 9539set "_Yellow="Black" "Yellow""
@@ -8286,43 +9586,41 @@ echo:
8286:: Check Activation IDs 9586:: Check Activation IDs
8287 9587
8288call :dk_actids 9588call :dk_actids
8289 9589if not defined applist (
9590net stop sppsvc /y %nul%
9591cscript //nologo %windir%\system32\slmgr.vbs /rilc %nul%
9592if !errorlevel! NEQ 0 cscript //nologo %windir%\system32\slmgr.vbs /rilc %nul%
9593call :dk_refresh
9594call :dk_actids
8290if not defined applist ( 9595if not defined applist (
8291%eline% 9596%eline%
8292echo Activation IDs not found. Aborting... 9597echo Activation IDs not found. Aborting...
8293echo: 9598echo:
8294echo Check this page for help. https://massgrave.dev/troubleshoot 9599echo Check this page for help. https://%mas%/troubleshoot
8295goto ced_done 9600goto ced_done
8296) 9601)
8297
8298:: Check Windows Edition
8299
8300set osedition=
8301for /f "tokens=3 delims=: " %%a in ('DISM /English /Online /Get-CurrentEdition 2^>nul ^| find /i "Current Edition :"') do set "osedition=%%a"
8302
8303if "%osedition%"=="" (
8304%eline%
8305DISM /English /Online /Get-CurrentEdition %nul%
8306cmd /c exit /b !errorlevel!
8307echo DISM command failed [Error Code - 0x!=ExitCode!]
8308echo OS Edition was not detected properly. Aborting...
8309echo:
8310echo Check this page for help. https://massgrave.dev/troubleshoot
8311goto ced_done
8312) 9602)
8313 9603
9604::========================================================================================================================================
9605
8314:: Check SKU value 9606:: Check SKU value
8315 9607
8316set osSKU= 9608set osSKU=
8317set regSKU= 9609set slcSKU=
8318set wmiSKU= 9610set wmiSKU=
8319 9611
8320for /f "tokens=3 delims=." %%a in ('reg query "HKLM\SYSTEM\CurrentControlSet\Control\ProductOptions" /v OSProductPfn 2^>nul') do set "regSKU=%%a" 9612if %winbuild% GEQ 14393 (set info=Kernel-BrandingInfo) else (set info=Kernel-ProductInfo)
8321if %_wmic% EQU 1 for /f "tokens=2 delims==" %%a in ('"wmic Path Win32_OperatingSystem Get OperatingSystemSKU /format:LIST" 2^>nul') do if not errorlevel 1 set "wmiSKU=%%a" 9613set d1=%ref% [void]$TypeBuilder.DefinePInvokeMethod('SLGetWindowsInformationDWORD', 'slc.dll', 'Public, Static', 1, [int], @([String], [int].MakeByRefType()), 1, 3);
8322if %_wmic% EQU 0 for /f "tokens=1" %%a in ('%psc% "([WMI]'Win32_OperatingSystem=@').OperatingSystemSKU" 2^>nul') do if not errorlevel 1 set "wmiSKU=%%a" 9614set d1=%d1% $Sku = 0; [void]$TypeBuilder.CreateType()::SLGetWindowsInformationDWORD('%info%', [ref]$Sku); $Sku
9615for /f "delims=" %%s in ('"%psc% %d1%"') do if not errorlevel 1 (set slcSKU=%%s)
9616if "%slcSKU%"=="0" set slcSKU=
9617if 1%slcSKU% NEQ +1%slcSKU% set slcSKU=
8323 9618
8324set osSKU=%wmiSKU% 9619if %_wmic% EQU 1 for /f "tokens=2 delims==" %%a in ('"wmic Path Win32_OperatingSystem Get OperatingSystemSKU /format:LIST" %nul6%') do if not errorlevel 1 set "wmiSKU=%%a"
8325if not defined osSKU set osSKU=%regSKU% 9620if %_wmic% EQU 0 for /f "tokens=1" %%a in ('%psc% "([WMI]'Win32_OperatingSystem=@').OperatingSystemSKU" %nul6%') do if not errorlevel 1 set "wmiSKU=%%a"
9621
9622set osSKU=%slcSKU%
9623if not defined osSKU set osSKU=%wmiSKU%
8326 9624
8327if not defined osSKU ( 9625if not defined osSKU (
8328%eline% 9626%eline%
@@ -8330,14 +9628,56 @@ echo SKU value was not detected properly. Aborting...
8330goto ced_done 9628goto ced_done
8331) 9629)
8332 9630
9631::========================================================================================================================================
9632
9633:: Check Windows Edition
9634
9635set osedition=
9636set dismedition=
9637set dismnotworking=
9638
9639set d1=%ref% [void]$TypeBuilder.DefinePInvokeMethod('SLGetWindowsInformation', 'slc.dll', 22, 1, [int], @([String], [int], [int].MakeByRefType(), [String].MakeByRefType()), 1, 3);
9640set d1=%d1% $editionName = 0; [void]$TypeBuilder.CreateType()::SLGetWindowsInformation('Kernel-EditionName', 0, [ref]0, [ref]$editionName); $editionName
9641if %winbuild% GEQ 14393 for /f "delims=" %%s in ('"%psc% %d1%"') do if not errorlevel 1 (set osedition=%%s)
9642if "%osedition%"=="0" set osedition=
9643
9644if not defined osedition (
9645for /f "skip=2 tokens=3" %%a in ('reg query "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion" /v EditionID %nul6%') do set "osedition=%%a"
9646)
9647
9648:: Workaround for a Windows bug in builds between 1607 and 1709 where ProfessionalEducation is shown as Professional
9649
9650if %osSKU%==164 set osedition=ProfessionalEducation
9651if %osSKU%==165 set osedition=ProfessionalEducationN
9652
9653for /f "tokens=3 delims=: " %%a in ('DISM /English /Online /Get-CurrentEdition %nul6% ^| find /i "Current Edition :"') do set "dismedition=%%a"
9654if not defined dismedition set dismnotworking=1
9655
9656if defined dismedition if not defined osedition set osedition=%dismedition%
9657
9658if not defined osedition (
9659%eline%
9660DISM /English /Online /Get-CurrentEdition %nul%
9661cmd /c exit /b !errorlevel!
9662echo DISM command failed [Error Code - 0x!=ExitCode!]
9663echo OS Edition was not detected properly. Aborting...
9664echo:
9665echo Check this page for help. https://%mas%/troubleshoot
9666goto ced_done
9667)
9668
9669::========================================================================================================================================
9670
8333set branch= 9671set branch=
8334for /f "skip=2 tokens=2*" %%a in ('reg query "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion" /v BuildBranch 2^>nul') do set "branch=%%b" 9672for /f "skip=2 tokens=2*" %%a in ('reg query "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion" /v BuildBranch %nul6%') do set "branch=%%b"
8335 9673
8336:: Check PowerShell 9674:: Check PowerShell
8337 9675
8338%psc% $ExecutionContext.SessionState.LanguageMode 2>nul | find /i "Full" 1>nul || ( 9676%psc% $ExecutionContext.SessionState.LanguageMode %nul2% | find /i "Full" %nul1% || (
8339%eline% 9677%eline%
8340echo PowerShell is not responding properly. Aborting... 9678echo PowerShell is not responding properly. Aborting...
9679echo:
9680echo Check this page for help. https://%mas%/troubleshoot
8341goto ced_done 9681goto ced_done
8342) 9682)
8343 9683
@@ -8349,15 +9689,22 @@ set _target=
8349set _dtarget= 9689set _dtarget=
8350set _ptarget= 9690set _ptarget=
8351set _ntarget= 9691set _ntarget=
9692set _wtarget=
9693
9694if %winbuild% GEQ 10240 for /f "tokens=4" %%a in ('dism /online /english /Get-TargetEditions ^| findstr /i /c:"Target Edition : "') do (if defined _dtarget (set "_dtarget= !_dtarget! %%a ") else (set "_dtarget= %%a "))
9695if %winbuild% LSS 10240 for /f "tokens=4" %%a in ('%psc% "$f=[io.file]::ReadAllText('!_batp!') -split ':cbsxml\:.*';& ([ScriptBlock]::Create($f[1])) -GetTargetEditions;" ^| findstr /i /c:"Target Edition : "') do (if defined _ptarget (set "_ptarget= !_ptarget! %%a ") else (set "_ptarget= %%a "))
8352 9696
8353if %winbuild% GEQ 10240 for /f "tokens=4" %%a in ('dism /online /english /Get-TargetEditions ^| findstr /i /c:"Target Edition : "') do (if defined _dtarget (set "_dtarget=!_dtarget! %%a") else (set "_dtarget=%%a")) 9697if %winbuild% GEQ 10240 if not exist "%SystemRoot%\Servicing\Packages\Microsoft-Windows-Server*Edition~*.mum" (
8354for /f "tokens=4" %%a in ('%psc% "$f=[io.file]::ReadAllText('!_batp!') -split ':cbsxml\:.*';& ([ScriptBlock]::Create($f[1])) -GetTargetEditions;" ^| findstr /i /c:"Target Edition : "') do (if defined _ptarget (set "_ptarget=!_ptarget! %%a") else (set "_ptarget=%%a")) 9698call :ced_edilist
9699if /i "%osedition:~0,4%"=="Core" (set "_wtarget= Professional !_wtarget! ")
9700set "_dtarget= %_dtarget% !_wtarget! "
9701)
8355 9702
8356::======================================================================================================================================== 9703::========================================================================================================================================
8357 9704
8358:: Block the change to/from CountrySpecific and CloudEdition editions 9705:: Block the change to/from CloudEdition editions
8359 9706
8360for %%# in (99 139 202 203) do if %osSKU%==%%# ( 9707for %%# in (202 203) do if %osSKU%==%%# (
8361%eline% 9708%eline%
8362echo [%winos% ^| SKU:%osSKU% ^| %winbuild%] 9709echo [%winos% ^| SKU:%osSKU% ^| %winbuild%]
8363echo It's not recommended to change this installed edition to any other. 9710echo It's not recommended to change this installed edition to any other.
@@ -8365,8 +9712,8 @@ echo Aborting...
8365goto ced_done 9712goto ced_done
8366) 9713)
8367 9714
8368for %%# in ( %_dtarget% %_ptarget% ) do ( 9715for %%# in ( %_dtarget% %_ptarget% ) do if /i not "%%#"=="%osedition%" (
8369echo "!_target!" | find /i " %%# " 1>nul || set "_target=!_target! %%# " 9716echo "!_target!" | find /i " %%# " %nul1% || set "_target= !_target! %%# "
8370) 9717)
8371 9718
8372if defined _target ( 9719if defined _target (
@@ -8378,6 +9725,7 @@ echo %%# | findstr /i "CountrySpecific CloudEdition" %nul% || (set "_ntarget=!_n
8378if not defined _ntarget ( 9725if not defined _ntarget (
8379%line% 9726%line%
8380echo: 9727echo:
9728if defined dismnotworking call :dk_color %Red% "DISM.exe is not responding."
8381call :dk_color %Gray% "Target Edition not found." 9729call :dk_color %Gray% "Target Edition not found."
8382echo Current Edition [%osedition% ^| %winbuild%] can not be changed to any other Edition. 9730echo Current Edition [%osedition% ^| %winbuild%] can not be changed to any other Edition.
8383%line% 9731%line%
@@ -8391,7 +9739,6 @@ goto ced_done
8391cls 9739cls
8392mode 98, 30 9740mode 98, 30
8393set inpt= 9741set inpt=
8394set note=
8395set counter=0 9742set counter=0
8396set verified=0 9743set verified=0
8397set targetedition= 9744set targetedition=
@@ -8399,21 +9746,16 @@ set targetedition=
8399%line% 9746%line%
8400echo: 9747echo:
8401call :dk_color %Gray% "You can change the Edition [%osedition%] [%winbuild%] to one of the following." 9748call :dk_color %Gray% "You can change the Edition [%osedition%] [%winbuild%] to one of the following."
9749if defined dismnotworking (
9750call :dk_color %_Yellow% "Note - DISM.exe is not responding."
9751if /i "%osedition:~0,4%"=="Core" call :dk_color %_Yellow% " - You will see more edition options to choose once its changed to Pro."
9752)
8402%line% 9753%line%
8403echo: 9754echo:
8404 9755
8405for %%A in (%_ntarget%) do ( 9756for %%A in (%_ntarget%) do (
8406set /a counter+=1 9757set /a counter+=1
8407if %winbuild% GEQ 10240 (
8408echo "%_ptarget%" | find /i "%%A" 1>nul && (
8409set note=1
8410call :dk_color2 %_White% "[!counter!] " %Magenta% "%%A"
8411) || (
8412echo [!counter!] %%A
8413)
8414) else (
8415echo [!counter!] %%A 9758echo [!counter!] %%A
8416)
8417set targetedition!counter!=%%A 9759set targetedition!counter!=%%A
8418) 9760)
8419 9761
@@ -8421,10 +9763,6 @@ set targetedition!counter!=%%A
8421echo: 9763echo:
8422echo [0] %_exitmsg% 9764echo [0] %_exitmsg%
8423echo: 9765echo:
8424if defined note (
8425echo Note: CBS Upgrade Method is available for Purple colored editions.
8426echo:
8427)
8428call :dk_color %_Green% "Enter option number in keyboard, and press "Enter":" 9766call :dk_color %_Green% "Enter option number in keyboard, and press "Enter":"
8429set /p inpt= 9767set /p inpt=
8430if "%inpt%"=="" goto cedmenu2 9768if "%inpt%"=="" goto cedmenu2
@@ -8435,71 +9773,26 @@ if %verified%==0 goto cedmenu2
8435 9773
8436::======================================================================================================================================== 9774::========================================================================================================================================
8437 9775
8438cls 9776if %winbuild% LSS 10240 goto :cbsmethod
8439if %winbuild% GEQ 10240 ( 9777if exist "%SystemRoot%\Servicing\Packages\Microsoft-Windows-Server*Edition~*.mum" goto :ced_change_server
8440echo "%_ptarget%" | find /i "%targetedition%" 1>nul && (
8441echo "%_dtarget%" | find /i "%targetedition%" 1>nul && (
8442echo:
8443%line%
8444echo:
8445if exist "%SystemRoot%\Servicing\Packages\Microsoft-Windows-Server*Edition~*.mum" (
8446echo [1] DISM Method [Recommended]
8447) else (
8448echo [1] Changepk Method [Recommended]
8449)
8450echo:
8451echo [2] CBS Upgrade Method [Alternative]
8452echo:
8453echo [0] Go back
8454%line%
8455echo:
8456echo Enter a menu option in the Keyboard:
8457choice /C:120 /N
8458set _el=!errorlevel!
8459if !_el!==3 goto :cedmenu2
8460if !_el!==2 goto :cbsmethod
8461if !_el!==1 REM
8462)
8463)
8464) else (
8465goto :cbsmethod
8466)
8467
8468echo "%_ptarget%" | find /i "%targetedition%" 1>nul && (
8469echo "%_dtarget%" | find /i "%targetedition%" 1>nul || (
8470goto :cbsmethod
8471)
8472)
8473
8474if exist "%SystemRoot%\Servicing\Packages\Microsoft-Windows-Server*Edition~*.mum" (
8475goto :ced_change_server
8476)
8477 9778
8478cls 9779cls
9780mode con cols=105 lines=32
9781
8479set key= 9782set key=
8480set _chan= 9783set _chan=
8481set _changepk=0 9784set _dismapi=0
8482 9785
8483:: Check if changepk.exe or slmgr.vbs is required for edition upgrade 9786:: Check if DISM Api or slmgr.vbs is required for edition upgrade
8484 9787
8485if not exist "%SystemRoot%\System32\spp\tokens\skus\%targetedition%\" ( 9788if not exist "%SystemRoot%\System32\spp\tokens\skus\%targetedition%\" (
8486set _changepk=1 9789set _dismapi=1
8487)
8488
8489if /i "%osedition:~0,4%"=="Core" (
8490if /i not "%targetedition:~0,4%"=="Core" (
8491set _changepk=1
8492)
8493) 9790)
8494 9791
8495if %_changepk%==1 (
8496set "keyflow=Retail Volume:MAK Volume:GVLK OEM:NONSLP OEM:DM"
8497) else (
8498set "keyflow=Retail OEM:NONSLP OEM:DM Volume:MAK Volume:GVLK" 9792set "keyflow=Retail OEM:NONSLP OEM:DM Volume:MAK Volume:GVLK"
8499)
8500 9793
8501if not defined key call :ced_targetSKU %targetedition% 9794call :ced_targetSKU %targetedition%
8502if not defined key if defined targetSKU call :ced_windowskey 9795if defined targetSKU call :ced_windowskey
8503if defined key if defined pkeychannel set _chan=%pkeychannel% 9796if defined key if defined pkeychannel set _chan=%pkeychannel%
8504if not defined key call :changeeditiondata 9797if not defined key call :changeeditiondata
8505 9798
@@ -8507,57 +9800,26 @@ if not defined key (
8507%eline% 9800%eline%
8508echo [%targetedition% ^| %winbuild%] 9801echo [%targetedition% ^| %winbuild%]
8509echo Unable to get product key from pkeyhelper.dll 9802echo Unable to get product key from pkeyhelper.dll
8510echo Make sure you are using updated version of the script. 9803echo:
8511echo https://massgrave.dev 9804echo Check this page for help. https://%mas%/troubleshoot
8512goto ced_done 9805goto ced_done
8513) 9806)
8514 9807
8515::======================================================================================================================================== 9808::========================================================================================================================================
8516 9809
8517%line% 9810:: Changing from Core to Non-Core & Changing editions in Windows build older than 17134 requires "changepk /productkey" or DISM Api method and restart
8518
8519:: Changing from Core to Non-Core & Changing editions in Windows build older than 17134 requires "changepk /productkey" method and restart
8520:: In other cases, editions can be changed instantly with "slmgr /ipk" 9811:: In other cases, editions can be changed instantly with "slmgr /ipk"
8521 9812
8522cls 9813cls
8523if %_changepk%==1 ( 9814%line%
8524echo "%_chan%" | find /i "OEM" >NUL && (
8525%eline%
8526echo [%osedition%] can not be changed to [%targetedition%] Edition due to lack of non OEM keys.
8527echo Non-OEM keys are required to change from Core to Non-Core Editions.
8528goto ced_done
8529)
8530)
8531
8532:ced_loop
8533
8534cls
8535if %_changepk%==1 (
8536for %%a in (l.root-servers.net resolver1.opendns.com download.windowsupdate.com google.com) do (
8537for /f "delims=[] tokens=2" %%# in ('ping -n 1 %%a') do (
8538if not [%%#]==[] (
8539%eline%
8540echo Internet needs to be disconnected to change edition [%osedition%] to [%targetedition%]
8541echo Disconnect the Internet and then press any key...
8542pause >nul
8543goto ced_loop
8544)
8545)
8546)
8547)
8548
8549echo: 9815echo:
8550echo Changing the Current Edition [%osedition%] to [%targetedition%] 9816echo Changing the Current Edition [%osedition%] %winbuild% to [%targetedition%]
8551echo: 9817echo:
8552 9818
8553if %_changepk%==1 ( 9819if %_dismapi%==1 (
8554call :dk_color %Magenta% "Notes-" 9820call :dk_color %Blue% "Notes-"
8555echo:
8556echo - You can safely ignore if error appears in the upgrade Window,
8557echo but in that case you must manually reboot the system.
8558echo: 9821echo:
8559echo - Save your work before continue, system will auto restart. 9822echo - Save your work before continue, system will auto restart.
8560echo - You can connect to Internet after the system restart.
8561echo: 9823echo:
8562echo - You will need to activate with HWID option once the edition is changed. 9824echo - You will need to activate with HWID option once the edition is changed.
8563echo: 9825echo:
@@ -8567,7 +9829,7 @@ if !errorlevel!==1 exit /b
8567 9829
8568::======================================================================================================================================== 9830::========================================================================================================================================
8569 9831
8570if %_changepk%==0 ( 9832if %_dismapi%==0 (
8571echo Installing %_chan% Key [%key%] 9833echo Installing %_chan% Key [%key%]
8572echo: 9834echo:
8573if %_wmic% EQU 1 wmic path SoftwareLicensingService where __CLASS='SoftwareLicensingService' call InstallProductKey ProductKey="%key%" %nul% 9835if %_wmic% EQU 1 wmic path SoftwareLicensingService where __CLASS='SoftwareLicensingService' call InstallProductKey ProductKey="%key%" %nul%
@@ -8585,14 +9847,19 @@ echo:
8585call :dk_color %Gray% "Reboot is required to properly change the Edition." 9847call :dk_color %Gray% "Reboot is required to properly change the Edition."
8586) else ( 9848) else (
8587call :dk_color %Red% "[Unsuccessful] [Error Code: 0x!=ExitCode!]" 9849call :dk_color %Red% "[Unsuccessful] [Error Code: 0x!=ExitCode!]"
9850echo Check this page for help. https://%mas%/troubleshoot
8588) 9851)
8589) 9852)
8590 9853
8591if %_changepk%==1 ( 9854if %_dismapi%==1 (
8592echo: 9855echo:
8593echo Applying the command with %_chan% Key 9856echo Applying the DISM API method with %_chan% Key %key%
8594echo start changepk.exe /ProductKey %key% 9857echo:
8595start changepk.exe /ProductKey %key% 9858%psc% "$f=[io.file]::ReadAllText('!_batp!') -split ':dismapi\:.*';& ([ScriptBlock]::Create($f[1])) %targetedition% %key%;"
9859timeout /t 3 %nul1%
9860echo:
9861call :dk_color %Blue% "Incase of errors, you must restart your system before trying again."
9862echo Check this page for help. https://%mas%/troubleshoot
8596) 9863)
8597%line% 9864%line%
8598 9865
@@ -8604,13 +9871,12 @@ goto ced_done
8604 9871
8605cls 9872cls
8606mode con cols=105 lines=32 9873mode con cols=105 lines=32
8607%nul% %psc% "&{$W=$Host.UI.RawUI.WindowSize;$B=$Host.UI.RawUI.BufferSize;$W.Height=31;$B.Height=200;$Host.UI.RawUI.WindowSize=$W;$Host.UI.RawUI.BufferSize=$B;}" 9874%psc% "&{$W=$Host.UI.RawUI.WindowSize;$B=$Host.UI.RawUI.BufferSize;$W.Height=31;$B.Height=200;$Host.UI.RawUI.WindowSize=$W;$Host.UI.RawUI.BufferSize=$B;}"
8608 9875
8609echo: 9876echo:
8610echo Changing the Current Edition [%osedition%] to [%targetedition%] 9877echo Changing the Current Edition [%osedition%] %winbuild% to [%targetedition%]
8611echo: 9878echo:
8612call :dk_color %Magenta% "Important - Save your work before continue, system will auto reboot." 9879call :dk_color %Blue% "Important - Save your work before continue, system will auto reboot."
8613if %winbuild% GEQ 17034 if %targetedition%==Professional echo - Enterprise Key will be installed instead of Pro, you can quickly change to Pro later.
8614echo: 9880echo:
8615choice /C:01 /N /M "[1] Continue [0] %_exitmsg% : " 9881choice /C:01 /N /M "[1] Continue [0] %_exitmsg% : "
8616if %errorlevel%==1 exit /b 9882if %errorlevel%==1 exit /b
@@ -8621,9 +9887,11 @@ echo:
8621 9887
8622if %_stg%==0 (set stage=) else (set stage=-StageCurrent) 9888if %_stg%==0 (set stage=) else (set stage=-StageCurrent)
8623%psc% "$f=[io.file]::ReadAllText('!_batp!') -split ':cbsxml\:.*';& ([ScriptBlock]::Create($f[1])) -SetEdition %targetedition% %stage%;" 9889%psc% "$f=[io.file]::ReadAllText('!_batp!') -split ':cbsxml\:.*';& ([ScriptBlock]::Create($f[1])) -SetEdition %targetedition% %stage%;"
8624
8625echo: 9890echo:
9891call :dk_color %Blue% "Incase of errors, you must restart your system before trying again."
9892echo Check this page for help. https://%mas%/troubleshoot
8626%line% 9893%line%
9894
8627goto ced_done 9895goto ced_done
8628 9896
8629::======================================================================================================================================== 9897::========================================================================================================================================
@@ -8632,23 +9900,23 @@ goto ced_done
8632 9900
8633cls 9901cls
8634mode con cols=105 lines=32 9902mode con cols=105 lines=32
8635%nul% %psc% "&{$W=$Host.UI.RawUI.WindowSize;$B=$Host.UI.RawUI.BufferSize;$W.Height=31;$B.Height=200;$Host.UI.RawUI.WindowSize=$W;$Host.UI.RawUI.BufferSize=$B;}" 9903%psc% "&{$W=$Host.UI.RawUI.WindowSize;$B=$Host.UI.RawUI.BufferSize;$W.Height=31;$B.Height=200;$Host.UI.RawUI.WindowSize=$W;$Host.UI.RawUI.BufferSize=$B;}"
8636 9904
8637set key= 9905set key=
8638set pkeychannel= 9906set _chan=
8639set "keyflow=Volume:GVLK Retail Volume:MAK OEM:NONSLP OEM:DM" 9907set "keyflow=Volume:GVLK Retail Volume:MAK OEM:NONSLP OEM:DM"
8640call :changeeditionserverdata
8641 9908
8642if not defined key call :ced_targetSKU %targetedition% 9909call :ced_targetSKU %targetedition%
8643if not defined key if defined targetSKU call :ced_windowskey 9910if defined targetSKU call :ced_windowskey
8644if defined key if not defined pkeychannel call :dk_pkeychannel %key% 9911if defined key if defined pkeychannel set _chan=%pkeychannel%
9912if not defined key call :changeeditiondata
8645 9913
8646if not defined key ( 9914if not defined key (
8647%eline% 9915%eline%
8648echo [%targetedition% ^| %winbuild%] 9916echo [%targetedition% ^| %winbuild%]
8649echo Unable to get product key from pkeyhelper.dll 9917echo Unable to get product key from pkeyhelper.dll
8650echo Make sure you are using updated version of the script. 9918echo:
8651echo https://massgrave.dev 9919echo Check this page for help. https://%mas%/troubleshoot
8652goto ced_done 9920goto ced_done
8653) 9921)
8654 9922
@@ -8656,13 +9924,14 @@ goto ced_done
8656 9924
8657cls 9925cls
8658echo: 9926echo:
8659echo Changing the Current Edition [%osedition%] to [%targetedition%] 9927echo Changing the Current Edition [%osedition%] %winbuild% to [%targetedition%]
8660echo: 9928echo:
8661echo Applying the command with %pkeychannel% Key 9929echo Applying the command with %_chan% Key
8662echo DISM /online /Set-Edition:%targetedition% /ProductKey:%key% /AcceptEula 9930echo DISM /online /Set-Edition:%targetedition% /ProductKey:%key% /AcceptEula
8663DISM /online /Set-Edition:%targetedition% /ProductKey:%key% /AcceptEula 9931DISM /online /Set-Edition:%targetedition% /ProductKey:%key% /AcceptEula
8664 9932
8665call :dk_color %Magenta% "Make sure to restart the system." 9933call :dk_color %Blue% "You must restart the system at this stage."
9934echo Help: https://%mas%/troubleshoot
8666 9935
8667::======================================================================================================================================== 9936::========================================================================================================================================
8668 9937
@@ -8670,7 +9939,18 @@ call :dk_color %Magenta% "Make sure to restart the system."
8670 9939
8671echo: 9940echo:
8672call :dk_color %_Yellow% "Press any key to %_exitmsg%..." 9941call :dk_color %_Yellow% "Press any key to %_exitmsg%..."
8673pause >nul 9942pause %nul1%
9943exit /b
9944
9945::========================================================================================================================================
9946
9947:: Get Edition list
9948
9949:ced_edilist
9950
9951if %_wmic% EQU 1 set "chkedi=for /f "tokens=2 delims==" %%a in ('"wmic path SoftwareLicensingProduct where (ApplicationID='55c92734-d682-4d71-983e-d6ec3f16059f') get LicenseFamily /VALUE" %nul6%')"
9952if %_wmic% EQU 0 set "chkedi=for /f "tokens=2 delims==" %%a in ('%psc% "(([WMISEARCHER]'SELECT LicenseFamily FROM SoftwareLicensingProduct WHERE ApplicationID=''55c92734-d682-4d71-983e-d6ec3f16059f''').Get()).LicenseFamily ^| %% {echo ('LicenseFamily='+$_)}" %nul6%')"
9953%chkedi% do (call set "_wtarget= !_wtarget! %%a ")
8674exit /b 9954exit /b
8675 9955
8676::======================================================================================================================================== 9956::========================================================================================================================================
@@ -8932,59 +10212,92 @@ Restart-Computer
8932 10212
8933::======================================================================================================================================== 10213::========================================================================================================================================
8934 10214
10215:: Change edition using DISM API
10216:: Thanks to Alex (aka may, ave9858)
10217
10218:dismapi:[
10219param (
10220 [Parameter()]
10221 [String]$TargetEdition,
10222
10223 [Parameter()]
10224 [String]$Key
10225)
10226
10227$AssemblyBuilder = [AppDomain]::CurrentDomain.DefineDynamicAssembly(4, 1)
10228$ModuleBuilder = $AssemblyBuilder.DefineDynamicModule(2, $False)
10229$TB = $ModuleBuilder.DefineType(0)
10230
10231[void]$TB.DefinePInvokeMethod('DismInitialize', 'DismApi.dll', 22, 1, [int], @([int], [IntPtr], [IntPtr]), 1, 3)
10232[void]$TB.DefinePInvokeMethod('DismOpenSession', 'DismApi.dll', 22, 1, [int], @([String], [IntPtr], [IntPtr], [UInt32].MakeByRefType()), 1, 3)
10233[void]$TB.DefinePInvokeMethod('_DismSetEdition', 'DismApi.dll', 22, 1, [int], @([UInt32], [String], [String], [IntPtr], [IntPtr], [IntPtr]), 1, 3)
10234$Dism = $TB.CreateType()
10235
10236[void]$Dism::DismInitialize(2, 0, 0)
10237$Session = 0
10238[void]$Dism::DismOpenSession('DISM_{53BFAE52-B167-4E2F-A258-0A37B57FF845}', 0, 0, [ref]$Session)
10239if (!$Dism::_DismSetEdition($Session, "$TargetEdition", "$Key", 0, 0, 0)) {
10240 Restart-Computer
10241}
10242:dismapi:]
10243
10244::========================================================================================================================================
10245
8935:: 1st column = Generic Retail/OEM/MAK/GVLK Key 10246:: 1st column = Generic Retail/OEM/MAK/GVLK Key
8936:: 2nd column = Key Type 10247:: 2nd column = Key Type
8937:: 3rd column = WMI Edition ID 10248:: 3rd column = WMI Edition ID
8938:: 4th column = Version name incase same Edition ID is used in different OS versions with different key 10249:: 4th column = Version name incase same Edition ID is used in different OS versions with different key
8939:: Separator = _ 10250:: Separator = _
8940 10251
8941:: Key preference is in the following order. Retail > Volume:MAK > Volume:GVLK > OEM:NONSLP > OEM:DM 10252:: For Windows 10/11 editions, HWID key is listed where ever possible, in Server versions, KMS key is listed where ever possible.
8942:: OEM keys are in last because they can't be used in edition change if "changepk /productkey" method is needed instead of "slmgr /ipk" 10253:: Only RS3 and older version Generic keys are stored here, later ones are extracted from the pkeyhelper.dll itself
8943:: OEM keys are listed here because we don't have other keys for that edition
8944 10254
8945:changeeditiondata 10255:changeeditiondata
8946 10256
10257if %winbuild% GTR 17763 exit /b
10258if exist "%SystemRoot%\Servicing\Packages\Microsoft-Windows-Server*CorEdition~*.mum" (set Cor=Cor) else (set Cor=)
10259
8947set h= 10260set h=
8948for %%# in ( 10261for %%# in (
894944N%h%YX-TK%h%R9D-CCM2%h%D-V6%h%B8F-HQ%h%WWR__Volume:MAK_Enterprise 10262XGV%h%PP-NM%h%H47-7TT%h%HJ-W%h%3FW7-8HV%h%2C__OEM:NONSLP_Enterprise
8950D6R%h%D9-D4%h%N8T-RT9Q%h%X-YW%h%6YT-FC%h%WWJ______Retail_Starter 10263D6R%h%D9-D4%h%N8T-RT9%h%QX-Y%h%W6YT-FCW%h%WJ______Retail_Starter
89513V6%h%Q6-NQ%h%XCX-V8YX%h%R-9Q%h%CYV-QP%h%FCT__Volume:MAK_EnterpriseN 102643V6%h%Q6-NQ%h%XCX-V8Y%h%XR-9%h%QCYV-QPF%h%CT__Volume:MAK_EnterpriseN
89523NF%h%XW-2T%h%27M-2BDW%h%6-4G%h%HRV-68%h%XRX______Retail_StarterN 102653NF%h%XW-2T%h%27M-2BD%h%W6-4%h%GHRV-68X%h%RX______Retail_StarterN
8953VK7%h%JG-NP%h%HTM-C97J%h%M-9M%h%PGT-3V%h%66T______Retail_Professional 10266VK7%h%JG-NP%h%HTM-C97%h%JM-9%h%MPGT-3V6%h%6T______Retail_Professional
89542B8%h%7N-8K%h%FHP-DKV6%h%R-Y2%h%C8J-PK%h%CKT______Retail_ProfessionalN 102672B8%h%7N-8K%h%FHP-DKV%h%6R-Y%h%2C8J-PKC%h%KT______Retail_ProfessionalN
89554CP%h%RK-NM%h%3K3-X6XX%h%Q-RX%h%X86-WX%h%CHW______Retail_CoreN 102684CP%h%RK-NM%h%3K3-X6X%h%XQ-R%h%XX86-WXC%h%HW______Retail_CoreN
8956N24%h%34-X9%h%D7W-8PF6%h%X-8D%h%V9T-8T%h%YMD______Retail_CoreCountrySpecific 10269N24%h%34-X9%h%D7W-8PF%h%6X-8%h%DV9T-8TY%h%MD______Retail_CoreCountrySpecific
8957BT7%h%9Q-G7%h%N6G-PGBY%h%W-4Y%h%WX6-6F%h%4BT______Retail_CoreSingleLanguage 10270BT7%h%9Q-G7%h%N6G-PGB%h%YW-4%h%YWX6-6F4%h%BT______Retail_CoreSingleLanguage
8958YTM%h%G3-N6%h%DKC-DKB7%h%7-7M%h%9GH-8H%h%VX7______Retail_Core 10271YTM%h%G3-N6%h%DKC-DKB%h%77-7%h%M9GH-8HV%h%X7______Retail_Core
8959XKC%h%NC-J2%h%6Q9-KFHD%h%2-FK%h%THY-KD%h%72Y__OEM:NONSLP_PPIPro 10272XKC%h%NC-J2%h%6Q9-KFH%h%D2-F%h%KTHY-KD7%h%2Y__OEM:NONSLP_PPIPro
8960YNM%h%GQ-8R%h%YV3-4PGQ%h%3-C8%h%XTP-7C%h%FBY______Retail_Education 10273YNM%h%GQ-8R%h%YV3-4PG%h%Q3-C%h%8XTP-7CF%h%BY______Retail_Education
896184N%h%GF-MH%h%BT6-FXBX%h%8-QW%h%JK7-DR%h%R8H______Retail_EducationN 1027484N%h%GF-MH%h%BT6-FXB%h%X8-Q%h%WJK7-DRR%h%8H______Retail_EducationN
8962KCN%h%VH-YK%h%WX8-GJJB%h%9-H9%h%FDT-6F%h%7W2__Volume:MAK_EnterpriseS_VB 10275NK9%h%6Y-D9%h%CD8-W44%h%CQ-R%h%8YTK-DYJ%h%WX__OEM:NONSLP_EnterpriseS_RS1
8963VBX%h%36-N7%h%DDY-M9H6%h%2-83%h%BMJ-CP%h%R42__Volume:MAK_EnterpriseS_RS5 10276FWN%h%7H-PF%h%93Q-4GG%h%P8-M%h%8RF3-MDW%h%WW__OEM:NONSLP_EnterpriseS_TH
8964PN3%h%KR-JX%h%M7T-46HM%h%4-MC%h%QGK-7X%h%PJQ__Volume:MAK_EnterpriseS_RS1 102772DB%h%W3-N2%h%PJG-MVH%h%W3-G%h%7TDK-9HK%h%R4__Volume:MAK_EnterpriseSN_RS1
8965DVW%h%KN-3G%h%CMV-Q2XF%h%4-DD%h%PGM-VQ%h%WWY__Volume:MAK_EnterpriseS_TH 10278NTX%h%6B-BR%h%YC2-K67%h%86-F%h%6MVQ-M7V%h%2X__Volume:MAK_EnterpriseSN_TH
8966RQF%h%NW-9T%h%PM3-JQ73%h%T-QV%h%4VQ-DV%h%9PT__Volume:MAK_EnterpriseSN_VB 10279G3K%h%NM-CH%h%G6T-R36%h%X3-9%h%QDG6-8M8%h%K9______Retail_ProfessionalSingleLanguage
8967M33%h%WV-NH%h%Y3C-R7FP%h%M-BQ%h%GPT-23%h%9PG__Volume:MAK_EnterpriseSN_RS5 10280HNG%h%CC-Y3%h%8KG-QVK%h%8D-W%h%MWRK-X86%h%VK______Retail_ProfessionalCountrySpecific
89682DB%h%W3-N2%h%PJG-MVHW%h%3-G7%h%TDK-9H%h%KR4__Volume:MAK_EnterpriseSN_RS1 10281DXG%h%7C-N3%h%6C4-C4H%h%TG-X%h%4T3X-2YV%h%77______Retail_ProfessionalWorkstation
8969NTX%h%6B-BR%h%YC2-K678%h%6-F6%h%MVQ-M7%h%V2X__Volume:MAK_EnterpriseSN_TH 10282WYP%h%NQ-8C%h%467-V2W%h%6J-T%h%X4WX-WT2%h%RQ______Retail_ProfessionalWorkstationN
8970G3K%h%NM-CH%h%G6T-R36X%h%3-9Q%h%DG6-8M%h%8K9______Retail_ProfessionalSingleLanguage 102838PT%h%T6-RN%h%W4C-6V7%h%J2-C%h%2D3X-MHB%h%PB______Retail_ProfessionalEducation
8971HNG%h%CC-Y3%h%8KG-QVK8%h%D-WM%h%WRK-X8%h%6VK______Retail_ProfessionalCountrySpecific 10284GJT%h%YN-HD%h%MQY-FRR%h%76-H%h%VGC7-QPF%h%8P______Retail_ProfessionalEducationN
8972DXG%h%7C-N3%h%6C4-C4HT%h%G-X4%h%T3X-2Y%h%V77______Retail_ProfessionalWorkstation 10285C4N%h%TJ-CX%h%6Q2-VXD%h%MR-X%h%VKGM-F9D%h%JC__Volume:MAK_EnterpriseG
8973WYP%h%NQ-8C%h%467-V2W6%h%J-TX%h%4WX-WT%h%2RQ______Retail_ProfessionalWorkstationN 1028646P%h%N6-R9%h%BK9-CVH%h%KB-H%h%WQ9V-MBJ%h%Y8__Volume:MAK_EnterpriseGN
89748PT%h%T6-RN%h%W4C-6V7J%h%2-C2%h%D3X-MH%h%BPB______Retail_ProfessionalEducation 10287NJC%h%F7-PW%h%8QT-332%h%4D-6%h%88JX-2YV%h%66______Retail_ServerRdsh
8975GJT%h%YN-HD%h%MQY-FRR7%h%6-HV%h%GC7-QP%h%F8P______Retail_ProfessionalEducationN 10288V3W%h%VW-N2%h%PV2-CGW%h%C3-3%h%4QGF-VMJ%h%2C______Retail_Cloud
8976C4N%h%TJ-CX%h%6Q2-VXDM%h%R-XV%h%KGM-F9%h%DJC__Volume:MAK_EnterpriseG 10289NH9%h%J3-68%h%WK7-6FB%h%93-4%h%K3DF-DJ4%h%F6______Retail_CloudN
897746P%h%N6-R9%h%BK9-CVHK%h%B-HW%h%Q9V-MB%h%JY8__Volume:MAK_EnterpriseGN 102902HN%h%6V-HG%h%TM8-6C9%h%7C-R%h%K67V-JQP%h%FD______Retail_CloudE
8978NJC%h%F7-PW%h%8QT-3324%h%D-68%h%8JX-2Y%h%V66______Retail_ServerRdsh 10291WC2%h%BQ-8N%h%RM3-FDD%h%YY-2%h%BFGV-KHK%h%QY_Volume:GVLK_ServerStandard%Cor%_RS1
8979V3W%h%VW-N2%h%PV2-CGWC%h%3-34%h%QGF-VM%h%J2C______Retail_Cloud 10292CB7%h%KF-BW%h%N84-R7R%h%2Y-7%h%93K2-8XD%h%DG_Volume:GVLK_ServerDatacenter%Cor%_RS1
8980NH9%h%J3-68%h%WK7-6FB9%h%3-4K%h%3DF-DJ%h%4F6______Retail_CloudN 10293JCK%h%RF-N3%h%7P4-C2D%h%82-9%h%YXRT-4M6%h%3B_Volume:GVLK_ServerSolution_RS1
89812HN%h%6V-HG%h%TM8-6C97%h%C-RK%h%67V-JQ%h%PFD______Retail_CloudE 10294QN4%h%C6-GB%h%JD2-FB4%h%22-G%h%HWJK-GJG%h%2R_Volume:GVLK_ServerCloudStorage_RS1
8982XQQ%h%YW-NF%h%FMW-XJPB%h%H-K8%h%732-CK%h%FFD______OEM:DM_IoTEnterprise 10295VP3%h%4G-4N%h%PPG-79J%h%TQ-8%h%64T4-R3M%h%QX_Volume:GVLK_ServerAzureCor_RS1
8983QPM%h%6N-7J%h%2WJ-P88H%h%H-P3%h%YRH-YY%h%74H__OEM:NONSLP_IoTEnterpriseS_VB 102969JQ%h%NQ-V8%h%HQ6-PKB%h%8H-G%h%GHRY-R62%h%H6______Retail_ServerAzureNano_RS1
8984KBN%h%8V-HF%h%GQ4-MGXV%h%D-34%h%7P6-PD%h%QGT_Volume:GVLK_IoTEnterpriseS_NI 10297VN8%h%D3-PR%h%82H-DB6%h%BJ-J%h%9P4M-92F%h%6J______Retail_ServerStorageStandard_RS1
8985K9V%h%KN-3B%h%GWV-Y624%h%W-MC%h%RMQ-BH%h%DCD______Retail_CloudEditionN 1029848T%h%QX-NV%h%K3R-D8Q%h%R3-G%h%THHM-8FH%h%XC______Retail_ServerStorageWorkgroup_RS1
8986KY7%h%PN-VR%h%6RX-83W6%h%Y-6D%h%DYQ-T6%h%R4W______Retail_CloudEdition 102992HX%h%DN-KR%h%XHB-GPY%h%C7-Y%h%CKFJ-7FV%h%DG_Volume:GVLK_ServerDatacenterACor_RS3
8987MPB%h%3G-XN%h%BR7-CC43%h%M-FG%h%64B-F9%h%GBK______Retail_IoTEnterpriseSK 10300PTX%h%N8-JF%h%HJM-4WC%h%78-M%h%PCBR-9W4%h%KR_Volume:GVLK_ServerStandardACor_RS3
8988) do ( 10301) do (
8989for /f "tokens=1-4 delims=_" %%A in ("%%#") do if /i %targetedition%==%%C ( 10302for /f "tokens=1-4 delims=_" %%A in ("%%#") do if /i %targetedition%==%%C (
8990 10303
@@ -8993,40 +10306,13 @@ set 4th=%%D
8993if not defined 4th ( 10306if not defined 4th (
8994set "key=%%A" & set "_chan=%%B" 10307set "key=%%A" & set "_chan=%%B"
8995) else ( 10308) else (
8996echo "%branch%" | find "%%D" 1>nul && (set "key=%%A" & set "_chan=%%B") 10309echo "%branch%" | find /i "%%D" %nul1% && (set "key=%%A" & set "_chan=%%B")
8997) 10310)
8998) 10311)
8999) 10312)
9000) 10313)
9001exit /b 10314exit /b
9002 10315
9003::========================================================================================================================================
9004
9005:changeeditionserverdata
9006
9007if exist "%SystemRoot%\Servicing\Packages\Microsoft-Windows-Server*CorEdition~*.mum" (set Cor=Cor) else (set Cor=)
9008
9009:: Only RS3 and older version keys (GVLK/Generic Retail) are stored here, later ones are extracted from the system itself
9010
9011set h=
9012for %%# in (
9013WC2%h%BQ-8N%h%RM3-FDD%h%YY-2B%h%FGV-KHK%h%QY_RS1_ServerStandard%Cor%
9014CB7%h%KF-BW%h%N84-R7R%h%2Y-79%h%3K2-8XD%h%DG_RS1_ServerDatacenter%Cor%
9015JCK%h%RF-N3%h%7P4-C2D%h%82-9Y%h%XRT-4M6%h%3B_RS1_ServerSolution
9016QN4%h%C6-GB%h%JD2-FB4%h%22-GH%h%WJK-GJG%h%2R_RS1_ServerCloudStorage
9017VP3%h%4G-4N%h%PPG-79J%h%TQ-86%h%4T4-R3M%h%QX_RS1_ServerAzureCor
90189JQ%h%NQ-V8%h%HQ6-PKB%h%8H-GG%h%HRY-R62%h%H6_RS1_ServerAzureNano
9019VN8%h%D3-PR%h%82H-DB6%h%BJ-J9%h%P4M-92F%h%6J_RS1_ServerStorageStandard
902048T%h%QX-NV%h%K3R-D8Q%h%R3-GT%h%HHM-8FH%h%XC_RS1_ServerStorageWorkgroup
90212HX%h%DN-KR%h%XHB-GPY%h%C7-YC%h%KFJ-7FV%h%DG_RS3_ServerDatacenterACor
9022PTX%h%N8-JF%h%HJM-4WC%h%78-MP%h%CBR-9W4%h%KR_RS3_ServerStandardACor
9023) do (
9024for /f "tokens=1-3 delims=_" %%A in ("%%#") do if /i %targetedition%==%%C (
9025echo "%branch%" | find /i "%%B" 1>nul && (set "key=%%A")
9026)
9027)
9028exit /b
9029
9030:+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 10316:+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
9031 10317
9032:MASend 10318:MASend
@@ -9036,4 +10322,5 @@ echo Press any key to exit...
9036pause >nul 10322pause >nul
9037exit /b 10323exit /b
9038 10324
9039::End:: \ No newline at end of file 10325::========================================================================================================================================
10326:: Leave empty line below
diff --git a/MAS/Separate-Files-Version/Activators/HWID_Activation.cmd b/MAS/Separate-Files-Version/Activators/HWID_Activation.cmd
index bae73e7..75a9b98 100644
--- a/MAS/Separate-Files-Version/Activators/HWID_Activation.cmd
+++ b/MAS/Separate-Files-Version/Activators/HWID_Activation.cmd
@@ -7,7 +7,7 @@
7:: 7::
8:: This script is a part of 'Microsoft_Activation_Scripts' (MAS) project. 8:: This script is a part of 'Microsoft_Activation_Scripts' (MAS) project.
9:: 9::
10:: Homepage: massgrave[.]dev 10:: Homepage: mass grave[.]dev
11:: Email: windowsaddict@protonmail.com 11:: Email: windowsaddict@protonmail.com
12:: 12::
13::============================================================================ 13::============================================================================
@@ -26,6 +26,13 @@ set _NoEditionChange=0
26 26
27::======================================================================================================================================== 27::========================================================================================================================================
28 28
29:: Set Path variable, it helps if it is misconfigured in the system
30
31set "PATH=%SystemRoot%\System32;%SystemRoot%\System32\wbem;%SystemRoot%\System32\WindowsPowerShell\v1.0\"
32if exist "%SystemRoot%\Sysnative\reg.exe" (
33set "PATH=%SystemRoot%\Sysnative;%SystemRoot%\Sysnative\wbem;%SystemRoot%\Sysnative\WindowsPowerShell\v1.0\;%PATH%"
34)
35
29:: Re-launch the script with x64 process if it was initiated by x86 process on x64 bit Windows 36:: Re-launch the script with x64 process if it was initiated by x86 process on x64 bit Windows
30:: or with ARM64 process if it was initiated by x86/ARM32 process on ARM64 Windows 37:: or with ARM64 process if it was initiated by x86/ARM32 process on ARM64 Windows
31 38
@@ -33,6 +40,10 @@ set "_cmdf=%~f0"
33for %%# in (%*) do ( 40for %%# in (%*) do (
34if /i "%%#"=="r1" set r1=1 41if /i "%%#"=="r1" set r1=1
35if /i "%%#"=="r2" set r2=1 42if /i "%%#"=="r2" set r2=1
43if /i "%%#"=="-qedit" (
44reg add HKCU\Console /v QuickEdit /t REG_DWORD /d "1" /f 1>nul
45rem check the code below admin elevation to understand why it's here
46)
36) 47)
37 48
38if exist %SystemRoot%\Sysnative\cmd.exe if not defined r1 ( 49if exist %SystemRoot%\Sysnative\cmd.exe if not defined r1 (
@@ -49,22 +60,34 @@ start %SystemRoot%\SysArm32\cmd.exe /c ""!_cmdf!" %* r2"
49exit /b 60exit /b
50) 61)
51 62
52:: Set Path variable, it helps if it is misconfigured in the system 63::========================================================================================================================================
53 64
54set "PATH=%SystemRoot%\System32;%SystemRoot%\System32\wbem;%SystemRoot%\System32\WindowsPowerShell\v1.0\" 65set "blank="
55if exist "%SystemRoot%\Sysnative\reg.exe" ( 66set "mas=mass%blank%grave.dev"
56set "PATH=%SystemRoot%\Sysnative;%SystemRoot%\Sysnative\wbem;%SystemRoot%\Sysnative\WindowsPowerShell\v1.0\;%PATH%" 67
68:: Check if Null service is working, it's important for the batch script
69
70sc query Null | find /i "RUNNING"
71if %errorlevel% NEQ 0 (
72echo:
73echo Null service is not running, script may crash...
74echo:
75echo:
76echo Help - https://%mas%/troubleshoot.html
77echo:
78echo:
79ping 127.0.0.1 -n 10
57) 80)
81cls
58 82
59:: Check LF line ending 83:: Check LF line ending
60 84
61pushd "%~dp0" 85pushd "%~dp0"
62>nul findstr /rxc:".*" "%~nx0" 86>nul findstr /v "$" "%~nx0" && (
63if not %errorlevel%==0 (
64echo: 87echo:
65echo Error: Script either has LF line ending issue, or it failed to read itself. 88echo Error: Script either has LF line ending issue or an empty line at the end of the script is missing.
66echo: 89echo:
67ping 127.0.0.1 -n 6 > nul 90ping 127.0.0.1 -n 6 >nul
68popd 91popd
69exit /b 92exit /b
70) 93)
@@ -94,21 +117,25 @@ for %%A in (%_act% %_NoEditionChange%) do (if "%%A"=="1" set _unattended=1)
94 117
95::======================================================================================================================================== 118::========================================================================================================================================
96 119
97set winbuild=1 120set "nul1=1>nul"
121set "nul2=2>nul"
122set "nul6=2^>nul"
98set "nul=>nul 2>&1" 123set "nul=>nul 2>&1"
124
99set psc=powershell.exe 125set psc=powershell.exe
126set winbuild=1
100for /f "tokens=6 delims=[]. " %%G in ('ver') do set winbuild=%%G 127for /f "tokens=6 delims=[]. " %%G in ('ver') do set winbuild=%%G
101 128
102set _NCS=1 129set _NCS=1
103if %winbuild% LSS 10586 set _NCS=0 130if %winbuild% LSS 10586 set _NCS=0
104if %winbuild% GEQ 10586 reg query "HKCU\Console" /v ForceV2 2>nul | find /i "0x0" 1>nul && (set _NCS=0) 131if %winbuild% GEQ 10586 reg query "HKCU\Console" /v ForceV2 %nul2% | find /i "0x0" %nul1% && (set _NCS=0)
105 132
106if %_NCS% EQU 1 ( 133if %_NCS% EQU 1 (
107for /F %%a in ('echo prompt $E ^| cmd') do set "esc=%%a" 134for /F %%a in ('echo prompt $E ^| cmd') do set "esc=%%a"
108set "Red="41;97m"" 135set "Red="41;97m""
109set "Gray="100;97m"" 136set "Gray="100;97m""
110set "Green="42;97m"" 137set "Green="42;97m""
111set "Magenta="45;97m"" 138set "Blue="44;97m""
112set "_White="40;37m"" 139set "_White="40;37m""
113set "_Green="40;92m"" 140set "_Green="40;92m""
114set "_Yellow="40;93m"" 141set "_Yellow="40;93m""
@@ -116,7 +143,7 @@ set "_Yellow="40;93m""
116set "Red="Red" "white"" 143set "Red="Red" "white""
117set "Gray="Darkgray" "white"" 144set "Gray="Darkgray" "white""
118set "Green="DarkGreen" "white"" 145set "Green="DarkGreen" "white""
119set "Magenta="Darkmagenta" "white"" 146set "Blue="Blue" "white""
120set "_White="Black" "Gray"" 147set "_White="Black" "Gray""
121set "_Green="Black" "Green"" 148set "_Green="Black" "Green""
122set "_Yellow="Black" "Yellow"" 149set "_Yellow="Black" "Yellow""
@@ -124,13 +151,19 @@ set "_Yellow="Black" "Yellow""
124 151
125set "nceline=echo: &echo ==== ERROR ==== &echo:" 152set "nceline=echo: &echo ==== ERROR ==== &echo:"
126set "eline=echo: &call :dk_color %Red% "==== ERROR ====" &echo:" 153set "eline=echo: &call :dk_color %Red% "==== ERROR ====" &echo:"
127if %~z0 GEQ 200000 (set "_exitmsg=Go back") else (set "_exitmsg=Exit") 154if %~z0 GEQ 200000 (
155set "_exitmsg=Go back"
156set "_fixmsg=Go back to Main Menu, select Troubleshoot and run Fix Licensing option."
157) else (
158set "_exitmsg=Exit"
159set "_fixmsg=In MAS folder, run Troubleshoot script and select Fix Licensing option."
160)
128 161
129::======================================================================================================================================== 162::========================================================================================================================================
130 163
131if %winbuild% LSS 10240 ( 164if %winbuild% LSS 10240 (
132%eline% 165%eline%
133echo Unsupported OS version detected. 166echo Unsupported OS version detected [%winbuild%].
134echo HWID Activation is supported only for Windows 10/11. 167echo HWID Activation is supported only for Windows 10/11.
135echo Use Online KMS Activation option. 168echo Use Online KMS Activation option.
136goto dk_done 169goto dk_done
@@ -167,7 +200,7 @@ setlocal EnableDelayedExpansion
167 200
168::======================================================================================================================================== 201::========================================================================================================================================
169 202
170echo "!_batf!" | find /i "!_ttemp!" 1>nul && ( 203echo "!_batf!" | find /i "!_ttemp!" %nul1% && (
171if /i not "!_work!"=="!_ttemp!" ( 204if /i not "!_work!"=="!_ttemp!" (
172%eline% 205%eline%
173echo Script is launched from the temp folder, 206echo Script is launched from the temp folder,
@@ -182,8 +215,8 @@ goto dk_done
182 215
183:: Elevate script as admin and pass arguments and preventing loop 216:: Elevate script as admin and pass arguments and preventing loop
184 217
185>nul fltmc || ( 218%nul1% fltmc || (
186if not defined _elev %nul% %psc% "start cmd.exe -arg '/c \"!_PSarg:'=''!\"' -verb runas" && exit /b 219if not defined _elev %psc% "start cmd.exe -arg '/c \"!_PSarg:'=''!\"' -verb runas" && exit /b
187%eline% 220%eline%
188echo This script require admin privileges. 221echo This script require admin privileges.
189echo To do so, right click on this script and select 'Run as administrator'. 222echo To do so, right click on this script and select 'Run as administrator'.
@@ -192,10 +225,29 @@ goto dk_done
192 225
193::======================================================================================================================================== 226::========================================================================================================================================
194 227
228:: This code disables QuickEdit for this cmd.exe session only without making permanent changes to the registry
229:: It is added because clicking on the script window pauses the operation and leads to the confusion that script stopped due to an error
230
231if %_unattended%==1 set quedit=1
232for %%# in (%_args%) do (if /i "%%#"=="-qedit" set quedit=1)
233
234reg query HKCU\Console /v QuickEdit %nul2% | find /i "0x0" %nul1% || if not defined quedit (
235reg add HKCU\Console /v QuickEdit /t REG_DWORD /d "0" /f %nul1%
236start cmd.exe /c ""!_batf!" %_args% -qedit"
237rem quickedit reset code is added at the starting of the script instead of here because it takes time to reflect in some cases
238exit /b
239)
240
241::========================================================================================================================================
242
195cls 243cls
196mode 102, 34 244mode 108, 34
197title HWID Activation 245title HWID Activation
198 246
247:: Start Windows update service at the beginning and in later checks as well, because in some normal conditions one kick is not enough
248
249sc start wuauserv %nul%
250
199echo: 251echo:
200echo Initializing... 252echo Initializing...
201call :dk_product 253call :dk_product
@@ -235,7 +287,7 @@ cls
235:: Check Evaluation version 287:: Check Evaluation version
236 288
237if exist "%SystemRoot%\Servicing\Packages\Microsoft-Windows-*EvalEdition~*.mum" ( 289if exist "%SystemRoot%\Servicing\Packages\Microsoft-Windows-*EvalEdition~*.mum" (
238reg query "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion" /v EditionID 2>nul | find /i "Eval" 1>nul && ( 290reg query "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion" /v EditionID %nul2% | find /i "Eval" %nul1% && (
239%eline% 291%eline%
240echo [%winos% ^| %winbuild%] 292echo [%winos% ^| %winbuild%]
241echo: 293echo:
@@ -243,7 +295,7 @@ echo Evaluation Editions cannot be activated.
243echo You need to install full version of %winos% 295echo You need to install full version of %winos%
244echo: 296echo:
245echo Download it from here, 297echo Download it from here,
246echo https://massgrave.dev/genuine-installation-media.html 298echo https://%mas%/genuine-installation-media.html
247goto dk_done 299goto dk_done
248) 300)
249) 301)
@@ -253,14 +305,23 @@ goto dk_done
253:: Check SKU value / Check in multiple places to find Edition change corruption 305:: Check SKU value / Check in multiple places to find Edition change corruption
254 306
255set osSKU= 307set osSKU=
256set regSKU= 308set slcSKU=
257set wmiSKU= 309set wmiSKU=
310set regSKU=
258 311
259for /f "tokens=3 delims=." %%a in ('reg query "HKLM\SYSTEM\CurrentControlSet\Control\ProductOptions" /v OSProductPfn 2^>nul') do set "regSKU=%%a" 312if %winbuild% GEQ 14393 (set info=Kernel-BrandingInfo) else (set info=Kernel-ProductInfo)
260if %_wmic% EQU 1 for /f "tokens=2 delims==" %%a in ('"wmic Path Win32_OperatingSystem Get OperatingSystemSKU /format:LIST" 2^>nul') do if not errorlevel 1 set "wmiSKU=%%a" 313set d1=%ref% [void]$TypeBuilder.DefinePInvokeMethod('SLGetWindowsInformationDWORD', 'slc.dll', 'Public, Static', 1, [int], @([String], [int].MakeByRefType()), 1, 3);
261if %_wmic% EQU 0 for /f "tokens=1" %%a in ('%psc% "([WMI]'Win32_OperatingSystem=@').OperatingSystemSKU" 2^>nul') do if not errorlevel 1 set "wmiSKU=%%a" 314set d1=%d1% $Sku = 0; [void]$TypeBuilder.CreateType()::SLGetWindowsInformationDWORD('%info%', [ref]$Sku); $Sku
315for /f "delims=" %%s in ('"%psc% %d1%"') do if not errorlevel 1 (set slcSKU=%%s)
316if "%slcSKU%"=="0" set slcSKU=
317if 1%slcSKU% NEQ +1%slcSKU% set slcSKU=
262 318
263set osSKU=%wmiSKU% 319for /f "tokens=3 delims=." %%a in ('reg query "HKLM\SYSTEM\CurrentControlSet\Control\ProductOptions" /v OSProductPfn %nul6%') do set "regSKU=%%a"
320if %_wmic% EQU 1 for /f "tokens=2 delims==" %%a in ('"wmic Path Win32_OperatingSystem Get OperatingSystemSKU /format:LIST" %nul6%') do if not errorlevel 1 set "wmiSKU=%%a"
321if %_wmic% EQU 0 for /f "tokens=1" %%a in ('%psc% "([WMI]'Win32_OperatingSystem=@').OperatingSystemSKU" %nul6%') do if not errorlevel 1 set "wmiSKU=%%a"
322
323set osSKU=%slcSKU%
324if not defined osSKU set osSKU=%wmiSKU%
264if not defined osSKU set osSKU=%regSKU% 325if not defined osSKU set osSKU=%regSKU%
265 326
266if not defined osSKU ( 327if not defined osSKU (
@@ -276,7 +337,8 @@ set error=
276cls 337cls
277echo: 338echo:
278for /f "skip=2 tokens=2*" %%a in ('reg query "HKLM\SYSTEM\CurrentControlSet\Control\Session Manager\Environment" /v PROCESSOR_ARCHITECTURE') do set arch=%%b 339for /f "skip=2 tokens=2*" %%a in ('reg query "HKLM\SYSTEM\CurrentControlSet\Control\Session Manager\Environment" /v PROCESSOR_ARCHITECTURE') do set arch=%%b
279echo Checking OS Info [%winos% ^| %winbuild% ^| %arch%] 340for /f "tokens=6-7 delims=[]. " %%i in ('ver') do if "%%j"=="" (set fullbuild=%%i) else (set fullbuild=%%i.%%j)
341echo Checking OS Info [%winos% ^| %fullbuild% ^| %arch%]
280 342
281:: Check Internet connection 343:: Check Internet connection
282 344
@@ -302,8 +364,8 @@ call :dk_color %Red% "Checking Internet Connection [Not Connected]"
302:: Check Windows Script Host 364:: Check Windows Script Host
303 365
304set _WSH=1 366set _WSH=1
305reg query "HKCU\SOFTWARE\Microsoft\Windows Script Host\Settings" /v Enabled 2>nul | find /i "0x0" 1>nul && (set _WSH=0) 367reg query "HKCU\SOFTWARE\Microsoft\Windows Script Host\Settings" /v Enabled %nul2% | find /i "0x0" %nul1% && (set _WSH=0)
306reg query "HKLM\SOFTWARE\Microsoft\Windows Script Host\Settings" /v Enabled 2>nul | find /i "0x0" 1>nul && (set _WSH=0) 368reg query "HKLM\SOFTWARE\Microsoft\Windows Script Host\Settings" /v Enabled %nul2% | find /i "0x0" %nul1% && (set _WSH=0)
307 369
308if %_WSH% EQU 0 ( 370if %_WSH% EQU 0 (
309reg add "HKLM\Software\Microsoft\Windows Script Host\Settings" /v Enabled /t REG_DWORD /d 1 /f %nul% 371reg add "HKLM\Software\Microsoft\Windows Script Host\Settings" /v Enabled /t REG_DWORD /d 1 /f %nul%
@@ -331,24 +393,29 @@ call :dk_errorcheck
331:: Check Windows updates and store app blockers 393:: Check Windows updates and store app blockers
332 394
333set updatesblock= 395set updatesblock=
334echo: %serv_ste% | findstr /i "wuauserv" %nul% && set updatesblock=1 396echo: %serv_cor% %serv_ste% | findstr /i "wuauserv" %nul% && set updatesblock=1
335for /f "skip=2 tokens=2*" %%a in ('reg query HKLM\SYSTEM\CurrentControlSet\Services\UsoSvc /v Start 2^>nul') do if /i %%b equ 0x4 set updatesblock=1 397
336if exist "%SystemRoot%\System32\WaaSMedicSvc.dll" ( 398sc start UsoSvc %nul%
337for /f "skip=2 tokens=2*" %%a in ('reg query HKLM\SYSTEM\CurrentControlSet\Services\WaaSMedicSvc /v Start 2^>nul') do if /i %%b equ 0x4 set updatesblock=1 399if %errorlevel% NEQ 1056 if %errorlevel% NEQ 0 set updatesblock=1
400
401if %winbuild% GEQ 17134 (
402sc start WaaSMedicSvc %nul%
403if !errorlevel! NEQ 1056 if !errorlevel! NEQ 0 set updatesblock=1
338) 404)
339 405
340reg query HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer /v SettingsPageVisibility 2>nul | find /i "windowsupdate" %nul% && set updatesblock=1 406reg query HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer /v SettingsPageVisibility %nul2% | find /i "windowsupdate" %nul% && set updatesblock=1
341reg query HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\WindowsUpdateSysprepInProgress %nul% && set updatesblock=1 407reg query HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\WindowsUpdateSysprepInProgress %nul% && set updatesblock=1
342reg query HKLM\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate /s 2>nul | findstr /i "NoAutoUpdate DisableWindowsUpdateAccess" %nul% && set updatesblock=1 408reg query HKLM\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate /s %nul2% | findstr /i "NoAutoUpdate DisableWindowsUpdateAccess" %nul% && set updatesblock=1
343 409
344if defined updatesblock ( 410if defined updatesblock (
345call :dk_color %Gray% "Checking Windows Update Blockers [Found]" 411call :dk_color %Gray% "Checking Windows Update Blockers [Found]"
346if defined applist echo: %serv_e% | find /i "wuauserv" %nul% && ( 412if defined applist echo: %serv_e% | find /i "wuauserv" %nul% && (
347call :dk_color %Magenta% "Windows Update Service [wuauserv] is not working. Enable it incase if you have disabled it." 413call :dk_color %Blue% "Windows Update is not working. Enable it incase if you have disabled it."
414reg query HKLM\SYSTEM\CurrentControlSet\Services\wuauserv /v WubLock %nul% && call :dk_color %Blue% "Sordum Windows Update Blocker tool has been used to block updates."
348) 415)
349) 416)
350 417
351reg query "HKLM\SOFTWARE\Policies\Microsoft\WindowsStore" /v DisableStoreApps 2>nul | find /i "0x1" %nul% && ( 418reg query "HKLM\SOFTWARE\Policies\Microsoft\WindowsStore" /v DisableStoreApps %nul2% | find /i "0x1" %nul% && (
352call :dk_color %Gray% "Checking Store App Blocker [Found]" 419call :dk_color %Gray% "Checking Store App Blocker [Found]"
353) 420)
354 421
@@ -359,15 +426,15 @@ call :dk_color %Gray% "Checking Store App Blocker [Found]"
359set key= 426set key=
360set altkey= 427set altkey=
361set changekey= 428set changekey=
362set curedition= 429set altapplist=
363set altedition= 430set altedition=
364set notworking= 431set notworking=
365set actidnotfound=
366
367for /f "skip=2 tokens=2*" %%a in ('reg query "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion" /v BuildBranch 2^>nul') do set "branch=%%b"
368 432
369if defined applist call :hwiddata key attempt1 433if defined applist call :hwiddata key
370if not defined key call :hwiddata key attempt2 434if not defined key (
435for /f "delims=" %%a in ('%psc% "$f=[io.file]::ReadAllText('!_batp!') -split ':getactivationid\:.*';iex ($f[1]);"') do (set altapplist=%%a)
436if defined altapplist call :hwiddata key
437)
371 438
372if defined notworking call :hwidfallback 439if defined notworking call :hwidfallback
373if not defined key call :hwidfallback 440if not defined key call :hwidfallback
@@ -376,10 +443,6 @@ if defined altkey (set key=%altkey%&set changekey=1&set notworking=)
376 443
377if defined notworking if defined notfoundaltactID ( 444if defined notworking if defined notfoundaltactID (
378call :dk_color %Red% "Checking Alternate Edition For HWID [%altedition% Activation ID Not Found]" 445call :dk_color %Red% "Checking Alternate Edition For HWID [%altedition% Activation ID Not Found]"
379if exist "%SystemRoot%\Servicing\Packages\Microsoft-Windows-*EvalEdition~*.mum" (
380call :dk_color %Magenta% "Evaluation Windows Found. Install Full version of %winos%"
381call :dk_color %Magenta% "Download it from https://massgrave.dev/genuine-installation-media.html"
382)
383) 446)
384 447
385if not defined key ( 448if not defined key (
@@ -387,7 +450,7 @@ if not defined key (
387echo [%winos% ^| %winbuild% ^| SKU:%osSKU%] 450echo [%winos% ^| %winbuild% ^| SKU:%osSKU%]
388echo Unable to find this product in the supported product list. 451echo Unable to find this product in the supported product list.
389echo Make sure you are using updated version of the script. 452echo Make sure you are using updated version of the script.
390echo https://massgrave.dev 453echo https://%mas%
391echo: 454echo:
392goto dk_done 455goto dk_done
393) 456)
@@ -400,7 +463,7 @@ if defined notworking set error=1
400 463
401echo: 464echo:
402if defined changekey ( 465if defined changekey (
403call :dk_color %Magenta% "[%altedition%] Edition product key will be used to enable HWID activation." 466call :dk_color %Blue% "[%altedition%] Edition product key will be used to enable HWID activation."
404echo: 467echo:
405) 468)
406 469
@@ -417,8 +480,8 @@ echo Installing Generic Product Key [%key%] [Successful]
417) else ( 480) else (
418call :dk_color %Red% "Installing Generic Product Key [%key%] [Failed] %errorcode%" 481call :dk_color %Red% "Installing Generic Product Key [%key%] [Failed] %errorcode%"
419if not defined error ( 482if not defined error (
420call :dk_color %Magenta% "In MAS, Goto Troubleshoot and run Fix Licensing option." 483if defined altapplist call :dk_color %Red% "Activation ID not found for this key."
421if defined actidnotfound call :dk_color %Red% "Activation ID not found for this key. Make sure you are using updated version of MAS." 484call :dk_color %Blue% "%_fixmsg%"
422set showfix=1 485set showfix=1
423) 486)
424set error=1 487set error=1
@@ -428,8 +491,8 @@ set error=1
428 491
429:: Change Windows region to USA to avoid activation issues as Windows store license is not available in many countries 492:: Change Windows region to USA to avoid activation issues as Windows store license is not available in many countries
430 493
431for /f "skip=2 tokens=2*" %%a in ('reg query "HKCU\Control Panel\International\Geo" /v Name 2^>nul') do set "name=%%b" 494for /f "skip=2 tokens=2*" %%a in ('reg query "HKCU\Control Panel\International\Geo" /v Name %nul6%') do set "name=%%b"
432for /f "skip=2 tokens=2*" %%a in ('reg query "HKCU\Control Panel\International\Geo" /v Nation 2^>nul') do set "nation=%%b" 495for /f "skip=2 tokens=2*" %%a in ('reg query "HKCU\Control Panel\International\Geo" /v Nation %nul6%') do set "nation=%%b"
433 496
434set regionchange= 497set regionchange=
435if not "%name%"=="US" ( 498if not "%name%"=="US" (
@@ -448,6 +511,11 @@ call :dk_color %Red% "Changing Windows Region To USA [Failed]"
448:: In some cases clipup -v -o method fails and in some cases service restart method fails as well 511:: In some cases clipup -v -o method fails and in some cases service restart method fails as well
449:: To maximize success rate and get better error details, script will install tickets two times (service restart + clipup -v -o) 512:: To maximize success rate and get better error details, script will install tickets two times (service restart + clipup -v -o)
450 513
514if not exist %SystemRoot%\system32\ClipUp.exe (
515call :dk_color %Red% "Checking ClipUp.exe File [Not found, aborting the process]"
516goto :dl_final
517)
518
451set "tdir=%ProgramData%\Microsoft\Windows\ClipSVC\GenuineTicket" 519set "tdir=%ProgramData%\Microsoft\Windows\ClipSVC\GenuineTicket"
452if not exist "%tdir%\" md "%tdir%\" %nul% 520if not exist "%tdir%\" md "%tdir%\" %nul%
453 521
@@ -460,7 +528,7 @@ call :hwiddata ticket
460copy /y /b "%tdir%\GenuineTicket" "%tdir%\GenuineTicket.xml" %nul% 528copy /y /b "%tdir%\GenuineTicket" "%tdir%\GenuineTicket.xml" %nul%
461 529
462if not exist "%tdir%\GenuineTicket.xml" ( 530if not exist "%tdir%\GenuineTicket.xml" (
463call :dk_color %Red% "Generating GenuineTicket.xml [Failed]" 531call :dk_color %Red% "Generating GenuineTicket.xml [Failed, aborting the process]"
464echo [%encoded%] 532echo [%encoded%]
465if exist "%tdir%\Genuine*" del /f /q "%tdir%\Genuine*" %nul% 533if exist "%tdir%\Genuine*" del /f /q "%tdir%\Genuine*" %nul%
466goto :dl_final 534goto :dl_final
@@ -488,6 +556,12 @@ clipup -v -o
488 556
489set rebuildinfo= 557set rebuildinfo=
490 558
559if not exist %ProgramData%\Microsoft\Windows\ClipSVC\tokens.dat (
560set error=1
561set rebuildinfo=1
562call :dk_color %Red% "Checking ClipSVC tokens.dat [Not Found]"
563)
564
491%_xmlexist% ( 565%_xmlexist% (
492set error=1 566set error=1
493set rebuildinfo=1 567set rebuildinfo=1
@@ -502,7 +576,7 @@ call :dk_color %Red% "Checking Ticket Migration [Failed]"
502 576
503if defined applist if not defined showfix if defined rebuildinfo ( 577if defined applist if not defined showfix if defined rebuildinfo (
504set showfix=1 578set showfix=1
505call :dk_color %Magenta% "In MAS, Goto Troubleshoot and run Fix Licensing option." 579call :dk_color %Blue% "%_fixmsg%"
506) 580)
507 581
508if exist "%tdir%\Genuine*" del /f /q "%tdir%\Genuine*" %nul% 582if exist "%tdir%\Genuine*" del /f /q "%tdir%\Genuine*" %nul%
@@ -522,6 +596,8 @@ call :dk_color %Green% "%winos% is permanently activated with a digital license.
522goto :dl_final 596goto :dl_final
523) 597)
524 598
599::==========================================================================================================================================
600
525:: Extended licensing servers tests incase error not found and activation failed 601:: Extended licensing servers tests incase error not found and activation failed
526 602
527set resfail= 603set resfail=
@@ -538,21 +614,23 @@ set "d1=Add-Type -AssemblyName System.Net.Http;"
538set "d1=!d1! $client = [System.Net.Http.HttpClient]::new();" 614set "d1=!d1! $client = [System.Net.Http.HttpClient]::new();"
539set "d1=!d1! $response = $client.GetAsync('https://%%#').GetAwaiter().GetResult();" 615set "d1=!d1! $response = $client.GetAsync('https://%%#').GetAwaiter().GetResult();"
540set "d1=!d1! $response.Content.ReadAsStringAsync().GetAwaiter().GetResult()" 616set "d1=!d1! $response.Content.ReadAsStringAsync().GetAwaiter().GetResult()"
541%psc% "!tls! !d1!" 2>nul | findstr /i "PurchaseFD DeviceAddResponse" 1>nul || set resfail=1 617%psc% "!tls! !d1!" %nul2% | findstr /i "PurchaseFD DeviceAddResponse" %nul1% || set resfail=1
542) 618)
543 619
544if not defined resfail ( 620if not defined resfail (
545%psc% "!tls! irm https://licensing.mp.microsoft.com/v7.0/licenses/content -Method POST" | find /i "traceId" 1>nul || set resfail=1 621%psc% "!tls! irm https://licensing.mp.microsoft.com/v7.0/licenses/content -Method POST" | find /i "traceId" %nul1% || set resfail=1
546) 622)
547 623
548if defined resfail ( 624if defined resfail (
549set error=1 625set error=1
550echo: 626echo:
551call :dk_color %Red% "Checking Licensing Servers [Failed To Connect]" 627call :dk_color %Red% "Checking Licensing Servers [Failed To Connect]"
552call :dk_color2 %Magenta% "Check this page for help" %_Yellow% " https://massgrave.dev/licensing-servers-issue" 628call :dk_color2 %Blue% "Check this page for help" %_Yellow% " https://%mas%/licensing-servers-issue"
553) 629)
554) 630)
555 631
632::==========================================================================================================================================
633
556:: Clear store ID related registry to fix activation incase error not found 634:: Clear store ID related registry to fix activation incase error not found
557 635
558if not defined error ( 636if not defined error (
@@ -573,17 +651,30 @@ call :dk_act
573call :dk_checkperm 651call :dk_checkperm
574) 652)
575 653
654REM Check Internet related error codes
655
656if not defined error if not defined _perm (
657echo "%error_code%" | findstr /i "0x80072e 0x80072f" %nul% && (
658set error=1
659echo:
660call :dk_color %Red% "Checking Internet Issues [Found] [%error_code%]"
661call :dk_color2 %Blue% "Check this page for help" %_Yellow% " https://%mas%/licensing-servers-issue"
662)
663)
664
665::==========================================================================================================================================
666
576echo: 667echo:
577if defined _perm ( 668if defined _perm (
578call :dk_color %Green% "%winos% is permanently activated with a digital license." 669call :dk_color %Green% "%winos% is permanently activated with a digital license."
579) else ( 670) else (
580call :dk_color %Red% "Activation Failed %error_code%" 671call :dk_color %Red% "Activation Failed %error_code%"
581if defined notworking ( 672if defined notworking (
582call :dk_color %Magenta% "At the time of writing this, HWID Activation was not supported for this product." 673call :dk_color %Blue% "At the time of writing this, HWID Activation was not supported for this product."
583call :dk_color %Magenta% "Use KMS38 Activation option." 674call :dk_color %Blue% "Use KMS38 Activation option."
584) else ( 675) else (
585if not defined error call :dk_color %Magenta% "In MAS, Goto Troubleshoot and run Fix Licensing option." 676if not defined error call :dk_color %Blue% "%_fixmsg%"
586call :dk_color2 %Magenta% "Check this page for help" %_Yellow% " https://massgrave.dev/troubleshoot" 677call :dk_color2 %Blue% "Check this page for help" %_Yellow% " https://%mas%/troubleshoot"
587) 678)
588) 679)
589 680
@@ -612,8 +703,8 @@ goto :dk_done
612 703
613:dk_checkperm 704:dk_checkperm
614 705
615if %_wmic% EQU 1 wmic path SoftwareLicensingProduct where (LicenseStatus='1' and GracePeriodRemaining='0' and PartialProductKey is not NULL) get Name /value 2>nul | findstr /i "Windows" 1>nul && set _perm=1||set _perm= 706if %_wmic% EQU 1 wmic path SoftwareLicensingProduct where (LicenseStatus='1' and GracePeriodRemaining='0' and PartialProductKey is not NULL) get Name /value %nul2% | findstr /i "Windows" %nul1% && set _perm=1||set _perm=
616if %_wmic% EQU 0 %psc% "(([WMISEARCHER]'SELECT Name FROM SoftwareLicensingProduct WHERE LicenseStatus=1 AND GracePeriodRemaining=0 AND PartialProductKey IS NOT NULL').Get()).Name | %% {echo ('Name='+$_)}" 2>nul | findstr /i "Windows" 1>nul && set _perm=1||set _perm= 707if %_wmic% EQU 0 %psc% "(([WMISEARCHER]'SELECT Name FROM SoftwareLicensingProduct WHERE LicenseStatus=1 AND GracePeriodRemaining=0 AND PartialProductKey IS NOT NULL').Get()).Name | %% {echo ('Name='+$_)}" %nul2% | findstr /i "Windows" %nul1% && set _perm=1||set _perm=
617exit /b 708exit /b
618 709
619:: Refresh license status 710:: Refresh license status
@@ -642,18 +733,49 @@ exit /b
642:dk_actids 733:dk_actids
643 734
644set applist= 735set applist=
645if %_wmic% EQU 1 set "chkapp=for /f "tokens=2 delims==" %%a in ('"wmic path SoftwareLicensingProduct where (ApplicationID='55c92734-d682-4d71-983e-d6ec3f16059f') get ID /VALUE" 2^>nul')" 736if %_wmic% EQU 1 set "chkapp=for /f "tokens=2 delims==" %%a in ('"wmic path SoftwareLicensingProduct where (ApplicationID='55c92734-d682-4d71-983e-d6ec3f16059f') get ID /VALUE" %nul6%')"
646if %_wmic% EQU 0 set "chkapp=for /f "tokens=2 delims==" %%a in ('%psc% "(([WMISEARCHER]'SELECT ID FROM SoftwareLicensingProduct WHERE ApplicationID=''55c92734-d682-4d71-983e-d6ec3f16059f''').Get()).ID ^| %% {echo ('ID='+$_)}" 2^>nul')" 737if %_wmic% EQU 0 set "chkapp=for /f "tokens=2 delims==" %%a in ('%psc% "(([WMISEARCHER]'SELECT ID FROM SoftwareLicensingProduct WHERE ApplicationID=''55c92734-d682-4d71-983e-d6ec3f16059f''').Get()).ID ^| %% {echo ('ID='+$_)}" %nul6%')"
647%chkapp% do (if defined applist (call set "applist=!applist! %%a") else (call set "applist=%%a")) 738%chkapp% do (if defined applist (call set "applist=!applist! %%a") else (call set "applist=%%a"))
648exit /b 739exit /b
649 740
741:: Get Activation IDs from licensing files if not found through WMI
742
743:getactivationid:
744$folderPath = "$env:windir\System32\spp\tokens\skus"
745$files = Get-ChildItem -Path $folderPath -Recurse -Filter "*.xrm-ms"
746$guids = @()
747foreach ($file in $files) {
748 $content = Get-Content -Path $file.FullName -Raw
749 $matches = [regex]::Matches($content, 'name="productSkuId">\{([0-9a-fA-F\-]+)\}')
750 foreach ($match in $matches) {
751 $guids += $match.Groups[1].Value
752 }
753}
754$guids = $guids | Select-Object -Unique
755$guidsString = $guids -join " "
756$guidsString
757:getactivationid:
758
759:: Get SvcRestartTask info
760
761:gettaskinfo:
762$task = Get-ScheduledTask | Where-Object { $_.TaskName -eq 'SvcRestartTask' -and $_.TaskPath -eq '\Microsoft\Windows\SoftwareProtectionPlatform\' }
763$info = $task | Get-ScheduledTaskInfo
764if ($info.LastRunTime -match 99) {
765$task | Start-ScheduledTask
766Start-Sleep -Seconds 3
767$info = $task | Get-ScheduledTaskInfo
768}
769"$($task.State) $($info.LastTaskResult) $($info.LastRunTime)"
770:gettaskinfo:
771
650:: Check wmic.exe 772:: Check wmic.exe
651 773
652:dk_ckeckwmic 774:dk_ckeckwmic
653 775
654set _wmic=0 776set _wmic=0
655for %%# in (wmic.exe) do @if not "%%~$PATH:#"=="" ( 777for %%# in (wmic.exe) do @if not "%%~$PATH:#"=="" (
656wmic path Win32_ComputerSystem get CreationClassName /value 2>nul | find /i "computersystem" 1>nul && set _wmic=1 778wmic path Win32_ComputerSystem get CreationClassName /value %nul2% | find /i "computersystem" %nul1% && set _wmic=1
657) 779)
658exit /b 780exit /b
659 781
@@ -668,8 +790,8 @@ set d1=%d1% $meth.SetImplementationFlags(128); $TypeBuilder.CreateType()::Brandi
668 790
669set winos= 791set winos=
670for /f "delims=" %%s in ('"%psc% %d1%"') do if not errorlevel 1 (set winos=%%s) 792for /f "delims=" %%s in ('"%psc% %d1%"') do if not errorlevel 1 (set winos=%%s)
671echo "%winos%" | find /i "Windows" 1>nul || ( 793echo "%winos%" | find /i "Windows" %nul1% || (
672for /f "skip=2 tokens=2*" %%a in ('reg query "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion" /v ProductName 2^>nul') do set "winos=%%b" 794for /f "skip=2 tokens=2*" %%a in ('reg query "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion" /v ProductName %nul6%') do set "winos=%%b"
673if %winbuild% GEQ 22000 ( 795if %winbuild% GEQ 22000 (
674set winos=!winos:Windows 10=Windows 11! 796set winos=!winos:Windows 10=Windows 11!
675) 797)
@@ -689,17 +811,33 @@ exit /b
689 811
690:dk_errorcheck 812:dk_errorcheck
691 813
814set showfix=
815
816:: Check corrupt services
817
818set serv_cor=
819for %%# in (%_serv%) do (
820set _corrupt=
821sc start %%# %nul%
822if !errorlevel! EQU 1060 set _corrupt=1
823sc query %%# %nul% || set _corrupt=1
824for %%G in (DependOnService Description DisplayName ErrorControl ImagePath ObjectName Start Type) do if not defined _corrupt (reg query HKLM\SYSTEM\CurrentControlSet\Services\%%# /v %%G %nul% || set _corrupt=1)
825if defined _corrupt (if defined serv_cor (set "serv_cor=!serv_cor! %%#") else (set "serv_cor=%%#"))
826)
827
828if defined serv_cor (
829set error=1
830call :dk_color %Red% "Checking Corrupt Services [%serv_cor%]"
831)
832
833::========================================================================================================================================
834
692:: Check disabled services 835:: Check disabled services
693 836
694set serv_ste= 837set serv_ste=
695for %%# in (%_serv%) do ( 838for %%# in (%_serv%) do (
696set serv_dis=
697reg query HKLM\SYSTEM\CurrentControlSet\Services\%%# /v ImagePath %nul% || set serv_dis=1
698for /f "skip=2 tokens=2*" %%a in ('reg query HKLM\SYSTEM\CurrentControlSet\Services\%%# /v Start 2^>nul') do if /i %%b equ 0x4 set serv_dis=1
699sc start %%# %nul% 839sc start %%# %nul%
700if !errorlevel! EQU 1058 set serv_dis=1 840if !errorlevel! EQU 1058 (if defined serv_ste (set "serv_ste=!serv_ste! %%#") else (set "serv_ste=%%#"))
701sc query %%# %nul% || set serv_dis=1
702if defined serv_dis (if defined serv_ste (set "serv_ste=!serv_ste! %%#") else (set "serv_ste=%%#"))
703) 841)
704 842
705:: Change disabled services startup type to default 843:: Change disabled services startup type to default
@@ -742,7 +880,7 @@ set errorcode=
742set checkerror= 880set checkerror=
743net start %%# /y %nul% 881net start %%# /y %nul%
744set errorcode=!errorlevel! 882set errorcode=!errorlevel!
745sc query %%# | find /i "4 RUNNING" %nul% || set checkerror=1 883sc query %%# | find /i "RUNNING" %nul% || set checkerror=1
746 884
747sc start %%# %nul% 885sc start %%# %nul%
748if !errorlevel! NEQ 1056 if !errorlevel! NEQ 0 (set errorcode=!errorlevel!&set checkerror=1) 886if !errorlevel! NEQ 1056 if !errorlevel! NEQ 0 (set errorcode=!errorlevel!&set checkerror=1)
@@ -753,7 +891,8 @@ if defined serv_e (
753set error=1 891set error=1
754call :dk_color %Red% "Starting Services [Failed] [%serv_e%]" 892call :dk_color %Red% "Starting Services [Failed] [%serv_e%]"
755echo %serv_e% | findstr /i "ClipSVC-1058 sppsvc-1058" %nul% && ( 893echo %serv_e% | findstr /i "ClipSVC-1058 sppsvc-1058" %nul% && (
756call :dk_color %Magenta% "Restart the system to fix disabled service error 1058." 894call :dk_color %Blue% "Restart the system to fix disabled service error 1058."
895set showfix=1
757) 896)
758) 897)
759 898
@@ -763,61 +902,51 @@ call :dk_color %Magenta% "Restart the system to fix disabled service error 1058.
763 902
764if defined safeboot_option ( 903if defined safeboot_option (
765set error=1 904set error=1
766call :dk_color2 %Red% "Checking Boot Mode " %Magenta% "[System is running in safe mode. Run in normal mode.]" 905set showfix=1
906call :dk_color2 %Red% "Checking Boot Mode " %Blue% "[System is running in safe mode. Run in normal mode.]"
767) 907)
768 908
769 909
770reg query "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Setup\State" 2>nul | find /i "IMAGE_STATE_COMPLETE" 1>nul || ( 910reg query "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Setup\State" %nul2% | find /i "IMAGE_STATE_COMPLETE" %nul1% || (
771set error=1 911set error=1
772call :dk_color2 %Red% "Checking Audit Mode " %Magenta% "[System is running in Audit mode. Run in normal mode.]" 912set showfix=1
913call :dk_color2 %Red% "Checking Audit Mode " %Blue% "[IMAGE_STATE_COMPLETE status not found. Run in normal mode.]"
773) 914)
774 915
775 916
776reg query "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\WinPE" /v InstRoot %nul% && ( 917reg query "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\WinPE" /v InstRoot %nul% && (
777set error=1 918set error=1
778call :dk_color2 %Red% "Checking WinPE " %Magenta% "[System is running in WinPE mode. Run in normal mode.]" 919set showfix=1
779) 920call :dk_color2 %Red% "Checking WinPE " %Blue% "[System is running in WinPE mode. Run in normal mode.]"
780
781
782for %%# in (wmic.exe) do @if "%%~$PATH:#"=="" (
783call :dk_color %Gray% "Checking WMIC.exe [Not Found]"
784) 921)
785 922
786 923
787%psc% $ExecutionContext.SessionState.LanguageMode 2>nul | find /i "Full" 1>nul || ( 924%psc% $ExecutionContext.SessionState.LanguageMode %nul2% | find /i "Full" %nul1% || (
788set error=1 925set error=1
789call :dk_color %Red% "Checking Powershell [Not Responding]" 926call :dk_color %Red% "Checking Powershell [Not Responding]"
790) 927)
791 928
792 929
793set wmifailed=
794if %_wmic% EQU 1 wmic path Win32_ComputerSystem get CreationClassName /value 2>nul | find /i "computersystem" 1>nul
795if %_wmic% EQU 0 %psc% "Get-CIMInstance -Class Win32_ComputerSystem | Select-Object -Property CreationClassName" 2>nul | find /i "computersystem" 1>nul
796if %errorlevel% NEQ 0 (
797set error=1
798set wmifailed=1
799call :dk_color %Red% "Checking WMI [Not Responding] %_wmic%"
800call :dk_color %Magenta% "In MAS, Goto Troubleshoot and run Fix WMI option."
801)
802
803
804if not "%regSKU%"=="%wmiSKU%" (
805call :dk_color %Red% "Checking WMI/REG SKU [Difference Found - WMI:%wmiSKU% Reg:%regSKU%]"
806)
807
808
809DISM /English /Online /Get-CurrentEdition %nul% 930DISM /English /Online /Get-CurrentEdition %nul%
810set error_code=%errorlevel% 931set dism_error=%errorlevel%
811cmd /c exit /b %error_code% 932cmd /c exit /b %dism_error%
812if %error_code% NEQ 0 set "error_code=[0x%=ExitCode%]" 933if %dism_error% NEQ 0 set "dism_error=[0x%=ExitCode%]"
813if %error_code% NEQ 0 ( 934if %dism_error% NEQ 0 (
814call :dk_color %Red% "Checking DISM [Not Responding] %error_code%" 935call :dk_color %Red% "Checking DISM [Not Responding] %dism_error%"
815) 936)
816 937
817 938
818if exist "%SystemRoot%\Servicing\Packages\Microsoft-Windows-*EvalEdition~*.mum" ( 939if not defined officeact if exist "%SystemRoot%\Servicing\Packages\Microsoft-Windows-*EvalEdition~*.mum" (
819set error=1 940set error=1
820call :dk_color %Red% "Checking Eval Packages [Non-Eval Licenses are installed in Eval Windows]" 941call :dk_color %Red% "Checking Eval Packages [Non-Eval Licenses are installed in Eval Windows]"
942if /i %dism_error%==[0x800F0805] (
943for %%# in (4 125 126 188 191 205) do if "%osSKU%"=="%%#" (
944call :dk_color %Blue% "Evaluation Windows can not be activated and different License install may lead to errors."
945call :dk_color %Blue% "It is recommended to install full version of %winos%."
946call :dk_color %Blue% "You can download it from https://%mas%/genuine-installation-media.html"
947set showfix=1
948)
949)
821) 950)
822 951
823 952
@@ -831,21 +960,49 @@ call :dk_color %Red% "Checking slmgr /dlv [Not Responding] %
831) 960)
832 961
833 962
963for %%# in (wmic.exe) do @if "%%~$PATH:#"=="" (
964call :dk_color %Gray% "Checking WMIC.exe [Not Found]"
965)
966
967
968set wmifailed=
969if %_wmic% EQU 1 wmic path Win32_ComputerSystem get CreationClassName /value %nul2% | find /i "computersystem" %nul1%
970if %_wmic% EQU 0 %psc% "Get-CIMInstance -Class Win32_ComputerSystem | Select-Object -Property CreationClassName" %nul2% | find /i "computersystem" %nul1%
971
972if %errorlevel% NEQ 0 set wmifailed=1
973echo "%error_code%" | findstr /i "0x800410 0x800440" %nul1% && set wmifailed=1& :: https://learn.microsoft.com/en-us/windows/win32/wmisdk/wmi-error-constants
974if defined wmifailed (
975set error=1
976call :dk_color %Red% "Checking WMI [Not Responding]"
977call :dk_color %Blue% "In MAS, Goto Troubleshoot and run Fix WMI option."
978set showfix=1
979)
980
981
982%nul% set /a "sum=%slcSKU%+%regSKU%+%wmiSKU%"
983set /a "sum/=3"
984if not defined officeact if not "%sum%"=="%slcSKU%" (
985call :dk_color %Red% "Checking SLC/WMI/REG SKU [Difference Found - SLC:%slcSKU% WMI:%wmiSKU% Reg:%regSKU%]"
986)
987
988
834reg query "HKU\S-1-5-20\Software\Microsoft\Windows NT\CurrentVersion\SoftwareProtectionPlatform\PersistedTSReArmed" %nul% && ( 989reg query "HKU\S-1-5-20\Software\Microsoft\Windows NT\CurrentVersion\SoftwareProtectionPlatform\PersistedTSReArmed" %nul% && (
835set error=1 990set error=1
836call :dk_color2 %Red% "Checking Rearm " %Magenta% "[System Restart Is Required]" 991set showfix=1
992call :dk_color2 %Red% "Checking Rearm " %Blue% "[System Restart Is Required]"
837) 993)
838 994
839 995
840reg query "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\ClipSVC\Volatile\PersistedSystemState" %nul% && ( 996reg query "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\ClipSVC\Volatile\PersistedSystemState" %nul% && (
841set error=1 997set error=1
842call :dk_color2 %Red% "Checking ClipSVC " %Magenta% "[System Restart Is Required]" 998set showfix=1
999call :dk_color2 %Red% "Checking ClipSVC " %Blue% "[System Restart Is Required]"
843) 1000)
844 1001
845 1002
846for /f "skip=2 tokens=2*" %%a in ('reg query "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\SoftwareProtectionPlatform" /v "SkipRearm" 2^>nul') do if /i %%b NEQ 0x0 ( 1003for /f "skip=2 tokens=2*" %%a in ('reg query "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\SoftwareProtectionPlatform" /v "SkipRearm" %nul6%') do if /i %%b NEQ 0x0 (
847reg add "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\SoftwareProtectionPlatform" /v "SkipRearm" /t REG_DWORD /d "0" /f %nul% 1004reg add "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\SoftwareProtectionPlatform" /v "SkipRearm" /t REG_DWORD /d "0" /f %nul%
848call :dk_color %Red% "Checking SkipRearm [Default 0 Value Not Found, Changing To 0]" 1005call :dk_color %Red% "Checking SkipRearm [Default 0 Value Not Found. Changing To 0]"
849net stop sppsvc /y %nul% 1006net stop sppsvc /y %nul%
850net start sppsvc /y %nul% 1007net start sppsvc /y %nul%
851set error=1 1008set error=1
@@ -854,7 +1011,24 @@ set error=1
854 1011
855reg query "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\SoftwareProtectionPlatform\Plugins\Objects\msft:rm/algorithm/hwid/4.0" /f ba02fed39662 /d %nul% || ( 1012reg query "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\SoftwareProtectionPlatform\Plugins\Objects\msft:rm/algorithm/hwid/4.0" /f ba02fed39662 /d %nul% || (
856call :dk_color %Red% "Checking SPP Registry Key [Incorrect ModuleId Found]" 1013call :dk_color %Red% "Checking SPP Registry Key [Incorrect ModuleId Found]"
1014call :dk_color %Blue% "Possibly Caused By Gaming Spoofers. Help: https://%mas%/troubleshoot"
1015set error=1
1016set showfix=1
1017)
1018
1019
1020set tokenstore=
1021for /f "skip=2 tokens=2*" %%a in ('reg query "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\SoftwareProtectionPlatform" /v TokenStore %nul6%') do call set "tokenstore=%%b"
1022if not exist "%tokenstore%\" (
857set error=1 1023set error=1
1024REM This code creates token folder only if it's missing and sets default permission for it
1025mkdir "%tokenstore%" %nul%
1026set "d=$sddl = 'O:BAG:BAD:PAI(A;OICI;FA;;;SY)(A;OICI;FA;;;BA)(A;OICIIO;GR;;;BU)(A;;FR;;;BU)(A;OICI;FA;;;S-1-5-80-123231216-2592883651-3715271367-3753151631-4175906628)';"
1027set "d=!d! $AclObject = New-Object System.Security.AccessControl.DirectorySecurity;"
1028set "d=!d! $AclObject.SetSecurityDescriptorSddlForm($sddl);"
1029set "d=!d! Set-Acl -Path %tokenstore% -AclObject $AclObject;"
1030%psc% "!d!" %nul%
1031call :dk_color %Gray% "Checking SPP Token Folder [Not Found. Creating Now] [%tokenstore%\]"
858) 1032)
859 1033
860 1034
@@ -872,44 +1046,43 @@ call :dk_color %Red% "Checking Activation IDs [Not Found]"
872) 1046)
873 1047
874 1048
875set tokenstore=
876for /f "skip=2 tokens=2*" %%a in ('reg query "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\SoftwareProtectionPlatform" /v TokenStore 2^>nul') do call set "tokenstore=%%b"
877if not exist "%tokenstore%\" (
878set error=1
879call :dk_color %Red% "Checking SPP Token Folder [Not Found] [%tokenstore%\]"
880)
881
882
883if exist "%tokenstore%\" if not exist "%tokenstore%\tokens.dat" ( 1049if exist "%tokenstore%\" if not exist "%tokenstore%\tokens.dat" (
884set error=1 1050set error=1
885call :dk_color %Red% "Checking SPP tokens.dat [Not Found] [%tokenstore%\]" 1051call :dk_color %Red% "Checking SPP tokens.dat [Not Found] [%tokenstore%\]"
886) 1052)
887 1053
888 1054
889if not exist %ProgramData%\Microsoft\Windows\ClipSVC\tokens.dat ( 1055if not exist %SystemRoot%\system32\sppsvc.exe (
890set error=1 1056set error=1
891call :dk_color %Red% "Checking ClipSVC tokens.dat [Not Found]" 1057set showfix=1
1058call :dk_color %Red% "Checking sppsvc.exe File [Not Found]"
892) 1059)
893 1060
894 1061
895if not exist %SystemRoot%\system32\sppsvc.exe ( 1062set task=
896set error=1 1063set taskerror=
897call :dk_color %Red% "Checking sppsvc.exe File [Not Found]" 1064if not defined wmifailed if not defined officeact (
1065for /f "delims=" %%a in ('%psc% "$f=[io.file]::ReadAllText('!_batp!') -split ':gettaskinfo\:.*';iex ($f[1]);"') do (set task=%%a)
1066echo "!task!" | find /i "Ready 0 " %nul% || set taskerror=1
1067echo "!task!" | find "99" %nul% && set taskerror=1
1068if defined taskerror (
1069call :dk_color %Gray% "Checking SvcRestartTask Last Run [Issues Found, !task!]"
1070call :dk_color %Gray% "Windows may face issues in keeping activation. Help: https://%mas%/troubleshoot"
1071)
898) 1072)
899 1073
900 1074
901:: Below checks are performed if required services are not disabled + slmgr /dlv errorlevel is not Zero + Rearm restart is not required + WMI is working fine 1075:: Below checks are performed if required services are not disabled or corrupted + if there is any error + slmgr /dlv errorlevel is not Zero + no fix was shown before
902 1076
903set showfix=
904set wpaerror= 1077set wpaerror=
905set permerror= 1078set permerror=
906if not defined serv_cste if /i not %error_code%==0 if /i not %error_code%==0xC004D302 if not defined wmifailed ( 1079if not defined serv_cor if not defined serv_cste if defined error if /i not %error_code%==0 if not defined showfix (
907 1080
908REM This code checks for invalid registry keys in HKLM\SYSTEM\WPA. This issue may appear even on healthy systems. 1081REM This code checks for invalid registry keys in HKLM\SYSTEM\WPA. This issue may appear even on healthy systems.
909 1082
910if %winbuild% GEQ 14393 ( 1083if %winbuild% GEQ 14393 (
911set /a count=0 1084set /a count=0
912for /f %%a in ('reg query "HKLM\SYSTEM\WPA" 2^>nul') do set /a count+=1 1085for /f %%a in ('reg query "HKLM\SYSTEM\WPA" %nul6%') do set /a count+=1
913for /L %%# in (1,1,!count!) do ( 1086for /L %%# in (1,1,!count!) do (
914reg query "HKLM\SYSTEM\WPA\8DEC0AF1-0341-4b93-85CD-72606C2DF94C-7P-%%#" /ve /t REG_BINARY %nul% || set wpaerror=1 1087reg query "HKLM\SYSTEM\WPA\8DEC0AF1-0341-4b93-85CD-72606C2DF94C-7P-%%#" /ve /t REG_BINARY %nul% || set wpaerror=1
915) 1088)
@@ -931,8 +1104,8 @@ if !errorlevel!==2 set permerror=1
931if defined permerror call :dk_color %Red% "Checking SPP Permissions [Error Found]" 1104if defined permerror call :dk_color %Red% "Checking SPP Permissions [Error Found]"
932 1105
933set showfix=1 1106set showfix=1
934call :dk_color %Magenta% "In MAS, Goto Troubleshoot and run Fix Licensing option." 1107call :dk_color %Blue% "%_fixmsg%"
935if not defined permerror call :dk_color %Magenta% "If activation still fails then run Fix WPA Registry option." 1108if not defined permerror call :dk_color %Blue% "If activation still fails then run Fix WPA Registry option."
936) 1109)
937 1110
938exit /b 1111exit /b
@@ -964,7 +1137,7 @@ exit /b
964echo: 1137echo:
965if %_unattended%==1 timeout /t 2 & exit /b 1138if %_unattended%==1 timeout /t 2 & exit /b
966call :dk_color %_Yellow% "Press any key to %_exitmsg%..." 1139call :dk_color %_Yellow% "Press any key to %_exitmsg%..."
967pause >nul 1140pause %nul1%
968exit /b 1141exit /b
969 1142
970::======================================================================================================================================== 1143::========================================================================================================================================
@@ -973,10 +1146,10 @@ exit /b
973:: 2nd column = Generic Retail/OEM/MAK Key 1146:: 2nd column = Generic Retail/OEM/MAK Key
974:: 3rd column = SKU ID 1147:: 3rd column = SKU ID
975:: 4th column = Key part number 1148:: 4th column = Key part number
976:: 5th column = Ticket signature value. It's as it is, it's not encoded. (Check https://massgrave.dev/hwid.html#Manual_Activation to see how it's generated) 1149:: 5th column = Ticket signature value. It's as it is, it's not encoded. (Check mass grave[.]dev/hwid.html#Manual_Activation to see how it's generated)
977:: 6th column = 1 = activation is not working (at the time of writing this), 0 = activation is working 1150:: 6th column = 1 = activation is not working (at the time of writing this), 0 = activation is working
978:: 7th column = Key Type 1151:: 7th column = Key Type
979:: 8th column = WMI Edition ID 1152:: 8th column = WMI Edition ID (For reference only)
980:: 9th column = Version name incase same Edition ID is used in different OS versions with different key 1153:: 9th column = Version name incase same Edition ID is used in different OS versions with different key
981:: Separator = _ 1154:: Separator = _
982 1155
@@ -996,14 +1169,17 @@ f742e4ff-909d-4fe9-aacb-3231d24a0c58_4CP%f%RK-NM%f%3K3-X6X%f%XQ-RX%f%X86-WX%f%CH
9962a6137f3-75c0-4f26-8e3e-d83d802865a4_XKC%f%NC-J2%f%6Q9-KFH%f%D2-FK%f%THY-KD%f%72Y_119_X19-99606_gtywgqIP3j+bliKdunuseeZWtsOzWhj+DmSBq7nqeNarHutgbWEwvcRiGo+nwxONt9Ak/VyuO76ZWH/db3iRVTk1y61vFv15gVlOy1ovLjVHBvmPVdQXIne2N+pIMb0eBhZWHRX63mYdkZRZ0wg/+bj4xsjJv+qLpWhVCzNMge4_0_OEM:NONSLP_PPIPro 11692a6137f3-75c0-4f26-8e3e-d83d802865a4_XKC%f%NC-J2%f%6Q9-KFH%f%D2-FK%f%THY-KD%f%72Y_119_X19-99606_gtywgqIP3j+bliKdunuseeZWtsOzWhj+DmSBq7nqeNarHutgbWEwvcRiGo+nwxONt9Ak/VyuO76ZWH/db3iRVTk1y61vFv15gVlOy1ovLjVHBvmPVdQXIne2N+pIMb0eBhZWHRX63mYdkZRZ0wg/+bj4xsjJv+qLpWhVCzNMge4_0_OEM:NONSLP_PPIPro
997e558417a-5123-4f6f-91e7-385c1c7ca9d4_YNM%f%GQ-8R%f%YV3-4PG%f%Q3-C8%f%XTP-7C%f%FBY_121_X19-98886_VuBmoSUdF63Cvwm9wNlc2yhD2tP9B72iVVWFNcbAwDGXF6o06oNMsIJ0VqGJDdBzZjVGw2wHokMabxZNDyIl90CO7trwgV8S0lLJVLymxyUaE3ThvN3YUsi9Q3H+5Kr0RpsojCWb+UQd/GY4bSXfyStXFylj6im7yv0db/ZWGbw_0_____Retail_Education 1170e558417a-5123-4f6f-91e7-385c1c7ca9d4_YNM%f%GQ-8R%f%YV3-4PG%f%Q3-C8%f%XTP-7C%f%FBY_121_X19-98886_VuBmoSUdF63Cvwm9wNlc2yhD2tP9B72iVVWFNcbAwDGXF6o06oNMsIJ0VqGJDdBzZjVGw2wHokMabxZNDyIl90CO7trwgV8S0lLJVLymxyUaE3ThvN3YUsi9Q3H+5Kr0RpsojCWb+UQd/GY4bSXfyStXFylj6im7yv0db/ZWGbw_0_____Retail_Education
998c5198a66-e435-4432-89cf-ec777c9d0352_84N%f%GF-MH%f%BT6-FXB%f%X8-QW%f%JK7-DR%f%R8H_122_X19-98892_jQ6S2bbNoVrp/zvi8BEUwCf7fge1nAdspcjXyTeTySUiR+hXPiKQEWgyLqAdZ5Or+X2JGT/LZN1/eZ9P+REmzG/WQotZ+fyyPguoSsES+d312RkfmQoI5gVanEkGjZSU4YohREM/Vyf9MOO7dbH9MMEpFm2mje6OnhyJo2gux0g_0_____Retail_EducationN 1171c5198a66-e435-4432-89cf-ec777c9d0352_84N%f%GF-MH%f%BT6-FXB%f%X8-QW%f%JK7-DR%f%R8H_122_X19-98892_jQ6S2bbNoVrp/zvi8BEUwCf7fge1nAdspcjXyTeTySUiR+hXPiKQEWgyLqAdZ5Or+X2JGT/LZN1/eZ9P+REmzG/WQotZ+fyyPguoSsES+d312RkfmQoI5gVanEkGjZSU4YohREM/Vyf9MOO7dbH9MMEpFm2mje6OnhyJo2gux0g_0_____Retail_EducationN
1172f6e29426-a256-4316-88bf-cc5b0f95ec0c_PJB%f%47-8P%f%N2T-MCG%f%DY-JT%f%Y3D-CB%f%CPV_125_X23-50331_Txrh+25Ej9T5ZZXUNxSh/t9ZV18K112m3pOtVVwAeXk4rqjovoYEKcR4DZxUrQ85tNnqSJ+mLlCfnHa9ghb7OTLCaba+d+LA8HBrFfG0g1Ya1gBBL3ZsACHBRPdDiXOGl8uil+5EkOx2sKX941S5fnNK/278XBFRm2NKwfJ7hhI_1_Volume:MAK_EnterpriseS_Ge
999cce9d2de-98ee-4ce2-8113-222620c64a27_KCN%f%VH-YK%f%WX8-GJJ%f%B9-H9%f%FDT-6F%f%7W2_125_X22-66075_wJ/BPDFz+13PVJtBqBo+E4LCm3LoMVALCQUun9kXGBULr7V8FQ5nKUudUGHDLNNVIIicdw9Uh26BKAt0/hnE7BpBkzwdi4qAdZgKXQ1t06Ek4+zXmoT225NvpaHsuhDkE687TtCB1ZWvAulA8G9ehE3HTJSoNm4wCFOQyIQQtqQ_1_Volume:MAK_EnterpriseS_VB 1173cce9d2de-98ee-4ce2-8113-222620c64a27_KCN%f%VH-YK%f%WX8-GJJ%f%B9-H9%f%FDT-6F%f%7W2_125_X22-66075_wJ/BPDFz+13PVJtBqBo+E4LCm3LoMVALCQUun9kXGBULr7V8FQ5nKUudUGHDLNNVIIicdw9Uh26BKAt0/hnE7BpBkzwdi4qAdZgKXQ1t06Ek4+zXmoT225NvpaHsuhDkE687TtCB1ZWvAulA8G9ehE3HTJSoNm4wCFOQyIQQtqQ_1_Volume:MAK_EnterpriseS_VB
1000d06934ee-5448-4fd1-964a-cd077618aa06_43T%f%BQ-NH%f%92J-XKT%f%M7-KT%f%3KK-P3%f%9PB_125_X21-83233_V+y0SFmAnGwRwgNz+0sO0mj+XxSjbdRDpom1Iqx2BJcsf96Q5ittJOcMhKiNswyKuq5suM5vy60tA/AUdb1mrnnrnXfmz7nFam/BIOOfa18GA7vd1aNFufhpmCiMWxoGSewH/T1pnCZrsvGYIj//qC7aiQVKYBngO7UYWGaytgc_0_OEM:NONSLP_EnterpriseS_RS5 1174d06934ee-5448-4fd1-964a-cd077618aa06_43T%f%BQ-NH%f%92J-XKT%f%M7-KT%f%3KK-P3%f%9PB_125_X21-83233_V+y0SFmAnGwRwgNz+0sO0mj+XxSjbdRDpom1Iqx2BJcsf96Q5ittJOcMhKiNswyKuq5suM5vy60tA/AUdb1mrnnrnXfmz7nFam/BIOOfa18GA7vd1aNFufhpmCiMWxoGSewH/T1pnCZrsvGYIj//qC7aiQVKYBngO7UYWGaytgc_0_OEM:NONSLP_EnterpriseS_RS5
1001706e0cfd-23f4-43bb-a9af-1a492b9f1302_NK9%f%6Y-D9%f%CD8-W44%f%CQ-R8%f%YTK-DY%f%JWX_125_X21-05035_U2DIv+LAhSGz0rNbTiMQYaP3M41+0+ZioF7vh0COeeJSIruDFCZ3Li7ZM3dSleg6QTCxG04uZ3i3r1bCZv0+WAfU9rG+3BqLAwKlJS/31rETeRWvrxB1UK4mTMHwAJc9txDAc15ureqF+2b9pIIpwLljmFer6fI7z0iI6I/ZuTU_0_OEM:NONSLP_EnterpriseS_RS1 1175706e0cfd-23f4-43bb-a9af-1a492b9f1302_NK9%f%6Y-D9%f%CD8-W44%f%CQ-R8%f%YTK-DY%f%JWX_125_X21-05035_U2DIv+LAhSGz0rNbTiMQYaP3M41+0+ZioF7vh0COeeJSIruDFCZ3Li7ZM3dSleg6QTCxG04uZ3i3r1bCZv0+WAfU9rG+3BqLAwKlJS/31rETeRWvrxB1UK4mTMHwAJc9txDAc15ureqF+2b9pIIpwLljmFer6fI7z0iI6I/ZuTU_0_OEM:NONSLP_EnterpriseS_RS1
1002faa57748-75c8-40a2-b851-71ce92aa8b45_FWN%f%7H-PF%f%93Q-4GG%f%P8-M8%f%RF3-MD%f%WWW_125_X19-99617_0frpwr4N/wBVRA/nOvAMqkxmRj6Vv9mA+jVNtnurAL1TjkPN/y+6YVUd5MP/Y4As4kddHoHiZXI+2siKHJsaV95ppXoHKR8d7FRVitr1F+82TbB7OVvdCclGrRZymnq25HvtSC3BROHt7ZXTgSCWMyB7MlbLiqHiTymOj5OMX1g_0_OEM:NONSLP_EnterpriseS_TH 1176faa57748-75c8-40a2-b851-71ce92aa8b45_FWN%f%7H-PF%f%93Q-4GG%f%P8-M8%f%RF3-MD%f%WWW_125_X19-99617_0frpwr4N/wBVRA/nOvAMqkxmRj6Vv9mA+jVNtnurAL1TjkPN/y+6YVUd5MP/Y4As4kddHoHiZXI+2siKHJsaV95ppXoHKR8d7FRVitr1F+82TbB7OVvdCclGrRZymnq25HvtSC3BROHt7ZXTgSCWMyB7MlbLiqHiTymOj5OMX1g_0_OEM:NONSLP_EnterpriseS_TH
1177837766ff-61c5-427d-87c3-a2acbd44767a_XFC%f%77-XN%f%RXM-2Q3%f%6W-FC%f%M9T-YH%f%DJ9_126_X23-50304_fIijy15jUocqsDIBLyz5/6FKqkNU1uoYYTqqnbBnk5bPUHKzjIbMGldJEjNgd7lKnHG9qhIjl0q1OHyTna4eY0ydD/b9MfLtD2hmfVvG7gJL8PNaZDa0MuGorxbQilR3nczXmeL/5gsvw5Q/uCfSY5p4UuPnjasKV8eITIPfu1k_1_Volume:MAK_EnterpriseSN_Ge
10032c060131-0e43-4e01-adc1-cf5ad1100da8_RQF%f%NW-9T%f%PM3-JQ7%f%3T-QV%f%4VQ-DV%f%9PT_126_X22-66108_UeA6O2iIW6zFMJzLMCQjVA7gUHOGRTiFB6LPrgjhgfJEXSZnDjxw8wsR+tp+JQWeaQDsVt06c2byH3z7Ft2wNk8n3gcXUknIjlcCckNjw05WDI64/wCqz+gtf1RajMEoV/mODpBx7rdLtCg03FyV7Z9LOib4/WLSmnxjDPKMG7s_1_Volume:MAK_EnterpriseSN_VB 11782c060131-0e43-4e01-adc1-cf5ad1100da8_RQF%f%NW-9T%f%PM3-JQ7%f%3T-QV%f%4VQ-DV%f%9PT_126_X22-66108_UeA6O2iIW6zFMJzLMCQjVA7gUHOGRTiFB6LPrgjhgfJEXSZnDjxw8wsR+tp+JQWeaQDsVt06c2byH3z7Ft2wNk8n3gcXUknIjlcCckNjw05WDI64/wCqz+gtf1RajMEoV/mODpBx7rdLtCg03FyV7Z9LOib4/WLSmnxjDPKMG7s_1_Volume:MAK_EnterpriseSN_VB
1004e8f74caa-03fb-4839-8bcc-2e442b317e53_M33%f%WV-NH%f%Y3C-R7F%f%PM-BQ%f%GPT-23%f%9PG_126_X21-83264_NtP6sMWmOTCdABAbgIZfxZzRs8zaqzfaabLeFXQJvfJvQPLQPk2UxMliASJG+7YwwbTD8pyhUoQqUYrlCzJZ6jDSDyUTJkXgo9akR4fBOg6Z5wn5fW8NGAMDcLND5d9XxHl0gWH/HZNIs/GZaPJsCVVqPr7X8bk/y0DeIofxICU_1_Volume:MAK_EnterpriseSN_RS5 1179e8f74caa-03fb-4839-8bcc-2e442b317e53_M33%f%WV-NH%f%Y3C-R7F%f%PM-BQ%f%GPT-23%f%9PG_126_X21-83264_NtP6sMWmOTCdABAbgIZfxZzRs8zaqzfaabLeFXQJvfJvQPLQPk2UxMliASJG+7YwwbTD8pyhUoQqUYrlCzJZ6jDSDyUTJkXgo9akR4fBOg6Z5wn5fW8NGAMDcLND5d9XxHl0gWH/HZNIs/GZaPJsCVVqPr7X8bk/y0DeIofxICU_1_Volume:MAK_EnterpriseSN_RS5
10053d1022d8-969f-4222-b54b-327f5a5af4c9_2DB%f%W3-N2%f%PJG-MVH%f%W3-G7%f%TDK-9H%f%KR4_126_X21-04921_WeNSkuiC3iyNT9tDqlj6KvM17UYMsYjEelyyMEyPEXSAbYA08lYtYJjCzxSE9T30p9dxqPIuj370OwHhAxG8a51/HoLNWR0grj08HmdOXUA8Ap4clEivxKM0zRvwPR6L2M2HQP0nN54c9It7ikzweJ0X2HHOb58oEw9LbMeUM/Y_0_Volume:MAK_EnterpriseSN_RS1 11803d1022d8-969f-4222-b54b-327f5a5af4c9_2DB%f%W3-N2%f%PJG-MVH%f%W3-G7%f%TDK-9H%f%KR4_126_X21-04921_WeNSkuiC3iyNT9tDqlj6KvM17UYMsYjEelyyMEyPEXSAbYA08lYtYJjCzxSE9T30p9dxqPIuj370OwHhAxG8a51/HoLNWR0grj08HmdOXUA8Ap4clEivxKM0zRvwPR6L2M2HQP0nN54c9It7ikzweJ0X2HHOb58oEw9LbMeUM/Y_0_Volume:MAK_EnterpriseSN_RS1
100660c243e1-f90b-4a1b-ba89-387294948fb6_NTX%f%6B-BR%f%YC2-K67%f%86-F6%f%MVQ-M7%f%V2X_126_X19-98770_QLG40WW/TtUqtir9K6FJCQXU1mfn27uutdOunHJ3gXk6v0Mbxaqu9GKqpg5xFzdFiOPb/8Bmk/ylwceXgoaUx1nKcBGb/Bg+jICiNMEYIbGyMuYiHb0iJeVbjbBLLfWuAAuUPftfnKPH3dAu1YvhaS5nv7a5wICrXdJWeVNpBxk_0_Volume:MAK_EnterpriseSN_TH 118160c243e1-f90b-4a1b-ba89-387294948fb6_NTX%f%6B-BR%f%YC2-K67%f%86-F6%f%MVQ-M7%f%V2X_126_X19-98770_QLG40WW/TtUqtir9K6FJCQXU1mfn27uutdOunHJ3gXk6v0Mbxaqu9GKqpg5xFzdFiOPb/8Bmk/ylwceXgoaUx1nKcBGb/Bg+jICiNMEYIbGyMuYiHb0iJeVbjbBLLfWuAAuUPftfnKPH3dAu1YvhaS5nv7a5wICrXdJWeVNpBxk_0_Volume:MAK_EnterpriseSN_TH
118201eb852c-424d-4060-94b8-c10d799d7364_3XP%f%6D-CR%f%ND4-DRY%f%M2-GM%f%84D-4G%f%G8Y_139_X23-37869_bpWJRMPuEeHIx4X+imsfTHaUXtdSGX9/+kuFDpkJ0rIQXKBf+pprkICUG/FJVciv60VXAMaQPBgn4zGfpfVTvJ0DTPxdRcS4WltLnz5L3fG6jXPjI5lArAFWlx7m93ch1zINoxbroU3inMo5JjsJaMZt01Gae6Of4k9DrgYC8U0_1_____Retail_ProfessionalCountrySpecific_Zn
1007eb6d346f-1c60-4643-b960-40ec31596c45_DXG%f%7C-N3%f%6C4-C4H%f%TG-X4%f%T3X-2Y%f%V77_161_X21-43626_vHO/5UEtrsDzGC30A2Ya5DYXlNMs7hVYiLvM7X31xkaFMxogbiy3ZDxBbjRku3VXyW+TYsFX/D/wdJgFmMrhsNrObkxqzYMMRjx+BpwOx2PspKpS2RyzovyRl8v93SvHB5IyoO2/3pm2YqJDK1hXLhms6+DDPuiofQt36q47reQ_0_____Retail_ProfessionalWorkstation 1183eb6d346f-1c60-4643-b960-40ec31596c45_DXG%f%7C-N3%f%6C4-C4H%f%TG-X4%f%T3X-2Y%f%V77_161_X21-43626_vHO/5UEtrsDzGC30A2Ya5DYXlNMs7hVYiLvM7X31xkaFMxogbiy3ZDxBbjRku3VXyW+TYsFX/D/wdJgFmMrhsNrObkxqzYMMRjx+BpwOx2PspKpS2RyzovyRl8v93SvHB5IyoO2/3pm2YqJDK1hXLhms6+DDPuiofQt36q47reQ_0_____Retail_ProfessionalWorkstation
100889e87510-ba92-45f6-8329-3afa905e3e83_WYP%f%NQ-8C%f%467-V2W%f%6J-TX%f%4WX-WT%f%2RQ_162_X21-43644_phlxNLr+sk8cCCmAVU3k3XrtD6sFDeoaODc+21soKqePbVQbzPHgokS73ccok6/gDfu/u5UKc7omL8pm2IhIhf70oC+8M/FFp0zRFeC/ZFXdF2tL23oKWI9kZbvcaoZBiqaDGc1bNYi5KAZYaJU8wwqw16ZnohQJZ7QR9cgUfFQ_0_____Retail_ProfessionalWorkstationN 118489e87510-ba92-45f6-8329-3afa905e3e83_WYP%f%NQ-8C%f%467-V2W%f%6J-TX%f%4WX-WT%f%2RQ_162_X21-43644_phlxNLr+sk8cCCmAVU3k3XrtD6sFDeoaODc+21soKqePbVQbzPHgokS73ccok6/gDfu/u5UKc7omL8pm2IhIhf70oC+8M/FFp0zRFeC/ZFXdF2tL23oKWI9kZbvcaoZBiqaDGc1bNYi5KAZYaJU8wwqw16ZnohQJZ7QR9cgUfFQ_0_____Retail_ProfessionalWorkstationN
100962f0c100-9c53-4e02-b886-a3528ddfe7f6_8PT%f%T6-RN%f%W4C-6V7%f%J2-C2%f%D3X-MH%f%BPB_164_X21-04955_Px7QWdfy0esrMzQoydKlmIcGdfV0pQvbnumyrh4evDNF9gpENm8OIfZfljIynury0qZAkw4AG3uGyp+5IxZGIh6U3dz41uNVfEcA9NZ34OEBXMtjEOU1ZbJ8wp8JecQKwlORclvsri9OOi0GbGc0TYRanlci2jJL/3x/gSuWXCs_0_____Retail_ProfessionalEducation 118562f0c100-9c53-4e02-b886-a3528ddfe7f6_8PT%f%T6-RN%f%W4C-6V7%f%J2-C2%f%D3X-MH%f%BPB_164_X21-04955_Px7QWdfy0esrMzQoydKlmIcGdfV0pQvbnumyrh4evDNF9gpENm8OIfZfljIynury0qZAkw4AG3uGyp+5IxZGIh6U3dz41uNVfEcA9NZ34OEBXMtjEOU1ZbJ8wp8JecQKwlORclvsri9OOi0GbGc0TYRanlci2jJL/3x/gSuWXCs_0_____Retail_ProfessionalEducation
@@ -1013,46 +1189,28 @@ d4ef7282-3d2c-4cf0-9976-8854e64a8d1e_V3W%f%VW-N2%f%PV2-CGW%f%C3-34%f%QGF-VM%f%J2
1013af5c9381-9240-417d-8d35-eb40cd03e484_NH9%f%J3-68%f%WK7-6FB%f%93-4K%f%3DF-DJ%f%4F6_179_X21-32987_H0qrFdf+FQxcSRJDtEwd8OfwC4iH/25Q01jz3QuB9yhEqB0W1i83u0WDpVK04pvU1EDCCRRI/DhXynbkWpLC0chdTOW4k5jIy+aa0cD3fccz9ChSjVHMzyTg3abEVFAvy9rttUyxcFIOKcINXHTxTRp5cZPwOa393tlJyBiliAo_0_____Retail_CloudN 1189af5c9381-9240-417d-8d35-eb40cd03e484_NH9%f%J3-68%f%WK7-6FB%f%93-4K%f%3DF-DJ%f%4F6_179_X21-32987_H0qrFdf+FQxcSRJDtEwd8OfwC4iH/25Q01jz3QuB9yhEqB0W1i83u0WDpVK04pvU1EDCCRRI/DhXynbkWpLC0chdTOW4k5jIy+aa0cD3fccz9ChSjVHMzyTg3abEVFAvy9rttUyxcFIOKcINXHTxTRp5cZPwOa393tlJyBiliAo_0_____Retail_CloudN
10148ab9bdd1-1f67-4997-82d9-8878520837d9_XQQ%f%YW-NF%f%FMW-XJP%f%BH-K8%f%732-CK%f%FFD_188_X21-99378_Bwx3E7qmE6M8UR6+KPqLnnavI6ThNHHUO717RJY9di2YI9rzC3O0LceXOHjshSKwfwxosqFsD/p/inrJmabed1yA/ZWwISyGtAIGTtRgpuSE4TAfW6KEW0v7rcr2wwwDq7DHSuz4QN4odEGe9bvtx4zIZKufQzzN4TN2rd/BJkE_0_____OEM:DM_IoTEnterprise 11908ab9bdd1-1f67-4997-82d9-8878520837d9_XQQ%f%YW-NF%f%FMW-XJP%f%BH-K8%f%732-CK%f%FFD_188_X21-99378_Bwx3E7qmE6M8UR6+KPqLnnavI6ThNHHUO717RJY9di2YI9rzC3O0LceXOHjshSKwfwxosqFsD/p/inrJmabed1yA/ZWwISyGtAIGTtRgpuSE4TAfW6KEW0v7rcr2wwwDq7DHSuz4QN4odEGe9bvtx4zIZKufQzzN4TN2rd/BJkE_0_____OEM:DM_IoTEnterprise
1015ed655016-a9e8-4434-95d9-4345352c2552_QPM%f%6N-7J%f%2WJ-P88%f%HH-P3%f%YRH-YY%f%74H_191_X21-99682_lE8qL1p4m68mv9wcxU2sdKZPIccybtOjr+aMAdV+sLHs9wzE26oz5GiSZ3UzpU7yoYrNMqwGkKX6mrCEGRLh+XR2Ricp7ELA1PkzaGm0FLUqaK2GNVQ00i+s6KcA2XRr/gWOhhGTqSCjpSi9cMiqMbftf9Bo/BJVK3ib9xU4OQw_0_OEM:NONSLP_IoTEnterpriseS_VB 1191ed655016-a9e8-4434-95d9-4345352c2552_QPM%f%6N-7J%f%2WJ-P88%f%HH-P3%f%YRH-YY%f%74H_191_X21-99682_lE8qL1p4m68mv9wcxU2sdKZPIccybtOjr+aMAdV+sLHs9wzE26oz5GiSZ3UzpU7yoYrNMqwGkKX6mrCEGRLh+XR2Ricp7ELA1PkzaGm0FLUqaK2GNVQ00i+s6KcA2XRr/gWOhhGTqSCjpSi9cMiqMbftf9Bo/BJVK3ib9xU4OQw_0_OEM:NONSLP_IoTEnterpriseS_VB
11926c4de1b8-24bb-4c17-9a77-7b939414c298_CGK%f%42-GY%f%N6Y-VD2%f%2B-BX%f%98W-J8%f%JXD_191_X23-12617_QEqj4TJNDYZnR8WdPp2TYu5UyiJtUmKER75/DuR5L5SZ1Qg/LUff0Nse+iT+cDVld/YA8RS1CxeMF1W/SLuPHqZvEzkPmYxGVy2U1iCbztfonAA2FZ3v76gbroMOr6bqMmeKNkhsUMG5sEz5uYXW0+K7Ke2z5GSMiEQHQN2yDA4_0_OEM:NONSLP_IoTEnterpriseS_Ge
1016d4bdc678-0a4b-4a32-a5b3-aaa24c3b0f24_K9V%f%KN-3B%f%GWV-Y62%f%4W-MC%f%RMQ-BH%f%DCD_202_X22-53884_hPcIn0dF9Dq6zlXd3RxBqVDPDnf5sTasTjUqhD6lGc9IkTc8476NHd1PV1Ds++VO34/dw2H2PWk33LT5Es6PnUi32Ypva4POy4QJo5W3qyduiJiHUOM5GS9yAkKfdHFgUXaUVwopYKq+EwmgxFmEvHYdWgREHgIMyNoKAZQK0Ok_0_____Retail_CloudEditionN 1193d4bdc678-0a4b-4a32-a5b3-aaa24c3b0f24_K9V%f%KN-3B%f%GWV-Y62%f%4W-MC%f%RMQ-BH%f%DCD_202_X22-53884_hPcIn0dF9Dq6zlXd3RxBqVDPDnf5sTasTjUqhD6lGc9IkTc8476NHd1PV1Ds++VO34/dw2H2PWk33LT5Es6PnUi32Ypva4POy4QJo5W3qyduiJiHUOM5GS9yAkKfdHFgUXaUVwopYKq+EwmgxFmEvHYdWgREHgIMyNoKAZQK0Ok_0_____Retail_CloudEditionN
101792fb8726-92a8-4ffc-94ce-f82e07444653_KY7%f%PN-VR%f%6RX-83W%f%6Y-6D%f%DYQ-T6%f%R4W_203_X22-53847_DCP6QzPj+BD1EEmlBelBt7x9AmvQOfd7kdkUB0b0x6/TNHRnZtdyix3pNX2IDQtJbLnNLc2ZlMmupbZQrtyxe3xl8+xlCnHByXZpzFty9sGzq3MozHHA9u9WsJEf5R7tnFDplNM1UitlTVTAyuCGk83brY4zjmz/52pUQyQHzjI_0_____Retail_CloudEdition 119492fb8726-92a8-4ffc-94ce-f82e07444653_KY7%f%PN-VR%f%6RX-83W%f%6Y-6D%f%DYQ-T6%f%R4W_203_X22-53847_DCP6QzPj+BD1EEmlBelBt7x9AmvQOfd7kdkUB0b0x6/TNHRnZtdyix3pNX2IDQtJbLnNLc2ZlMmupbZQrtyxe3xl8+xlCnHByXZpzFty9sGzq3MozHHA9u9WsJEf5R7tnFDplNM1UitlTVTAyuCGk83brY4zjmz/52pUQyQHzjI_0_____Retail_CloudEdition
1018d4f9b41f-205c-405e-8e08-3d16e88e02be_J7N%f%JW-V6%f%KBM-CC8%f%RW-Y2%f%9Y4-HQ%f%2MJ_205_X23-15027_U9eyfIBXrs++lyP6OjHHaF/wjieAxQeSKwzSkGBeTTpyCDcenq8t4cKvqDHnauSZzaVPWNoVcASkMCdlJi3EkR29KSgvx9/K2OB8LVH2PPpqvwjm1ZZdrvLMGhW83A/KRrtN9AOx7bnPC8MNLErnzbRRS9/aOrmp4Uzo8EIVagI_0_OEM:NONSLP_IoTEnterpriseSK 1195d4f9b41f-205c-405e-8e08-3d16e88e02be_J7N%f%JW-V6%f%KBM-CC8%f%RW-Y2%f%9Y4-HQ%f%2MJ_205_X23-15027_U9eyfIBXrs++lyP6OjHHaF/wjieAxQeSKwzSkGBeTTpyCDcenq8t4cKvqDHnauSZzaVPWNoVcASkMCdlJi3EkR29KSgvx9/K2OB8LVH2PPpqvwjm1ZZdrvLMGhW83A/KRrtN9AOx7bnPC8MNLErnzbRRS9/aOrmp4Uzo8EIVagI_0_OEM:NONSLP_IoTEnterpriseSK
1019) do ( 1196) do (
1020for /f "tokens=1-10 delims=_" %%A in ("%%#") do ( 1197for /f "tokens=1-9 delims=_" %%A in ("%%#") do (
1021 1198
1022if %1==key if %osSKU%==%%C ( 1199REM Detect key
1023 1200
1024REM Detect key attempt 1 1201if %1==key if %osSKU%==%%C if not defined key (
1025 1202echo "!applist! !altapplist!" | find /i "%%A" %nul1% && (
1026if "%2"=="attempt1" if not defined key (
1027echo "!applist!" | find /i "%%A" 1>nul && (
1028if %%F==1 set notworking=1 1203if %%F==1 set notworking=1
1029set key=%%B 1204set key=%%B
1030) 1205)
1031) 1206)
1032 1207
1033REM Detect key attempt 2
1034
1035if "%2"=="attempt2" if not defined key (
1036set actidnotfound=1
1037set 9th=%%I
1038if not defined 9th (
1039if %%F==1 set notworking=1
1040set key=%%B
1041) else (
1042echo "%branch%" | find /i "%%I" 1>nul && (
1043if %%F==1 set notworking=1
1044set key=%%B
1045)
1046)
1047)
1048)
1049
1050REM Generate ticket 1208REM Generate ticket
1051 1209
1052if %1==ticket if "%key%"=="%%B" ( 1210if %1==ticket if "%key%"=="%%B" (
1053set "string=OSMajorVersion=5;OSMinorVersion=1;OSPlatformId=2;PP=0;Pfn=Microsoft.Windows.%%C.%%D_8wekyb3d8bbwe;DownlevelGenuineState=1;$([char]0)" 1211set "string=OSMajorVersion=5;OSMinorVersion=1;OSPlatformId=2;PP=0;Pfn=Microsoft.Windows.%%C.%%D_8wekyb3d8bbwe;DownlevelGenuineState=1;$([char]0)"
1054for /f "tokens=* delims=" %%i in ('%psc% [conv%f%ert]::ToBas%f%e64String([Text.En%f%coding]::Uni%f%code.GetBytes("""!string!"""^)^)') do set "encoded=%%i" 1212for /f "tokens=* delims=" %%i in ('%psc% [conv%f%ert]::ToBas%f%e64String([Text.En%f%coding]::Uni%f%code.GetBytes("""!string!"""^)^)') do set "encoded=%%i"
1055echo "!encoded!" | find "AAAA" 1>nul || exit /b 1213echo "!encoded!" | find "AAAA" %nul1% || exit /b
1056 1214
1057<nul set /p "=<?xml version="1.0" encoding="utf-8"?><genuineAuthorization xmlns="http://www.microsoft.com/DRM/SL/GenuineAuthorization/1.0"><version>1.0</version><genuineProperties origin="sppclient"><properties>OA3xOriginalProductId=;OA3xOriginalProductKey=;SessionId=!encoded!;TimeStampClient=2022-10-11T12:00:00Z</properties><signatures><signature name="clientLockboxKey" method="rsa-sha256">%%E=</signature></signatures></genuineProperties></genuineAuthorization>" >"%tdir%\GenuineTicket" 1215<nul set /p "=<?xml version="1.0" encoding="utf-8"?><genuineAuthorization xmlns="http://www.microsoft.com/DRM/SL/GenuineAuthorization/1.0"><version>1.0</version><genuineProperties origin="sppclient"><properties>OA3xOriginalProductId=;OA3xOriginalProductKey=;SessionId=!encoded!;TimeStampClient=2022-10-11T12:00:00Z</properties><signatures><signature name="clientLockboxKey" method="rsa-sha256">%%E=</signature></signatures></genuineProperties></genuineAuthorization>" >"%tdir%\GenuineTicket"
1058) 1216)
@@ -1065,8 +1223,6 @@ exit /b
1065 1223
1066:: Below code is used to get alternate edition name and key if current edition doesn't support HWID activation 1224:: Below code is used to get alternate edition name and key if current edition doesn't support HWID activation
1067 1225
1068:: ProfessionalCountrySpecific won't be converted because it's not a good idea to change CountrySpecific editions
1069
1070:: 1st column = Current SKU ID 1226:: 1st column = Current SKU ID
1071:: 2nd column = Current Edition Name 1227:: 2nd column = Current Edition Name
1072:: 3rd column = Current Edition Activation ID 1228:: 3rd column = Current Edition Activation ID
@@ -1082,15 +1238,16 @@ set notfoundaltactID=
1082if %_NoEditionChange%==1 exit /b 1238if %_NoEditionChange%==1 exit /b
1083 1239
1084for %%# in ( 1240for %%# in (
1085125_EnterpriseS-2021___________cce9d2de-98ee-4ce2-8113-222620c64a27_ed655016-a9e8-4434-95d9-4345352c2552_QPM%f%6N-7J2%f%WJ-P8%f%8HH-P3Y%f%RH-YY%f%74H_IoTEnterpriseS-2021 1241125_EnterpriseS-2021_______________cce9d2de-98ee-4ce2-8113-222620c64a27_ed655016-a9e8-4434-95d9-4345352c2552_QPM%f%6N-7J2%f%WJ-P8%f%8HH-P3Y%f%RH-YY%f%74H_IoTEnterpriseS-2021
1086191_IoTEnterpriseS-Win11_______59eb965c-9150-42b7-a0ec-22151b9897c5_d4f9b41f-205c-405e-8e08-3d16e88e02be_J7N%f%JW-V6K%f%BM-CC%f%8RW-Y29%f%Y4-HQ%f%2MJ_IoTEnterpriseSK-Win11 1242125_EnterpriseS-2024_______________f6e29426-a256-4316-88bf-cc5b0f95ec0c_6c4de1b8-24bb-4c17-9a77-7b939414c298_CGK%f%42-GYN%f%6Y-VD%f%22B-BX9%f%8W-J8%f%JXD_IoTEnterpriseS-2024
1087138_ProfessionalSingleLanguage_a48938aa-62fa-4966-9d44-9f04da3f72f2_4de7cb65-cdf1-4de9-8ae8-e3cce27b9f2c_VK7%f%JG-NPH%f%TM-C9%f%7JM-9MP%f%GT-3V%f%66T_Professional 1243138_ProfessionalSingleLanguage_____a48938aa-62fa-4966-9d44-9f04da3f72f2_4de7cb65-cdf1-4de9-8ae8-e3cce27b9f2c_VK7%f%JG-NPH%f%TM-C9%f%7JM-9MP%f%GT-3V%f%66T_Professional
1244139_ProfessionalCountrySpecific____f7af7d09-40e4-419c-a49b-eae366689ebd_4de7cb65-cdf1-4de9-8ae8-e3cce27b9f2c_VK7%f%JG-NPH%f%TM-C9%f%7JM-9MP%f%GT-3V%f%66T_Professional
1245139_ProfessionalCountrySpecific-Zn_01eb852c-424d-4060-94b8-c10d799d7364_4de7cb65-cdf1-4de9-8ae8-e3cce27b9f2c_VK7%f%JG-NPH%f%TM-C9%f%7JM-9MP%f%GT-3V%f%66T_Professional
1088) do ( 1246) do (
1089for /f "tokens=1-6 delims=_" %%A in ("%%#") do if %osSKU%==%%A ( 1247for /f "tokens=1-6 delims=_" %%A in ("%%#") do if %osSKU%==%%A (
1090echo "!applist!" | find /i "%%C" 1>nul && ( 1248echo "!applist! !altapplist!" | find /i "%%C" %nul1% && (
1091echo "!applist!" | find /i "%%D" 1>nul && ( 1249echo "!applist!" | find /i "%%D" %nul1% && (
1092set altkey=%%E 1250set altkey=%%E
1093set curedition=%%B
1094set altedition=%%F 1251set altedition=%%F
1095) || ( 1252) || (
1096set altedition=%%F 1253set altedition=%%F
@@ -1101,4 +1258,5 @@ set notfoundaltactID=1
1101) 1258)
1102exit /b 1259exit /b
1103 1260
1104::======================================================================================================================================== \ No newline at end of file 1261::========================================================================================================================================
1262:: Leave empty line below
diff --git a/MAS/Separate-Files-Version/Activators/KMS38_Activation.cmd b/MAS/Separate-Files-Version/Activators/KMS38_Activation.cmd
index 8c2e9c5..f8fc38b 100644
--- a/MAS/Separate-Files-Version/Activators/KMS38_Activation.cmd
+++ b/MAS/Separate-Files-Version/Activators/KMS38_Activation.cmd
@@ -7,7 +7,7 @@
7:: 7::
8:: This script is a part of 'Microsoft_Activation_Scripts' (MAS) project. 8:: This script is a part of 'Microsoft_Activation_Scripts' (MAS) project.
9:: 9::
10:: Homepage: massgrave[.]dev 10:: Homepage: mass grave[.]dev
11:: Email: windowsaddict@protonmail.com 11:: Email: windowsaddict@protonmail.com
12:: 12::
13::============================================================================ 13::============================================================================
@@ -29,6 +29,13 @@ set _NoEditionChange=0
29 29
30::======================================================================================================================================== 30::========================================================================================================================================
31 31
32:: Set Path variable, it helps if it is misconfigured in the system
33
34set "PATH=%SystemRoot%\System32;%SystemRoot%\System32\wbem;%SystemRoot%\System32\WindowsPowerShell\v1.0\"
35if exist "%SystemRoot%\Sysnative\reg.exe" (
36set "PATH=%SystemRoot%\Sysnative;%SystemRoot%\Sysnative\wbem;%SystemRoot%\Sysnative\WindowsPowerShell\v1.0\;%PATH%"
37)
38
32:: Re-launch the script with x64 process if it was initiated by x86 process on x64 bit Windows 39:: Re-launch the script with x64 process if it was initiated by x86 process on x64 bit Windows
33:: or with ARM64 process if it was initiated by x86/ARM32 process on ARM64 Windows 40:: or with ARM64 process if it was initiated by x86/ARM32 process on ARM64 Windows
34 41
@@ -36,6 +43,10 @@ set "_cmdf=%~f0"
36for %%# in (%*) do ( 43for %%# in (%*) do (
37if /i "%%#"=="r1" set r1=1 44if /i "%%#"=="r1" set r1=1
38if /i "%%#"=="r2" set r2=1 45if /i "%%#"=="r2" set r2=1
46if /i "%%#"=="-qedit" (
47reg add HKCU\Console /v QuickEdit /t REG_DWORD /d "1" /f 1>nul
48rem check the code below admin elevation to understand why it's here
49)
39) 50)
40 51
41if exist %SystemRoot%\Sysnative\cmd.exe if not defined r1 ( 52if exist %SystemRoot%\Sysnative\cmd.exe if not defined r1 (
@@ -52,22 +63,34 @@ start %SystemRoot%\SysArm32\cmd.exe /c ""!_cmdf!" %* r2"
52exit /b 63exit /b
53) 64)
54 65
55:: Set Path variable, it helps if it is misconfigured in the system 66::========================================================================================================================================
56 67
57set "PATH=%SystemRoot%\System32;%SystemRoot%\System32\wbem;%SystemRoot%\System32\WindowsPowerShell\v1.0\" 68set "blank="
58if exist "%SystemRoot%\Sysnative\reg.exe" ( 69set "mas=mass%blank%grave.dev"
59set "PATH=%SystemRoot%\Sysnative;%SystemRoot%\Sysnative\wbem;%SystemRoot%\Sysnative\WindowsPowerShell\v1.0\;%PATH%" 70
71:: Check if Null service is working, it's important for the batch script
72
73sc query Null | find /i "RUNNING"
74if %errorlevel% NEQ 0 (
75echo:
76echo Null service is not running, script may crash...
77echo:
78echo:
79echo Help - https://%mas%/troubleshoot.html
80echo:
81echo:
82ping 127.0.0.1 -n 10
60) 83)
84cls
61 85
62:: Check LF line ending 86:: Check LF line ending
63 87
64pushd "%~dp0" 88pushd "%~dp0"
65>nul findstr /rxc:".*" "%~nx0" 89>nul findstr /v "$" "%~nx0" && (
66if not %errorlevel%==0 (
67echo: 90echo:
68echo Error: Script either has LF line ending issue, or it failed to read itself. 91echo Error: Script either has LF line ending issue or an empty line at the end of the script is missing.
69echo: 92echo:
70ping 127.0.0.1 -n 6 > nul 93ping 127.0.0.1 -n 6 >nul
71popd 94popd
72exit /b 95exit /b
73) 96)
@@ -98,21 +121,25 @@ for %%A in (%_act% %_rem% %_NoEditionChange%) do (if "%%A"=="1" set _unattended=
98 121
99::======================================================================================================================================== 122::========================================================================================================================================
100 123
101set winbuild=1 124set "nul1=1>nul"
125set "nul2=2>nul"
126set "nul6=2^>nul"
102set "nul=>nul 2>&1" 127set "nul=>nul 2>&1"
128
103set psc=powershell.exe 129set psc=powershell.exe
130set winbuild=1
104for /f "tokens=6 delims=[]. " %%G in ('ver') do set winbuild=%%G 131for /f "tokens=6 delims=[]. " %%G in ('ver') do set winbuild=%%G
105 132
106set _NCS=1 133set _NCS=1
107if %winbuild% LSS 10586 set _NCS=0 134if %winbuild% LSS 10586 set _NCS=0
108if %winbuild% GEQ 10586 reg query "HKCU\Console" /v ForceV2 2>nul | find /i "0x0" 1>nul && (set _NCS=0) 135if %winbuild% GEQ 10586 reg query "HKCU\Console" /v ForceV2 %nul2% | find /i "0x0" %nul1% && (set _NCS=0)
109 136
110if %_NCS% EQU 1 ( 137if %_NCS% EQU 1 (
111for /F %%a in ('echo prompt $E ^| cmd') do set "esc=%%a" 138for /F %%a in ('echo prompt $E ^| cmd') do set "esc=%%a"
112set "Red="41;97m"" 139set "Red="41;97m""
113set "Gray="100;97m"" 140set "Gray="100;97m""
114set "Green="42;97m"" 141set "Green="42;97m""
115set "Magenta="45;97m"" 142set "Blue="44;97m""
116set "_White="40;37m"" 143set "_White="40;37m""
117set "_Green="40;92m"" 144set "_Green="40;92m""
118set "_Yellow="40;93m"" 145set "_Yellow="40;93m""
@@ -120,7 +147,7 @@ set "_Yellow="40;93m""
120set "Red="Red" "white"" 147set "Red="Red" "white""
121set "Gray="Darkgray" "white"" 148set "Gray="Darkgray" "white""
122set "Green="DarkGreen" "white"" 149set "Green="DarkGreen" "white""
123set "Magenta="Darkmagenta" "white"" 150set "Blue="Blue" "white""
124set "_White="Black" "Gray"" 151set "_White="Black" "Gray""
125set "_Green="Black" "Green"" 152set "_Green="Black" "Green""
126set "_Yellow="Black" "Yellow"" 153set "_Yellow="Black" "Yellow""
@@ -129,14 +156,21 @@ set "_Yellow="Black" "Yellow""
129set _k38= 156set _k38=
130set "nceline=echo: &echo ==== ERROR ==== &echo:" 157set "nceline=echo: &echo ==== ERROR ==== &echo:"
131set "eline=echo: &call :dk_color %Red% "==== ERROR ====" &echo:" 158set "eline=echo: &call :dk_color %Red% "==== ERROR ====" &echo:"
132if %~z0 GEQ 200000 (set "_exitmsg=Go back") else (set "_exitmsg=Exit") 159if %~z0 GEQ 200000 (
160set "_exitmsg=Go back"
161set "_fixmsg=Go back to Main Menu, select Troubleshoot and run Fix Licensing option."
162) else (
163set "_exitmsg=Exit"
164set "_fixmsg=In MAS folder, run Troubleshoot script and select Fix Licensing option."
165)
166
133set "specific_kms=SOFTWARE\Microsoft\Windows NT\CurrentVersion\SoftwareProtectionPlatform\55c92734-d682-4d71-983e-d6ec3f16059f" 167set "specific_kms=SOFTWARE\Microsoft\Windows NT\CurrentVersion\SoftwareProtectionPlatform\55c92734-d682-4d71-983e-d6ec3f16059f"
134 168
135::======================================================================================================================================== 169::========================================================================================================================================
136 170
137if %winbuild% LSS 14393 ( 171if %winbuild% LSS 14393 (
138%eline% 172%eline%
139echo Unsupported OS version detected. 173echo Unsupported OS version detected [%winbuild%].
140echo KMS38 Activation is supported for Windows 10/11/Server, build 14393 and later. 174echo KMS38 Activation is supported for Windows 10/11/Server, build 14393 and later.
141goto dk_done 175goto dk_done
142) 176)
@@ -165,7 +199,7 @@ setlocal EnableDelayedExpansion
165 199
166::======================================================================================================================================== 200::========================================================================================================================================
167 201
168echo "!_batf!" | find /i "!_ttemp!" 1>nul && ( 202echo "!_batf!" | find /i "!_ttemp!" %nul1% && (
169if /i not "!_work!"=="!_ttemp!" ( 203if /i not "!_work!"=="!_ttemp!" (
170%eline% 204%eline%
171echo Script is launched from the temp folder, 205echo Script is launched from the temp folder,
@@ -180,8 +214,8 @@ goto dk_done
180 214
181:: Elevate script as admin and pass arguments and preventing loop 215:: Elevate script as admin and pass arguments and preventing loop
182 216
183>nul fltmc || ( 217%nul1% fltmc || (
184if not defined _elev %nul% %psc% "start cmd.exe -arg '/c \"!_PSarg:'=''!\"' -verb runas" && exit /b 218if not defined _elev %psc% "start cmd.exe -arg '/c \"!_PSarg:'=''!\"' -verb runas" && exit /b
185%eline% 219%eline%
186echo This script require admin privileges. 220echo This script require admin privileges.
187echo To do so, right click on this script and select 'Run as administrator'. 221echo To do so, right click on this script and select 'Run as administrator'.
@@ -190,6 +224,21 @@ goto dk_done
190 224
191::======================================================================================================================================== 225::========================================================================================================================================
192 226
227:: This code disables QuickEdit for this cmd.exe session only without making permanent changes to the registry
228:: It is added because clicking on the script window pauses the operation and leads to the confusion that script stopped due to an error
229
230if %_unattended%==1 set quedit=1
231for %%# in (%_args%) do (if /i "%%#"=="-qedit" set quedit=1)
232
233reg query HKCU\Console /v QuickEdit %nul2% | find /i "0x0" %nul1% || if not defined quedit (
234reg add HKCU\Console /v QuickEdit /t REG_DWORD /d "0" /f %nul1%
235start cmd.exe /c ""!_batf!" %_args% -qedit"
236rem quickedit reset code is added at the starting of the script instead of here because it takes time to reflect in some cases
237exit /b
238)
239
240::========================================================================================================================================
241
193if %_rem%==1 goto :k_uninstall 242if %_rem%==1 goto :k_uninstall
194 243
195:k_menu 244:k_menu
@@ -227,7 +276,7 @@ goto :k_menu
227:k_menu2 276:k_menu2
228 277
229cls 278cls
230mode 102, 33 279mode 108, 34
231title KMS38 Activation 280title KMS38 Activation
232 281
233echo: 282echo:
@@ -276,7 +325,7 @@ if exist "%SystemRoot%\Servicing\Packages\Microsoft-Windows-Server*EvalEdition~*
276if exist "%SystemRoot%\Servicing\Packages\Microsoft-Windows-Server*EvalCorEdition~*.mum" set _eval=1 & set _evalserv=1 325if exist "%SystemRoot%\Servicing\Packages\Microsoft-Windows-Server*EvalCorEdition~*.mum" set _eval=1 & set _evalserv=1
277 326
278if defined _eval ( 327if defined _eval (
279reg query "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion" /v EditionID 2>nul | find /i "Eval" 1>nul && ( 328reg query "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion" /v EditionID %nul2% | find /i "Eval" %nul1% && (
280%eline% 329%eline%
281echo [%winos% ^| %winbuild%] 330echo [%winos% ^| %winbuild%]
282if defined _evalserv ( 331if defined _evalserv (
@@ -288,7 +337,7 @@ echo Evaluation Editions cannot be activated.
288echo You need to install full version of %winos% 337echo You need to install full version of %winos%
289echo: 338echo:
290echo Download it from here, 339echo Download it from here,
291echo https://massgrave.dev/genuine-installation-media.html 340echo https://%mas%/genuine-installation-media.html
292) 341)
293goto dk_done 342goto dk_done
294) 343)
@@ -307,7 +356,7 @@ if not exist "!_work!\clipup.exe" (
307echo clipup.exe doesn't exist in Server Cor/Acor [No GUI] version. 356echo clipup.exe doesn't exist in Server Cor/Acor [No GUI] version.
308echo It's required for KMS38 Activation. 357echo It's required for KMS38 Activation.
309echo Check below page on how to activate it. 358echo Check below page on how to activate it.
310echo https://massgrave.dev/kms38.html 359echo https://%mas%/kms38.html
311goto dk_done 360goto dk_done
312) 361)
313) 362)
@@ -317,14 +366,23 @@ goto dk_done
317:: Check SKU value / Check in multiple places to find Edition change corruption 366:: Check SKU value / Check in multiple places to find Edition change corruption
318 367
319set osSKU= 368set osSKU=
320set regSKU= 369set slcSKU=
321set wmiSKU= 370set wmiSKU=
371set regSKU=
322 372
323for /f "tokens=3 delims=." %%a in ('reg query "HKLM\SYSTEM\CurrentControlSet\Control\ProductOptions" /v OSProductPfn 2^>nul') do set "regSKU=%%a" 373if %winbuild% GEQ 14393 (set info=Kernel-BrandingInfo) else (set info=Kernel-ProductInfo)
324if %_wmic% EQU 1 for /f "tokens=2 delims==" %%a in ('"wmic Path Win32_OperatingSystem Get OperatingSystemSKU /format:LIST" 2^>nul') do if not errorlevel 1 set "wmiSKU=%%a" 374set d1=%ref% [void]$TypeBuilder.DefinePInvokeMethod('SLGetWindowsInformationDWORD', 'slc.dll', 'Public, Static', 1, [int], @([String], [int].MakeByRefType()), 1, 3);
325if %_wmic% EQU 0 for /f "tokens=1" %%a in ('%psc% "([WMI]'Win32_OperatingSystem=@').OperatingSystemSKU" 2^>nul') do if not errorlevel 1 set "wmiSKU=%%a" 375set d1=%d1% $Sku = 0; [void]$TypeBuilder.CreateType()::SLGetWindowsInformationDWORD('%info%', [ref]$Sku); $Sku
376for /f "delims=" %%s in ('"%psc% %d1%"') do if not errorlevel 1 (set slcSKU=%%s)
377if "%slcSKU%"=="0" set slcSKU=
378if 1%slcSKU% NEQ +1%slcSKU% set slcSKU=
326 379
327set osSKU=%wmiSKU% 380for /f "tokens=3 delims=." %%a in ('reg query "HKLM\SYSTEM\CurrentControlSet\Control\ProductOptions" /v OSProductPfn %nul6%') do set "regSKU=%%a"
381if %_wmic% EQU 1 for /f "tokens=2 delims==" %%a in ('"wmic Path Win32_OperatingSystem Get OperatingSystemSKU /format:LIST" %nul6%') do if not errorlevel 1 set "wmiSKU=%%a"
382if %_wmic% EQU 0 for /f "tokens=1" %%a in ('%psc% "([WMI]'Win32_OperatingSystem=@').OperatingSystemSKU" %nul6%') do if not errorlevel 1 set "wmiSKU=%%a"
383
384set osSKU=%slcSKU%
385if not defined osSKU set osSKU=%wmiSKU%
328if not defined osSKU set osSKU=%regSKU% 386if not defined osSKU set osSKU=%regSKU%
329 387
330if not defined osSKU ( 388if not defined osSKU (
@@ -340,15 +398,16 @@ set error=
340cls 398cls
341echo: 399echo:
342for /f "skip=2 tokens=2*" %%a in ('reg query "HKLM\SYSTEM\CurrentControlSet\Control\Session Manager\Environment" /v PROCESSOR_ARCHITECTURE') do set arch=%%b 400for /f "skip=2 tokens=2*" %%a in ('reg query "HKLM\SYSTEM\CurrentControlSet\Control\Session Manager\Environment" /v PROCESSOR_ARCHITECTURE') do set arch=%%b
343echo Checking OS Info [%winos% ^| %winbuild% ^| %arch%] 401for /f "tokens=6-7 delims=[]. " %%i in ('ver') do if "%%j"=="" (set fullbuild=%%i) else (set fullbuild=%%i.%%j)
402echo Checking OS Info [%winos% ^| %fullbuild% ^| %arch%]
344 403
345::======================================================================================================================================== 404::========================================================================================================================================
346 405
347:: Check Windows Script Host 406:: Check Windows Script Host
348 407
349set _WSH=1 408set _WSH=1
350reg query "HKCU\SOFTWARE\Microsoft\Windows Script Host\Settings" /v Enabled 2>nul | find /i "0x0" 1>nul && (set _WSH=0) 409reg query "HKCU\SOFTWARE\Microsoft\Windows Script Host\Settings" /v Enabled %nul2% | find /i "0x0" %nul1% && (set _WSH=0)
351reg query "HKLM\SOFTWARE\Microsoft\Windows Script Host\Settings" /v Enabled 2>nul | find /i "0x0" 1>nul && (set _WSH=0) 410reg query "HKLM\SOFTWARE\Microsoft\Windows Script Host\Settings" /v Enabled %nul2% | find /i "0x0" %nul1% && (set _WSH=0)
352 411
353if %_WSH% EQU 0 ( 412if %_WSH% EQU 0 (
354reg add "HKLM\Software\Microsoft\Windows Script Host\Settings" /v Enabled /t REG_DWORD /d 1 /f %nul% 413reg add "HKLM\Software\Microsoft\Windows Script Host\Settings" /v Enabled /t REG_DWORD /d 1 /f %nul%
@@ -384,7 +443,6 @@ set key=
384set pkey= 443set pkey=
385set altkey= 444set altkey=
386set changekey= 445set changekey=
387set curedition=
388set altedition= 446set altedition=
389 447
390if defined applist call :kms38data getkey 448if defined applist call :kms38data getkey
@@ -394,6 +452,14 @@ if defined applist if not defined key call :kms38fallback
394 452
395if defined altkey (set key=%altkey%&set changekey=1) 453if defined altkey (set key=%altkey%&set changekey=1)
396 454
455set /a UBR=0
456if %osSKU%==191 if defined altkey if defined altedition (
457for /f "skip=2 tokens=2*" %%a in ('reg query "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion" /v UBR 2^>nul') do if not errorlevel 1 set /a UBR=%%b
458if %winbuild% GEQ 19044 if !UBR! LSS 2788 (
459call :dk_color %Blue% "Windows must to be updated to build 19044.2788 or higher for IotEnterpriseS KMS38 activation."
460)
461)
462
397if not defined key if defined notfoundaltactID ( 463if not defined key if defined notfoundaltactID (
398call :dk_color %Red% "Checking Alternate Edition For KMS38 [%altedition% Activation ID Not Found]" 464call :dk_color %Red% "Checking Alternate Edition For KMS38 [%altedition% Activation ID Not Found]"
399) 465)
@@ -403,7 +469,7 @@ if not defined key if not defined _gvlk (
403echo [%winos% ^| %winbuild% ^| SKU:%osSKU%] 469echo [%winos% ^| %winbuild% ^| SKU:%osSKU%]
404echo Unable to find this product in the supported product list. 470echo Unable to find this product in the supported product list.
405echo Make sure you are using updated version of the script. 471echo Make sure you are using updated version of the script.
406echo https://massgrave.dev 472echo https://%mas%
407echo: 473echo:
408goto dk_done 474goto dk_done
409) 475)
@@ -414,14 +480,14 @@ goto dk_done
414 480
415echo: 481echo:
416if defined changekey ( 482if defined changekey (
417call :dk_color %Magenta% "[%altedition%] Edition product key will be used to enable KMS38 activation." 483call :dk_color %Blue% "[%altedition%] Edition product key will be used to enable KMS38 activation."
418echo: 484echo:
419) 485)
420 486
421set _partial= 487set _partial=
422if not defined key ( 488if not defined key (
423if %_wmic% EQU 1 for /f "tokens=2 delims==" %%# in ('wmic path SoftwareLicensingProduct where "ApplicationID='55c92734-d682-4d71-983e-d6ec3f16059f' and PartialProductKey<>null" Get PartialProductKey /value 2^>nul') do set "_partial=%%#" 489if %_wmic% EQU 1 for /f "tokens=2 delims==" %%# in ('wmic path SoftwareLicensingProduct where "ApplicationID='55c92734-d682-4d71-983e-d6ec3f16059f' and PartialProductKey<>null" Get PartialProductKey /value %nul6%') do set "_partial=%%#"
424if %_wmic% EQU 0 for /f "tokens=2 delims==" %%# in ('%psc% "(([WMISEARCHER]'SELECT PartialProductKey FROM SoftwareLicensingProduct WHERE ApplicationID=''55c92734-d682-4d71-983e-d6ec3f16059f'' AND PartialProductKey IS NOT NULL').Get()).PartialProductKey | %% {echo ('PartialProductKey='+$_)}" 2^>nul') do set "_partial=%%#" 490if %_wmic% EQU 0 for /f "tokens=2 delims==" %%# in ('%psc% "(([WMISEARCHER]'SELECT PartialProductKey FROM SoftwareLicensingProduct WHERE ApplicationID=''55c92734-d682-4d71-983e-d6ec3f16059f'' AND PartialProductKey IS NOT NULL').Get()).PartialProductKey | %% {echo ('PartialProductKey='+$_)}" %nul6%') do set "_partial=%%#"
425call echo Checking Installed Product Key [Partial Key - %%_partial%%] [Volume:GVLK] 491call echo Checking Installed Product Key [Partial Key - %%_partial%%] [Volume:GVLK]
426) 492)
427 493
@@ -440,7 +506,7 @@ echo Installing KMS Client Setup Key [%key%] [Successful]
440) else ( 506) else (
441call :dk_color %Red% "Installing KMS Client Setup Key [%key%] [Failed] !error_code!" 507call :dk_color %Red% "Installing KMS Client Setup Key [%key%] [Failed] !error_code!"
442if not defined error ( 508if not defined error (
443call :dk_color %Magenta% "In MAS, Goto Troubleshoot and run Fix Licensing option." 509call :dk_color %Blue% "%_fixmsg%"
444set showfix=1 510set showfix=1
445) 511)
446set error=1 512set error=1
@@ -452,8 +518,8 @@ set error=1
452:: Check activation ID for setting specific KMS host 518:: Check activation ID for setting specific KMS host
453 519
454set app= 520set app=
455if %_wmic% EQU 1 for /f "tokens=2 delims==" %%a in ('"wmic path SoftwareLicensingProduct where (ApplicationID='55c92734-d682-4d71-983e-d6ec3f16059f' and Description like '%%KMSCLIENT%%' and PartialProductKey is not NULL) get ID /VALUE" 2^>nul') do call set "app=%%a" 521if %_wmic% EQU 1 for /f "tokens=2 delims==" %%a in ('"wmic path SoftwareLicensingProduct where (ApplicationID='55c92734-d682-4d71-983e-d6ec3f16059f' and Description like '%%KMSCLIENT%%' and PartialProductKey is not NULL) get ID /VALUE" %nul6%') do call set "app=%%a"
456if %_wmic% EQU 0 for /f "tokens=2 delims==" %%a in ('%psc% "(([WMISEARCHER]'SELECT ID FROM SoftwareLicensingProduct WHERE ApplicationID=''55c92734-d682-4d71-983e-d6ec3f16059f'' AND Description like ''%%KMSCLIENT%%'' AND PartialProductKey IS NOT NULL').Get()).ID | %% {echo ('ID='+$_)}" 2^>nul') do call set "app=%%a" 522if %_wmic% EQU 0 for /f "tokens=2 delims==" %%a in ('%psc% "(([WMISEARCHER]'SELECT ID FROM SoftwareLicensingProduct WHERE ApplicationID=''55c92734-d682-4d71-983e-d6ec3f16059f'' AND Description like ''%%KMSCLIENT%%'' AND PartialProductKey IS NOT NULL').Get()).ID | %% {echo ('ID='+$_)}" %nul6%') do call set "app=%%a"
457 523
458if not defined app ( 524if not defined app (
459call :dk_color %Red% "Checking Installed GVLK Activation ID [Not Found] Aborting..." 525call :dk_color %Red% "Checking Installed GVLK Activation ID [Not Found] Aborting..."
@@ -509,6 +575,11 @@ goto :k_final
509:: In some cases clipup -v -o method fails and in some cases service restart method fails as well 575:: In some cases clipup -v -o method fails and in some cases service restart method fails as well
510:: To maximize success rate and get better error details, script will install tickets two times (service restart + clipup -v -o) 576:: To maximize success rate and get better error details, script will install tickets two times (service restart + clipup -v -o)
511 577
578if not exist %SystemRoot%\system32\ClipUp.exe (
579call :dk_color %Red% "Checking ClipUp.exe File [Not found, aborting the process]"
580goto :k_final
581)
582
512set "tdir=%ProgramData%\Microsoft\Windows\ClipSVC\GenuineTicket" 583set "tdir=%ProgramData%\Microsoft\Windows\ClipSVC\GenuineTicket"
513if not exist "%tdir%\" md "%tdir%\" %nul% 584if not exist "%tdir%\" md "%tdir%\" %nul%
514 585
@@ -518,7 +589,7 @@ if exist "%ProgramData%\Microsoft\Windows\ClipSVC\Install\Migration\*" del /f /q
518 589
519:: Signature value is as it is, it's not encoded 590:: Signature value is as it is, it's not encoded
520:: Session ID is in Base64 encoded format. It's decoded value is "OSMajorVersion=5;OSMinorVersion=1;OSPlatformId=2;PP=0;GVLKExp=2038-01-19T03:14:07Z;DownlevelGenuineState=1;" 591:: Session ID is in Base64 encoded format. It's decoded value is "OSMajorVersion=5;OSMinorVersion=1;OSPlatformId=2;PP=0;GVLKExp=2038-01-19T03:14:07Z;DownlevelGenuineState=1;"
521:: Check https://massgrave.dev/kms38.html#Manual_Activation to see how it's generated 592:: Check mass grave[.]dev/kms38.html#Manual_Activation to see how it's generated
522 593
523set "signature=C52iGEoH+1VqzI6kEAqOhUyrWuEObnivzaVjyef8WqItVYd/xGDTZZ3bkxAI9hTpobPFNJyJx6a3uriXq3HVd7mlXfSUK9ydeoUdG4eqMeLwkxeb6jQWJzLOz41rFVSMtBL0e+ycCATebTaXS4uvFYaDHDdPw2lKY8ADj3MLgsA=" 594set "signature=C52iGEoH+1VqzI6kEAqOhUyrWuEObnivzaVjyef8WqItVYd/xGDTZZ3bkxAI9hTpobPFNJyJx6a3uriXq3HVd7mlXfSUK9ydeoUdG4eqMeLwkxeb6jQWJzLOz41rFVSMtBL0e+ycCATebTaXS4uvFYaDHDdPw2lKY8ADj3MLgsA="
524set "sessionId=TwBTAE0AYQBqAG8AcgBWAGUAcgBzAGkAbwBuAD0ANQA7AE8AUwBNAGkAbgBvAHIAVgBlAHIAcwBpAG8AbgA9ADEAOwBPAFMAUABsAGEAdABmAG8AcgBtAEkAZAA9ADIAOwBQAFAAPQAwADsARwBWAEwASwBFAHgAcAA9ADIAMAAzADgALQAwADEALQAxADkAVAAwADMAOgAxADQAOgAwADcAWgA7AEQAbwB3AG4AbABlAHYAZQBsAEcAZQBuAHUAaQBuAGUAUwB0AGEAdABlAD0AMQA7AAAA" 595set "sessionId=TwBTAE0AYQBqAG8AcgBWAGUAcgBzAGkAbwBuAD0ANQA7AE8AUwBNAGkAbgBvAHIAVgBlAHIAcwBpAG8AbgA9ADEAOwBPAFMAUABsAGEAdABmAG8AcgBtAEkAZAA9ADIAOwBQAFAAPQAwADsARwBWAEwASwBFAHgAcAA9ADIAMAAzADgALQAwADEALQAxADkAVAAwADMAOgAxADQAOgAwADcAWgA7AEQAbwB3AG4AbABlAHYAZQBsAEcAZQBuAHUAaQBuAGUAUwB0AGEAdABlAD0AMQA7AAAA"
@@ -527,7 +598,7 @@ set "sessionId=TwBTAE0AYQBqAG8AcgBWAGUAcgBzAGkAbwBuAD0ANQA7AE8AUwBNAGkAbgBvAHIAV
527copy /y /b "%tdir%\GenuineTicket" "%tdir%\GenuineTicket.xml" %nul% 598copy /y /b "%tdir%\GenuineTicket" "%tdir%\GenuineTicket.xml" %nul%
528 599
529if not exist "%tdir%\GenuineTicket.xml" ( 600if not exist "%tdir%\GenuineTicket.xml" (
530call :dk_color %Red% "Generating GenuineTicket.xml [Failed]" 601call :dk_color %Red% "Generating GenuineTicket.xml [Failed, aborting the process]"
531if exist "%tdir%\Genuine*" del /f /q "%tdir%\Genuine*" %nul% 602if exist "%tdir%\Genuine*" del /f /q "%tdir%\Genuine*" %nul%
532goto :k_final 603goto :k_final
533) else ( 604) else (
@@ -542,10 +613,10 @@ net stop sppsvc /y %nul%
542net stop sppsvc /y %nul% 613net stop sppsvc /y %nul%
543net stop sppsvc /y %nul% 614net stop sppsvc /y %nul%
544 615
545sc query sppsvc | find /i "1 STOPPED" %nul% && ( 616sc query sppsvc | find /i "STOPPED" %nul% && (
546echo Stopping sppsvc Service [Successful] 617echo Stopping sppsvc Service [Successful]
547) || ( 618) || (
548call :dk_color %Red% "Stopping sppsvc Service [Failed]" 619call :dk_color %Gray% "Stopping sppsvc Service [Failed]"
549) 620)
550 621
551%_xmlexist% ( 622%_xmlexist% (
@@ -566,6 +637,12 @@ clipup -v -o
566 637
567set rebuildinfo= 638set rebuildinfo=
568 639
640if not exist %ProgramData%\Microsoft\Windows\ClipSVC\tokens.dat (
641set error=1
642set rebuildinfo=1
643call :dk_color %Red% "Checking ClipSVC tokens.dat [Not Found]"
644)
645
569%_xmlexist% ( 646%_xmlexist% (
570set error=1 647set error=1
571set rebuildinfo=1 648set rebuildinfo=1
@@ -580,7 +657,7 @@ call :dk_color %Red% "Checking Ticket Migration [Failed]"
580 657
581if defined applist if not defined showfix if defined rebuildinfo ( 658if defined applist if not defined showfix if defined rebuildinfo (
582set showfix=1 659set showfix=1
583call :dk_color %Magenta% "In MAS, Goto Troubleshoot and run Fix Licensing option." 660call :dk_color %Blue% "%_fixmsg%"
584) 661)
585 662
586if exist "%tdir%\Genuine*" del /f /q "%tdir%\Genuine*" %nul% 663if exist "%tdir%\Genuine*" del /f /q "%tdir%\Genuine*" %nul%
@@ -619,8 +696,8 @@ goto :k_final
619) 696)
620 697
621call :dk_color %Red% "Activation Failed" 698call :dk_color %Red% "Activation Failed"
622if not defined error call :dk_color %Magenta% "In MAS, Goto Troubleshoot and run Fix Licensing option." 699if not defined error call :dk_color %Blue% "%_fixmsg%"
623call :dk_color2 %Magenta% "Check this page for help" %_Yellow% " https://massgrave.dev/troubleshoot" 700call :dk_color2 %Blue% "Check this page for help" %_Yellow% " https://%mas%/troubleshoot"
624 701
625::======================================================================================================================================== 702::========================================================================================================================================
626 703
@@ -645,9 +722,9 @@ if defined _k38 (
645%psc% "$f=[io.file]::ReadAllText('!_batp!') -split ':regdel\:.*';& ([ScriptBlock]::Create($f[1])) -protect;" 722%psc% "$f=[io.file]::ReadAllText('!_batp!') -split ':regdel\:.*';& ([ScriptBlock]::Create($f[1])) -protect;"
646%nul% reg delete "HKLM\%specific_kms%" /f 723%nul% reg delete "HKLM\%specific_kms%" /f
647%nul% reg query "HKLM\%specific_kms%" && ( 724%nul% reg query "HKLM\%specific_kms%" && (
648call :dk_color %Magenta% "Protect KMS38 By KMS [Successful] [Locked A Registry Key]" 725call :dk_color %Blue% "Protect KMS38 From KMS [Successful] [Locked A Registry Key]"
649) || ( 726) || (
650call :dk_color %Red% "Protect KMS38 By KMS [Failed To Lock A Registry Key]" 727call :dk_color %Red% "Protect KMS38 From KMS [Failed To Lock A Registry Key]"
651) 728)
652) 729)
653 730
@@ -731,7 +808,7 @@ $key.SetAccessControl($acl)
731:k_actinfo 808:k_actinfo
732 809
733set xpr= 810set xpr=
734for /f "tokens=* delims=" %%# in ('%psc% "$([DateTime]::Now.addMinutes(%gpr%)).ToString('yyyy-MM-dd HH:mm:ss')" 2^>nul') do set "xpr=%%#" 811for /f "tokens=* delims=" %%# in ('%psc% "$([DateTime]::Now.addMinutes(%gpr%)).ToString('yyyy-MM-dd HH:mm:ss')" %nul6%') do set "xpr=%%#"
735call :dk_color %Green% "%winos% is activated till !xpr!" 812call :dk_color %Green% "%winos% is activated till !xpr!"
736exit /b 813exit /b
737 814
@@ -740,8 +817,8 @@ exit /b
740:k_checkexp 817:k_checkexp
741 818
742set gpr=0 819set gpr=0
743if %_wmic% EQU 1 for /f "tokens=2 delims==" %%# in ('"wmic path SoftwareLicensingProduct where (ApplicationID='55c92734-d682-4d71-983e-d6ec3f16059f' and Description like '%%KMSCLIENT%%' and PartialProductKey is not NULL) get GracePeriodRemaining /VALUE" 2^>nul') do set "gpr=%%#" 820if %_wmic% EQU 1 for /f "tokens=2 delims==" %%# in ('"wmic path SoftwareLicensingProduct where (ApplicationID='55c92734-d682-4d71-983e-d6ec3f16059f' and Description like '%%KMSCLIENT%%' and PartialProductKey is not NULL) get GracePeriodRemaining /VALUE" %nul6%') do set "gpr=%%#"
744if %_wmic% EQU 0 for /f "tokens=2 delims==" %%# in ('%psc% "(([WMISEARCHER]'SELECT GracePeriodRemaining FROM SoftwareLicensingProduct WHERE ApplicationID=''55c92734-d682-4d71-983e-d6ec3f16059f'' AND Description like ''%%KMSCLIENT%%'' AND PartialProductKey IS NOT NULL').Get()).GracePeriodRemaining | %% {echo ('GracePeriodRemaining='+$_)}" 2^>nul') do set "gpr=%%#" 821if %_wmic% EQU 0 for /f "tokens=2 delims==" %%# in ('%psc% "(([WMISEARCHER]'SELECT GracePeriodRemaining FROM SoftwareLicensingProduct WHERE ApplicationID=''55c92734-d682-4d71-983e-d6ec3f16059f'' AND Description like ''%%KMSCLIENT%%'' AND PartialProductKey IS NOT NULL').Get()).GracePeriodRemaining | %% {echo ('GracePeriodRemaining='+$_)}" %nul6%') do set "gpr=%%#"
745if %gpr% GTR 259200 (set _k38=1) else (set _k38=) 822if %gpr% GTR 259200 (set _k38=1) else (set _k38=)
746exit /b 823exit /b
747 824
@@ -749,8 +826,8 @@ exit /b
749 826
750:dk_checkperm 827:dk_checkperm
751 828
752if %_wmic% EQU 1 wmic path SoftwareLicensingProduct where (LicenseStatus='1' and GracePeriodRemaining='0' and PartialProductKey is not NULL) get Name /value 2>nul | findstr /i "Windows" 1>nul && set _perm=1||set _perm= 829if %_wmic% EQU 1 wmic path SoftwareLicensingProduct where (LicenseStatus='1' and GracePeriodRemaining='0' and PartialProductKey is not NULL) get Name /value %nul2% | findstr /i "Windows" %nul1% && set _perm=1||set _perm=
753if %_wmic% EQU 0 %psc% "(([WMISEARCHER]'SELECT Name FROM SoftwareLicensingProduct WHERE LicenseStatus=1 AND GracePeriodRemaining=0 AND PartialProductKey IS NOT NULL').Get()).Name | %% {echo ('Name='+$_)}" 2>nul | findstr /i "Windows" 1>nul && set _perm=1||set _perm= 830if %_wmic% EQU 0 %psc% "(([WMISEARCHER]'SELECT Name FROM SoftwareLicensingProduct WHERE LicenseStatus=1 AND GracePeriodRemaining=0 AND PartialProductKey IS NOT NULL').Get()).Name | %% {echo ('Name='+$_)}" %nul2% | findstr /i "Windows" %nul1% && set _perm=1||set _perm=
754exit /b 831exit /b
755 832
756:: Refresh license status 833:: Refresh license status
@@ -765,8 +842,8 @@ exit /b
765 842
766:dk_channel 843:dk_channel
767 844
768if %_wmic% EQU 1 for /f "tokens=2 delims==" %%# in ('wmic path SoftwareLicensingProduct where "ApplicationID='55c92734-d682-4d71-983e-d6ec3f16059f' and PartialProductKey<>null" Get ProductKeyChannel /value 2^>nul') do set "_channel=%%#" 845if %_wmic% EQU 1 for /f "tokens=2 delims==" %%# in ('wmic path SoftwareLicensingProduct where "ApplicationID='55c92734-d682-4d71-983e-d6ec3f16059f' and PartialProductKey<>null" Get ProductKeyChannel /value %nul6%') do set "_channel=%%#"
769if %_wmic% EQU 0 for /f "tokens=2 delims==" %%# in ('%psc% "(([WMISEARCHER]'SELECT ProductKeyChannel FROM SoftwareLicensingProduct WHERE ApplicationID=''55c92734-d682-4d71-983e-d6ec3f16059f'' AND PartialProductKey IS NOT NULL').Get()).ProductKeyChannel | %% {echo ('ProductKeyChannel='+$_)}" 2^>nul') do set "_channel=%%#" 846if %_wmic% EQU 0 for /f "tokens=2 delims==" %%# in ('%psc% "(([WMISEARCHER]'SELECT ProductKeyChannel FROM SoftwareLicensingProduct WHERE ApplicationID=''55c92734-d682-4d71-983e-d6ec3f16059f'' AND PartialProductKey IS NOT NULL').Get()).ProductKeyChannel | %% {echo ('ProductKeyChannel='+$_)}" %nul6%') do set "_channel=%%#"
770exit /b 847exit /b
771 848
772:: Get Windows Activation IDs 849:: Get Windows Activation IDs
@@ -774,18 +851,31 @@ exit /b
774:dk_actids 851:dk_actids
775 852
776set applist= 853set applist=
777if %_wmic% EQU 1 set "chkapp=for /f "tokens=2 delims==" %%a in ('"wmic path SoftwareLicensingProduct where (ApplicationID='55c92734-d682-4d71-983e-d6ec3f16059f') get ID /VALUE" 2^>nul')" 854if %_wmic% EQU 1 set "chkapp=for /f "tokens=2 delims==" %%a in ('"wmic path SoftwareLicensingProduct where (ApplicationID='55c92734-d682-4d71-983e-d6ec3f16059f') get ID /VALUE" %nul6%')"
778if %_wmic% EQU 0 set "chkapp=for /f "tokens=2 delims==" %%a in ('%psc% "(([WMISEARCHER]'SELECT ID FROM SoftwareLicensingProduct WHERE ApplicationID=''55c92734-d682-4d71-983e-d6ec3f16059f''').Get()).ID ^| %% {echo ('ID='+$_)}" 2^>nul')" 855if %_wmic% EQU 0 set "chkapp=for /f "tokens=2 delims==" %%a in ('%psc% "(([WMISEARCHER]'SELECT ID FROM SoftwareLicensingProduct WHERE ApplicationID=''55c92734-d682-4d71-983e-d6ec3f16059f''').Get()).ID ^| %% {echo ('ID='+$_)}" %nul6%')"
779%chkapp% do (if defined applist (call set "applist=!applist! %%a") else (call set "applist=%%a")) 856%chkapp% do (if defined applist (call set "applist=!applist! %%a") else (call set "applist=%%a"))
780exit /b 857exit /b
781 858
859:: Get SvcRestartTask info
860
861:gettaskinfo:
862$task = Get-ScheduledTask | Where-Object { $_.TaskName -eq 'SvcRestartTask' -and $_.TaskPath -eq '\Microsoft\Windows\SoftwareProtectionPlatform\' }
863$info = $task | Get-ScheduledTaskInfo
864if ($info.LastRunTime -match 99) {
865$task | Start-ScheduledTask
866Start-Sleep -Seconds 3
867$info = $task | Get-ScheduledTaskInfo
868}
869"$($task.State) $($info.LastTaskResult) $($info.LastRunTime)"
870:gettaskinfo:
871
782:: Check wmic.exe 872:: Check wmic.exe
783 873
784:dk_ckeckwmic 874:dk_ckeckwmic
785 875
786set _wmic=0 876set _wmic=0
787for %%# in (wmic.exe) do @if not "%%~$PATH:#"=="" ( 877for %%# in (wmic.exe) do @if not "%%~$PATH:#"=="" (
788wmic path Win32_ComputerSystem get CreationClassName /value 2>nul | find /i "computersystem" 1>nul && set _wmic=1 878wmic path Win32_ComputerSystem get CreationClassName /value %nul2% | find /i "computersystem" %nul1% && set _wmic=1
789) 879)
790exit /b 880exit /b
791 881
@@ -800,8 +890,8 @@ set d1=%d1% $meth.SetImplementationFlags(128); $TypeBuilder.CreateType()::Brandi
800 890
801set winos= 891set winos=
802for /f "delims=" %%s in ('"%psc% %d1%"') do if not errorlevel 1 (set winos=%%s) 892for /f "delims=" %%s in ('"%psc% %d1%"') do if not errorlevel 1 (set winos=%%s)
803echo "%winos%" | find /i "Windows" 1>nul || ( 893echo "%winos%" | find /i "Windows" %nul1% || (
804for /f "skip=2 tokens=2*" %%a in ('reg query "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion" /v ProductName 2^>nul') do set "winos=%%b" 894for /f "skip=2 tokens=2*" %%a in ('reg query "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion" /v ProductName %nul6%') do set "winos=%%b"
805if %winbuild% GEQ 22000 ( 895if %winbuild% GEQ 22000 (
806set winos=!winos:Windows 10=Windows 11! 896set winos=!winos:Windows 10=Windows 11!
807) 897)
@@ -866,17 +956,33 @@ exit /b
866 956
867:dk_errorcheck 957:dk_errorcheck
868 958
959set showfix=
960
961:: Check corrupt services
962
963set serv_cor=
964for %%# in (%_serv%) do (
965set _corrupt=
966sc start %%# %nul%
967if !errorlevel! EQU 1060 set _corrupt=1
968sc query %%# %nul% || set _corrupt=1
969for %%G in (DependOnService Description DisplayName ErrorControl ImagePath ObjectName Start Type) do if not defined _corrupt (reg query HKLM\SYSTEM\CurrentControlSet\Services\%%# /v %%G %nul% || set _corrupt=1)
970if defined _corrupt (if defined serv_cor (set "serv_cor=!serv_cor! %%#") else (set "serv_cor=%%#"))
971)
972
973if defined serv_cor (
974set error=1
975call :dk_color %Red% "Checking Corrupt Services [%serv_cor%]"
976)
977
978::========================================================================================================================================
979
869:: Check disabled services 980:: Check disabled services
870 981
871set serv_ste= 982set serv_ste=
872for %%# in (%_serv%) do ( 983for %%# in (%_serv%) do (
873set serv_dis=
874reg query HKLM\SYSTEM\CurrentControlSet\Services\%%# /v ImagePath %nul% || set serv_dis=1
875for /f "skip=2 tokens=2*" %%a in ('reg query HKLM\SYSTEM\CurrentControlSet\Services\%%# /v Start 2^>nul') do if /i %%b equ 0x4 set serv_dis=1
876sc start %%# %nul% 984sc start %%# %nul%
877if !errorlevel! EQU 1058 set serv_dis=1 985if !errorlevel! EQU 1058 (if defined serv_ste (set "serv_ste=!serv_ste! %%#") else (set "serv_ste=%%#"))
878sc query %%# %nul% || set serv_dis=1
879if defined serv_dis (if defined serv_ste (set "serv_ste=!serv_ste! %%#") else (set "serv_ste=%%#"))
880) 986)
881 987
882:: Change disabled services startup type to default 988:: Change disabled services startup type to default
@@ -919,7 +1025,7 @@ set errorcode=
919set checkerror= 1025set checkerror=
920net start %%# /y %nul% 1026net start %%# /y %nul%
921set errorcode=!errorlevel! 1027set errorcode=!errorlevel!
922sc query %%# | find /i "4 RUNNING" %nul% || set checkerror=1 1028sc query %%# | find /i "RUNNING" %nul% || set checkerror=1
923 1029
924sc start %%# %nul% 1030sc start %%# %nul%
925if !errorlevel! NEQ 1056 if !errorlevel! NEQ 0 (set errorcode=!errorlevel!&set checkerror=1) 1031if !errorlevel! NEQ 1056 if !errorlevel! NEQ 0 (set errorcode=!errorlevel!&set checkerror=1)
@@ -930,7 +1036,8 @@ if defined serv_e (
930set error=1 1036set error=1
931call :dk_color %Red% "Starting Services [Failed] [%serv_e%]" 1037call :dk_color %Red% "Starting Services [Failed] [%serv_e%]"
932echo %serv_e% | findstr /i "ClipSVC-1058 sppsvc-1058" %nul% && ( 1038echo %serv_e% | findstr /i "ClipSVC-1058 sppsvc-1058" %nul% && (
933call :dk_color %Magenta% "Restart the system to fix disabled service error 1058." 1039call :dk_color %Blue% "Restart the system to fix disabled service error 1058."
1040set showfix=1
934) 1041)
935) 1042)
936 1043
@@ -940,61 +1047,51 @@ call :dk_color %Magenta% "Restart the system to fix disabled service error 1058.
940 1047
941if defined safeboot_option ( 1048if defined safeboot_option (
942set error=1 1049set error=1
943call :dk_color2 %Red% "Checking Boot Mode " %Magenta% "[System is running in safe mode. Run in normal mode.]" 1050set showfix=1
1051call :dk_color2 %Red% "Checking Boot Mode " %Blue% "[System is running in safe mode. Run in normal mode.]"
944) 1052)
945 1053
946 1054
947reg query "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Setup\State" 2>nul | find /i "IMAGE_STATE_COMPLETE" 1>nul || ( 1055reg query "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Setup\State" %nul2% | find /i "IMAGE_STATE_COMPLETE" %nul1% || (
948set error=1 1056set error=1
949call :dk_color2 %Red% "Checking Audit Mode " %Magenta% "[System is running in Audit mode. Run in normal mode.]" 1057set showfix=1
1058call :dk_color2 %Red% "Checking Audit Mode " %Blue% "[IMAGE_STATE_COMPLETE status not found. Run in normal mode.]"
950) 1059)
951 1060
952 1061
953reg query "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\WinPE" /v InstRoot %nul% && ( 1062reg query "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\WinPE" /v InstRoot %nul% && (
954set error=1 1063set error=1
955call :dk_color2 %Red% "Checking WinPE " %Magenta% "[System is running in WinPE mode. Run in normal mode.]" 1064set showfix=1
956) 1065call :dk_color2 %Red% "Checking WinPE " %Blue% "[System is running in WinPE mode. Run in normal mode.]"
957
958
959for %%# in (wmic.exe) do @if "%%~$PATH:#"=="" (
960call :dk_color %Gray% "Checking WMIC.exe [Not Found]"
961) 1066)
962 1067
963 1068
964%psc% $ExecutionContext.SessionState.LanguageMode 2>nul | find /i "Full" 1>nul || ( 1069%psc% $ExecutionContext.SessionState.LanguageMode %nul2% | find /i "Full" %nul1% || (
965set error=1 1070set error=1
966call :dk_color %Red% "Checking Powershell [Not Responding]" 1071call :dk_color %Red% "Checking Powershell [Not Responding]"
967) 1072)
968 1073
969 1074
970set wmifailed=
971if %_wmic% EQU 1 wmic path Win32_ComputerSystem get CreationClassName /value 2>nul | find /i "computersystem" 1>nul
972if %_wmic% EQU 0 %psc% "Get-CIMInstance -Class Win32_ComputerSystem | Select-Object -Property CreationClassName" 2>nul | find /i "computersystem" 1>nul
973if %errorlevel% NEQ 0 (
974set error=1
975set wmifailed=1
976call :dk_color %Red% "Checking WMI [Not Responding] %_wmic%"
977call :dk_color %Magenta% "In MAS, Goto Troubleshoot and run Fix WMI option."
978)
979
980
981if not "%regSKU%"=="%wmiSKU%" (
982call :dk_color %Red% "Checking WMI/REG SKU [Difference Found - WMI:%wmiSKU% Reg:%regSKU%]"
983)
984
985
986DISM /English /Online /Get-CurrentEdition %nul% 1075DISM /English /Online /Get-CurrentEdition %nul%
987set error_code=%errorlevel% 1076set dism_error=%errorlevel%
988cmd /c exit /b %error_code% 1077cmd /c exit /b %dism_error%
989if %error_code% NEQ 0 set "error_code=[0x%=ExitCode%]" 1078if %dism_error% NEQ 0 set "dism_error=[0x%=ExitCode%]"
990if %error_code% NEQ 0 ( 1079if %dism_error% NEQ 0 (
991call :dk_color %Red% "Checking DISM [Not Responding] %error_code%" 1080call :dk_color %Red% "Checking DISM [Not Responding] %dism_error%"
992) 1081)
993 1082
994 1083
995if exist "%SystemRoot%\Servicing\Packages\Microsoft-Windows-*EvalEdition~*.mum" ( 1084if not defined officeact if exist "%SystemRoot%\Servicing\Packages\Microsoft-Windows-*EvalEdition~*.mum" (
996set error=1 1085set error=1
997call :dk_color %Red% "Checking Eval Packages [Non-Eval Licenses are installed in Eval Windows]" 1086call :dk_color %Red% "Checking Eval Packages [Non-Eval Licenses are installed in Eval Windows]"
1087if /i %dism_error%==[0x800F0805] (
1088for %%# in (4 125 126 188 191 205) do if "%osSKU%"=="%%#" (
1089call :dk_color %Blue% "Evaluation Windows can not be activated and different License install may lead to errors."
1090call :dk_color %Blue% "It is recommended to install full version of %winos%."
1091call :dk_color %Blue% "You can download it from https://%mas%/genuine-installation-media.html"
1092set showfix=1
1093)
1094)
998) 1095)
999 1096
1000 1097
@@ -1008,21 +1105,49 @@ call :dk_color %Red% "Checking slmgr /dlv [Not Responding] %
1008) 1105)
1009 1106
1010 1107
1108for %%# in (wmic.exe) do @if "%%~$PATH:#"=="" (
1109call :dk_color %Gray% "Checking WMIC.exe [Not Found]"
1110)
1111
1112
1113set wmifailed=
1114if %_wmic% EQU 1 wmic path Win32_ComputerSystem get CreationClassName /value %nul2% | find /i "computersystem" %nul1%
1115if %_wmic% EQU 0 %psc% "Get-CIMInstance -Class Win32_ComputerSystem | Select-Object -Property CreationClassName" %nul2% | find /i "computersystem" %nul1%
1116
1117if %errorlevel% NEQ 0 set wmifailed=1
1118echo "%error_code%" | findstr /i "0x800410 0x800440" %nul1% && set wmifailed=1& :: https://learn.microsoft.com/en-us/windows/win32/wmisdk/wmi-error-constants
1119if defined wmifailed (
1120set error=1
1121call :dk_color %Red% "Checking WMI [Not Responding]"
1122call :dk_color %Blue% "In MAS, Goto Troubleshoot and run Fix WMI option."
1123set showfix=1
1124)
1125
1126
1127%nul% set /a "sum=%slcSKU%+%regSKU%+%wmiSKU%"
1128set /a "sum/=3"
1129if not defined officeact if not "%sum%"=="%slcSKU%" (
1130call :dk_color %Red% "Checking SLC/WMI/REG SKU [Difference Found - SLC:%slcSKU% WMI:%wmiSKU% Reg:%regSKU%]"
1131)
1132
1133
1011reg query "HKU\S-1-5-20\Software\Microsoft\Windows NT\CurrentVersion\SoftwareProtectionPlatform\PersistedTSReArmed" %nul% && ( 1134reg query "HKU\S-1-5-20\Software\Microsoft\Windows NT\CurrentVersion\SoftwareProtectionPlatform\PersistedTSReArmed" %nul% && (
1012set error=1 1135set error=1
1013call :dk_color2 %Red% "Checking Rearm " %Magenta% "[System Restart Is Required]" 1136set showfix=1
1137call :dk_color2 %Red% "Checking Rearm " %Blue% "[System Restart Is Required]"
1014) 1138)
1015 1139
1016 1140
1017reg query "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\ClipSVC\Volatile\PersistedSystemState" %nul% && ( 1141reg query "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\ClipSVC\Volatile\PersistedSystemState" %nul% && (
1018set error=1 1142set error=1
1019call :dk_color2 %Red% "Checking ClipSVC " %Magenta% "[System Restart Is Required]" 1143set showfix=1
1144call :dk_color2 %Red% "Checking ClipSVC " %Blue% "[System Restart Is Required]"
1020) 1145)
1021 1146
1022 1147
1023for /f "skip=2 tokens=2*" %%a in ('reg query "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\SoftwareProtectionPlatform" /v "SkipRearm" 2^>nul') do if /i %%b NEQ 0x0 ( 1148for /f "skip=2 tokens=2*" %%a in ('reg query "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\SoftwareProtectionPlatform" /v "SkipRearm" %nul6%') do if /i %%b NEQ 0x0 (
1024reg add "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\SoftwareProtectionPlatform" /v "SkipRearm" /t REG_DWORD /d "0" /f %nul% 1149reg add "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\SoftwareProtectionPlatform" /v "SkipRearm" /t REG_DWORD /d "0" /f %nul%
1025call :dk_color %Red% "Checking SkipRearm [Default 0 Value Not Found, Changing To 0]" 1150call :dk_color %Red% "Checking SkipRearm [Default 0 Value Not Found. Changing To 0]"
1026net stop sppsvc /y %nul% 1151net stop sppsvc /y %nul%
1027net start sppsvc /y %nul% 1152net start sppsvc /y %nul%
1028set error=1 1153set error=1
@@ -1031,7 +1156,24 @@ set error=1
1031 1156
1032reg query "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\SoftwareProtectionPlatform\Plugins\Objects\msft:rm/algorithm/hwid/4.0" /f ba02fed39662 /d %nul% || ( 1157reg query "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\SoftwareProtectionPlatform\Plugins\Objects\msft:rm/algorithm/hwid/4.0" /f ba02fed39662 /d %nul% || (
1033call :dk_color %Red% "Checking SPP Registry Key [Incorrect ModuleId Found]" 1158call :dk_color %Red% "Checking SPP Registry Key [Incorrect ModuleId Found]"
1159call :dk_color %Blue% "Possibly Caused By Gaming Spoofers. Help: https://%mas%/troubleshoot"
1034set error=1 1160set error=1
1161set showfix=1
1162)
1163
1164
1165set tokenstore=
1166for /f "skip=2 tokens=2*" %%a in ('reg query "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\SoftwareProtectionPlatform" /v TokenStore %nul6%') do call set "tokenstore=%%b"
1167if not exist "%tokenstore%\" (
1168set error=1
1169REM This code creates token folder only if it's missing and sets default permission for it
1170mkdir "%tokenstore%" %nul%
1171set "d=$sddl = 'O:BAG:BAD:PAI(A;OICI;FA;;;SY)(A;OICI;FA;;;BA)(A;OICIIO;GR;;;BU)(A;;FR;;;BU)(A;OICI;FA;;;S-1-5-80-123231216-2592883651-3715271367-3753151631-4175906628)';"
1172set "d=!d! $AclObject = New-Object System.Security.AccessControl.DirectorySecurity;"
1173set "d=!d! $AclObject.SetSecurityDescriptorSddlForm($sddl);"
1174set "d=!d! Set-Acl -Path %tokenstore% -AclObject $AclObject;"
1175%psc% "!d!" %nul%
1176call :dk_color %Gray% "Checking SPP Token Folder [Not Found. Creating Now] [%tokenstore%\]"
1035) 1177)
1036 1178
1037 1179
@@ -1049,44 +1191,43 @@ call :dk_color %Red% "Checking Activation IDs [Not Found]"
1049) 1191)
1050 1192
1051 1193
1052set tokenstore=
1053for /f "skip=2 tokens=2*" %%a in ('reg query "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\SoftwareProtectionPlatform" /v TokenStore 2^>nul') do call set "tokenstore=%%b"
1054if not exist "%tokenstore%\" (
1055set error=1
1056call :dk_color %Red% "Checking SPP Token Folder [Not Found] [%tokenstore%\]"
1057)
1058
1059
1060if exist "%tokenstore%\" if not exist "%tokenstore%\tokens.dat" ( 1194if exist "%tokenstore%\" if not exist "%tokenstore%\tokens.dat" (
1061set error=1 1195set error=1
1062call :dk_color %Red% "Checking SPP tokens.dat [Not Found] [%tokenstore%\]" 1196call :dk_color %Red% "Checking SPP tokens.dat [Not Found] [%tokenstore%\]"
1063) 1197)
1064 1198
1065 1199
1066if not exist %ProgramData%\Microsoft\Windows\ClipSVC\tokens.dat ( 1200if not exist %SystemRoot%\system32\sppsvc.exe (
1067set error=1 1201set error=1
1068call :dk_color %Red% "Checking ClipSVC tokens.dat [Not Found]" 1202set showfix=1
1203call :dk_color %Red% "Checking sppsvc.exe File [Not Found]"
1069) 1204)
1070 1205
1071 1206
1072if not exist %SystemRoot%\system32\sppsvc.exe ( 1207set task=
1073set error=1 1208set taskerror=
1074call :dk_color %Red% "Checking sppsvc.exe File [Not Found]" 1209if not defined wmifailed if not defined officeact (
1210for /f "delims=" %%a in ('%psc% "$f=[io.file]::ReadAllText('!_batp!') -split ':gettaskinfo\:.*';iex ($f[1]);"') do (set task=%%a)
1211echo "!task!" | find /i "Ready 0 " %nul% || set taskerror=1
1212echo "!task!" | find "99" %nul% && set taskerror=1
1213if defined taskerror (
1214call :dk_color %Gray% "Checking SvcRestartTask Last Run [Issues Found, !task!]"
1215call :dk_color %Gray% "Windows may face issues in keeping activation. Help: https://%mas%/troubleshoot"
1216)
1075) 1217)
1076 1218
1077 1219
1078:: Below checks are performed if required services are not disabled + slmgr /dlv errorlevel is not Zero + Rearm restart is not required + WMI is working fine 1220:: Below checks are performed if required services are not disabled or corrupted + if there is any error + slmgr /dlv errorlevel is not Zero + no fix was shown before
1079 1221
1080set showfix=
1081set wpaerror= 1222set wpaerror=
1082set permerror= 1223set permerror=
1083if not defined serv_cste if /i not %error_code%==0 if /i not %error_code%==0xC004D302 if not defined wmifailed ( 1224if not defined serv_cor if not defined serv_cste if defined error if /i not %error_code%==0 if not defined showfix (
1084 1225
1085REM This code checks for invalid registry keys in HKLM\SYSTEM\WPA. This issue may appear even on healthy systems. 1226REM This code checks for invalid registry keys in HKLM\SYSTEM\WPA. This issue may appear even on healthy systems.
1086 1227
1087if %winbuild% GEQ 14393 ( 1228if %winbuild% GEQ 14393 (
1088set /a count=0 1229set /a count=0
1089for /f %%a in ('reg query "HKLM\SYSTEM\WPA" 2^>nul') do set /a count+=1 1230for /f %%a in ('reg query "HKLM\SYSTEM\WPA" %nul6%') do set /a count+=1
1090for /L %%# in (1,1,!count!) do ( 1231for /L %%# in (1,1,!count!) do (
1091reg query "HKLM\SYSTEM\WPA\8DEC0AF1-0341-4b93-85CD-72606C2DF94C-7P-%%#" /ve /t REG_BINARY %nul% || set wpaerror=1 1232reg query "HKLM\SYSTEM\WPA\8DEC0AF1-0341-4b93-85CD-72606C2DF94C-7P-%%#" /ve /t REG_BINARY %nul% || set wpaerror=1
1092) 1233)
@@ -1108,8 +1249,8 @@ if !errorlevel!==2 set permerror=1
1108if defined permerror call :dk_color %Red% "Checking SPP Permissions [Error Found]" 1249if defined permerror call :dk_color %Red% "Checking SPP Permissions [Error Found]"
1109 1250
1110set showfix=1 1251set showfix=1
1111call :dk_color %Magenta% "In MAS, Goto Troubleshoot and run Fix Licensing option." 1252call :dk_color %Blue% "%_fixmsg%"
1112if not defined permerror call :dk_color %Magenta% "If activation still fails then run Fix WPA Registry option." 1253if not defined permerror call :dk_color %Blue% "If activation still fails then run Fix WPA Registry option."
1113) 1254)
1114 1255
1115exit /b 1256exit /b
@@ -1141,7 +1282,7 @@ exit /b
1141echo: 1282echo:
1142if %_unattended%==1 timeout /t 2 & exit /b 1283if %_unattended%==1 timeout /t 2 & exit /b
1143call :dk_color %_Yellow% "Press any key to %_exitmsg%..." 1284call :dk_color %_Yellow% "Press any key to %_exitmsg%..."
1144pause >nul 1285pause %nul1%
1145exit /b 1286exit /b
1146 1287
1147::======================================================================================================================================== 1288::========================================================================================================================================
@@ -1178,10 +1319,10 @@ cd918a57-a41b-4c82-8dce-1a538e221a83_7HN%f%RX-D7%f%KGG-3K4%f%RQ-4W%f%PJ4-YT%f%DF
117843d9af6e-5e86-4be8-a797-d072a046896c_K9F%f%YF-G6%f%NCK-73M%f%32-XM%f%VPY-F9%f%DRR_120_ServerARM64_RS4 131943d9af6e-5e86-4be8-a797-d072a046896c_K9F%f%YF-G6%f%NCK-73M%f%32-XM%f%VPY-F9%f%DRR_120_ServerARM64_RS4
1179e0c42288-980c-4788-a014-c080d2e1926e_NW6%f%C2-QM%f%PVW-D7K%f%KK-3G%f%KT6-VC%f%FB2_121_Education 1320e0c42288-980c-4788-a014-c080d2e1926e_NW6%f%C2-QM%f%PVW-D7K%f%KK-3G%f%KT6-VC%f%FB2_121_Education
11803c102355-d027-42c6-ad23-2e7ef8a02585_2WH%f%4N-8Q%f%GBV-H22%f%JP-CT%f%43Q-MD%f%WWJ_122_EducationN 13213c102355-d027-42c6-ad23-2e7ef8a02585_2WH%f%4N-8Q%f%GBV-H22%f%JP-CT%f%43Q-MD%f%WWJ_122_EducationN
118132d2fab3-e4a8-42c2-923b-4bf4fd13e6ee_M7X%f%TQ-FN%f%8P6-TTK%f%YV-9D%f%4CC-J4%f%62D_125_EnterpriseS_RS5,VB 132232d2fab3-e4a8-42c2-923b-4bf4fd13e6ee_M7X%f%TQ-FN%f%8P6-TTK%f%YV-9D%f%4CC-J4%f%62D_125_EnterpriseS_RS5,VB,Ge
11822d5a5a60-3040-48bf-beb0-fcd770c20ce0_DCP%f%HK-NF%f%MTC-H88%f%MJ-PF%f%HPY-QJ%f%4BJ_125_EnterpriseS_RS1 13232d5a5a60-3040-48bf-beb0-fcd770c20ce0_DCP%f%HK-NF%f%MTC-H88%f%MJ-PF%f%HPY-QJ%f%4BJ_125_EnterpriseS_RS1
11837b51a46c-0c04-4e8f-9af4-8496cca90d5e_WNM%f%TR-4C%f%88C-JK8%f%YV-HQ%f%7T2-76%f%DF9_125_EnterpriseS_TH1 13247b51a46c-0c04-4e8f-9af4-8496cca90d5e_WNM%f%TR-4C%f%88C-JK8%f%YV-HQ%f%7T2-76%f%DF9_125_EnterpriseS_TH1
11847103a333-b8c8-49cc-93ce-d37c09687f92_92N%f%FX-8D%f%JQP-P6B%f%BQ-TH%f%F9C-7C%f%G2H_126_EnterpriseSN_RS5,VB 13257103a333-b8c8-49cc-93ce-d37c09687f92_92N%f%FX-8D%f%JQP-P6B%f%BQ-TH%f%F9C-7C%f%G2H_126_EnterpriseSN_RS5,VB,Ge
11859f776d83-7156-45b2-8a5c-359b9c9f22a3_QFF%f%DN-GR%f%T3P-VKW%f%WX-X7%f%T3R-8B%f%639_126_EnterpriseSN_RS1 13269f776d83-7156-45b2-8a5c-359b9c9f22a3_QFF%f%DN-GR%f%T3P-VKW%f%WX-X7%f%T3R-8B%f%639_126_EnterpriseSN_RS1
118687b838b7-41b6-4590-8318-5797951d8529_2F7%f%7B-TN%f%FGY-69Q%f%QF-B8%f%YKP-D6%f%9TJ_126_EnterpriseSN_TH1 132787b838b7-41b6-4590-8318-5797951d8529_2F7%f%7B-TN%f%FGY-69Q%f%QF-B8%f%YKP-D6%f%9TJ_126_EnterpriseSN_TH1
118739e69c41-42b4-4a0a-abad-8e3c10a797cc_QFN%f%D9-D3%f%Y9C-J3K%f%KY-6R%f%PVP-2D%f%PYV_145_ServerDatacenterACor_FE 132839e69c41-42b4-4a0a-abad-8e3c10a797cc_QFN%f%D9-D3%f%Y9C-J3K%f%KY-6R%f%PVP-2D%f%PYV_145_ServerDatacenterACor_FE
@@ -1202,13 +1343,13 @@ e38454fb-41a4-4f59-a5dc-25080e354730_44R%f%PN-FT%f%Y23-9VT%f%TB-MP%f%9BX-T8%f%4F
1202ec868e65-fadf-4759-b23e-93fe37f2cc29_CPW%f%HC-NT%f%2C7-VYW%f%78-DH%f%DB2-PG%f%3GK_175_ServerRdsh_RS5 1343ec868e65-fadf-4759-b23e-93fe37f2cc29_CPW%f%HC-NT%f%2C7-VYW%f%78-DH%f%DB2-PG%f%3GK_175_ServerRdsh_RS5
1203e4db50ea-bda1-4566-b047-0ca50abc6f07_7NB%f%T4-WG%f%BQX-MP4%f%H7-QX%f%FF8-YP%f%3KX_175_ServerRdsh_RS3 1344e4db50ea-bda1-4566-b047-0ca50abc6f07_7NB%f%T4-WG%f%BQX-MP4%f%H7-QX%f%FF8-YP%f%3KX_175_ServerRdsh_RS3
12040df4f814-3f57-4b8b-9a9d-fddadcd69fac_NBT%f%WJ-3D%f%R69-3C4%f%V8-C2%f%6MC-GQ%f%9M6_183_CloudE 13450df4f814-3f57-4b8b-9a9d-fddadcd69fac_NBT%f%WJ-3D%f%R69-3C4%f%V8-C2%f%6MC-GQ%f%9M6_183_CloudE
120559eb965c-9150-42b7-a0ec-22151b9897c5_KBN%f%8V-HF%f%GQ4-MGX%f%VD-34%f%7P6-PD%f%QGT_191_IoTEnterpriseS_NI 134659eb965c-9150-42b7-a0ec-22151b9897c5_KBN%f%8V-HF%f%GQ4-MGX%f%VD-34%f%7P6-PD%f%QGT_191_IoTEnterpriseS_VB,NI
1206d30136fc-cb4b-416e-a23d-87207abc44a9_6XN%f%7V-PC%f%BDC-BDB%f%RH-8D%f%QY7-G6%f%R44_202_CloudEditionN 1347d30136fc-cb4b-416e-a23d-87207abc44a9_6XN%f%7V-PC%f%BDC-BDB%f%RH-8D%f%QY7-G6%f%R44_202_CloudEditionN
1207ca7df2e3-5ea0-47b8-9ac1-b1be4d8edd69_37D%f%7F-N4%f%9CB-WQR%f%8W-TB%f%J73-FM%f%8RX_203_CloudEdition 1348ca7df2e3-5ea0-47b8-9ac1-b1be4d8edd69_37D%f%7F-N4%f%9CB-WQR%f%8W-TB%f%J73-FM%f%8RX_203_CloudEdition
120819b5e0fb-4431-46bc-bac1-2f1873e4ae73_NTB%f%V8-9K%f%7Q8-V27%f%C6-M2%f%BTV-KH%f%MXV_407_ServerTurbine 134919b5e0fb-4431-46bc-bac1-2f1873e4ae73_NTB%f%V8-9K%f%7Q8-V27%f%C6-M2%f%BTV-KH%f%MXV_407_ServerTurbine
1209) do ( 1350) do (
1210for /f "tokens=1-5 delims=_" %%A in ("%%#") do if %osSKU%==%%C ( 1351for /f "tokens=1-5 delims=_" %%A in ("%%#") do if %osSKU%==%%C (
1211if %1==getkey if not defined key echo "!applist!" | find /i "%%A" >nul && set key=%%B 1352if %1==getkey if not defined key echo "!applist!" | find /i "%%A" %nul1% && set key=%%B
1212) 1353)
1213) 1354)
1214exit /b 1355exit /b
@@ -1216,7 +1357,6 @@ exit /b
1216::======================================================================================================================================== 1357::========================================================================================================================================
1217 1358
1218:: Below code is used to get alternate edition name and key if current edition doesn't support KMS38 activation 1359:: Below code is used to get alternate edition name and key if current edition doesn't support KMS38 activation
1219:: ProfessionalCountrySpecific won't be converted because it's not a good idea to change CountrySpecific editions
1220 1360
1221:: 1st column = Current SKU ID 1361:: 1st column = Current SKU ID
1222:: 2nd column = Current Edition Name 1362:: 2nd column = Current Edition Name
@@ -1233,16 +1373,17 @@ set notfoundaltactID=
1233if %_NoEditionChange%==1 exit /b 1373if %_NoEditionChange%==1 exit /b
1234 1374
1235for %%# in ( 1375for %%# in (
1236188_IoTEnterprise_______________8ab9bdd1-1f67-4997-82d9-8878520837d9_73111121-5638-40f6-bc11-f1d7b0d64300_NPP%f%R9-FWD%f%CX-D2%f%C8J-H872%f%K-2Y%f%T43_Enterprise 1376188_IoTEnterprise__________________8ab9bdd1-1f67-4997-82d9-8878520837d9_73111121-5638-40f6-bc11-f1d7b0d64300_NPP%f%R9-FWD%f%CX-D2%f%C8J-H872%f%K-2Y%f%T43_Enterprise
1237191_IoTEnterpriseS-2021_________ed655016-a9e8-4434-95d9-4345352c2552_32d2fab3-e4a8-42c2-923b-4bf4fd13e6ee_M7X%f%TQ-FN8%f%P6-TT%f%KYV-9D4C%f%C-J4%f%62D_EnterpriseS-2021 1377191_IoTEnterpriseS-2021____________ed655016-a9e8-4434-95d9-4345352c2552_32d2fab3-e4a8-42c2-923b-4bf4fd13e6ee_M7X%f%TQ-FN8%f%P6-TT%f%KYV-9D4C%f%C-J4%f%62D_EnterpriseS-2021
1238205_IoTEnterpriseSK_____________d4f9b41f-205c-405e-8e08-3d16e88e02be_59eb965c-9150-42b7-a0ec-22151b9897c5_KBN%f%8V-HFG%f%Q4-MG%f%XVD-347P%f%6-PD%f%QGT_IoTEnterpriseS-Win11 1378205_IoTEnterpriseSK________________d4f9b41f-205c-405e-8e08-3d16e88e02be_59eb965c-9150-42b7-a0ec-22151b9897c5_KBN%f%8V-HFG%f%Q4-MG%f%XVD-347P%f%6-PD%f%QGT_IoTEnterpriseS
1239138_ProfessionalSingleLanguage__a48938aa-62fa-4966-9d44-9f04da3f72f2_2de67392-b7a7-462a-b1ca-108dd189f588_W26%f%9N-WFG%f%WX-YV%f%C9B-4J6C%f%9-T8%f%3GX_Professional 1379138_ProfessionalSingleLanguage_____a48938aa-62fa-4966-9d44-9f04da3f72f2_2de67392-b7a7-462a-b1ca-108dd189f588_W26%f%9N-WFG%f%WX-YV%f%C9B-4J6C%f%9-T8%f%3GX_Professional
1380139_ProfessionalCountrySpecific____f7af7d09-40e4-419c-a49b-eae366689ebd_2de67392-b7a7-462a-b1ca-108dd189f588_W26%f%9N-WFG%f%WX-YV%f%C9B-4J6C%f%9-T8%f%3GX_Professional
1381139_ProfessionalCountrySpecific-Zn_01eb852c-424d-4060-94b8-c10d799d7364_2de67392-b7a7-462a-b1ca-108dd189f588_W26%f%9N-WFG%f%WX-YV%f%C9B-4J6C%f%9-T8%f%3GX_Professional
1240) do ( 1382) do (
1241for /f "tokens=1-6 delims=_" %%A in ("%%#") do if %osSKU%==%%A ( 1383for /f "tokens=1-6 delims=_" %%A in ("%%#") do if %osSKU%==%%A (
1242echo "!applist!" | find /i "%%C" 1>nul && ( 1384echo "!applist!" | find /i "%%C" %nul1% && (
1243echo "!applist!" | find /i "%%D" 1>nul && ( 1385echo "!applist!" | find /i "%%D" %nul1% && (
1244set altkey=%%E 1386set altkey=%%E
1245set curedition=%%B
1246set altedition=%%F 1387set altedition=%%F
1247) || ( 1388) || (
1248set altedition=%%F 1389set altedition=%%F
@@ -1253,4 +1394,5 @@ set notfoundaltactID=1
1253) 1394)
1254exit /b 1395exit /b
1255 1396
1256::======================================================================================================================================== \ No newline at end of file 1397::========================================================================================================================================
1398:: Leave empty line below
diff --git a/MAS/Separate-Files-Version/Activators/Ohook_Activation/BIN/Info.html b/MAS/Separate-Files-Version/Activators/Ohook_Activation/BIN/Info.html
new file mode 100644
index 0000000..9e6dcaf
--- /dev/null
+++ b/MAS/Separate-Files-Version/Activators/Ohook_Activation/BIN/Info.html
@@ -0,0 +1,3 @@
1<html>
2<meta http-equiv="refresh" content="0; url=https://massgrave.dev/ohook.html#Custom_sppcdll_Info">
3</html> \ No newline at end of file
diff --git a/MAS/Separate-Files-Version/Activators/Ohook_Activation/BIN/sppc32.dll b/MAS/Separate-Files-Version/Activators/Ohook_Activation/BIN/sppc32.dll
new file mode 100644
index 0000000..42dc642
--- /dev/null
+++ b/MAS/Separate-Files-Version/Activators/Ohook_Activation/BIN/sppc32.dll
Binary files differ
diff --git a/MAS/Separate-Files-Version/Activators/Ohook_Activation/BIN/sppc64.dll b/MAS/Separate-Files-Version/Activators/Ohook_Activation/BIN/sppc64.dll
new file mode 100644
index 0000000..03dfff6
--- /dev/null
+++ b/MAS/Separate-Files-Version/Activators/Ohook_Activation/BIN/sppc64.dll
Binary files differ
diff --git a/MAS/Separate-Files-Version/Activators/Ohook_Activation/Ohook_Activation.cmd b/MAS/Separate-Files-Version/Activators/Ohook_Activation/Ohook_Activation.cmd
new file mode 100644
index 0000000..d2e82ff
--- /dev/null
+++ b/MAS/Separate-Files-Version/Activators/Ohook_Activation/Ohook_Activation.cmd
@@ -0,0 +1,1536 @@
1@setlocal DisableDelayedExpansion
2@echo off
3
4
5
6::============================================================================
7::
8:: This script is a part of 'Microsoft_Activation_Scripts' (MAS) project.
9::
10:: Homepage: mass grave[.]dev
11:: Email: windowsaddict@protonmail.com
12::
13::============================================================================
14
15
16
17:: To activate Office with Ohook activation, run the script with "/Ohook" parameter or change 0 to 1 in below line
18set _act=0
19
20:: To remove Ohook activation, run the script with /Ohook-Uninstall parameter or change 0 to 1 in below line
21set _rem=0
22
23:: If value is changed in above lines or parameter is used then script will run in unattended mode
24
25
26
27::========================================================================================================================================
28
29:: Set Path variable, it helps if it is misconfigured in the system
30
31set "PATH=%SystemRoot%\System32;%SystemRoot%\System32\wbem;%SystemRoot%\System32\WindowsPowerShell\v1.0\"
32if exist "%SystemRoot%\Sysnative\reg.exe" (
33set "PATH=%SystemRoot%\Sysnative;%SystemRoot%\Sysnative\wbem;%SystemRoot%\Sysnative\WindowsPowerShell\v1.0\;%PATH%"
34)
35
36:: Re-launch the script with x64 process if it was initiated by x86 process on x64 bit Windows
37:: or with ARM64 process if it was initiated by x86/ARM32 process on ARM64 Windows
38
39set "_cmdf=%~f0"
40for %%# in (%*) do (
41if /i "%%#"=="r1" set r1=1
42if /i "%%#"=="r2" set r2=1
43if /i "%%#"=="-qedit" (
44reg add HKCU\Console /v QuickEdit /t REG_DWORD /d "1" /f 1>nul
45rem check the code below admin elevation to understand why it's here
46)
47)
48
49if exist %SystemRoot%\Sysnative\cmd.exe if not defined r1 (
50setlocal EnableDelayedExpansion
51start %SystemRoot%\Sysnative\cmd.exe /c ""!_cmdf!" %* r1"
52exit /b
53)
54
55:: Re-launch the script with ARM32 process if it was initiated by x64 process on ARM64 Windows
56
57if exist %SystemRoot%\SysArm32\cmd.exe if %PROCESSOR_ARCHITECTURE%==AMD64 if not defined r2 (
58setlocal EnableDelayedExpansion
59start %SystemRoot%\SysArm32\cmd.exe /c ""!_cmdf!" %* r2"
60exit /b
61)
62
63::========================================================================================================================================
64
65set "blank="
66set "mas=mass%blank%grave.dev"
67
68:: Check if Null service is working, it's important for the batch script
69
70sc query Null | find /i "RUNNING"
71if %errorlevel% NEQ 0 (
72echo:
73echo Null service is not running, script may crash...
74echo:
75echo:
76echo Help - https://%mas%/troubleshoot.html
77echo:
78echo:
79ping 127.0.0.1 -n 10
80)
81cls
82
83:: Check LF line ending
84
85pushd "%~dp0"
86>nul findstr /v "$" "%~nx0" && (
87echo:
88echo Error: Script either has LF line ending issue or an empty line at the end of the script is missing.
89echo:
90ping 127.0.0.1 -n 6 >nul
91popd
92exit /b
93)
94popd
95
96::========================================================================================================================================
97
98cls
99color 07
100title Ohook Activation
101
102set _args=
103set _elev=
104set _unattended=0
105
106set _args=%*
107if defined _args set _args=%_args:"=%
108if defined _args (
109for %%A in (%_args%) do (
110if /i "%%A"=="/Ohook" set _act=1
111if /i "%%A"=="/Ohook-Uninstall" set _rem=1
112if /i "%%A"=="-el" set _elev=1
113)
114)
115
116for %%A in (%_act% %_rem%) do (if "%%A"=="1" set _unattended=1)
117
118::========================================================================================================================================
119
120set "nul1=1>nul"
121set "nul2=2>nul"
122set "nul6=2^>nul"
123set "nul=>nul 2>&1"
124
125set psc=powershell.exe
126set winbuild=1
127for /f "tokens=6 delims=[]. " %%G in ('ver') do set winbuild=%%G
128
129set _NCS=1
130if %winbuild% LSS 10586 set _NCS=0
131if %winbuild% GEQ 10586 reg query "HKCU\Console" /v ForceV2 %nul2% | find /i "0x0" %nul1% && (set _NCS=0)
132
133if %_NCS% EQU 1 (
134for /F %%a in ('echo prompt $E ^| cmd') do set "esc=%%a"
135set "Red="41;97m""
136set "Gray="100;97m""
137set "Green="42;97m""
138set "Blue="44;97m""
139set "_White="40;37m""
140set "_Green="40;92m""
141set "_Yellow="40;93m""
142) else (
143set "Red="Red" "white""
144set "Gray="Darkgray" "white""
145set "Green="DarkGreen" "white""
146set "Blue="Blue" "white""
147set "_White="Black" "Gray""
148set "_Green="Black" "Green""
149set "_Yellow="Black" "Yellow""
150)
151
152set "nceline=echo: &echo ==== ERROR ==== &echo:"
153set "eline=echo: &call :dk_color %Red% "==== ERROR ====" &echo:"
154if %~z0 GEQ 200000 (
155set "_exitmsg=Go back"
156set "_fixmsg=Go back to Main Menu, select Troubleshoot and run Fix Licensing option."
157) else (
158set "_exitmsg=Exit"
159set "_fixmsg=In MAS folder, run Troubleshoot script and select Fix Licensing option."
160)
161
162::========================================================================================================================================
163
164if %winbuild% LSS 9200 (
165%eline%
166echo Unsupported OS version detected [%winbuild%].
167echo Ohook Activation is supported on Windows 8 and later and their server equivalent.
168goto dk_done
169)
170
171for %%# in (powershell.exe) do @if "%%~$PATH:#"=="" (
172%nceline%
173echo Unable to find powershell.exe in the system.
174goto dk_done
175)
176
177::========================================================================================================================================
178
179:: Fix for the special characters limitation in path name
180
181set "_work=%~dp0"
182if "%_work:~-1%"=="\" set "_work=%_work:~0,-1%"
183
184set "_batf=%~f0"
185set "_batp=%_batf:'=''%"
186
187set _PSarg="""%~f0""" -el %_args%
188
189set "_ttemp=%temp%"
190
191setlocal EnableDelayedExpansion
192
193::========================================================================================================================================
194
195echo "!_batf!" | find /i "!_ttemp!" %nul1% && (
196if /i not "!_work!"=="!_ttemp!" (
197%eline%
198echo Script is launched from the temp folder,
199echo Most likely you are running the script directly from the archive file.
200echo:
201echo Extract the archive file and launch the script from the extracted folder.
202goto dk_done
203)
204)
205
206::========================================================================================================================================
207
208:: Elevate script as admin and pass arguments and preventing loop
209
210%nul1% fltmc || (
211if not defined _elev %psc% "start cmd.exe -arg '/c \"!_PSarg:'=''!\"' -verb runas" && exit /b
212%eline%
213echo This script require admin privileges.
214echo To do so, right click on this script and select 'Run as administrator'.
215goto dk_done
216)
217
218::========================================================================================================================================
219
220:: This code disables QuickEdit for this cmd.exe session only without making permanent changes to the registry
221:: It is added because clicking on the script window pauses the operation and leads to the confusion that script stopped due to an error
222
223if %_unattended%==1 set quedit=1
224for %%# in (%_args%) do (if /i "%%#"=="-qedit" set quedit=1)
225
226reg query HKCU\Console /v QuickEdit %nul2% | find /i "0x0" %nul1% || if not defined quedit (
227reg add HKCU\Console /v QuickEdit /t REG_DWORD /d "0" /f %nul1%
228start cmd.exe /c ""!_batf!" %_args% -qedit"
229rem quickedit reset code is added at the starting of the script instead of here because it takes time to reflect in some cases
230exit /b
231)
232
233::========================================================================================================================================
234
235if %_rem%==1 goto :oh_uninstall
236
237:oh_menu
238
239if %_unattended%==0 (
240cls
241mode 76, 25
242title Ohook Activation
243
244echo:
245echo:
246echo:
247echo:
248echo ____________________________________________________________
249echo:
250echo [1] Install Ohook Office Activation
251echo:
252echo [2] Uninstall
253echo ____________________________________________
254echo:
255echo [3] Download Office
256echo:
257echo [0] %_exitmsg%
258echo ____________________________________________________________
259echo:
260call :dk_color2 %_White% " " %_Green% "Enter a menu option in the Keyboard [1,2,3,0]"
261choice /C:1230 /N
262set _el=!errorlevel!
263if !_el!==4 exit /b
264if !_el!==3 start https://%mas%/genuine-installation-media.html &goto :oh_menu
265if !_el!==2 goto :oh_uninstall
266if !_el!==1 goto :oh_menu2
267goto :oh_menu
268)
269
270::========================================================================================================================================
271
272:oh_menu2
273
274cls
275mode 128, 32
276%psc% "&{$W=$Host.UI.RawUI.WindowSize;$B=$Host.UI.RawUI.BufferSize;$W.Height=32;$B.Height=300;$Host.UI.RawUI.WindowSize=$W;$Host.UI.RawUI.BufferSize=$B;}"
277
278title Ohook Activation
279
280:: Check files
281
282for %%# in (sppc32.dll sppc64.dll) do (
283if not exist "!_work!\BIN\%%#" (
284%eline%
285echo '%%#' file is missing in 'BIN' folder. Aborting...
286goto dk_done
287)
288)
289
290echo:
291echo Initializing...
292call :dk_product
293call :dk_ckeckwmic
294
295:: Show info for potential script stuck scenario
296
297sc start sppsvc %nul%
298if %errorlevel% NEQ 1056 if %errorlevel% NEQ 0 (
299echo:
300echo Error code: %errorlevel%
301call :dk_color %Red% "Failed to start [sppsvc] service, rest of the process may take a long time..."
302echo:
303)
304
305::========================================================================================================================================
306
307set error=
308
309cls
310echo:
311for /f "skip=2 tokens=2*" %%a in ('reg query "HKLM\SYSTEM\CurrentControlSet\Control\Session Manager\Environment" /v PROCESSOR_ARCHITECTURE') do set osarch=%%b
312for /f "tokens=6-7 delims=[]. " %%i in ('ver') do if "%%j"=="" (set fullbuild=%%i) else (set fullbuild=%%i.%%j)
313echo Checking OS Info [%winos% ^| %fullbuild% ^| %osarch%]
314
315::========================================================================================================================================
316
317:: Check Windows Script Host
318
319set _WSH=1
320reg query "HKCU\SOFTWARE\Microsoft\Windows Script Host\Settings" /v Enabled %nul2% | find /i "0x0" %nul1% && (set _WSH=0)
321reg query "HKLM\SOFTWARE\Microsoft\Windows Script Host\Settings" /v Enabled %nul2% | find /i "0x0" %nul1% && (set _WSH=0)
322
323if %_WSH% EQU 0 (
324reg add "HKLM\Software\Microsoft\Windows Script Host\Settings" /v Enabled /t REG_DWORD /d 1 /f %nul%
325reg add "HKCU\Software\Microsoft\Windows Script Host\Settings" /v Enabled /t REG_DWORD /d 1 /f %nul%
326if not "%arch%"=="x86" reg add "HKLM\Software\Microsoft\Windows Script Host\Settings" /v Enabled /t REG_DWORD /d 1 /f /reg:32 %nul%
327echo Enabling Windows Script Host [Successful]
328)
329
330::========================================================================================================================================
331
332echo Initiating Diagnostic Tests...
333
334set "_serv=sppsvc Winmgmt"
335set officeact=1
336call :dk_errorcheck
337
338:: Check unsupported office versions
339
340set o14msi=
341set o14c2r=
342set o16uwp=
343
344set _68=HKLM\SOFTWARE\Microsoft\Office
345set _86=HKLM\SOFTWARE\Wow6432Node\Microsoft\Office
346%nul% reg query %_68%\14.0\Common\InstallRoot /v Path && set o14msi=Office 2010 MSI
347%nul% reg query %_86%\14.0\Common\InstallRoot /v Path && set o14msi=Office 2010 MSI
348%nul% reg query %_68%\14.0\CVH /f Click2run /k && set o14c2r=Office 2010 C2R
349%nul% reg query %_86%\14.0\CVH /f Click2run /k && set o14c2r=Office 2010 C2R
350
351if %winbuild% GEQ 10240 %psc% "Get-AppxPackage -name "Microsoft.Office.Desktop"" | find /i "Office" %nul1% && set o16uwp=Office UWP
352
353if not "%o14msi%%o14c2r%%o16uwp%"=="" (
354echo:
355set error=1
356call :dk_color %Red% "Checking Unsupported Office Install [ %o14msi%%o14c2r%%o16uwp%]"
357)
358
359::========================================================================================================================================
360
361:: Check supported office versions
362
363call :oh_getpath
364
365sc query ClickToRunSvc %nul%
366set error1=%errorlevel%
367
368if defined o16c2r if %error1% EQU 1060 (
369call :dk_color %Red% "Checking ClickToRun Service [Not found, Office 16.0 files found]"
370set o16c2r=
371set error=1
372)
373
374sc query OfficeSvc %nul%
375set error2=%errorlevel%
376
377if defined o15c2r if %error1% EQU 1060 if %error2% EQU 1060 (
378call :dk_color %Red% "Checking ClickToRun Service [Not found, Office 15.0 files found]"
379set o15c2r=
380set error=1
381)
382
383if "%o16c2r%%o15c2r%%o16msi%%o15msi%"=="" (
384set error=1
385echo:
386if not "%o14msi%%o14c2r%%o16uwp%"=="" (
387call :dk_color %Red% "Checking Supported Office Install [Not Found]"
388) else (
389call :dk_color %Red% "Checking Installed Office [Not Found]"
390)
391
392if %winbuild% GEQ 10240 %psc% "Get-AppxPackage -name "Microsoft.MicrosoftOfficeHub"" | find /i "Office" %nul1% && (
393echo:
394echo You have only Office dashboard app installed, you need to install full Office version.
395)
396echo:
397call :dk_color %Blue% "Download and install Office from below URL and try again."
398echo:
399echo https://%mas%/genuine-installation-media.html
400goto dk_done
401)
402
403set multioffice=
404if not "%o16c2r%%o15c2r%%o16msi%%o15msi%"=="1" set multioffice=1
405if not "%o14msi%%o14c2r%%o16uwp%"=="" set multioffice=1
406
407if defined multioffice (
408call :dk_color %Gray% "Checking Multiple Office Install [Found. Its best to install only one version]"
409)
410
411::========================================================================================================================================
412
413:: Process Office 15.0 C2R
414
415if not defined o15c2r goto :starto16c2r
416
417call :oh_reset
418call :oh_actids
419
420set oVer=15
421for /f "skip=2 tokens=2*" %%a in ('"reg query %o15c2r_reg% /v InstallPath" %nul6%') do (set "_oRoot=%%b\root")
422for /f "skip=2 tokens=2*" %%a in ('"reg query %o15c2r_reg%\Configuration /v Platform" %nul6%') do (set "_oArch=%%b")
423if not defined _oArch for /f "skip=2 tokens=2*" %%a in ('"reg query %o15c2r_reg%\propertyBag /v Platform" %nul6%') do (set "_oArch=%%b")
424
425echo "%o15c2r_reg%" | find /i "Wow6432Node" %nul1% && (set _tok=10) || (set _tok=9)
426for /f "tokens=%_tok% delims=\" %%a in ('reg query %o15c2r_reg%\ProductReleaseIDs\Active %nul6% ^| findstr /i "Retail Volume"') do (
427if not defined _oIds (set "_oIds=%%a") else (set "_oIds=!_oIds! %%a")
428)
429
430set "_oLPath=%_oRoot%\Licenses"
431
432if [%_oArch%]==[x64] (set "_hookPath=%_oRoot%\vfs\System" & set "_hook=sppc64.dll")
433if [%_oArch%]==[x86] (set "_hookPath=%_oRoot%\vfs\SystemX86" & set "_hook=sppc32.dll")
434if not [%osarch%]==[x86] (
435if [%_oArch%]==[x64] set "_sppcPath=%SystemRoot%\System32\sppc.dll"
436if [%_oArch%]==[x86] set "_sppcPath=%SystemRoot%\SysWOW64\sppc.dll"
437) else (
438set "_sppcPath=%SystemRoot%\System32\sppc.dll"
439)
440
441echo:
442echo Activating Office 15.0 %_oArch% C2R...
443
444if not defined _oIds (
445call :dk_color %Red% "Checking Installed Products [Product IDs not found. Aborting activation...]"
446set error=1
447goto :starto16c2r
448)
449
450call :oh_process
451call :oh_hookinstall
452
453::========================================================================================================================================
454
455:starto16c2r
456
457:: Process Office 16.0 C2R
458
459if not defined o16c2r goto :startmsi
460
461call :oh_reset
462call :oh_actids
463
464set oVer=16
465for /f "skip=2 tokens=2*" %%a in ('"reg query %o16c2r_reg% /v InstallPath" %nul6%') do (set "_oRoot=%%b\root")
466for /f "skip=2 tokens=2*" %%a in ('"reg query %o16c2r_reg%\Configuration /v Platform" %nul6%') do (set "_oArch=%%b")
467
468echo "%o16c2r_reg%" | find /i "Wow6432Node" %nul1% && (set _tok=9) || (set _tok=8)
469for /f "tokens=%_tok% delims=\" %%a in ('reg query "%o16c2r_reg%\ProductReleaseIDs" /s /f ".16" /k %nul6% ^| findstr /i "Retail Volume"') do (
470if not defined _oIds (set "_oIds=%%a") else (set "_oIds=!_oIds! %%a")
471)
472set _oIds=%_oIds:.16=%
473
474set "_oLPath=%_oRoot%\Licenses16"
475
476if [%_oArch%]==[x64] (set "_hookPath=%_oRoot%\vfs\System" & set "_hook=sppc64.dll")
477if [%_oArch%]==[x86] (set "_hookPath=%_oRoot%\vfs\SystemX86" & set "_hook=sppc32.dll")
478if not [%osarch%]==[x86] (
479if [%_oArch%]==[x64] set "_sppcPath=%SystemRoot%\System32\sppc.dll"
480if [%_oArch%]==[x86] set "_sppcPath=%SystemRoot%\SysWOW64\sppc.dll"
481) else (
482set "_sppcPath=%SystemRoot%\System32\sppc.dll"
483)
484
485echo:
486echo Activating Office 16.0 %_oArch% C2R...
487
488if not defined _oIds (
489call :dk_color %Red% "Checking Installed Products [Product IDs not found. Aborting activation...]"
490set error=1
491goto :startmsi
492)
493
494call :oh_process
495call :oh_hookinstall
496
497::========================================================================================================================================
498
499:: Find remnants of Office vNext license block and remove it because it stops non vNext licenses from appearing
500
501set sub_next=
502set kNext=HKCU\SOFTWARE\Microsoft\Office\16.0\Common\Licensing
503
504reg query %kNext%\LicensingNext /v MigrationToV5Done %nul2% | find /i "0x1" %nul% && (
505reg query %kNext%\LicensingNext %nul2% | findstr /i "volume retail" %nul2% | findstr /i "0x2 0x3" %nul% && (
506set sub_next=1
507reg delete %kNext% /f %nul%
508)
509)
510
511if defined sub_next (
512reg query %kNext%\LicensingNext %nul% && (
513call :dk_color %Red% "Removing Office vNext Block [Failed]"
514) || (
515echo Removing Office vNext Block [Successful]
516)
517)
518
519::========================================================================================================================================
520
521:: O365 products attempt to validate the license and may show a banner "There was a problem checking this device's license status.", other products don't do that.
522:: A simple registry entry can skip this check
523
524echo "%_lic%" | find /i "Subscription" %nul% && (
525echo Adding a Reg To Skip License Check [Successful]
526reg add HKCU\Software\Microsoft\Office\16.0\Common\Licensing\Resiliency /v "TimeOfLastHeartbeatFailure" /t REG_SZ /d "2033-08-18T22:18:45Z" /f %nul%
527)
528
529::========================================================================================================================================
530
531:: mass grave[.]dev/office-license-is-not-genuine.html
532:: Add registry keys for volume products so that 'non-genuine' banner won't appear
533:: Script already is using MAK instead of GVLK so it won't appear anyway, but registry keys are added incase Office installs default GVLK grace key for volume products
534
535echo "%_oIds%" | find /i "Volume" %nul1% && (
536if %winbuild% GEQ 9200 (
537if not [%osarch%]==[x86] (
538reg delete "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\SoftwareProtectionPlatform\0ff1ce15-a989-479d-af46-f275c6370663" /f /reg:32 %nul%
539reg add "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\SoftwareProtectionPlatform\0ff1ce15-a989-479d-af46-f275c6370663" /f /v KeyManagementServiceName /t REG_SZ /d "10.0.0.10" /reg:32 %nul%
540)
541reg delete "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\SoftwareProtectionPlatform\0ff1ce15-a989-479d-af46-f275c6370663" /f %nul%
542reg add "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\SoftwareProtectionPlatform\0ff1ce15-a989-479d-af46-f275c6370663" /f /v KeyManagementServiceName /t REG_SZ /d "10.0.0.10" %nul%
543echo Adding a Reg To Prevent Banner [Successful]
544)
545)
546
547::========================================================================================================================================
548
549:startmsi
550
551if defined o15msi call :oh_processmsi 15 %o15msi_reg%
552if defined o16msi call :oh_processmsi 16 %o16msi_reg%
553
554::========================================================================================================================================
555
556:: Uninstall other / grace Keys
557
558set upk_result=0
559set allapplist=
560
561if %_wmic% EQU 1 set "chkapp=for /f "tokens=2 delims==" %%a in ('"wmic path SoftwareLicensingProduct where (ApplicationID='0ff1ce15-a989-479d-af46-f275c6370663' and PartialProductKey is not null) get ID /VALUE" %nul6%')"
562if %_wmic% EQU 0 set "chkapp=for /f "tokens=2 delims==" %%a in ('%psc% "(([WMISEARCHER]'SELECT ID FROM SoftwareLicensingProduct WHERE ApplicationID=''0ff1ce15-a989-479d-af46-f275c6370663'' AND PartialProductKey IS NOT NULL').Get()).ID ^| %% {echo ('ID='+$_)}" %nul6%')"
563%chkapp% do (if defined allapplist (call set "allapplist=!allapplist! %%a") else (call set "allapplist=%%a"))
564
565for %%# in (%allapplist%) do (
566echo "%_allactid%" | find /i "%%#" %nul1% || (
567cscript //nologo %windir%\system32\slmgr.vbs /upk %%# %nul% && (
568set upk_result=1
569) || (
570set error=1
571set upk_result=2
572)
573)
574)
575
576if not %upk_result%==0 echo:
577if %upk_result%==1 echo Uninstalling Other/Grace Keys [Successful]
578if %upk_result%==2 call :dk_color %Red% "Uninstalling Other/Grace Keys [Failed]"
579
580::========================================================================================================================================
581
582:: Refresh Windows Insider Preview Licenses
583:: It required in Insider versions otherwise office may not activate
584
585if exist "%windir%\system32\spp\store_test\2.0\tokens.dat" (
586cscript //nologo %windir%\system32\slmgr.vbs /rilc %nul%
587if !errorlevel! NEQ 0 cscript //nologo %windir%\system32\slmgr.vbs /rilc %nul%
588)
589
590::========================================================================================================================================
591
592echo:
593if not defined error (
594call :dk_color %Green% "Office is permanently activated."
595echo Help: https://%mas%/troubleshoot
596) else (
597call :dk_color %Red% "Some errors were detected."
598if not defined ierror if not defined showfix if not defined serv_cor if not defined serv_cste call :dk_color %Blue% "%_fixmsg%"
599echo:
600call :dk_color2 %Blue% "Check this page for help" %_Yellow% " https://%mas%/troubleshoot"
601)
602
603goto :dk_done
604
605::========================================================================================================================================
606
607:oh_uninstall
608
609cls
610mode 99, 28
611title Uninstall Ohook Activation
612
613set _present=
614set _unerror=
615call :oh_reset
616call :oh_getpath
617
618echo:
619echo Uninstalling Ohook Activation...
620echo:
621
622if defined o16c2r_reg (for /f "skip=2 tokens=2*" %%a in ('"reg query %o16c2r_reg% /v InstallPath" %nul6%') do (set "_16CHook=%%b\root\vfs"))
623if defined o15c2r_reg (for /f "skip=2 tokens=2*" %%a in ('"reg query %o15c2r_reg% /v InstallPath" %nul6%') do (set "_15CHook=%%b\root\vfs"))
624if defined o16msi_reg (for /f "skip=2 tokens=2*" %%a in ('"reg query %o16msi_reg%\Common\InstallRoot /v Path" %nul6%') do (set "_16MHook=%%b"))
625if defined o15msi_reg (for /f "skip=2 tokens=2*" %%a in ('"reg query %o15msi_reg%\Common\InstallRoot /v Path" %nul6%') do (set "_15MHook=%%b"))
626
627if defined _16CHook (if exist "%_16CHook%\System\sppc*dll" (set _present=1& del /s /f /q "%_16CHook%\System\sppc*dll" & if exist "%_16CHook%\System\sppc*dll" set _unerror=1))
628if defined _16CHook (if exist "%_16CHook%\SystemX86\sppc*dll" (set _present=1& del /s /f /q "%_16CHook%\SystemX86\sppc*dll" & if exist "%_16CHook%\SystemX86\sppc*dll" set _unerror=1))
629if defined _15CHook (if exist "%_15CHook%\System\sppc*dll" (set _present=1& del /s /f /q "%_15CHook%\System\sppc*dll" & if exist "%_15CHook%\System\sppc*dll" set _unerror=1))
630if defined _15CHook (if exist "%_15CHook%\SystemX86\sppc*dll" (set _present=1& del /s /f /q "%_15CHook%\SystemX86\sppc*dll" & if exist "%_15CHook%\SystemX86\sppc*dll" set _unerror=1))
631if defined _16MHook (if exist "%_16MHook%sppc*dll" (set _present=1& del /s /f /q "%_16MHook%sppc*dll" & if exist "%_16MHook%sppc*dll" set _unerror=1))
632if defined _15MHook (if exist "%_15MHook%sppc*dll" (set _present=1& del /s /f /q "%_15MHook%sppc*dll" & if exist "%_15MHook%sppc*dll" set _unerror=1))
633
634for %%# in (15 16) do (
635for %%A in ("%ProgramFiles%" "%ProgramW6432%" "%ProgramFiles(x86)%") do (
636if exist "%%~A\Microsoft Office\Office%%#\sppc*dll" (set _present=1& del /s /f /q "%%~A\Microsoft Office\Office%%#\sppc*dll" & if exist "%%~A\Microsoft Office\Office%%#\sppc*dll" set _unerror=1)
637)
638)
639
640for %%# in (System SystemX86) do (
641for %%G in ("Office 15" "Office") do (
642for %%A in ("%ProgramFiles%" "%ProgramW6432%" "%ProgramFiles(x86)%") do (
643if exist "%%~A\Microsoft %%~G\root\vfs\%%#\sppc*dll" (set _present=1& del /s /f /q "%%~A\Microsoft %%~G\root\vfs\%%#\sppc*dll" & if exist "%%~A\Microsoft %%~G\root\vfs\%%#\sppc*dll" set _unerror=1)
644)
645)
646)
647
648reg query HKCU\Software\Microsoft\Office\16.0\Common\Licensing\Resiliency /s %nul2% | find /i "2033" %nul% && (
649echo:
650echo Deleting - HKCU\Software\Microsoft\Office\16.0\Common\Licensing\Resiliency
651reg delete HKCU\Software\Microsoft\Office\16.0\Common\Licensing\Resiliency /f
652)
653
654reg query "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\SoftwareProtectionPlatform\0ff1ce15-a989-479d-af46-f275c6370663" %nul% && (
655echo:
656echo Deleting - Registry key to prevent non-genuine banner
657reg delete "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\SoftwareProtectionPlatform\0ff1ce15-a989-479d-af46-f275c6370663" /f
658)
659
660reg query "HKLM\SOFTWARE\Wow6432Node\Microsoft\Windows NT\CurrentVersion\SoftwareProtectionPlatform\0ff1ce15-a989-479d-af46-f275c6370663" %nul% && (
661reg delete "HKLM\SOFTWARE\Wow6432Node\Microsoft\Windows NT\CurrentVersion\SoftwareProtectionPlatform\0ff1ce15-a989-479d-af46-f275c6370663" /f
662)
663
664echo __________________________________________________________________________________________
665echo:
666
667if not defined _present (
668echo Ohook Activation is not installed.
669) else (
670if defined _unerror (
671call :dk_color %Red% "Failed to uninstall Ohook activation."
672call :dk_color %Blue% "Close Office apps if they are running and try again."
673) else (
674call :dk_color %Green% "Successfully uninstalled Ohook activation."
675)
676)
677echo __________________________________________________________________________________________
678
679goto :dk_done
680
681::========================================================================================================================================
682
683:oh_reset
684
685set _oRoot=
686set _oArch=
687set _oIds=
688set _oLPath=
689set _hookPath=
690set _hook=
691set _sppcPath=
692set _key=
693set _actid=
694set _prod=
695set _lic=
696set _License=
697exit /b
698
699::========================================================================================================================================
700
701:oh_getpath
702
703set o16c2r=
704set o15c2r=
705set o16msi=
706set o15msi=
707
708set _68=HKLM\SOFTWARE\Microsoft\Office
709set _86=HKLM\SOFTWARE\Wow6432Node\Microsoft\Office
710
711for /f "skip=2 tokens=2*" %%a in ('"reg query %_86%\ClickToRun /v InstallPath" %nul6%') do if exist "%%b\root\Licenses16\ProPlus*.xrm-ms" (set o16c2r=1&set o16c2r_reg=%_86%\ClickToRun)
712for /f "skip=2 tokens=2*" %%a in ('"reg query %_68%\ClickToRun /v InstallPath" %nul6%') do if exist "%%b\root\Licenses16\ProPlus*.xrm-ms" (set o16c2r=1&set o16c2r_reg=%_68%\ClickToRun)
713for /f "skip=2 tokens=2*" %%a in ('"reg query %_86%\15.0\ClickToRun /v InstallPath" %nul6%') do if exist "%%b\root\Licenses\ProPlus*.xrm-ms" (set o15c2r=1&set o15c2r_reg=%_86%\15.0\ClickToRun)
714for /f "skip=2 tokens=2*" %%a in ('"reg query %_68%\15.0\ClickToRun /v InstallPath" %nul6%') do if exist "%%b\root\Licenses\ProPlus*.xrm-ms" (set o15c2r=1&set o15c2r_reg=%_68%\15.0\ClickToRun)
715
716for /f "skip=2 tokens=2*" %%a in ('"reg query %_86%\16.0\Common\InstallRoot /v Path" %nul6%') do if exist "%%b\OSPP.VBS" (set o16msi=1&set o16msi_reg=%_86%\16.0)
717for /f "skip=2 tokens=2*" %%a in ('"reg query %_68%\16.0\Common\InstallRoot /v Path" %nul6%') do if exist "%%b\OSPP.VBS" (set o16msi=1&set o16msi_reg=%_68%\16.0)
718for /f "skip=2 tokens=2*" %%a in ('"reg query %_86%\15.0\Common\InstallRoot /v Path" %nul6%') do if exist "%%b\OSPP.VBS" (set o15msi=1&set o15msi_reg=%_86%\15.0)
719for /f "skip=2 tokens=2*" %%a in ('"reg query %_68%\15.0\Common\InstallRoot /v Path" %nul6%') do if exist "%%b\OSPP.VBS" (set o15msi=1&set o15msi_reg=%_68%\15.0)
720
721exit /b
722
723::========================================================================================================================================
724
725:oh_installkey
726
727if %_wmic% EQU 1 wmic path SoftwareLicensingService where __CLASS='SoftwareLicensingService' call InstallProductKey ProductKey="%_key%" %nul%
728if %_wmic% EQU 0 %psc% "(([WMISEARCHER]'SELECT Version FROM SoftwareLicensingService').Get()).InstallProductKey('%_key%')" %nul%
729if not %errorlevel%==0 cscript //nologo %windir%\system32\slmgr.vbs /ipk %_key% %nul%
730set errorcode=%errorlevel%
731cmd /c exit /b %errorcode%
732if %errorcode% NEQ 0 set "errorcode=[0x%=ExitCode%]"
733
734if %errorcode% EQU 0 (
735call :dk_refresh
736echo Installing Generic Product Key [%_key%] [%_prod%] [%_lic%] [Successful]
737) else (
738call :dk_color %Red% "Installing Generic Product Key [%_key%] [%_prod%] [%_lic%] [Failed] %errorcode%"
739if not defined error (
740call :dk_color %Blue% "%_fixmsg%"
741set showfix=1
742)
743set error=1
744)
745
746exit /b
747
748::========================================================================================================================================
749
750:oh_installlic
751
752if not defined _oLPath exit /b
753
754set _License=%_prod:Retail=R_%
755set _License=%_License:Volume=VL_%
756
757for %%# in ("!_oLPath!\client-issuance-*.xrm-ms") do (
758cscript //nologo %windir%\system32\slmgr.vbs /ilc "!_oLPath!\%%~nx#" %nul%
759)
760cscript //nologo %windir%\system32\slmgr.vbs /ilc "!_oLPath!\pkeyconfig-office.xrm-ms" %nul%
761
762for %%# in ("!_oLPath!\%_License%*.xrm-ms") do (
763cscript //nologo %windir%\system32\slmgr.vbs /ilc "!_oLPath!\%%~nx#" %nul%
764)
765
766call :oh_actids
767
768echo "!oapplist!" | find /i "!_actid!" %nul1% && (
769call :dk_color %Gray% "Installing Missing License Files [Office %oVer%.0 %_prod%] [Successful]"
770) || (
771set error=1
772call :dk_color %Red% "Installing Missing License Files [Office %oVer%.0 %_prod%] [Failed]"
773)
774
775exit /b
776
777::========================================================================================================================================
778
779:oh_hookinstall
780
781set ierror=
782set hasherror=
783
784del /s /q "%_hookPath%\sppcs.dll" %nul%
785del /s /q "%_hookPath%\sppc.dll" %nul%
786
787if exist "%_hookPath%\sppcs.dll" set ierror=1
788if exist "%_hookPath%\sppc.dll" set ierror=1
789
790mklink "%_hookPath%\sppcs.dll" "%_sppcPath%" %nul%
791if not %errorlevel%==0 set ierror=1
792
793pushd "!_work!\BIN\"
794copy /y %_hook% "%_hookPath%\sppc.dll" %nul%
795popd
796if not exist "%_hookPath%\sppc.dll" set ierror=1
797
798echo:
799if not defined ierror (
800echo Symlinking System's sppc.dll To ["%_hookPath%\sppcs.dll"] [Successful]
801echo Copying Custom %_hook% To ["%_hookPath%\sppc.dll"] [Successful]
802) else (
803set error=1
804call :dk_color %Red% "Symlinking Systems sppc.dll [Failed]"
805call :dk_color %Red% "Copying Custom %_hook% [Failed]"
806echo ["%_hookPath%\sppc.dll"]
807call :dk_color %Blue% "Close Office apps if they are running and try again."
808)
809
810if not defined ierror call :oh_modify "%_hookPath%\sppc.dll"
811
812if not defined ierror (
813if defined hasherror (
814set error=1
815set ierror=1
816call :dk_color %Red% "Modifying Hash of Custom %_hook% [Failed]"
817) else (
818echo Modifying Hash of Custom %_hook% [Successful]
819)
820)
821
822exit /b
823
824::========================================================================================================================================
825
826:oh_process
827
828for %%# in (%_oIds%) do (
829set _key=
830set _actid=
831set _lic=
832set _prod=%%#
833
834call :ohookdata getinfo %%#
835
836if not [!_key!]==[] (
837echo "!oapplist!" | find /i "!_actid!" %nul1% || call :oh_installlic
838call :oh_installkey
839) else (
840set error=1
841call :dk_color %Red% "Checking Product In Script [Office %oVer%.0 %%# not found in script]"
842echo Make sure you are using Latest MAS script.
843)
844)
845
846exit /b
847
848::========================================================================================================================================
849
850:oh_msiproducts
851
852set msitemp=%SystemRoot%\Temp\_msitemp.txt
853
854if %oVer%==15 set _psmsikey=%o15msi_reg:HKLM\=HKLM:%
855if %oVer%==16 set _psmsikey=%o16msi_reg:HKLM\=HKLM:%
856
857if exist %msitemp% del /f /q %msitemp%
858%psc% "$Key = '%_psmsikey%\Registration\{*FF1CE}'; $keydata = Get-ItemProperty -Path $Key -Name "DigitalProductID"; $binaryData = $keydata."DigitalProductID"; $stringData = [System.Text.Encoding]::Unicode.GetString($binaryData);$stringData" >>%msitemp%
859
860if exist %msitemp% call :ohookdata getmsiprod
861if exist %msitemp% del /f /q %msitemp%
862
863exit /b
864
865::========================================================================================================================================
866
867:oh_processmsi
868
869:: Process Office MSI Version
870
871call :oh_reset
872call :oh_actids
873
874set oVer=%1
875for /f "skip=2 tokens=2*" %%a in ('"reg query %2\Common\InstallRoot /v Path" %nul6%') do (set "_oRoot=%%b")
876if "%_oRoot:~-1%"=="\" set "_oRoot=%_oRoot:~0,-1%"
877
878echo "%2" | find /i "Wow6432Node" %nul1% && set _oArch=x86
879if not [%osarch%]==[x86] if not defined _oArch set _oArch=x64
880if [%osarch%]==[x86] set _oArch=x86
881
882if [%_oArch%]==[x64] (set "_hookPath=%_oRoot%" & set "_hook=sppc64.dll")
883if [%_oArch%]==[x86] (set "_hookPath=%_oRoot%" & set "_hook=sppc32.dll")
884if not [%osarch%]==[x86] (
885if [%_oArch%]==[x64] set "_sppcPath=%SystemRoot%\System32\sppc.dll"
886if [%_oArch%]==[x86] set "_sppcPath=%SystemRoot%\SysWOW64\sppc.dll"
887) else (
888set "_sppcPath=%SystemRoot%\System32\sppc.dll"
889)
890
891call :oh_msiproducts
892
893echo:
894echo Activating Office %1.0 %_oArch% MSI...
895
896if not defined _oIds (
897set error=1
898call :dk_color %Red% "Checking Installed Products [Product IDs not found. Aborting activation...]"
899exit /b
900)
901
902call :oh_process
903call :oh_hookinstall
904
905exit /b
906
907::========================================================================================================================================
908
909:: Refresh license status
910
911:dk_refresh
912
913if %_wmic% EQU 1 wmic path SoftwareLicensingService where __CLASS='SoftwareLicensingService' call RefreshLicenseStatus %nul%
914if %_wmic% EQU 0 %psc% "$null=(([WMICLASS]'SoftwareLicensingService').GetInstances()).RefreshLicenseStatus()" %nul%
915exit /b
916
917:: Get Windows Activation IDs
918
919:dk_actids
920
921set applist=
922if %_wmic% EQU 1 set "chkapp=for /f "tokens=2 delims==" %%a in ('"wmic path SoftwareLicensingProduct where (ApplicationID='55c92734-d682-4d71-983e-d6ec3f16059f') get ID /VALUE" %nul6%')"
923if %_wmic% EQU 0 set "chkapp=for /f "tokens=2 delims==" %%a in ('%psc% "(([WMISEARCHER]'SELECT ID FROM SoftwareLicensingProduct WHERE ApplicationID=''55c92734-d682-4d71-983e-d6ec3f16059f''').Get()).ID ^| %% {echo ('ID='+$_)}" %nul6%')"
924%chkapp% do (if defined applist (call set "applist=!applist! %%a") else (call set "applist=%%a"))
925exit /b
926
927:: Get Office Activation IDs
928
929:oh_actids
930
931set oapplist=
932if %_wmic% EQU 1 set "chkapp=for /f "tokens=2 delims==" %%a in ('"wmic path SoftwareLicensingProduct where (ApplicationID='0ff1ce15-a989-479d-af46-f275c6370663') get ID /VALUE" %nul6%')"
933if %_wmic% EQU 0 set "chkapp=for /f "tokens=2 delims==" %%a in ('%psc% "(([WMISEARCHER]'SELECT ID FROM SoftwareLicensingProduct WHERE ApplicationID=''0ff1ce15-a989-479d-af46-f275c6370663''').Get()).ID ^| %% {echo ('ID='+$_)}" %nul6%')"
934%chkapp% do (if defined oapplist (call set "oapplist=!oapplist! %%a") else (call set "oapplist=%%a"))
935exit /b
936
937:: Check wmic.exe
938
939:dk_ckeckwmic
940
941set _wmic=0
942for %%# in (wmic.exe) do @if not "%%~$PATH:#"=="" (
943wmic path Win32_ComputerSystem get CreationClassName /value %nul2% | find /i "computersystem" %nul1% && set _wmic=1
944)
945exit /b
946
947:: Get Product name (WMI/REG methods are not reliable in all conditions, hence winbrand.dll method is used)
948
949:dk_product
950
951call :dk_reflection
952
953set d1=%ref% $meth = $TypeBuilder.DefinePInvokeMethod('BrandingFormatString', 'winbrand.dll', 'Public, Static', 1, [String], @([String]), 1, 3);
954set d1=%d1% $meth.SetImplementationFlags(128); $TypeBuilder.CreateType()::BrandingFormatString('%%WINDOWS_LONG%%')
955
956set winos=
957for /f "delims=" %%s in ('"%psc% %d1%"') do if not errorlevel 1 (set winos=%%s)
958echo "%winos%" | find /i "Windows" %nul1% || (
959for /f "skip=2 tokens=2*" %%a in ('reg query "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion" /v ProductName %nul6%') do set "winos=%%b"
960if %winbuild% GEQ 22000 (
961set winos=!winos:Windows 10=Windows 11!
962)
963)
964exit /b
965
966:: Common lines used in PowerShell reflection code
967
968:dk_reflection
969
970set ref=$AssemblyBuilder = [AppDomain]::CurrentDomain.DefineDynamicAssembly(4, 1);
971set ref=%ref% $ModuleBuilder = $AssemblyBuilder.DefineDynamicModule(2, $False);
972set ref=%ref% $TypeBuilder = $ModuleBuilder.DefineType(0);
973exit /b
974
975::========================================================================================================================================
976
977:dk_errorcheck
978
979set showfix=
980
981:: Check corrupt services
982
983set serv_cor=
984for %%# in (%_serv%) do (
985set _corrupt=
986sc start %%# %nul%
987if !errorlevel! EQU 1060 set _corrupt=1
988sc query %%# %nul% || set _corrupt=1
989for %%G in (DependOnService Description DisplayName ErrorControl ImagePath ObjectName Start Type) do if not defined _corrupt (reg query HKLM\SYSTEM\CurrentControlSet\Services\%%# /v %%G %nul% || set _corrupt=1)
990if defined _corrupt (if defined serv_cor (set "serv_cor=!serv_cor! %%#") else (set "serv_cor=%%#"))
991)
992
993if defined serv_cor (
994set error=1
995call :dk_color %Red% "Checking Corrupt Services [%serv_cor%]"
996)
997
998::========================================================================================================================================
999
1000:: Check disabled services
1001
1002set serv_ste=
1003for %%# in (%_serv%) do (
1004sc start %%# %nul%
1005if !errorlevel! EQU 1058 (if defined serv_ste (set "serv_ste=!serv_ste! %%#") else (set "serv_ste=%%#"))
1006)
1007
1008:: Change disabled services startup type to default
1009
1010set serv_csts=
1011set serv_cste=
1012
1013if defined serv_ste (
1014for %%# in (%serv_ste%) do (
1015if /i %%#==ClipSVC (reg add "HKLM\SYSTEM\CurrentControlSet\Services\%%#" /v "Start" /t REG_DWORD /d "3" /f %nul% & sc config %%# start= demand %nul%)
1016if /i %%#==wlidsvc sc config %%# start= demand %nul%
1017if /i %%#==sppsvc (reg add "HKLM\SYSTEM\CurrentControlSet\Services\%%#" /v "Start" /t REG_DWORD /d "2" /f %nul% & sc config %%# start= delayed-auto %nul%)
1018if /i %%#==KeyIso sc config %%# start= demand %nul%
1019if /i %%#==LicenseManager sc config %%# start= demand %nul%
1020if /i %%#==Winmgmt sc config %%# start= auto %nul%
1021if /i %%#==wuauserv sc config %%# start= demand %nul%
1022if !errorlevel!==0 (
1023if defined serv_csts (set "serv_csts=!serv_csts! %%#") else (set "serv_csts=%%#")
1024) else (
1025if defined serv_cste (set "serv_cste=!serv_cste! %%#") else (set "serv_cste=%%#")
1026)
1027)
1028)
1029
1030if defined serv_csts call :dk_color %Gray% "Enabling Disabled Services [Successful] [%serv_csts%]"
1031
1032if defined serv_cste (
1033set error=1
1034call :dk_color %Red% "Enabling Disabled Services [Failed] [%serv_cste%]"
1035)
1036
1037::========================================================================================================================================
1038
1039:: Check if the services are able to run or not
1040:: Workarounds are added to get correct status and error code because sc query doesn't output correct results in some conditions
1041
1042set serv_e=
1043for %%# in (%_serv%) do (
1044set errorcode=
1045set checkerror=
1046net start %%# /y %nul%
1047set errorcode=!errorlevel!
1048sc query %%# | find /i "RUNNING" %nul% || set checkerror=1
1049
1050sc start %%# %nul%
1051if !errorlevel! NEQ 1056 if !errorlevel! NEQ 0 (set errorcode=!errorlevel!&set checkerror=1)
1052if defined checkerror if defined serv_e (set "serv_e=!serv_e!, %%#-!errorcode!") else (set "serv_e=%%#-!errorcode!")
1053)
1054
1055if defined serv_e (
1056set error=1
1057call :dk_color %Red% "Starting Services [Failed] [%serv_e%]"
1058echo %serv_e% | findstr /i "ClipSVC-1058 sppsvc-1058" %nul% && (
1059call :dk_color %Blue% "Restart the system to fix disabled service error 1058."
1060set showfix=1
1061)
1062)
1063
1064::========================================================================================================================================
1065
1066:: Various error checks
1067
1068if defined safeboot_option (
1069set error=1
1070set showfix=1
1071call :dk_color2 %Red% "Checking Boot Mode " %Blue% "[System is running in safe mode. Run in normal mode.]"
1072)
1073
1074
1075reg query "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Setup\State" %nul2% | find /i "IMAGE_STATE_COMPLETE" %nul1% || (
1076set error=1
1077set showfix=1
1078call :dk_color2 %Red% "Checking Audit Mode " %Blue% "[IMAGE_STATE_COMPLETE status not found. Run in normal mode.]"
1079)
1080
1081
1082reg query "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\WinPE" /v InstRoot %nul% && (
1083set error=1
1084set showfix=1
1085call :dk_color2 %Red% "Checking WinPE " %Blue% "[System is running in WinPE mode. Run in normal mode.]"
1086)
1087
1088
1089%psc% $ExecutionContext.SessionState.LanguageMode %nul2% | find /i "Full" %nul1% || (
1090set error=1
1091call :dk_color %Red% "Checking Powershell [Not Responding]"
1092)
1093
1094
1095DISM /English /Online /Get-CurrentEdition %nul%
1096set dism_error=%errorlevel%
1097cmd /c exit /b %dism_error%
1098if %dism_error% NEQ 0 set "dism_error=[0x%=ExitCode%]"
1099if %dism_error% NEQ 0 (
1100call :dk_color %Red% "Checking DISM [Not Responding] %dism_error%"
1101)
1102
1103
1104cscript //nologo %windir%\system32\slmgr.vbs /dlv %nul%
1105set error_code=%errorlevel%
1106cmd /c exit /b %error_code%
1107if %error_code% NEQ 0 set "error_code=0x%=ExitCode%"
1108if %error_code% NEQ 0 (
1109set error=1
1110call :dk_color %Red% "Checking slmgr /dlv [Not Responding] %error_code%"
1111)
1112
1113
1114for %%# in (wmic.exe) do @if "%%~$PATH:#"=="" (
1115call :dk_color %Gray% "Checking WMIC.exe [Not Found]"
1116)
1117
1118
1119set wmifailed=
1120if %_wmic% EQU 1 wmic path Win32_ComputerSystem get CreationClassName /value %nul2% | find /i "computersystem" %nul1%
1121if %_wmic% EQU 0 %psc% "Get-CIMInstance -Class Win32_ComputerSystem | Select-Object -Property CreationClassName" %nul2% | find /i "computersystem" %nul1%
1122
1123if %errorlevel% NEQ 0 set wmifailed=1
1124echo "%error_code%" | findstr /i "0x800410 0x800440" %nul1% && set wmifailed=1& :: https://learn.microsoft.com/en-us/windows/win32/wmisdk/wmi-error-constants
1125if defined wmifailed (
1126set error=1
1127call :dk_color %Red% "Checking WMI [Not Responding]"
1128call :dk_color %Blue% "In MAS, Goto Troubleshoot and run Fix WMI option."
1129set showfix=1
1130)
1131
1132
1133reg query "HKU\S-1-5-20\Software\Microsoft\Windows NT\CurrentVersion\SoftwareProtectionPlatform\PersistedTSReArmed" %nul% && (
1134set error=1
1135set showfix=1
1136call :dk_color2 %Red% "Checking Rearm " %Blue% "[System Restart Is Required]"
1137)
1138
1139
1140reg query "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\ClipSVC\Volatile\PersistedSystemState" %nul% && (
1141set error=1
1142set showfix=1
1143call :dk_color2 %Red% "Checking ClipSVC " %Blue% "[System Restart Is Required]"
1144)
1145
1146
1147for /f "skip=2 tokens=2*" %%a in ('reg query "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\SoftwareProtectionPlatform" /v "SkipRearm" %nul6%') do if /i %%b NEQ 0x0 (
1148reg add "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\SoftwareProtectionPlatform" /v "SkipRearm" /t REG_DWORD /d "0" /f %nul%
1149call :dk_color %Red% "Checking SkipRearm [Default 0 Value Not Found. Changing To 0]"
1150net stop sppsvc /y %nul%
1151net start sppsvc /y %nul%
1152set error=1
1153)
1154
1155
1156reg query "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\SoftwareProtectionPlatform\Plugins\Objects\msft:rm/algorithm/hwid/4.0" /f ba02fed39662 /d %nul% || (
1157call :dk_color %Red% "Checking SPP Registry Key [Incorrect ModuleId Found]"
1158call :dk_color %Blue% "Possibly Caused By Gaming Spoofers. Help: https://%mas%/troubleshoot"
1159set error=1
1160set showfix=1
1161)
1162
1163
1164set tokenstore=
1165for /f "skip=2 tokens=2*" %%a in ('reg query "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\SoftwareProtectionPlatform" /v TokenStore %nul6%') do call set "tokenstore=%%b"
1166if not exist "%tokenstore%\" (
1167set error=1
1168REM This code creates token folder only if it's missing and sets default permission for it
1169mkdir "%tokenstore%" %nul%
1170set "d=$sddl = 'O:BAG:BAD:PAI(A;OICI;FA;;;SY)(A;OICI;FA;;;BA)(A;OICIIO;GR;;;BU)(A;;FR;;;BU)(A;OICI;FA;;;S-1-5-80-123231216-2592883651-3715271367-3753151631-4175906628)';"
1171set "d=!d! $AclObject = New-Object System.Security.AccessControl.DirectorySecurity;"
1172set "d=!d! $AclObject.SetSecurityDescriptorSddlForm($sddl);"
1173set "d=!d! Set-Acl -Path %tokenstore% -AclObject $AclObject;"
1174%psc% "!d!" %nul%
1175call :dk_color %Gray% "Checking SPP Token Folder [Not Found. Creating Now] [%tokenstore%\]"
1176)
1177
1178
1179call :dk_actids
1180if not defined applist (
1181net stop sppsvc /y %nul%
1182cscript //nologo %windir%\system32\slmgr.vbs /rilc %nul%
1183if !errorlevel! NEQ 0 cscript //nologo %windir%\system32\slmgr.vbs /rilc %nul%
1184call :dk_refresh
1185call :dk_actids
1186if not defined applist (
1187set error=1
1188call :dk_color %Red% "Checking Activation IDs [Not Found]"
1189)
1190)
1191
1192
1193if exist "%tokenstore%\" if not exist "%tokenstore%\tokens.dat" (
1194set error=1
1195call :dk_color %Red% "Checking SPP tokens.dat [Not Found] [%tokenstore%\]"
1196)
1197
1198
1199if not exist %SystemRoot%\system32\sppsvc.exe (
1200set error=1
1201set showfix=1
1202call :dk_color %Red% "Checking sppsvc.exe File [Not Found]"
1203)
1204
1205
1206:: Below checks are performed if required services are not disabled or corrupted + if there is any error + slmgr /dlv errorlevel is not Zero + no fix was shown before
1207
1208set wpaerror=
1209set permerror=
1210if not defined serv_cor if not defined serv_cste if defined error if /i not %error_code%==0 if not defined showfix (
1211
1212REM This code checks for invalid registry keys in HKLM\SYSTEM\WPA. This issue may appear even on healthy systems.
1213
1214if %winbuild% GEQ 14393 (
1215set /a count=0
1216for /f %%a in ('reg query "HKLM\SYSTEM\WPA" %nul6%') do set /a count+=1
1217for /L %%# in (1,1,!count!) do (
1218reg query "HKLM\SYSTEM\WPA\8DEC0AF1-0341-4b93-85CD-72606C2DF94C-7P-%%#" /ve /t REG_BINARY %nul% || set wpaerror=1
1219)
1220if defined wpaerror call :dk_color %Red% "Checking WPA Registry Keys [Error Found] [Registry Count - !count!]"
1221)
1222
1223REM This code checks if NT SERVICE\sppsvc has permission access to tokens folder and required registry keys. It's often caused by gaming spoofers.
1224
1225if not exist "%tokenstore%\" set permerror=1
1226
1227for %%# in (
1228"%tokenstore%"
1229"HKLM:\SYSTEM\WPA"
1230"HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion\SoftwareProtectionPlatform"
1231) do if not defined permerror (
1232%psc% "$acl = Get-Acl '%%#'; if ($acl.Access.Where{ $_.IdentityReference -eq 'NT SERVICE\sppsvc' -and $_.AccessControlType -eq 'Deny' -or $acl.Access.IdentityReference -notcontains 'NT SERVICE\sppsvc'}) {Exit 2}" %nul%
1233if !errorlevel!==2 set permerror=1
1234)
1235if defined permerror call :dk_color %Red% "Checking SPP Permissions [Error Found]"
1236
1237set showfix=1
1238call :dk_color %Blue% "%_fixmsg%"
1239if not defined permerror call :dk_color %Blue% "If activation still fails then run Fix WPA Registry option."
1240)
1241
1242exit /b
1243
1244::========================================================================================================================================
1245
1246:dk_color
1247
1248if %_NCS% EQU 1 (
1249echo %esc%[%~1%~2%esc%[0m
1250) else (
1251%psc% write-host -back '%1' -fore '%2' '%3'
1252)
1253exit /b
1254
1255:dk_color2
1256
1257if %_NCS% EQU 1 (
1258echo %esc%[%~1%~2%esc%[%~3%~4%esc%[0m
1259) else (
1260%psc% write-host -back '%1' -fore '%2' '%3' -NoNewline; write-host -back '%4' -fore '%5' '%6'
1261)
1262exit /b
1263
1264::========================================================================================================================================
1265
1266:dk_done
1267
1268echo:
1269if %_unattended%==1 timeout /t 2 & exit /b
1270call :dk_color %_Yellow% "Press any key to %_exitmsg%..."
1271pause %nul1%
1272exit /b
1273
1274::========================================================================================================================================
1275
1276:: 1st column = Office version number
1277:: 2nd column = Activation ID
1278:: 3rd column = Generic key. Preference is given in this order, Retail > OEM:NONSLP > Volume:MAK > Volume:GVLK > Retail:TB:Sub
1279:: 4th column = Last part of license description
1280:: 5th column = Edition
1281:: Separator = "_"
1282
1283:ohookdata
1284
1285set f=
1286for %%# in (
128715_ab4d047b-97cf-4126-a69f-34df08e2f254_B7R%f%FY-7N%f%XPK-Q43%f%42-Y9%f%X2H-3JX%f%4X_Retail________AccessRetail
128815_4374022d-56b8-48c1-9bb7-d8f2fc726343_9MF%f%9G-CN%f%32B-HV7%f%XT-9X%f%J8T-9KV%f%F4_MAK___________AccessVolume
128915_1b1d9bd5-12ea-4063-964c-16e7e87d6e08_NT8%f%89-MB%f%H4X-8MD%f%4H-X8%f%R2D-WQH%f%F8_Retail________ExcelRetail
129015_ac1ae7fd-b949-4e04-a330-849bc40638cf_Y3N%f%36-YC%f%HDK-XYW%f%BG-KY%f%QVV-BDT%f%J2_MAK___________ExcelVolume
129115_cfaf5356-49e3-48a8-ab3c-e729ab791250_BMK%f%4W-6N%f%88B-BP9%f%QR-PH%f%FCK-MG7%f%GF_Retail________GrooveRetail
129215_4825ac28-ce41-45a7-9e6e-1fed74057601_RN8%f%4D-7H%f%CWY-FTC%f%BK-JM%f%XWM-HT7%f%GJ_MAK___________GrooveVolume
129315_c02fb62e-1cd5-4e18-ba25-e0480467ffaa_2WQ%f%NF-GB%f%K4B-XVG%f%6F-BB%f%MX7-M4F%f%2Y_OEM-Perp______HomeBusinessPipcRetail
129415_cd256150-a898-441f-aac0-9f8f33390e45_NVT%f%DK-QB%f%8J9-M28%f%GR-92%f%BPC-BR9%f%6Q_Retail________HomeBusinessRetail
129515_98685d21-78bd-4c62-bc4f-653344a63035_R29%f%WQ-CM%f%NCM-2TH%f%CT-K4%f%H92-FX6%f%KR_Retail________HomeStudentRetail
129615_44984381-406e-4a35-b1c3-e54f499556e2_RV7%f%NQ-HY%f%3WW-7CK%f%WH-QT%f%VMW-29V%f%HC_Retail________InfoPathRetail
129715_9e016989-4007-42a6-8051-64eb97110cf2_C4T%f%GN-QQ%f%W6Y-FYK%f%XC-6W%f%JW7-X73%f%VG_MAK___________InfoPathVolume
129815_9103f3ce-1084-447a-827e-d6097f68c895_6MD%f%N4-WF%f%3FV-4WH%f%3Q-W6%f%99V-RGC%f%MY_PrepidBypass__LyncAcademicRetail
129915_ff693bf4-0276-4ddb-bb42-74ef1a0c9f4d_N42%f%BF-CB%f%Y9F-W2C%f%7R-X3%f%97X-DYF%f%QW_PrepidBypass__LyncEntryRetail
130015_fada6658-bfc6-4c4e-825a-59a89822cda8_89P%f%23-2N%f%K2R-JXM%f%2M-3Q%f%8R8-BWM%f%3Y_Retail________LyncRetail
130115_e1264e10-afaf-4439-a98b-256df8bb156f_3WK%f%CD-RN%f%489-4M7%f%XJ-GJ%f%2GQ-YBF%f%Q6_MAK___________LyncVolume
130215_3169c8df-f659-4f95-9cc6-3115e6596e83_YYH%f%XG-KT%f%NKF-XGR%f%T7-H2%f%99D-8K6%f%MM_Retail________MondoRetail
130315_f33485a0-310b-4b72-9a0e-b1d605510dbd_2YN%f%YQ-FQ%f%MVG-CB8%f%KW-6X%f%KYD-M7R%f%RJ_MAK___________MondoVolume
130415_3391e125-f6e4-4b1e-899c-a25e6092d40d_4TG%f%WV-6N%f%9P6-G2H%f%8Y-2H%f%WKB-B4F%f%F4_Bypass________OneNoteFreeRetail
130515_8b524bcc-67ea-4876-a509-45e46f6347e8_3KX%f%XQ-PV%f%N2C-8P7%f%YY-HC%f%V88-GVG%f%Q6_Retail________OneNoteRetail
130615_b067e965-7521-455b-b9f7-c740204578a2_JDM%f%WF-NJ%f%C7B-HRC%f%HY-WF%f%T8G-BPX%f%D9_MAK___________OneNoteVolume
130715_12004b48-e6c8-4ffa-ad5a-ac8d4467765a_9N4%f%RQ-CF%f%8R2-HBV%f%CB-J3%f%C9V-94P%f%4D_Retail________OutlookRetail
130815_8d577c50-ae5e-47fd-a240-24986f73d503_HNG%f%29-GG%f%WRG-RFC%f%8C-JT%f%FP4-2J9%f%FH_MAK___________OutlookVolume
130915_5aab8561-1686-43f7-9ff5-2c861da58d17_9CY%f%B3-NF%f%MRW-YFD%f%G6-XC%f%7TF-BY3%f%6J_OEM-Perp______PersonalPipcRetail
131015_17e9df2d-ed91-4382-904b-4fed6a12caf0_2NC%f%QJ-MF%f%RMH-TXV%f%83-J7%f%V4C-RVR%f%WC_Retail________PersonalRetail
131115_31743b82-bfbc-44b6-aa12-85d42e644d5b_HVM%f%N2-KP%f%HQH-DVQ%f%MK-7B%f%3CM-FGB%f%FC_Retail________PowerPointRetail
131215_e40dcb44-1d5c-4085-8e8f-943f33c4f004_47D%f%KN-HP%f%JP7-RF9%f%M3-VC%f%YT2-TMQ%f%4G_MAK___________PowerPointVolume
131315_064383fa-1538-491c-859b-0ecab169a0ab_N3Q%f%MM-GK%f%DT3-JQG%f%X6-7X%f%3MQ-4GB%f%G3_Retail________ProPlusRetail
131415_2b88c4f2-ea8f-43cd-805e-4d41346e18a7_QKH%f%NX-M9%f%GGH-T3Q%f%MW-YP%f%K4Q-QRP%f%9V_MAK___________ProPlusVolume
131515_4e26cac1-e15a-4467-9069-cb47b67fe191_CF9%f%DD-6C%f%NW2-BJW%f%JQ-CV%f%CFX-Y7T%f%XD_OEM-Perp______ProfessionalPipcRetail
131615_44bc70e2-fb83-4b09-9082-e5557e0c2ede_MBQ%f%BN-CQ%f%PT6-PXR%f%MC-TY%f%JFR-3C8%f%MY_Retail________ProfessionalRetail
131715_f2435de4-5fc0-4e5b-ac97-34f515ec5ee7_B4R%f%N4-H4%f%JYG-YMQ%f%MC-CY%f%GKH-46W%f%PH_Retail________ProjectProRetail
131815_ed34dc89-1c27-4ecd-8b2f-63d0f4cedc32_WFC%f%T2-NB%f%FQ7-JD7%f%VV-MF%f%JX6-6F2%f%CM_MAK___________ProjectProVolume
131915_5517e6a2-739b-4822-946f-7f0f1c5934b1_2B9%f%6V-X9%f%NJY-WFB%f%RC-Q8%f%MP2-7CC%f%C4_Retail________ProjectStdRetail
132015_2b9e4a37-6230-4b42-bee2-e25ce86c8c7a_3CN%f%QX-T3%f%4TY-99R%f%H4-C4%f%YD2-KWY%f%GV_MAK___________ProjectStdVolume
132115_c3a0814a-70a4-471f-af37-2313a6331111_TWN%f%CJ-YR%f%84W-X7P%f%PF-6D%f%PRP-D67%f%VC_Retail________PublisherRetail
132215_38ea49f6-ad1d-43f1-9888-99a35d7c9409_DJP%f%HV-NC%f%JV6-GWP%f%T6-K2%f%6JX-C7G%f%X6_MAK___________PublisherVolume
132315_ba3e3833-6a7e-445a-89d0-7802a9a68588_3NY%f%6J-WH%f%T3F-47B%f%DV-JH%f%F36-234%f%3W_PrepidBypass__SPDRetail
132415_32255c0a-16b4-4ce2-b388-8a4267e219eb_V6V%f%WN-KC%f%2HR-YYD%f%D6-9V%f%7HQ-7T7%f%VP_Retail________StandardRetail
132515_a24cca51-3d54-4c41-8a76-4031f5338cb2_9TN%f%6B-PC%f%YH4-MCV%f%DQ-KT%f%83C-TMQ%f%7T_MAK___________StandardVolume
132615_15d12ad4-622d-4257-976c-5eb3282fb93d_JRJ%f%NJ-33%f%M7C-R73%f%X3-P9%f%XF7-R89%f%MY_Retail________VisioProRetail
132715_3e4294dd-a765-49bc-8dbd-cf8b62a4bd3d_YN7%f%CF-XR%f%H6R-CGK%f%RY-GK%f%PV3-BG7%f%WF_MAK___________VisioProVolume
132815_dae597ce-5823-4c77-9580-7268b93a4b23_G2N%f%2Q-4Q%f%D2T-DY4%f%TP-GY%f%489-3RQ%f%CG_Retail________VisioStdRetail
132915_44a1f6ff-0876-4edb-9169-dbb43101ee89_RX6%f%3Y-4N%f%FK2-XTY%f%C8-C6%f%B3W-YPX%f%PJ_MAK___________VisioStdVolume
133015_191509f2-6977-456f-ab30-cf0492b1e93a_NB7%f%7V-RP%f%FQ6-PMM%f%KQ-T8%f%7DV-M4D%f%84_Retail________WordRetail
133115_9cedef15-be37-4ff0-a08a-13a045540641_RPH%f%PB-Y7%f%NC4-3VY%f%FM-DW%f%7VD-G8Y%f%J8_MAK___________WordVolume
133215_befee371-a2f5-4648-85db-a2c55fdf324c_JXR%f%8H-NJ%f%3MK-X66%f%W8-78%f%CWD-QRQ%f%6C_Retail________O365BusinessRetail
133315_537ea5b5-7d50-4876-bd38-a53a77caca32_J2W%f%28-TN%f%9C8-26P%f%WV-F7%f%J4G-72X%f%CB_Subscription1_O365HomePremRetail
133415_0c4e5e7a-b436-4776-bb89-88e4b14687e2_T6J%f%JW-DY%f%N99-WK4%f%6B-9M%f%KKV-94P%f%2Y_Retail________O365ProPlusRetail
133515_7a75647f-636f-4607-8e54-e1b7d1ad8930_B9V%f%9Q-F6%f%ND8-T4K%f%4K-88%f%68M-HT7%f%KT_Retail________O365SmallBusPremRetail
133616_bfa358b0-98f1-4125-842e-585fa13032e6_WHK%f%4N-YQ%f%GHB-XWX%f%CC-G3%f%HYC-6JF%f%94_Retail________AccessRetail
133716_9d9faf9e-d345-4b49-afce-68cb0a539c7c_RNB%f%7V-P4%f%8F4-3FY%f%Y6-2P%f%3R3-63B%f%QV_PrepidBypass__AccessRuntimeRetail
133816_3b2fa33f-cd5a-43a5-bd95-f49f3f546b0b_JJ2%f%Y4-N8%f%KM3-Y8K%f%Y3-Y2%f%2FR-R3K%f%VK_MAK___________AccessVolume
133916_424d52ff-7ad2-4bc7-8ac6-748d767b455d_RKJ%f%BN-VW%f%TM2-BDK%f%XX-RK%f%QFD-JTY%f%Q2_Retail________ExcelRetail
134016_685062a7-6024-42e7-8c5f-6bb9e63e697f_FVG%f%NR-X8%f%2B2-6PR%f%JM-YT%f%4W7-8HV%f%36_MAK___________ExcelVolume
134116_c02fb62e-1cd5-4e18-ba25-e0480467ffaa_2WQ%f%NF-GB%f%K4B-XVG%f%6F-BB%f%MX7-M4F%f%2Y_OEM-Perp______HomeBusinessPipcRetail
134216_86834d00-7896-4a38-8fae-32f20b86fa2b_HM6%f%FM-NV%f%F78-KV9%f%PM-F3%f%6B8-D9M%f%XD_Retail________HomeBusinessRetail
134316_c28acdb8-d8b3-4199-baa4-024d09e97c99_PNP%f%RV-F2%f%627-Q8J%f%VC-3D%f%GR9-WTY%f%RK_Retail________HomeStudentRetail
134416_e2127526-b60c-43e0-bed1-3c9dc3d5a468_YWD%f%4R-CN%f%KVT-VG8%f%VJ-93%f%33B-RC3%f%B8_Retail________HomeStudentVNextRetail
134516_b21367df-9545-4f02-9f24-240691da0e58_Y3X%f%PN-P7%f%PC4-MGP%f%TJ-2B%f%Y3Q-RJR%f%FV_Retail________MondoRetail
134616_2cd0ea7e-749f-4288-a05e-567c573b2a6c_FMT%f%QQ-84%f%NR8-274%f%4R-MX%f%F4P-PGY%f%R3_MAK___________MondoVolume
134716_436366de-5579-4f24-96db-3893e4400030_XYN%f%TG-R9%f%6FY-369%f%HX-YF%f%PHY-F9C%f%PM_Bypass________OneNoteFreeRetail
134816_83ac4dd9-1b93-40ed-aa55-ede25bb6af38_FXF%f%6F-CN%f%C26-W64%f%3C-K6%f%KB7-6XX%f%W3_Retail________OneNoteRetail
134916_23b672da-a456-4860-a8f3-e062a501d7e8_9TY%f%VN-D7%f%6HK-BVM%f%WT-Y7%f%G88-9TP%f%PV_MAK___________OneNoteVolume
135016_5a670809-0983-4c2d-8aad-d3c2c5b7d5d1_7N4%f%KG-P2%f%QDH-86V%f%9C-DJ%f%FVF-369%f%W9_Retail________OutlookRetail
135116_50059979-ac6f-4458-9e79-710bcb41721a_7QP%f%NR-3H%f%FDG-YP6%f%T9-JQ%f%CKQ-KKX%f%XC_MAK___________OutlookVolume
135216_5aab8561-1686-43f7-9ff5-2c861da58d17_9CY%f%B3-NF%f%MRW-YFD%f%G6-XC%f%7TF-BY3%f%6J_OEM-Perp______PersonalPipcRetail
135316_a9f645a1-0d6a-4978-926a-abcb363b72a6_FT7%f%VF-XB%f%N92-HPD%f%JV-RH%f%MBY-6VK%f%BF_Retail________PersonalRetail
135416_f32d1284-0792-49da-9ac6-deb2bc9c80b6_N7G%f%CB-WQ%f%T7K-QRH%f%WG-TT%f%PYD-7T9%f%XF_Retail________PowerPointRetail
135516_9b4060c9-a7f5-4a66-b732-faf248b7240f_X3R%f%T9-ND%f%G64-VMK%f%2M-KQ%f%6XY-DPF%f%GV_MAK___________PowerPointVolume
135616_de52bd50-9564-4adc-8fcb-a345c17f84f9_GM4%f%3N-F7%f%42Q-6JD%f%DK-M6%f%22J-J8G%f%DV_Retail________ProPlusRetail
135716_c47456e3-265d-47b6-8ca0-c30abbd0ca36_FNV%f%K8-8D%f%VCJ-F7X%f%3J-KG%f%VQB-RC2%f%QY_MAK___________ProPlusVolume
135816_4e26cac1-e15a-4467-9069-cb47b67fe191_CF9%f%DD-6C%f%NW2-BJW%f%JQ-CV%f%CFX-Y7T%f%XD_OEM-Perp______ProfessionalPipcRetail
135916_d64edc00-7453-4301-8428-197343fafb16_NXF%f%TK-YD%f%9Y7-X9M%f%MJ-9B%f%WM6-J2Q%f%VH_Retail________ProfessionalRetail
136016_0f42f316-00b1-48c5-ada4-2f52b5720ad0_WKK%f%GF-TT%f%N8F-QC9%f%T2-6C%f%2DC-3YH%f%63_Retail________ProjectProRetail
136116_82f502b5-b0b0-4349-bd2c-c560df85b248_PKC%f%3N-8F%f%99H-28M%f%VY-J4%f%RYY-CWG%f%DH_MAK___________ProjectProVolume
136216_16728639-a9ab-4994-b6d8-f81051e69833_JBN%f%PH-YF%f%2F7-Q9Y%f%29-86%f%CTG-C9Y%f%GV_MAKC2R________ProjectProXVolume
136316_e9f0b3fc-962f-4944-ad06-05c10b6bcd5e_4H6%f%NF-QD%f%PG8-83W%f%97-9K%f%8XY-XBT%f%9Y_Retail________ProjectStdRetail
136416_82e6b314-2a62-4e51-9220-61358dd230e6_4TG%f%WV-6N%f%9P6-G2H%f%8Y-2H%f%WKB-B4G%f%93_MAK___________ProjectStdVolume
136516_431058f0-c059-44c5-b9e7-ed2dd46b6789_N3W%f%2Q-69%f%MBT-27R%f%D9-BH%f%8V3-JT2%f%C8_MAKC2R________ProjectStdXVolume
136616_6e0c1d99-c72e-4968-bcb7-ab79e03e201e_WKW%f%ND-X6%f%G9G-CDM%f%TV-CP%f%GYJ-6MV%f%BF_Retail________PublisherRetail
136716_fcc1757b-5d5f-486a-87cf-c4d6dedb6032_9QV%f%N2-PX%f%XRX-8V4%f%W8-Q7%f%926-TJG%f%D8_MAK___________PublisherVolume
136816_9103f3ce-1084-447a-827e-d6097f68c895_6MD%f%N4-WF%f%3FV-4WH%f%3Q-W6%f%99V-RGC%f%MY_PrepidBypass__SkypeServiceBypassRetail
136916_971cd368-f2e1-49c1-aedd-330909ce18b6_4N4%f%D8-3J%f%7Y3-YYW%f%7C-73%f%HD2-V8R%f%HY_PrepidBypass__SkypeforBusinessEntryRetail
137016_418d2b9f-b491-4d7f-84f1-49e27cc66597_PBJ%f%79-77%f%NY4-VRG%f%FG-Y8%f%WYC-CKC%f%RC_Retail________SkypeforBusinessRetail
137116_03ca3b9a-0869-4749-8988-3cbc9d9f51bb_DMT%f%CJ-KN%f%RKR-JV8%f%TQ-V2%f%CR2-VFT%f%FH_MAK___________SkypeforBusinessVolume
137216_4a31c291-3a12-4c64-b8ab-cd79212be45e_2FP%f%WN-4H%f%6CM-KD8%f%QQ-8H%f%CHC-P9X%f%YW_Retail________StandardRetail
137316_0ed94aac-2234-4309-ba29-74bdbb887083_WHG%f%MQ-JN%f%MGT-MDQ%f%VF-WD%f%R69-KQB%f%WC_MAK___________StandardVolume
137416_2dfe2075-2d04-4e43-816a-eb60bbb77574_7TM%f%6H-KN%f%R4K-Q7H%f%BX-72%f%T2Q-H22%f%RV_Retail________VisioProRetail
137516_295b2c03-4b1c-4221-b292-1411f468bd02_NRK%f%T9-C8%f%GP2-XDY%f%XQ-YW%f%72K-MG9%f%2B_MAK___________VisioProVolume
137616_0594dc12-8444-4912-936a-747ca742dbdb_G98%f%Q2-B6%f%N77-CFH%f%9J-K8%f%24G-XQC%f%C4_MAKC2R________VisioProXVolume
137716_c76dbcbc-d71b-4f45-b5b3-b7494cb4e23e_Q8R%f%4N-GJ%f%CPG-CF3%f%2R-JF%f%CYR-K4T%f%F3_Retail________VisioStdRetail
137816_44151c2d-c398-471f-946f-7660542e3369_XNC%f%JB-YY%f%883-JRW%f%64-DP%f%XMX-JXC%f%R6_MAK___________VisioStdVolume
137916_1d1c6879-39a3-47a5-9a6d-aceefa6a289d_B2H%f%TN-JP%f%H8C-J6Y%f%6V-HC%f%HKB-43M%f%GT_MAKC2R________VisioStdXVolume
138016_cacaa1bf-da53-4c3b-9700-11738ef1c2a5_P8K%f%82-NQ%f%7GG-JKY%f%8T-6V%f%HVY-88G%f%GD_Retail________WordRetail
138116_c3000759-551f-4f4a-bcac-a4b42cbf1de2_YHM%f%WC-YN%f%6V9-WJP%f%XD-3W%f%QKP-TMV%f%CV_MAK___________WordVolume
138216_518687bd-dc55-45b9-8fa6-f918e1082e83_WRY%f%J6-G3%f%NP7-7VH%f%94-8X%f%7KP-JB7%f%HC_Retail________Access2019Retail
138316_385b91d6-9c2c-4a2e-86b5-f44d44a48c5f_6FW%f%HX-NK%f%YXK-BW3%f%4Q-7X%f%C9F-Q9P%f%X7_MAK-AE________Access2019Volume
138416_22e6b96c-1011-4cd5-8b35-3c8fb6366b86_FGQ%f%NJ-JW%f%JCG-7Q8%f%MG-RM%f%RGJ-9TQ%f%VF_PrepidBypass__AccessRuntime2019Retail
138516_c201c2b7-02a1-41a8-b496-37c72910cd4a_KBP%f%NW-64%f%CMM-8KW%f%CB-23%f%F44-8B7%f%HM_Retail________Excel2019Retail
138616_05cb4e1d-cc81-45d5-a769-f34b09b9b391_8NT%f%4X-GQ%f%MCK-62X%f%4P-TW%f%6QP-YKP%f%YF_MAK-AE________Excel2019Volume
138716_7fe09eef-5eed-4733-9a60-d7019df11cac_QBN%f%2Y-9B%f%284-9KW%f%78-K4%f%8PB-R62%f%YT_Retail________HomeBusiness2019Retail
138816_4539aa2c-5c31-4d47-9139-543a868e5741_XNW%f%PM-32%f%XQC-Y7Q%f%JC-QG%f%GBV-YY7%f%JK_Retail________HomeStudent2019Retail
138916_20e359d5-927f-47c0-8a27-38adbdd27124_WR4%f%3D-NM%f%WQQ-HCQ%f%R2-VK%f%XDR-37B%f%7H_Retail________Outlook2019Retail
139016_92a99ed8-2923-4cb7-a4c5-31da6b0b8cf3_RN3%f%QB-GT%f%6D7-YB3%f%VH-F3%f%RPB-3GQ%f%YB_MAK-AE________Outlook2019Volume
139116_2747b731-0f1f-413e-a92d-386ec1277dd8_NMB%f%Y8-V3%f%CV7-BX6%f%K6-29%f%22Y-43M%f%7T_Retail________Personal2019Retail
139216_7e63cc20-ba37-42a1-822d-d5f29f33a108_HN2%f%7K-JH%f%J8R-7T7%f%KK-WJ%f%YC3-FM7%f%MM_Retail________PowerPoint2019Retail
139316_13c2d7bf-f10d-42eb-9e93-abf846785434_29G%f%NM-VM%f%33V-WR2%f%3K-HG%f%2DT-KTQ%f%YR_MAK-AE________PowerPoint2019Volume
139416_a3072b8f-adcc-4e75-8d62-fdeb9bdfae57_BN4%f%XJ-R9%f%DYY-96W%f%48-YK%f%8DM-MY7%f%PY_Retail________ProPlus2019Retail
139516_6755c7a7-4dfe-46f5-bce8-427be8e9dc62_T8Y%f%BN-4Y%f%V3X-KK2%f%4Q-QX%f%BD7-T3C%f%63_MAK-AE________ProPlus2019Volume
139616_1717c1e0-47d3-4899-a6d3-1022db7415e0_9NX%f%DK-MR%f%Y98-2VJ%f%V8-GF%f%73J-TQ9%f%FK_Retail________Professional2019Retail
139716_0d270ef7-5aaf-4370-a372-bc806b96adb7_JDT%f%NC-PP%f%77T-T9H%f%2W-G4%f%J2J-VH8%f%JK_Retail________ProjectPro2019Retail
139816_d4ebadd6-401b-40d5-adf4-a5d4accd72d1_TBX%f%BD-FN%f%WKJ-WRH%f%BD-KB%f%PHH-XD9%f%F2_MAK-AE________ProjectPro2019Volume
139916_bb7ffe5f-daf9-4b79-b107-453e1c8427b5_R3J%f%NT-8P%f%BDP-MTW%f%CK-VD%f%2V8-HMK%f%F9_Retail________ProjectStd2019Retail
140016_fdaa3c03-dc27-4a8d-8cbf-c3d843a28ddc_RBR%f%FX-MQ%f%NDJ-4XF%f%HF-7Q%f%VDR-JHX%f%GC_MAK-AE________ProjectStd2019Volume
140116_f053a7c7-f342-4ab8-9526-a1d6e5105823_4QC%f%36-NW%f%3YH-D2Y%f%9D-RJ%f%PC7-VVB%f%9D_Retail________Publisher2019Retail
140216_40055495-be00-444e-99cc-07446729b53e_K8F%f%2D-NB%f%M32-BF2%f%6V-YC%f%KFJ-29Y%f%9W_MAK-AE________Publisher2019Volume
140316_b639e55c-8f3e-47fe-9761-26c6a786ad6b_JBD%f%KF-6N%f%CD6-49K%f%3G-2T%f%V79-BKP%f%73_Retail________SkypeforBusiness2019Retail
140416_15a430d4-5e3f-4e6d-8a0a-14bf3caee4c7_9MN%f%Q7-YP%f%Q3B-6WJ%f%XM-G8%f%3T3-CBB%f%DK_MAK-AE________SkypeforBusiness2019Volume
140516_f88cfdec-94ce-4463-a969-037be92bc0e7_N97%f%22-BV%f%9H6-WTJ%f%TT-FP%f%B93-978%f%MK_PrepidBypass__SkypeforBusinessEntry2019Retail
140616_fdfa34dd-a472-4b85-bee6-cf07bf0aaa1c_NDG%f%VM-MD%f%27H-2XH%f%VC-KD%f%DX2-YKP%f%74_Retail________Standard2019Retail
140716_beb5065c-1872-409e-94e2-403bcfb6a878_NT3%f%V6-XM%f%BK7-Q66%f%MF-VM%f%KR4-FC3%f%3M_MAK-AE________Standard2019Volume
140816_a6f69d68-5590-4e02-80b9-e7233dff204e_2NW%f%VW-QG%f%F4T-9CP%f%MB-WY%f%DQ9-7XP%f%79_Retail________VisioPro2019Retail
140916_f41abf81-f409-4b0d-889d-92b3e3d7d005_33Y%f%F4-GN%f%CQ3-J6G%f%DM-J6%f%7P3-FM7%f%QP_MAK-AE________VisioPro2019Volume
141016_4a582021-18c2-489f-9b3d-5186de48f1cd_263%f%WK-3N%f%797-7R4%f%37-28%f%BKG-3V8%f%M8_Retail________VisioStd2019Retail
141116_933ed0e3-747d-48b0-9c2c-7ceb4c7e473d_BGN%f%HX-QT%f%PRJ-F9C%f%9G-R8%f%QQG-8T2%f%7F_MAK-AE________VisioStd2019Volume
141216_72cee1c2-3376-4377-9f25-4024b6baadf8_JXR%f%8H-NJ%f%3MK-X66%f%W8-78%f%CWD-QRV%f%R2_Retail________Word2019Retail
141316_fe5fe9d5-3b06-4015-aa35-b146f85c4709_9F3%f%6R-PN%f%VHH-3DX%f%GQ-7C%f%D2H-R9D%f%3V_MAK-AE________Word2019Volume
141416_f634398e-af69-48c9-b256-477bea3078b5_P28%f%6B-N3%f%XYP-36Q%f%RQ-29%f%CMP-RVX%f%9M_Retail________Access2021Retail
141516_ae17db74-16b0-430b-912f-4fe456e271db_JBH%f%3N-P9%f%7FP-FRT%f%JD-MG%f%K2C-VFW%f%G6_MAK-AE________Access2021Volume
141616_fb099c19-d48b-4a2f-a160-4383011060aa_V6Q%f%FB-7N%f%7G9-PF7%f%W9-M8%f%FQM-MY8%f%G9_Retail________Excel2021Retail
141716_9da1ecdb-3a62-4273-a234-bf6d43dc0778_WNY%f%R4-KM%f%R9H-KVC%f%8W-7H%f%J8B-K79%f%DQ_MAK-AE________Excel2021Volume
141816_0e878942-3ba1-48ee-a215-f64d10a9f97b_QV2%f%VN-37%f%WPX-DHH%f%4K-B8%f%2H6-PDP%f%3T_Retail1_______HomeBusiness2021Retail
141916_9e7d5312-95fc-4443-a551-69c20624ec6b_3QN%f%G6-8F%f%JTH-88B%f%F9-KB%f%BVM-JMB%f%78_Retail________HomeStudent2021Retail
142016_279706f4-3a4b-4877-949b-f8c299cf0cc5_NB2%f%TQ-3Y%f%79C-77C%f%6M-QM%f%Y7H-7QY%f%8P_Retail________OneNote2021Retail
142116_ecea2cfa-d406-4a7f-be0d-c6163250d126_4NC%f%WR-9V%f%92Y-34V%f%B2-RP%f%THR-YTG%f%R7_Retail________Outlook2021Retail
142216_45bf67f9-0fc8-4335-8b09-9226cef8a576_JQ9%f%MJ-QY%f%N6B-67P%f%X9-GY%f%FVY-QJ6%f%TB_MAK-AE________Outlook2021Volume
142316_8f89391e-eedb-429d-af90-9d36fbf94de6_RRR%f%YB-DN%f%749-GCP%f%W4-9H%f%6VK-HCH%f%PT_Retail________Personal2021Retail
142416_c9bf5e86-f5e3-4ac6-8d52-e114a604d7bf_3KX%f%XQ-PV%f%N2C-8P7%f%YY-HC%f%V88-GVM%f%96_Retail1_______PowerPoint2021Retail
142516_716f2434-41b6-4969-ab73-e61e593a3875_39G%f%2N-3B%f%D9C-C4X%f%CM-BD%f%4QG-FVY%f%DY_MAK-AE________PowerPoint2021Volume
142616_c2f04adf-a5de-45c5-99a5-f5fddbda74a8_8WX%f%TP-MN%f%628-KY4%f%4G-VJ%f%WCK-C7P%f%CF_Retail________ProPlus2021Retail
142716_3f180b30-9b05-4fe2-aa8d-0c1c4790f811_RNH%f%JY-DT%f%FXW-HW9%f%F8-49%f%82D-MD2%f%CW_MAK-AE1_______ProPlus2021Volume
142816_96097a68-b5c5-4b19-8600-2e8d6841a0db_JRJ%f%NJ-33%f%M7C-R73%f%X3-P9%f%XF7-R9F%f%6M_MAK-AE________ProPlusSPLA2021Volume
142916_711e48a6-1a79-4b00-af10-73f4ca3aaac4_DJP%f%HV-NC%f%JV6-GWP%f%T6-K2%f%6JX-C7P%f%BG_Retail________Professional2021Retail
143016_3747d1d5-55a8-4bc3-b53d-19fff1913195_QKH%f%NX-M9%f%GGH-T3Q%f%MW-YP%f%K4Q-QRW%f%MV_Retail________ProjectPro2021Retail
143116_17739068-86c4-4924-8633-1e529abc7efc_HVC%f%34-CV%f%NPG-RVC%f%MT-X2%f%JRF-CR7%f%RK_MAK-AE1_______ProjectPro2021Volume
143216_4ea64dca-227c-436b-813f-b6624be2d54c_2B9%f%6V-X9%f%NJY-WFB%f%RC-Q8%f%MP2-7CH%f%RR_Retail________ProjectStd2021Retail
143316_84313d1e-47c8-4e27-8ced-0476b7ee46c4_3CN%f%QX-T3%f%4TY-99R%f%H4-C4%f%YD2-KW6%f%WH_MAK-AE________ProjectStd2021Volume
143416_b769b746-53b1-4d89-8a68-41944dafe797_CDN%f%FG-77%f%T8D-VKQ%f%JX-B7%f%KT3-KK2%f%8V_Retail1_______Publisher2021Retail
143516_a0234cfe-99bd-4586-a812-4f296323c760_2KX%f%JH-3N%f%HTW-RDB%f%PX-QF%f%RXJ-MTG%f%XF_MAK-AE________Publisher2021Volume
143616_c3fb48b2-1fd4-4dc8-af39-819edf194288_DVB%f%XN-HF%f%T43-CVP%f%RQ-J8%f%9TF-VMM%f%HG_Retail________SkypeforBusiness2021Retail
143716_6029109c-ceb8-4ee5-b324-f8eb2981e99a_R3F%f%CY-NH%f%GC7-CBP%f%VP-8Q%f%934-YTG%f%XG_MAK-AE________SkypeforBusiness2021Volume
143816_9e7e7b8e-a0e7-467b-9749-d0de82fb7297_HXN%f%XB-J4%f%JGM-TCF%f%44-2X%f%2CV-FJV%f%VH_Retail________Standard2021Retail
143916_223a60d8-9002-4a55-abac-593f5b66ca45_2CJ%f%N4-C9%f%XK2-HFP%f%Q6-YH%f%498-82T%f%XH_MAK-AE________Standard2021Volume
144016_b99ba8c4-e257-4b70-a31a-8bd308ce7073_BQW%f%DW-NJ%f%9YF-P7Y%f%79-H6%f%DCT-MKQ%f%9C_MAK-AE________StandardSPLA2021Volume
144116_814014d3-c30b-4f63-a493-3708e0dc0ba8_T6P%f%26-NJ%f%VBR-76B%f%K8-WB%f%CDY-TX3%f%BC_Retail________VisioPro2021Retail
144216_c590605a-a08a-4cc7-8dc2-f1ffb3d06949_JNK%f%BX-MH%f%9P4-K8Y%f%YV-8C%f%G2Y-VQ2%f%C8_MAK-AE________VisioPro2021Volume
144316_16d43989-a5ef-47e2-9ff1-272784caee24_89N%f%YY-KB%f%93R-7X2%f%2F-93%f%QDF-DJ6%f%YM_Retail________VisioStd2021Retail
144416_d55f90ee-4ba2-4d02-b216-1300ee50e2af_BW4%f%3B-4P%f%NFP-V63%f%7F-23%f%TR2-J47%f%TX_MAK-AE________VisioStd2021Volume
144516_fb33d997-4aa3-494e-8b58-03e9ab0f181d_VNC%f%C4-CJ%f%QVK-BKX%f%34-77%f%Y8H-CYX%f%MR_Retail________Word2021Retail
144616_0c728382-95fb-4a55-8f12-62e605f91727_BJG%f%97-NW%f%3GM-8QQ%f%Q7-FH%f%76G-686%f%XM_MAK-AE________Word2021Volume
144716_6337137e-7c07-4197-8986-bece6a76fc33_2P3%f%C9-BQ%f%NJH-VCV%f%PH-YD%f%Y6M-43J%f%PQ_Subscription__O365BusinessRetail
144816_2f5c71b4-5b7a-4005-bb68-f9fac26f2ea3_W62%f%NQ-26%f%7QR-RTF%f%74-PF%f%2MH-JQM%f%TH_Subscription__O365EduCloudRetail
144916_537ea5b5-7d50-4876-bd38-a53a77caca32_J2W%f%28-TN%f%9C8-26P%f%WV-F7%f%J4G-72X%f%CB_Subscription1_O365HomePremRetail
145016_149dbce7-a48e-44db-8364-a53386cd4580_2N3%f%82-D6%f%PKK-QTX%f%4D-2J%f%JYK-M96%f%P2_Subscription1_O365ProPlusRetail
145116_bacd4614-5bef-4a5e-bafc-de4c788037a2_HN8%f%JP-87%f%TQJ-PBF%f%3P-Y6%f%6KC-W2K%f%9V_Subscription1_O365SmallBusPremRetail
1452) do (
1453for /f "tokens=1-5 delims=_" %%A in ("%%#") do (
1454if %1==getinfo if %oVer%==%%A if "%2"=="%%E" (set _key=%%C& set _actid=%%B& set _allactid=!_allactid! %%B&set _lic=%%D)
1455
1456if %1==getmsiprod if %oVer%==%%A (find /i "%%E" %msitemp% %nul% && (if defined _oIds (set _oIds=!_oIds! %%E) else (set _oIds=%%E)))
1457
1458)
1459)
1460exit /b
1461
1462::========================================================================================================================================
1463
1464:: This code is used to modify the timestamp value of sppc dll file in order to change checksums
1465:: It's done to lower the potential false positive detection by antivirus's. On each install, it will install a unique sppc dll file
1466
1467:oh_modify
1468
1469%psc% "$f=[io.file]::ReadAllText('!_batp!') -split ':hexedit\:.*';& ([ScriptBlock]::Create($f[1])) '%1';" %nul2% | find /i "Error found" %nul1% && set hasherror=1
1470exit /b
1471
1472:hexedit:
1473param (
1474 [Parameter()]
1475 [String]$PePath
1476)
1477
1478# Define dynamic assembly, module, and type
1479$AssemblyBuilder = [AppDomain]::CurrentDomain.DefineDynamicAssembly(4, 1)
1480$ModuleBuilder = $AssemblyBuilder.DefineDynamicModule(2, $False)
1481$TypeBuilder = $ModuleBuilder.DefineType(0)
1482
1483# Define P/Invoke method
1484[void]$TypeBuilder.DefinePInvokeMethod('MapFileAndCheckSum', 'imagehlp.dll', 'Public, Static', [Reflection.CallingConventions]::Standard, [int], @([string], [int].MakeByRefType(), [int].MakeByRefType()), [Runtime.InteropServices.CallingConvention]::Winapi, [Runtime.InteropServices.CharSet]::Auto)
1485
1486# Create the type
1487$Imagehlp = $TypeBuilder.CreateType()
1488
1489# File and offset information
1490$PeFile = Get-ChildItem -Path $PePath
1491$timestampOffset = 136
1492$exportTimestampOffset = 3076
1493$checkSumOffset = 216
1494
1495# Calculate timestamp
1496$currentTimestamp = [DateTime]::UtcNow
1497$unixTimestamp = [int]($currentTimestamp - (Get-Date -Year 1970 -Month 1 -Day 1 -Hour 0 -Minute 0 -Second 0)).TotalSeconds
1498
1499# Open file
1500$Stream = [System.IO.File]::Open($PeFile.FullName, [System.IO.FileMode]::Open, [System.IO.FileAccess]::Write, [System.IO.FileShare]::Read)
1501$Writer = New-Object System.IO.BinaryWriter($Stream)
1502
1503# Change timestamps
1504$Writer.BaseStream.Position = $timestampOffset
1505$Writer.Write($unixTimestamp)
1506
1507$Writer.BaseStream.Position = $exportTimestampOffset
1508$Writer.Write($unixTimestamp)
1509
1510$Writer.Flush()
1511
1512# Update hash
1513[int]$HeaderSum = 0
1514[int]$CheckSum = 0
1515
1516[void]$Imagehlp::MapFileAndCheckSum($PeFile.FullName, [ref]$HeaderSum, [ref]$CheckSum)
1517
1518if ($HeaderSum -ne $CheckSum) {
1519 $Writer.BaseStream.Position = $checkSumOffset
1520 $Writer.Write($CheckSum)
1521 $Writer.Flush()
1522} else {
1523 Write-host Error found
1524}
1525
1526[void]$Imagehlp::MapFileAndCheckSum($PeFile.FullName, [ref]$HeaderSum, [ref]$CheckSum)
1527
1528if ($HeaderSum -ne $CheckSum) {
1529 Write-host Error found
1530}
1531
1532$Stream.Close()
1533:hexedit:
1534
1535::========================================================================================================================================
1536:: Leave empty line below
diff --git a/MAS/Separate-Files-Version/Activators/Ohook_Activation/Ohook_Activation_AIO.cmd b/MAS/Separate-Files-Version/Activators/Ohook_Activation/Ohook_Activation_AIO.cmd
new file mode 100644
index 0000000..1bbd61c
--- /dev/null
+++ b/MAS/Separate-Files-Version/Activators/Ohook_Activation/Ohook_Activation_AIO.cmd
@@ -0,0 +1,1682 @@
1@setlocal DisableDelayedExpansion
2@echo off
3
4
5
6::============================================================================
7::
8:: This script is a part of 'Microsoft_Activation_Scripts' (MAS) project.
9::
10:: Homepage: mass grave[.]dev
11:: Email: windowsaddict@protonmail.com
12::
13::============================================================================
14
15
16
17:: To activate Office with Ohook activation, run the script with "/Ohook" parameter or change 0 to 1 in below line
18set _act=0
19
20:: To remove Ohook activation, run the script with /Ohook-Uninstall parameter or change 0 to 1 in below line
21set _rem=0
22
23:: If value is changed in above lines or parameter is used then script will run in unattended mode
24
25
26
27::========================================================================================================================================
28
29:: Set Path variable, it helps if it is misconfigured in the system
30
31set "PATH=%SystemRoot%\System32;%SystemRoot%\System32\wbem;%SystemRoot%\System32\WindowsPowerShell\v1.0\"
32if exist "%SystemRoot%\Sysnative\reg.exe" (
33set "PATH=%SystemRoot%\Sysnative;%SystemRoot%\Sysnative\wbem;%SystemRoot%\Sysnative\WindowsPowerShell\v1.0\;%PATH%"
34)
35
36:: Re-launch the script with x64 process if it was initiated by x86 process on x64 bit Windows
37:: or with ARM64 process if it was initiated by x86/ARM32 process on ARM64 Windows
38
39set "_cmdf=%~f0"
40for %%# in (%*) do (
41if /i "%%#"=="r1" set r1=1
42if /i "%%#"=="r2" set r2=1
43if /i "%%#"=="-qedit" (
44reg add HKCU\Console /v QuickEdit /t REG_DWORD /d "1" /f 1>nul
45rem check the code below admin elevation to understand why it's here
46)
47)
48
49if exist %SystemRoot%\Sysnative\cmd.exe if not defined r1 (
50setlocal EnableDelayedExpansion
51start %SystemRoot%\Sysnative\cmd.exe /c ""!_cmdf!" %* r1"
52exit /b
53)
54
55:: Re-launch the script with ARM32 process if it was initiated by x64 process on ARM64 Windows
56
57if exist %SystemRoot%\SysArm32\cmd.exe if %PROCESSOR_ARCHITECTURE%==AMD64 if not defined r2 (
58setlocal EnableDelayedExpansion
59start %SystemRoot%\SysArm32\cmd.exe /c ""!_cmdf!" %* r2"
60exit /b
61)
62
63::========================================================================================================================================
64
65set "blank="
66set "mas=mass%blank%grave.dev"
67
68:: Check if Null service is working, it's important for the batch script
69
70sc query Null | find /i "RUNNING"
71if %errorlevel% NEQ 0 (
72echo:
73echo Null service is not running, script may crash...
74echo:
75echo:
76echo Help - https://%mas%/troubleshoot.html
77echo:
78echo:
79ping 127.0.0.1 -n 10
80)
81cls
82
83:: Check LF line ending
84
85pushd "%~dp0"
86>nul findstr /v "$" "%~nx0" && (
87echo:
88echo Error: Script either has LF line ending issue or an empty line at the end of the script is missing.
89echo:
90ping 127.0.0.1 -n 6 >nul
91popd
92exit /b
93)
94popd
95
96::========================================================================================================================================
97
98cls
99color 07
100title Ohook Activation
101
102set _args=
103set _elev=
104set _unattended=0
105
106set _args=%*
107if defined _args set _args=%_args:"=%
108if defined _args (
109for %%A in (%_args%) do (
110if /i "%%A"=="/Ohook" set _act=1
111if /i "%%A"=="/Ohook-Uninstall" set _rem=1
112if /i "%%A"=="-el" set _elev=1
113)
114)
115
116for %%A in (%_act% %_rem%) do (if "%%A"=="1" set _unattended=1)
117
118::========================================================================================================================================
119
120set "nul1=1>nul"
121set "nul2=2>nul"
122set "nul6=2^>nul"
123set "nul=>nul 2>&1"
124
125set psc=powershell.exe
126set winbuild=1
127for /f "tokens=6 delims=[]. " %%G in ('ver') do set winbuild=%%G
128
129set _NCS=1
130if %winbuild% LSS 10586 set _NCS=0
131if %winbuild% GEQ 10586 reg query "HKCU\Console" /v ForceV2 %nul2% | find /i "0x0" %nul1% && (set _NCS=0)
132
133if %_NCS% EQU 1 (
134for /F %%a in ('echo prompt $E ^| cmd') do set "esc=%%a"
135set "Red="41;97m""
136set "Gray="100;97m""
137set "Green="42;97m""
138set "Blue="44;97m""
139set "_White="40;37m""
140set "_Green="40;92m""
141set "_Yellow="40;93m""
142) else (
143set "Red="Red" "white""
144set "Gray="Darkgray" "white""
145set "Green="DarkGreen" "white""
146set "Blue="Blue" "white""
147set "_White="Black" "Gray""
148set "_Green="Black" "Green""
149set "_Yellow="Black" "Yellow""
150)
151
152set "nceline=echo: &echo ==== ERROR ==== &echo:"
153set "eline=echo: &call :dk_color %Red% "==== ERROR ====" &echo:"
154if %~z0 GEQ 200000 (
155set "_exitmsg=Go back"
156set "_fixmsg=Go back to Main Menu, select Troubleshoot and run Fix Licensing option."
157) else (
158set "_exitmsg=Exit"
159set "_fixmsg=In MAS folder, run Troubleshoot script and select Fix Licensing option."
160)
161
162::========================================================================================================================================
163
164if %winbuild% LSS 9200 (
165%eline%
166echo Unsupported OS version detected [%winbuild%].
167echo Ohook Activation is supported on Windows 8 and later and their server equivalent.
168goto dk_done
169)
170
171for %%# in (powershell.exe) do @if "%%~$PATH:#"=="" (
172%nceline%
173echo Unable to find powershell.exe in the system.
174goto dk_done
175)
176
177::========================================================================================================================================
178
179:: Fix for the special characters limitation in path name
180
181set "_work=%~dp0"
182if "%_work:~-1%"=="\" set "_work=%_work:~0,-1%"
183
184set "_batf=%~f0"
185set "_batp=%_batf:'=''%"
186
187set _PSarg="""%~f0""" -el %_args%
188
189set "_ttemp=%temp%"
190
191setlocal EnableDelayedExpansion
192
193::========================================================================================================================================
194
195echo "!_batf!" | find /i "!_ttemp!" %nul1% && (
196if /i not "!_work!"=="!_ttemp!" (
197%eline%
198echo Script is launched from the temp folder,
199echo Most likely you are running the script directly from the archive file.
200echo:
201echo Extract the archive file and launch the script from the extracted folder.
202goto dk_done
203)
204)
205
206::========================================================================================================================================
207
208:: Elevate script as admin and pass arguments and preventing loop
209
210%nul1% fltmc || (
211if not defined _elev %psc% "start cmd.exe -arg '/c \"!_PSarg:'=''!\"' -verb runas" && exit /b
212%eline%
213echo This script require admin privileges.
214echo To do so, right click on this script and select 'Run as administrator'.
215goto dk_done
216)
217
218::========================================================================================================================================
219
220:: This code disables QuickEdit for this cmd.exe session only without making permanent changes to the registry
221:: It is added because clicking on the script window pauses the operation and leads to the confusion that script stopped due to an error
222
223if %_unattended%==1 set quedit=1
224for %%# in (%_args%) do (if /i "%%#"=="-qedit" set quedit=1)
225
226reg query HKCU\Console /v QuickEdit %nul2% | find /i "0x0" %nul1% || if not defined quedit (
227reg add HKCU\Console /v QuickEdit /t REG_DWORD /d "0" /f %nul1%
228start cmd.exe /c ""!_batf!" %_args% -qedit"
229rem quickedit reset code is added at the starting of the script instead of here because it takes time to reflect in some cases
230exit /b
231)
232
233::========================================================================================================================================
234
235if %_rem%==1 goto :oh_uninstall
236
237:oh_menu
238
239if %_unattended%==0 (
240cls
241mode 76, 25
242title Ohook Activation
243
244echo:
245echo:
246echo:
247echo:
248echo ____________________________________________________________
249echo:
250echo [1] Install Ohook Office Activation
251echo:
252echo [2] Uninstall
253echo ____________________________________________
254echo:
255echo [3] Download Office
256echo:
257echo [0] %_exitmsg%
258echo ____________________________________________________________
259echo:
260call :dk_color2 %_White% " " %_Green% "Enter a menu option in the Keyboard [1,2,3,0]"
261choice /C:1230 /N
262set _el=!errorlevel!
263if !_el!==4 exit /b
264if !_el!==3 start https://%mas%/genuine-installation-media.html &goto :oh_menu
265if !_el!==2 goto :oh_uninstall
266if !_el!==1 goto :oh_menu2
267goto :oh_menu
268)
269
270::========================================================================================================================================
271
272:oh_menu2
273
274cls
275mode 128, 32
276%psc% "&{$W=$Host.UI.RawUI.WindowSize;$B=$Host.UI.RawUI.BufferSize;$W.Height=32;$B.Height=300;$Host.UI.RawUI.WindowSize=$W;$Host.UI.RawUI.BufferSize=$B;}"
277
278title Ohook Activation
279
280echo:
281echo Initializing...
282call :dk_product
283call :dk_ckeckwmic
284
285:: Show info for potential script stuck scenario
286
287sc start sppsvc %nul%
288if %errorlevel% NEQ 1056 if %errorlevel% NEQ 0 (
289echo:
290echo Error code: %errorlevel%
291call :dk_color %Red% "Failed to start [sppsvc] service, rest of the process may take a long time..."
292echo:
293)
294
295::========================================================================================================================================
296
297set error=
298
299cls
300echo:
301for /f "skip=2 tokens=2*" %%a in ('reg query "HKLM\SYSTEM\CurrentControlSet\Control\Session Manager\Environment" /v PROCESSOR_ARCHITECTURE') do set osarch=%%b
302for /f "tokens=6-7 delims=[]. " %%i in ('ver') do if "%%j"=="" (set fullbuild=%%i) else (set fullbuild=%%i.%%j)
303echo Checking OS Info [%winos% ^| %fullbuild% ^| %osarch%]
304
305::========================================================================================================================================
306
307:: Check Windows Script Host
308
309set _WSH=1
310reg query "HKCU\SOFTWARE\Microsoft\Windows Script Host\Settings" /v Enabled %nul2% | find /i "0x0" %nul1% && (set _WSH=0)
311reg query "HKLM\SOFTWARE\Microsoft\Windows Script Host\Settings" /v Enabled %nul2% | find /i "0x0" %nul1% && (set _WSH=0)
312
313if %_WSH% EQU 0 (
314reg add "HKLM\Software\Microsoft\Windows Script Host\Settings" /v Enabled /t REG_DWORD /d 1 /f %nul%
315reg add "HKCU\Software\Microsoft\Windows Script Host\Settings" /v Enabled /t REG_DWORD /d 1 /f %nul%
316if not "%arch%"=="x86" reg add "HKLM\Software\Microsoft\Windows Script Host\Settings" /v Enabled /t REG_DWORD /d 1 /f /reg:32 %nul%
317echo Enabling Windows Script Host [Successful]
318)
319
320::========================================================================================================================================
321
322echo Initiating Diagnostic Tests...
323
324set "_serv=sppsvc Winmgmt"
325set officeact=1
326call :dk_errorcheck
327
328:: Check unsupported office versions
329
330set o14msi=
331set o14c2r=
332set o16uwp=
333
334set _68=HKLM\SOFTWARE\Microsoft\Office
335set _86=HKLM\SOFTWARE\Wow6432Node\Microsoft\Office
336%nul% reg query %_68%\14.0\Common\InstallRoot /v Path && set o14msi=Office 2010 MSI
337%nul% reg query %_86%\14.0\Common\InstallRoot /v Path && set o14msi=Office 2010 MSI
338%nul% reg query %_68%\14.0\CVH /f Click2run /k && set o14c2r=Office 2010 C2R
339%nul% reg query %_86%\14.0\CVH /f Click2run /k && set o14c2r=Office 2010 C2R
340
341if %winbuild% GEQ 10240 %psc% "Get-AppxPackage -name "Microsoft.Office.Desktop"" | find /i "Office" %nul1% && set o16uwp=Office UWP
342
343if not "%o14msi%%o14c2r%%o16uwp%"=="" (
344echo:
345set error=1
346call :dk_color %Red% "Checking Unsupported Office Install [ %o14msi%%o14c2r%%o16uwp%]"
347)
348
349::========================================================================================================================================
350
351:: Check supported office versions
352
353call :oh_getpath
354
355sc query ClickToRunSvc %nul%
356set error1=%errorlevel%
357
358if defined o16c2r if %error1% EQU 1060 (
359call :dk_color %Red% "Checking ClickToRun Service [Not found, Office 16.0 files found]"
360set o16c2r=
361set error=1
362)
363
364sc query OfficeSvc %nul%
365set error2=%errorlevel%
366
367if defined o15c2r if %error1% EQU 1060 if %error2% EQU 1060 (
368call :dk_color %Red% "Checking ClickToRun Service [Not found, Office 15.0 files found]"
369set o15c2r=
370set error=1
371)
372
373if "%o16c2r%%o15c2r%%o16msi%%o15msi%"=="" (
374set error=1
375echo:
376if not "%o14msi%%o14c2r%%o16uwp%"=="" (
377call :dk_color %Red% "Checking Supported Office Install [Not Found]"
378) else (
379call :dk_color %Red% "Checking Installed Office [Not Found]"
380)
381
382if %winbuild% GEQ 10240 %psc% "Get-AppxPackage -name "Microsoft.MicrosoftOfficeHub"" | find /i "Office" %nul1% && (
383echo:
384echo You have only Office dashboard app installed, you need to install full Office version.
385)
386echo:
387call :dk_color %Blue% "Download and install Office from below URL and try again."
388echo:
389echo https://%mas%/genuine-installation-media.html
390goto dk_done
391)
392
393set multioffice=
394if not "%o16c2r%%o15c2r%%o16msi%%o15msi%"=="1" set multioffice=1
395if not "%o14msi%%o14c2r%%o16uwp%"=="" set multioffice=1
396
397if defined multioffice (
398call :dk_color %Gray% "Checking Multiple Office Install [Found. Its best to install only one version]"
399)
400
401::========================================================================================================================================
402
403:: Process Office 15.0 C2R
404
405if not defined o15c2r goto :starto16c2r
406
407call :oh_reset
408call :oh_actids
409
410set oVer=15
411for /f "skip=2 tokens=2*" %%a in ('"reg query %o15c2r_reg% /v InstallPath" %nul6%') do (set "_oRoot=%%b\root")
412for /f "skip=2 tokens=2*" %%a in ('"reg query %o15c2r_reg%\Configuration /v Platform" %nul6%') do (set "_oArch=%%b")
413if not defined _oArch for /f "skip=2 tokens=2*" %%a in ('"reg query %o15c2r_reg%\propertyBag /v Platform" %nul6%') do (set "_oArch=%%b")
414
415echo "%o15c2r_reg%" | find /i "Wow6432Node" %nul1% && (set _tok=10) || (set _tok=9)
416for /f "tokens=%_tok% delims=\" %%a in ('reg query %o15c2r_reg%\ProductReleaseIDs\Active %nul6% ^| findstr /i "Retail Volume"') do (
417if not defined _oIds (set "_oIds=%%a") else (set "_oIds=!_oIds! %%a")
418)
419
420set "_oLPath=%_oRoot%\Licenses"
421
422if [%_oArch%]==[x64] (set "_hookPath=%_oRoot%\vfs\System" & set "_hook=sppc64.dll")
423if [%_oArch%]==[x86] (set "_hookPath=%_oRoot%\vfs\SystemX86" & set "_hook=sppc32.dll")
424if not [%osarch%]==[x86] (
425if [%_oArch%]==[x64] set "_sppcPath=%SystemRoot%\System32\sppc.dll"
426if [%_oArch%]==[x86] set "_sppcPath=%SystemRoot%\SysWOW64\sppc.dll"
427) else (
428set "_sppcPath=%SystemRoot%\System32\sppc.dll"
429)
430
431echo:
432echo Activating Office 15.0 %_oArch% C2R...
433
434if not defined _oIds (
435call :dk_color %Red% "Checking Installed Products [Product IDs not found. Aborting activation...]"
436set error=1
437goto :starto16c2r
438)
439
440call :oh_process
441call :oh_hookinstall
442
443::========================================================================================================================================
444
445:starto16c2r
446
447:: Process Office 16.0 C2R
448
449if not defined o16c2r goto :startmsi
450
451call :oh_reset
452call :oh_actids
453
454set oVer=16
455for /f "skip=2 tokens=2*" %%a in ('"reg query %o16c2r_reg% /v InstallPath" %nul6%') do (set "_oRoot=%%b\root")
456for /f "skip=2 tokens=2*" %%a in ('"reg query %o16c2r_reg%\Configuration /v Platform" %nul6%') do (set "_oArch=%%b")
457
458echo "%o16c2r_reg%" | find /i "Wow6432Node" %nul1% && (set _tok=9) || (set _tok=8)
459for /f "tokens=%_tok% delims=\" %%a in ('reg query "%o16c2r_reg%\ProductReleaseIDs" /s /f ".16" /k %nul6% ^| findstr /i "Retail Volume"') do (
460if not defined _oIds (set "_oIds=%%a") else (set "_oIds=!_oIds! %%a")
461)
462set _oIds=%_oIds:.16=%
463
464set "_oLPath=%_oRoot%\Licenses16"
465
466if [%_oArch%]==[x64] (set "_hookPath=%_oRoot%\vfs\System" & set "_hook=sppc64.dll")
467if [%_oArch%]==[x86] (set "_hookPath=%_oRoot%\vfs\SystemX86" & set "_hook=sppc32.dll")
468if not [%osarch%]==[x86] (
469if [%_oArch%]==[x64] set "_sppcPath=%SystemRoot%\System32\sppc.dll"
470if [%_oArch%]==[x86] set "_sppcPath=%SystemRoot%\SysWOW64\sppc.dll"
471) else (
472set "_sppcPath=%SystemRoot%\System32\sppc.dll"
473)
474
475echo:
476echo Activating Office 16.0 %_oArch% C2R...
477
478if not defined _oIds (
479call :dk_color %Red% "Checking Installed Products [Product IDs not found. Aborting activation...]"
480set error=1
481goto :startmsi
482)
483
484call :oh_process
485call :oh_hookinstall
486
487::========================================================================================================================================
488
489:: Find remnants of Office vNext license block and remove it because it stops non vNext licenses from appearing
490
491set sub_next=
492set kNext=HKCU\SOFTWARE\Microsoft\Office\16.0\Common\Licensing
493
494reg query %kNext%\LicensingNext /v MigrationToV5Done %nul2% | find /i "0x1" %nul% && (
495reg query %kNext%\LicensingNext %nul2% | findstr /i "volume retail" %nul2% | findstr /i "0x2 0x3" %nul% && (
496set sub_next=1
497reg delete %kNext% /f %nul%
498)
499)
500
501if defined sub_next (
502reg query %kNext%\LicensingNext %nul% && (
503call :dk_color %Red% "Removing Office vNext Block [Failed]"
504) || (
505echo Removing Office vNext Block [Successful]
506)
507)
508
509::========================================================================================================================================
510
511:: O365 products attempt to validate the license and may show a banner "There was a problem checking this device's license status.", other products don't do that.
512:: A simple registry entry can skip this check
513
514echo "%_lic%" | find /i "Subscription" %nul% && (
515echo Adding a Reg To Skip License Check [Successful]
516reg add HKCU\Software\Microsoft\Office\16.0\Common\Licensing\Resiliency /v "TimeOfLastHeartbeatFailure" /t REG_SZ /d "2033-08-18T22:18:45Z" /f %nul%
517)
518
519::========================================================================================================================================
520
521:: mass grave[.]dev/office-license-is-not-genuine.html
522:: Add registry keys for volume products so that 'non-genuine' banner won't appear
523:: Script already is using MAK instead of GVLK so it won't appear anyway, but registry keys are added incase Office installs default GVLK grace key for volume products
524
525echo "%_oIds%" | find /i "Volume" %nul1% && (
526if %winbuild% GEQ 9200 (
527if not [%osarch%]==[x86] (
528reg delete "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\SoftwareProtectionPlatform\0ff1ce15-a989-479d-af46-f275c6370663" /f /reg:32 %nul%
529reg add "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\SoftwareProtectionPlatform\0ff1ce15-a989-479d-af46-f275c6370663" /f /v KeyManagementServiceName /t REG_SZ /d "10.0.0.10" /reg:32 %nul%
530)
531reg delete "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\SoftwareProtectionPlatform\0ff1ce15-a989-479d-af46-f275c6370663" /f %nul%
532reg add "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\SoftwareProtectionPlatform\0ff1ce15-a989-479d-af46-f275c6370663" /f /v KeyManagementServiceName /t REG_SZ /d "10.0.0.10" %nul%
533echo Adding a Reg To Prevent Banner [Successful]
534)
535)
536
537::========================================================================================================================================
538
539:startmsi
540
541if defined o15msi call :oh_processmsi 15 %o15msi_reg%
542if defined o16msi call :oh_processmsi 16 %o16msi_reg%
543
544::========================================================================================================================================
545
546:: Uninstall other / grace Keys
547
548set upk_result=0
549set allapplist=
550
551if %_wmic% EQU 1 set "chkapp=for /f "tokens=2 delims==" %%a in ('"wmic path SoftwareLicensingProduct where (ApplicationID='0ff1ce15-a989-479d-af46-f275c6370663' and PartialProductKey is not null) get ID /VALUE" %nul6%')"
552if %_wmic% EQU 0 set "chkapp=for /f "tokens=2 delims==" %%a in ('%psc% "(([WMISEARCHER]'SELECT ID FROM SoftwareLicensingProduct WHERE ApplicationID=''0ff1ce15-a989-479d-af46-f275c6370663'' AND PartialProductKey IS NOT NULL').Get()).ID ^| %% {echo ('ID='+$_)}" %nul6%')"
553%chkapp% do (if defined allapplist (call set "allapplist=!allapplist! %%a") else (call set "allapplist=%%a"))
554
555for %%# in (%allapplist%) do (
556echo "%_allactid%" | find /i "%%#" %nul1% || (
557cscript //nologo %windir%\system32\slmgr.vbs /upk %%# %nul% && (
558set upk_result=1
559) || (
560set error=1
561set upk_result=2
562)
563)
564)
565
566if not %upk_result%==0 echo:
567if %upk_result%==1 echo Uninstalling Other/Grace Keys [Successful]
568if %upk_result%==2 call :dk_color %Red% "Uninstalling Other/Grace Keys [Failed]"
569
570::========================================================================================================================================
571
572:: Refresh Windows Insider Preview Licenses
573:: It required in Insider versions otherwise office may not activate
574
575if exist "%windir%\system32\spp\store_test\2.0\tokens.dat" (
576cscript //nologo %windir%\system32\slmgr.vbs /rilc %nul%
577if !errorlevel! NEQ 0 cscript //nologo %windir%\system32\slmgr.vbs /rilc %nul%
578)
579
580::========================================================================================================================================
581
582echo:
583if not defined error (
584call :dk_color %Green% "Office is permanently activated."
585echo Help: https://%mas%/troubleshoot
586) else (
587call :dk_color %Red% "Some errors were detected."
588if not defined ierror if not defined showfix if not defined serv_cor if not defined serv_cste call :dk_color %Blue% "%_fixmsg%"
589echo:
590call :dk_color2 %Blue% "Check this page for help" %_Yellow% " https://%mas%/troubleshoot"
591)
592
593goto :dk_done
594
595::========================================================================================================================================
596
597:oh_uninstall
598
599cls
600mode 99, 28
601title Uninstall Ohook Activation
602
603set _present=
604set _unerror=
605call :oh_reset
606call :oh_getpath
607
608echo:
609echo Uninstalling Ohook Activation...
610echo:
611
612if defined o16c2r_reg (for /f "skip=2 tokens=2*" %%a in ('"reg query %o16c2r_reg% /v InstallPath" %nul6%') do (set "_16CHook=%%b\root\vfs"))
613if defined o15c2r_reg (for /f "skip=2 tokens=2*" %%a in ('"reg query %o15c2r_reg% /v InstallPath" %nul6%') do (set "_15CHook=%%b\root\vfs"))
614if defined o16msi_reg (for /f "skip=2 tokens=2*" %%a in ('"reg query %o16msi_reg%\Common\InstallRoot /v Path" %nul6%') do (set "_16MHook=%%b"))
615if defined o15msi_reg (for /f "skip=2 tokens=2*" %%a in ('"reg query %o15msi_reg%\Common\InstallRoot /v Path" %nul6%') do (set "_15MHook=%%b"))
616
617if defined _16CHook (if exist "%_16CHook%\System\sppc*dll" (set _present=1& del /s /f /q "%_16CHook%\System\sppc*dll" & if exist "%_16CHook%\System\sppc*dll" set _unerror=1))
618if defined _16CHook (if exist "%_16CHook%\SystemX86\sppc*dll" (set _present=1& del /s /f /q "%_16CHook%\SystemX86\sppc*dll" & if exist "%_16CHook%\SystemX86\sppc*dll" set _unerror=1))
619if defined _15CHook (if exist "%_15CHook%\System\sppc*dll" (set _present=1& del /s /f /q "%_15CHook%\System\sppc*dll" & if exist "%_15CHook%\System\sppc*dll" set _unerror=1))
620if defined _15CHook (if exist "%_15CHook%\SystemX86\sppc*dll" (set _present=1& del /s /f /q "%_15CHook%\SystemX86\sppc*dll" & if exist "%_15CHook%\SystemX86\sppc*dll" set _unerror=1))
621if defined _16MHook (if exist "%_16MHook%sppc*dll" (set _present=1& del /s /f /q "%_16MHook%sppc*dll" & if exist "%_16MHook%sppc*dll" set _unerror=1))
622if defined _15MHook (if exist "%_15MHook%sppc*dll" (set _present=1& del /s /f /q "%_15MHook%sppc*dll" & if exist "%_15MHook%sppc*dll" set _unerror=1))
623
624for %%# in (15 16) do (
625for %%A in ("%ProgramFiles%" "%ProgramW6432%" "%ProgramFiles(x86)%") do (
626if exist "%%~A\Microsoft Office\Office%%#\sppc*dll" (set _present=1& del /s /f /q "%%~A\Microsoft Office\Office%%#\sppc*dll" & if exist "%%~A\Microsoft Office\Office%%#\sppc*dll" set _unerror=1)
627)
628)
629
630for %%# in (System SystemX86) do (
631for %%G in ("Office 15" "Office") do (
632for %%A in ("%ProgramFiles%" "%ProgramW6432%" "%ProgramFiles(x86)%") do (
633if exist "%%~A\Microsoft %%~G\root\vfs\%%#\sppc*dll" (set _present=1& del /s /f /q "%%~A\Microsoft %%~G\root\vfs\%%#\sppc*dll" & if exist "%%~A\Microsoft %%~G\root\vfs\%%#\sppc*dll" set _unerror=1)
634)
635)
636)
637
638reg query HKCU\Software\Microsoft\Office\16.0\Common\Licensing\Resiliency /s %nul2% | find /i "2033" %nul% && (
639echo:
640echo Deleting - HKCU\Software\Microsoft\Office\16.0\Common\Licensing\Resiliency
641reg delete HKCU\Software\Microsoft\Office\16.0\Common\Licensing\Resiliency /f
642)
643
644reg query "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\SoftwareProtectionPlatform\0ff1ce15-a989-479d-af46-f275c6370663" %nul% && (
645echo:
646echo Deleting - Registry key to prevent non-genuine banner
647reg delete "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\SoftwareProtectionPlatform\0ff1ce15-a989-479d-af46-f275c6370663" /f
648)
649
650reg query "HKLM\SOFTWARE\Wow6432Node\Microsoft\Windows NT\CurrentVersion\SoftwareProtectionPlatform\0ff1ce15-a989-479d-af46-f275c6370663" %nul% && (
651reg delete "HKLM\SOFTWARE\Wow6432Node\Microsoft\Windows NT\CurrentVersion\SoftwareProtectionPlatform\0ff1ce15-a989-479d-af46-f275c6370663" /f
652)
653
654echo __________________________________________________________________________________________
655echo:
656
657if not defined _present (
658echo Ohook Activation is not installed.
659) else (
660if defined _unerror (
661call :dk_color %Red% "Failed to uninstall Ohook activation."
662call :dk_color %Blue% "Close Office apps if they are running and try again."
663) else (
664call :dk_color %Green% "Successfully uninstalled Ohook activation."
665)
666)
667echo __________________________________________________________________________________________
668
669goto :dk_done
670
671::========================================================================================================================================
672
673:oh_reset
674
675set _oRoot=
676set _oArch=
677set _oIds=
678set _oLPath=
679set _hookPath=
680set _hook=
681set _sppcPath=
682set _key=
683set _actid=
684set _prod=
685set _lic=
686set _License=
687exit /b
688
689::========================================================================================================================================
690
691:oh_getpath
692
693set o16c2r=
694set o15c2r=
695set o16msi=
696set o15msi=
697
698set _68=HKLM\SOFTWARE\Microsoft\Office
699set _86=HKLM\SOFTWARE\Wow6432Node\Microsoft\Office
700
701for /f "skip=2 tokens=2*" %%a in ('"reg query %_86%\ClickToRun /v InstallPath" %nul6%') do if exist "%%b\root\Licenses16\ProPlus*.xrm-ms" (set o16c2r=1&set o16c2r_reg=%_86%\ClickToRun)
702for /f "skip=2 tokens=2*" %%a in ('"reg query %_68%\ClickToRun /v InstallPath" %nul6%') do if exist "%%b\root\Licenses16\ProPlus*.xrm-ms" (set o16c2r=1&set o16c2r_reg=%_68%\ClickToRun)
703for /f "skip=2 tokens=2*" %%a in ('"reg query %_86%\15.0\ClickToRun /v InstallPath" %nul6%') do if exist "%%b\root\Licenses\ProPlus*.xrm-ms" (set o15c2r=1&set o15c2r_reg=%_86%\15.0\ClickToRun)
704for /f "skip=2 tokens=2*" %%a in ('"reg query %_68%\15.0\ClickToRun /v InstallPath" %nul6%') do if exist "%%b\root\Licenses\ProPlus*.xrm-ms" (set o15c2r=1&set o15c2r_reg=%_68%\15.0\ClickToRun)
705
706for /f "skip=2 tokens=2*" %%a in ('"reg query %_86%\16.0\Common\InstallRoot /v Path" %nul6%') do if exist "%%b\OSPP.VBS" (set o16msi=1&set o16msi_reg=%_86%\16.0)
707for /f "skip=2 tokens=2*" %%a in ('"reg query %_68%\16.0\Common\InstallRoot /v Path" %nul6%') do if exist "%%b\OSPP.VBS" (set o16msi=1&set o16msi_reg=%_68%\16.0)
708for /f "skip=2 tokens=2*" %%a in ('"reg query %_86%\15.0\Common\InstallRoot /v Path" %nul6%') do if exist "%%b\OSPP.VBS" (set o15msi=1&set o15msi_reg=%_86%\15.0)
709for /f "skip=2 tokens=2*" %%a in ('"reg query %_68%\15.0\Common\InstallRoot /v Path" %nul6%') do if exist "%%b\OSPP.VBS" (set o15msi=1&set o15msi_reg=%_68%\15.0)
710
711exit /b
712
713::========================================================================================================================================
714
715:oh_installkey
716
717if %_wmic% EQU 1 wmic path SoftwareLicensingService where __CLASS='SoftwareLicensingService' call InstallProductKey ProductKey="%_key%" %nul%
718if %_wmic% EQU 0 %psc% "(([WMISEARCHER]'SELECT Version FROM SoftwareLicensingService').Get()).InstallProductKey('%_key%')" %nul%
719if not %errorlevel%==0 cscript //nologo %windir%\system32\slmgr.vbs /ipk %_key% %nul%
720set errorcode=%errorlevel%
721cmd /c exit /b %errorcode%
722if %errorcode% NEQ 0 set "errorcode=[0x%=ExitCode%]"
723
724if %errorcode% EQU 0 (
725call :dk_refresh
726echo Installing Generic Product Key [%_key%] [%_prod%] [%_lic%] [Successful]
727) else (
728call :dk_color %Red% "Installing Generic Product Key [%_key%] [%_prod%] [%_lic%] [Failed] %errorcode%"
729if not defined error (
730call :dk_color %Blue% "%_fixmsg%"
731set showfix=1
732)
733set error=1
734)
735
736exit /b
737
738::========================================================================================================================================
739
740:oh_installlic
741
742if not defined _oLPath exit /b
743
744set _License=%_prod:Retail=R_%
745set _License=%_License:Volume=VL_%
746
747for %%# in ("!_oLPath!\client-issuance-*.xrm-ms") do (
748cscript //nologo %windir%\system32\slmgr.vbs /ilc "!_oLPath!\%%~nx#" %nul%
749)
750cscript //nologo %windir%\system32\slmgr.vbs /ilc "!_oLPath!\pkeyconfig-office.xrm-ms" %nul%
751
752for %%# in ("!_oLPath!\%_License%*.xrm-ms") do (
753cscript //nologo %windir%\system32\slmgr.vbs /ilc "!_oLPath!\%%~nx#" %nul%
754)
755
756call :oh_actids
757
758echo "!oapplist!" | find /i "!_actid!" %nul1% && (
759call :dk_color %Gray% "Installing Missing License Files [Office %oVer%.0 %_prod%] [Successful]"
760) || (
761set error=1
762call :dk_color %Red% "Installing Missing License Files [Office %oVer%.0 %_prod%] [Failed]"
763)
764
765exit /b
766
767::========================================================================================================================================
768
769:oh_hookinstall
770
771set ierror=
772set hasherror=
773
774del /s /q "%_hookPath%\sppcs.dll" %nul%
775del /s /q "%_hookPath%\sppc.dll" %nul%
776
777if exist "%_hookPath%\sppcs.dll" set ierror=1
778if exist "%_hookPath%\sppc.dll" set ierror=1
779
780mklink "%_hookPath%\sppcs.dll" "%_sppcPath%" %nul%
781if not %errorlevel%==0 set ierror=1
782
783if not exist "%_hookPath%\sppc.dll" call :oh_extractdll "%_hookPath%\sppc.dll"
784if not exist "%_hookPath%\sppc.dll" set ierror=1
785
786echo:
787if not defined ierror (
788echo Symlinking System's sppc.dll To ["%_hookPath%\sppcs.dll"] [Successful]
789echo Extracting Custom %_hook% To ["%_hookPath%\sppc.dll"] [Successful]
790) else (
791set error=1
792call :dk_color %Red% "Symlinking Systems sppc.dll [Failed]"
793call :dk_color %Red% "Extracting Custom %_hook% [Failed]"
794echo ["%_hookPath%\sppc.dll"]
795call :dk_color %Blue% "Close Office apps if they are running and try again."
796)
797
798if not defined ierror (
799if defined hasherror (
800set error=1
801set ierror=1
802call :dk_color %Red% "Modifying Hash of Custom %_hook% [Failed]"
803) else (
804echo Modifying Hash of Custom %_hook% [Successful]
805)
806)
807
808exit /b
809
810::========================================================================================================================================
811
812:oh_process
813
814for %%# in (%_oIds%) do (
815set _key=
816set _actid=
817set _lic=
818set _prod=%%#
819
820call :ohookdata getinfo %%#
821
822if not [!_key!]==[] (
823echo "!oapplist!" | find /i "!_actid!" %nul1% || call :oh_installlic
824call :oh_installkey
825) else (
826set error=1
827call :dk_color %Red% "Checking Product In Script [Office %oVer%.0 %%# not found in script]"
828echo Make sure you are using Latest MAS script.
829)
830)
831
832exit /b
833
834::========================================================================================================================================
835
836:oh_msiproducts
837
838set msitemp=%SystemRoot%\Temp\_msitemp.txt
839
840if %oVer%==15 set _psmsikey=%o15msi_reg:HKLM\=HKLM:%
841if %oVer%==16 set _psmsikey=%o16msi_reg:HKLM\=HKLM:%
842
843if exist %msitemp% del /f /q %msitemp%
844%psc% "$Key = '%_psmsikey%\Registration\{*FF1CE}'; $keydata = Get-ItemProperty -Path $Key -Name "DigitalProductID"; $binaryData = $keydata."DigitalProductID"; $stringData = [System.Text.Encoding]::Unicode.GetString($binaryData);$stringData" >>%msitemp%
845
846if exist %msitemp% call :ohookdata getmsiprod
847if exist %msitemp% del /f /q %msitemp%
848
849exit /b
850
851::========================================================================================================================================
852
853:oh_processmsi
854
855:: Process Office MSI Version
856
857call :oh_reset
858call :oh_actids
859
860set oVer=%1
861for /f "skip=2 tokens=2*" %%a in ('"reg query %2\Common\InstallRoot /v Path" %nul6%') do (set "_oRoot=%%b")
862if "%_oRoot:~-1%"=="\" set "_oRoot=%_oRoot:~0,-1%"
863
864echo "%2" | find /i "Wow6432Node" %nul1% && set _oArch=x86
865if not [%osarch%]==[x86] if not defined _oArch set _oArch=x64
866if [%osarch%]==[x86] set _oArch=x86
867
868if [%_oArch%]==[x64] (set "_hookPath=%_oRoot%" & set "_hook=sppc64.dll")
869if [%_oArch%]==[x86] (set "_hookPath=%_oRoot%" & set "_hook=sppc32.dll")
870if not [%osarch%]==[x86] (
871if [%_oArch%]==[x64] set "_sppcPath=%SystemRoot%\System32\sppc.dll"
872if [%_oArch%]==[x86] set "_sppcPath=%SystemRoot%\SysWOW64\sppc.dll"
873) else (
874set "_sppcPath=%SystemRoot%\System32\sppc.dll"
875)
876
877call :oh_msiproducts
878
879echo:
880echo Activating Office %1.0 %_oArch% MSI...
881
882if not defined _oIds (
883set error=1
884call :dk_color %Red% "Checking Installed Products [Product IDs not found. Aborting activation...]"
885exit /b
886)
887
888call :oh_process
889call :oh_hookinstall
890
891exit /b
892
893::========================================================================================================================================
894
895:: Refresh license status
896
897:dk_refresh
898
899if %_wmic% EQU 1 wmic path SoftwareLicensingService where __CLASS='SoftwareLicensingService' call RefreshLicenseStatus %nul%
900if %_wmic% EQU 0 %psc% "$null=(([WMICLASS]'SoftwareLicensingService').GetInstances()).RefreshLicenseStatus()" %nul%
901exit /b
902
903:: Get Windows Activation IDs
904
905:dk_actids
906
907set applist=
908if %_wmic% EQU 1 set "chkapp=for /f "tokens=2 delims==" %%a in ('"wmic path SoftwareLicensingProduct where (ApplicationID='55c92734-d682-4d71-983e-d6ec3f16059f') get ID /VALUE" %nul6%')"
909if %_wmic% EQU 0 set "chkapp=for /f "tokens=2 delims==" %%a in ('%psc% "(([WMISEARCHER]'SELECT ID FROM SoftwareLicensingProduct WHERE ApplicationID=''55c92734-d682-4d71-983e-d6ec3f16059f''').Get()).ID ^| %% {echo ('ID='+$_)}" %nul6%')"
910%chkapp% do (if defined applist (call set "applist=!applist! %%a") else (call set "applist=%%a"))
911exit /b
912
913:: Get Office Activation IDs
914
915:oh_actids
916
917set oapplist=
918if %_wmic% EQU 1 set "chkapp=for /f "tokens=2 delims==" %%a in ('"wmic path SoftwareLicensingProduct where (ApplicationID='0ff1ce15-a989-479d-af46-f275c6370663') get ID /VALUE" %nul6%')"
919if %_wmic% EQU 0 set "chkapp=for /f "tokens=2 delims==" %%a in ('%psc% "(([WMISEARCHER]'SELECT ID FROM SoftwareLicensingProduct WHERE ApplicationID=''0ff1ce15-a989-479d-af46-f275c6370663''').Get()).ID ^| %% {echo ('ID='+$_)}" %nul6%')"
920%chkapp% do (if defined oapplist (call set "oapplist=!oapplist! %%a") else (call set "oapplist=%%a"))
921exit /b
922
923:: Check wmic.exe
924
925:dk_ckeckwmic
926
927set _wmic=0
928for %%# in (wmic.exe) do @if not "%%~$PATH:#"=="" (
929wmic path Win32_ComputerSystem get CreationClassName /value %nul2% | find /i "computersystem" %nul1% && set _wmic=1
930)
931exit /b
932
933:: Get Product name (WMI/REG methods are not reliable in all conditions, hence winbrand.dll method is used)
934
935:dk_product
936
937call :dk_reflection
938
939set d1=%ref% $meth = $TypeBuilder.DefinePInvokeMethod('BrandingFormatString', 'winbrand.dll', 'Public, Static', 1, [String], @([String]), 1, 3);
940set d1=%d1% $meth.SetImplementationFlags(128); $TypeBuilder.CreateType()::BrandingFormatString('%%WINDOWS_LONG%%')
941
942set winos=
943for /f "delims=" %%s in ('"%psc% %d1%"') do if not errorlevel 1 (set winos=%%s)
944echo "%winos%" | find /i "Windows" %nul1% || (
945for /f "skip=2 tokens=2*" %%a in ('reg query "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion" /v ProductName %nul6%') do set "winos=%%b"
946if %winbuild% GEQ 22000 (
947set winos=!winos:Windows 10=Windows 11!
948)
949)
950exit /b
951
952:: Common lines used in PowerShell reflection code
953
954:dk_reflection
955
956set ref=$AssemblyBuilder = [AppDomain]::CurrentDomain.DefineDynamicAssembly(4, 1);
957set ref=%ref% $ModuleBuilder = $AssemblyBuilder.DefineDynamicModule(2, $False);
958set ref=%ref% $TypeBuilder = $ModuleBuilder.DefineType(0);
959exit /b
960
961::========================================================================================================================================
962
963:dk_errorcheck
964
965set showfix=
966
967:: Check corrupt services
968
969set serv_cor=
970for %%# in (%_serv%) do (
971set _corrupt=
972sc start %%# %nul%
973if !errorlevel! EQU 1060 set _corrupt=1
974sc query %%# %nul% || set _corrupt=1
975for %%G in (DependOnService Description DisplayName ErrorControl ImagePath ObjectName Start Type) do if not defined _corrupt (reg query HKLM\SYSTEM\CurrentControlSet\Services\%%# /v %%G %nul% || set _corrupt=1)
976if defined _corrupt (if defined serv_cor (set "serv_cor=!serv_cor! %%#") else (set "serv_cor=%%#"))
977)
978
979if defined serv_cor (
980set error=1
981call :dk_color %Red% "Checking Corrupt Services [%serv_cor%]"
982)
983
984::========================================================================================================================================
985
986:: Check disabled services
987
988set serv_ste=
989for %%# in (%_serv%) do (
990sc start %%# %nul%
991if !errorlevel! EQU 1058 (if defined serv_ste (set "serv_ste=!serv_ste! %%#") else (set "serv_ste=%%#"))
992)
993
994:: Change disabled services startup type to default
995
996set serv_csts=
997set serv_cste=
998
999if defined serv_ste (
1000for %%# in (%serv_ste%) do (
1001if /i %%#==ClipSVC (reg add "HKLM\SYSTEM\CurrentControlSet\Services\%%#" /v "Start" /t REG_DWORD /d "3" /f %nul% & sc config %%# start= demand %nul%)
1002if /i %%#==wlidsvc sc config %%# start= demand %nul%
1003if /i %%#==sppsvc (reg add "HKLM\SYSTEM\CurrentControlSet\Services\%%#" /v "Start" /t REG_DWORD /d "2" /f %nul% & sc config %%# start= delayed-auto %nul%)
1004if /i %%#==KeyIso sc config %%# start= demand %nul%
1005if /i %%#==LicenseManager sc config %%# start= demand %nul%
1006if /i %%#==Winmgmt sc config %%# start= auto %nul%
1007if /i %%#==wuauserv sc config %%# start= demand %nul%
1008if !errorlevel!==0 (
1009if defined serv_csts (set "serv_csts=!serv_csts! %%#") else (set "serv_csts=%%#")
1010) else (
1011if defined serv_cste (set "serv_cste=!serv_cste! %%#") else (set "serv_cste=%%#")
1012)
1013)
1014)
1015
1016if defined serv_csts call :dk_color %Gray% "Enabling Disabled Services [Successful] [%serv_csts%]"
1017
1018if defined serv_cste (
1019set error=1
1020call :dk_color %Red% "Enabling Disabled Services [Failed] [%serv_cste%]"
1021)
1022
1023::========================================================================================================================================
1024
1025:: Check if the services are able to run or not
1026:: Workarounds are added to get correct status and error code because sc query doesn't output correct results in some conditions
1027
1028set serv_e=
1029for %%# in (%_serv%) do (
1030set errorcode=
1031set checkerror=
1032net start %%# /y %nul%
1033set errorcode=!errorlevel!
1034sc query %%# | find /i "RUNNING" %nul% || set checkerror=1
1035
1036sc start %%# %nul%
1037if !errorlevel! NEQ 1056 if !errorlevel! NEQ 0 (set errorcode=!errorlevel!&set checkerror=1)
1038if defined checkerror if defined serv_e (set "serv_e=!serv_e!, %%#-!errorcode!") else (set "serv_e=%%#-!errorcode!")
1039)
1040
1041if defined serv_e (
1042set error=1
1043call :dk_color %Red% "Starting Services [Failed] [%serv_e%]"
1044echo %serv_e% | findstr /i "ClipSVC-1058 sppsvc-1058" %nul% && (
1045call :dk_color %Blue% "Restart the system to fix disabled service error 1058."
1046set showfix=1
1047)
1048)
1049
1050::========================================================================================================================================
1051
1052:: Various error checks
1053
1054if defined safeboot_option (
1055set error=1
1056set showfix=1
1057call :dk_color2 %Red% "Checking Boot Mode " %Blue% "[System is running in safe mode. Run in normal mode.]"
1058)
1059
1060
1061reg query "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Setup\State" %nul2% | find /i "IMAGE_STATE_COMPLETE" %nul1% || (
1062set error=1
1063set showfix=1
1064call :dk_color2 %Red% "Checking Audit Mode " %Blue% "[IMAGE_STATE_COMPLETE status not found. Run in normal mode.]"
1065)
1066
1067
1068reg query "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\WinPE" /v InstRoot %nul% && (
1069set error=1
1070set showfix=1
1071call :dk_color2 %Red% "Checking WinPE " %Blue% "[System is running in WinPE mode. Run in normal mode.]"
1072)
1073
1074
1075%psc% $ExecutionContext.SessionState.LanguageMode %nul2% | find /i "Full" %nul1% || (
1076set error=1
1077call :dk_color %Red% "Checking Powershell [Not Responding]"
1078)
1079
1080
1081DISM /English /Online /Get-CurrentEdition %nul%
1082set dism_error=%errorlevel%
1083cmd /c exit /b %dism_error%
1084if %dism_error% NEQ 0 set "dism_error=[0x%=ExitCode%]"
1085if %dism_error% NEQ 0 (
1086call :dk_color %Red% "Checking DISM [Not Responding] %dism_error%"
1087)
1088
1089
1090cscript //nologo %windir%\system32\slmgr.vbs /dlv %nul%
1091set error_code=%errorlevel%
1092cmd /c exit /b %error_code%
1093if %error_code% NEQ 0 set "error_code=0x%=ExitCode%"
1094if %error_code% NEQ 0 (
1095set error=1
1096call :dk_color %Red% "Checking slmgr /dlv [Not Responding] %error_code%"
1097)
1098
1099
1100for %%# in (wmic.exe) do @if "%%~$PATH:#"=="" (
1101call :dk_color %Gray% "Checking WMIC.exe [Not Found]"
1102)
1103
1104
1105set wmifailed=
1106if %_wmic% EQU 1 wmic path Win32_ComputerSystem get CreationClassName /value %nul2% | find /i "computersystem" %nul1%
1107if %_wmic% EQU 0 %psc% "Get-CIMInstance -Class Win32_ComputerSystem | Select-Object -Property CreationClassName" %nul2% | find /i "computersystem" %nul1%
1108
1109if %errorlevel% NEQ 0 set wmifailed=1
1110echo "%error_code%" | findstr /i "0x800410 0x800440" %nul1% && set wmifailed=1& :: https://learn.microsoft.com/en-us/windows/win32/wmisdk/wmi-error-constants
1111if defined wmifailed (
1112set error=1
1113call :dk_color %Red% "Checking WMI [Not Responding]"
1114call :dk_color %Blue% "In MAS, Goto Troubleshoot and run Fix WMI option."
1115set showfix=1
1116)
1117
1118
1119reg query "HKU\S-1-5-20\Software\Microsoft\Windows NT\CurrentVersion\SoftwareProtectionPlatform\PersistedTSReArmed" %nul% && (
1120set error=1
1121set showfix=1
1122call :dk_color2 %Red% "Checking Rearm " %Blue% "[System Restart Is Required]"
1123)
1124
1125
1126reg query "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\ClipSVC\Volatile\PersistedSystemState" %nul% && (
1127set error=1
1128set showfix=1
1129call :dk_color2 %Red% "Checking ClipSVC " %Blue% "[System Restart Is Required]"
1130)
1131
1132
1133for /f "skip=2 tokens=2*" %%a in ('reg query "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\SoftwareProtectionPlatform" /v "SkipRearm" %nul6%') do if /i %%b NEQ 0x0 (
1134reg add "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\SoftwareProtectionPlatform" /v "SkipRearm" /t REG_DWORD /d "0" /f %nul%
1135call :dk_color %Red% "Checking SkipRearm [Default 0 Value Not Found. Changing To 0]"
1136net stop sppsvc /y %nul%
1137net start sppsvc /y %nul%
1138set error=1
1139)
1140
1141
1142reg query "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\SoftwareProtectionPlatform\Plugins\Objects\msft:rm/algorithm/hwid/4.0" /f ba02fed39662 /d %nul% || (
1143call :dk_color %Red% "Checking SPP Registry Key [Incorrect ModuleId Found]"
1144call :dk_color %Blue% "Possibly Caused By Gaming Spoofers. Help: https://%mas%/troubleshoot"
1145set error=1
1146set showfix=1
1147)
1148
1149
1150set tokenstore=
1151for /f "skip=2 tokens=2*" %%a in ('reg query "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\SoftwareProtectionPlatform" /v TokenStore %nul6%') do call set "tokenstore=%%b"
1152if not exist "%tokenstore%\" (
1153set error=1
1154REM This code creates token folder only if it's missing and sets default permission for it
1155mkdir "%tokenstore%" %nul%
1156set "d=$sddl = 'O:BAG:BAD:PAI(A;OICI;FA;;;SY)(A;OICI;FA;;;BA)(A;OICIIO;GR;;;BU)(A;;FR;;;BU)(A;OICI;FA;;;S-1-5-80-123231216-2592883651-3715271367-3753151631-4175906628)';"
1157set "d=!d! $AclObject = New-Object System.Security.AccessControl.DirectorySecurity;"
1158set "d=!d! $AclObject.SetSecurityDescriptorSddlForm($sddl);"
1159set "d=!d! Set-Acl -Path %tokenstore% -AclObject $AclObject;"
1160%psc% "!d!" %nul%
1161call :dk_color %Gray% "Checking SPP Token Folder [Not Found. Creating Now] [%tokenstore%\]"
1162)
1163
1164
1165call :dk_actids
1166if not defined applist (
1167net stop sppsvc /y %nul%
1168cscript //nologo %windir%\system32\slmgr.vbs /rilc %nul%
1169if !errorlevel! NEQ 0 cscript //nologo %windir%\system32\slmgr.vbs /rilc %nul%
1170call :dk_refresh
1171call :dk_actids
1172if not defined applist (
1173set error=1
1174call :dk_color %Red% "Checking Activation IDs [Not Found]"
1175)
1176)
1177
1178
1179if exist "%tokenstore%\" if not exist "%tokenstore%\tokens.dat" (
1180set error=1
1181call :dk_color %Red% "Checking SPP tokens.dat [Not Found] [%tokenstore%\]"
1182)
1183
1184
1185if not exist %SystemRoot%\system32\sppsvc.exe (
1186set error=1
1187set showfix=1
1188call :dk_color %Red% "Checking sppsvc.exe File [Not Found]"
1189)
1190
1191
1192:: Below checks are performed if required services are not disabled or corrupted + if there is any error + slmgr /dlv errorlevel is not Zero + no fix was shown before
1193
1194set wpaerror=
1195set permerror=
1196if not defined serv_cor if not defined serv_cste if defined error if /i not %error_code%==0 if not defined showfix (
1197
1198REM This code checks for invalid registry keys in HKLM\SYSTEM\WPA. This issue may appear even on healthy systems.
1199
1200if %winbuild% GEQ 14393 (
1201set /a count=0
1202for /f %%a in ('reg query "HKLM\SYSTEM\WPA" %nul6%') do set /a count+=1
1203for /L %%# in (1,1,!count!) do (
1204reg query "HKLM\SYSTEM\WPA\8DEC0AF1-0341-4b93-85CD-72606C2DF94C-7P-%%#" /ve /t REG_BINARY %nul% || set wpaerror=1
1205)
1206if defined wpaerror call :dk_color %Red% "Checking WPA Registry Keys [Error Found] [Registry Count - !count!]"
1207)
1208
1209REM This code checks if NT SERVICE\sppsvc has permission access to tokens folder and required registry keys. It's often caused by gaming spoofers.
1210
1211if not exist "%tokenstore%\" set permerror=1
1212
1213for %%# in (
1214"%tokenstore%"
1215"HKLM:\SYSTEM\WPA"
1216"HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion\SoftwareProtectionPlatform"
1217) do if not defined permerror (
1218%psc% "$acl = Get-Acl '%%#'; if ($acl.Access.Where{ $_.IdentityReference -eq 'NT SERVICE\sppsvc' -and $_.AccessControlType -eq 'Deny' -or $acl.Access.IdentityReference -notcontains 'NT SERVICE\sppsvc'}) {Exit 2}" %nul%
1219if !errorlevel!==2 set permerror=1
1220)
1221if defined permerror call :dk_color %Red% "Checking SPP Permissions [Error Found]"
1222
1223set showfix=1
1224call :dk_color %Blue% "%_fixmsg%"
1225if not defined permerror call :dk_color %Blue% "If activation still fails then run Fix WPA Registry option."
1226)
1227
1228exit /b
1229
1230::========================================================================================================================================
1231
1232:dk_color
1233
1234if %_NCS% EQU 1 (
1235echo %esc%[%~1%~2%esc%[0m
1236) else (
1237%psc% write-host -back '%1' -fore '%2' '%3'
1238)
1239exit /b
1240
1241:dk_color2
1242
1243if %_NCS% EQU 1 (
1244echo %esc%[%~1%~2%esc%[%~3%~4%esc%[0m
1245) else (
1246%psc% write-host -back '%1' -fore '%2' '%3' -NoNewline; write-host -back '%4' -fore '%5' '%6'
1247)
1248exit /b
1249
1250::========================================================================================================================================
1251
1252:dk_done
1253
1254echo:
1255if %_unattended%==1 timeout /t 2 & exit /b
1256call :dk_color %_Yellow% "Press any key to %_exitmsg%..."
1257pause %nul1%
1258exit /b
1259
1260::========================================================================================================================================
1261
1262:: 1st column = Office version number
1263:: 2nd column = Activation ID
1264:: 3rd column = Generic key. Preference is given in this order, Retail > OEM:NONSLP > Volume:MAK > Volume:GVLK > Retail:TB:Sub
1265:: 4th column = Last part of license description
1266:: 5th column = Edition
1267:: Separator = "_"
1268
1269:ohookdata
1270
1271set f=
1272for %%# in (
127315_ab4d047b-97cf-4126-a69f-34df08e2f254_B7R%f%FY-7N%f%XPK-Q43%f%42-Y9%f%X2H-3JX%f%4X_Retail________AccessRetail
127415_4374022d-56b8-48c1-9bb7-d8f2fc726343_9MF%f%9G-CN%f%32B-HV7%f%XT-9X%f%J8T-9KV%f%F4_MAK___________AccessVolume
127515_1b1d9bd5-12ea-4063-964c-16e7e87d6e08_NT8%f%89-MB%f%H4X-8MD%f%4H-X8%f%R2D-WQH%f%F8_Retail________ExcelRetail
127615_ac1ae7fd-b949-4e04-a330-849bc40638cf_Y3N%f%36-YC%f%HDK-XYW%f%BG-KY%f%QVV-BDT%f%J2_MAK___________ExcelVolume
127715_cfaf5356-49e3-48a8-ab3c-e729ab791250_BMK%f%4W-6N%f%88B-BP9%f%QR-PH%f%FCK-MG7%f%GF_Retail________GrooveRetail
127815_4825ac28-ce41-45a7-9e6e-1fed74057601_RN8%f%4D-7H%f%CWY-FTC%f%BK-JM%f%XWM-HT7%f%GJ_MAK___________GrooveVolume
127915_c02fb62e-1cd5-4e18-ba25-e0480467ffaa_2WQ%f%NF-GB%f%K4B-XVG%f%6F-BB%f%MX7-M4F%f%2Y_OEM-Perp______HomeBusinessPipcRetail
128015_cd256150-a898-441f-aac0-9f8f33390e45_NVT%f%DK-QB%f%8J9-M28%f%GR-92%f%BPC-BR9%f%6Q_Retail________HomeBusinessRetail
128115_98685d21-78bd-4c62-bc4f-653344a63035_R29%f%WQ-CM%f%NCM-2TH%f%CT-K4%f%H92-FX6%f%KR_Retail________HomeStudentRetail
128215_44984381-406e-4a35-b1c3-e54f499556e2_RV7%f%NQ-HY%f%3WW-7CK%f%WH-QT%f%VMW-29V%f%HC_Retail________InfoPathRetail
128315_9e016989-4007-42a6-8051-64eb97110cf2_C4T%f%GN-QQ%f%W6Y-FYK%f%XC-6W%f%JW7-X73%f%VG_MAK___________InfoPathVolume
128415_9103f3ce-1084-447a-827e-d6097f68c895_6MD%f%N4-WF%f%3FV-4WH%f%3Q-W6%f%99V-RGC%f%MY_PrepidBypass__LyncAcademicRetail
128515_ff693bf4-0276-4ddb-bb42-74ef1a0c9f4d_N42%f%BF-CB%f%Y9F-W2C%f%7R-X3%f%97X-DYF%f%QW_PrepidBypass__LyncEntryRetail
128615_fada6658-bfc6-4c4e-825a-59a89822cda8_89P%f%23-2N%f%K2R-JXM%f%2M-3Q%f%8R8-BWM%f%3Y_Retail________LyncRetail
128715_e1264e10-afaf-4439-a98b-256df8bb156f_3WK%f%CD-RN%f%489-4M7%f%XJ-GJ%f%2GQ-YBF%f%Q6_MAK___________LyncVolume
128815_3169c8df-f659-4f95-9cc6-3115e6596e83_YYH%f%XG-KT%f%NKF-XGR%f%T7-H2%f%99D-8K6%f%MM_Retail________MondoRetail
128915_f33485a0-310b-4b72-9a0e-b1d605510dbd_2YN%f%YQ-FQ%f%MVG-CB8%f%KW-6X%f%KYD-M7R%f%RJ_MAK___________MondoVolume
129015_3391e125-f6e4-4b1e-899c-a25e6092d40d_4TG%f%WV-6N%f%9P6-G2H%f%8Y-2H%f%WKB-B4F%f%F4_Bypass________OneNoteFreeRetail
129115_8b524bcc-67ea-4876-a509-45e46f6347e8_3KX%f%XQ-PV%f%N2C-8P7%f%YY-HC%f%V88-GVG%f%Q6_Retail________OneNoteRetail
129215_b067e965-7521-455b-b9f7-c740204578a2_JDM%f%WF-NJ%f%C7B-HRC%f%HY-WF%f%T8G-BPX%f%D9_MAK___________OneNoteVolume
129315_12004b48-e6c8-4ffa-ad5a-ac8d4467765a_9N4%f%RQ-CF%f%8R2-HBV%f%CB-J3%f%C9V-94P%f%4D_Retail________OutlookRetail
129415_8d577c50-ae5e-47fd-a240-24986f73d503_HNG%f%29-GG%f%WRG-RFC%f%8C-JT%f%FP4-2J9%f%FH_MAK___________OutlookVolume
129515_5aab8561-1686-43f7-9ff5-2c861da58d17_9CY%f%B3-NF%f%MRW-YFD%f%G6-XC%f%7TF-BY3%f%6J_OEM-Perp______PersonalPipcRetail
129615_17e9df2d-ed91-4382-904b-4fed6a12caf0_2NC%f%QJ-MF%f%RMH-TXV%f%83-J7%f%V4C-RVR%f%WC_Retail________PersonalRetail
129715_31743b82-bfbc-44b6-aa12-85d42e644d5b_HVM%f%N2-KP%f%HQH-DVQ%f%MK-7B%f%3CM-FGB%f%FC_Retail________PowerPointRetail
129815_e40dcb44-1d5c-4085-8e8f-943f33c4f004_47D%f%KN-HP%f%JP7-RF9%f%M3-VC%f%YT2-TMQ%f%4G_MAK___________PowerPointVolume
129915_064383fa-1538-491c-859b-0ecab169a0ab_N3Q%f%MM-GK%f%DT3-JQG%f%X6-7X%f%3MQ-4GB%f%G3_Retail________ProPlusRetail
130015_2b88c4f2-ea8f-43cd-805e-4d41346e18a7_QKH%f%NX-M9%f%GGH-T3Q%f%MW-YP%f%K4Q-QRP%f%9V_MAK___________ProPlusVolume
130115_4e26cac1-e15a-4467-9069-cb47b67fe191_CF9%f%DD-6C%f%NW2-BJW%f%JQ-CV%f%CFX-Y7T%f%XD_OEM-Perp______ProfessionalPipcRetail
130215_44bc70e2-fb83-4b09-9082-e5557e0c2ede_MBQ%f%BN-CQ%f%PT6-PXR%f%MC-TY%f%JFR-3C8%f%MY_Retail________ProfessionalRetail
130315_f2435de4-5fc0-4e5b-ac97-34f515ec5ee7_B4R%f%N4-H4%f%JYG-YMQ%f%MC-CY%f%GKH-46W%f%PH_Retail________ProjectProRetail
130415_ed34dc89-1c27-4ecd-8b2f-63d0f4cedc32_WFC%f%T2-NB%f%FQ7-JD7%f%VV-MF%f%JX6-6F2%f%CM_MAK___________ProjectProVolume
130515_5517e6a2-739b-4822-946f-7f0f1c5934b1_2B9%f%6V-X9%f%NJY-WFB%f%RC-Q8%f%MP2-7CC%f%C4_Retail________ProjectStdRetail
130615_2b9e4a37-6230-4b42-bee2-e25ce86c8c7a_3CN%f%QX-T3%f%4TY-99R%f%H4-C4%f%YD2-KWY%f%GV_MAK___________ProjectStdVolume
130715_c3a0814a-70a4-471f-af37-2313a6331111_TWN%f%CJ-YR%f%84W-X7P%f%PF-6D%f%PRP-D67%f%VC_Retail________PublisherRetail
130815_38ea49f6-ad1d-43f1-9888-99a35d7c9409_DJP%f%HV-NC%f%JV6-GWP%f%T6-K2%f%6JX-C7G%f%X6_MAK___________PublisherVolume
130915_ba3e3833-6a7e-445a-89d0-7802a9a68588_3NY%f%6J-WH%f%T3F-47B%f%DV-JH%f%F36-234%f%3W_PrepidBypass__SPDRetail
131015_32255c0a-16b4-4ce2-b388-8a4267e219eb_V6V%f%WN-KC%f%2HR-YYD%f%D6-9V%f%7HQ-7T7%f%VP_Retail________StandardRetail
131115_a24cca51-3d54-4c41-8a76-4031f5338cb2_9TN%f%6B-PC%f%YH4-MCV%f%DQ-KT%f%83C-TMQ%f%7T_MAK___________StandardVolume
131215_15d12ad4-622d-4257-976c-5eb3282fb93d_JRJ%f%NJ-33%f%M7C-R73%f%X3-P9%f%XF7-R89%f%MY_Retail________VisioProRetail
131315_3e4294dd-a765-49bc-8dbd-cf8b62a4bd3d_YN7%f%CF-XR%f%H6R-CGK%f%RY-GK%f%PV3-BG7%f%WF_MAK___________VisioProVolume
131415_dae597ce-5823-4c77-9580-7268b93a4b23_G2N%f%2Q-4Q%f%D2T-DY4%f%TP-GY%f%489-3RQ%f%CG_Retail________VisioStdRetail
131515_44a1f6ff-0876-4edb-9169-dbb43101ee89_RX6%f%3Y-4N%f%FK2-XTY%f%C8-C6%f%B3W-YPX%f%PJ_MAK___________VisioStdVolume
131615_191509f2-6977-456f-ab30-cf0492b1e93a_NB7%f%7V-RP%f%FQ6-PMM%f%KQ-T8%f%7DV-M4D%f%84_Retail________WordRetail
131715_9cedef15-be37-4ff0-a08a-13a045540641_RPH%f%PB-Y7%f%NC4-3VY%f%FM-DW%f%7VD-G8Y%f%J8_MAK___________WordVolume
131815_befee371-a2f5-4648-85db-a2c55fdf324c_JXR%f%8H-NJ%f%3MK-X66%f%W8-78%f%CWD-QRQ%f%6C_Retail________O365BusinessRetail
131915_537ea5b5-7d50-4876-bd38-a53a77caca32_J2W%f%28-TN%f%9C8-26P%f%WV-F7%f%J4G-72X%f%CB_Subscription1_O365HomePremRetail
132015_0c4e5e7a-b436-4776-bb89-88e4b14687e2_T6J%f%JW-DY%f%N99-WK4%f%6B-9M%f%KKV-94P%f%2Y_Retail________O365ProPlusRetail
132115_7a75647f-636f-4607-8e54-e1b7d1ad8930_B9V%f%9Q-F6%f%ND8-T4K%f%4K-88%f%68M-HT7%f%KT_Retail________O365SmallBusPremRetail
132216_bfa358b0-98f1-4125-842e-585fa13032e6_WHK%f%4N-YQ%f%GHB-XWX%f%CC-G3%f%HYC-6JF%f%94_Retail________AccessRetail
132316_9d9faf9e-d345-4b49-afce-68cb0a539c7c_RNB%f%7V-P4%f%8F4-3FY%f%Y6-2P%f%3R3-63B%f%QV_PrepidBypass__AccessRuntimeRetail
132416_3b2fa33f-cd5a-43a5-bd95-f49f3f546b0b_JJ2%f%Y4-N8%f%KM3-Y8K%f%Y3-Y2%f%2FR-R3K%f%VK_MAK___________AccessVolume
132516_424d52ff-7ad2-4bc7-8ac6-748d767b455d_RKJ%f%BN-VW%f%TM2-BDK%f%XX-RK%f%QFD-JTY%f%Q2_Retail________ExcelRetail
132616_685062a7-6024-42e7-8c5f-6bb9e63e697f_FVG%f%NR-X8%f%2B2-6PR%f%JM-YT%f%4W7-8HV%f%36_MAK___________ExcelVolume
132716_c02fb62e-1cd5-4e18-ba25-e0480467ffaa_2WQ%f%NF-GB%f%K4B-XVG%f%6F-BB%f%MX7-M4F%f%2Y_OEM-Perp______HomeBusinessPipcRetail
132816_86834d00-7896-4a38-8fae-32f20b86fa2b_HM6%f%FM-NV%f%F78-KV9%f%PM-F3%f%6B8-D9M%f%XD_Retail________HomeBusinessRetail
132916_c28acdb8-d8b3-4199-baa4-024d09e97c99_PNP%f%RV-F2%f%627-Q8J%f%VC-3D%f%GR9-WTY%f%RK_Retail________HomeStudentRetail
133016_e2127526-b60c-43e0-bed1-3c9dc3d5a468_YWD%f%4R-CN%f%KVT-VG8%f%VJ-93%f%33B-RC3%f%B8_Retail________HomeStudentVNextRetail
133116_b21367df-9545-4f02-9f24-240691da0e58_Y3X%f%PN-P7%f%PC4-MGP%f%TJ-2B%f%Y3Q-RJR%f%FV_Retail________MondoRetail
133216_2cd0ea7e-749f-4288-a05e-567c573b2a6c_FMT%f%QQ-84%f%NR8-274%f%4R-MX%f%F4P-PGY%f%R3_MAK___________MondoVolume
133316_436366de-5579-4f24-96db-3893e4400030_XYN%f%TG-R9%f%6FY-369%f%HX-YF%f%PHY-F9C%f%PM_Bypass________OneNoteFreeRetail
133416_83ac4dd9-1b93-40ed-aa55-ede25bb6af38_FXF%f%6F-CN%f%C26-W64%f%3C-K6%f%KB7-6XX%f%W3_Retail________OneNoteRetail
133516_23b672da-a456-4860-a8f3-e062a501d7e8_9TY%f%VN-D7%f%6HK-BVM%f%WT-Y7%f%G88-9TP%f%PV_MAK___________OneNoteVolume
133616_5a670809-0983-4c2d-8aad-d3c2c5b7d5d1_7N4%f%KG-P2%f%QDH-86V%f%9C-DJ%f%FVF-369%f%W9_Retail________OutlookRetail
133716_50059979-ac6f-4458-9e79-710bcb41721a_7QP%f%NR-3H%f%FDG-YP6%f%T9-JQ%f%CKQ-KKX%f%XC_MAK___________OutlookVolume
133816_5aab8561-1686-43f7-9ff5-2c861da58d17_9CY%f%B3-NF%f%MRW-YFD%f%G6-XC%f%7TF-BY3%f%6J_OEM-Perp______PersonalPipcRetail
133916_a9f645a1-0d6a-4978-926a-abcb363b72a6_FT7%f%VF-XB%f%N92-HPD%f%JV-RH%f%MBY-6VK%f%BF_Retail________PersonalRetail
134016_f32d1284-0792-49da-9ac6-deb2bc9c80b6_N7G%f%CB-WQ%f%T7K-QRH%f%WG-TT%f%PYD-7T9%f%XF_Retail________PowerPointRetail
134116_9b4060c9-a7f5-4a66-b732-faf248b7240f_X3R%f%T9-ND%f%G64-VMK%f%2M-KQ%f%6XY-DPF%f%GV_MAK___________PowerPointVolume
134216_de52bd50-9564-4adc-8fcb-a345c17f84f9_GM4%f%3N-F7%f%42Q-6JD%f%DK-M6%f%22J-J8G%f%DV_Retail________ProPlusRetail
134316_c47456e3-265d-47b6-8ca0-c30abbd0ca36_FNV%f%K8-8D%f%VCJ-F7X%f%3J-KG%f%VQB-RC2%f%QY_MAK___________ProPlusVolume
134416_4e26cac1-e15a-4467-9069-cb47b67fe191_CF9%f%DD-6C%f%NW2-BJW%f%JQ-CV%f%CFX-Y7T%f%XD_OEM-Perp______ProfessionalPipcRetail
134516_d64edc00-7453-4301-8428-197343fafb16_NXF%f%TK-YD%f%9Y7-X9M%f%MJ-9B%f%WM6-J2Q%f%VH_Retail________ProfessionalRetail
134616_0f42f316-00b1-48c5-ada4-2f52b5720ad0_WKK%f%GF-TT%f%N8F-QC9%f%T2-6C%f%2DC-3YH%f%63_Retail________ProjectProRetail
134716_82f502b5-b0b0-4349-bd2c-c560df85b248_PKC%f%3N-8F%f%99H-28M%f%VY-J4%f%RYY-CWG%f%DH_MAK___________ProjectProVolume
134816_16728639-a9ab-4994-b6d8-f81051e69833_JBN%f%PH-YF%f%2F7-Q9Y%f%29-86%f%CTG-C9Y%f%GV_MAKC2R________ProjectProXVolume
134916_e9f0b3fc-962f-4944-ad06-05c10b6bcd5e_4H6%f%NF-QD%f%PG8-83W%f%97-9K%f%8XY-XBT%f%9Y_Retail________ProjectStdRetail
135016_82e6b314-2a62-4e51-9220-61358dd230e6_4TG%f%WV-6N%f%9P6-G2H%f%8Y-2H%f%WKB-B4G%f%93_MAK___________ProjectStdVolume
135116_431058f0-c059-44c5-b9e7-ed2dd46b6789_N3W%f%2Q-69%f%MBT-27R%f%D9-BH%f%8V3-JT2%f%C8_MAKC2R________ProjectStdXVolume
135216_6e0c1d99-c72e-4968-bcb7-ab79e03e201e_WKW%f%ND-X6%f%G9G-CDM%f%TV-CP%f%GYJ-6MV%f%BF_Retail________PublisherRetail
135316_fcc1757b-5d5f-486a-87cf-c4d6dedb6032_9QV%f%N2-PX%f%XRX-8V4%f%W8-Q7%f%926-TJG%f%D8_MAK___________PublisherVolume
135416_9103f3ce-1084-447a-827e-d6097f68c895_6MD%f%N4-WF%f%3FV-4WH%f%3Q-W6%f%99V-RGC%f%MY_PrepidBypass__SkypeServiceBypassRetail
135516_971cd368-f2e1-49c1-aedd-330909ce18b6_4N4%f%D8-3J%f%7Y3-YYW%f%7C-73%f%HD2-V8R%f%HY_PrepidBypass__SkypeforBusinessEntryRetail
135616_418d2b9f-b491-4d7f-84f1-49e27cc66597_PBJ%f%79-77%f%NY4-VRG%f%FG-Y8%f%WYC-CKC%f%RC_Retail________SkypeforBusinessRetail
135716_03ca3b9a-0869-4749-8988-3cbc9d9f51bb_DMT%f%CJ-KN%f%RKR-JV8%f%TQ-V2%f%CR2-VFT%f%FH_MAK___________SkypeforBusinessVolume
135816_4a31c291-3a12-4c64-b8ab-cd79212be45e_2FP%f%WN-4H%f%6CM-KD8%f%QQ-8H%f%CHC-P9X%f%YW_Retail________StandardRetail
135916_0ed94aac-2234-4309-ba29-74bdbb887083_WHG%f%MQ-JN%f%MGT-MDQ%f%VF-WD%f%R69-KQB%f%WC_MAK___________StandardVolume
136016_2dfe2075-2d04-4e43-816a-eb60bbb77574_7TM%f%6H-KN%f%R4K-Q7H%f%BX-72%f%T2Q-H22%f%RV_Retail________VisioProRetail
136116_295b2c03-4b1c-4221-b292-1411f468bd02_NRK%f%T9-C8%f%GP2-XDY%f%XQ-YW%f%72K-MG9%f%2B_MAK___________VisioProVolume
136216_0594dc12-8444-4912-936a-747ca742dbdb_G98%f%Q2-B6%f%N77-CFH%f%9J-K8%f%24G-XQC%f%C4_MAKC2R________VisioProXVolume
136316_c76dbcbc-d71b-4f45-b5b3-b7494cb4e23e_Q8R%f%4N-GJ%f%CPG-CF3%f%2R-JF%f%CYR-K4T%f%F3_Retail________VisioStdRetail
136416_44151c2d-c398-471f-946f-7660542e3369_XNC%f%JB-YY%f%883-JRW%f%64-DP%f%XMX-JXC%f%R6_MAK___________VisioStdVolume
136516_1d1c6879-39a3-47a5-9a6d-aceefa6a289d_B2H%f%TN-JP%f%H8C-J6Y%f%6V-HC%f%HKB-43M%f%GT_MAKC2R________VisioStdXVolume
136616_cacaa1bf-da53-4c3b-9700-11738ef1c2a5_P8K%f%82-NQ%f%7GG-JKY%f%8T-6V%f%HVY-88G%f%GD_Retail________WordRetail
136716_c3000759-551f-4f4a-bcac-a4b42cbf1de2_YHM%f%WC-YN%f%6V9-WJP%f%XD-3W%f%QKP-TMV%f%CV_MAK___________WordVolume
136816_518687bd-dc55-45b9-8fa6-f918e1082e83_WRY%f%J6-G3%f%NP7-7VH%f%94-8X%f%7KP-JB7%f%HC_Retail________Access2019Retail
136916_385b91d6-9c2c-4a2e-86b5-f44d44a48c5f_6FW%f%HX-NK%f%YXK-BW3%f%4Q-7X%f%C9F-Q9P%f%X7_MAK-AE________Access2019Volume
137016_22e6b96c-1011-4cd5-8b35-3c8fb6366b86_FGQ%f%NJ-JW%f%JCG-7Q8%f%MG-RM%f%RGJ-9TQ%f%VF_PrepidBypass__AccessRuntime2019Retail
137116_c201c2b7-02a1-41a8-b496-37c72910cd4a_KBP%f%NW-64%f%CMM-8KW%f%CB-23%f%F44-8B7%f%HM_Retail________Excel2019Retail
137216_05cb4e1d-cc81-45d5-a769-f34b09b9b391_8NT%f%4X-GQ%f%MCK-62X%f%4P-TW%f%6QP-YKP%f%YF_MAK-AE________Excel2019Volume
137316_7fe09eef-5eed-4733-9a60-d7019df11cac_QBN%f%2Y-9B%f%284-9KW%f%78-K4%f%8PB-R62%f%YT_Retail________HomeBusiness2019Retail
137416_4539aa2c-5c31-4d47-9139-543a868e5741_XNW%f%PM-32%f%XQC-Y7Q%f%JC-QG%f%GBV-YY7%f%JK_Retail________HomeStudent2019Retail
137516_20e359d5-927f-47c0-8a27-38adbdd27124_WR4%f%3D-NM%f%WQQ-HCQ%f%R2-VK%f%XDR-37B%f%7H_Retail________Outlook2019Retail
137616_92a99ed8-2923-4cb7-a4c5-31da6b0b8cf3_RN3%f%QB-GT%f%6D7-YB3%f%VH-F3%f%RPB-3GQ%f%YB_MAK-AE________Outlook2019Volume
137716_2747b731-0f1f-413e-a92d-386ec1277dd8_NMB%f%Y8-V3%f%CV7-BX6%f%K6-29%f%22Y-43M%f%7T_Retail________Personal2019Retail
137816_7e63cc20-ba37-42a1-822d-d5f29f33a108_HN2%f%7K-JH%f%J8R-7T7%f%KK-WJ%f%YC3-FM7%f%MM_Retail________PowerPoint2019Retail
137916_13c2d7bf-f10d-42eb-9e93-abf846785434_29G%f%NM-VM%f%33V-WR2%f%3K-HG%f%2DT-KTQ%f%YR_MAK-AE________PowerPoint2019Volume
138016_a3072b8f-adcc-4e75-8d62-fdeb9bdfae57_BN4%f%XJ-R9%f%DYY-96W%f%48-YK%f%8DM-MY7%f%PY_Retail________ProPlus2019Retail
138116_6755c7a7-4dfe-46f5-bce8-427be8e9dc62_T8Y%f%BN-4Y%f%V3X-KK2%f%4Q-QX%f%BD7-T3C%f%63_MAK-AE________ProPlus2019Volume
138216_1717c1e0-47d3-4899-a6d3-1022db7415e0_9NX%f%DK-MR%f%Y98-2VJ%f%V8-GF%f%73J-TQ9%f%FK_Retail________Professional2019Retail
138316_0d270ef7-5aaf-4370-a372-bc806b96adb7_JDT%f%NC-PP%f%77T-T9H%f%2W-G4%f%J2J-VH8%f%JK_Retail________ProjectPro2019Retail
138416_d4ebadd6-401b-40d5-adf4-a5d4accd72d1_TBX%f%BD-FN%f%WKJ-WRH%f%BD-KB%f%PHH-XD9%f%F2_MAK-AE________ProjectPro2019Volume
138516_bb7ffe5f-daf9-4b79-b107-453e1c8427b5_R3J%f%NT-8P%f%BDP-MTW%f%CK-VD%f%2V8-HMK%f%F9_Retail________ProjectStd2019Retail
138616_fdaa3c03-dc27-4a8d-8cbf-c3d843a28ddc_RBR%f%FX-MQ%f%NDJ-4XF%f%HF-7Q%f%VDR-JHX%f%GC_MAK-AE________ProjectStd2019Volume
138716_f053a7c7-f342-4ab8-9526-a1d6e5105823_4QC%f%36-NW%f%3YH-D2Y%f%9D-RJ%f%PC7-VVB%f%9D_Retail________Publisher2019Retail
138816_40055495-be00-444e-99cc-07446729b53e_K8F%f%2D-NB%f%M32-BF2%f%6V-YC%f%KFJ-29Y%f%9W_MAK-AE________Publisher2019Volume
138916_b639e55c-8f3e-47fe-9761-26c6a786ad6b_JBD%f%KF-6N%f%CD6-49K%f%3G-2T%f%V79-BKP%f%73_Retail________SkypeforBusiness2019Retail
139016_15a430d4-5e3f-4e6d-8a0a-14bf3caee4c7_9MN%f%Q7-YP%f%Q3B-6WJ%f%XM-G8%f%3T3-CBB%f%DK_MAK-AE________SkypeforBusiness2019Volume
139116_f88cfdec-94ce-4463-a969-037be92bc0e7_N97%f%22-BV%f%9H6-WTJ%f%TT-FP%f%B93-978%f%MK_PrepidBypass__SkypeforBusinessEntry2019Retail
139216_fdfa34dd-a472-4b85-bee6-cf07bf0aaa1c_NDG%f%VM-MD%f%27H-2XH%f%VC-KD%f%DX2-YKP%f%74_Retail________Standard2019Retail
139316_beb5065c-1872-409e-94e2-403bcfb6a878_NT3%f%V6-XM%f%BK7-Q66%f%MF-VM%f%KR4-FC3%f%3M_MAK-AE________Standard2019Volume
139416_a6f69d68-5590-4e02-80b9-e7233dff204e_2NW%f%VW-QG%f%F4T-9CP%f%MB-WY%f%DQ9-7XP%f%79_Retail________VisioPro2019Retail
139516_f41abf81-f409-4b0d-889d-92b3e3d7d005_33Y%f%F4-GN%f%CQ3-J6G%f%DM-J6%f%7P3-FM7%f%QP_MAK-AE________VisioPro2019Volume
139616_4a582021-18c2-489f-9b3d-5186de48f1cd_263%f%WK-3N%f%797-7R4%f%37-28%f%BKG-3V8%f%M8_Retail________VisioStd2019Retail
139716_933ed0e3-747d-48b0-9c2c-7ceb4c7e473d_BGN%f%HX-QT%f%PRJ-F9C%f%9G-R8%f%QQG-8T2%f%7F_MAK-AE________VisioStd2019Volume
139816_72cee1c2-3376-4377-9f25-4024b6baadf8_JXR%f%8H-NJ%f%3MK-X66%f%W8-78%f%CWD-QRV%f%R2_Retail________Word2019Retail
139916_fe5fe9d5-3b06-4015-aa35-b146f85c4709_9F3%f%6R-PN%f%VHH-3DX%f%GQ-7C%f%D2H-R9D%f%3V_MAK-AE________Word2019Volume
140016_f634398e-af69-48c9-b256-477bea3078b5_P28%f%6B-N3%f%XYP-36Q%f%RQ-29%f%CMP-RVX%f%9M_Retail________Access2021Retail
140116_ae17db74-16b0-430b-912f-4fe456e271db_JBH%f%3N-P9%f%7FP-FRT%f%JD-MG%f%K2C-VFW%f%G6_MAK-AE________Access2021Volume
140216_fb099c19-d48b-4a2f-a160-4383011060aa_V6Q%f%FB-7N%f%7G9-PF7%f%W9-M8%f%FQM-MY8%f%G9_Retail________Excel2021Retail
140316_9da1ecdb-3a62-4273-a234-bf6d43dc0778_WNY%f%R4-KM%f%R9H-KVC%f%8W-7H%f%J8B-K79%f%DQ_MAK-AE________Excel2021Volume
140416_0e878942-3ba1-48ee-a215-f64d10a9f97b_QV2%f%VN-37%f%WPX-DHH%f%4K-B8%f%2H6-PDP%f%3T_Retail1_______HomeBusiness2021Retail
140516_9e7d5312-95fc-4443-a551-69c20624ec6b_3QN%f%G6-8F%f%JTH-88B%f%F9-KB%f%BVM-JMB%f%78_Retail________HomeStudent2021Retail
140616_279706f4-3a4b-4877-949b-f8c299cf0cc5_NB2%f%TQ-3Y%f%79C-77C%f%6M-QM%f%Y7H-7QY%f%8P_Retail________OneNote2021Retail
140716_ecea2cfa-d406-4a7f-be0d-c6163250d126_4NC%f%WR-9V%f%92Y-34V%f%B2-RP%f%THR-YTG%f%R7_Retail________Outlook2021Retail
140816_45bf67f9-0fc8-4335-8b09-9226cef8a576_JQ9%f%MJ-QY%f%N6B-67P%f%X9-GY%f%FVY-QJ6%f%TB_MAK-AE________Outlook2021Volume
140916_8f89391e-eedb-429d-af90-9d36fbf94de6_RRR%f%YB-DN%f%749-GCP%f%W4-9H%f%6VK-HCH%f%PT_Retail________Personal2021Retail
141016_c9bf5e86-f5e3-4ac6-8d52-e114a604d7bf_3KX%f%XQ-PV%f%N2C-8P7%f%YY-HC%f%V88-GVM%f%96_Retail1_______PowerPoint2021Retail
141116_716f2434-41b6-4969-ab73-e61e593a3875_39G%f%2N-3B%f%D9C-C4X%f%CM-BD%f%4QG-FVY%f%DY_MAK-AE________PowerPoint2021Volume
141216_c2f04adf-a5de-45c5-99a5-f5fddbda74a8_8WX%f%TP-MN%f%628-KY4%f%4G-VJ%f%WCK-C7P%f%CF_Retail________ProPlus2021Retail
141316_3f180b30-9b05-4fe2-aa8d-0c1c4790f811_RNH%f%JY-DT%f%FXW-HW9%f%F8-49%f%82D-MD2%f%CW_MAK-AE1_______ProPlus2021Volume
141416_96097a68-b5c5-4b19-8600-2e8d6841a0db_JRJ%f%NJ-33%f%M7C-R73%f%X3-P9%f%XF7-R9F%f%6M_MAK-AE________ProPlusSPLA2021Volume
141516_711e48a6-1a79-4b00-af10-73f4ca3aaac4_DJP%f%HV-NC%f%JV6-GWP%f%T6-K2%f%6JX-C7P%f%BG_Retail________Professional2021Retail
141616_3747d1d5-55a8-4bc3-b53d-19fff1913195_QKH%f%NX-M9%f%GGH-T3Q%f%MW-YP%f%K4Q-QRW%f%MV_Retail________ProjectPro2021Retail
141716_17739068-86c4-4924-8633-1e529abc7efc_HVC%f%34-CV%f%NPG-RVC%f%MT-X2%f%JRF-CR7%f%RK_MAK-AE1_______ProjectPro2021Volume
141816_4ea64dca-227c-436b-813f-b6624be2d54c_2B9%f%6V-X9%f%NJY-WFB%f%RC-Q8%f%MP2-7CH%f%RR_Retail________ProjectStd2021Retail
141916_84313d1e-47c8-4e27-8ced-0476b7ee46c4_3CN%f%QX-T3%f%4TY-99R%f%H4-C4%f%YD2-KW6%f%WH_MAK-AE________ProjectStd2021Volume
142016_b769b746-53b1-4d89-8a68-41944dafe797_CDN%f%FG-77%f%T8D-VKQ%f%JX-B7%f%KT3-KK2%f%8V_Retail1_______Publisher2021Retail
142116_a0234cfe-99bd-4586-a812-4f296323c760_2KX%f%JH-3N%f%HTW-RDB%f%PX-QF%f%RXJ-MTG%f%XF_MAK-AE________Publisher2021Volume
142216_c3fb48b2-1fd4-4dc8-af39-819edf194288_DVB%f%XN-HF%f%T43-CVP%f%RQ-J8%f%9TF-VMM%f%HG_Retail________SkypeforBusiness2021Retail
142316_6029109c-ceb8-4ee5-b324-f8eb2981e99a_R3F%f%CY-NH%f%GC7-CBP%f%VP-8Q%f%934-YTG%f%XG_MAK-AE________SkypeforBusiness2021Volume
142416_9e7e7b8e-a0e7-467b-9749-d0de82fb7297_HXN%f%XB-J4%f%JGM-TCF%f%44-2X%f%2CV-FJV%f%VH_Retail________Standard2021Retail
142516_223a60d8-9002-4a55-abac-593f5b66ca45_2CJ%f%N4-C9%f%XK2-HFP%f%Q6-YH%f%498-82T%f%XH_MAK-AE________Standard2021Volume
142616_b99ba8c4-e257-4b70-a31a-8bd308ce7073_BQW%f%DW-NJ%f%9YF-P7Y%f%79-H6%f%DCT-MKQ%f%9C_MAK-AE________StandardSPLA2021Volume
142716_814014d3-c30b-4f63-a493-3708e0dc0ba8_T6P%f%26-NJ%f%VBR-76B%f%K8-WB%f%CDY-TX3%f%BC_Retail________VisioPro2021Retail
142816_c590605a-a08a-4cc7-8dc2-f1ffb3d06949_JNK%f%BX-MH%f%9P4-K8Y%f%YV-8C%f%G2Y-VQ2%f%C8_MAK-AE________VisioPro2021Volume
142916_16d43989-a5ef-47e2-9ff1-272784caee24_89N%f%YY-KB%f%93R-7X2%f%2F-93%f%QDF-DJ6%f%YM_Retail________VisioStd2021Retail
143016_d55f90ee-4ba2-4d02-b216-1300ee50e2af_BW4%f%3B-4P%f%NFP-V63%f%7F-23%f%TR2-J47%f%TX_MAK-AE________VisioStd2021Volume
143116_fb33d997-4aa3-494e-8b58-03e9ab0f181d_VNC%f%C4-CJ%f%QVK-BKX%f%34-77%f%Y8H-CYX%f%MR_Retail________Word2021Retail
143216_0c728382-95fb-4a55-8f12-62e605f91727_BJG%f%97-NW%f%3GM-8QQ%f%Q7-FH%f%76G-686%f%XM_MAK-AE________Word2021Volume
143316_6337137e-7c07-4197-8986-bece6a76fc33_2P3%f%C9-BQ%f%NJH-VCV%f%PH-YD%f%Y6M-43J%f%PQ_Subscription__O365BusinessRetail
143416_2f5c71b4-5b7a-4005-bb68-f9fac26f2ea3_W62%f%NQ-26%f%7QR-RTF%f%74-PF%f%2MH-JQM%f%TH_Subscription__O365EduCloudRetail
143516_537ea5b5-7d50-4876-bd38-a53a77caca32_J2W%f%28-TN%f%9C8-26P%f%WV-F7%f%J4G-72X%f%CB_Subscription1_O365HomePremRetail
143616_149dbce7-a48e-44db-8364-a53386cd4580_2N3%f%82-D6%f%PKK-QTX%f%4D-2J%f%JYK-M96%f%P2_Subscription1_O365ProPlusRetail
143716_bacd4614-5bef-4a5e-bafc-de4c788037a2_HN8%f%JP-87%f%TQJ-PBF%f%3P-Y6%f%6KC-W2K%f%9V_Subscription1_O365SmallBusPremRetail
1438) do (
1439for /f "tokens=1-5 delims=_" %%A in ("%%#") do (
1440if %1==getinfo if %oVer%==%%A if "%2"=="%%E" (set _key=%%C& set _actid=%%B& set _allactid=!_allactid! %%B&set _lic=%%D)
1441
1442if %1==getmsiprod if %oVer%==%%A (find /i "%%E" %msitemp% %nul% && (if defined _oIds (set _oIds=!_oIds! %%E) else (set _oIds=%%E)))
1443
1444)
1445)
1446exit /b
1447
1448::========================================================================================================================================
1449
1450:: This code is used to modify the timestamp value of sppc dll file in order to change checksums
1451:: It's done to lower the potential false positive detection by antivirus's. On each install, it will install a unique sppc dll file
1452
1453:oh_extractdll
1454
1455set b=
1456%psc% "$f=[io.file]::ReadAllText('!_batp!') -split ':%_hook%\:.*';$bytes = [Con%b%vert]::FromBas%b%e64String($f[1]); $PePath='%1'; $m=[io.file]::ReadAllText('!_batp!') -split ':hexedit\:.*';iex ($m[1]);" %nul2% | find /i "Error found" %nul1% && set hasherror=1
1457exit /b
1458
1459:hexedit:
1460# Use a MemoryStream to perform operations on the bytes
1461$MemoryStream = New-Object System.IO.MemoryStream
1462$Writer = New-Object System.IO.BinaryWriter($MemoryStream)
1463$Writer.Write($bytes)
1464
1465# Define dynamic assembly, module, and type
1466$AssemblyBuilder = [AppDomain]::CurrentDomain.DefineDynamicAssembly(4, 1)
1467$ModuleBuilder = $AssemblyBuilder.DefineDynamicModule(2, $False)
1468$TypeBuilder = $ModuleBuilder.DefineType(0)
1469
1470# Define P/Invoke method
1471[void]$TypeBuilder.DefinePInvokeMethod('MapFileAndCheckSum', 'imagehlp.dll', 'Public, Static', [Reflection.CallingConventions]::Standard, [int], @([string], [int].MakeByRefType(), [int].MakeByRefType()), [Runtime.InteropServices.CallingConvention]::Winapi, [Runtime.InteropServices.CharSet]::Auto)
1472
1473# Create the type
1474$Imagehlp = $TypeBuilder.CreateType()
1475
1476# Offset information
1477$timestampOffset = 136
1478$exportTimestampOffset = 3076
1479$checkSumOffset = 216
1480
1481# Calculate timestamp
1482$currentTimestamp = [DateTime]::UtcNow
1483$unixTimestamp = [int]($currentTimestamp - (Get-Date -Year 1970 -Month 1 -Day 1 -Hour 0 -Minute 0 -Second 0)).TotalSeconds
1484
1485# Change timestamps
1486$Writer.BaseStream.Position = $timestampOffset
1487$Writer.Write($unixTimestamp)
1488
1489$Writer.BaseStream.Position = $exportTimestampOffset
1490$Writer.Write($unixTimestamp)
1491
1492$Writer.Flush()
1493
1494# Write the current state of the MemoryStream to a temporary file
1495$tempFilePath = [System.IO.Path]::Combine($env:windir, "Temp", [System.IO.Path]::GetRandomFileName())
1496[System.IO.File]::WriteAllBytes($tempFilePath, $MemoryStream.ToArray())
1497
1498# Update hash using the temporary file
1499[int]$HeaderSum = 0
1500[int]$CheckSum = 0
1501[void]$Imagehlp::MapFileAndCheckSum($tempFilePath, [ref]$HeaderSum, [ref]$CheckSum)
1502
1503# If the checksums don't match, update the checksum in the MemoryStream
1504if ($HeaderSum -ne $CheckSum) {
1505 $Writer.BaseStream.Position = $checkSumOffset
1506 $Writer.Write($CheckSum)
1507 $Writer.Flush()
1508} else {
1509 Write-host Error found
1510}
1511
1512# Delete the temporary file
1513Remove-Item -Path $tempFilePath -Force
1514
1515# Get the modified bytes
1516$modifiedBytes = $MemoryStream.ToArray()
1517
1518# Write the modified bytes to the final file
1519[System.IO.File]::WriteAllBytes($PePath, $modifiedBytes)
1520
1521[void]$Imagehlp::MapFileAndCheckSum($PePath, [ref]$HeaderSum, [ref]$CheckSum)
1522if ($HeaderSum -ne $CheckSum) {
1523 Write-host Error found
1524}
1525
1526$MemoryStream.Close()
1527:hexedit:
1528
1529::========================================================================================================================================
1530::
1531:: This below blocks of text is encoded in base64 format
1532:: The blocks in labels "sppc64.dll" and "sppc32.dll" contains below files
1533::
1534:: C6DF24DEEF2E83813DEE9C81DDD9793A3D60C117A4E8E231B82E32B3192927E7 *sppc64.dll
1535:: E6AC83560C19EC7EB868C50EA97EA0ED5632A397A9F43C17E24E6DE4A694D118 *sppc32.dll
1536::
1537:: The files are encoded in base64 to make MAS AIO version. Alternatively, you can use MAS separate files version
1538::
1539:: mass grave[.]dev/ohook
1540:: Here you can find the files source code and info on how to rebuild the identical sppc.dll files
1541::
1542:: stackoverflow.com/a/35335273
1543:: Here you can check how to extract sppc.dll files from base64
1544::
1545:: For any further question, feel free to contact us on mass grave[.]dev/contactus
1546::
1547::========================================================================================================================================
1548
1549:sppc32.dll:
1550TVqQAAMAAAAEAAAA//8AALgAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAgAAAAA4fug4AtAnNIbgBTM0hVGhpcyBwcm9ncmFtIGNhbm5vdCBiZSBydW4gaW4gRE9TIG1vZGUuDQ0KJAAAAAAAAABQRQAATAEHAMDc0GQAAAAAAAAAAOAA
1551DiMLAQIoAAIAAAAeAAAAAAAAABAAAAAQAAAAAAAAAACAagAQAAAAAgAABAAAA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AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
1609AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
1610AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
1611AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
1612:sppc32.dll:
1613
1614:========================================================================================================================================
1615
1616:sppc64.dll:
1617TVqQAAMAAAAEAAAA//8AALgAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAgAAAAA4fug4AtAnNIbgBTM0hVGhpcyBwcm9ncmFtIGNhbm5vdCBiZSBydW4gaW4gRE9TIG1vZGUuDQ0KJAAAAAAAAABQRQAAZIYHAMDc0GQAAAAAAAAAAPAA
1618LiILAgIoAAIAAAAeAAAAAAAAABAAAAAQAAAAAJIxAgAAAAAQAAAAAgAABAAAAAAAAAAGAAAAAAAAAACQAAAABAAA39AAAAIAYAEAACAAAAAAAAAQAAAAAAAAAAAQAAAAAAAAEAAAAAAAAAAAAAAQAAAAAFAAAI0QAAAAcAAAUAEAAACAAAB4AwAAADAAACQAAAAAAAAA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BwAHAAYwAuAGQAbABsAAAAAAAsAAYAAQBQAHIAbwBkAHUAYwB0AE4AYQBtAGUAAAAAAG8AaABvAG8AawAAADQACAABAFAAcgBvAGQAdQBjAHQAVgBlAHIAcwBpAG8AbgAAADAALgAzAC4A
1677MAAuADAAAABEAAAAAQBWAGEAcgBGAGkAbABlAEkAbgBmAG8AAAAAACQABAAAAFQAcgBhAG4AcwBsAGEAdABpAG8AbgAAAAAACQTkBAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
1678AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
1679:sppc64.dll:
1680
1681::========================================================================================================================================
1682:: Leave empty line below
diff --git a/MAS/Separate-Files-Version/Activators/Online_KMS_Activation.cmd b/MAS/Separate-Files-Version/Activators/Online_KMS_Activation.cmd
index befbdc3..fd6df96 100644
--- a/MAS/Separate-Files-Version/Activators/Online_KMS_Activation.cmd
+++ b/MAS/Separate-Files-Version/Activators/Online_KMS_Activation.cmd
@@ -20,9 +20,15 @@
20 20
21 21
22 22
23
24::======================================================================================================================================== 23::========================================================================================================================================
25 24
25:: Set Path variable, it helps if it is misconfigured in the system
26
27set "PATH=%SystemRoot%\System32;%SystemRoot%\System32\wbem;%SystemRoot%\System32\WindowsPowerShell\v1.0\"
28if exist "%SystemRoot%\Sysnative\reg.exe" (
29set "PATH=%SystemRoot%\Sysnative;%SystemRoot%\Sysnative\wbem;%SystemRoot%\Sysnative\WindowsPowerShell\v1.0\;%PATH%"
30)
31
26:: Re-launch the script with x64 process if it was initiated by x86 process on x64 bit Windows 32:: Re-launch the script with x64 process if it was initiated by x86 process on x64 bit Windows
27:: or with ARM64 process if it was initiated by x86/ARM32 process on ARM64 Windows 33:: or with ARM64 process if it was initiated by x86/ARM32 process on ARM64 Windows
28 34
@@ -30,6 +36,10 @@ set "_cmdf=%~f0"
30for %%# in (%*) do ( 36for %%# in (%*) do (
31if /i "%%#"=="r1" set r1=1 37if /i "%%#"=="r1" set r1=1
32if /i "%%#"=="r2" set r2=1 38if /i "%%#"=="r2" set r2=1
39if /i "%%#"=="-qedit" (
40reg add HKCU\Console /v QuickEdit /t REG_DWORD /d "1" /f 1>nul
41rem check the code below admin elevation to understand why it's here
42)
33) 43)
34 44
35if exist %SystemRoot%\Sysnative\cmd.exe if not defined r1 ( 45if exist %SystemRoot%\Sysnative\cmd.exe if not defined r1 (
@@ -46,22 +56,34 @@ start %SystemRoot%\SysArm32\cmd.exe /c ""!_cmdf!" %* r2"
46exit /b 56exit /b
47) 57)
48 58
49:: Set Path variable, it helps if it is misconfigured in the system 59::========================================================================================================================================
50 60
51set "PATH=%SystemRoot%\System32;%SystemRoot%\System32\wbem;%SystemRoot%\System32\WindowsPowerShell\v1.0\" 61set "blank="
52if exist "%SystemRoot%\Sysnative\reg.exe" ( 62set "mas=mass%blank%grave.dev"
53set "PATH=%SystemRoot%\Sysnative;%SystemRoot%\Sysnative\wbem;%SystemRoot%\Sysnative\WindowsPowerShell\v1.0\;%PATH%" 63
64:: Check if Null service is working, it's important for the batch script
65
66sc query Null | find /i "RUNNING"
67if %errorlevel% NEQ 0 (
68echo:
69echo Null service is not running, script may crash...
70echo:
71echo:
72echo Help - https://%mas%/troubleshoot.html
73echo:
74echo:
75ping 127.0.0.1 -n 10
54) 76)
77cls
55 78
56:: Check LF line ending 79:: Check LF line ending
57 80
58pushd "%~dp0" 81pushd "%~dp0"
59>nul findstr /rxc:".*" "%~nx0" 82>nul findstr /v "$" "%~nx0" && (
60if not %errorlevel%==0 (
61echo: 83echo:
62echo Error: Script either has LF line ending issue, or it failed to read itself. 84echo Error: Script either has LF line ending issue or an empty line at the end of the script is missing.
63echo: 85echo:
64ping 127.0.0.1 -n 6 > nul 86ping 127.0.0.1 -n 6 >nul
65popd 87popd
66exit /b 88exit /b
67) 89)
@@ -96,8 +118,7 @@ set _unattendedact=
96set _args=%* 118set _args=%*
97if defined _args set _args=%_args:"=% 119if defined _args set _args=%_args:"=%
98if defined _args ( 120if defined _args (
99set _unattended=1 121echo "%_args%" | find /i "/KMS" >nul && set _unattended=1
100if "%_args%"=="-el" set _unattended=
101 122
102for %%A in (%_args%) do ( 123for %%A in (%_args%) do (
103if /i "%%A"=="-el" (set _elev=1 124if /i "%%A"=="-el" (set _elev=1
@@ -116,9 +137,9 @@ if /i "%%A"=="-el" (set _elev=1
116 137
117::======================================================================================================================================== 138::========================================================================================================================================
118 139
119set winbuild=1
120set "nul=>nul 2>&1" 140set "nul=>nul 2>&1"
121set psc=powershell.exe 141set psc=powershell.exe
142set winbuild=1
122for /f "tokens=6 delims=[]. " %%G in ('ver') do set winbuild=%%G 143for /f "tokens=6 delims=[]. " %%G in ('ver') do set winbuild=%%G
123 144
124set _NCS=1 145set _NCS=1
@@ -136,7 +157,7 @@ if %_Debug% EQU 1 set _unattended=1
136 157
137if %winbuild% LSS 7600 ( 158if %winbuild% LSS 7600 (
138%nceline% 159%nceline%
139echo Unsupported OS version detected. 160echo Unsupported OS version detected [%winbuild%].
140echo Project is supported for Windows 7/8/8.1/10/11 and their Server equivalent. 161echo Project is supported for Windows 7/8/8.1/10/11 and their Server equivalent.
141goto Done 162goto Done
142) 163)
@@ -182,7 +203,7 @@ goto Done
182:: Elevate script as admin and pass arguments and preventing loop 203:: Elevate script as admin and pass arguments and preventing loop
183 204
184>nul fltmc || ( 205>nul fltmc || (
185if not defined _elev %nul% %psc% "start cmd.exe -arg '/c \"!_PSarg:'=''!\"' -verb runas" && exit /b 206if not defined _elev %psc% "start cmd.exe -arg '/c \"!_PSarg:'=''!\"' -verb runas" && exit /b
186%nceline% 207%nceline%
187echo This script require admin privileges. 208echo This script require admin privileges.
188echo To do so, right click on this script and select 'Run as administrator'. 209echo To do so, right click on this script and select 'Run as administrator'.
@@ -191,6 +212,21 @@ goto Done
191 212
192::======================================================================================================================================== 213::========================================================================================================================================
193 214
215:: This code disables QuickEdit for this cmd.exe session only without making permanent changes to the registry
216:: It is added because clicking on the script window pauses the operation and leads to the confusion that script stopped due to an error
217
218if defined _unattended set quedit=1
219for %%# in (%_args%) do (if /i "%%#"=="-qedit" set quedit=1)
220
221reg query HKCU\Console /v QuickEdit 2>nul | find /i "0x0" %nul% || if not defined quedit (
222reg add HKCU\Console /v QuickEdit /t REG_DWORD /d "0" /f %nul%
223start cmd.exe /c ""!_batf!" %_args% -qedit"
224rem quickedit reset code is added at the starting of the script instead of here because it takes time to reflect in some cases
225exit /b
226)
227
228::========================================================================================================================================
229
194if %~z0 GEQ 300000 (set "_exitmsg=Go back") else (set "_exitmsg=Exit") 230if %~z0 GEQ 300000 (set "_exitmsg=Go back") else (set "_exitmsg=Exit")
195 231
196:: Check not x86 Windows 232:: Check not x86 Windows
@@ -252,7 +288,7 @@ reg query %kNext% /v MigrationToV5Done 2>nul | find /i "0x1" %nul% && call :offi
252 288
253set _tskinstalled= 289set _tskinstalled=
254reg query "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Schedule\taskcache\tasks" /f Path /s | find /i "\Activation-Renewal" >nul && ( 290reg query "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Schedule\taskcache\tasks" /f Path /s | find /i "\Activation-Renewal" >nul && (
255find /i "Ver:1.8" %ProgramData%\Activation-Renewal\Activation_task.cmd %nul% && set _tskinstalled=1 291find /i "Ver:1.9" "%ProgramFiles%\Activation-Renewal\Activation_task.cmd" %nul% && set _tskinstalled=1
256) 292)
257 293
258set _oldtsk= 294set _oldtsk=
@@ -382,7 +418,12 @@ set "_log=%~dpn0"
382set "_work=%~dp0" 418set "_work=%~dp0"
383if "%_work:~-1%"=="\" set "_work=%_work:~0,-1%" 419if "%_work:~-1%"=="\" set "_work=%_work:~0,-1%"
384set _UNC=0 420set _UNC=0
385if "%_work:~0,2%"=="\\" set _UNC=1 421if "%_work:~0,2%"=="\\" (
422set _UNC=1
423) else (
424net use %~d0 %_Null%
425if not errorlevel 1 set _UNC=1
426)
386for /f "skip=2 tokens=2*" %%a in ('reg query "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders" /v Desktop') do call set "_dsk=%%b" 427for /f "skip=2 tokens=2*" %%a in ('reg query "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders" /v Desktop') do call set "_dsk=%%b"
387if exist "%PUBLIC%\Desktop\desktop.ini" set "_dsk=%PUBLIC%\Desktop" 428if exist "%PUBLIC%\Desktop\desktop.ini" set "_dsk=%PUBLIC%\Desktop"
388set "_mO21a=Detected Office 2021 C2R Retail is activated" 429set "_mO21a=Detected Office 2021 C2R Retail is activated"
@@ -407,6 +448,8 @@ if exist "%SystemRoot%\Servicing\Packages\Microsoft-Windows-Server*Edition~*.mum
407set "ESUEditions=ServerDatacenter,ServerDatacenterCore,ServerDatacenterV,ServerDatacenterVCore,ServerStandard,ServerStandardCore,ServerStandardV,ServerStandardVCore,ServerEnterprise,ServerEnterpriseCore,ServerEnterpriseV,ServerEnterpriseVCore" 448set "ESUEditions=ServerDatacenter,ServerDatacenterCore,ServerDatacenterV,ServerDatacenterVCore,ServerStandard,ServerStandardCore,ServerStandardV,ServerStandardVCore,ServerEnterprise,ServerEnterpriseCore,ServerEnterpriseV,ServerEnterpriseVCore"
408) 449)
409for /f "tokens=6 delims=[]. " %%G in ('ver') do set winbuild=%%G 450for /f "tokens=6 delims=[]. " %%G in ('ver') do set winbuild=%%G
451set UBR=0
452if %winbuild% GEQ 7601 for /f "skip=2 tokens=2*" %%a in ('reg query "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion" /v UBR 2^>nul') do if not errorlevel 1 set /a UBR=%%b
410set "_csq=cscript.exe //NoLogo //Job:WmiQuery "%~nx0?.wsf"" 453set "_csq=cscript.exe //NoLogo //Job:WmiQuery "%~nx0?.wsf""
411set "_csm=cscript.exe //NoLogo //Job:WmiMethod "%~nx0?.wsf"" 454set "_csm=cscript.exe //NoLogo //Job:WmiMethod "%~nx0?.wsf""
412set "_csp=cscript.exe //NoLogo //Job:WmiPKey "%~nx0?.wsf"" 455set "_csp=cscript.exe //NoLogo //Job:WmiPKey "%~nx0?.wsf""
@@ -437,7 +480,7 @@ pushd "!_work!"
437 480
438if not defined _unattended ( 481if not defined _unattended (
439mode con cols=98 lines=31 482mode con cols=98 lines=31
440%nul% %psc% "&%_buf%" 483%psc% "&%_buf%"
441title %_title% 484title %_title%
442) else ( 485) else (
443title Online KMS Activation 486title Online KMS Activation
@@ -608,7 +651,10 @@ IF %winbuild% LSS 14393 (
608) 651)
609IF NOT "%EditionWMI%"=="" SET "EditionID=%EditionWMI%" 652IF NOT "%EditionWMI%"=="" SET "EditionID=%EditionWMI%"
610IF /I "%EditionID%"=="IoTEnterprise" SET "EditionID=Enterprise" 653IF /I "%EditionID%"=="IoTEnterprise" SET "EditionID=Enterprise"
611IF /I "%EditionID%"=="IoTEnterpriseS" IF %winbuild% LSS 22610 SET "EditionID=EnterpriseS" 654IF /I "%EditionID%"=="IoTEnterpriseS" IF %winbuild% LSS 22610 (
655SET "EditionID=EnterpriseS"
656IF %winbuild% GEQ 19041 IF %UBR% GEQ 2788 SET "EditionID=IoTEnterpriseS"
657)
612IF /I "%EditionID%"=="ProfessionalSingleLanguage" SET "EditionID=Professional" 658IF /I "%EditionID%"=="ProfessionalSingleLanguage" SET "EditionID=Professional"
613IF /I "%EditionID%"=="ProfessionalCountrySpecific" SET "EditionID=Professional" 659IF /I "%EditionID%"=="ProfessionalCountrySpecific" SET "EditionID=Professional"
614IF /I "%EditionID%"=="EnterpriseG" SET Win10Gov=1 660IF /I "%EditionID%"=="EnterpriseG" SET Win10Gov=1
@@ -2220,6 +2266,7 @@ if %_C16Msg% EQU 1 set _CtRMsg=1
2220if %_C15Msg% EQU 1 set _CtRMsg=1 2266if %_C15Msg% EQU 1 set _CtRMsg=1
2221if %_Office16% EQU 1 ( 2267if %_Office16% EQU 1 (
2222for %%a in (%_RetIds%,ProPlus) do set "_%%a=" 2268for %%a in (%_RetIds%,ProPlus) do set "_%%a="
2269for %%A in (19,21) do call :officeLoc %%A
2223) 2270)
2224if %_Office15% EQU 1 ( 2271if %_Office15% EQU 1 (
2225for %%a in (%_R15Ids%,ProPlus) do set "_%%a=" 2272for %%a in (%_R15Ids%,ProPlus) do set "_%%a="
@@ -3314,6 +3361,11 @@ echo Deleting [Folder] %ProgramData%\Activation-Renewal\
3314rmdir /s /q "%ProgramData%\Activation-Renewal\" %nul% 3361rmdir /s /q "%ProgramData%\Activation-Renewal\" %nul%
3315) 3362)
3316 3363
3364If exist "%ProgramFiles%\Activation-Renewal\" (
3365echo Deleting [Folder] %ProgramFiles%\Activation-Renewal\
3366rmdir /s /q "%ProgramFiles%\Activation-Renewal\" %nul%
3367)
3368
3317reg query "HKCR\DesktopBackground\shell\Activate Windows - Office" %nul% && ( 3369reg query "HKCR\DesktopBackground\shell\Activate Windows - Office" %nul% && (
3318echo Deleting [Registry] HKCR\DesktopBackground\shell\Activate Windows - Office 3370echo Deleting [Registry] HKCR\DesktopBackground\shell\Activate Windows - Office
3319Reg delete "HKCR\DesktopBackground\shell\Activate Windows - Office" /f %nul% 3371Reg delete "HKCR\DesktopBackground\shell\Activate Windows - Office" /f %nul%
@@ -3321,13 +3373,13 @@ Reg delete "HKCR\DesktopBackground\shell\Activate Windows - Office" /f %nul%
3321 3373
3322reg query "%key%" /f Path /s | find /i "\Activation-Renewal" >nul && (set error_=1) 3374reg query "%key%" /f Path /s | find /i "\Activation-Renewal" >nul && (set error_=1)
3323reg query "%key%" /f Path /s | find /i "\Activation-Run_Once" >nul && (set error_=1) 3375reg query "%key%" /f Path /s | find /i "\Activation-Run_Once" >nul && (set error_=1)
3324reg query "%key%" /f Path /s | find /i "\Online_KMS_Activation_Script-Run_Once" >nul && (set error_=1) 3376reg query "%key%" /f Path /s | find /i "\Online_KMS_Activation_Script" >nul && (set error_=1)
3325reg query "%key%" /f Path /s | find /i "\Online_KMS_Activation_Script-Run_Once" >nul && (set error_=1)
3326If exist "%windir%\Online_KMS_Activation_Script\" (set error_=1) 3377If exist "%windir%\Online_KMS_Activation_Script\" (set error_=1)
3327reg query "HKCR\DesktopBackground\shell\Activate Windows - Office" %nul% && (set error_=1) 3378reg query "HKCR\DesktopBackground\shell\Activate Windows - Office" %nul% && (set error_=1)
3328if exist "%ProgramData%\Online_KMS_Activation.cmd" (set error_=1) 3379if exist "%ProgramData%\Online_KMS_Activation.cmd" (set error_=1)
3329if exist "%ProgramData%\Online_KMS_Activation\" (set error_=1) 3380if exist "%ProgramData%\Online_KMS_Activation\" (set error_=1)
3330if exist "%ProgramData%\Activation-Renewal\" (set error_=1) 3381if exist "%ProgramData%\Activation-Renewal\" (set error_=1)
3382if exist "%ProgramFiles%\Activation-Renewal\" (set error_=1)
3331exit /b 3383exit /b
3332 3384
3333:========================================================================================================================================= 3385:=========================================================================================================================================
@@ -3339,7 +3391,7 @@ mode con cols=91 lines=30
3339title Install Activation Auto-Renewal 3391title Install Activation Auto-Renewal
3340 3392
3341set error_= 3393set error_=
3342set "_dest=%ProgramData%\Activation-Renewal" 3394set "_dest=%ProgramFiles%\Activation-Renewal"
3343set "key=HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Schedule\taskcache\tasks" 3395set "key=HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Schedule\taskcache\tasks"
3344 3396
3345call :clearstuff %nul% 3397call :clearstuff %nul%
@@ -3352,7 +3404,7 @@ goto :RenDone
3352) 3404)
3353 3405
3354if not exist "%_dest%\" md "%_dest%\" %nul% 3406if not exist "%_dest%\" md "%_dest%\" %nul%
3355set "_temp=%SystemRoot%\Temp\_taskwork" 3407set "_temp=%SystemRoot%\Temp\_taskwork_%Random%"
3356 3408
3357set nil= 3409set nil=
3358if exist "%_temp%\.*" rmdir /s /q "%_temp%\" %nul% 3410if exist "%_temp%\.*" rmdir /s /q "%_temp%\" %nul%
@@ -3364,7 +3416,7 @@ if defined ActTask (s%nil%cht%nil%asks /cre%nil%ate /tn "Activation-Run_Once" /r
3364if exist "%_temp%\.*" rmdir /s /q "%_temp%\" %nul% 3416if exist "%_temp%\.*" rmdir /s /q "%_temp%\" %nul%
3365 3417
3366call :createInfo.txt 3418call :createInfo.txt
3367%nul% %psc% "$f=[io.file]::ReadAllText('!_batp!') -split \":_extracttask\:.*`r`n\"; [io.file]::WriteAllText('%_dest%\Activation_task.cmd', '@REM Dummy ' + '%random%' + [Environment]::NewLine + $f[1].Trim(), [System.Text.Encoding]::ASCII);" 3419%psc% "$f=[io.file]::ReadAllText('!_batp!') -split \":_extracttask\:.*`r`n\"; [io.file]::WriteAllText('%_dest%\Activation_task.cmd', '@REM Dummy ' + '%random%' + [Environment]::NewLine + $f[1].Trim(), [System.Text.Encoding]::ASCII);"
3368title Install Activation Auto-Renewal 3420title Install Activation Auto-Renewal
3369 3421
3370::======================================================================================================================================== 3422::========================================================================================================================================
@@ -3445,9 +3497,9 @@ echo Activation-Run_Once [Activation Task - deletes itself once activated]
3445echo The scheduled tasks runs only if the system is connected to the Internet. 3497echo The scheduled tasks runs only if the system is connected to the Internet.
3446echo: 3498echo:
3447echo - Files 3499echo - Files
3448echo C:\ProgramData\Activation-Renewal\Activation_task.cmd 3500echo C:\Program Files\Activation-Renewal\Activation_task.cmd
3449echo C:\ProgramData\Activation-Renewal\Info.txt 3501echo C:\Program Files\Activation-Renewal\Info.txt
3450echo C:\ProgramData\Activation-Renewal\Logs.txt 3502echo C:\Program Files\Activation-Renewal\Logs.txt
3451echo ______________________________________________________________________________________________ 3503echo ______________________________________________________________________________________________
3452echo: 3504echo:
3453echo Online KMS Activation Script is a part of 'Microsoft_Activation_Scripts' [MAS] project. 3505echo Online KMS Activation Script is a part of 'Microsoft_Activation_Scripts' [MAS] project.
@@ -3516,7 +3568,7 @@ exit /b
3516 </Settings> 3568 </Settings>
3517 <Actions Context="LocalSystem"> 3569 <Actions Context="LocalSystem">
3518 <Exec> 3570 <Exec>
3519 <Command>%ProgramData%\Activation-Renewal\Activation_task.cmd</Command> 3571 <Command>%ProgramFiles%\Activation-Renewal\Activation_task.cmd</Command>
3520 <Arguments>Task</Arguments> 3572 <Arguments>Task</Arguments>
3521 </Exec> 3573 </Exec>
3522 </Actions> 3574 </Actions>
@@ -3573,7 +3625,7 @@ exit /b
3573 </Settings> 3625 </Settings>
3574 <Actions Context="LocalSystem"> 3626 <Actions Context="LocalSystem">
3575 <Exec> 3627 <Exec>
3576 <Command>%ProgramData%\Activation-Renewal\Activation_task.cmd</Command> 3628 <Command>%ProgramFiles%\Activation-Renewal\Activation_task.cmd</Command>
3577 <Arguments>Task</Arguments> 3629 <Arguments>Task</Arguments>
3578 </Exec> 3630 </Exec>
3579 </Actions> 3631 </Actions>
@@ -3586,7 +3638,7 @@ exit /b
3586 3638
3587:RenExport 3639:RenExport
3588 3640
3589%nul% %psc% "$f=[io.file]::ReadAllText('!_batp!') -split \":%~1\:.*`r`n\"; [io.file]::WriteAllText('%~2',$f[1].Trim(),[System.Text.Encoding]::%~3);" 3641%psc% "$f=[io.file]::ReadAllText('!_batp!') -split \":%~1\:.*`r`n\"; [io.file]::WriteAllText('%~2',$f[1].Trim(),[System.Text.Encoding]::%~3);"
3590exit /b 3642exit /b
3591 3643
3592::======================================================================================================================================== 3644::========================================================================================================================================
@@ -3647,7 +3699,7 @@ wmic path Win32_ComputerSystem get CreationClassName /value 2>nul | find /i "com
3647) 3699)
3648 3700
3649setlocal EnableDelayedExpansion 3701setlocal EnableDelayedExpansion
3650if exist "%ProgramData%\Activation-Renewal\" call :_taskstart>>"%ProgramData%\Activation-Renewal\Logs.txt" & exit 3702if exist "%ProgramFiles%\Activation-Renewal\" call :_taskstart>>"%ProgramFiles%\Activation-Renewal\Logs.txt" & exit
3651 3703
3652::======================================================================================================================================== 3704::========================================================================================================================================
3653 3705
@@ -4047,7 +4099,7 @@ if not [%KMS_IP%]==[!KMS_IP!] exit /b
4047goto :_taskgetserv 4099goto :_taskgetserv
4048) 4100)
4049 4101
4050:: Ver:1.8 4102:: Ver:1.9
4051::======================================================================================================================================== 4103::========================================================================================================================================
4052:_extracttask: 4104:_extracttask:
4053 4105
@@ -4192,4 +4244,5 @@ if ($OSPP) {
4192UninstallLicenses("sppc.dll") 4244UninstallLicenses("sppc.dll")
4193:cleanlicense: 4245:cleanlicense:
4194 4246
4195::======================================================================================================================================== \ No newline at end of file 4247::========================================================================================================================================
4248:: Leave empty line below
diff --git a/MAS/Separate-Files-Version/Change_Edition.cmd b/MAS/Separate-Files-Version/Change_Edition.cmd
index 140d6a0..d1461ad 100644
--- a/MAS/Separate-Files-Version/Change_Edition.cmd
+++ b/MAS/Separate-Files-Version/Change_Edition.cmd
@@ -7,7 +7,7 @@
7:: 7::
8:: This script is a part of 'Microsoft_Activation_Scripts' (MAS) project. 8:: This script is a part of 'Microsoft_Activation_Scripts' (MAS) project.
9:: 9::
10:: Homepage: massgrave.dev 10:: Homepage: mass grave[.]dev
11:: Email: windowsaddict@protonmail.com 11:: Email: windowsaddict@protonmail.com
12:: 12::
13::============================================================================ 13::============================================================================
@@ -21,6 +21,13 @@ set _stg=0
21 21
22::======================================================================================================================================== 22::========================================================================================================================================
23 23
24:: Set Path variable, it helps if it is misconfigured in the system
25
26set "PATH=%SystemRoot%\System32;%SystemRoot%\System32\wbem;%SystemRoot%\System32\WindowsPowerShell\v1.0\"
27if exist "%SystemRoot%\Sysnative\reg.exe" (
28set "PATH=%SystemRoot%\Sysnative;%SystemRoot%\Sysnative\wbem;%SystemRoot%\Sysnative\WindowsPowerShell\v1.0\;%PATH%"
29)
30
24:: Re-launch the script with x64 process if it was initiated by x86 process on x64 bit Windows 31:: Re-launch the script with x64 process if it was initiated by x86 process on x64 bit Windows
25:: or with ARM64 process if it was initiated by x86/ARM32 process on ARM64 Windows 32:: or with ARM64 process if it was initiated by x86/ARM32 process on ARM64 Windows
26 33
@@ -28,6 +35,10 @@ set "_cmdf=%~f0"
28for %%# in (%*) do ( 35for %%# in (%*) do (
29if /i "%%#"=="r1" set r1=1 36if /i "%%#"=="r1" set r1=1
30if /i "%%#"=="r2" set r2=1 37if /i "%%#"=="r2" set r2=1
38if /i "%%#"=="-qedit" (
39reg add HKCU\Console /v QuickEdit /t REG_DWORD /d "1" /f %nul1%
40rem check the code below admin elevation to understand why it's here
41)
31) 42)
32 43
33if exist %SystemRoot%\Sysnative\cmd.exe if not defined r1 ( 44if exist %SystemRoot%\Sysnative\cmd.exe if not defined r1 (
@@ -44,22 +55,34 @@ start %SystemRoot%\SysArm32\cmd.exe /c ""!_cmdf!" %* r2"
44exit /b 55exit /b
45) 56)
46 57
47:: Set Path variable, it helps if it is misconfigured in the system 58::========================================================================================================================================
48 59
49set "PATH=%SystemRoot%\System32;%SystemRoot%\System32\wbem;%SystemRoot%\System32\WindowsPowerShell\v1.0\" 60set "blank="
50if exist "%SystemRoot%\Sysnative\reg.exe" ( 61set "mas=mass%blank%grave.dev"
51set "PATH=%SystemRoot%\Sysnative;%SystemRoot%\Sysnative\wbem;%SystemRoot%\Sysnative\WindowsPowerShell\v1.0\;%PATH%" 62
63:: Check if Null service is working, it's important for the batch script
64
65sc query Null | find /i "RUNNING"
66if %errorlevel% NEQ 0 (
67echo:
68echo Null service is not running, script may crash...
69echo:
70echo:
71echo Help - https://%mas%/troubleshoot.html
72echo:
73echo:
74ping 127.0.0.1 -n 10
52) 75)
76cls
53 77
54:: Check LF line ending 78:: Check LF line ending
55 79
56pushd "%~dp0" 80pushd "%~dp0"
57>nul findstr /rxc:".*" "%~nx0" 81>nul findstr /v "$" "%~nx0" && (
58if not %errorlevel%==0 (
59echo: 82echo:
60echo Error: Script either has LF line ending issue, or it failed to read itself. 83echo Error: Script either has LF line ending issue or an empty line at the end of the script is missing.
61echo: 84echo:
62ping 127.0.0.1 -n 6 > nul 85ping 127.0.0.1 -n 6 >nul
63popd 86popd
64exit /b 87exit /b
65) 88)
@@ -71,24 +94,36 @@ cls
71color 07 94color 07
72title Change Windows Edition 95title Change Windows Edition
73 96
97set _args=
74set _elev= 98set _elev=
75if /i "%~1"=="-el" set _elev=1
76 99
77set winbuild=1 100set _args=%*
101if defined _args set _args=%_args:"=%
102if defined _args (
103for %%A in (%_args%) do (
104if /i "%%A"=="-el" set _elev=1
105)
106)
107
108set "nul1=1>nul"
109set "nul2=2>nul"
110set "nul6=2^>nul"
78set "nul=>nul 2>&1" 111set "nul=>nul 2>&1"
112
79set psc=powershell.exe 113set psc=powershell.exe
114set winbuild=1
80for /f "tokens=6 delims=[]. " %%G in ('ver') do set winbuild=%%G 115for /f "tokens=6 delims=[]. " %%G in ('ver') do set winbuild=%%G
81 116
82set _NCS=1 117set _NCS=1
83if %winbuild% LSS 10586 set _NCS=0 118if %winbuild% LSS 10586 set _NCS=0
84if %winbuild% GEQ 10586 reg query "HKCU\Console" /v ForceV2 2>nul | find /i "0x0" 1>nul && (set _NCS=0) 119if %winbuild% GEQ 10586 reg query "HKCU\Console" /v ForceV2 %nul2% | find /i "0x0" %nul1% && (set _NCS=0)
85 120
86if %_NCS% EQU 1 ( 121if %_NCS% EQU 1 (
87for /F %%a in ('echo prompt $E ^| cmd') do set "esc=%%a" 122for /F %%a in ('echo prompt $E ^| cmd') do set "esc=%%a"
88set "Red="41;97m"" 123set "Red="41;97m""
89set "Gray="100;97m"" 124set "Gray="100;97m""
90set "Green="42;97m"" 125set "Green="42;97m""
91set "Magenta="45;97m"" 126set "Blue="44;97m""
92set "_White="40;37m"" 127set "_White="40;37m""
93set "_Green="40;92m"" 128set "_Green="40;92m""
94set "_Yellow="40;93m"" 129set "_Yellow="40;93m""
@@ -96,7 +131,7 @@ set "_Yellow="40;93m""
96set "Red="Red" "white"" 131set "Red="Red" "white""
97set "Gray="Darkgray" "white"" 132set "Gray="Darkgray" "white""
98set "Green="DarkGreen" "white"" 133set "Green="DarkGreen" "white""
99set "Magenta="Darkmagenta" "white"" 134set "Blue="Blue" "white""
100set "_White="Black" "Gray"" 135set "_White="Black" "Gray""
101set "_Green="Black" "Green"" 136set "_Green="Black" "Green""
102set "_Yellow="Black" "Yellow"" 137set "_Yellow="Black" "Yellow""
@@ -111,7 +146,7 @@ if %~z0 GEQ 200000 (set "_exitmsg=Go back") else (set "_exitmsg=Exit")
111 146
112if %winbuild% LSS 7600 ( 147if %winbuild% LSS 7600 (
113%nceline% 148%nceline%
114echo Unsupported OS version detected. 149echo Unsupported OS version detected [%winbuild%].
115echo Project is supported only for Windows 7/8/8.1/10/11 and their Server equivalent. 150echo Project is supported only for Windows 7/8/8.1/10/11 and their Server equivalent.
116goto ced_done 151goto ced_done
117) 152)
@@ -140,7 +175,7 @@ setlocal EnableDelayedExpansion
140 175
141::======================================================================================================================================== 176::========================================================================================================================================
142 177
143echo "!_batf!" | find /i "!_ttemp!" 1>nul && ( 178echo "!_batf!" | find /i "!_ttemp!" %nul1% && (
144if /i not "!_work!"=="!_ttemp!" ( 179if /i not "!_work!"=="!_ttemp!" (
145%eline% 180%eline%
146echo Script is launched from the temp folder, 181echo Script is launched from the temp folder,
@@ -155,8 +190,8 @@ goto ced_done
155 190
156:: Elevate script as admin and pass arguments and preventing loop 191:: Elevate script as admin and pass arguments and preventing loop
157 192
158>nul fltmc || ( 193%nul1% fltmc || (
159if not defined _elev %nul% %psc% "start cmd.exe -arg '/c \"!_PSarg:'=''!\"' -verb runas" && exit /b 194if not defined _elev %psc% "start cmd.exe -arg '/c \"!_PSarg:'=''!\"' -verb runas" && exit /b
160%eline% 195%eline%
161echo This script require admin privileges. 196echo This script require admin privileges.
162echo To do so, right click on this script and select 'Run as administrator'. 197echo To do so, right click on this script and select 'Run as administrator'.
@@ -165,6 +200,20 @@ goto ced_done
165 200
166::======================================================================================================================================== 201::========================================================================================================================================
167 202
203:: This code disables QuickEdit for this cmd.exe session only without making permanent changes to the registry
204:: It is added because clicking on the script window pauses the operation and leads to the confusion that script stopped due to an error
205
206for %%# in (%_args%) do (if /i "%%#"=="-qedit" set quedit=1)
207
208reg query HKCU\Console /v QuickEdit %nul2% | find /i "0x0" %nul1% || if not defined quedit (
209reg add HKCU\Console /v QuickEdit /t REG_DWORD /d "0" /f %nul1%
210start cmd.exe /c ""!_batf!" %_args% -qedit"
211rem quickedit reset code is added at the starting of the script instead of here because it takes time to reflect in some cases
212exit /b
213)
214
215::========================================================================================================================================
216
168cls 217cls
169mode 98, 30 218mode 98, 30
170 219
@@ -189,43 +238,41 @@ echo:
189:: Check Activation IDs 238:: Check Activation IDs
190 239
191call :dk_actids 240call :dk_actids
192 241if not defined applist (
242net stop sppsvc /y %nul%
243cscript //nologo %windir%\system32\slmgr.vbs /rilc %nul%
244if !errorlevel! NEQ 0 cscript //nologo %windir%\system32\slmgr.vbs /rilc %nul%
245call :dk_refresh
246call :dk_actids
193if not defined applist ( 247if not defined applist (
194%eline% 248%eline%
195echo Activation IDs not found. Aborting... 249echo Activation IDs not found. Aborting...
196echo: 250echo:
197echo Check this page for help. https://massgrave.dev/troubleshoot 251echo Check this page for help. https://%mas%/troubleshoot
198goto ced_done 252goto ced_done
199) 253)
200
201:: Check Windows Edition
202
203set osedition=
204for /f "tokens=3 delims=: " %%a in ('DISM /English /Online /Get-CurrentEdition 2^>nul ^| find /i "Current Edition :"') do set "osedition=%%a"
205
206if "%osedition%"=="" (
207%eline%
208DISM /English /Online /Get-CurrentEdition %nul%
209cmd /c exit /b !errorlevel!
210echo DISM command failed [Error Code - 0x!=ExitCode!]
211echo OS Edition was not detected properly. Aborting...
212echo:
213echo Check this page for help. https://massgrave.dev/troubleshoot
214goto ced_done
215) 254)
216 255
256::========================================================================================================================================
257
217:: Check SKU value 258:: Check SKU value
218 259
219set osSKU= 260set osSKU=
220set regSKU= 261set slcSKU=
221set wmiSKU= 262set wmiSKU=
222 263
223for /f "tokens=3 delims=." %%a in ('reg query "HKLM\SYSTEM\CurrentControlSet\Control\ProductOptions" /v OSProductPfn 2^>nul') do set "regSKU=%%a" 264if %winbuild% GEQ 14393 (set info=Kernel-BrandingInfo) else (set info=Kernel-ProductInfo)
224if %_wmic% EQU 1 for /f "tokens=2 delims==" %%a in ('"wmic Path Win32_OperatingSystem Get OperatingSystemSKU /format:LIST" 2^>nul') do if not errorlevel 1 set "wmiSKU=%%a" 265set d1=%ref% [void]$TypeBuilder.DefinePInvokeMethod('SLGetWindowsInformationDWORD', 'slc.dll', 'Public, Static', 1, [int], @([String], [int].MakeByRefType()), 1, 3);
225if %_wmic% EQU 0 for /f "tokens=1" %%a in ('%psc% "([WMI]'Win32_OperatingSystem=@').OperatingSystemSKU" 2^>nul') do if not errorlevel 1 set "wmiSKU=%%a" 266set d1=%d1% $Sku = 0; [void]$TypeBuilder.CreateType()::SLGetWindowsInformationDWORD('%info%', [ref]$Sku); $Sku
267for /f "delims=" %%s in ('"%psc% %d1%"') do if not errorlevel 1 (set slcSKU=%%s)
268if "%slcSKU%"=="0" set slcSKU=
269if 1%slcSKU% NEQ +1%slcSKU% set slcSKU=
270
271if %_wmic% EQU 1 for /f "tokens=2 delims==" %%a in ('"wmic Path Win32_OperatingSystem Get OperatingSystemSKU /format:LIST" %nul6%') do if not errorlevel 1 set "wmiSKU=%%a"
272if %_wmic% EQU 0 for /f "tokens=1" %%a in ('%psc% "([WMI]'Win32_OperatingSystem=@').OperatingSystemSKU" %nul6%') do if not errorlevel 1 set "wmiSKU=%%a"
226 273
227set osSKU=%wmiSKU% 274set osSKU=%slcSKU%
228if not defined osSKU set osSKU=%regSKU% 275if not defined osSKU set osSKU=%wmiSKU%
229 276
230if not defined osSKU ( 277if not defined osSKU (
231%eline% 278%eline%
@@ -233,14 +280,56 @@ echo SKU value was not detected properly. Aborting...
233goto ced_done 280goto ced_done
234) 281)
235 282
283::========================================================================================================================================
284
285:: Check Windows Edition
286
287set osedition=
288set dismedition=
289set dismnotworking=
290
291set d1=%ref% [void]$TypeBuilder.DefinePInvokeMethod('SLGetWindowsInformation', 'slc.dll', 22, 1, [int], @([String], [int], [int].MakeByRefType(), [String].MakeByRefType()), 1, 3);
292set d1=%d1% $editionName = 0; [void]$TypeBuilder.CreateType()::SLGetWindowsInformation('Kernel-EditionName', 0, [ref]0, [ref]$editionName); $editionName
293if %winbuild% GEQ 14393 for /f "delims=" %%s in ('"%psc% %d1%"') do if not errorlevel 1 (set osedition=%%s)
294if "%osedition%"=="0" set osedition=
295
296if not defined osedition (
297for /f "skip=2 tokens=3" %%a in ('reg query "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion" /v EditionID %nul6%') do set "osedition=%%a"
298)
299
300:: Workaround for a Windows bug in builds between 1607 and 1709 where ProfessionalEducation is shown as Professional
301
302if %osSKU%==164 set osedition=ProfessionalEducation
303if %osSKU%==165 set osedition=ProfessionalEducationN
304
305for /f "tokens=3 delims=: " %%a in ('DISM /English /Online /Get-CurrentEdition %nul6% ^| find /i "Current Edition :"') do set "dismedition=%%a"
306if not defined dismedition set dismnotworking=1
307
308if defined dismedition if not defined osedition set osedition=%dismedition%
309
310if not defined osedition (
311%eline%
312DISM /English /Online /Get-CurrentEdition %nul%
313cmd /c exit /b !errorlevel!
314echo DISM command failed [Error Code - 0x!=ExitCode!]
315echo OS Edition was not detected properly. Aborting...
316echo:
317echo Check this page for help. https://%mas%/troubleshoot
318goto ced_done
319)
320
321::========================================================================================================================================
322
236set branch= 323set branch=
237for /f "skip=2 tokens=2*" %%a in ('reg query "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion" /v BuildBranch 2^>nul') do set "branch=%%b" 324for /f "skip=2 tokens=2*" %%a in ('reg query "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion" /v BuildBranch %nul6%') do set "branch=%%b"
238 325
239:: Check PowerShell 326:: Check PowerShell
240 327
241%psc% $ExecutionContext.SessionState.LanguageMode 2>nul | find /i "Full" 1>nul || ( 328%psc% $ExecutionContext.SessionState.LanguageMode %nul2% | find /i "Full" %nul1% || (
242%eline% 329%eline%
243echo PowerShell is not responding properly. Aborting... 330echo PowerShell is not responding properly. Aborting...
331echo:
332echo Check this page for help. https://%mas%/troubleshoot
244goto ced_done 333goto ced_done
245) 334)
246 335
@@ -252,15 +341,22 @@ set _target=
252set _dtarget= 341set _dtarget=
253set _ptarget= 342set _ptarget=
254set _ntarget= 343set _ntarget=
344set _wtarget=
345
346if %winbuild% GEQ 10240 for /f "tokens=4" %%a in ('dism /online /english /Get-TargetEditions ^| findstr /i /c:"Target Edition : "') do (if defined _dtarget (set "_dtarget= !_dtarget! %%a ") else (set "_dtarget= %%a "))
347if %winbuild% LSS 10240 for /f "tokens=4" %%a in ('%psc% "$f=[io.file]::ReadAllText('!_batp!') -split ':cbsxml\:.*';& ([ScriptBlock]::Create($f[1])) -GetTargetEditions;" ^| findstr /i /c:"Target Edition : "') do (if defined _ptarget (set "_ptarget= !_ptarget! %%a ") else (set "_ptarget= %%a "))
255 348
256if %winbuild% GEQ 10240 for /f "tokens=4" %%a in ('dism /online /english /Get-TargetEditions ^| findstr /i /c:"Target Edition : "') do (if defined _dtarget (set "_dtarget=!_dtarget! %%a") else (set "_dtarget=%%a")) 349if %winbuild% GEQ 10240 if not exist "%SystemRoot%\Servicing\Packages\Microsoft-Windows-Server*Edition~*.mum" (
257for /f "tokens=4" %%a in ('%psc% "$f=[io.file]::ReadAllText('!_batp!') -split ':cbsxml\:.*';& ([ScriptBlock]::Create($f[1])) -GetTargetEditions;" ^| findstr /i /c:"Target Edition : "') do (if defined _ptarget (set "_ptarget=!_ptarget! %%a") else (set "_ptarget=%%a")) 350call :ced_edilist
351if /i "%osedition:~0,4%"=="Core" (set "_wtarget= Professional !_wtarget! ")
352set "_dtarget= %_dtarget% !_wtarget! "
353)
258 354
259::======================================================================================================================================== 355::========================================================================================================================================
260 356
261:: Block the change to/from CountrySpecific and CloudEdition editions 357:: Block the change to/from CloudEdition editions
262 358
263for %%# in (99 139 202 203) do if %osSKU%==%%# ( 359for %%# in (202 203) do if %osSKU%==%%# (
264%eline% 360%eline%
265echo [%winos% ^| SKU:%osSKU% ^| %winbuild%] 361echo [%winos% ^| SKU:%osSKU% ^| %winbuild%]
266echo It's not recommended to change this installed edition to any other. 362echo It's not recommended to change this installed edition to any other.
@@ -268,8 +364,8 @@ echo Aborting...
268goto ced_done 364goto ced_done
269) 365)
270 366
271for %%# in ( %_dtarget% %_ptarget% ) do ( 367for %%# in ( %_dtarget% %_ptarget% ) do if /i not "%%#"=="%osedition%" (
272echo "!_target!" | find /i " %%# " 1>nul || set "_target=!_target! %%# " 368echo "!_target!" | find /i " %%# " %nul1% || set "_target= !_target! %%# "
273) 369)
274 370
275if defined _target ( 371if defined _target (
@@ -281,6 +377,7 @@ echo %%# | findstr /i "CountrySpecific CloudEdition" %nul% || (set "_ntarget=!_n
281if not defined _ntarget ( 377if not defined _ntarget (
282%line% 378%line%
283echo: 379echo:
380if defined dismnotworking call :dk_color %Red% "DISM.exe is not responding."
284call :dk_color %Gray% "Target Edition not found." 381call :dk_color %Gray% "Target Edition not found."
285echo Current Edition [%osedition% ^| %winbuild%] can not be changed to any other Edition. 382echo Current Edition [%osedition% ^| %winbuild%] can not be changed to any other Edition.
286%line% 383%line%
@@ -294,7 +391,6 @@ goto ced_done
294cls 391cls
295mode 98, 30 392mode 98, 30
296set inpt= 393set inpt=
297set note=
298set counter=0 394set counter=0
299set verified=0 395set verified=0
300set targetedition= 396set targetedition=
@@ -302,21 +398,16 @@ set targetedition=
302%line% 398%line%
303echo: 399echo:
304call :dk_color %Gray% "You can change the Edition [%osedition%] [%winbuild%] to one of the following." 400call :dk_color %Gray% "You can change the Edition [%osedition%] [%winbuild%] to one of the following."
401if defined dismnotworking (
402call :dk_color %_Yellow% "Note - DISM.exe is not responding."
403if /i "%osedition:~0,4%"=="Core" call :dk_color %_Yellow% " - You will see more edition options to choose once its changed to Pro."
404)
305%line% 405%line%
306echo: 406echo:
307 407
308for %%A in (%_ntarget%) do ( 408for %%A in (%_ntarget%) do (
309set /a counter+=1 409set /a counter+=1
310if %winbuild% GEQ 10240 (
311echo "%_ptarget%" | find /i "%%A" 1>nul && (
312set note=1
313call :dk_color2 %_White% "[!counter!] " %Magenta% "%%A"
314) || (
315echo [!counter!] %%A
316)
317) else (
318echo [!counter!] %%A 410echo [!counter!] %%A
319)
320set targetedition!counter!=%%A 411set targetedition!counter!=%%A
321) 412)
322 413
@@ -324,10 +415,6 @@ set targetedition!counter!=%%A
324echo: 415echo:
325echo [0] %_exitmsg% 416echo [0] %_exitmsg%
326echo: 417echo:
327if defined note (
328echo Note: CBS Upgrade Method is available for Purple colored editions.
329echo:
330)
331call :dk_color %_Green% "Enter option number in keyboard, and press "Enter":" 418call :dk_color %_Green% "Enter option number in keyboard, and press "Enter":"
332set /p inpt= 419set /p inpt=
333if "%inpt%"=="" goto cedmenu2 420if "%inpt%"=="" goto cedmenu2
@@ -338,71 +425,26 @@ if %verified%==0 goto cedmenu2
338 425
339::======================================================================================================================================== 426::========================================================================================================================================
340 427
341cls 428if %winbuild% LSS 10240 goto :cbsmethod
342if %winbuild% GEQ 10240 ( 429if exist "%SystemRoot%\Servicing\Packages\Microsoft-Windows-Server*Edition~*.mum" goto :ced_change_server
343echo "%_ptarget%" | find /i "%targetedition%" 1>nul && (
344echo "%_dtarget%" | find /i "%targetedition%" 1>nul && (
345echo:
346%line%
347echo:
348if exist "%SystemRoot%\Servicing\Packages\Microsoft-Windows-Server*Edition~*.mum" (
349echo [1] DISM Method [Recommended]
350) else (
351echo [1] Changepk Method [Recommended]
352)
353echo:
354echo [2] CBS Upgrade Method [Alternative]
355echo:
356echo [0] Go back
357%line%
358echo:
359echo Enter a menu option in the Keyboard:
360choice /C:120 /N
361set _el=!errorlevel!
362if !_el!==3 goto :cedmenu2
363if !_el!==2 goto :cbsmethod
364if !_el!==1 REM
365)
366)
367) else (
368goto :cbsmethod
369)
370
371echo "%_ptarget%" | find /i "%targetedition%" 1>nul && (
372echo "%_dtarget%" | find /i "%targetedition%" 1>nul || (
373goto :cbsmethod
374)
375)
376
377if exist "%SystemRoot%\Servicing\Packages\Microsoft-Windows-Server*Edition~*.mum" (
378goto :ced_change_server
379)
380 430
381cls 431cls
432mode con cols=105 lines=32
433
382set key= 434set key=
383set _chan= 435set _chan=
384set _changepk=0 436set _dismapi=0
385 437
386:: Check if changepk.exe or slmgr.vbs is required for edition upgrade 438:: Check if DISM Api or slmgr.vbs is required for edition upgrade
387 439
388if not exist "%SystemRoot%\System32\spp\tokens\skus\%targetedition%\" ( 440if not exist "%SystemRoot%\System32\spp\tokens\skus\%targetedition%\" (
389set _changepk=1 441set _dismapi=1
390) 442)
391 443
392if /i "%osedition:~0,4%"=="Core" (
393if /i not "%targetedition:~0,4%"=="Core" (
394set _changepk=1
395)
396)
397
398if %_changepk%==1 (
399set "keyflow=Retail Volume:MAK Volume:GVLK OEM:NONSLP OEM:DM"
400) else (
401set "keyflow=Retail OEM:NONSLP OEM:DM Volume:MAK Volume:GVLK" 444set "keyflow=Retail OEM:NONSLP OEM:DM Volume:MAK Volume:GVLK"
402)
403 445
404if not defined key call :ced_targetSKU %targetedition% 446call :ced_targetSKU %targetedition%
405if not defined key if defined targetSKU call :ced_windowskey 447if defined targetSKU call :ced_windowskey
406if defined key if defined pkeychannel set _chan=%pkeychannel% 448if defined key if defined pkeychannel set _chan=%pkeychannel%
407if not defined key call :changeeditiondata 449if not defined key call :changeeditiondata
408 450
@@ -410,57 +452,26 @@ if not defined key (
410%eline% 452%eline%
411echo [%targetedition% ^| %winbuild%] 453echo [%targetedition% ^| %winbuild%]
412echo Unable to get product key from pkeyhelper.dll 454echo Unable to get product key from pkeyhelper.dll
413echo Make sure you are using updated version of the script. 455echo:
414echo https://massgrave.dev 456echo Check this page for help. https://%mas%/troubleshoot
415goto ced_done 457goto ced_done
416) 458)
417 459
418::======================================================================================================================================== 460::========================================================================================================================================
419 461
420%line% 462:: Changing from Core to Non-Core & Changing editions in Windows build older than 17134 requires "changepk /productkey" or DISM Api method and restart
421
422:: Changing from Core to Non-Core & Changing editions in Windows build older than 17134 requires "changepk /productkey" method and restart
423:: In other cases, editions can be changed instantly with "slmgr /ipk" 463:: In other cases, editions can be changed instantly with "slmgr /ipk"
424 464
425cls 465cls
426if %_changepk%==1 ( 466%line%
427echo "%_chan%" | find /i "OEM" >NUL && (
428%eline%
429echo [%osedition%] can not be changed to [%targetedition%] Edition due to lack of non OEM keys.
430echo Non-OEM keys are required to change from Core to Non-Core Editions.
431goto ced_done
432)
433)
434
435:ced_loop
436
437cls
438if %_changepk%==1 (
439for %%a in (l.root-servers.net resolver1.opendns.com download.windowsupdate.com google.com) do (
440for /f "delims=[] tokens=2" %%# in ('ping -n 1 %%a') do (
441if not [%%#]==[] (
442%eline%
443echo Internet needs to be disconnected to change edition [%osedition%] to [%targetedition%]
444echo Disconnect the Internet and then press any key...
445pause >nul
446goto ced_loop
447)
448)
449)
450)
451
452echo: 467echo:
453echo Changing the Current Edition [%osedition%] to [%targetedition%] 468echo Changing the Current Edition [%osedition%] %winbuild% to [%targetedition%]
454echo: 469echo:
455 470
456if %_changepk%==1 ( 471if %_dismapi%==1 (
457call :dk_color %Magenta% "Notes-" 472call :dk_color %Blue% "Notes-"
458echo:
459echo - You can safely ignore if error appears in the upgrade Window,
460echo but in that case you must manually reboot the system.
461echo: 473echo:
462echo - Save your work before continue, system will auto restart. 474echo - Save your work before continue, system will auto restart.
463echo - You can connect to Internet after the system restart.
464echo: 475echo:
465echo - You will need to activate with HWID option once the edition is changed. 476echo - You will need to activate with HWID option once the edition is changed.
466echo: 477echo:
@@ -470,7 +481,7 @@ if !errorlevel!==1 exit /b
470 481
471::======================================================================================================================================== 482::========================================================================================================================================
472 483
473if %_changepk%==0 ( 484if %_dismapi%==0 (
474echo Installing %_chan% Key [%key%] 485echo Installing %_chan% Key [%key%]
475echo: 486echo:
476if %_wmic% EQU 1 wmic path SoftwareLicensingService where __CLASS='SoftwareLicensingService' call InstallProductKey ProductKey="%key%" %nul% 487if %_wmic% EQU 1 wmic path SoftwareLicensingService where __CLASS='SoftwareLicensingService' call InstallProductKey ProductKey="%key%" %nul%
@@ -488,14 +499,19 @@ echo:
488call :dk_color %Gray% "Reboot is required to properly change the Edition." 499call :dk_color %Gray% "Reboot is required to properly change the Edition."
489) else ( 500) else (
490call :dk_color %Red% "[Unsuccessful] [Error Code: 0x!=ExitCode!]" 501call :dk_color %Red% "[Unsuccessful] [Error Code: 0x!=ExitCode!]"
502echo Check this page for help. https://%mas%/troubleshoot
491) 503)
492) 504)
493 505
494if %_changepk%==1 ( 506if %_dismapi%==1 (
495echo: 507echo:
496echo Applying the command with %_chan% Key 508echo Applying the DISM API method with %_chan% Key %key%
497echo start changepk.exe /ProductKey %key% 509echo:
498start changepk.exe /ProductKey %key% 510%psc% "$f=[io.file]::ReadAllText('!_batp!') -split ':dismapi\:.*';& ([ScriptBlock]::Create($f[1])) %targetedition% %key%;"
511timeout /t 3 %nul1%
512echo:
513call :dk_color %Blue% "Incase of errors, you must restart your system before trying again."
514echo Check this page for help. https://%mas%/troubleshoot
499) 515)
500%line% 516%line%
501 517
@@ -507,13 +523,12 @@ goto ced_done
507 523
508cls 524cls
509mode con cols=105 lines=32 525mode con cols=105 lines=32
510%nul% %psc% "&{$W=$Host.UI.RawUI.WindowSize;$B=$Host.UI.RawUI.BufferSize;$W.Height=31;$B.Height=200;$Host.UI.RawUI.WindowSize=$W;$Host.UI.RawUI.BufferSize=$B;}" 526%psc% "&{$W=$Host.UI.RawUI.WindowSize;$B=$Host.UI.RawUI.BufferSize;$W.Height=31;$B.Height=200;$Host.UI.RawUI.WindowSize=$W;$Host.UI.RawUI.BufferSize=$B;}"
511 527
512echo: 528echo:
513echo Changing the Current Edition [%osedition%] to [%targetedition%] 529echo Changing the Current Edition [%osedition%] %winbuild% to [%targetedition%]
514echo: 530echo:
515call :dk_color %Magenta% "Important - Save your work before continue, system will auto reboot." 531call :dk_color %Blue% "Important - Save your work before continue, system will auto reboot."
516if %winbuild% GEQ 17034 if %targetedition%==Professional echo - Enterprise Key will be installed instead of Pro, you can quickly change to Pro later.
517echo: 532echo:
518choice /C:01 /N /M "[1] Continue [0] %_exitmsg% : " 533choice /C:01 /N /M "[1] Continue [0] %_exitmsg% : "
519if %errorlevel%==1 exit /b 534if %errorlevel%==1 exit /b
@@ -524,9 +539,11 @@ echo:
524 539
525if %_stg%==0 (set stage=) else (set stage=-StageCurrent) 540if %_stg%==0 (set stage=) else (set stage=-StageCurrent)
526%psc% "$f=[io.file]::ReadAllText('!_batp!') -split ':cbsxml\:.*';& ([ScriptBlock]::Create($f[1])) -SetEdition %targetedition% %stage%;" 541%psc% "$f=[io.file]::ReadAllText('!_batp!') -split ':cbsxml\:.*';& ([ScriptBlock]::Create($f[1])) -SetEdition %targetedition% %stage%;"
527
528echo: 542echo:
543call :dk_color %Blue% "Incase of errors, you must restart your system before trying again."
544echo Check this page for help. https://%mas%/troubleshoot
529%line% 545%line%
546
530goto ced_done 547goto ced_done
531 548
532::======================================================================================================================================== 549::========================================================================================================================================
@@ -535,23 +552,23 @@ goto ced_done
535 552
536cls 553cls
537mode con cols=105 lines=32 554mode con cols=105 lines=32
538%nul% %psc% "&{$W=$Host.UI.RawUI.WindowSize;$B=$Host.UI.RawUI.BufferSize;$W.Height=31;$B.Height=200;$Host.UI.RawUI.WindowSize=$W;$Host.UI.RawUI.BufferSize=$B;}" 555%psc% "&{$W=$Host.UI.RawUI.WindowSize;$B=$Host.UI.RawUI.BufferSize;$W.Height=31;$B.Height=200;$Host.UI.RawUI.WindowSize=$W;$Host.UI.RawUI.BufferSize=$B;}"
539 556
540set key= 557set key=
541set pkeychannel= 558set _chan=
542set "keyflow=Volume:GVLK Retail Volume:MAK OEM:NONSLP OEM:DM" 559set "keyflow=Volume:GVLK Retail Volume:MAK OEM:NONSLP OEM:DM"
543call :changeeditionserverdata
544 560
545if not defined key call :ced_targetSKU %targetedition% 561call :ced_targetSKU %targetedition%
546if not defined key if defined targetSKU call :ced_windowskey 562if defined targetSKU call :ced_windowskey
547if defined key if not defined pkeychannel call :dk_pkeychannel %key% 563if defined key if defined pkeychannel set _chan=%pkeychannel%
564if not defined key call :changeeditiondata
548 565
549if not defined key ( 566if not defined key (
550%eline% 567%eline%
551echo [%targetedition% ^| %winbuild%] 568echo [%targetedition% ^| %winbuild%]
552echo Unable to get product key from pkeyhelper.dll 569echo Unable to get product key from pkeyhelper.dll
553echo Make sure you are using updated version of the script. 570echo:
554echo https://massgrave.dev 571echo Check this page for help. https://%mas%/troubleshoot
555goto ced_done 572goto ced_done
556) 573)
557 574
@@ -559,13 +576,14 @@ goto ced_done
559 576
560cls 577cls
561echo: 578echo:
562echo Changing the Current Edition [%osedition%] to [%targetedition%] 579echo Changing the Current Edition [%osedition%] %winbuild% to [%targetedition%]
563echo: 580echo:
564echo Applying the command with %pkeychannel% Key 581echo Applying the command with %_chan% Key
565echo DISM /online /Set-Edition:%targetedition% /ProductKey:%key% /AcceptEula 582echo DISM /online /Set-Edition:%targetedition% /ProductKey:%key% /AcceptEula
566DISM /online /Set-Edition:%targetedition% /ProductKey:%key% /AcceptEula 583DISM /online /Set-Edition:%targetedition% /ProductKey:%key% /AcceptEula
567 584
568call :dk_color %Magenta% "Make sure to restart the system." 585call :dk_color %Blue% "You must restart the system at this stage."
586echo Help: https://%mas%/troubleshoot
569 587
570::======================================================================================================================================== 588::========================================================================================================================================
571 589
@@ -573,7 +591,7 @@ call :dk_color %Magenta% "Make sure to restart the system."
573 591
574echo: 592echo:
575call :dk_color %_Yellow% "Press any key to %_exitmsg%..." 593call :dk_color %_Yellow% "Press any key to %_exitmsg%..."
576pause >nul 594pause %nul1%
577exit /b 595exit /b
578 596
579::======================================================================================================================================== 597::========================================================================================================================================
@@ -591,18 +609,27 @@ exit /b
591:dk_actids 609:dk_actids
592 610
593set applist= 611set applist=
594if %_wmic% EQU 1 set "chkapp=for /f "tokens=2 delims==" %%a in ('"wmic path SoftwareLicensingProduct where (ApplicationID='55c92734-d682-4d71-983e-d6ec3f16059f') get ID /VALUE" 2^>nul')" 612if %_wmic% EQU 1 set "chkapp=for /f "tokens=2 delims==" %%a in ('"wmic path SoftwareLicensingProduct where (ApplicationID='55c92734-d682-4d71-983e-d6ec3f16059f') get ID /VALUE" %nul6%')"
595if %_wmic% EQU 0 set "chkapp=for /f "tokens=2 delims==" %%a in ('%psc% "(([WMISEARCHER]'SELECT ID FROM SoftwareLicensingProduct WHERE ApplicationID=''55c92734-d682-4d71-983e-d6ec3f16059f''').Get()).ID ^| %% {echo ('ID='+$_)}" 2^>nul')" 613if %_wmic% EQU 0 set "chkapp=for /f "tokens=2 delims==" %%a in ('%psc% "(([WMISEARCHER]'SELECT ID FROM SoftwareLicensingProduct WHERE ApplicationID=''55c92734-d682-4d71-983e-d6ec3f16059f''').Get()).ID ^| %% {echo ('ID='+$_)}" %nul6%')"
596%chkapp% do (if defined applist (call set "applist=!applist! %%a") else (call set "applist=%%a")) 614%chkapp% do (if defined applist (call set "applist=!applist! %%a") else (call set "applist=%%a"))
597exit /b 615exit /b
598 616
617:: Get Edition list
618
619:ced_edilist
620
621if %_wmic% EQU 1 set "chkedi=for /f "tokens=2 delims==" %%a in ('"wmic path SoftwareLicensingProduct where (ApplicationID='55c92734-d682-4d71-983e-d6ec3f16059f') get LicenseFamily /VALUE" %nul6%')"
622if %_wmic% EQU 0 set "chkedi=for /f "tokens=2 delims==" %%a in ('%psc% "(([WMISEARCHER]'SELECT LicenseFamily FROM SoftwareLicensingProduct WHERE ApplicationID=''55c92734-d682-4d71-983e-d6ec3f16059f''').Get()).LicenseFamily ^| %% {echo ('LicenseFamily='+$_)}" %nul6%')"
623%chkedi% do (call set "_wtarget= !_wtarget! %%a ")
624exit /b
625
599:: Check wmic.exe 626:: Check wmic.exe
600 627
601:dk_ckeckwmic 628:dk_ckeckwmic
602 629
603set _wmic=0 630set _wmic=0
604for %%# in (wmic.exe) do @if not "%%~$PATH:#"=="" ( 631for %%# in (wmic.exe) do @if not "%%~$PATH:#"=="" (
605wmic path Win32_ComputerSystem get CreationClassName /value 2>nul | find /i "computersystem" 1>nul && set _wmic=1 632wmic path Win32_ComputerSystem get CreationClassName /value %nul2% | find /i "computersystem" %nul1% && set _wmic=1
606) 633)
607exit /b 634exit /b
608 635
@@ -617,8 +644,8 @@ set d1=%d1% $meth.SetImplementationFlags(128); $TypeBuilder.CreateType()::Brandi
617 644
618set winos= 645set winos=
619for /f "delims=" %%s in ('"%psc% %d1%"') do if not errorlevel 1 (set winos=%%s) 646for /f "delims=" %%s in ('"%psc% %d1%"') do if not errorlevel 1 (set winos=%%s)
620echo "%winos%" | find /i "Windows" 1>nul || ( 647echo "%winos%" | find /i "Windows" %nul1% || (
621for /f "skip=2 tokens=2*" %%a in ('reg query "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion" /v ProductName 2^>nul') do set "winos=%%b" 648for /f "skip=2 tokens=2*" %%a in ('reg query "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion" /v ProductName %nul6%') do set "winos=%%b"
622if %winbuild% GEQ 22000 ( 649if %winbuild% GEQ 22000 (
623set winos=!winos:Windows 10=Windows 11! 650set winos=!winos:Windows 10=Windows 11!
624) 651)
@@ -944,59 +971,92 @@ Restart-Computer
944 971
945::======================================================================================================================================== 972::========================================================================================================================================
946 973
974:: Change edition using DISM API
975:: Thanks to Alex (aka may, ave9858)
976
977:dismapi:[
978param (
979 [Parameter()]
980 [String]$TargetEdition,
981
982 [Parameter()]
983 [String]$Key
984)
985
986$AssemblyBuilder = [AppDomain]::CurrentDomain.DefineDynamicAssembly(4, 1)
987$ModuleBuilder = $AssemblyBuilder.DefineDynamicModule(2, $False)
988$TB = $ModuleBuilder.DefineType(0)
989
990[void]$TB.DefinePInvokeMethod('DismInitialize', 'DismApi.dll', 22, 1, [int], @([int], [IntPtr], [IntPtr]), 1, 3)
991[void]$TB.DefinePInvokeMethod('DismOpenSession', 'DismApi.dll', 22, 1, [int], @([String], [IntPtr], [IntPtr], [UInt32].MakeByRefType()), 1, 3)
992[void]$TB.DefinePInvokeMethod('_DismSetEdition', 'DismApi.dll', 22, 1, [int], @([UInt32], [String], [String], [IntPtr], [IntPtr], [IntPtr]), 1, 3)
993$Dism = $TB.CreateType()
994
995[void]$Dism::DismInitialize(2, 0, 0)
996$Session = 0
997[void]$Dism::DismOpenSession('DISM_{53BFAE52-B167-4E2F-A258-0A37B57FF845}', 0, 0, [ref]$Session)
998if (!$Dism::_DismSetEdition($Session, "$TargetEdition", "$Key", 0, 0, 0)) {
999 Restart-Computer
1000}
1001:dismapi:]
1002
1003::========================================================================================================================================
1004
947:: 1st column = Generic Retail/OEM/MAK/GVLK Key 1005:: 1st column = Generic Retail/OEM/MAK/GVLK Key
948:: 2nd column = Key Type 1006:: 2nd column = Key Type
949:: 3rd column = WMI Edition ID 1007:: 3rd column = WMI Edition ID
950:: 4th column = Version name incase same Edition ID is used in different OS versions with different key 1008:: 4th column = Version name incase same Edition ID is used in different OS versions with different key
951:: Separator = _ 1009:: Separator = _
952 1010
953:: Key preference is in the following order. Retail > Volume:MAK > Volume:GVLK > OEM:NONSLP > OEM:DM 1011:: For Windows 10/11 editions, HWID key is listed where ever possible, in Server versions, KMS key is listed where ever possible.
954:: OEM keys are in last because they can't be used in edition change if "changepk /productkey" method is needed instead of "slmgr /ipk" 1012:: Only RS3 and older version Generic keys are stored here, later ones are extracted from the pkeyhelper.dll itself
955:: OEM keys are listed here because we don't have other keys for that edition
956 1013
957:changeeditiondata 1014:changeeditiondata
958 1015
1016if %winbuild% GTR 17763 exit /b
1017if exist "%SystemRoot%\Servicing\Packages\Microsoft-Windows-Server*CorEdition~*.mum" (set Cor=Cor) else (set Cor=)
1018
959set h= 1019set h=
960for %%# in ( 1020for %%# in (
96144N%h%YX-TK%h%R9D-CCM2%h%D-V6%h%B8F-HQ%h%WWR__Volume:MAK_Enterprise 1021XGV%h%PP-NM%h%H47-7TT%h%HJ-W%h%3FW7-8HV%h%2C__OEM:NONSLP_Enterprise
962D6R%h%D9-D4%h%N8T-RT9Q%h%X-YW%h%6YT-FC%h%WWJ______Retail_Starter 1022D6R%h%D9-D4%h%N8T-RT9%h%QX-Y%h%W6YT-FCW%h%WJ______Retail_Starter
9633V6%h%Q6-NQ%h%XCX-V8YX%h%R-9Q%h%CYV-QP%h%FCT__Volume:MAK_EnterpriseN 10233V6%h%Q6-NQ%h%XCX-V8Y%h%XR-9%h%QCYV-QPF%h%CT__Volume:MAK_EnterpriseN
9643NF%h%XW-2T%h%27M-2BDW%h%6-4G%h%HRV-68%h%XRX______Retail_StarterN 10243NF%h%XW-2T%h%27M-2BD%h%W6-4%h%GHRV-68X%h%RX______Retail_StarterN
965VK7%h%JG-NP%h%HTM-C97J%h%M-9M%h%PGT-3V%h%66T______Retail_Professional 1025VK7%h%JG-NP%h%HTM-C97%h%JM-9%h%MPGT-3V6%h%6T______Retail_Professional
9662B8%h%7N-8K%h%FHP-DKV6%h%R-Y2%h%C8J-PK%h%CKT______Retail_ProfessionalN 10262B8%h%7N-8K%h%FHP-DKV%h%6R-Y%h%2C8J-PKC%h%KT______Retail_ProfessionalN
9674CP%h%RK-NM%h%3K3-X6XX%h%Q-RX%h%X86-WX%h%CHW______Retail_CoreN 10274CP%h%RK-NM%h%3K3-X6X%h%XQ-R%h%XX86-WXC%h%HW______Retail_CoreN
968N24%h%34-X9%h%D7W-8PF6%h%X-8D%h%V9T-8T%h%YMD______Retail_CoreCountrySpecific 1028N24%h%34-X9%h%D7W-8PF%h%6X-8%h%DV9T-8TY%h%MD______Retail_CoreCountrySpecific
969BT7%h%9Q-G7%h%N6G-PGBY%h%W-4Y%h%WX6-6F%h%4BT______Retail_CoreSingleLanguage 1029BT7%h%9Q-G7%h%N6G-PGB%h%YW-4%h%YWX6-6F4%h%BT______Retail_CoreSingleLanguage
970YTM%h%G3-N6%h%DKC-DKB7%h%7-7M%h%9GH-8H%h%VX7______Retail_Core 1030YTM%h%G3-N6%h%DKC-DKB%h%77-7%h%M9GH-8HV%h%X7______Retail_Core
971XKC%h%NC-J2%h%6Q9-KFHD%h%2-FK%h%THY-KD%h%72Y__OEM:NONSLP_PPIPro 1031XKC%h%NC-J2%h%6Q9-KFH%h%D2-F%h%KTHY-KD7%h%2Y__OEM:NONSLP_PPIPro
972YNM%h%GQ-8R%h%YV3-4PGQ%h%3-C8%h%XTP-7C%h%FBY______Retail_Education 1032YNM%h%GQ-8R%h%YV3-4PG%h%Q3-C%h%8XTP-7CF%h%BY______Retail_Education
97384N%h%GF-MH%h%BT6-FXBX%h%8-QW%h%JK7-DR%h%R8H______Retail_EducationN 103384N%h%GF-MH%h%BT6-FXB%h%X8-Q%h%WJK7-DRR%h%8H______Retail_EducationN
974KCN%h%VH-YK%h%WX8-GJJB%h%9-H9%h%FDT-6F%h%7W2__Volume:MAK_EnterpriseS_VB 1034NK9%h%6Y-D9%h%CD8-W44%h%CQ-R%h%8YTK-DYJ%h%WX__OEM:NONSLP_EnterpriseS_RS1
975VBX%h%36-N7%h%DDY-M9H6%h%2-83%h%BMJ-CP%h%R42__Volume:MAK_EnterpriseS_RS5 1035FWN%h%7H-PF%h%93Q-4GG%h%P8-M%h%8RF3-MDW%h%WW__OEM:NONSLP_EnterpriseS_TH
976PN3%h%KR-JX%h%M7T-46HM%h%4-MC%h%QGK-7X%h%PJQ__Volume:MAK_EnterpriseS_RS1 10362DB%h%W3-N2%h%PJG-MVH%h%W3-G%h%7TDK-9HK%h%R4__Volume:MAK_EnterpriseSN_RS1
977DVW%h%KN-3G%h%CMV-Q2XF%h%4-DD%h%PGM-VQ%h%WWY__Volume:MAK_EnterpriseS_TH 1037NTX%h%6B-BR%h%YC2-K67%h%86-F%h%6MVQ-M7V%h%2X__Volume:MAK_EnterpriseSN_TH
978RQF%h%NW-9T%h%PM3-JQ73%h%T-QV%h%4VQ-DV%h%9PT__Volume:MAK_EnterpriseSN_VB 1038G3K%h%NM-CH%h%G6T-R36%h%X3-9%h%QDG6-8M8%h%K9______Retail_ProfessionalSingleLanguage
979M33%h%WV-NH%h%Y3C-R7FP%h%M-BQ%h%GPT-23%h%9PG__Volume:MAK_EnterpriseSN_RS5 1039HNG%h%CC-Y3%h%8KG-QVK%h%8D-W%h%MWRK-X86%h%VK______Retail_ProfessionalCountrySpecific
9802DB%h%W3-N2%h%PJG-MVHW%h%3-G7%h%TDK-9H%h%KR4__Volume:MAK_EnterpriseSN_RS1 1040DXG%h%7C-N3%h%6C4-C4H%h%TG-X%h%4T3X-2YV%h%77______Retail_ProfessionalWorkstation
981NTX%h%6B-BR%h%YC2-K678%h%6-F6%h%MVQ-M7%h%V2X__Volume:MAK_EnterpriseSN_TH 1041WYP%h%NQ-8C%h%467-V2W%h%6J-T%h%X4WX-WT2%h%RQ______Retail_ProfessionalWorkstationN
982G3K%h%NM-CH%h%G6T-R36X%h%3-9Q%h%DG6-8M%h%8K9______Retail_ProfessionalSingleLanguage 10428PT%h%T6-RN%h%W4C-6V7%h%J2-C%h%2D3X-MHB%h%PB______Retail_ProfessionalEducation
983HNG%h%CC-Y3%h%8KG-QVK8%h%D-WM%h%WRK-X8%h%6VK______Retail_ProfessionalCountrySpecific 1043GJT%h%YN-HD%h%MQY-FRR%h%76-H%h%VGC7-QPF%h%8P______Retail_ProfessionalEducationN
984DXG%h%7C-N3%h%6C4-C4HT%h%G-X4%h%T3X-2Y%h%V77______Retail_ProfessionalWorkstation 1044C4N%h%TJ-CX%h%6Q2-VXD%h%MR-X%h%VKGM-F9D%h%JC__Volume:MAK_EnterpriseG
985WYP%h%NQ-8C%h%467-V2W6%h%J-TX%h%4WX-WT%h%2RQ______Retail_ProfessionalWorkstationN 104546P%h%N6-R9%h%BK9-CVH%h%KB-H%h%WQ9V-MBJ%h%Y8__Volume:MAK_EnterpriseGN
9868PT%h%T6-RN%h%W4C-6V7J%h%2-C2%h%D3X-MH%h%BPB______Retail_ProfessionalEducation 1046NJC%h%F7-PW%h%8QT-332%h%4D-6%h%88JX-2YV%h%66______Retail_ServerRdsh
987GJT%h%YN-HD%h%MQY-FRR7%h%6-HV%h%GC7-QP%h%F8P______Retail_ProfessionalEducationN 1047V3W%h%VW-N2%h%PV2-CGW%h%C3-3%h%4QGF-VMJ%h%2C______Retail_Cloud
988C4N%h%TJ-CX%h%6Q2-VXDM%h%R-XV%h%KGM-F9%h%DJC__Volume:MAK_EnterpriseG 1048NH9%h%J3-68%h%WK7-6FB%h%93-4%h%K3DF-DJ4%h%F6______Retail_CloudN
98946P%h%N6-R9%h%BK9-CVHK%h%B-HW%h%Q9V-MB%h%JY8__Volume:MAK_EnterpriseGN 10492HN%h%6V-HG%h%TM8-6C9%h%7C-R%h%K67V-JQP%h%FD______Retail_CloudE
990NJC%h%F7-PW%h%8QT-3324%h%D-68%h%8JX-2Y%h%V66______Retail_ServerRdsh 1050WC2%h%BQ-8N%h%RM3-FDD%h%YY-2%h%BFGV-KHK%h%QY_Volume:GVLK_ServerStandard%Cor%_RS1
991V3W%h%VW-N2%h%PV2-CGWC%h%3-34%h%QGF-VM%h%J2C______Retail_Cloud 1051CB7%h%KF-BW%h%N84-R7R%h%2Y-7%h%93K2-8XD%h%DG_Volume:GVLK_ServerDatacenter%Cor%_RS1
992NH9%h%J3-68%h%WK7-6FB9%h%3-4K%h%3DF-DJ%h%4F6______Retail_CloudN 1052JCK%h%RF-N3%h%7P4-C2D%h%82-9%h%YXRT-4M6%h%3B_Volume:GVLK_ServerSolution_RS1
9932HN%h%6V-HG%h%TM8-6C97%h%C-RK%h%67V-JQ%h%PFD______Retail_CloudE 1053QN4%h%C6-GB%h%JD2-FB4%h%22-G%h%HWJK-GJG%h%2R_Volume:GVLK_ServerCloudStorage_RS1
994XQQ%h%YW-NF%h%FMW-XJPB%h%H-K8%h%732-CK%h%FFD______OEM:DM_IoTEnterprise 1054VP3%h%4G-4N%h%PPG-79J%h%TQ-8%h%64T4-R3M%h%QX_Volume:GVLK_ServerAzureCor_RS1
995QPM%h%6N-7J%h%2WJ-P88H%h%H-P3%h%YRH-YY%h%74H__OEM:NONSLP_IoTEnterpriseS_VB 10559JQ%h%NQ-V8%h%HQ6-PKB%h%8H-G%h%GHRY-R62%h%H6______Retail_ServerAzureNano_RS1
996KBN%h%8V-HF%h%GQ4-MGXV%h%D-34%h%7P6-PD%h%QGT_Volume:GVLK_IoTEnterpriseS_NI 1056VN8%h%D3-PR%h%82H-DB6%h%BJ-J%h%9P4M-92F%h%6J______Retail_ServerStorageStandard_RS1
997K9V%h%KN-3B%h%GWV-Y624%h%W-MC%h%RMQ-BH%h%DCD______Retail_CloudEditionN 105748T%h%QX-NV%h%K3R-D8Q%h%R3-G%h%THHM-8FH%h%XC______Retail_ServerStorageWorkgroup_RS1
998KY7%h%PN-VR%h%6RX-83W6%h%Y-6D%h%DYQ-T6%h%R4W______Retail_CloudEdition 10582HX%h%DN-KR%h%XHB-GPY%h%C7-Y%h%CKFJ-7FV%h%DG_Volume:GVLK_ServerDatacenterACor_RS3
999MPB%h%3G-XN%h%BR7-CC43%h%M-FG%h%64B-F9%h%GBK______Retail_IoTEnterpriseSK 1059PTX%h%N8-JF%h%HJM-4WC%h%78-M%h%PCBR-9W4%h%KR_Volume:GVLK_ServerStandardACor_RS3
1000) do ( 1060) do (
1001for /f "tokens=1-4 delims=_" %%A in ("%%#") do if /i %targetedition%==%%C ( 1061for /f "tokens=1-4 delims=_" %%A in ("%%#") do if /i %targetedition%==%%C (
1002 1062
@@ -1005,7 +1065,7 @@ set 4th=%%D
1005if not defined 4th ( 1065if not defined 4th (
1006set "key=%%A" & set "_chan=%%B" 1066set "key=%%A" & set "_chan=%%B"
1007) else ( 1067) else (
1008echo "%branch%" | find "%%D" 1>nul && (set "key=%%A" & set "_chan=%%B") 1068echo "%branch%" | find /i "%%D" %nul1% && (set "key=%%A" & set "_chan=%%B")
1009) 1069)
1010) 1070)
1011) 1071)
@@ -1013,30 +1073,4 @@ echo "%branch%" | find "%%D" 1>nul && (set "key=%%A" & set "_chan=%%B")
1013exit /b 1073exit /b
1014 1074
1015::======================================================================================================================================== 1075::========================================================================================================================================
1016 1076:: Leave empty line below
1017:changeeditionserverdata
1018
1019if exist "%SystemRoot%\Servicing\Packages\Microsoft-Windows-Server*CorEdition~*.mum" (set Cor=Cor) else (set Cor=)
1020
1021:: Only RS3 and older version keys (GVLK/Generic Retail) are stored here, later ones are extracted from the system itself
1022
1023set h=
1024for %%# in (
1025WC2%h%BQ-8N%h%RM3-FDD%h%YY-2B%h%FGV-KHK%h%QY_RS1_ServerStandard%Cor%
1026CB7%h%KF-BW%h%N84-R7R%h%2Y-79%h%3K2-8XD%h%DG_RS1_ServerDatacenter%Cor%
1027JCK%h%RF-N3%h%7P4-C2D%h%82-9Y%h%XRT-4M6%h%3B_RS1_ServerSolution
1028QN4%h%C6-GB%h%JD2-FB4%h%22-GH%h%WJK-GJG%h%2R_RS1_ServerCloudStorage
1029VP3%h%4G-4N%h%PPG-79J%h%TQ-86%h%4T4-R3M%h%QX_RS1_ServerAzureCor
10309JQ%h%NQ-V8%h%HQ6-PKB%h%8H-GG%h%HRY-R62%h%H6_RS1_ServerAzureNano
1031VN8%h%D3-PR%h%82H-DB6%h%BJ-J9%h%P4M-92F%h%6J_RS1_ServerStorageStandard
103248T%h%QX-NV%h%K3R-D8Q%h%R3-GT%h%HHM-8FH%h%XC_RS1_ServerStorageWorkgroup
10332HX%h%DN-KR%h%XHB-GPY%h%C7-YC%h%KFJ-7FV%h%DG_RS3_ServerDatacenterACor
1034PTX%h%N8-JF%h%HJM-4WC%h%78-MP%h%CBR-9W4%h%KR_RS3_ServerStandardACor
1035) do (
1036for /f "tokens=1-3 delims=_" %%A in ("%%#") do if /i %targetedition%==%%C (
1037echo "%branch%" | find /i "%%B" 1>nul && (set "key=%%A")
1038)
1039)
1040exit /b
1041
1042::======================================================================================================================================== \ No newline at end of file
diff --git a/MAS/Separate-Files-Version/Check-Activation-Status-vbs.cmd b/MAS/Separate-Files-Version/Check-Activation-Status-vbs.cmd
index 471036c..a7b8685 100644
--- a/MAS/Separate-Files-Version/Check-Activation-Status-vbs.cmd
+++ b/MAS/Separate-Files-Version/Check-Activation-Status-vbs.cmd
@@ -39,12 +39,11 @@ set "Path=%SystemRoot%\Sysnative;%SystemRoot%\Sysnative\Wbem;%SystemRoot%\Sysnat
39:: Check LF line ending 39:: Check LF line ending
40 40
41pushd "%~dp0" 41pushd "%~dp0"
42>nul findstr /rxc:".*" "%~nx0" 42>nul findstr /v "$" "%~nx0" && (
43if not %errorlevel%==0 (
44echo: 43echo:
45echo Error: Script either has LF line ending issue, or it failed to read itself. 44echo Error: Script either has LF line ending issue or an empty line at the end of the script is missing.
46echo: 45echo:
47ping 127.0.0.1 -n 6 > nul 46ping 127.0.0.1 -n 6 >nul
48popd 47popd
49exit /b 48exit /b
50) 49)
@@ -230,4 +229,5 @@ cscript //nologo "!office!\ospp.vbs" /dstatus
230echo. 229echo.
231echo Press any key to exit. 230echo Press any key to exit.
232pause >nul 231pause >nul
233exit /b \ No newline at end of file 232exit /b
233:: Leave empty line below
diff --git a/MAS/Separate-Files-Version/Check-Activation-Status-wmi.cmd b/MAS/Separate-Files-Version/Check-Activation-Status-wmi.cmd
index 2df64ec..f5eb509 100644
--- a/MAS/Separate-Files-Version/Check-Activation-Status-wmi.cmd
+++ b/MAS/Separate-Files-Version/Check-Activation-Status-wmi.cmd
@@ -67,12 +67,11 @@ set "Path=%SystemRoot%\Sysnative;%SystemRoot%\Sysnative\Wbem;%SystemRoot%\Sysnat
67:: Check LF line ending 67:: Check LF line ending
68 68
69pushd "%~dp0" 69pushd "%~dp0"
70>nul findstr /rxc:".*" "%~nx0" 70>nul findstr /v "$" "%~nx0" && (
71if not %errorlevel%==0 (
72echo: 71echo:
73echo Error: Script either has LF line ending issue, or it failed to read itself. 72echo Error: Script either has LF line ending issue or an empty line at the end of the script is missing.
74echo: 73echo:
75ping 127.0.0.1 -n 6 > nul 74ping 127.0.0.1 -n 6 >nul
76popd 75popd
77exit /b 76exit /b
78) 77)
@@ -536,4 +535,5 @@ PrintLicensesInformation -Mode "NUL"
536 Write-Host 535 Write-Host
537PrintLicensesInformation -Mode "Device" 536PrintLicensesInformation -Mode "Device"
538:vNextDiag: 537:vNextDiag:
539::=================================================== \ No newline at end of file 538::===================================================
539:: Leave empty line below
diff --git a/MAS/Separate-Files-Version/Extract_OEM_Folder.cmd b/MAS/Separate-Files-Version/Extract_OEM_Folder.cmd
index 0883f24..4b07b57 100644
--- a/MAS/Separate-Files-Version/Extract_OEM_Folder.cmd
+++ b/MAS/Separate-Files-Version/Extract_OEM_Folder.cmd
@@ -7,16 +7,22 @@
7:: 7::
8:: This script is a part of 'Microsoft_Activation_Scripts' (MAS) project. 8:: This script is a part of 'Microsoft_Activation_Scripts' (MAS) project.
9:: 9::
10:: Homepage: mass grave.dev 10:: Homepage: mass grave[.]dev
11:: Email: windowsaddict@protonmail.com 11:: Email: windowsaddict@protonmail.com
12:: 12::
13::============================================================================ 13::============================================================================
14 14
15 15
16 16
17
18::======================================================================================================================================== 17::========================================================================================================================================
19 18
19:: Set Path variable, it helps if it is misconfigured in the system
20
21set "PATH=%SystemRoot%\System32;%SystemRoot%\System32\wbem;%SystemRoot%\System32\WindowsPowerShell\v1.0\"
22if exist "%SystemRoot%\Sysnative\reg.exe" (
23set "PATH=%SystemRoot%\Sysnative;%SystemRoot%\Sysnative\wbem;%SystemRoot%\Sysnative\WindowsPowerShell\v1.0\;%PATH%"
24)
25
20:: Re-launch the script with x64 process if it was initiated by x86 process on x64 bit Windows 26:: Re-launch the script with x64 process if it was initiated by x86 process on x64 bit Windows
21:: or with ARM64 process if it was initiated by x86/ARM32 process on ARM64 Windows 27:: or with ARM64 process if it was initiated by x86/ARM32 process on ARM64 Windows
22 28
@@ -24,6 +30,10 @@ set "_cmdf=%~f0"
24for %%# in (%*) do ( 30for %%# in (%*) do (
25if /i "%%#"=="r1" set r1=1 31if /i "%%#"=="r1" set r1=1
26if /i "%%#"=="r2" set r2=1 32if /i "%%#"=="r2" set r2=1
33if /i "%%#"=="-qedit" (
34reg add HKCU\Console /v QuickEdit /t REG_DWORD /d "1" /f %nul1%
35rem check the code below admin elevation to understand why it's here
36)
27) 37)
28 38
29if exist %SystemRoot%\Sysnative\cmd.exe if not defined r1 ( 39if exist %SystemRoot%\Sysnative\cmd.exe if not defined r1 (
@@ -40,22 +50,34 @@ start %SystemRoot%\SysArm32\cmd.exe /c ""!_cmdf!" %* r2"
40exit /b 50exit /b
41) 51)
42 52
43:: Set Path variable, it helps if it is misconfigured in the system 53::========================================================================================================================================
44 54
45set "PATH=%SystemRoot%\System32;%SystemRoot%\System32\wbem;%SystemRoot%\System32\WindowsPowerShell\v1.0\" 55set "blank="
46if exist "%SystemRoot%\Sysnative\reg.exe" ( 56set "mas=mass%blank%grave.dev"
47set "PATH=%SystemRoot%\Sysnative;%SystemRoot%\Sysnative\wbem;%SystemRoot%\Sysnative\WindowsPowerShell\v1.0\;%PATH%" 57
58:: Check if Null service is working, it's important for the batch script
59
60sc query Null | find /i "RUNNING"
61if %errorlevel% NEQ 0 (
62echo:
63echo Null service is not running, script may crash...
64echo:
65echo:
66echo Help - https://%mas%/troubleshoot.html
67echo:
68echo:
69ping 127.0.0.1 -n 10
48) 70)
71cls
49 72
50:: Check LF line ending 73:: Check LF line ending
51 74
52pushd "%~dp0" 75pushd "%~dp0"
53>nul findstr /rxc:".*" "%~nx0" 76>nul findstr /v "$" "%~nx0" && (
54if not %errorlevel%==0 (
55echo: 77echo:
56echo Error: Script either has LF line ending issue, or it failed to read itself. 78echo Error: Script either has LF line ending issue or an empty line at the end of the script is missing.
57echo: 79echo:
58ping 127.0.0.1 -n 6 > nul 80ping 127.0.0.1 -n 6 >nul
59popd 81popd
60exit /b 82exit /b
61) 83)
@@ -67,27 +89,44 @@ cls
67color 07 89color 07
68title Extract $OEM$ Folder 90title Extract $OEM$ Folder
69 91
70set winbuild=1 92set _args=
93set _elev=
94
95set _args=%*
96if defined _args set _args=%_args:"=%
97if defined _args (
98for %%A in (%_args%) do (
99if /i "%%A"=="-el" set _elev=1
100)
101)
102
103set "nul1=1>nul"
104set "nul2=2>nul"
105set "nul6=2^>nul"
71set "nul=>nul 2>&1" 106set "nul=>nul 2>&1"
107
72set psc=powershell.exe 108set psc=powershell.exe
109set winbuild=1
73for /f "tokens=6 delims=[]. " %%G in ('ver') do set winbuild=%%G 110for /f "tokens=6 delims=[]. " %%G in ('ver') do set winbuild=%%G
74 111
75set _NCS=1 112set _NCS=1
76if %winbuild% LSS 10586 set _NCS=0 113if %winbuild% LSS 10586 set _NCS=0
77if %winbuild% GEQ 10586 reg query "HKCU\Console" /v ForceV2 2>nul | find /i "0x0" 1>nul && (set _NCS=0) 114if %winbuild% GEQ 10586 reg query "HKCU\Console" /v ForceV2 %nul2% | find /i "0x0" %nul1% && (set _NCS=0)
78 115
79if %_NCS% EQU 1 ( 116if %_NCS% EQU 1 (
80for /F %%a in ('echo prompt $E ^| cmd') do set "esc=%%a" 117for /F %%a in ('echo prompt $E ^| cmd') do set "esc=%%a"
81set "Red="41;97m"" 118set "Red="41;97m""
119set "Gray="100;97m""
82set "Green="42;97m"" 120set "Green="42;97m""
83set "Magenta="45;97m"" 121set "Blue="44;97m""
84set "_White="40;37m"" 122set "_White="40;37m""
85set "_Green="40;92m"" 123set "_Green="40;92m""
86set "_Yellow="40;93m"" 124set "_Yellow="40;93m""
87) else ( 125) else (
88set "Red="Red" "white"" 126set "Red="Red" "white""
127set "Gray="Darkgray" "white""
89set "Green="DarkGreen" "white"" 128set "Green="DarkGreen" "white""
90set "Magenta="Darkmagenta" "white"" 129set "Blue="Blue" "white""
91set "_White="Black" "Gray"" 130set "_White="Black" "Gray""
92set "_Green="Black" "Green"" 131set "_Green="Black" "Green""
93set "_Yellow="Black" "Yellow"" 132set "_Yellow="Black" "Yellow""
@@ -100,7 +139,7 @@ set "eline=echo: &call :ex_color %Red% "==== ERROR ====" &echo:"
100 139
101if %winbuild% LSS 7600 ( 140if %winbuild% LSS 7600 (
102%nceline% 141%nceline%
103echo Unsupported OS version detected. 142echo Unsupported OS version detected [%winbuild%].
104echo Project is supported only for Windows 7/8/8.1/10/11 and their Server equivalent. 143echo Project is supported only for Windows 7/8/8.1/10/11 and their Server equivalent.
105goto done2 144goto done2
106) 145)
@@ -115,27 +154,20 @@ goto done2
115 154
116:: Fix for the special characters limitation in path name 155:: Fix for the special characters limitation in path name
117 156
118set desktop=
119for /f "skip=2 tokens=2*" %%a in ('reg query "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders" /v Desktop') do call set "desktop=%%b"
120if not defined desktop for /f "delims=" %%a in ('%psc% "& {write-host $([Environment]::GetFolderPath('Desktop'))}"') do call set "desktop=%%a"
121
122set "_work=%~dp0" 157set "_work=%~dp0"
123if "%_work:~-1%"=="\" set "_work=%_work:~0,-1%" 158if "%_work:~-1%"=="\" set "_work=%_work:~0,-1%"
124 159
125set "_batf=%~f0" 160set "_batf=%~f0"
126set "_batp=%_batf:'=''%" 161set "_batp=%_batf:'=''%"
127set "_pdesk=%desktop:'=''%"
128 162
129set _PSarg="""%~f0""" -el %_args% 163set _PSarg="""%~f0""" -el %_args%
130set "_ttemp=%temp%" 164set "_ttemp=%temp%"
131 165
132set "_dir=%desktop%\$OEM$\$$\Setup\Scripts"
133
134setlocal EnableDelayedExpansion 166setlocal EnableDelayedExpansion
135 167
136::======================================================================================================================================== 168::========================================================================================================================================
137 169
138echo "!_batf!" | find /i "!_ttemp!" 1>nul && ( 170echo "!_batf!" | find /i "!_ttemp!" %nul1% && (
139if /i not "!_work!"=="!_ttemp!" ( 171if /i not "!_work!"=="!_ttemp!" (
140%eline% 172%eline%
141echo Script is launched from the temp folder, 173echo Script is launched from the temp folder,
@@ -150,8 +182,8 @@ goto done2
150 182
151:: Elevate script as admin and pass arguments and preventing loop 183:: Elevate script as admin and pass arguments and preventing loop
152 184
153>nul fltmc || ( 185%nul1% fltmc || (
154if not defined _elev %nul% %psc% "start cmd.exe -arg '/c \"!_PSarg:'=''!\"' -verb runas" && exit /b 186if not defined _elev %psc% "start cmd.exe -arg '/c \"!_PSarg:'=''!\"' -verb runas" && exit /b
155%eline% 187%eline%
156echo This script require admin privileges. 188echo This script require admin privileges.
157echo To do so, right click on this script and select 'Run as administrator'. 189echo To do so, right click on this script and select 'Run as administrator'.
@@ -160,12 +192,39 @@ goto done2
160 192
161::======================================================================================================================================== 193::========================================================================================================================================
162 194
163if not exist "!desktop!\" ( 195:: This code disables QuickEdit for this cmd.exe session only without making permanent changes to the registry
196:: It is added because clicking on the script window pauses the operation and leads to the confusion that script stopped due to an error
197
198for %%# in (%_args%) do (if /i "%%#"=="-qedit" set quedit=1)
199
200reg query HKCU\Console /v QuickEdit %nul2% | find /i "0x0" %nul1% || if not defined quedit (
201reg add HKCU\Console /v QuickEdit /t REG_DWORD /d "0" /f %nul1%
202start cmd.exe /c ""!_batf!" %_args% -qedit"
203rem quickedit reset code is added at the starting of the script instead of here because it takes time to reflect in some cases
204exit /b
205)
206
207::========================================================================================================================================
208
209setlocal DisableDelayedExpansion
210
211:: Check desktop location
212
213set desktop=
214for /f "skip=2 tokens=2*" %%a in ('reg query "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders" /v Desktop') do call set "desktop=%%b"
215if not defined desktop for /f "delims=" %%a in ('%psc% "& {write-host $([Environment]::GetFolderPath('Desktop'))}"') do call set "desktop=%%a"
216
217set "_pdesk=%desktop:'=''%"
218set "_dir=%desktop%\$OEM$\$$\Setup\Scripts"
219
220if exist "!desktop!\" (
164%eline% 221%eline%
165echo Desktop location was not detected, aborting... 222echo Desktop location was not detected, aborting...
166goto done2 223goto done2
167) 224)
168 225
226setlocal EnableDelayedExpansion
227
169::======================================================================================================================================== 228::========================================================================================================================================
170 229
171mode con cols=78 lines=30 230mode con cols=78 lines=30
@@ -181,7 +240,9 @@ goto done2
181set HWID_Activation.cmd=Activators\HWID_Activation.cmd 240set HWID_Activation.cmd=Activators\HWID_Activation.cmd
182set KMS38_Activation.cmd=Activators\KMS38_Activation.cmd 241set KMS38_Activation.cmd=Activators\KMS38_Activation.cmd
183set Online_KMS_Activation.cmd=Activators\Online_KMS_Activation.cmd 242set Online_KMS_Activation.cmd=Activators\Online_KMS_Activation.cmd
184 243set Ohook_Activation.cmd=Activators\Ohook_Activation\Ohook_Activation.cmd
244set sppc32.dll=Activators\Ohook_Activation\BIN\sppc32.dll
245set sppc64.dll=Activators\Ohook_Activation\BIN\sppc64.dll
185pushd "!_work!" 246pushd "!_work!"
186 247
187set _nofile= 248set _nofile=
@@ -189,6 +250,9 @@ for %%# in (
189%HWID_Activation.cmd% 250%HWID_Activation.cmd%
190%KMS38_Activation.cmd% 251%KMS38_Activation.cmd%
191%Online_KMS_Activation.cmd% 252%Online_KMS_Activation.cmd%
253%Ohook_Activation.cmd%
254%sppc32.dll%
255%sppc64.dll%
192) do ( 256) do (
193if not exist "%%#" set _nofile=1 257if not exist "%%#" set _nofile=1
194) 258)
@@ -213,29 +277,38 @@ echo:
213echo: 277echo:
214echo: 278echo:
215echo: 279echo:
216echo:
217echo: Extract $OEM$ folder on the desktop 280echo: Extract $OEM$ folder on the desktop
218echo: ________________________________________________________ 281echo: ________________________________________________________
219echo: 282echo:
220echo: [1] HWID 283echo: [1] HWID
221echo: [2] KMS38 284echo: [2] Ohook
222echo: [3] Online KMS 285echo: [3] KMS38
223echo: 286echo: [4] Online KMS
224echo: [4] HWID ^(Windows^) ^+ Online KMS ^(Office^) 287echo:
225echo: [5] KMS38 ^(Windows^) ^+ Online KMS ^(Office^) 288echo: [5] HWID ^(Windows^) ^+ Ohook ^(Office^)
226echo: 289echo: [6] HWID ^(Windows^) ^+ Online KMS ^(Office^)
227echo: [0] Exit 290echo: [7] KMS38 ^(Windows^) ^+ Ohook ^(Office^)
291echo: [8] KMS38 ^(Windows^) ^+ Online KMS ^(Office^)
292echo: [9] Online KMS ^(Windows^) ^+ Ohook ^(Office^)
293echo:
294call :ex_color2 %_White% " [R] " %_Green% "ReadMe"
295echo: [0] Exit
228echo: ________________________________________________________ 296echo: ________________________________________________________
229echo: 297echo:
230call :ex_color2 %_White% " " %_Green% "Enter a menu option in the Keyboard [1,2,3,4,5,0]" 298call :ex_color2 %_White% " " %_Green% "Enter a menu option in the Keyboard :"
231choice /C:123450 /N 299choice /C:123456789R0 /N
232set _erl=%errorlevel% 300set _erl=%errorlevel%
233 301
234if %_erl%==6 exit /b 302if %_erl%==11 exit /b
235if %_erl%==5 goto:kms38_kms 303if %_erl%==10 start https://%mas%/oem-folder.html &goto :Menu
236if %_erl%==4 goto:hwid_kms 304if %_erl%==9 goto:kms_ohook
237if %_erl%==3 goto:kms 305if %_erl%==8 goto:kms38_kms
238if %_erl%==2 goto:kms38 306if %_erl%==7 goto:kms38_ohook
307if %_erl%==6 goto:hwid_kms
308if %_erl%==5 goto:hwid_ohook
309if %_erl%==4 goto:kms
310if %_erl%==3 goto:kms38
311if %_erl%==2 goto:ohook
239if %_erl%==1 goto:hwid 312if %_erl%==1 goto:hwid
240goto :Menu 313goto :Menu
241 314
@@ -271,6 +344,40 @@ cd \
271 344
272::======================================================================================================================================== 345::========================================================================================================================================
273 346
347:ohook
348
349cls
350md "!desktop!\$OEM$\$$\Setup\Scripts\BIN"
351pushd "!_work!"
352copy /y /b "%Ohook_Activation.cmd%" "!_dir!\Ohook_Activation.cmd" %nul%
353copy /y /b "%sppc32.dll%" "!_dir!\BIN\sppc32.dll" %nul%
354copy /y /b "%sppc64.dll%" "!_dir!\BIN\sppc64.dll" %nul%
355popd
356call :export ohook_setup
357
358set _error=
359if not exist "!_dir!\Ohook_Activation.cmd" set _error=1
360if not exist "!_dir!\BIN\sppc32.dll" set _error=1
361if not exist "!_dir!\BIN\sppc64.dll" set _error=1
362if not exist "!_dir!\SetupComplete.cmd" set _error=1
363if defined _error goto errorfound
364
365set oem=Ohook
366goto done
367
368:ohook_setup:
369@echo off
370
371fltmc >nul || exit /b
372
373start /b /wait cmd /c "%~dp0Ohook_Activation.cmd" /Ohook
374
375cd \
376(goto) 2>nul & (if "%~dp0"=="%SystemRoot%\Setup\Scripts\" rd /s /q "%~dp0")
377:ohook_setup:
378
379::========================================================================================================================================
380
274:kms38 381:kms38
275 382
276cls 383cls
@@ -331,6 +438,44 @@ cd \
331 438
332::======================================================================================================================================== 439::========================================================================================================================================
333 440
441:hwid_ohook
442
443cls
444md "!desktop!\$OEM$\$$\Setup\Scripts\BIN"
445pushd "!_work!"
446copy /y /b "%HWID_Activation.cmd%" "!_dir!\HWID_Activation.cmd" %nul%
447copy /y /b "%Ohook_Activation.cmd%" "!_dir!\Ohook_Activation.cmd" %nul%
448copy /y /b "%sppc32.dll%" "!_dir!\BIN\sppc32.dll" %nul%
449copy /y /b "%sppc64.dll%" "!_dir!\BIN\sppc64.dll" %nul%
450popd
451call :export hwid_ohook_setup
452
453set _error=
454if not exist "!_dir!\HWID_Activation.cmd" set _error=1
455if not exist "!_dir!\Ohook_Activation.cmd" set _error=1
456if not exist "!_dir!\BIN\sppc32.dll" set _error=1
457if not exist "!_dir!\BIN\sppc64.dll" set _error=1
458if not exist "!_dir!\SetupComplete.cmd" set _error=1
459if defined _error goto errorfound
460
461set oem=HWID [Windows] + Ohook [Office]
462goto done
463
464:hwid_ohook_setup:
465@echo off
466
467fltmc >nul || exit /b
468
469start /b /wait cmd /c "%~dp0HWID_Activation.cmd" /HWID
470
471start /b /wait cmd /c "%~dp0Ohook_Activation.cmd" /Ohook
472
473cd \
474(goto) 2>nul & (if "%~dp0"=="%SystemRoot%\Setup\Scripts\" rd /s /q "%~dp0")
475:hwid_ohook_setup:
476
477::========================================================================================================================================
478
334:hwid_kms 479:hwid_kms
335 480
336cls 481cls
@@ -365,6 +510,44 @@ cd \
365 510
366::======================================================================================================================================== 511::========================================================================================================================================
367 512
513:kms38_ohook
514
515cls
516md "!desktop!\$OEM$\$$\Setup\Scripts\BIN"
517pushd "!_work!"
518copy /y /b "%KMS38_Activation.cmd%" "!_dir!\KMS38_Activation.cmd" %nul%
519copy /y /b "%Ohook_Activation.cmd%" "!_dir!\Ohook_Activation.cmd" %nul%
520copy /y /b "%sppc32.dll%" "!_dir!\BIN\sppc32.dll" %nul%
521copy /y /b "%sppc64.dll%" "!_dir!\BIN\sppc64.dll" %nul%
522popd
523call :export kms38_ohook_setup
524
525set _error=
526if not exist "!_dir!\KMS38_Activation.cmd" set _error=1
527if not exist "!_dir!\Ohook_Activation.cmd" set _error=1
528if not exist "!_dir!\BIN\sppc32.dll" set _error=1
529if not exist "!_dir!\BIN\sppc64.dll" set _error=1
530if not exist "!_dir!\SetupComplete.cmd" set _error=1
531if defined _error goto errorfound
532
533set oem=KMS38 [Windows] + Ohook [Office]
534goto done
535
536:kms38_ohook_setup:
537@echo off
538
539fltmc >nul || exit /b
540
541start /b /wait cmd /c "%~dp0KMS38_Activation.cmd" /KMS38
542
543start /b /wait cmd /c "%~dp0Ohook_Activation.cmd" /Ohook
544
545cd \
546(goto) 2>nul & (if "%~dp0"=="%SystemRoot%\Setup\Scripts\" rd /s /q "%~dp0")
547:kms38_ohook_setup:
548
549::========================================================================================================================================
550
368:kms38_kms 551:kms38_kms
369 552
370cls 553cls
@@ -399,6 +582,44 @@ cd \
399 582
400::======================================================================================================================================== 583::========================================================================================================================================
401 584
585:kms_ohook
586
587cls
588md "!desktop!\$OEM$\$$\Setup\Scripts\BIN"
589pushd "!_work!"
590copy /y /b "%Online_KMS_Activation.cmd%" "!_dir!\Online_KMS_Activation.cmd" %nul%
591copy /y /b "%Ohook_Activation.cmd%" "!_dir!\Ohook_Activation.cmd" %nul%
592copy /y /b "%sppc32.dll%" "!_dir!\BIN\sppc32.dll" %nul%
593copy /y /b "%sppc64.dll%" "!_dir!\BIN\sppc64.dll" %nul%
594popd
595call :export kms_ohook_setup
596
597set _error=
598if not exist "!_dir!\Online_KMS_Activation.cmd" set _error=1
599if not exist "!_dir!\Ohook_Activation.cmd" set _error=1
600if not exist "!_dir!\BIN\sppc32.dll" set _error=1
601if not exist "!_dir!\BIN\sppc64.dll" set _error=1
602if not exist "!_dir!\SetupComplete.cmd" set _error=1
603if defined _error goto errorfound
604
605set oem=Online KMS [Windows] + Ohook [Office]
606goto done
607
608:kms_ohook_setup:
609@echo off
610
611fltmc >nul || exit /b
612
613start /b /wait cmd /c "%~dp0Online_KMS_Activation.cmd" /KMS-ActAndRenewalTask /KMS-Windows
614
615start /b /wait cmd /c "%~dp0Ohook_Activation.cmd" /Ohook
616
617cd \
618(goto) 2>nul & (if "%~dp0"=="%SystemRoot%\Setup\Scripts\" rd /s /q "%~dp0")
619:kms_ohook_setup:
620
621::========================================================================================================================================
622
402:errorfound 623:errorfound
403 624
404%eline% 625%eline%
@@ -407,15 +628,14 @@ goto :done2
407 628
408:done 629:done
409 630
410set -=
411echo ______________________________________________________________ 631echo ______________________________________________________________
412echo: 632echo:
413call :ex_color %Magenta% "%oem%" 633call :ex_color %Blue% "%oem%"
414call :ex_color %Green% "$OEM$ folder is successfully created on the Desktop." 634call :ex_color %Green% "$OEM$ folder is successfully created on the Desktop."
415echo "%oem%" | find /i "38" %nul% && ( 635echo "%oem%" | find /i "38" %nul% && (
416echo: 636echo:
417echo To KMS38 activate Server Cor/Acor editions ^(No GUI Versions^), 637echo To KMS38 activate Server Cor/Acor editions ^(No GUI Versions^),
418echo Check this page https://mass%-%grave.dev/oem-folder 638echo Check this page https://%mas%/oem-folder
419) 639)
420echo ______________________________________________________________ 640echo ______________________________________________________________
421 641
@@ -423,7 +643,7 @@ echo ______________________________________________________________
423 643
424echo: 644echo:
425call :ex_color %_Yellow% "Press any key to exit..." 645call :ex_color %_Yellow% "Press any key to exit..."
426pause >nul 646pause %nul1%
427exit /b 647exit /b
428 648
429::======================================================================================================================================== 649::========================================================================================================================================
@@ -432,7 +652,7 @@ exit /b
432 652
433:export 653:export
434 654
435%nul% %psc% "$f=[io.file]::ReadAllText('!_batp!') -split \":%~1\:.*`r`n\"; [io.file]::WriteAllText('!_pdesk!\$OEM$\$$\Setup\Scripts\SetupComplete.cmd',$f[1].Trim(),[System.Text.Encoding]::ASCII);" 655%psc% "$f=[io.file]::ReadAllText('!_batp!') -split \":%~1\:.*`r`n\"; [io.file]::WriteAllText('!_pdesk!\$OEM$\$$\Setup\Scripts\SetupComplete.cmd',$f[1].Trim(),[System.Text.Encoding]::ASCII);"
436exit /b 656exit /b
437 657
438::======================================================================================================================================== 658::========================================================================================================================================
@@ -455,4 +675,5 @@ if not exist %psc% (echo %~3%~6) else (%psc% write-host -back '%1' -fore '%2' '%
455) 675)
456exit /b 676exit /b
457 677
458::======================================================================================================================================== \ No newline at end of file 678::========================================================================================================================================
679:: Leave empty line below
diff --git a/MAS/Separate-Files-Version/Install_HWID_Key.cmd b/MAS/Separate-Files-Version/Install_HWID_Key.cmd
deleted file mode 100644
index e91745b..0000000
--- a/MAS/Separate-Files-Version/Install_HWID_Key.cmd
+++ /dev/null
@@ -1,439 +0,0 @@
1@setlocal DisableDelayedExpansion
2@echo off
3
4
5
6::============================================================================
7::
8:: This script is a part of 'Microsoft_Activation_Scripts' (MAS) project.
9::
10:: Homepage: massgrave.dev
11:: Email: windowsaddict@protonmail.com
12::
13::============================================================================
14
15
16
17:: For unattended mode, run the script with "/Insert-HWID-Key" parameter
18
19
20
21::========================================================================================================================================
22
23:: Re-launch the script with x64 process if it was initiated by x86 process on x64 bit Windows
24:: or with ARM64 process if it was initiated by x86/ARM32 process on ARM64 Windows
25
26set "_cmdf=%~f0"
27for %%# in (%*) do (
28if /i "%%#"=="r1" set r1=1
29if /i "%%#"=="r2" set r2=1
30)
31
32if exist %SystemRoot%\Sysnative\cmd.exe if not defined r1 (
33setlocal EnableDelayedExpansion
34start %SystemRoot%\Sysnative\cmd.exe /c ""!_cmdf!" %* r1"
35exit /b
36)
37
38:: Re-launch the script with ARM32 process if it was initiated by x64 process on ARM64 Windows
39
40if exist %SystemRoot%\SysArm32\cmd.exe if %PROCESSOR_ARCHITECTURE%==AMD64 if not defined r2 (
41setlocal EnableDelayedExpansion
42start %SystemRoot%\SysArm32\cmd.exe /c ""!_cmdf!" %* r2"
43exit /b
44)
45
46:: Set Path variable, it helps if it is misconfigured in the system
47
48set "PATH=%SystemRoot%\System32;%SystemRoot%\System32\wbem;%SystemRoot%\System32\WindowsPowerShell\v1.0\"
49if exist "%SystemRoot%\Sysnative\reg.exe" (
50set "PATH=%SystemRoot%\Sysnative;%SystemRoot%\Sysnative\wbem;%SystemRoot%\Sysnative\WindowsPowerShell\v1.0\;%PATH%"
51)
52
53:: Check LF line ending
54
55pushd "%~dp0"
56>nul findstr /rxc:".*" "%~nx0"
57if not %errorlevel%==0 (
58echo:
59echo Error: Script either has LF line ending issue, or it failed to read itself.
60echo:
61ping 127.0.0.1 -n 6 > nul
62popd
63exit /b
64)
65popd
66
67::========================================================================================================================================
68
69cls
70color 07
71title Install Windows HWID Key
72
73set _args=
74set _elev=
75set _unattended=0
76
77set _args=%*
78if defined _args set _args=%_args:"=%
79if defined _args (
80for %%A in (%_args%) do (
81if /i "%%A"=="-el" set _elev=1
82if /i "%%A"=="/Insert-HWID-Key" set _unattended=1
83)
84)
85
86::========================================================================================================================================
87
88set winbuild=1
89set "nul=>nul 2>&1"
90set psc=powershell.exe
91for /f "tokens=6 delims=[]. " %%G in ('ver') do set winbuild=%%G
92
93set _NCS=1
94if %winbuild% LSS 10586 set _NCS=0
95if %winbuild% GEQ 10586 reg query "HKCU\Console" /v ForceV2 2>nul | find /i "0x0" 1>nul && (set _NCS=0)
96
97if %_NCS% EQU 1 (
98for /F %%a in ('echo prompt $E ^| cmd') do set "esc=%%a"
99set "Red="41;97m""
100set "Green="42;97m""
101set "_Green="40;92m""
102set "_Yellow="40;93m""
103) else (
104set "Red="Red" "white""
105set "Green="DarkGreen" "white""
106set "_Green="Black" "Green""
107set "_Yellow="Black" "Yellow""
108)
109
110set "nceline=echo: &echo ==== ERROR ==== &echo:"
111set "eline=echo: &call :dk_color %Red% "==== ERROR ====" &echo:"
112set "line=echo ___________________________________________________________________________________________"
113if %~z0 GEQ 200000 (set "_exitmsg=Go back") else (set "_exitmsg=Exit")
114
115::========================================================================================================================================
116
117if %winbuild% LSS 10240 (
118%eline%
119echo Unsupported OS version detected.
120echo This option is supported only for Windows 10/11.
121goto ins_done
122)
123
124if exist "%SystemRoot%\Servicing\Packages\Microsoft-Windows-Server*Edition~*.mum" (
125%eline%
126echo HWID Activation is not supported for Windows Server.
127goto ins_done
128)
129
130for %%# in (powershell.exe) do @if "%%~$PATH:#"=="" (
131%nceline%
132echo Unable to find powershell.exe in the system.
133goto ins_done
134)
135
136::========================================================================================================================================
137
138:: Fix for the special characters limitation in path name
139
140set "_work=%~dp0"
141if "%_work:~-1%"=="\" set "_work=%_work:~0,-1%"
142
143set "_batf=%~f0"
144set "_batp=%_batf:'=''%"
145
146set _PSarg="""%~f0""" -el %_args%
147
148set "_ttemp=%temp%"
149
150setlocal EnableDelayedExpansion
151
152::========================================================================================================================================
153
154echo "!_batf!" | find /i "!_ttemp!" 1>nul && (
155if /i not "!_work!"=="!_ttemp!" (
156%eline%
157echo Script is launched from the temp folder,
158echo Most likely you are running the script directly from the archive file.
159echo:
160echo Extract the archive file and launch the script from the extracted folder.
161goto ins_done
162)
163)
164
165::========================================================================================================================================
166
167:: Elevate script as admin and pass arguments and preventing loop
168
169>nul fltmc || (
170if not defined _elev %nul% %psc% "start cmd.exe -arg '/c \"!_PSarg:'=''!\"' -verb runas" && exit /b
171%eline%
172echo This script require admin privileges.
173echo To do so, right click on this script and select 'Run as administrator'.
174goto ins_done
175)
176
177::========================================================================================================================================
178
179cls
180mode 98, 30
181echo:
182echo Initializing...
183call :dk_product
184call :dk_ckeckwmic
185call :dk_actids
186
187::========================================================================================================================================
188
189:: Check SKU value / Check in multiple places to find Edition change corruption
190
191set osSKU=
192set regSKU=
193set wmiSKU=
194
195for /f "tokens=3 delims=." %%a in ('reg query "HKLM\SYSTEM\CurrentControlSet\Control\ProductOptions" /v OSProductPfn 2^>nul') do set "regSKU=%%a"
196if %_wmic% EQU 1 for /f "tokens=2 delims==" %%a in ('"wmic Path Win32_OperatingSystem Get OperatingSystemSKU /format:LIST" 2^>nul') do if not errorlevel 1 set "wmiSKU=%%a"
197if %_wmic% EQU 0 for /f "tokens=1" %%a in ('%psc% "([WMI]'Win32_OperatingSystem=@').OperatingSystemSKU" 2^>nul') do if not errorlevel 1 set "wmiSKU=%%a"
198
199set osSKU=%wmiSKU%
200if not defined osSKU set osSKU=%regSKU%
201
202if not defined osSKU (
203%eline%
204echo SKU value was not detected properly. Aborting...
205goto ins_done
206)
207
208::========================================================================================================================================
209
210:: Detect key
211
212set key=
213set channel=
214set actidnotfound=
215
216for /f "skip=2 tokens=2*" %%a in ('reg query "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion" /v BuildBranch 2^>nul') do set "branch=%%b"
217
218if defined applist call :hwidkey key attempt1
219if not defined key call :hwidkey key attempt2
220
221if not defined key (
222%eline%
223echo [%winos% ^| %winbuild% ^| SKU:%osSKU%]
224echo Unable to find this product in the HWID supported product list.
225echo Make sure you are using updated version of the script.
226echo https://massgrave.dev
227goto ins_done
228)
229
230::========================================================================================================================================
231
232if %_unattended%==1 goto insertkey
233
234cls
235%line%
236echo:
237echo Install [%winos% ^| SKU:%osSKU% ^| %winbuild%] %channel% Key
238echo [%key%]
239%line%
240echo:
241if not "%regSKU%"=="%wmiSKU%" (
242echo Note: Difference Found In SKU Value- WMI:%wmiSKU% Reg:%regSKU%
243echo:
244)
245call :dk_color %_Green% "Press [1] to Continue or [0] to %_exitmsg%"
246choice /C:01 /N
247if %errorlevel%==1 exit /b
248
249::========================================================================================================================================
250
251:insertkey
252
253cls
254%line%
255
256if %_wmic% EQU 1 wmic path SoftwareLicensingService where __CLASS='SoftwareLicensingService' call InstallProductKey ProductKey="%key%" %nul%
257if %_wmic% EQU 0 %psc% "(([WMISEARCHER]'SELECT Version FROM SoftwareLicensingService').Get()).InstallProductKey('%key%')" %nul%
258if not %errorlevel%==0 cscript //nologo %windir%\system32\slmgr.vbs /ipk %key% %nul%
259
260set error_code=%errorlevel%
261cmd /c exit /b %error_code%
262if %error_code% NEQ 0 set "error_code=[0x%=ExitCode%]"
263
264echo:
265echo [%winos% ^| SKU:%osSKU% ^| %winbuild%]
266echo Installing %channel% [%key%]
267echo:
268
269if %error_code% EQU 0 (
270call :dk_refresh
271call :dk_color %Green% "[Successful]"
272) else (
273call :dk_color %Red% "[Unsuccessful] %error_code%"
274if defined actidnotfound call :dk_color %Red% "Activation ID not found for this key."
275echo Check this page for help https://massgrave.dev/troubleshoot
276)
277%line%
278
279::========================================================================================================================================
280
281:ins_done
282
283echo:
284if %_unattended%==1 timeout /t 2 & exit /b
285call :dk_color %_Yellow% "Press any key to %_exitmsg%..."
286pause >nul
287exit /b
288
289::========================================================================================================================================
290
291:: Refresh license status
292
293:dk_refresh
294
295if %_wmic% EQU 1 wmic path SoftwareLicensingService where __CLASS='SoftwareLicensingService' call RefreshLicenseStatus %nul%
296if %_wmic% EQU 0 %psc% "$null=(([WMICLASS]'SoftwareLicensingService').GetInstances()).RefreshLicenseStatus()" %nul%
297exit /b
298
299:: Get Windows Activation IDs
300
301:dk_actids
302
303set applist=
304if %_wmic% EQU 1 set "chkapp=for /f "tokens=2 delims==" %%a in ('"wmic path SoftwareLicensingProduct where (ApplicationID='55c92734-d682-4d71-983e-d6ec3f16059f') get ID /VALUE" 2^>nul')"
305if %_wmic% EQU 0 set "chkapp=for /f "tokens=2 delims==" %%a in ('%psc% "(([WMISEARCHER]'SELECT ID FROM SoftwareLicensingProduct WHERE ApplicationID=''55c92734-d682-4d71-983e-d6ec3f16059f''').Get()).ID ^| %% {echo ('ID='+$_)}" 2^>nul')"
306%chkapp% do (if defined applist (call set "applist=!applist! %%a") else (call set "applist=%%a"))
307exit /b
308
309:: Check wmic.exe
310
311:dk_ckeckwmic
312
313set _wmic=0
314for %%# in (wmic.exe) do @if not "%%~$PATH:#"=="" (
315wmic path Win32_ComputerSystem get CreationClassName /value 2>nul | find /i "computersystem" 1>nul && set _wmic=1
316)
317exit /b
318
319:: Get Product name (WMI/REG methods are not reliable in all conditions, hence winbrand.dll method is used)
320
321:dk_product
322
323call :dk_reflection
324
325set d1=%ref% $meth = $TypeBuilder.DefinePInvokeMethod('BrandingFormatString', 'winbrand.dll', 'Public, Static', 1, [String], @([String]), 1, 3);
326set d1=%d1% $meth.SetImplementationFlags(128); $TypeBuilder.CreateType()::BrandingFormatString('%%WINDOWS_LONG%%')
327
328set winos=
329for /f "delims=" %%s in ('"%psc% %d1%"') do if not errorlevel 1 (set winos=%%s)
330echo "%winos%" | find /i "Windows" 1>nul || (
331for /f "skip=2 tokens=2*" %%a in ('reg query "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion" /v ProductName 2^>nul') do set "winos=%%b"
332if %winbuild% GEQ 22000 (
333set winos=!winos:Windows 10=Windows 11!
334)
335)
336exit /b
337
338:: Common lines used in PowerShell reflection code
339
340:dk_reflection
341
342set ref=$AssemblyBuilder = [AppDomain]::CurrentDomain.DefineDynamicAssembly(4, 1);
343set ref=%ref% $ModuleBuilder = $AssemblyBuilder.DefineDynamicModule(2, $False);
344set ref=%ref% $TypeBuilder = $ModuleBuilder.DefineType(0);
345exit /b
346
347::========================================================================================================================================
348
349:dk_color
350
351if %_NCS% EQU 1 (
352echo %esc%[%~1%~2%esc%[0m
353) else (
354%psc% write-host -back '%1' -fore '%2' '%3'
355)
356exit /b
357
358::========================================================================================================================================
359
360:: 1st column = Activation ID
361:: 2nd column = Generic Retail/OEM/MAK Key
362:: 3rd column = SKU ID
363:: 4th column = Key Type
364:: 5th column = WMI Edition ID
365:: 6th column = Version name incase same Edition ID is used in different OS versions with different key
366:: Separator = _
367
368
369:hwidkey
370
371set f=
372for %%# in (
3738b351c9c-f398-4515-9900-09df49427262_XGV%f%PP-NM%f%H47-7TTH%f%J-W3F%f%W7-8HV%f%2C___4_OEM:NONSLP_Enterprise
374c83cef07-6b72-4bbc-a28f-a00386872839_3V6%f%Q6-NQ%f%XCX-V8YX%f%R-9QC%f%YV-QPF%f%CT__27_Volume:MAK_EnterpriseN
3754de7cb65-cdf1-4de9-8ae8-e3cce27b9f2c_VK7%f%JG-NP%f%HTM-C97J%f%M-9MP%f%GT-3V6%f%6T__48_____Retail_Professional
3769fbaf5d6-4d83-4422-870d-fdda6e5858aa_2B8%f%7N-8K%f%FHP-DKV6%f%R-Y2C%f%8J-PKC%f%KT__49_____Retail_ProfessionalN
377f742e4ff-909d-4fe9-aacb-3231d24a0c58_4CP%f%RK-NM%f%3K3-X6XX%f%Q-RXX%f%86-WXC%f%HW__98_____Retail_CoreN
3781d1bac85-7365-4fea-949a-96978ec91ae0_N24%f%34-X9%f%D7W-8PF6%f%X-8DV%f%9T-8TY%f%MD__99_____Retail_CoreCountrySpecific
3793ae2cc14-ab2d-41f4-972f-5e20142771dc_BT7%f%9Q-G7%f%N6G-PGBY%f%W-4YW%f%X6-6F4%f%BT_100_____Retail_CoreSingleLanguage
3802b1f36bb-c1cd-4306-bf5c-a0367c2d97d8_YTM%f%G3-N6%f%DKC-DKB7%f%7-7M9%f%GH-8HV%f%X7_101_____Retail_Core
3812a6137f3-75c0-4f26-8e3e-d83d802865a4_XKC%f%NC-J2%f%6Q9-KFHD%f%2-FKT%f%HY-KD7%f%2Y_119_OEM:NONSLP_PPIPro
382e558417a-5123-4f6f-91e7-385c1c7ca9d4_YNM%f%GQ-8R%f%YV3-4PGQ%f%3-C8X%f%TP-7CF%f%BY_121_____Retail_Education
383c5198a66-e435-4432-89cf-ec777c9d0352_84N%f%GF-MH%f%BT6-FXBX%f%8-QWJ%f%K7-DRR%f%8H_122_____Retail_EducationN
384cce9d2de-98ee-4ce2-8113-222620c64a27_KCN%f%VH-YK%f%WX8-GJJB%f%9-H9F%f%DT-6F7%f%W2_125_Volume:MAK_EnterpriseS_VB
385d06934ee-5448-4fd1-964a-cd077618aa06_43T%f%BQ-NH%f%92J-XKTM%f%7-KT3%f%KK-P39%f%PB_125_OEM:NONSLP_EnterpriseS_RS5
386706e0cfd-23f4-43bb-a9af-1a492b9f1302_NK9%f%6Y-D9%f%CD8-W44C%f%Q-R8Y%f%TK-DYJ%f%WX_125_OEM:NONSLP_EnterpriseS_RS1
387faa57748-75c8-40a2-b851-71ce92aa8b45_FWN%f%7H-PF%f%93Q-4GGP%f%8-M8R%f%F3-MDW%f%WW_125_OEM:NONSLP_EnterpriseS_TH
3882c060131-0e43-4e01-adc1-cf5ad1100da8_RQF%f%NW-9T%f%PM3-JQ73%f%T-QV4%f%VQ-DV9%f%PT_126_Volume:MAK_EnterpriseSN_VB
389e8f74caa-03fb-4839-8bcc-2e442b317e53_M33%f%WV-NH%f%Y3C-R7FP%f%M-BQG%f%PT-239%f%PG_126_Volume:MAK_EnterpriseSN_RS5
3903d1022d8-969f-4222-b54b-327f5a5af4c9_2DB%f%W3-N2%f%PJG-MVHW%f%3-G7T%f%DK-9HK%f%R4_126_Volume:MAK_EnterpriseSN_RS1
39160c243e1-f90b-4a1b-ba89-387294948fb6_NTX%f%6B-BR%f%YC2-K678%f%6-F6M%f%VQ-M7V%f%2X_126_Volume:MAK_EnterpriseSN_TH
392eb6d346f-1c60-4643-b960-40ec31596c45_DXG%f%7C-N3%f%6C4-C4HT%f%G-X4T%f%3X-2YV%f%77_161_____Retail_ProfessionalWorkstation
39389e87510-ba92-45f6-8329-3afa905e3e83_WYP%f%NQ-8C%f%467-V2W6%f%J-TX4%f%WX-WT2%f%RQ_162_____Retail_ProfessionalWorkstationN
39462f0c100-9c53-4e02-b886-a3528ddfe7f6_8PT%f%T6-RN%f%W4C-6V7J%f%2-C2D%f%3X-MHB%f%PB_164_____Retail_ProfessionalEducation
39513a38698-4a49-4b9e-8e83-98fe51110953_GJT%f%YN-HD%f%MQY-FRR7%f%6-HVG%f%C7-QPF%f%8P_165_____Retail_ProfessionalEducationN
396df96023b-dcd9-4be2-afa0-c6c871159ebe_NJC%f%F7-PW%f%8QT-3324%f%D-688%f%JX-2YV%f%66_175_____Retail_ServerRdsh
397d4ef7282-3d2c-4cf0-9976-8854e64a8d1e_V3W%f%VW-N2%f%PV2-CGWC%f%3-34Q%f%GF-VMJ%f%2C_178_____Retail_Cloud
398af5c9381-9240-417d-8d35-eb40cd03e484_NH9%f%J3-68%f%WK7-6FB9%f%3-4K3%f%DF-DJ4%f%F6_179_____Retail_CloudN
3998ab9bdd1-1f67-4997-82d9-8878520837d9_XQQ%f%YW-NF%f%FMW-XJPB%f%H-K87%f%32-CKF%f%FD_188_____OEM:DM_IoTEnterprise
400ed655016-a9e8-4434-95d9-4345352c2552_QPM%f%6N-7J%f%2WJ-P88H%f%H-P3Y%f%RH-YY7%f%4H_191_OEM:NONSLP_IoTEnterpriseS_VB
401d4bdc678-0a4b-4a32-a5b3-aaa24c3b0f24_K9V%f%KN-3B%f%GWV-Y624%f%W-MCR%f%MQ-BHD%f%CD_202_____Retail_CloudEditionN
40292fb8726-92a8-4ffc-94ce-f82e07444653_KY7%f%PN-VR%f%6RX-83W6%f%Y-6DD%f%YQ-T6R%f%4W_203_____Retail_CloudEdition
403d4f9b41f-205c-405e-8e08-3d16e88e02be_J7N%f%JW-V6%f%KBM-CC8R%f%W-Y29%f%Y4-HQ2%f%MJ_205_OEM:NONSLP_IoTEnterpriseSK
404) do (
405for /f "tokens=1-6 delims=_" %%A in ("%%#") do (
406
407if %1==key if %osSKU%==%%C (
408
409REM Detect key attempt 1
410
411if "%2"=="attempt1" if not defined key (
412echo "!applist!" | find /i "%%A" 1>nul && (
413set key=%%B
414set channel=%%D
415)
416)
417
418REM Detect key attempt 2
419
420if "%2"=="attempt2" if not defined key (
421set actidnotfound=1
422set 6th=%%F
423if not defined 6th (
424set key=%%B
425set channel=%%D
426) else (
427echo "%branch%" | find /i "%%F" 1>nul && (
428set key=%%B
429set channel=%%D
430)
431)
432)
433)
434
435)
436)
437exit /b
438
439::======================================================================================================================================== \ No newline at end of file
diff --git a/MAS/Separate-Files-Version/Troubleshoot.cmd b/MAS/Separate-Files-Version/Troubleshoot.cmd
index 82ae790..831d4b0 100644
--- a/MAS/Separate-Files-Version/Troubleshoot.cmd
+++ b/MAS/Separate-Files-Version/Troubleshoot.cmd
@@ -7,16 +7,22 @@
7:: 7::
8:: This script is a part of 'Microsoft_Activation_Scripts' (MAS) project. 8:: This script is a part of 'Microsoft_Activation_Scripts' (MAS) project.
9:: 9::
10:: Homepage: massgrave.dev 10:: Homepage: mass grave[.]dev
11:: Email: windowsaddict@protonmail.com 11:: Email: windowsaddict@protonmail.com
12:: 12::
13::============================================================================ 13::============================================================================
14 14
15 15
16 16
17
18::======================================================================================================================================== 17::========================================================================================================================================
19 18
19:: Set Path variable, it helps if it is misconfigured in the system
20
21set "PATH=%SystemRoot%\System32;%SystemRoot%\System32\wbem;%SystemRoot%\System32\WindowsPowerShell\v1.0\"
22if exist "%SystemRoot%\Sysnative\reg.exe" (
23set "PATH=%SystemRoot%\Sysnative;%SystemRoot%\Sysnative\wbem;%SystemRoot%\Sysnative\WindowsPowerShell\v1.0\;%PATH%"
24)
25
20:: Re-launch the script with x64 process if it was initiated by x86 process on x64 bit Windows 26:: Re-launch the script with x64 process if it was initiated by x86 process on x64 bit Windows
21:: or with ARM64 process if it was initiated by x86/ARM32 process on ARM64 Windows 27:: or with ARM64 process if it was initiated by x86/ARM32 process on ARM64 Windows
22 28
@@ -24,6 +30,10 @@ set "_cmdf=%~f0"
24for %%# in (%*) do ( 30for %%# in (%*) do (
25if /i "%%#"=="r1" set r1=1 31if /i "%%#"=="r1" set r1=1
26if /i "%%#"=="r2" set r2=1 32if /i "%%#"=="r2" set r2=1
33if /i "%%#"=="-qedit" (
34reg add HKCU\Console /v QuickEdit /t REG_DWORD /d "1" /f %nul1%
35rem check the code below admin elevation to understand why it's here
36)
27) 37)
28 38
29if exist %SystemRoot%\Sysnative\cmd.exe if not defined r1 ( 39if exist %SystemRoot%\Sysnative\cmd.exe if not defined r1 (
@@ -40,22 +50,34 @@ start %SystemRoot%\SysArm32\cmd.exe /c ""!_cmdf!" %* r2"
40exit /b 50exit /b
41) 51)
42 52
43:: Set Path variable, it helps if it is misconfigured in the system 53::========================================================================================================================================
44 54
45set "PATH=%SystemRoot%\System32;%SystemRoot%\System32\wbem;%SystemRoot%\System32\WindowsPowerShell\v1.0\" 55set "blank="
46if exist "%SystemRoot%\Sysnative\reg.exe" ( 56set "mas=mass%blank%grave.dev"
47set "PATH=%SystemRoot%\Sysnative;%SystemRoot%\Sysnative\wbem;%SystemRoot%\Sysnative\WindowsPowerShell\v1.0\;%PATH%" 57
58:: Check if Null service is working, it's important for the batch script
59
60sc query Null | find /i "RUNNING"
61if %errorlevel% NEQ 0 (
62echo:
63echo Null service is not running, script may crash...
64echo:
65echo:
66echo Help - https://%mas%/troubleshoot.html
67echo:
68echo:
69ping 127.0.0.1 -n 10
48) 70)
71cls
49 72
50:: Check LF line ending 73:: Check LF line ending
51 74
52pushd "%~dp0" 75pushd "%~dp0"
53>nul findstr /rxc:".*" "%~nx0" 76>nul findstr /v "$" "%~nx0" && (
54if not %errorlevel%==0 (
55echo: 77echo:
56echo Error: Script either has LF line ending issue, or it failed to read itself. 78echo Error: Script either has LF line ending issue or an empty line at the end of the script is missing.
57echo: 79echo:
58ping 127.0.0.1 -n 6 > nul 80ping 127.0.0.1 -n 6 >nul
59popd 81popd
60exit /b 82exit /b
61) 83)
@@ -67,21 +89,32 @@ cls
67color 07 89color 07
68title Troubleshoot 90title Troubleshoot
69 91
92set _args=
70set _elev= 93set _elev=
71if /i "%~1"=="-el" set _elev=1
72 94
73set winbuild=1 95set _args=%*
96if defined _args set _args=%_args:"=%
97if defined _args (
98for %%A in (%_args%) do (
99if /i "%%A"=="-el" set _elev=1
100)
101)
102
103set "nul1=1>nul"
104set "nul2=2>nul"
105set "nul6=2^>nul"
74set "nul=>nul 2>&1" 106set "nul=>nul 2>&1"
107
75set psc=powershell.exe 108set psc=powershell.exe
109set winbuild=1
76for /f "tokens=6 delims=[]. " %%G in ('ver') do set winbuild=%%G 110for /f "tokens=6 delims=[]. " %%G in ('ver') do set winbuild=%%G
77 111
78set _NCS=1 112set _NCS=1
79if %winbuild% LSS 10586 set _NCS=0 113if %winbuild% LSS 10586 set _NCS=0
80if %winbuild% GEQ 10586 reg query "HKCU\Console" /v ForceV2 2>nul | find /i "0x0" 1>nul && (set _NCS=0) 114if %winbuild% GEQ 10586 reg query "HKCU\Console" /v ForceV2 %nul2% | find /i "0x0" %nul1% && (set _NCS=0)
81 115
82call :_colorprep 116call :_colorprep
83 117
84set cbs_log=%SystemRoot%\logs\cbs\cbs.log
85set "nceline=echo: &echo ==== ERROR ==== &echo:" 118set "nceline=echo: &echo ==== ERROR ==== &echo:"
86set "eline=echo: &call :_color %Red% "==== ERROR ====" &echo:" 119set "eline=echo: &call :_color %Red% "==== ERROR ====" &echo:"
87set "line=_________________________________________________________________________________________________" 120set "line=_________________________________________________________________________________________________"
@@ -91,7 +124,7 @@ if %~z0 GEQ 200000 (set "_exitmsg=Go back") else (set "_exitmsg=Exit")
91 124
92if %winbuild% LSS 7600 ( 125if %winbuild% LSS 7600 (
93%nceline% 126%nceline%
94echo Unsupported OS version detected. 127echo Unsupported OS version detected [%winbuild%].
95echo Project is supported only for Windows 7/8/8.1/10/11 and their Server equivalent. 128echo Project is supported only for Windows 7/8/8.1/10/11 and their Server equivalent.
96goto at_done 129goto at_done
97) 130)
@@ -120,7 +153,7 @@ setlocal EnableDelayedExpansion
120 153
121::======================================================================================================================================== 154::========================================================================================================================================
122 155
123echo "!_batf!" | find /i "!_ttemp!" 1>nul && ( 156echo "!_batf!" | find /i "!_ttemp!" %nul1% && (
124if /i not "!_work!"=="!_ttemp!" ( 157if /i not "!_work!"=="!_ttemp!" (
125%nceline% 158%nceline%
126echo Script is launched from the temp folder, 159echo Script is launched from the temp folder,
@@ -135,8 +168,8 @@ goto at_done
135 168
136:: Elevate script as admin and pass arguments and preventing loop 169:: Elevate script as admin and pass arguments and preventing loop
137 170
138>nul fltmc || ( 171%nul1% fltmc || (
139if not defined _elev %nul% %psc% "start cmd.exe -arg '/c \"!_PSarg:'=''!\"' -verb runas" && exit /b 172if not defined _elev %psc% "start cmd.exe -arg '/c \"!_PSarg:'=''!\"' -verb runas" && exit /b
140%nceline% 173%nceline%
141echo This script require admin privileges. 174echo This script require admin privileges.
142echo To do so, right click on this script and select 'Run as administrator'. 175echo To do so, right click on this script and select 'Run as administrator'.
@@ -145,6 +178,20 @@ goto at_done
145 178
146::======================================================================================================================================== 179::========================================================================================================================================
147 180
181:: This code disables QuickEdit for this cmd.exe session only without making permanent changes to the registry
182:: It is added because clicking on the script window pauses the operation and leads to the confusion that script stopped due to an error
183
184for %%# in (%_args%) do (if /i "%%#"=="-qedit" set quedit=1)
185
186reg query HKCU\Console /v QuickEdit %nul2% | find /i "0x0" %nul1% || if not defined quedit (
187reg add HKCU\Console /v QuickEdit /t REG_DWORD /d "0" /f %nul1%
188start cmd.exe /c ""!_batf!" %_args% -qedit"
189rem quickedit reset code is added at the starting of the script instead of here because it takes time to reflect in some cases
190exit /b
191)
192
193::========================================================================================================================================
194
148setlocal DisableDelayedExpansion 195setlocal DisableDelayedExpansion
149 196
150:: Check desktop location 197:: Check desktop location
@@ -195,12 +242,12 @@ choice /C:1234560 /N
195set _erl=%errorlevel% 242set _erl=%errorlevel%
196 243
197if %_erl%==7 exit /b 244if %_erl%==7 exit /b
198if %_erl%==6 start https://massgrave.dev/fix-wpa-registry.html &goto at_menu 245if %_erl%==6 start https://%mas%/fix-wpa-registry.html &goto at_menu
199if %_erl%==5 goto:retokens 246if %_erl%==5 goto:retokens
200if %_erl%==4 goto:fixwmi 247if %_erl%==4 goto:fixwmi
201if %_erl%==3 goto:sfcscan 248if %_erl%==3 goto:sfcscan
202if %_erl%==2 goto:dism_rest 249if %_erl%==2 goto:dism_rest
203if %_erl%==1 start https://massgrave.dev/troubleshoot.html &goto at_menu 250if %_erl%==1 start https://%mas%/troubleshoot.html &goto at_menu
204goto :at_menu 251goto :at_menu
205 252
206::======================================================================================================================================== 253::========================================================================================================================================
@@ -248,23 +295,29 @@ if %errorlevel%==1 goto at_menu
248 295
249cls 296cls
250mode 110, 30 297mode 110, 30
251echo:
252
253call :_stopservice TrustedInstaller 298call :_stopservice TrustedInstaller
254del /s /f /q "%SystemRoot%\logs\cbs\*.*"
255 299
256set _time= 300set _time=
257for /f %%a in ('%psc% "Get-Date -format HH_mm_ss"') do set _time=%%a 301for /f %%a in ('%psc% "Get-Date -format HH_mm_ss"') do set _time=%%a
258echo: 302echo:
259echo Applying the command, 303echo Applying the command,
260echo dism /english /online /cleanup-image /restorehealth 304echo dism /english /online /cleanup-image /restorehealth
261echo: 305dism /english /online /cleanup-image /restorehealth
262dism /english /online /cleanup-image /restorehealth /Logpath:"%SystemRoot%\Temp\RHealth_DISM_%_time%.txt" /loglevel:4 306
307call :_stopservice TrustedInstaller
263 308
264if not exist "!desktop!\AT_Logs\" md "!desktop!\AT_Logs\" %nul% 309if not exist "!desktop!\AT_Logs\" md "!desktop!\AT_Logs\" %nul%
265copy /y /b "%SystemRoot%\Temp\RHealth_DISM_%_time%.txt" "!desktop!\AT_Logs\RHealth_DISM_%_time%.txt" %nul% 310
266copy /y /b "%cbs_log%" "!desktop!\AT_Logs\RHealth_CBS_%_time%.txt" %nul% 311call :compresslog cbs\CBS.log RHealth_CBS %nul%
267del /f /q "%SystemRoot%\Temp\RHealth_DISM_%_time%.txt" %nul% 312call :compresslog DISM\dism.log RHealth_DISM %nul%
313
314if not exist "!desktop!\AT_Logs\RHealth_CBS_%_time%.cab" (
315copy /y /b "%SystemRoot%\logs\cbs\cbs.log" "!desktop!\AT_Logs\RHealth_CBS_%_time%.log" %nul%
316)
317
318if not exist "!desktop!\AT_Logs\RHealth_DISM_%_time%.cab" (
319copy /y /b "%SystemRoot%\logs\DISM\dism.log" "!desktop!\AT_Logs\RHealth_DISM_%_time%.log" %nul%
320)
268 321
269echo: 322echo:
270call :_color %Gray% "CBS and DISM logs are copied to the AT_Logs folder on the dekstop." 323call :_color %Gray% "CBS and DISM logs are copied to the AT_Logs folder on the dekstop."
@@ -294,22 +347,24 @@ choice /C:09 /N /M "> [9] Continue [0] Go back : "
294if %errorlevel%==1 goto at_menu 347if %errorlevel%==1 goto at_menu
295 348
296cls 349cls
297echo:
298
299call :_stopservice TrustedInstaller 350call :_stopservice TrustedInstaller
300del /s /f /q "%SystemRoot%\logs\cbs\*.*"
301 351
302set _time= 352set _time=
303for /f %%a in ('%psc% "Get-Date -format HH_mm_ss"') do set _time=%%a 353for /f %%a in ('%psc% "Get-Date -format HH_mm_ss"') do set _time=%%a
304echo: 354echo:
305echo Applying the command, 355echo Applying the command,
306echo sfc /scannow 356echo sfc /scannow
307echo:
308sfc /scannow 357sfc /scannow
309 358
359call :_stopservice TrustedInstaller
360
310if not exist "!desktop!\AT_Logs\" md "!desktop!\AT_Logs\" %nul% 361if not exist "!desktop!\AT_Logs\" md "!desktop!\AT_Logs\" %nul%
311 362
312copy /y /b "%cbs_log%" "!desktop!\AT_Logs\SFC_CBS_%_time%.txt" %nul% 363call :compresslog cbs\CBS.log SFC_CBS %nul%
364
365if not exist "!desktop!\AT_Logs\SFC_CBS_%_time%.cab" (
366copy /y /b "%SystemRoot%\logs\cbs\cbs.log" "!desktop!\AT_Logs\SFC_CBS_%_time%.log" %nul%
367)
313 368
314echo: 369echo:
315call :_color %Gray% "CBS log is copied to the AT_Logs folder on the dekstop." 370call :_color %Gray% "CBS log is copied to the AT_Logs folder on the dekstop."
@@ -321,7 +376,7 @@ goto :at_back
321 376
322cls 377cls
323mode con cols=115 lines=32 378mode con cols=115 lines=32
324%nul% %psc% "&{$W=$Host.UI.RawUI.WindowSize;$B=$Host.UI.RawUI.BufferSize;$W.Height=31;$B.Height=200;$Host.UI.RawUI.WindowSize=$W;$Host.UI.RawUI.BufferSize=$B;}" 379%psc% "&{$W=$Host.UI.RawUI.WindowSize;$B=$Host.UI.RawUI.BufferSize;$W.Height=31;$B.Height=200;$Host.UI.RawUI.WindowSize=$W;$Host.UI.RawUI.BufferSize=$B;}"
325title Fix Licensing ^(ClipSVC ^+ Office vNext ^+ SPP ^+ OSPP^) 380title Fix Licensing ^(ClipSVC ^+ Office vNext ^+ SPP ^+ OSPP^)
326 381
327echo: 382echo:
@@ -354,7 +409,7 @@ cls
354echo: 409echo:
355echo %line% 410echo %line%
356echo: 411echo:
357call :_color %Magenta% "Rebuilding ClipSVC Licences" 412call :_color %Blue% "Rebuilding ClipSVC Licences"
358echo: 413echo:
359 414
360if %winbuild% LSS 10240 ( 415if %winbuild% LSS 10240 (
@@ -363,7 +418,7 @@ echo Skipping...
363goto :cleanvnext 418goto :cleanvnext
364) 419)
365 420
366%psc% "(([WMISEARCHER]'SELECT Name FROM SoftwareLicensingProduct WHERE LicenseStatus=1 AND GracePeriodRemaining=0 AND PartialProductKey IS NOT NULL').Get()).Name" 2>nul | findstr /i "Windows" 1>nul && ( 421%psc% "(([WMISEARCHER]'SELECT Name FROM SoftwareLicensingProduct WHERE LicenseStatus=1 AND GracePeriodRemaining=0 AND PartialProductKey IS NOT NULL').Get()).Name" %nul2% | findstr /i "Windows" %nul1% && (
367echo Windows is permanently activated. 422echo Windows is permanently activated.
368echo Skipping rebuilding ClipSVC licences... 423echo Skipping rebuilding ClipSVC licences...
369goto :cleanvnext 424goto :cleanvnext
@@ -460,7 +515,7 @@ for %%# in (wlidsvc LicenseManager) do (net stop %%# /y %nul% & net start %%# /y
460echo: 515echo:
461echo %line% 516echo %line%
462echo: 517echo:
463call :_color %Magenta% "Clearing Office vNext License" 518call :_color %Blue% "Clearing Office vNext License"
464echo: 519echo:
465 520
466setlocal DisableDelayedExpansion 521setlocal DisableDelayedExpansion
@@ -515,7 +570,7 @@ echo Not Found Registry - %%#
515echo: 570echo:
516echo %line% 571echo %line%
517echo: 572echo:
518call :_color %Magenta% "Rebuilding SPP Licensing Tokens" 573call :_color %Blue% "Rebuilding SPP Licensing Tokens"
519echo: 574echo:
520 575
521call :scandat check 576call :scandat check
@@ -529,7 +584,7 @@ echo tokens.dat file: [%token%]
529if %winbuild% GEQ 14393 ( 584if %winbuild% GEQ 14393 (
530set wpaerror= 585set wpaerror=
531set /a count=0 586set /a count=0
532for /f %%a in ('reg query "HKLM\SYSTEM\WPA" 2^>nul') do set /a count+=1 587for /f %%a in ('reg query "HKLM\SYSTEM\WPA" %nul6%') do set /a count+=1
533for /L %%# in (1,1,!count!) do ( 588for /L %%# in (1,1,!count!) do (
534reg query "HKLM\SYSTEM\WPA\8DEC0AF1-0341-4b93-85CD-72606C2DF94C-7P-%%#" /ve /t REG_BINARY %nul% || set wpaerror=1 589reg query "HKLM\SYSTEM\WPA\8DEC0AF1-0341-4b93-85CD-72606C2DF94C-7P-%%#" /ve /t REG_BINARY %nul% || set wpaerror=1
535) 590)
@@ -542,7 +597,7 @@ call :_color %Red% "[Error Found] [Registry Count - !count!]"
542) 597)
543 598
544set tokenstore= 599set tokenstore=
545for /f "skip=2 tokens=2*" %%a in ('reg query "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\SoftwareProtectionPlatform" /v TokenStore 2^>nul') do call set "tokenstore=%%b" 600for /f "skip=2 tokens=2*" %%a in ('reg query "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\SoftwareProtectionPlatform" /v TokenStore %nul6%') do call set "tokenstore=%%b"
546 601
547:: Check sppsvc permissions and apply fixes 602:: Check sppsvc permissions and apply fixes
548 603
@@ -580,7 +635,7 @@ call :_color %Red% "[Failed To Fix]"
580echo [Successfully Fixed] 635echo [Successfully Fixed]
581) 636)
582) else ( 637) else (
583echo [Error Not Found] 638echo [No Error Found]
584) 639)
585) 640)
586 641
@@ -624,7 +679,7 @@ echo tokens.dat file was rebuilt successfully.
624echo: 679echo:
625echo %line% 680echo %line%
626echo: 681echo:
627call :_color %Magenta% "Rebuilding OSPP Licensing Tokens" 682call :_color %Blue% "Rebuilding OSPP Licensing Tokens"
628echo: 683echo:
629 684
630sc qc osppsvc %nul% || ( 685sc qc osppsvc %nul% || (
@@ -681,7 +736,7 @@ echo tokens.dat file was rebuilt successfully.
681echo: 736echo:
682echo %line% 737echo %line%
683echo: 738echo:
684call :_color %Magenta% "Repairing Office Licenses" 739call :_color %Blue% "Repairing Office Licenses"
685echo: 740echo:
686 741
687for /f "skip=2 tokens=2*" %%a in ('reg query "HKLM\SYSTEM\CurrentControlSet\Control\Session Manager\Environment" /v PROCESSOR_ARCHITECTURE') do set arch=%%b 742for /f "skip=2 tokens=2*" %%a in ('reg query "HKLM\SYSTEM\CurrentControlSet\Control\Session Manager\Environment" /v PROCESSOR_ARCHITECTURE') do set arch=%%b
@@ -723,10 +778,7 @@ set _86=HKLM\SOFTWARE\Wow6432Node\Microsoft\Office
723 778
724set uwp16= 779set uwp16=
725if %winbuild% GEQ 10240 ( 780if %winbuild% GEQ 10240 (
726dir /b "%ProgramFiles%\WindowsApps\Microsoft.Office.Desktop*" %nul% && set uwp16=Office 16.0 UWP 781%psc% "Get-AppxPackage -name "Microsoft.Office.Desktop"" | find /i "Office" %nul1% && set uwp16=Office 16.0 UWP
727dir /b "%ProgramW6432%\WindowsApps\Microsoft.Office.Desktop*" %nul% && set uwp16=Office 16.0 UWP
728dir /b "%ProgramFiles(x86)%\WindowsApps\Microsoft.Office.Desktop*" %nul% && set uwp16=Office 16.0 UWP
729%psc% "Get-AppxPackage -name "Microsoft.Office.Desktop"" | find /i "Office" 1>nul && set uwp16=Office 16.0 UWP
730) 782)
731 783
732set /a counter=0 784set /a counter=0
@@ -774,7 +826,7 @@ echo:
774call :_color %_Yellow% "A Window will popup, in that Window you need to select [Quick] Repair Option..." 826call :_color %_Yellow% "A Window will popup, in that Window you need to select [Quick] Repair Option..."
775call :_color %_Yellow% "Press any key to continue..." 827call :_color %_Yellow% "Press any key to continue..."
776echo: 828echo:
777pause >nul 829pause %nul1%
778) 830)
779 831
780if defined uwp16 ( 832if defined uwp16 (
@@ -843,12 +895,15 @@ goto :at_back
843 895
844echo: 896echo:
845echo Checking WMI 897echo Checking WMI
898call :checkwmi
846 899
847set error= 900:: Apply basic fix first and check
848wmic path Win32_ComputerSystem get CreationClassName /value 2>nul | find /i "computersystem" 1>nul 901
849if %errorlevel% NEQ 0 set error=1 902if defined error (
850winmgmt /verifyrepository %nul% 903call :_stopservice Winmgmt
851if %errorlevel% NEQ 0 set error=1 904winmgmt /salvagerepository %nul%
905call :checkwmi
906)
852 907
853if not defined error ( 908if not defined error (
854echo [Working] 909echo [Working]
@@ -858,10 +913,16 @@ goto :at_back
858 913
859call :_color %Red% "[Not Responding]" 914call :_color %Red% "[Not Responding]"
860 915
916set _corrupt=
917sc start Winmgmt %nul%
918if %errorlevel% EQU 1060 set _corrupt=1
919sc query Winmgmt %nul% || set _corrupt=1
920for %%G in (DependOnService Description DisplayName ErrorControl ImagePath ObjectName Start Type) do if not defined _corrupt (reg query HKLM\SYSTEM\CurrentControlSet\Services\Winmgmt /v %%G %nul% || set _corrupt=1)
921
861echo: 922echo:
862sc query Winmgmt %nul% || ( 923if defined _corrupt (
863%eline% 924%eline%
864echo Winmgmt service is not installed. Aborting... 925echo Winmgmt service is corrupted. Aborting...
865goto :at_back 926goto :at_back
866) 927)
867 928
@@ -880,12 +941,12 @@ echo Stopping Winmgmt service
880call :_stopservice Winmgmt 941call :_stopservice Winmgmt
881call :_stopservice Winmgmt 942call :_stopservice Winmgmt
882call :_stopservice Winmgmt 943call :_stopservice Winmgmt
883sc query Winmgmt | find /i "1 STOPPED" %nul% && ( 944sc query Winmgmt | find /i "STOPPED" %nul% && (
884echo [Successful] 945echo [Successful]
885) || ( 946) || (
886call :_color %Red% "[Failed]" 947call :_color %Red% "[Failed]"
887echo: 948echo:
888call :_color %Magenta% "Its recommended to select [Restart] option and then apply Fix WMI option again." 949call :_color %Blue% "Its recommended to select [Restart] option and then apply Fix WMI option again."
889echo %line% 950echo %line%
890echo: 951echo:
891choice /C:21 /N /M "> [1] Restart [2] Revert Back Changes :" 952choice /C:21 /N /M "> [1] Restart [2] Revert Back Changes :"
@@ -914,8 +975,8 @@ echo [Successful]
914call :_color %Red% "[Failed]" 975call :_color %Red% "[Failed]"
915) 976)
916 977
917wmic path Win32_ComputerSystem get CreationClassName /value 2>nul | find /i "computersystem" 1>nul 978call :checkwmi
918if %errorlevel% EQU 0 ( 979if not defined error (
919echo: 980echo:
920echo Checking WMI 981echo Checking WMI
921call :_color %Green% "[Working]" 982call :_color %Green% "[Working]"
@@ -928,8 +989,8 @@ call :registerobj %nul%
928 989
929echo: 990echo:
930echo Checking WMI 991echo Checking WMI
931wmic path Win32_ComputerSystem get CreationClassName /value 2>nul | find /i "computersystem" 1>nul 992call :checkwmi
932if %errorlevel% NEQ 0 ( 993if defined error (
933call :_color %Red% "[Not Responding]" 994call :_color %Red% "[Not Responding]"
934echo: 995echo:
935echo Run [Dism RestoreHealth] and [SFC Scannow] options and make sure there are no errors. 996echo Run [Dism RestoreHealth] and [SFC Scannow] options and make sure there are no errors.
@@ -959,6 +1020,22 @@ winmgmt /salvagerepository
959winmgmt /resetrepository 1020winmgmt /resetrepository
960exit /b 1021exit /b
961 1022
1023:checkwmi
1024
1025:: https://learn.microsoft.com/en-us/windows/win32/wmisdk/wmi-error-constants
1026
1027set error=
1028wmic path Win32_ComputerSystem get CreationClassName /value %nul2% | find /i "computersystem" %nul1%
1029if %errorlevel% NEQ 0 (set error=1& exit /b)
1030winmgmt /verifyrepository %nul%
1031if %errorlevel% NEQ 0 (set error=1& exit /b)
1032
1033cscript //nologo %windir%\system32\slmgr.vbs /dlv %nul%
1034cmd /c exit /b %errorlevel%
1035echo "0x%=ExitCode%" | findstr /i "0x800410 0x800440" %nul1%
1036if %errorlevel% EQU 0 set error=1
1037exit /b
1038
962::======================================================================================================================================== 1039::========================================================================================================================================
963 1040
964:at_back 1041:at_back
@@ -967,7 +1044,7 @@ echo:
967echo %line% 1044echo %line%
968echo: 1045echo:
969call :_color %_Yellow% "Press any key to go back..." 1046call :_color %_Yellow% "Press any key to go back..."
970pause >nul 1047pause %nul1%
971goto :at_menu 1048goto :at_menu
972 1049
973::======================================================================================================================================== 1050::========================================================================================================================================
@@ -976,7 +1053,39 @@ goto :at_menu
976 1053
977echo: 1054echo:
978echo Press any key to %_exitmsg%... 1055echo Press any key to %_exitmsg%...
979pause >nul 1056pause %nul1%
1057exit /b
1058
1059::========================================================================================================================================
1060
1061:compresslog
1062
1063:: https://stackoverflow.com/a/46268232
1064
1065set "ddf="%SystemRoot%\Temp\ddf""
1066%nul% del /q /f %ddf%
1067echo/.New Cabinet>%ddf%
1068echo/.set Cabinet=ON>>%ddf%
1069echo/.set CabinetFileCountThreshold=0;>>%ddf%
1070echo/.set Compress=ON>>%ddf%
1071echo/.set CompressionType=LZX>>%ddf%
1072echo/.set CompressionLevel=7;>>%ddf%
1073echo/.set CompressionMemory=21;>>%ddf%
1074echo/.set FolderFileCountThreshold=0;>>%ddf%
1075echo/.set FolderSizeThreshold=0;>>%ddf%
1076echo/.set GenerateInf=OFF>>%ddf%
1077echo/.set InfFileName=nul>>%ddf%
1078echo/.set MaxCabinetSize=0;>>%ddf%
1079echo/.set MaxDiskFileCount=0;>>%ddf%
1080echo/.set MaxDiskSize=0;>>%ddf%
1081echo/.set MaxErrors=1;>>%ddf%
1082echo/.set RptFileName=nul>>%ddf%
1083echo/.set UniqueFiles=ON>>%ddf%
1084for /f "tokens=* delims=" %%D in ('dir /a:-D/b/s "%SystemRoot%\logs\%1"') do (
1085 echo/"%%~fD" /inf=no;>>%ddf%
1086)
1087makecab /F %ddf% /D DiskDirectory1="" /D CabinetNameTemplate="!desktop!\AT_Logs\%2_%_time%.cab"
1088del /q /f %ddf%
980exit /b 1089exit /b
981 1090
982::======================================================================================================================================== 1091::========================================================================================================================================
@@ -1201,4 +1310,5 @@ set "_Yellow="0E""
1201 1310
1202exit /b 1311exit /b
1203 1312
1204::======================================================================================================================================== \ No newline at end of file 1313::========================================================================================================================================
1314:: Leave empty line below
diff --git a/README.md b/README.md
index 833a29e..46d5e57 100644
--- a/README.md
+++ b/README.md
@@ -2,7 +2,7 @@
2 2
3<h1 align="center">Microsoft Activation Scripts (MAS)</h1> 3<h1 align="center">Microsoft Activation Scripts (MAS)</h1>
4 4
5<p align="center">A Windows and Office activator using HWID / KMS38 / Online KMS activation methods, with a focus on open-source code and fewer antivirus detections.</p> 5<p align="center">A Windows and Office activator using HWID / Ohook / KMS38 / Online KMS activation methods, with a focus on open-source code and fewer antivirus detections.</p>
6<hr> 6<hr>
7 7
8## Download / How to use it? 8## Download / How to use it?
@@ -27,8 +27,8 @@
27To run the scripts in unattended mode, check [here](https://massgrave.dev/command_line_switches.html) 27To run the scripts in unattended mode, check [here](https://massgrave.dev/command_line_switches.html)
28 28
29``` 29```
30Latest Version: 1.8 30Latest Version: 1.9
31Release date: 16-Mar-2023 31Release date: 25-Sep-2023
32``` 32```
33 33
34### [Troubleshooting / Help](https://massgrave.dev/troubleshoot.html) 34### [Troubleshooting / Help](https://massgrave.dev/troubleshoot.html)
@@ -39,17 +39,18 @@ Release date: 16-Mar-2023
39[![1.1]][1] 39[![1.1]][1]
40[![1.2]][2] 40[![1.2]][2]
41[![1.3]][3] 41[![1.3]][3]
42[![1.4]][4]
42 43
43[1.1]: https://lookimg.com/images/2023/03/21/QTvjcD.png (Chat with us without signup) 44[1.1]: https://lookimg.com/images/2023/03/21/QTvjcD.png (Chat with us without signup)
44[1.2]: https://lookimg.com/images/2023/03/21/QTvLyd.png (Chat with us) 45[1.2]: https://lookimg.com/images/2023/03/21/QTvLyd.png (Chat with us)
45[1.3]: https://lookimg.com/images/2023/03/21/QTvXBJ.png (Follow on twitter) 46[1.3]: https://lookimg.com/images/2023/03/21/QTvXBJ.png (Follow on twitter)
47[1.4]: https://lookimg.com/images/2023/05/17/Q0iZ2U.png (Reddit)
46 48
47[1]: https://discord.gg/gjJEfq7ux8 49[1]: https://discord.gg/gjJEfq7ux8
48[2]: https://t.me/Microsoft_Activation_Scripts 50[2]: https://t.me/Microsoft_Activation_Scripts
49[3]: https://twitter.com/massgravel 51[3]: https://twitter.com/massgravel
52[4]: https://www.reddit.com/r/MAS_Activator
50 53
51--- 54---
52 55
53Made with Love ❤️ 56<p align="center">Made with Love ❤️</p>
54
55