diff options
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 | |||
25 | set "PATH=%SystemRoot%\System32;%SystemRoot%\System32\wbem;%SystemRoot%\System32\WindowsPowerShell\v1.0\" | ||
26 | if exist "%SystemRoot%\Sysnative\reg.exe" ( | ||
27 | set "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" | |||
25 | for %%# in (%*) do ( | 34 | for %%# in (%*) do ( |
26 | if /i "%%#"=="r1" set r1=1 | 35 | if /i "%%#"=="r1" set r1=1 |
27 | if /i "%%#"=="r2" set r2=1 | 36 | if /i "%%#"=="r2" set r2=1 |
37 | if /i "%%#"=="-qedit" ( | ||
38 | reg add HKCU\Console /v QuickEdit /t REG_DWORD /d "1" /f 1>nul | ||
39 | rem check the code below admin elevation to understand why it's here | ||
40 | ) | ||
28 | ) | 41 | ) |
29 | 42 | ||
30 | if exist %SystemRoot%\Sysnative\cmd.exe if not defined r1 ( | 43 | if exist %SystemRoot%\Sysnative\cmd.exe if not defined r1 ( |
@@ -41,23 +54,35 @@ start %SystemRoot%\SysArm32\cmd.exe /c ""!_cmdf!" %* r2" | |||
41 | exit /b | 54 | exit /b |
42 | ) | 55 | ) |
43 | 56 | ||
44 | :: Set Path variable, it helps if it is misconfigured in the system | 57 | ::======================================================================================================================================== |
45 | 58 | ||
46 | set "PATH=%SystemRoot%\System32;%SystemRoot%\System32\wbem;%SystemRoot%\System32\WindowsPowerShell\v1.0\" | 59 | set "blank=" |
47 | if exist "%SystemRoot%\Sysnative\reg.exe" ( | 60 | set "mas=mass%blank%grave.dev" |
48 | set "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 | |||
64 | sc query Null | find /i "RUNNING" | ||
65 | if %errorlevel% NEQ 0 ( | ||
66 | echo: | ||
67 | echo Null service is not running, script may crash... | ||
68 | echo: | ||
69 | echo: | ||
70 | echo Help - https://%mas%/troubleshoot.html | ||
71 | echo: | ||
72 | echo: | ||
73 | ping 127.0.0.1 -n 10 | ||
49 | ) | 74 | ) |
75 | cls | ||
50 | 76 | ||
51 | :: Check LF line ending | 77 | :: Check LF line ending |
52 | 78 | ||
53 | pushd "%~dp0" | 79 | pushd "%~dp0" |
54 | >nul findstr /rxc:".*" "%~nx0" | 80 | >nul findstr /v "$" "%~nx0" && ( |
55 | if not %errorlevel%==0 ( | ||
56 | echo: | 81 | echo: |
57 | echo Error: Script either has LF line ending issue, or it failed to read itself. | 82 | echo Error: Script either has LF line ending issue or an empty line at the end of the script is missing. |
58 | echo: | 83 | echo: |
84 | ping 127.0.0.1 -n 6 >nul | ||
59 | popd | 85 | popd |
60 | ping 127.0.0.1 -n 6 > nul | ||
61 | exit /b | 86 | exit /b |
62 | ) | 87 | ) |
63 | popd | 88 | popd |
@@ -102,7 +127,7 @@ set "eline=echo: &call :_color %Red% "==== ERROR ====" &echo:" | |||
102 | 127 | ||
103 | if %winbuild% LSS 7600 ( | 128 | if %winbuild% LSS 7600 ( |
104 | %nceline% | 129 | %nceline% |
105 | echo Unsupported OS version detected. | 130 | echo Unsupported OS version detected [%winbuild%]. |
106 | echo Project is supported only for Windows 7/8/8.1/10/11 and their Server equivalent. | 131 | echo Project is supported only for Windows 7/8/8.1/10/11 and their Server equivalent. |
107 | goto MASend | 132 | goto 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 || ( |
151 | if not defined _elev %nul% %psc% "start cmd.exe -arg '/c \"!_PSarg:'=''!\"' -verb runas" && exit /b | 176 | if not defined _elev %psc% "start cmd.exe -arg '/c \"!_PSarg:'=''!\"' -verb runas" && exit /b |
152 | %nceline% | 177 | %nceline% |
153 | echo This script require administrator privileges. | 178 | echo This script require admin privileges. |
154 | echo To do so, right click on this script and select 'Run as administrator'. | 179 | echo To do so, right click on this script and select 'Run as administrator'. |
155 | goto MASend | 180 | goto 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 | |||
190 | if defined _MASunattended set quedit=1 | ||
191 | for %%# in (%_args%) do (if /i "%%#"=="-qedit" set quedit=1) | ||
192 | |||
193 | reg query HKCU\Console /v QuickEdit %nul2% | find /i "0x0" %nul1% || if not defined quedit ( | ||
194 | reg add HKCU\Console /v QuickEdit /t REG_DWORD /d "0" /f %nul1% | ||
195 | start cmd.exe /c ""!_batf!" %_args% -qedit" | ||
196 | rem quickedit reset code is added at the starting of the script instead of here because it takes time to reflect in some cases | ||
197 | exit /b | ||
198 | ) | ||
199 | |||
200 | ::======================================================================================================================================== | ||
201 | |||
162 | :: Run script with parameters in unattended mode | 202 | :: Run script with parameters in unattended mode |
163 | 203 | ||
164 | set _elev= | 204 | set _elev= |
165 | if defined _args echo "%_args%" | find /i "/S" %nul% && (set "_silent=%nul%") || (set _silent=) | 205 | if defined _args echo "%_args%" | find /i "/S" %nul% && (set "_silent=%nul%") || (set _silent=) |
166 | if defined _args echo "%_args%" | find /i "/" %nul% && ( | 206 | if defined _args echo "%_args%" | find /i "/" %nul% && ( |
167 | echo "%_args%" | find /i "/HWID" %nul% && (setlocal & (call :HWIDActivation %_args% %_silent%) & cls & endlocal) | 207 | echo "%_args%" | find /i "/HWID" %nul% && (setlocal & cls & (call :HWIDActivation %_args% %_silent%) & endlocal) |
168 | echo "%_args%" | find /i "/KMS38" %nul% && (setlocal & (call :KMS38Activation %_args% %_silent%) & cls & endlocal) | 208 | echo "%_args%" | find /i "/KMS38" %nul% && (setlocal & cls & (call :KMS38Activation %_args% %_silent%) & endlocal) |
169 | echo "%_args%" | find /i "/KMS-" %nul% && (setlocal & (call :KMSActivation %_args% %_silent%) & cls & endlocal) | 209 | echo "%_args%" | find /i "/KMS-" %nul% && (setlocal & cls & (call :KMSActivation %_args% %_silent%) & endlocal) |
170 | echo "%_args%" | find /i "/Insert" %nul% && (setlocal & (call :insert_hwidkey %_args% %_silent%) & cls & endlocal) | 210 | echo "%_args%" | find /i "/Ohook" %nul% && (setlocal & cls & (call :OhookActivation %_args% %_silent%) & endlocal) |
171 | exit /b | 211 | exit /b |
172 | ) | 212 | ) |
173 | 213 | ||
@@ -181,7 +221,6 @@ set _desktop_= | |||
181 | for /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" | 221 | for /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" |
182 | if not defined _desktop_ for /f "delims=" %%a in ('%psc% "& {write-host $([Environment]::GetFolderPath('Desktop'))}"') do call set "_desktop_=%%a" | 222 | if not defined _desktop_ for /f "delims=" %%a in ('%psc% "& {write-host $([Environment]::GetFolderPath('Desktop'))}"') do call set "_desktop_=%%a" |
183 | 223 | ||
184 | set "_pdesk=%_desktop_:'=''%" | ||
185 | setlocal EnableDelayedExpansion | 224 | setlocal EnableDelayedExpansion |
186 | 225 | ||
187 | ::======================================================================================================================================== | 226 | ::======================================================================================================================================== |
@@ -190,43 +229,42 @@ setlocal EnableDelayedExpansion | |||
190 | 229 | ||
191 | cls | 230 | cls |
192 | color 07 | 231 | color 07 |
193 | title Microsoft_Activation_Scripts 1.8 | 232 | title Microsoft_Activation_Scripts 1.9 |
194 | mode 76, 30 | 233 | mode 76, 30 |
195 | set "mastemp=%SystemRoot%\Temp\__MAS" | ||
196 | if exist "%mastemp%\.*" rmdir /s /q "%mastemp%\" %nul% | ||
197 | 234 | ||
198 | echo: | 235 | echo: |
199 | echo: | 236 | echo: |
200 | echo: | 237 | echo: |
201 | echo: | 238 | echo: |
202 | echo: | ||
203 | echo: ______________________________________________________________ | 239 | echo: ______________________________________________________________ |
204 | echo: | 240 | echo: |
205 | echo: Activation Methods: | 241 | echo: Activation Methods: |
206 | echo: | 242 | echo: |
207 | echo: [1] HWID ^| Windows ^| Permanent | 243 | echo: [1] HWID ^| Windows ^| Permanent |
208 | echo: [2] KMS38 ^| Windows ^| 2038 Year | 244 | echo: [2] Ohook ^| Office ^| Permanent |
209 | echo: [3] Online KMS ^| Windows / Office ^| 180 Days | 245 | echo: [3] KMS38 ^| Windows ^| Year 2038 |
246 | echo: [4] Online KMS ^| Windows / Office ^| 180 Days | ||
210 | echo: __________________________________________________ | 247 | echo: __________________________________________________ |
211 | echo: | 248 | echo: |
212 | echo: [4] Activation Status | 249 | echo: [5] Activation Status |
213 | echo: [5] Troubleshoot | 250 | echo: [6] Troubleshoot |
214 | echo: [6] Extras | 251 | echo: [7] Extras |
215 | echo: [7] Help | 252 | echo: [8] Help |
216 | echo: [0] Exit | 253 | echo: [0] Exit |
217 | echo: ______________________________________________________________ | 254 | echo: ______________________________________________________________ |
218 | echo: | 255 | echo: |
219 | call :_color2 %_White% " " %_Green% "Enter a menu option in the Keyboard [1,2,3,4,5,6,7,0] :" | 256 | call :_color2 %_White% " " %_Green% "Enter a menu option in the Keyboard [1,2,3,4,5,6,7,8,0] :" |
220 | choice /C:12345670 /N | 257 | choice /C:123456780 /N |
221 | set _erl=%errorlevel% | 258 | set _erl=%errorlevel% |
222 | 259 | ||
223 | if %_erl%==8 exit /b | 260 | if %_erl%==9 exit /b |
224 | if %_erl%==7 start https://massgrave.dev & goto :MainMenu | 261 | if %_erl%==8 start https://%mas%/troubleshoot.html & goto :MainMenu |
225 | if %_erl%==6 goto:Extras | 262 | if %_erl%==7 goto:Extras |
226 | if %_erl%==5 setlocal & call :troubleshoot & cls & endlocal & goto :MainMenu | 263 | if %_erl%==6 setlocal & call :troubleshoot & cls & endlocal & goto :MainMenu |
227 | if %_erl%==4 setlocal & call :_Check_Status_wmi & cls & endlocal & goto :MainMenu | 264 | if %_erl%==5 setlocal & call :_Check_Status_wmi & cls & endlocal & goto :MainMenu |
228 | if %_erl%==3 setlocal & call :KMSActivation & cls & endlocal & goto :MainMenu | 265 | if %_erl%==4 setlocal & call :KMSActivation & cls & endlocal & goto :MainMenu |
229 | if %_erl%==2 setlocal & call :KMS38Activation & cls & endlocal & goto :MainMenu | 266 | if %_erl%==3 setlocal & call :KMS38Activation & cls & endlocal & goto :MainMenu |
267 | if %_erl%==2 setlocal & call :OhookActivation & cls & endlocal & goto :MainMenu | ||
230 | if %_erl%==1 setlocal & call :HWIDActivation & cls & endlocal & goto :MainMenu | 268 | if %_erl%==1 setlocal & call :HWIDActivation & cls & endlocal & goto :MainMenu |
231 | goto :MainMenu | 269 | goto :MainMenu |
232 | 270 | ||
@@ -242,14 +280,15 @@ echo: | |||
242 | echo: | 280 | echo: |
243 | echo: | 281 | echo: |
244 | echo: | 282 | echo: |
245 | echo: | ||
246 | echo: ______________________________________________________________ | 283 | echo: ______________________________________________________________ |
247 | echo: | 284 | echo: |
248 | echo: [1] Change Windows Edition | 285 | echo: [1] Change Windows Edition |
249 | echo: | 286 | echo: |
250 | echo: [2] Extract $OEM$ Folder | 287 | echo: [2] Extract $OEM$ Folder |
251 | echo: [3] Insert Windows HWID Key | 288 | echo: |
252 | echo: [4] Activation Status [vbs] | 289 | echo: [3] Activation Status [vbs] |
290 | echo: | ||
291 | echo: [4] Download Genuine Windows / Office | ||
253 | echo: __________________________________________________ | 292 | echo: __________________________________________________ |
254 | echo: | 293 | echo: |
255 | echo: [0] Go to Main Menu | 294 | echo: [0] Go to Main Menu |
@@ -260,8 +299,8 @@ choice /C:12340 /N | |||
260 | set _erl=%errorlevel% | 299 | set _erl=%errorlevel% |
261 | 300 | ||
262 | if %_erl%==5 goto :MainMenu | 301 | if %_erl%==5 goto :MainMenu |
263 | if %_erl%==4 setlocal & call :_Check_Status_vbs & cls & endlocal & goto :Extras | 302 | if %_erl%==4 start https://%mas%/genuine-installation-media.html & goto :Extras |
264 | if %_erl%==3 setlocal & call :insert_hwidkey & cls & endlocal & goto :Extras | 303 | if %_erl%==3 setlocal & call :_Check_Status_vbs & cls & endlocal & goto :Extras |
265 | if %_erl%==2 goto:Extract$OEM$ | 304 | if %_erl%==2 goto:Extract$OEM$ |
266 | if %_erl%==1 setlocal & call :change_edition & cls & endlocal & goto :Extras | 305 | if %_erl%==1 setlocal & call :change_edition & cls & endlocal & goto :Extras |
267 | goto :Extras | 306 | goto :Extras |
@@ -298,36 +337,43 @@ goto Extras | |||
298 | 337 | ||
299 | cls | 338 | cls |
300 | title Extract $OEM$ Folder | 339 | title Extract $OEM$ Folder |
301 | mode 76, 30 | 340 | mode 78, 30 |
302 | |||
303 | echo: | 341 | echo: |
304 | echo: | 342 | echo: |
305 | echo: | 343 | echo: |
306 | echo: | 344 | echo: |
345 | echo: Extract $OEM$ folder on the desktop | ||
346 | echo: ________________________________________________________ | ||
307 | echo: | 347 | echo: |
308 | echo: Extract $OEM$ folder on the desktop | 348 | echo: [1] HWID |
309 | echo: ______________________________________________________________ | 349 | echo: [2] Ohook |
310 | echo: | 350 | echo: [3] KMS38 |
311 | echo: [1] HWID | 351 | echo: [4] Online KMS |
312 | echo: [2] KMS38 | 352 | echo: |
313 | echo: [3] Online KMS | 353 | echo: [5] HWID ^(Windows^) ^+ Ohook ^(Office^) |
314 | echo: | 354 | echo: [6] HWID ^(Windows^) ^+ Online KMS ^(Office^) |
315 | echo: [4] HWID ^(Windows^) ^+ Online KMS ^(Office^) | 355 | echo: [7] KMS38 ^(Windows^) ^+ Ohook ^(Office^) |
316 | echo: [5] KMS38 ^(Windows^) ^+ Online KMS ^(Office^) | 356 | echo: [8] KMS38 ^(Windows^) ^+ Online KMS ^(Office^) |
317 | echo: __________________________________________________ | 357 | echo: [9] Online KMS ^(Windows^) ^+ Ohook ^(Office^) |
318 | echo: | 358 | echo: |
319 | echo: [0] Go Back | 359 | call :_color2 %_White% " [R] " %_Green% "ReadMe" |
320 | echo: ______________________________________________________________ | 360 | echo: [0] Go Back |
361 | echo: ________________________________________________________ | ||
321 | echo: | 362 | echo: |
322 | call :_color2 %_White% " " %_Green% "Enter a menu option in the Keyboard:" | 363 | call :_color2 %_White% " " %_Green% "Enter a menu option in the Keyboard:" |
323 | choice /C:123450 /N | 364 | choice /C:123456789R0 /N |
324 | set _erl=%errorlevel% | 365 | set _erl=%errorlevel% |
325 | 366 | ||
326 | if %_erl%==6 goto:Extras | 367 | if %_erl%==11 goto:Extras |
327 | if %_erl%==5 (set "_oem=KMS38 [Windows] + Online KMS [Office]" & set "para=/KMS38 /KMS-ActAndRenewalTask /KMS-Office" &goto:Extract$OEM$3) | 368 | if %_erl%==10 start https://%mas%/oem-folder.html &goto:Extract$OEM$2 |
328 | if %_erl%==4 (set "_oem=HWID [Windows] + Online KMS [Office]" & set "para=/HWID /KMS-ActAndRenewalTask /KMS-Office" &goto:Extract$OEM$3) | 369 | if %_erl%==9 (set "_oem=Online KMS [Windows] + Ohook [Office]" & set "para=/KMS-ActAndRenewalTask /KMS-Windows /Ohook" &goto:Extract$OEM$3) |
329 | if %_erl%==3 (set "_oem=Online KMS" & set "para=/KMS-ActAndRenewalTask /KMS-WindowsOffice" &goto:Extract$OEM$3) | 370 | if %_erl%==8 (set "_oem=KMS38 [Windows] + Online KMS [Office]" & set "para=/KMS38 /KMS-ActAndRenewalTask /KMS-Office" &goto:Extract$OEM$3) |
330 | if %_erl%==2 (set "_oem=KMS38" & set "para=/KMS38" &goto:Extract$OEM$3) | 371 | if %_erl%==7 (set "_oem=KMS38 [Windows] + Ohook [Office]" & set "para=/KMS38 /Ohook" &goto:Extract$OEM$3) |
372 | if %_erl%==6 (set "_oem=HWID [Windows] + Online KMS [Office]" & set "para=/HWID /KMS-ActAndRenewalTask /KMS-Office" &goto:Extract$OEM$3) | ||
373 | if %_erl%==5 (set "_oem=HWID [Windows] + Ohook [Office]" & set "para=/HWID /Ohook" &goto:Extract$OEM$3) | ||
374 | if %_erl%==4 (set "_oem=Online KMS" & set "para=/KMS-ActAndRenewalTask /KMS-WindowsOffice" &goto:Extract$OEM$3) | ||
375 | if %_erl%==3 (set "_oem=KMS38" & set "para=/KMS38" &goto:Extract$OEM$3) | ||
376 | if %_erl%==2 (set "_oem=Ohook" & set "para=/Ohook" &goto:Extract$OEM$3) | ||
331 | if %_erl%==1 (set "_oem=HWID" & set "para=/HWID" &goto:Extract$OEM$3) | 377 | if %_erl%==1 (set "_oem=HWID" & set "para=/HWID" &goto:Extract$OEM$3) |
332 | goto :Extract$OEM$2 | 378 | goto :Extract$OEM$2 |
333 | 379 | ||
@@ -357,13 +403,13 @@ if defined _error ( | |||
357 | echo Failed to extract $OEM$ folder on the Desktop. | 403 | echo Failed to extract $OEM$ folder on the Desktop. |
358 | ) else ( | 404 | ) else ( |
359 | echo: | 405 | echo: |
360 | call :_color %Magenta% "%_oem%" | 406 | call :_color %Blue% "%_oem%" |
361 | call :_color %Green% "$OEM$ folder is successfully created on the Desktop." | 407 | call :_color %Green% "$OEM$ folder is successfully created on the Desktop." |
362 | ) | 408 | ) |
363 | echo "%_oem%" | find /i "KMS38" 1>nul && ( | 409 | echo "%_oem%" | find /i "KMS38" 1>nul && ( |
364 | echo: | 410 | echo: |
365 | echo To KMS38 activate Server Cor/Acor editions ^(No GUI Versions^), | 411 | echo To KMS38 activate Server Cor/Acor editions ^(No GUI Versions^), |
366 | echo Check this page https://massgrave.dev/oem-folder | 412 | echo Check this page https://%mas%/oem-folder |
367 | ) | 413 | ) |
368 | echo ___________________________________________________________________ | 414 | echo ___________________________________________________________________ |
369 | echo: | 415 | echo: |
@@ -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 | ||
392 | cls | 436 | cls |
@@ -411,21 +455,25 @@ for %%A in (%_act% %_NoEditionChange%) do (if "%%A"=="1" set _unattended=1) | |||
411 | 455 | ||
412 | ::======================================================================================================================================== | 456 | ::======================================================================================================================================== |
413 | 457 | ||
414 | set winbuild=1 | 458 | set "nul1=1>nul" |
459 | set "nul2=2>nul" | ||
460 | set "nul6=2^>nul" | ||
415 | set "nul=>nul 2>&1" | 461 | set "nul=>nul 2>&1" |
462 | |||
416 | set psc=powershell.exe | 463 | set psc=powershell.exe |
464 | set winbuild=1 | ||
417 | for /f "tokens=6 delims=[]. " %%G in ('ver') do set winbuild=%%G | 465 | for /f "tokens=6 delims=[]. " %%G in ('ver') do set winbuild=%%G |
418 | 466 | ||
419 | set _NCS=1 | 467 | set _NCS=1 |
420 | if %winbuild% LSS 10586 set _NCS=0 | 468 | if %winbuild% LSS 10586 set _NCS=0 |
421 | if %winbuild% GEQ 10586 reg query "HKCU\Console" /v ForceV2 2>nul | find /i "0x0" 1>nul && (set _NCS=0) | 469 | if %winbuild% GEQ 10586 reg query "HKCU\Console" /v ForceV2 %nul2% | find /i "0x0" %nul1% && (set _NCS=0) |
422 | 470 | ||
423 | if %_NCS% EQU 1 ( | 471 | if %_NCS% EQU 1 ( |
424 | for /F %%a in ('echo prompt $E ^| cmd') do set "esc=%%a" | 472 | for /F %%a in ('echo prompt $E ^| cmd') do set "esc=%%a" |
425 | set "Red="41;97m"" | 473 | set "Red="41;97m"" |
426 | set "Gray="100;97m"" | 474 | set "Gray="100;97m"" |
427 | set "Green="42;97m"" | 475 | set "Green="42;97m"" |
428 | set "Magenta="45;97m"" | 476 | set "Blue="44;97m"" |
429 | set "_White="40;37m"" | 477 | set "_White="40;37m"" |
430 | set "_Green="40;92m"" | 478 | set "_Green="40;92m"" |
431 | set "_Yellow="40;93m"" | 479 | set "_Yellow="40;93m"" |
@@ -433,7 +481,7 @@ set "_Yellow="40;93m"" | |||
433 | set "Red="Red" "white"" | 481 | set "Red="Red" "white"" |
434 | set "Gray="Darkgray" "white"" | 482 | set "Gray="Darkgray" "white"" |
435 | set "Green="DarkGreen" "white"" | 483 | set "Green="DarkGreen" "white"" |
436 | set "Magenta="Darkmagenta" "white"" | 484 | set "Blue="Blue" "white"" |
437 | set "_White="Black" "Gray"" | 485 | set "_White="Black" "Gray"" |
438 | set "_Green="Black" "Green"" | 486 | set "_Green="Black" "Green"" |
439 | set "_Yellow="Black" "Yellow"" | 487 | set "_Yellow="Black" "Yellow"" |
@@ -441,13 +489,19 @@ set "_Yellow="Black" "Yellow"" | |||
441 | 489 | ||
442 | set "nceline=echo: &echo ==== ERROR ==== &echo:" | 490 | set "nceline=echo: &echo ==== ERROR ==== &echo:" |
443 | set "eline=echo: &call :dk_color %Red% "==== ERROR ====" &echo:" | 491 | set "eline=echo: &call :dk_color %Red% "==== ERROR ====" &echo:" |
444 | if %~z0 GEQ 200000 (set "_exitmsg=Go back") else (set "_exitmsg=Exit") | 492 | if %~z0 GEQ 200000 ( |
493 | set "_exitmsg=Go back" | ||
494 | set "_fixmsg=Go back to Main Menu, select Troubleshoot and run Fix Licensing option." | ||
495 | ) else ( | ||
496 | set "_exitmsg=Exit" | ||
497 | set "_fixmsg=In MAS folder, run Troubleshoot script and select Fix Licensing option." | ||
498 | ) | ||
445 | 499 | ||
446 | ::======================================================================================================================================== | 500 | ::======================================================================================================================================== |
447 | 501 | ||
448 | if %winbuild% LSS 10240 ( | 502 | if %winbuild% LSS 10240 ( |
449 | %eline% | 503 | %eline% |
450 | echo Unsupported OS version detected. | 504 | echo Unsupported OS version detected [%winbuild%]. |
451 | echo HWID Activation is supported only for Windows 10/11. | 505 | echo HWID Activation is supported only for Windows 10/11. |
452 | echo Use Online KMS Activation option. | 506 | echo Use Online KMS Activation option. |
453 | goto dk_done | 507 | goto dk_done |
@@ -479,9 +533,13 @@ setlocal EnableDelayedExpansion | |||
479 | ::======================================================================================================================================== | 533 | ::======================================================================================================================================== |
480 | 534 | ||
481 | cls | 535 | cls |
482 | mode 102, 34 | 536 | mode 108, 34 |
483 | title HWID Activation | 537 | title 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 | |||
541 | sc start wuauserv %nul% | ||
542 | |||
485 | echo: | 543 | echo: |
486 | echo Initializing... | 544 | echo Initializing... |
487 | call :dk_product | 545 | call :dk_product |
@@ -521,7 +579,7 @@ cls | |||
521 | :: Check Evaluation version | 579 | :: Check Evaluation version |
522 | 580 | ||
523 | if exist "%SystemRoot%\Servicing\Packages\Microsoft-Windows-*EvalEdition~*.mum" ( | 581 | if exist "%SystemRoot%\Servicing\Packages\Microsoft-Windows-*EvalEdition~*.mum" ( |
524 | reg query "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion" /v EditionID 2>nul | find /i "Eval" 1>nul && ( | 582 | reg query "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion" /v EditionID %nul2% | find /i "Eval" %nul1% && ( |
525 | %eline% | 583 | %eline% |
526 | echo [%winos% ^| %winbuild%] | 584 | echo [%winos% ^| %winbuild%] |
527 | echo: | 585 | echo: |
@@ -529,7 +587,7 @@ echo Evaluation Editions cannot be activated. | |||
529 | echo You need to install full version of %winos% | 587 | echo You need to install full version of %winos% |
530 | echo: | 588 | echo: |
531 | echo Download it from here, | 589 | echo Download it from here, |
532 | echo https://massgrave.dev/genuine-installation-media.html | 590 | echo https://%mas%/genuine-installation-media.html |
533 | goto dk_done | 591 | goto 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 | ||
541 | set osSKU= | 599 | set osSKU= |
542 | set regSKU= | 600 | set slcSKU= |
543 | set wmiSKU= | 601 | set wmiSKU= |
602 | set regSKU= | ||
544 | 603 | ||
545 | for /f "tokens=3 delims=." %%a in ('reg query "HKLM\SYSTEM\CurrentControlSet\Control\ProductOptions" /v OSProductPfn 2^>nul') do set "regSKU=%%a" | 604 | if %winbuild% GEQ 14393 (set info=Kernel-BrandingInfo) else (set info=Kernel-ProductInfo) |
546 | if %_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" | 605 | set d1=%ref% [void]$TypeBuilder.DefinePInvokeMethod('SLGetWindowsInformationDWORD', 'slc.dll', 'Public, Static', 1, [int], @([String], [int].MakeByRefType()), 1, 3); |
547 | if %_wmic% EQU 0 for /f "tokens=1" %%a in ('%psc% "([WMI]'Win32_OperatingSystem=@').OperatingSystemSKU" 2^>nul') do if not errorlevel 1 set "wmiSKU=%%a" | 606 | set d1=%d1% $Sku = 0; [void]$TypeBuilder.CreateType()::SLGetWindowsInformationDWORD('%info%', [ref]$Sku); $Sku |
607 | for /f "delims=" %%s in ('"%psc% %d1%"') do if not errorlevel 1 (set slcSKU=%%s) | ||
608 | if "%slcSKU%"=="0" set slcSKU= | ||
609 | if 1%slcSKU% NEQ +1%slcSKU% set slcSKU= | ||
548 | 610 | ||
549 | set osSKU=%wmiSKU% | 611 | for /f "tokens=3 delims=." %%a in ('reg query "HKLM\SYSTEM\CurrentControlSet\Control\ProductOptions" /v OSProductPfn %nul6%') do set "regSKU=%%a" |
612 | if %_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" | ||
613 | if %_wmic% EQU 0 for /f "tokens=1" %%a in ('%psc% "([WMI]'Win32_OperatingSystem=@').OperatingSystemSKU" %nul6%') do if not errorlevel 1 set "wmiSKU=%%a" | ||
614 | |||
615 | set osSKU=%slcSKU% | ||
616 | if not defined osSKU set osSKU=%wmiSKU% | ||
550 | if not defined osSKU set osSKU=%regSKU% | 617 | if not defined osSKU set osSKU=%regSKU% |
551 | 618 | ||
552 | if not defined osSKU ( | 619 | if not defined osSKU ( |
@@ -562,7 +629,8 @@ set error= | |||
562 | cls | 629 | cls |
563 | echo: | 630 | echo: |
564 | for /f "skip=2 tokens=2*" %%a in ('reg query "HKLM\SYSTEM\CurrentControlSet\Control\Session Manager\Environment" /v PROCESSOR_ARCHITECTURE') do set arch=%%b | 631 | for /f "skip=2 tokens=2*" %%a in ('reg query "HKLM\SYSTEM\CurrentControlSet\Control\Session Manager\Environment" /v PROCESSOR_ARCHITECTURE') do set arch=%%b |
565 | echo Checking OS Info [%winos% ^| %winbuild% ^| %arch%] | 632 | for /f "tokens=6-7 delims=[]. " %%i in ('ver') do if "%%j"=="" (set fullbuild=%%i) else (set fullbuild=%%i.%%j) |
633 | echo 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 | ||
590 | set _WSH=1 | 658 | set _WSH=1 |
591 | reg query "HKCU\SOFTWARE\Microsoft\Windows Script Host\Settings" /v Enabled 2>nul | find /i "0x0" 1>nul && (set _WSH=0) | 659 | reg query "HKCU\SOFTWARE\Microsoft\Windows Script Host\Settings" /v Enabled %nul2% | find /i "0x0" %nul1% && (set _WSH=0) |
592 | reg query "HKLM\SOFTWARE\Microsoft\Windows Script Host\Settings" /v Enabled 2>nul | find /i "0x0" 1>nul && (set _WSH=0) | 660 | reg query "HKLM\SOFTWARE\Microsoft\Windows Script Host\Settings" /v Enabled %nul2% | find /i "0x0" %nul1% && (set _WSH=0) |
593 | 661 | ||
594 | if %_WSH% EQU 0 ( | 662 | if %_WSH% EQU 0 ( |
595 | reg add "HKLM\Software\Microsoft\Windows Script Host\Settings" /v Enabled /t REG_DWORD /d 1 /f %nul% | 663 | reg 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 | ||
619 | set updatesblock= | 687 | set updatesblock= |
620 | echo: %serv_ste% | findstr /i "wuauserv" %nul% && set updatesblock=1 | 688 | echo: %serv_cor% %serv_ste% | findstr /i "wuauserv" %nul% && set updatesblock=1 |
621 | for /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 | |
622 | if exist "%SystemRoot%\System32\WaaSMedicSvc.dll" ( | 690 | sc start UsoSvc %nul% |
623 | for /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 | 691 | if %errorlevel% NEQ 1056 if %errorlevel% NEQ 0 set updatesblock=1 |
692 | |||
693 | if %winbuild% GEQ 17134 ( | ||
694 | sc start WaaSMedicSvc %nul% | ||
695 | if !errorlevel! NEQ 1056 if !errorlevel! NEQ 0 set updatesblock=1 | ||
624 | ) | 696 | ) |
625 | 697 | ||
626 | reg query HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer /v SettingsPageVisibility 2>nul | find /i "windowsupdate" %nul% && set updatesblock=1 | 698 | reg query HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer /v SettingsPageVisibility %nul2% | find /i "windowsupdate" %nul% && set updatesblock=1 |
627 | reg query HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\WindowsUpdateSysprepInProgress %nul% && set updatesblock=1 | 699 | reg query HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\WindowsUpdateSysprepInProgress %nul% && set updatesblock=1 |
628 | reg query HKLM\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate /s 2>nul | findstr /i "NoAutoUpdate DisableWindowsUpdateAccess" %nul% && set updatesblock=1 | 700 | reg query HKLM\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate /s %nul2% | findstr /i "NoAutoUpdate DisableWindowsUpdateAccess" %nul% && set updatesblock=1 |
629 | 701 | ||
630 | if defined updatesblock ( | 702 | if defined updatesblock ( |
631 | call :dk_color %Gray% "Checking Windows Update Blockers [Found]" | 703 | call :dk_color %Gray% "Checking Windows Update Blockers [Found]" |
632 | if defined applist echo: %serv_e% | find /i "wuauserv" %nul% && ( | 704 | if defined applist echo: %serv_e% | find /i "wuauserv" %nul% && ( |
633 | call :dk_color %Magenta% "Windows Update Service [wuauserv] is not working. Enable it incase if you have disabled it." | 705 | call :dk_color %Blue% "Windows Update is not working. Enable it incase if you have disabled it." |
706 | reg 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 | ||
637 | reg query "HKLM\SOFTWARE\Policies\Microsoft\WindowsStore" /v DisableStoreApps 2>nul | find /i "0x1" %nul% && ( | 710 | reg query "HKLM\SOFTWARE\Policies\Microsoft\WindowsStore" /v DisableStoreApps %nul2% | find /i "0x1" %nul% && ( |
638 | call :dk_color %Gray% "Checking Store App Blocker [Found]" | 711 | call :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]" | |||
645 | set key= | 718 | set key= |
646 | set altkey= | 719 | set altkey= |
647 | set changekey= | 720 | set changekey= |
648 | set curedition= | 721 | set altapplist= |
649 | set altedition= | 722 | set altedition= |
650 | set notworking= | 723 | set notworking= |
651 | set actidnotfound= | ||
652 | |||
653 | for /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 | ||
655 | if defined applist call :hwiddata key attempt1 | 725 | if defined applist call :hwiddata key |
656 | if not defined key call :hwiddata key attempt2 | 726 | if not defined key ( |
727 | for /f "delims=" %%a in ('%psc% "$f=[io.file]::ReadAllText('!_batp!') -split ':getactivationid\:.*';iex ($f[1]);"') do (set altapplist=%%a) | ||
728 | if defined altapplist call :hwiddata key | ||
729 | ) | ||
657 | 730 | ||
658 | if defined notworking call :hwidfallback | 731 | if defined notworking call :hwidfallback |
659 | if not defined key call :hwidfallback | 732 | if not defined key call :hwidfallback |
@@ -662,10 +735,6 @@ if defined altkey (set key=%altkey%&set changekey=1&set notworking=) | |||
662 | 735 | ||
663 | if defined notworking if defined notfoundaltactID ( | 736 | if defined notworking if defined notfoundaltactID ( |
664 | call :dk_color %Red% "Checking Alternate Edition For HWID [%altedition% Activation ID Not Found]" | 737 | call :dk_color %Red% "Checking Alternate Edition For HWID [%altedition% Activation ID Not Found]" |
665 | if exist "%SystemRoot%\Servicing\Packages\Microsoft-Windows-*EvalEdition~*.mum" ( | ||
666 | call :dk_color %Magenta% "Evaluation Windows Found. Install Full version of %winos%" | ||
667 | call :dk_color %Magenta% "Download it from https://massgrave.dev/genuine-installation-media.html" | ||
668 | ) | ||
669 | ) | 738 | ) |
670 | 739 | ||
671 | if not defined key ( | 740 | if not defined key ( |
@@ -673,7 +742,7 @@ if not defined key ( | |||
673 | echo [%winos% ^| %winbuild% ^| SKU:%osSKU%] | 742 | echo [%winos% ^| %winbuild% ^| SKU:%osSKU%] |
674 | echo Unable to find this product in the supported product list. | 743 | echo Unable to find this product in the supported product list. |
675 | echo Make sure you are using updated version of the script. | 744 | echo Make sure you are using updated version of the script. |
676 | echo https://massgrave.dev | 745 | echo https://%mas% |
677 | echo: | 746 | echo: |
678 | goto dk_done | 747 | goto dk_done |
679 | ) | 748 | ) |
@@ -686,7 +755,7 @@ if defined notworking set error=1 | |||
686 | 755 | ||
687 | echo: | 756 | echo: |
688 | if defined changekey ( | 757 | if defined changekey ( |
689 | call :dk_color %Magenta% "[%altedition%] Edition product key will be used to enable HWID activation." | 758 | call :dk_color %Blue% "[%altedition%] Edition product key will be used to enable HWID activation." |
690 | echo: | 759 | echo: |
691 | ) | 760 | ) |
692 | 761 | ||
@@ -703,8 +772,8 @@ echo Installing Generic Product Key [%key%] [Successful] | |||
703 | ) else ( | 772 | ) else ( |
704 | call :dk_color %Red% "Installing Generic Product Key [%key%] [Failed] %errorcode%" | 773 | call :dk_color %Red% "Installing Generic Product Key [%key%] [Failed] %errorcode%" |
705 | if not defined error ( | 774 | if not defined error ( |
706 | call :dk_color %Magenta% "In MAS, Goto Troubleshoot and run Fix Licensing option." | 775 | if defined altapplist call :dk_color %Red% "Activation ID not found for this key." |
707 | if defined actidnotfound call :dk_color %Red% "Activation ID not found for this key. Make sure you are using updated version of MAS." | 776 | call :dk_color %Blue% "%_fixmsg%" |
708 | set showfix=1 | 777 | set showfix=1 |
709 | ) | 778 | ) |
710 | set error=1 | 779 | set 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 | ||
717 | for /f "skip=2 tokens=2*" %%a in ('reg query "HKCU\Control Panel\International\Geo" /v Name 2^>nul') do set "name=%%b" | 786 | for /f "skip=2 tokens=2*" %%a in ('reg query "HKCU\Control Panel\International\Geo" /v Name %nul6%') do set "name=%%b" |
718 | for /f "skip=2 tokens=2*" %%a in ('reg query "HKCU\Control Panel\International\Geo" /v Nation 2^>nul') do set "nation=%%b" | 787 | for /f "skip=2 tokens=2*" %%a in ('reg query "HKCU\Control Panel\International\Geo" /v Nation %nul6%') do set "nation=%%b" |
719 | 788 | ||
720 | set regionchange= | 789 | set regionchange= |
721 | if not "%name%"=="US" ( | 790 | if 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 | ||
806 | if not exist %SystemRoot%\system32\ClipUp.exe ( | ||
807 | call :dk_color %Red% "Checking ClipUp.exe File [Not found, aborting the process]" | ||
808 | goto :dl_final | ||
809 | ) | ||
810 | |||
737 | set "tdir=%ProgramData%\Microsoft\Windows\ClipSVC\GenuineTicket" | 811 | set "tdir=%ProgramData%\Microsoft\Windows\ClipSVC\GenuineTicket" |
738 | if not exist "%tdir%\" md "%tdir%\" %nul% | 812 | if not exist "%tdir%\" md "%tdir%\" %nul% |
739 | 813 | ||
@@ -746,7 +820,7 @@ call :hwiddata ticket | |||
746 | copy /y /b "%tdir%\GenuineTicket" "%tdir%\GenuineTicket.xml" %nul% | 820 | copy /y /b "%tdir%\GenuineTicket" "%tdir%\GenuineTicket.xml" %nul% |
747 | 821 | ||
748 | if not exist "%tdir%\GenuineTicket.xml" ( | 822 | if not exist "%tdir%\GenuineTicket.xml" ( |
749 | call :dk_color %Red% "Generating GenuineTicket.xml [Failed]" | 823 | call :dk_color %Red% "Generating GenuineTicket.xml [Failed, aborting the process]" |
750 | echo [%encoded%] | 824 | echo [%encoded%] |
751 | if exist "%tdir%\Genuine*" del /f /q "%tdir%\Genuine*" %nul% | 825 | if exist "%tdir%\Genuine*" del /f /q "%tdir%\Genuine*" %nul% |
752 | goto :dl_final | 826 | goto :dl_final |
@@ -774,6 +848,12 @@ clipup -v -o | |||
774 | 848 | ||
775 | set rebuildinfo= | 849 | set rebuildinfo= |
776 | 850 | ||
851 | if not exist %ProgramData%\Microsoft\Windows\ClipSVC\tokens.dat ( | ||
852 | set error=1 | ||
853 | set rebuildinfo=1 | ||
854 | call :dk_color %Red% "Checking ClipSVC tokens.dat [Not Found]" | ||
855 | ) | ||
856 | |||
777 | %_xmlexist% ( | 857 | %_xmlexist% ( |
778 | set error=1 | 858 | set error=1 |
779 | set rebuildinfo=1 | 859 | set rebuildinfo=1 |
@@ -788,7 +868,7 @@ call :dk_color %Red% "Checking Ticket Migration [Failed]" | |||
788 | 868 | ||
789 | if defined applist if not defined showfix if defined rebuildinfo ( | 869 | if defined applist if not defined showfix if defined rebuildinfo ( |
790 | set showfix=1 | 870 | set showfix=1 |
791 | call :dk_color %Magenta% "In MAS, Goto Troubleshoot and run Fix Licensing option." | 871 | call :dk_color %Blue% "%_fixmsg%" |
792 | ) | 872 | ) |
793 | 873 | ||
794 | if exist "%tdir%\Genuine*" del /f /q "%tdir%\Genuine*" %nul% | 874 | if 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. | |||
808 | goto :dl_final | 888 | goto :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 | ||
813 | set resfail= | 895 | set resfail= |
@@ -824,21 +906,23 @@ set "d1=Add-Type -AssemblyName System.Net.Http;" | |||
824 | set "d1=!d1! $client = [System.Net.Http.HttpClient]::new();" | 906 | set "d1=!d1! $client = [System.Net.Http.HttpClient]::new();" |
825 | set "d1=!d1! $response = $client.GetAsync('https://%%#').GetAwaiter().GetResult();" | 907 | set "d1=!d1! $response = $client.GetAsync('https://%%#').GetAwaiter().GetResult();" |
826 | set "d1=!d1! $response.Content.ReadAsStringAsync().GetAwaiter().GetResult()" | 908 | set "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 | ||
830 | if not defined resfail ( | 912 | if 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 | ||
834 | if defined resfail ( | 916 | if defined resfail ( |
835 | set error=1 | 917 | set error=1 |
836 | echo: | 918 | echo: |
837 | call :dk_color %Red% "Checking Licensing Servers [Failed To Connect]" | 919 | call :dk_color %Red% "Checking Licensing Servers [Failed To Connect]" |
838 | call :dk_color2 %Magenta% "Check this page for help" %_Yellow% " https://massgrave.dev/licensing-servers-issue" | 920 | call :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 | ||
844 | if not defined error ( | 928 | if not defined error ( |
@@ -859,17 +943,30 @@ call :dk_act | |||
859 | call :dk_checkperm | 943 | call :dk_checkperm |
860 | ) | 944 | ) |
861 | 945 | ||
946 | REM Check Internet related error codes | ||
947 | |||
948 | if not defined error if not defined _perm ( | ||
949 | echo "%error_code%" | findstr /i "0x80072e 0x80072f" %nul% && ( | ||
950 | set error=1 | ||
951 | echo: | ||
952 | call :dk_color %Red% "Checking Internet Issues [Found] [%error_code%]" | ||
953 | call :dk_color2 %Blue% "Check this page for help" %_Yellow% " https://%mas%/licensing-servers-issue" | ||
954 | ) | ||
955 | ) | ||
956 | |||
957 | ::========================================================================================================================================== | ||
958 | |||
862 | echo: | 959 | echo: |
863 | if defined _perm ( | 960 | if defined _perm ( |
864 | call :dk_color %Green% "%winos% is permanently activated with a digital license." | 961 | call :dk_color %Green% "%winos% is permanently activated with a digital license." |
865 | ) else ( | 962 | ) else ( |
866 | call :dk_color %Red% "Activation Failed %error_code%" | 963 | call :dk_color %Red% "Activation Failed %error_code%" |
867 | if defined notworking ( | 964 | if defined notworking ( |
868 | call :dk_color %Magenta% "At the time of writing this, HWID Activation was not supported for this product." | 965 | call :dk_color %Blue% "At the time of writing this, HWID Activation was not supported for this product." |
869 | call :dk_color %Magenta% "Use KMS38 Activation option." | 966 | call :dk_color %Blue% "Use KMS38 Activation option." |
870 | ) else ( | 967 | ) else ( |
871 | if not defined error call :dk_color %Magenta% "In MAS, Goto Troubleshoot and run Fix Licensing option." | 968 | if not defined error call :dk_color %Blue% "%_fixmsg%" |
872 | call :dk_color2 %Magenta% "Check this page for help" %_Yellow% " https://massgrave.dev/troubleshoot" | 969 | call :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 | ||
901 | if %_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= | 998 | if %_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= |
902 | if %_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= | 999 | if %_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= |
903 | exit /b | 1000 | exit /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 | ||
930 | set applist= | 1027 | set applist= |
931 | if %_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')" | 1028 | if %_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%')" |
932 | if %_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')" | 1029 | if %_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")) |
934 | exit /b | 1031 | exit /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 = @() | ||
1039 | foreach ($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 | ||
1056 | if ($info.LastRunTime -match 99) { | ||
1057 | $task | Start-ScheduledTask | ||
1058 | Start-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 | ||
940 | set _wmic=0 | 1068 | set _wmic=0 |
941 | for %%# in (wmic.exe) do @if not "%%~$PATH:#"=="" ( | 1069 | for %%# in (wmic.exe) do @if not "%%~$PATH:#"=="" ( |
942 | wmic path Win32_ComputerSystem get CreationClassName /value 2>nul | find /i "computersystem" 1>nul && set _wmic=1 | 1070 | wmic path Win32_ComputerSystem get CreationClassName /value %nul2% | find /i "computersystem" %nul1% && set _wmic=1 |
943 | ) | 1071 | ) |
944 | exit /b | 1072 | exit /b |
945 | 1073 | ||
@@ -954,8 +1082,8 @@ set d1=%d1% $meth.SetImplementationFlags(128); $TypeBuilder.CreateType()::Brandi | |||
954 | 1082 | ||
955 | set winos= | 1083 | set winos= |
956 | for /f "delims=" %%s in ('"%psc% %d1%"') do if not errorlevel 1 (set winos=%%s) | 1084 | for /f "delims=" %%s in ('"%psc% %d1%"') do if not errorlevel 1 (set winos=%%s) |
957 | echo "%winos%" | find /i "Windows" 1>nul || ( | 1085 | echo "%winos%" | find /i "Windows" %nul1% || ( |
958 | for /f "skip=2 tokens=2*" %%a in ('reg query "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion" /v ProductName 2^>nul') do set "winos=%%b" | 1086 | for /f "skip=2 tokens=2*" %%a in ('reg query "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion" /v ProductName %nul6%') do set "winos=%%b" |
959 | if %winbuild% GEQ 22000 ( | 1087 | if %winbuild% GEQ 22000 ( |
960 | set winos=!winos:Windows 10=Windows 11! | 1088 | set winos=!winos:Windows 10=Windows 11! |
961 | ) | 1089 | ) |
@@ -975,17 +1103,33 @@ exit /b | |||
975 | 1103 | ||
976 | :dk_errorcheck | 1104 | :dk_errorcheck |
977 | 1105 | ||
1106 | set showfix= | ||
1107 | |||
1108 | :: Check corrupt services | ||
1109 | |||
1110 | set serv_cor= | ||
1111 | for %%# in (%_serv%) do ( | ||
1112 | set _corrupt= | ||
1113 | sc start %%# %nul% | ||
1114 | if !errorlevel! EQU 1060 set _corrupt=1 | ||
1115 | sc query %%# %nul% || set _corrupt=1 | ||
1116 | for %%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) | ||
1117 | if defined _corrupt (if defined serv_cor (set "serv_cor=!serv_cor! %%#") else (set "serv_cor=%%#")) | ||
1118 | ) | ||
1119 | |||
1120 | if defined serv_cor ( | ||
1121 | set error=1 | ||
1122 | call :dk_color %Red% "Checking Corrupt Services [%serv_cor%]" | ||
1123 | ) | ||
1124 | |||
1125 | ::======================================================================================================================================== | ||
1126 | |||
978 | :: Check disabled services | 1127 | :: Check disabled services |
979 | 1128 | ||
980 | set serv_ste= | 1129 | set serv_ste= |
981 | for %%# in (%_serv%) do ( | 1130 | for %%# in (%_serv%) do ( |
982 | set serv_dis= | ||
983 | reg query HKLM\SYSTEM\CurrentControlSet\Services\%%# /v ImagePath %nul% || set serv_dis=1 | ||
984 | for /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 | ||
985 | sc start %%# %nul% | 1131 | sc start %%# %nul% |
986 | if !errorlevel! EQU 1058 set serv_dis=1 | 1132 | if !errorlevel! EQU 1058 (if defined serv_ste (set "serv_ste=!serv_ste! %%#") else (set "serv_ste=%%#")) |
987 | sc query %%# %nul% || set serv_dis=1 | ||
988 | if 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= | |||
1028 | set checkerror= | 1172 | set checkerror= |
1029 | net start %%# /y %nul% | 1173 | net start %%# /y %nul% |
1030 | set errorcode=!errorlevel! | 1174 | set errorcode=!errorlevel! |
1031 | sc query %%# | find /i "4 RUNNING" %nul% || set checkerror=1 | 1175 | sc query %%# | find /i "RUNNING" %nul% || set checkerror=1 |
1032 | 1176 | ||
1033 | sc start %%# %nul% | 1177 | sc start %%# %nul% |
1034 | if !errorlevel! NEQ 1056 if !errorlevel! NEQ 0 (set errorcode=!errorlevel!&set checkerror=1) | 1178 | if !errorlevel! NEQ 1056 if !errorlevel! NEQ 0 (set errorcode=!errorlevel!&set checkerror=1) |
@@ -1039,7 +1183,8 @@ if defined serv_e ( | |||
1039 | set error=1 | 1183 | set error=1 |
1040 | call :dk_color %Red% "Starting Services [Failed] [%serv_e%]" | 1184 | call :dk_color %Red% "Starting Services [Failed] [%serv_e%]" |
1041 | echo %serv_e% | findstr /i "ClipSVC-1058 sppsvc-1058" %nul% && ( | 1185 | echo %serv_e% | findstr /i "ClipSVC-1058 sppsvc-1058" %nul% && ( |
1042 | call :dk_color %Magenta% "Restart the system to fix disabled service error 1058." | 1186 | call :dk_color %Blue% "Restart the system to fix disabled service error 1058." |
1187 | set 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 | ||
1050 | if defined safeboot_option ( | 1195 | if defined safeboot_option ( |
1051 | set error=1 | 1196 | set error=1 |
1052 | call :dk_color2 %Red% "Checking Boot Mode " %Magenta% "[System is running in safe mode. Run in normal mode.]" | 1197 | set showfix=1 |
1198 | call :dk_color2 %Red% "Checking Boot Mode " %Blue% "[System is running in safe mode. Run in normal mode.]" | ||
1053 | ) | 1199 | ) |
1054 | 1200 | ||
1055 | 1201 | ||
1056 | reg query "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Setup\State" 2>nul | find /i "IMAGE_STATE_COMPLETE" 1>nul || ( | 1202 | reg query "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Setup\State" %nul2% | find /i "IMAGE_STATE_COMPLETE" %nul1% || ( |
1057 | set error=1 | 1203 | set error=1 |
1058 | call :dk_color2 %Red% "Checking Audit Mode " %Magenta% "[System is running in Audit mode. Run in normal mode.]" | 1204 | set showfix=1 |
1205 | call :dk_color2 %Red% "Checking Audit Mode " %Blue% "[IMAGE_STATE_COMPLETE status not found. Run in normal mode.]" | ||
1059 | ) | 1206 | ) |
1060 | 1207 | ||
1061 | 1208 | ||
1062 | reg query "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\WinPE" /v InstRoot %nul% && ( | 1209 | reg query "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\WinPE" /v InstRoot %nul% && ( |
1063 | set error=1 | 1210 | set error=1 |
1064 | call :dk_color2 %Red% "Checking WinPE " %Magenta% "[System is running in WinPE mode. Run in normal mode.]" | 1211 | set showfix=1 |
1065 | ) | 1212 | call :dk_color2 %Red% "Checking WinPE " %Blue% "[System is running in WinPE mode. Run in normal mode.]" |
1066 | |||
1067 | |||
1068 | for %%# in (wmic.exe) do @if "%%~$PATH:#"=="" ( | ||
1069 | call :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% || ( |
1074 | set error=1 | 1217 | set error=1 |
1075 | call :dk_color %Red% "Checking Powershell [Not Responding]" | 1218 | call :dk_color %Red% "Checking Powershell [Not Responding]" |
1076 | ) | 1219 | ) |
1077 | 1220 | ||
1078 | 1221 | ||
1079 | set wmifailed= | ||
1080 | if %_wmic% EQU 1 wmic path Win32_ComputerSystem get CreationClassName /value 2>nul | find /i "computersystem" 1>nul | ||
1081 | if %_wmic% EQU 0 %psc% "Get-CIMInstance -Class Win32_ComputerSystem | Select-Object -Property CreationClassName" 2>nul | find /i "computersystem" 1>nul | ||
1082 | if %errorlevel% NEQ 0 ( | ||
1083 | set error=1 | ||
1084 | set wmifailed=1 | ||
1085 | call :dk_color %Red% "Checking WMI [Not Responding] %_wmic%" | ||
1086 | call :dk_color %Magenta% "In MAS, Goto Troubleshoot and run Fix WMI option." | ||
1087 | ) | ||
1088 | |||
1089 | |||
1090 | if not "%regSKU%"=="%wmiSKU%" ( | ||
1091 | call :dk_color %Red% "Checking WMI/REG SKU [Difference Found - WMI:%wmiSKU% Reg:%regSKU%]" | ||
1092 | ) | ||
1093 | |||
1094 | |||
1095 | DISM /English /Online /Get-CurrentEdition %nul% | 1222 | DISM /English /Online /Get-CurrentEdition %nul% |
1096 | set error_code=%errorlevel% | 1223 | set dism_error=%errorlevel% |
1097 | cmd /c exit /b %error_code% | 1224 | cmd /c exit /b %dism_error% |
1098 | if %error_code% NEQ 0 set "error_code=[0x%=ExitCode%]" | 1225 | if %dism_error% NEQ 0 set "dism_error=[0x%=ExitCode%]" |
1099 | if %error_code% NEQ 0 ( | 1226 | if %dism_error% NEQ 0 ( |
1100 | call :dk_color %Red% "Checking DISM [Not Responding] %error_code%" | 1227 | call :dk_color %Red% "Checking DISM [Not Responding] %dism_error%" |
1101 | ) | 1228 | ) |
1102 | 1229 | ||
1103 | 1230 | ||
1104 | if exist "%SystemRoot%\Servicing\Packages\Microsoft-Windows-*EvalEdition~*.mum" ( | 1231 | if not defined officeact if exist "%SystemRoot%\Servicing\Packages\Microsoft-Windows-*EvalEdition~*.mum" ( |
1105 | set error=1 | 1232 | set error=1 |
1106 | call :dk_color %Red% "Checking Eval Packages [Non-Eval Licenses are installed in Eval Windows]" | 1233 | call :dk_color %Red% "Checking Eval Packages [Non-Eval Licenses are installed in Eval Windows]" |
1234 | if /i %dism_error%==[0x800F0805] ( | ||
1235 | for %%# in (4 125 126 188 191 205) do if "%osSKU%"=="%%#" ( | ||
1236 | call :dk_color %Blue% "Evaluation Windows can not be activated and different License install may lead to errors." | ||
1237 | call :dk_color %Blue% "It is recommended to install full version of %winos%." | ||
1238 | call :dk_color %Blue% "You can download it from https://%mas%/genuine-installation-media.html" | ||
1239 | set 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 | ||
1255 | for %%# in (wmic.exe) do @if "%%~$PATH:#"=="" ( | ||
1256 | call :dk_color %Gray% "Checking WMIC.exe [Not Found]" | ||
1257 | ) | ||
1258 | |||
1259 | |||
1260 | set wmifailed= | ||
1261 | if %_wmic% EQU 1 wmic path Win32_ComputerSystem get CreationClassName /value %nul2% | find /i "computersystem" %nul1% | ||
1262 | if %_wmic% EQU 0 %psc% "Get-CIMInstance -Class Win32_ComputerSystem | Select-Object -Property CreationClassName" %nul2% | find /i "computersystem" %nul1% | ||
1263 | |||
1264 | if %errorlevel% NEQ 0 set wmifailed=1 | ||
1265 | echo "%error_code%" | findstr /i "0x800410 0x800440" %nul1% && set wmifailed=1& :: https://learn.microsoft.com/en-us/windows/win32/wmisdk/wmi-error-constants | ||
1266 | if defined wmifailed ( | ||
1267 | set error=1 | ||
1268 | call :dk_color %Red% "Checking WMI [Not Responding]" | ||
1269 | call :dk_color %Blue% "In MAS, Goto Troubleshoot and run Fix WMI option." | ||
1270 | set showfix=1 | ||
1271 | ) | ||
1272 | |||
1273 | |||
1274 | %nul% set /a "sum=%slcSKU%+%regSKU%+%wmiSKU%" | ||
1275 | set /a "sum/=3" | ||
1276 | if not defined officeact if not "%sum%"=="%slcSKU%" ( | ||
1277 | call :dk_color %Red% "Checking SLC/WMI/REG SKU [Difference Found - SLC:%slcSKU% WMI:%wmiSKU% Reg:%regSKU%]" | ||
1278 | ) | ||
1279 | |||
1280 | |||
1120 | reg query "HKU\S-1-5-20\Software\Microsoft\Windows NT\CurrentVersion\SoftwareProtectionPlatform\PersistedTSReArmed" %nul% && ( | 1281 | reg query "HKU\S-1-5-20\Software\Microsoft\Windows NT\CurrentVersion\SoftwareProtectionPlatform\PersistedTSReArmed" %nul% && ( |
1121 | set error=1 | 1282 | set error=1 |
1122 | call :dk_color2 %Red% "Checking Rearm " %Magenta% "[System Restart Is Required]" | 1283 | set showfix=1 |
1284 | call :dk_color2 %Red% "Checking Rearm " %Blue% "[System Restart Is Required]" | ||
1123 | ) | 1285 | ) |
1124 | 1286 | ||
1125 | 1287 | ||
1126 | reg query "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\ClipSVC\Volatile\PersistedSystemState" %nul% && ( | 1288 | reg query "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\ClipSVC\Volatile\PersistedSystemState" %nul% && ( |
1127 | set error=1 | 1289 | set error=1 |
1128 | call :dk_color2 %Red% "Checking ClipSVC " %Magenta% "[System Restart Is Required]" | 1290 | set showfix=1 |
1291 | call :dk_color2 %Red% "Checking ClipSVC " %Blue% "[System Restart Is Required]" | ||
1129 | ) | 1292 | ) |
1130 | 1293 | ||
1131 | 1294 | ||
1132 | for /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 ( | 1295 | for /f "skip=2 tokens=2*" %%a in ('reg query "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\SoftwareProtectionPlatform" /v "SkipRearm" %nul6%') do if /i %%b NEQ 0x0 ( |
1133 | reg add "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\SoftwareProtectionPlatform" /v "SkipRearm" /t REG_DWORD /d "0" /f %nul% | 1296 | reg add "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\SoftwareProtectionPlatform" /v "SkipRearm" /t REG_DWORD /d "0" /f %nul% |
1134 | call :dk_color %Red% "Checking SkipRearm [Default 0 Value Not Found, Changing To 0]" | 1297 | call :dk_color %Red% "Checking SkipRearm [Default 0 Value Not Found. Changing To 0]" |
1135 | net stop sppsvc /y %nul% | 1298 | net stop sppsvc /y %nul% |
1136 | net start sppsvc /y %nul% | 1299 | net start sppsvc /y %nul% |
1137 | set error=1 | 1300 | set error=1 |
@@ -1140,7 +1303,24 @@ set error=1 | |||
1140 | 1303 | ||
1141 | reg query "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\SoftwareProtectionPlatform\Plugins\Objects\msft:rm/algorithm/hwid/4.0" /f ba02fed39662 /d %nul% || ( | 1304 | reg query "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\SoftwareProtectionPlatform\Plugins\Objects\msft:rm/algorithm/hwid/4.0" /f ba02fed39662 /d %nul% || ( |
1142 | call :dk_color %Red% "Checking SPP Registry Key [Incorrect ModuleId Found]" | 1305 | call :dk_color %Red% "Checking SPP Registry Key [Incorrect ModuleId Found]" |
1306 | call :dk_color %Blue% "Possibly Caused By Gaming Spoofers. Help: https://%mas%/troubleshoot" | ||
1143 | set error=1 | 1307 | set error=1 |
1308 | set showfix=1 | ||
1309 | ) | ||
1310 | |||
1311 | |||
1312 | set tokenstore= | ||
1313 | for /f "skip=2 tokens=2*" %%a in ('reg query "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\SoftwareProtectionPlatform" /v TokenStore %nul6%') do call set "tokenstore=%%b" | ||
1314 | if not exist "%tokenstore%\" ( | ||
1315 | set error=1 | ||
1316 | REM This code creates token folder only if it's missing and sets default permission for it | ||
1317 | mkdir "%tokenstore%" %nul% | ||
1318 | set "d=$sddl = 'O:BAG:BAD:PAI(A;OICI;FA;;;SY)(A;OICI;FA;;;BA)(A;OICIIO;GR;;;BU)(A;;FR;;;BU)(A;OICI;FA;;;S-1-5-80-123231216-2592883651-3715271367-3753151631-4175906628)';" | ||
1319 | set "d=!d! $AclObject = New-Object System.Security.AccessControl.DirectorySecurity;" | ||
1320 | set "d=!d! $AclObject.SetSecurityDescriptorSddlForm($sddl);" | ||
1321 | set "d=!d! Set-Acl -Path %tokenstore% -AclObject $AclObject;" | ||
1322 | %psc% "!d!" %nul% | ||
1323 | call :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 | ||
1161 | set tokenstore= | ||
1162 | for /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" | ||
1163 | if not exist "%tokenstore%\" ( | ||
1164 | set error=1 | ||
1165 | call :dk_color %Red% "Checking SPP Token Folder [Not Found] [%tokenstore%\]" | ||
1166 | ) | ||
1167 | |||
1168 | |||
1169 | if exist "%tokenstore%\" if not exist "%tokenstore%\tokens.dat" ( | 1341 | if exist "%tokenstore%\" if not exist "%tokenstore%\tokens.dat" ( |
1170 | set error=1 | 1342 | set error=1 |
1171 | call :dk_color %Red% "Checking SPP tokens.dat [Not Found] [%tokenstore%\]" | 1343 | call :dk_color %Red% "Checking SPP tokens.dat [Not Found] [%tokenstore%\]" |
1172 | ) | 1344 | ) |
1173 | 1345 | ||
1174 | 1346 | ||
1175 | if not exist %ProgramData%\Microsoft\Windows\ClipSVC\tokens.dat ( | 1347 | if not exist %SystemRoot%\system32\sppsvc.exe ( |
1176 | set error=1 | 1348 | set error=1 |
1177 | call :dk_color %Red% "Checking ClipSVC tokens.dat [Not Found]" | 1349 | set showfix=1 |
1350 | call :dk_color %Red% "Checking sppsvc.exe File [Not Found]" | ||
1178 | ) | 1351 | ) |
1179 | 1352 | ||
1180 | 1353 | ||
1181 | if not exist %SystemRoot%\system32\sppsvc.exe ( | 1354 | set task= |
1182 | set error=1 | 1355 | set taskerror= |
1183 | call :dk_color %Red% "Checking sppsvc.exe File [Not Found]" | 1356 | if not defined wmifailed if not defined officeact ( |
1357 | for /f "delims=" %%a in ('%psc% "$f=[io.file]::ReadAllText('!_batp!') -split ':gettaskinfo\:.*';iex ($f[1]);"') do (set task=%%a) | ||
1358 | echo "!task!" | find /i "Ready 0 " %nul% || set taskerror=1 | ||
1359 | echo "!task!" | find "99" %nul% && set taskerror=1 | ||
1360 | if defined taskerror ( | ||
1361 | call :dk_color %Gray% "Checking SvcRestartTask Last Run [Issues Found, !task!]" | ||
1362 | call :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 | ||
1189 | set showfix= | ||
1190 | set wpaerror= | 1369 | set wpaerror= |
1191 | set permerror= | 1370 | set permerror= |
1192 | if not defined serv_cste if /i not %error_code%==0 if /i not %error_code%==0xC004D302 if not defined wmifailed ( | 1371 | if not defined serv_cor if not defined serv_cste if defined error if /i not %error_code%==0 if not defined showfix ( |
1193 | 1372 | ||
1194 | REM This code checks for invalid registry keys in HKLM\SYSTEM\WPA. This issue may appear even on healthy systems. | 1373 | REM This code checks for invalid registry keys in HKLM\SYSTEM\WPA. This issue may appear even on healthy systems. |
1195 | 1374 | ||
1196 | if %winbuild% GEQ 14393 ( | 1375 | if %winbuild% GEQ 14393 ( |
1197 | set /a count=0 | 1376 | set /a count=0 |
1198 | for /f %%a in ('reg query "HKLM\SYSTEM\WPA" 2^>nul') do set /a count+=1 | 1377 | for /f %%a in ('reg query "HKLM\SYSTEM\WPA" %nul6%') do set /a count+=1 |
1199 | for /L %%# in (1,1,!count!) do ( | 1378 | for /L %%# in (1,1,!count!) do ( |
1200 | reg query "HKLM\SYSTEM\WPA\8DEC0AF1-0341-4b93-85CD-72606C2DF94C-7P-%%#" /ve /t REG_BINARY %nul% || set wpaerror=1 | 1379 | reg 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 | |||
1217 | if defined permerror call :dk_color %Red% "Checking SPP Permissions [Error Found]" | 1396 | if defined permerror call :dk_color %Red% "Checking SPP Permissions [Error Found]" |
1218 | 1397 | ||
1219 | set showfix=1 | 1398 | set showfix=1 |
1220 | call :dk_color %Magenta% "In MAS, Goto Troubleshoot and run Fix Licensing option." | 1399 | call :dk_color %Blue% "%_fixmsg%" |
1221 | if not defined permerror call :dk_color %Magenta% "If activation still fails then run Fix WPA Registry option." | 1400 | if not defined permerror call :dk_color %Blue% "If activation still fails then run Fix WPA Registry option." |
1222 | ) | 1401 | ) |
1223 | 1402 | ||
1224 | exit /b | 1403 | exit /b |
@@ -1250,7 +1429,7 @@ exit /b | |||
1250 | echo: | 1429 | echo: |
1251 | if %_unattended%==1 timeout /t 2 & exit /b | 1430 | if %_unattended%==1 timeout /t 2 & exit /b |
1252 | call :dk_color %_Yellow% "Press any key to %_exitmsg%..." | 1431 | call :dk_color %_Yellow% "Press any key to %_exitmsg%..." |
1253 | pause >nul | 1432 | pause %nul1% |
1254 | exit /b | 1433 | exit /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 | |||
1282 | 2a6137f3-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 | 1461 | 2a6137f3-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 |
1283 | e558417a-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 | 1462 | e558417a-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 |
1284 | c5198a66-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 | 1463 | c5198a66-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 |
1464 | f6e29426-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 | ||
1285 | cce9d2de-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 | 1465 | cce9d2de-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 |
1286 | d06934ee-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 | 1466 | d06934ee-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 |
1287 | 706e0cfd-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 | 1467 | 706e0cfd-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 |
1288 | faa57748-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 | 1468 | faa57748-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 |
1469 | 837766ff-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 | ||
1289 | 2c060131-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 | 1470 | 2c060131-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 |
1290 | e8f74caa-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 | 1471 | e8f74caa-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 |
1291 | 3d1022d8-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 | 1472 | 3d1022d8-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 |
1292 | 60c243e1-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 | 1473 | 60c243e1-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 |
1474 | 01eb852c-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 | ||
1293 | eb6d346f-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 | 1475 | eb6d346f-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 |
1294 | 89e87510-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 | 1476 | 89e87510-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 |
1295 | 62f0c100-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 | 1477 | 62f0c100-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 | |||
1299 | af5c9381-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 | 1481 | af5c9381-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 |
1300 | 8ab9bdd1-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 | 1482 | 8ab9bdd1-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 |
1301 | ed655016-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 | 1483 | ed655016-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 |
1484 | 6c4de1b8-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 | ||
1302 | d4bdc678-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 | 1485 | d4bdc678-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 |
1303 | 92fb8726-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 | 1486 | 92fb8726-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 |
1304 | d4f9b41f-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 | 1487 | d4f9b41f-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 ( |
1306 | for /f "tokens=1-10 delims=_" %%A in ("%%#") do ( | 1489 | for /f "tokens=1-9 delims=_" %%A in ("%%#") do ( |
1307 | |||
1308 | if %1==key if %osSKU%==%%C ( | ||
1309 | |||
1310 | REM Detect key attempt 1 | ||
1311 | |||
1312 | if "%2"=="attempt1" if not defined key ( | ||
1313 | echo "!applist!" | find /i "%%A" 1>nul && ( | ||
1314 | if %%F==1 set notworking=1 | ||
1315 | set key=%%B | ||
1316 | ) | ||
1317 | ) | ||
1318 | 1490 | ||
1319 | REM Detect key attempt 2 | 1491 | REM Detect key |
1320 | 1492 | ||
1321 | if "%2"=="attempt2" if not defined key ( | 1493 | if %1==key if %osSKU%==%%C if not defined key ( |
1322 | set actidnotfound=1 | 1494 | echo "!applist! !altapplist!" | find /i "%%A" %nul1% && ( |
1323 | set 9th=%%I | ||
1324 | if not defined 9th ( | ||
1325 | if %%F==1 set notworking=1 | 1495 | if %%F==1 set notworking=1 |
1326 | set key=%%B | 1496 | set key=%%B |
1327 | ) else ( | ||
1328 | echo "%branch%" | find /i "%%I" 1>nul && ( | ||
1329 | if %%F==1 set notworking=1 | ||
1330 | set key=%%B | ||
1331 | ) | ||
1332 | ) | ||
1333 | ) | 1497 | ) |
1334 | ) | 1498 | ) |
1335 | 1499 | ||
@@ -1338,7 +1502,7 @@ REM Generate ticket | |||
1338 | if %1==ticket if "%key%"=="%%B" ( | 1502 | if %1==ticket if "%key%"=="%%B" ( |
1339 | set "string=OSMajorVersion=5;OSMinorVersion=1;OSPlatformId=2;PP=0;Pfn=Microsoft.Windows.%%C.%%D_8wekyb3d8bbwe;DownlevelGenuineState=1;$([char]0)" | 1503 | set "string=OSMajorVersion=5;OSMinorVersion=1;OSPlatformId=2;PP=0;Pfn=Microsoft.Windows.%%C.%%D_8wekyb3d8bbwe;DownlevelGenuineState=1;$([char]0)" |
1340 | for /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" | 1504 | for /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" |
1341 | echo "!encoded!" | find "AAAA" 1>nul || exit /b | 1505 | echo "!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= | |||
1368 | if %_NoEditionChange%==1 exit /b | 1530 | if %_NoEditionChange%==1 exit /b |
1369 | 1531 | ||
1370 | for %%# in ( | 1532 | for %%# in ( |
1371 | 125_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 | 1533 | 125_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 |
1372 | 191_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 | 1534 | 125_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 |
1373 | 138_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 | 1535 | 138_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 |
1536 | 139_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 | ||
1537 | 139_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 ( |
1375 | for /f "tokens=1-6 delims=_" %%A in ("%%#") do if %osSKU%==%%A ( | 1539 | for /f "tokens=1-6 delims=_" %%A in ("%%#") do if %osSKU%==%%A ( |
1376 | echo "!applist!" | find /i "%%C" 1>nul && ( | 1540 | echo "!applist! !altapplist!" | find /i "%%C" %nul1% && ( |
1377 | echo "!applist!" | find /i "%%D" 1>nul && ( | 1541 | echo "!applist!" | find /i "%%D" %nul1% && ( |
1378 | set altkey=%%E | 1542 | set altkey=%%E |
1379 | set curedition=%%B | ||
1380 | set altedition=%%F | 1543 | set altedition=%%F |
1381 | ) || ( | 1544 | ) || ( |
1382 | set altedition=%%F | 1545 | set 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 | ||
1560 | set _act=0 | ||
1561 | |||
1562 | :: To remove Ohook activation, run the script with /Ohook-Uninstall parameter or change 0 to 1 in below line | ||
1563 | set _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 | |||
1569 | cls | ||
1570 | color 07 | ||
1571 | title Ohook Activation | ||
1572 | |||
1573 | set _args= | ||
1574 | set _elev= | ||
1575 | set _unattended=0 | ||
1576 | |||
1577 | set _args=%* | ||
1578 | if defined _args set _args=%_args:"=% | ||
1579 | if defined _args ( | ||
1580 | for %%A in (%_args%) do ( | ||
1581 | if /i "%%A"=="/Ohook" set _act=1 | ||
1582 | if /i "%%A"=="/Ohook-Uninstall" set _rem=1 | ||
1583 | if /i "%%A"=="-el" set _elev=1 | ||
1584 | ) | ||
1585 | ) | ||
1586 | |||
1587 | for %%A in (%_act% %_rem%) do (if "%%A"=="1" set _unattended=1) | ||
1588 | |||
1589 | ::======================================================================================================================================== | ||
1590 | |||
1591 | set "nul1=1>nul" | ||
1592 | set "nul2=2>nul" | ||
1593 | set "nul6=2^>nul" | ||
1594 | set "nul=>nul 2>&1" | ||
1595 | |||
1596 | set psc=powershell.exe | ||
1597 | set winbuild=1 | ||
1598 | for /f "tokens=6 delims=[]. " %%G in ('ver') do set winbuild=%%G | ||
1599 | |||
1600 | set _NCS=1 | ||
1601 | if %winbuild% LSS 10586 set _NCS=0 | ||
1602 | if %winbuild% GEQ 10586 reg query "HKCU\Console" /v ForceV2 %nul2% | find /i "0x0" %nul1% && (set _NCS=0) | ||
1603 | |||
1604 | if %_NCS% EQU 1 ( | ||
1605 | for /F %%a in ('echo prompt $E ^| cmd') do set "esc=%%a" | ||
1606 | set "Red="41;97m"" | ||
1607 | set "Gray="100;97m"" | ||
1608 | set "Green="42;97m"" | ||
1609 | set "Blue="44;97m"" | ||
1610 | set "_White="40;37m"" | ||
1611 | set "_Green="40;92m"" | ||
1612 | set "_Yellow="40;93m"" | ||
1613 | ) else ( | ||
1614 | set "Red="Red" "white"" | ||
1615 | set "Gray="Darkgray" "white"" | ||
1616 | set "Green="DarkGreen" "white"" | ||
1617 | set "Blue="Blue" "white"" | ||
1618 | set "_White="Black" "Gray"" | ||
1619 | set "_Green="Black" "Green"" | ||
1620 | set "_Yellow="Black" "Yellow"" | ||
1621 | ) | ||
1622 | |||
1623 | set "nceline=echo: &echo ==== ERROR ==== &echo:" | ||
1624 | set "eline=echo: &call :dk_color %Red% "==== ERROR ====" &echo:" | ||
1625 | if %~z0 GEQ 200000 ( | ||
1626 | set "_exitmsg=Go back" | ||
1627 | set "_fixmsg=Go back to Main Menu, select Troubleshoot and run Fix Licensing option." | ||
1628 | ) else ( | ||
1629 | set "_exitmsg=Exit" | ||
1630 | set "_fixmsg=In MAS folder, run Troubleshoot script and select Fix Licensing option." | ||
1631 | ) | ||
1632 | |||
1633 | ::======================================================================================================================================== | ||
1634 | |||
1635 | if %winbuild% LSS 9200 ( | ||
1636 | %eline% | ||
1637 | echo Unsupported OS version detected [%winbuild%]. | ||
1638 | echo Ohook Activation is supported on Windows 8 and later and their server equivalent. | ||
1639 | goto dk_done | ||
1640 | ) | ||
1641 | |||
1642 | ::======================================================================================================================================== | ||
1643 | |||
1644 | :: Fix for the special characters limitation in path name | ||
1645 | |||
1646 | set "_work=%~dp0" | ||
1647 | if "%_work:~-1%"=="\" set "_work=%_work:~0,-1%" | ||
1648 | |||
1649 | set "_batf=%~f0" | ||
1650 | set "_batp=%_batf:'=''%" | ||
1651 | |||
1652 | set _PSarg="""%~f0""" -el %_args% | ||
1653 | |||
1654 | set "_ttemp=%temp%" | ||
1655 | |||
1656 | setlocal EnableDelayedExpansion | ||
1657 | |||
1658 | ::======================================================================================================================================== | ||
1659 | |||
1660 | if %_rem%==1 goto :oh_uninstall | ||
1661 | |||
1662 | :oh_menu | ||
1663 | |||
1664 | if %_unattended%==0 ( | ||
1665 | cls | ||
1666 | mode 76, 25 | ||
1667 | title Ohook Activation | ||
1668 | |||
1669 | echo: | ||
1670 | echo: | ||
1671 | echo: | ||
1672 | echo: | ||
1673 | echo ____________________________________________________________ | ||
1674 | echo: | ||
1675 | echo [1] Install Ohook Office Activation | ||
1676 | echo: | ||
1677 | echo [2] Uninstall | ||
1678 | echo ____________________________________________ | ||
1679 | echo: | ||
1680 | echo [3] Download Office | ||
1681 | echo: | ||
1682 | echo [0] %_exitmsg% | ||
1683 | echo ____________________________________________________________ | ||
1684 | echo: | ||
1685 | call :dk_color2 %_White% " " %_Green% "Enter a menu option in the Keyboard [1,2,3,0]" | ||
1686 | choice /C:1230 /N | ||
1687 | set _el=!errorlevel! | ||
1688 | if !_el!==4 exit /b | ||
1689 | if !_el!==3 start https://%mas%/genuine-installation-media.html &goto :oh_menu | ||
1690 | if !_el!==2 goto :oh_uninstall | ||
1691 | if !_el!==1 goto :oh_menu2 | ||
1692 | goto :oh_menu | ||
1693 | ) | ||
1694 | |||
1695 | ::======================================================================================================================================== | ||
1696 | |||
1697 | :oh_menu2 | ||
1698 | |||
1699 | cls | ||
1700 | mode 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 | |||
1703 | title Ohook Activation | ||
1704 | |||
1705 | echo: | ||
1706 | echo Initializing... | ||
1707 | call :dk_product | ||
1708 | call :dk_ckeckwmic | ||
1709 | |||
1710 | :: Show info for potential script stuck scenario | ||
1711 | |||
1712 | sc start sppsvc %nul% | ||
1713 | if %errorlevel% NEQ 1056 if %errorlevel% NEQ 0 ( | ||
1714 | echo: | ||
1715 | echo Error code: %errorlevel% | ||
1716 | call :dk_color %Red% "Failed to start [sppsvc] service, rest of the process may take a long time..." | ||
1717 | echo: | ||
1718 | ) | ||
1719 | |||
1720 | ::======================================================================================================================================== | ||
1721 | |||
1722 | set error= | ||
1723 | |||
1724 | cls | ||
1725 | echo: | ||
1726 | for /f "skip=2 tokens=2*" %%a in ('reg query "HKLM\SYSTEM\CurrentControlSet\Control\Session Manager\Environment" /v PROCESSOR_ARCHITECTURE') do set osarch=%%b | ||
1727 | for /f "tokens=6-7 delims=[]. " %%i in ('ver') do if "%%j"=="" (set fullbuild=%%i) else (set fullbuild=%%i.%%j) | ||
1728 | echo Checking OS Info [%winos% ^| %fullbuild% ^| %osarch%] | ||
1729 | |||
1730 | ::======================================================================================================================================== | ||
1731 | |||
1732 | :: Check Windows Script Host | ||
1733 | |||
1734 | set _WSH=1 | ||
1735 | reg query "HKCU\SOFTWARE\Microsoft\Windows Script Host\Settings" /v Enabled %nul2% | find /i "0x0" %nul1% && (set _WSH=0) | ||
1736 | reg query "HKLM\SOFTWARE\Microsoft\Windows Script Host\Settings" /v Enabled %nul2% | find /i "0x0" %nul1% && (set _WSH=0) | ||
1737 | |||
1738 | if %_WSH% EQU 0 ( | ||
1739 | reg add "HKLM\Software\Microsoft\Windows Script Host\Settings" /v Enabled /t REG_DWORD /d 1 /f %nul% | ||
1740 | reg add "HKCU\Software\Microsoft\Windows Script Host\Settings" /v Enabled /t REG_DWORD /d 1 /f %nul% | ||
1741 | if not "%arch%"=="x86" reg add "HKLM\Software\Microsoft\Windows Script Host\Settings" /v Enabled /t REG_DWORD /d 1 /f /reg:32 %nul% | ||
1742 | echo Enabling Windows Script Host [Successful] | ||
1743 | ) | ||
1744 | |||
1745 | ::======================================================================================================================================== | ||
1746 | |||
1747 | echo Initiating Diagnostic Tests... | ||
1748 | |||
1749 | set "_serv=sppsvc Winmgmt" | ||
1750 | set officeact=1 | ||
1751 | call :dk_errorcheck | ||
1752 | |||
1753 | :: Check unsupported office versions | ||
1754 | |||
1755 | set o14msi= | ||
1756 | set o14c2r= | ||
1757 | set o16uwp= | ||
1758 | |||
1759 | set _68=HKLM\SOFTWARE\Microsoft\Office | ||
1760 | set _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 | |||
1766 | if %winbuild% GEQ 10240 %psc% "Get-AppxPackage -name "Microsoft.Office.Desktop"" | find /i "Office" %nul1% && set o16uwp=Office UWP | ||
1767 | |||
1768 | if not "%o14msi%%o14c2r%%o16uwp%"=="" ( | ||
1769 | echo: | ||
1770 | set error=1 | ||
1771 | call :dk_color %Red% "Checking Unsupported Office Install [ %o14msi%%o14c2r%%o16uwp%]" | ||
1772 | ) | ||
1773 | |||
1774 | ::======================================================================================================================================== | ||
1775 | |||
1776 | :: Check supported office versions | ||
1777 | |||
1778 | call :oh_getpath | ||
1779 | |||
1780 | sc query ClickToRunSvc %nul% | ||
1781 | set error1=%errorlevel% | ||
1782 | |||
1783 | if defined o16c2r if %error1% EQU 1060 ( | ||
1784 | call :dk_color %Red% "Checking ClickToRun Service [Not found, Office 16.0 files found]" | ||
1785 | set o16c2r= | ||
1786 | set error=1 | ||
1787 | ) | ||
1788 | |||
1789 | sc query OfficeSvc %nul% | ||
1790 | set error2=%errorlevel% | ||
1791 | |||
1792 | if defined o15c2r if %error1% EQU 1060 if %error2% EQU 1060 ( | ||
1793 | call :dk_color %Red% "Checking ClickToRun Service [Not found, Office 15.0 files found]" | ||
1794 | set o15c2r= | ||
1795 | set error=1 | ||
1796 | ) | ||
1797 | |||
1798 | if "%o16c2r%%o15c2r%%o16msi%%o15msi%"=="" ( | ||
1799 | set error=1 | ||
1800 | echo: | ||
1801 | if not "%o14msi%%o14c2r%%o16uwp%"=="" ( | ||
1802 | call :dk_color %Red% "Checking Supported Office Install [Not Found]" | ||
1803 | ) else ( | ||
1804 | call :dk_color %Red% "Checking Installed Office [Not Found]" | ||
1805 | ) | ||
1806 | |||
1807 | if %winbuild% GEQ 10240 %psc% "Get-AppxPackage -name "Microsoft.MicrosoftOfficeHub"" | find /i "Office" %nul1% && ( | ||
1808 | echo: | ||
1809 | echo You have only Office dashboard app installed, you need to install full Office version. | ||
1810 | ) | ||
1811 | echo: | ||
1812 | call :dk_color %Blue% "Download and install Office from below URL and try again." | ||
1813 | echo: | ||
1814 | echo https://%mas%/genuine-installation-media.html | ||
1815 | goto dk_done | ||
1816 | ) | ||
1817 | |||
1818 | set multioffice= | ||
1819 | if not "%o16c2r%%o15c2r%%o16msi%%o15msi%"=="1" set multioffice=1 | ||
1820 | if not "%o14msi%%o14c2r%%o16uwp%"=="" set multioffice=1 | ||
1821 | |||
1822 | if defined multioffice ( | ||
1823 | call :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 | |||
1830 | if not defined o15c2r goto :starto16c2r | ||
1831 | |||
1832 | call :oh_reset | ||
1833 | call :oh_actids | ||
1834 | |||
1835 | set oVer=15 | ||
1836 | for /f "skip=2 tokens=2*" %%a in ('"reg query %o15c2r_reg% /v InstallPath" %nul6%') do (set "_oRoot=%%b\root") | ||
1837 | for /f "skip=2 tokens=2*" %%a in ('"reg query %o15c2r_reg%\Configuration /v Platform" %nul6%') do (set "_oArch=%%b") | ||
1838 | if not defined _oArch for /f "skip=2 tokens=2*" %%a in ('"reg query %o15c2r_reg%\propertyBag /v Platform" %nul6%') do (set "_oArch=%%b") | ||
1839 | |||
1840 | echo "%o15c2r_reg%" | find /i "Wow6432Node" %nul1% && (set _tok=10) || (set _tok=9) | ||
1841 | for /f "tokens=%_tok% delims=\" %%a in ('reg query %o15c2r_reg%\ProductReleaseIDs\Active %nul6% ^| findstr /i "Retail Volume"') do ( | ||
1842 | if not defined _oIds (set "_oIds=%%a") else (set "_oIds=!_oIds! %%a") | ||
1843 | ) | ||
1844 | |||
1845 | set "_oLPath=%_oRoot%\Licenses" | ||
1846 | |||
1847 | if [%_oArch%]==[x64] (set "_hookPath=%_oRoot%\vfs\System" & set "_hook=sppc64.dll") | ||
1848 | if [%_oArch%]==[x86] (set "_hookPath=%_oRoot%\vfs\SystemX86" & set "_hook=sppc32.dll") | ||
1849 | if not [%osarch%]==[x86] ( | ||
1850 | if [%_oArch%]==[x64] set "_sppcPath=%SystemRoot%\System32\sppc.dll" | ||
1851 | if [%_oArch%]==[x86] set "_sppcPath=%SystemRoot%\SysWOW64\sppc.dll" | ||
1852 | ) else ( | ||
1853 | set "_sppcPath=%SystemRoot%\System32\sppc.dll" | ||
1854 | ) | ||
1855 | |||
1856 | echo: | ||
1857 | echo Activating Office 15.0 %_oArch% C2R... | ||
1858 | |||
1859 | if not defined _oIds ( | ||
1860 | call :dk_color %Red% "Checking Installed Products [Product IDs not found. Aborting activation...]" | ||
1861 | set error=1 | ||
1862 | goto :starto16c2r | ||
1863 | ) | ||
1864 | |||
1865 | call :oh_process | ||
1866 | call :oh_hookinstall | ||
1867 | |||
1868 | ::======================================================================================================================================== | ||
1869 | |||
1870 | :starto16c2r | ||
1871 | |||
1872 | :: Process Office 16.0 C2R | ||
1873 | |||
1874 | if not defined o16c2r goto :startmsi | ||
1875 | |||
1876 | call :oh_reset | ||
1877 | call :oh_actids | ||
1878 | |||
1879 | set oVer=16 | ||
1880 | for /f "skip=2 tokens=2*" %%a in ('"reg query %o16c2r_reg% /v InstallPath" %nul6%') do (set "_oRoot=%%b\root") | ||
1881 | for /f "skip=2 tokens=2*" %%a in ('"reg query %o16c2r_reg%\Configuration /v Platform" %nul6%') do (set "_oArch=%%b") | ||
1882 | |||
1883 | echo "%o16c2r_reg%" | find /i "Wow6432Node" %nul1% && (set _tok=9) || (set _tok=8) | ||
1884 | for /f "tokens=%_tok% delims=\" %%a in ('reg query "%o16c2r_reg%\ProductReleaseIDs" /s /f ".16" /k %nul6% ^| findstr /i "Retail Volume"') do ( | ||
1885 | if not defined _oIds (set "_oIds=%%a") else (set "_oIds=!_oIds! %%a") | ||
1886 | ) | ||
1887 | set _oIds=%_oIds:.16=% | ||
1888 | |||
1889 | set "_oLPath=%_oRoot%\Licenses16" | ||
1890 | |||
1891 | if [%_oArch%]==[x64] (set "_hookPath=%_oRoot%\vfs\System" & set "_hook=sppc64.dll") | ||
1892 | if [%_oArch%]==[x86] (set "_hookPath=%_oRoot%\vfs\SystemX86" & set "_hook=sppc32.dll") | ||
1893 | if not [%osarch%]==[x86] ( | ||
1894 | if [%_oArch%]==[x64] set "_sppcPath=%SystemRoot%\System32\sppc.dll" | ||
1895 | if [%_oArch%]==[x86] set "_sppcPath=%SystemRoot%\SysWOW64\sppc.dll" | ||
1896 | ) else ( | ||
1897 | set "_sppcPath=%SystemRoot%\System32\sppc.dll" | ||
1898 | ) | ||
1899 | |||
1900 | echo: | ||
1901 | echo Activating Office 16.0 %_oArch% C2R... | ||
1902 | |||
1903 | if not defined _oIds ( | ||
1904 | call :dk_color %Red% "Checking Installed Products [Product IDs not found. Aborting activation...]" | ||
1905 | set error=1 | ||
1906 | goto :startmsi | ||
1907 | ) | ||
1908 | |||
1909 | call :oh_process | ||
1910 | call :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 | |||
1916 | set sub_next= | ||
1917 | set kNext=HKCU\SOFTWARE\Microsoft\Office\16.0\Common\Licensing | ||
1918 | |||
1919 | reg query %kNext%\LicensingNext /v MigrationToV5Done %nul2% | find /i "0x1" %nul% && ( | ||
1920 | reg query %kNext%\LicensingNext %nul2% | findstr /i "volume retail" %nul2% | findstr /i "0x2 0x3" %nul% && ( | ||
1921 | set sub_next=1 | ||
1922 | reg delete %kNext% /f %nul% | ||
1923 | ) | ||
1924 | ) | ||
1925 | |||
1926 | if defined sub_next ( | ||
1927 | reg query %kNext%\LicensingNext %nul% && ( | ||
1928 | call :dk_color %Red% "Removing Office vNext Block [Failed]" | ||
1929 | ) || ( | ||
1930 | echo 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 | |||
1939 | echo "%_lic%" | find /i "Subscription" %nul% && ( | ||
1940 | echo Adding a Reg To Skip License Check [Successful] | ||
1941 | reg 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 | |||
1950 | echo "%_oIds%" | find /i "Volume" %nul1% && ( | ||
1951 | if %winbuild% GEQ 9200 ( | ||
1952 | if not [%osarch%]==[x86] ( | ||
1953 | reg delete "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\SoftwareProtectionPlatform\0ff1ce15-a989-479d-af46-f275c6370663" /f /reg:32 %nul% | ||
1954 | reg 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 | ) | ||
1956 | reg delete "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\SoftwareProtectionPlatform\0ff1ce15-a989-479d-af46-f275c6370663" /f %nul% | ||
1957 | reg 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% | ||
1958 | echo Adding a Reg To Prevent Banner [Successful] | ||
1959 | ) | ||
1960 | ) | ||
1961 | |||
1962 | ::======================================================================================================================================== | ||
1963 | |||
1964 | :startmsi | ||
1965 | |||
1966 | if defined o15msi call :oh_processmsi 15 %o15msi_reg% | ||
1967 | if defined o16msi call :oh_processmsi 16 %o16msi_reg% | ||
1968 | |||
1969 | ::======================================================================================================================================== | ||
1970 | |||
1971 | :: Uninstall other / grace Keys | ||
1972 | |||
1973 | set upk_result=0 | ||
1974 | set allapplist= | ||
1975 | |||
1976 | if %_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%')" | ||
1977 | if %_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 | |||
1980 | for %%# in (%allapplist%) do ( | ||
1981 | echo "%_allactid%" | find /i "%%#" %nul1% || ( | ||
1982 | cscript //nologo %windir%\system32\slmgr.vbs /upk %%# %nul% && ( | ||
1983 | set upk_result=1 | ||
1984 | ) || ( | ||
1985 | set error=1 | ||
1986 | set upk_result=2 | ||
1987 | ) | ||
1988 | ) | ||
1989 | ) | ||
1990 | |||
1991 | if not %upk_result%==0 echo: | ||
1992 | if %upk_result%==1 echo Uninstalling Other/Grace Keys [Successful] | ||
1993 | if %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 | |||
2000 | if exist "%windir%\system32\spp\store_test\2.0\tokens.dat" ( | ||
2001 | cscript //nologo %windir%\system32\slmgr.vbs /rilc %nul% | ||
2002 | if !errorlevel! NEQ 0 cscript //nologo %windir%\system32\slmgr.vbs /rilc %nul% | ||
2003 | ) | ||
2004 | |||
2005 | ::======================================================================================================================================== | ||
2006 | |||
2007 | echo: | ||
2008 | if not defined error ( | ||
2009 | call :dk_color %Green% "Office is permanently activated." | ||
2010 | echo Help: https://%mas%/troubleshoot | ||
2011 | ) else ( | ||
2012 | call :dk_color %Red% "Some errors were detected." | ||
2013 | if not defined ierror if not defined showfix if not defined serv_cor if not defined serv_cste call :dk_color %Blue% "%_fixmsg%" | ||
2014 | echo: | ||
2015 | call :dk_color2 %Blue% "Check this page for help" %_Yellow% " https://%mas%/troubleshoot" | ||
2016 | ) | ||
2017 | |||
2018 | goto :dk_done | ||
2019 | |||
2020 | ::======================================================================================================================================== | ||
2021 | |||
2022 | :oh_uninstall | ||
2023 | |||
2024 | cls | ||
2025 | mode 99, 28 | ||
2026 | title Uninstall Ohook Activation | ||
2027 | |||
2028 | set _present= | ||
2029 | set _unerror= | ||
2030 | call :oh_reset | ||
2031 | call :oh_getpath | ||
2032 | |||
2033 | echo: | ||
2034 | echo Uninstalling Ohook Activation... | ||
2035 | echo: | ||
2036 | |||
2037 | if defined o16c2r_reg (for /f "skip=2 tokens=2*" %%a in ('"reg query %o16c2r_reg% /v InstallPath" %nul6%') do (set "_16CHook=%%b\root\vfs")) | ||
2038 | if defined o15c2r_reg (for /f "skip=2 tokens=2*" %%a in ('"reg query %o15c2r_reg% /v InstallPath" %nul6%') do (set "_15CHook=%%b\root\vfs")) | ||
2039 | if defined o16msi_reg (for /f "skip=2 tokens=2*" %%a in ('"reg query %o16msi_reg%\Common\InstallRoot /v Path" %nul6%') do (set "_16MHook=%%b")) | ||
2040 | if defined o15msi_reg (for /f "skip=2 tokens=2*" %%a in ('"reg query %o15msi_reg%\Common\InstallRoot /v Path" %nul6%') do (set "_15MHook=%%b")) | ||
2041 | |||
2042 | if defined _16CHook (if exist "%_16CHook%\System\sppc*dll" (set _present=1& del /s /f /q "%_16CHook%\System\sppc*dll" & if exist "%_16CHook%\System\sppc*dll" set _unerror=1)) | ||
2043 | if defined _16CHook (if exist "%_16CHook%\SystemX86\sppc*dll" (set _present=1& del /s /f /q "%_16CHook%\SystemX86\sppc*dll" & if exist "%_16CHook%\SystemX86\sppc*dll" set _unerror=1)) | ||
2044 | if 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)) | ||
2045 | if defined _15CHook (if exist "%_15CHook%\SystemX86\sppc*dll" (set _present=1& del /s /f /q "%_15CHook%\SystemX86\sppc*dll" & if exist "%_15CHook%\SystemX86\sppc*dll" set _unerror=1)) | ||
2046 | if defined _16MHook (if exist "%_16MHook%sppc*dll" (set _present=1& del /s /f /q "%_16MHook%sppc*dll" & if exist "%_16MHook%sppc*dll" set _unerror=1)) | ||
2047 | if defined _15MHook (if exist "%_15MHook%sppc*dll" (set _present=1& del /s /f /q "%_15MHook%sppc*dll" & if exist "%_15MHook%sppc*dll" set _unerror=1)) | ||
2048 | |||
2049 | for %%# in (15 16) do ( | ||
2050 | for %%A in ("%ProgramFiles%" "%ProgramW6432%" "%ProgramFiles(x86)%") do ( | ||
2051 | if exist "%%~A\Microsoft Office\Office%%#\sppc*dll" (set _present=1& del /s /f /q "%%~A\Microsoft Office\Office%%#\sppc*dll" & if exist "%%~A\Microsoft Office\Office%%#\sppc*dll" set _unerror=1) | ||
2052 | ) | ||
2053 | ) | ||
2054 | |||
2055 | for %%# in (System SystemX86) do ( | ||
2056 | for %%G in ("Office 15" "Office") do ( | ||
2057 | for %%A in ("%ProgramFiles%" "%ProgramW6432%" "%ProgramFiles(x86)%") do ( | ||
2058 | if 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 | |||
2063 | reg query HKCU\Software\Microsoft\Office\16.0\Common\Licensing\Resiliency /s %nul2% | find /i "2033" %nul% && ( | ||
2064 | echo: | ||
2065 | echo Deleting - HKCU\Software\Microsoft\Office\16.0\Common\Licensing\Resiliency | ||
2066 | reg delete HKCU\Software\Microsoft\Office\16.0\Common\Licensing\Resiliency /f | ||
2067 | ) | ||
2068 | |||
2069 | reg query "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\SoftwareProtectionPlatform\0ff1ce15-a989-479d-af46-f275c6370663" %nul% && ( | ||
2070 | echo: | ||
2071 | echo Deleting - Registry key to prevent non-genuine banner | ||
2072 | reg delete "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\SoftwareProtectionPlatform\0ff1ce15-a989-479d-af46-f275c6370663" /f | ||
2073 | ) | ||
2074 | |||
2075 | reg query "HKLM\SOFTWARE\Wow6432Node\Microsoft\Windows NT\CurrentVersion\SoftwareProtectionPlatform\0ff1ce15-a989-479d-af46-f275c6370663" %nul% && ( | ||
2076 | reg delete "HKLM\SOFTWARE\Wow6432Node\Microsoft\Windows NT\CurrentVersion\SoftwareProtectionPlatform\0ff1ce15-a989-479d-af46-f275c6370663" /f | ||
2077 | ) | ||
2078 | |||
2079 | echo __________________________________________________________________________________________ | ||
2080 | echo: | ||
2081 | |||
2082 | if not defined _present ( | ||
2083 | echo Ohook Activation is not installed. | ||
2084 | ) else ( | ||
2085 | if defined _unerror ( | ||
2086 | call :dk_color %Red% "Failed to uninstall Ohook activation." | ||
2087 | call :dk_color %Blue% "Close Office apps if they are running and try again." | ||
2088 | ) else ( | ||
2089 | call :dk_color %Green% "Successfully uninstalled Ohook activation." | ||
2090 | ) | ||
2091 | ) | ||
2092 | echo __________________________________________________________________________________________ | ||
2093 | |||
2094 | goto :dk_done | ||
2095 | |||
2096 | ::======================================================================================================================================== | ||
2097 | |||
2098 | :oh_reset | ||
2099 | |||
2100 | set _oRoot= | ||
2101 | set _oArch= | ||
2102 | set _oIds= | ||
2103 | set _oLPath= | ||
2104 | set _hookPath= | ||
2105 | set _hook= | ||
2106 | set _sppcPath= | ||
2107 | set _key= | ||
2108 | set _actid= | ||
2109 | set _prod= | ||
2110 | set _lic= | ||
2111 | set _License= | ||
2112 | exit /b | ||
2113 | |||
2114 | ::======================================================================================================================================== | ||
2115 | |||
2116 | :oh_getpath | ||
2117 | |||
2118 | set o16c2r= | ||
2119 | set o15c2r= | ||
2120 | set o16msi= | ||
2121 | set o15msi= | ||
2122 | |||
2123 | set _68=HKLM\SOFTWARE\Microsoft\Office | ||
2124 | set _86=HKLM\SOFTWARE\Wow6432Node\Microsoft\Office | ||
2125 | |||
2126 | for /f "skip=2 tokens=2*" %%a in ('"reg query %_86%\ClickToRun /v InstallPath" %nul6%') do if exist "%%b\root\Licenses16\ProPlus*.xrm-ms" (set o16c2r=1&set o16c2r_reg=%_86%\ClickToRun) | ||
2127 | for /f "skip=2 tokens=2*" %%a in ('"reg query %_68%\ClickToRun /v InstallPath" %nul6%') do if exist "%%b\root\Licenses16\ProPlus*.xrm-ms" (set o16c2r=1&set o16c2r_reg=%_68%\ClickToRun) | ||
2128 | for /f "skip=2 tokens=2*" %%a in ('"reg query %_86%\15.0\ClickToRun /v InstallPath" %nul6%') do if exist "%%b\root\Licenses\ProPlus*.xrm-ms" (set o15c2r=1&set o15c2r_reg=%_86%\15.0\ClickToRun) | ||
2129 | for /f "skip=2 tokens=2*" %%a in ('"reg query %_68%\15.0\ClickToRun /v InstallPath" %nul6%') do if exist "%%b\root\Licenses\ProPlus*.xrm-ms" (set o15c2r=1&set o15c2r_reg=%_68%\15.0\ClickToRun) | ||
2130 | |||
2131 | for /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) | ||
2132 | for /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) | ||
2133 | for /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) | ||
2134 | for /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 | |||
2136 | exit /b | ||
2137 | |||
2138 | ::======================================================================================================================================== | ||
2139 | |||
2140 | :oh_installkey | ||
2141 | |||
2142 | if %_wmic% EQU 1 wmic path SoftwareLicensingService where __CLASS='SoftwareLicensingService' call InstallProductKey ProductKey="%_key%" %nul% | ||
2143 | if %_wmic% EQU 0 %psc% "(([WMISEARCHER]'SELECT Version FROM SoftwareLicensingService').Get()).InstallProductKey('%_key%')" %nul% | ||
2144 | if not %errorlevel%==0 cscript //nologo %windir%\system32\slmgr.vbs /ipk %_key% %nul% | ||
2145 | set errorcode=%errorlevel% | ||
2146 | cmd /c exit /b %errorcode% | ||
2147 | if %errorcode% NEQ 0 set "errorcode=[0x%=ExitCode%]" | ||
2148 | |||
2149 | if %errorcode% EQU 0 ( | ||
2150 | call :dk_refresh | ||
2151 | echo Installing Generic Product Key [%_key%] [%_prod%] [%_lic%] [Successful] | ||
2152 | ) else ( | ||
2153 | call :dk_color %Red% "Installing Generic Product Key [%_key%] [%_prod%] [%_lic%] [Failed] %errorcode%" | ||
2154 | if not defined error ( | ||
2155 | call :dk_color %Blue% "%_fixmsg%" | ||
2156 | set showfix=1 | ||
2157 | ) | ||
2158 | set error=1 | ||
2159 | ) | ||
2160 | |||
2161 | exit /b | ||
2162 | |||
2163 | ::======================================================================================================================================== | ||
2164 | |||
2165 | :oh_installlic | ||
2166 | |||
2167 | if not defined _oLPath exit /b | ||
2168 | |||
2169 | set _License=%_prod:Retail=R_% | ||
2170 | set _License=%_License:Volume=VL_% | ||
2171 | |||
2172 | for %%# in ("!_oLPath!\client-issuance-*.xrm-ms") do ( | ||
2173 | cscript //nologo %windir%\system32\slmgr.vbs /ilc "!_oLPath!\%%~nx#" %nul% | ||
2174 | ) | ||
2175 | cscript //nologo %windir%\system32\slmgr.vbs /ilc "!_oLPath!\pkeyconfig-office.xrm-ms" %nul% | ||
2176 | |||
2177 | for %%# in ("!_oLPath!\%_License%*.xrm-ms") do ( | ||
2178 | cscript //nologo %windir%\system32\slmgr.vbs /ilc "!_oLPath!\%%~nx#" %nul% | ||
2179 | ) | ||
2180 | |||
2181 | call :oh_actids | ||
2182 | |||
2183 | echo "!oapplist!" | find /i "!_actid!" %nul1% && ( | ||
2184 | call :dk_color %Gray% "Installing Missing License Files [Office %oVer%.0 %_prod%] [Successful]" | ||
2185 | ) || ( | ||
2186 | set error=1 | ||
2187 | call :dk_color %Red% "Installing Missing License Files [Office %oVer%.0 %_prod%] [Failed]" | ||
2188 | ) | ||
2189 | |||
2190 | exit /b | ||
2191 | |||
2192 | ::======================================================================================================================================== | ||
2193 | |||
2194 | :oh_hookinstall | ||
2195 | |||
2196 | set ierror= | ||
2197 | set hasherror= | ||
2198 | |||
2199 | del /s /q "%_hookPath%\sppcs.dll" %nul% | ||
2200 | del /s /q "%_hookPath%\sppc.dll" %nul% | ||
2201 | |||
2202 | if exist "%_hookPath%\sppcs.dll" set ierror=1 | ||
2203 | if exist "%_hookPath%\sppc.dll" set ierror=1 | ||
2204 | |||
2205 | mklink "%_hookPath%\sppcs.dll" "%_sppcPath%" %nul% | ||
2206 | if not %errorlevel%==0 set ierror=1 | ||
2207 | |||
2208 | if not exist "%_hookPath%\sppc.dll" call :oh_extractdll "%_hookPath%\sppc.dll" | ||
2209 | if not exist "%_hookPath%\sppc.dll" set ierror=1 | ||
2210 | |||
2211 | echo: | ||
2212 | if not defined ierror ( | ||
2213 | echo Symlinking System's sppc.dll To ["%_hookPath%\sppcs.dll"] [Successful] | ||
2214 | echo Extracting Custom %_hook% To ["%_hookPath%\sppc.dll"] [Successful] | ||
2215 | ) else ( | ||
2216 | set error=1 | ||
2217 | call :dk_color %Red% "Symlinking Systems sppc.dll [Failed]" | ||
2218 | call :dk_color %Red% "Extracting Custom %_hook% [Failed]" | ||
2219 | echo ["%_hookPath%\sppc.dll"] | ||
2220 | call :dk_color %Blue% "Close Office apps if they are running and try again." | ||
2221 | ) | ||
2222 | |||
2223 | if not defined ierror ( | ||
2224 | if defined hasherror ( | ||
2225 | set error=1 | ||
2226 | set ierror=1 | ||
2227 | call :dk_color %Red% "Modifying Hash of Custom %_hook% [Failed]" | ||
2228 | ) else ( | ||
2229 | echo Modifying Hash of Custom %_hook% [Successful] | ||
2230 | ) | ||
2231 | ) | ||
2232 | |||
2233 | exit /b | ||
2234 | |||
2235 | ::======================================================================================================================================== | ||
2236 | |||
2237 | :oh_process | ||
2238 | |||
2239 | for %%# in (%_oIds%) do ( | ||
2240 | set _key= | ||
2241 | set _actid= | ||
2242 | set _lic= | ||
2243 | set _prod=%%# | ||
2244 | |||
2245 | call :ohookdata getinfo %%# | ||
2246 | |||
2247 | if not [!_key!]==[] ( | ||
2248 | echo "!oapplist!" | find /i "!_actid!" %nul1% || call :oh_installlic | ||
2249 | call :oh_installkey | ||
2250 | ) else ( | ||
2251 | set error=1 | ||
2252 | call :dk_color %Red% "Checking Product In Script [Office %oVer%.0 %%# not found in script]" | ||
2253 | echo Make sure you are using Latest MAS script. | ||
2254 | ) | ||
2255 | ) | ||
2256 | |||
2257 | exit /b | ||
2258 | |||
2259 | ::======================================================================================================================================== | ||
2260 | |||
2261 | :oh_msiproducts | ||
2262 | |||
2263 | set msitemp=%SystemRoot%\Temp\_msitemp.txt | ||
2264 | |||
2265 | if %oVer%==15 set _psmsikey=%o15msi_reg:HKLM\=HKLM:% | ||
2266 | if %oVer%==16 set _psmsikey=%o16msi_reg:HKLM\=HKLM:% | ||
2267 | |||
2268 | if 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 | |||
2271 | if exist %msitemp% call :ohookdata getmsiprod | ||
2272 | if exist %msitemp% del /f /q %msitemp% | ||
2273 | |||
2274 | exit /b | ||
2275 | |||
2276 | ::======================================================================================================================================== | ||
2277 | |||
2278 | :oh_processmsi | ||
2279 | |||
2280 | :: Process Office MSI Version | ||
2281 | |||
2282 | call :oh_reset | ||
2283 | call :oh_actids | ||
2284 | |||
2285 | set oVer=%1 | ||
2286 | for /f "skip=2 tokens=2*" %%a in ('"reg query %2\Common\InstallRoot /v Path" %nul6%') do (set "_oRoot=%%b") | ||
2287 | if "%_oRoot:~-1%"=="\" set "_oRoot=%_oRoot:~0,-1%" | ||
2288 | |||
2289 | echo "%2" | find /i "Wow6432Node" %nul1% && set _oArch=x86 | ||
2290 | if not [%osarch%]==[x86] if not defined _oArch set _oArch=x64 | ||
2291 | if [%osarch%]==[x86] set _oArch=x86 | ||
2292 | |||
2293 | if [%_oArch%]==[x64] (set "_hookPath=%_oRoot%" & set "_hook=sppc64.dll") | ||
2294 | if [%_oArch%]==[x86] (set "_hookPath=%_oRoot%" & set "_hook=sppc32.dll") | ||
2295 | if not [%osarch%]==[x86] ( | ||
2296 | if [%_oArch%]==[x64] set "_sppcPath=%SystemRoot%\System32\sppc.dll" | ||
2297 | if [%_oArch%]==[x86] set "_sppcPath=%SystemRoot%\SysWOW64\sppc.dll" | ||
2298 | ) else ( | ||
2299 | set "_sppcPath=%SystemRoot%\System32\sppc.dll" | ||
2300 | ) | ||
2301 | |||
2302 | call :oh_msiproducts | ||
2303 | |||
2304 | echo: | ||
2305 | echo Activating Office %1.0 %_oArch% MSI... | ||
2306 | |||
2307 | if not defined _oIds ( | ||
2308 | set error=1 | ||
2309 | call :dk_color %Red% "Checking Installed Products [Product IDs not found. Aborting activation...]" | ||
2310 | exit /b | ||
2311 | ) | ||
2312 | |||
2313 | call :oh_process | ||
2314 | call :oh_hookinstall | ||
2315 | |||
2316 | exit /b | ||
2317 | |||
2318 | ::======================================================================================================================================== | ||
2319 | |||
2320 | :: Get Office Activation IDs | ||
2321 | |||
2322 | :oh_actids | ||
2323 | |||
2324 | set oapplist= | ||
2325 | if %_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%')" | ||
2326 | if %_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")) | ||
2328 | exit /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 | |||
2341 | set f= | ||
2342 | for %%# in ( | ||
2343 | 15_ab4d047b-97cf-4126-a69f-34df08e2f254_B7R%f%FY-7N%f%XPK-Q43%f%42-Y9%f%X2H-3JX%f%4X_Retail________AccessRetail | ||
2344 | 15_4374022d-56b8-48c1-9bb7-d8f2fc726343_9MF%f%9G-CN%f%32B-HV7%f%XT-9X%f%J8T-9KV%f%F4_MAK___________AccessVolume | ||
2345 | 15_1b1d9bd5-12ea-4063-964c-16e7e87d6e08_NT8%f%89-MB%f%H4X-8MD%f%4H-X8%f%R2D-WQH%f%F8_Retail________ExcelRetail | ||
2346 | 15_ac1ae7fd-b949-4e04-a330-849bc40638cf_Y3N%f%36-YC%f%HDK-XYW%f%BG-KY%f%QVV-BDT%f%J2_MAK___________ExcelVolume | ||
2347 | 15_cfaf5356-49e3-48a8-ab3c-e729ab791250_BMK%f%4W-6N%f%88B-BP9%f%QR-PH%f%FCK-MG7%f%GF_Retail________GrooveRetail | ||
2348 | 15_4825ac28-ce41-45a7-9e6e-1fed74057601_RN8%f%4D-7H%f%CWY-FTC%f%BK-JM%f%XWM-HT7%f%GJ_MAK___________GrooveVolume | ||
2349 | 15_c02fb62e-1cd5-4e18-ba25-e0480467ffaa_2WQ%f%NF-GB%f%K4B-XVG%f%6F-BB%f%MX7-M4F%f%2Y_OEM-Perp______HomeBusinessPipcRetail | ||
2350 | 15_cd256150-a898-441f-aac0-9f8f33390e45_NVT%f%DK-QB%f%8J9-M28%f%GR-92%f%BPC-BR9%f%6Q_Retail________HomeBusinessRetail | ||
2351 | 15_98685d21-78bd-4c62-bc4f-653344a63035_R29%f%WQ-CM%f%NCM-2TH%f%CT-K4%f%H92-FX6%f%KR_Retail________HomeStudentRetail | ||
2352 | 15_44984381-406e-4a35-b1c3-e54f499556e2_RV7%f%NQ-HY%f%3WW-7CK%f%WH-QT%f%VMW-29V%f%HC_Retail________InfoPathRetail | ||
2353 | 15_9e016989-4007-42a6-8051-64eb97110cf2_C4T%f%GN-QQ%f%W6Y-FYK%f%XC-6W%f%JW7-X73%f%VG_MAK___________InfoPathVolume | ||
2354 | 15_9103f3ce-1084-447a-827e-d6097f68c895_6MD%f%N4-WF%f%3FV-4WH%f%3Q-W6%f%99V-RGC%f%MY_PrepidBypass__LyncAcademicRetail | ||
2355 | 15_ff693bf4-0276-4ddb-bb42-74ef1a0c9f4d_N42%f%BF-CB%f%Y9F-W2C%f%7R-X3%f%97X-DYF%f%QW_PrepidBypass__LyncEntryRetail | ||
2356 | 15_fada6658-bfc6-4c4e-825a-59a89822cda8_89P%f%23-2N%f%K2R-JXM%f%2M-3Q%f%8R8-BWM%f%3Y_Retail________LyncRetail | ||
2357 | 15_e1264e10-afaf-4439-a98b-256df8bb156f_3WK%f%CD-RN%f%489-4M7%f%XJ-GJ%f%2GQ-YBF%f%Q6_MAK___________LyncVolume | ||
2358 | 15_3169c8df-f659-4f95-9cc6-3115e6596e83_YYH%f%XG-KT%f%NKF-XGR%f%T7-H2%f%99D-8K6%f%MM_Retail________MondoRetail | ||
2359 | 15_f33485a0-310b-4b72-9a0e-b1d605510dbd_2YN%f%YQ-FQ%f%MVG-CB8%f%KW-6X%f%KYD-M7R%f%RJ_MAK___________MondoVolume | ||
2360 | 15_3391e125-f6e4-4b1e-899c-a25e6092d40d_4TG%f%WV-6N%f%9P6-G2H%f%8Y-2H%f%WKB-B4F%f%F4_Bypass________OneNoteFreeRetail | ||
2361 | 15_8b524bcc-67ea-4876-a509-45e46f6347e8_3KX%f%XQ-PV%f%N2C-8P7%f%YY-HC%f%V88-GVG%f%Q6_Retail________OneNoteRetail | ||
2362 | 15_b067e965-7521-455b-b9f7-c740204578a2_JDM%f%WF-NJ%f%C7B-HRC%f%HY-WF%f%T8G-BPX%f%D9_MAK___________OneNoteVolume | ||
2363 | 15_12004b48-e6c8-4ffa-ad5a-ac8d4467765a_9N4%f%RQ-CF%f%8R2-HBV%f%CB-J3%f%C9V-94P%f%4D_Retail________OutlookRetail | ||
2364 | 15_8d577c50-ae5e-47fd-a240-24986f73d503_HNG%f%29-GG%f%WRG-RFC%f%8C-JT%f%FP4-2J9%f%FH_MAK___________OutlookVolume | ||
2365 | 15_5aab8561-1686-43f7-9ff5-2c861da58d17_9CY%f%B3-NF%f%MRW-YFD%f%G6-XC%f%7TF-BY3%f%6J_OEM-Perp______PersonalPipcRetail | ||
2366 | 15_17e9df2d-ed91-4382-904b-4fed6a12caf0_2NC%f%QJ-MF%f%RMH-TXV%f%83-J7%f%V4C-RVR%f%WC_Retail________PersonalRetail | ||
2367 | 15_31743b82-bfbc-44b6-aa12-85d42e644d5b_HVM%f%N2-KP%f%HQH-DVQ%f%MK-7B%f%3CM-FGB%f%FC_Retail________PowerPointRetail | ||
2368 | 15_e40dcb44-1d5c-4085-8e8f-943f33c4f004_47D%f%KN-HP%f%JP7-RF9%f%M3-VC%f%YT2-TMQ%f%4G_MAK___________PowerPointVolume | ||
2369 | 15_064383fa-1538-491c-859b-0ecab169a0ab_N3Q%f%MM-GK%f%DT3-JQG%f%X6-7X%f%3MQ-4GB%f%G3_Retail________ProPlusRetail | ||
2370 | 15_2b88c4f2-ea8f-43cd-805e-4d41346e18a7_QKH%f%NX-M9%f%GGH-T3Q%f%MW-YP%f%K4Q-QRP%f%9V_MAK___________ProPlusVolume | ||
2371 | 15_4e26cac1-e15a-4467-9069-cb47b67fe191_CF9%f%DD-6C%f%NW2-BJW%f%JQ-CV%f%CFX-Y7T%f%XD_OEM-Perp______ProfessionalPipcRetail | ||
2372 | 15_44bc70e2-fb83-4b09-9082-e5557e0c2ede_MBQ%f%BN-CQ%f%PT6-PXR%f%MC-TY%f%JFR-3C8%f%MY_Retail________ProfessionalRetail | ||
2373 | 15_f2435de4-5fc0-4e5b-ac97-34f515ec5ee7_B4R%f%N4-H4%f%JYG-YMQ%f%MC-CY%f%GKH-46W%f%PH_Retail________ProjectProRetail | ||
2374 | 15_ed34dc89-1c27-4ecd-8b2f-63d0f4cedc32_WFC%f%T2-NB%f%FQ7-JD7%f%VV-MF%f%JX6-6F2%f%CM_MAK___________ProjectProVolume | ||
2375 | 15_5517e6a2-739b-4822-946f-7f0f1c5934b1_2B9%f%6V-X9%f%NJY-WFB%f%RC-Q8%f%MP2-7CC%f%C4_Retail________ProjectStdRetail | ||
2376 | 15_2b9e4a37-6230-4b42-bee2-e25ce86c8c7a_3CN%f%QX-T3%f%4TY-99R%f%H4-C4%f%YD2-KWY%f%GV_MAK___________ProjectStdVolume | ||
2377 | 15_c3a0814a-70a4-471f-af37-2313a6331111_TWN%f%CJ-YR%f%84W-X7P%f%PF-6D%f%PRP-D67%f%VC_Retail________PublisherRetail | ||
2378 | 15_38ea49f6-ad1d-43f1-9888-99a35d7c9409_DJP%f%HV-NC%f%JV6-GWP%f%T6-K2%f%6JX-C7G%f%X6_MAK___________PublisherVolume | ||
2379 | 15_ba3e3833-6a7e-445a-89d0-7802a9a68588_3NY%f%6J-WH%f%T3F-47B%f%DV-JH%f%F36-234%f%3W_PrepidBypass__SPDRetail | ||
2380 | 15_32255c0a-16b4-4ce2-b388-8a4267e219eb_V6V%f%WN-KC%f%2HR-YYD%f%D6-9V%f%7HQ-7T7%f%VP_Retail________StandardRetail | ||
2381 | 15_a24cca51-3d54-4c41-8a76-4031f5338cb2_9TN%f%6B-PC%f%YH4-MCV%f%DQ-KT%f%83C-TMQ%f%7T_MAK___________StandardVolume | ||
2382 | 15_15d12ad4-622d-4257-976c-5eb3282fb93d_JRJ%f%NJ-33%f%M7C-R73%f%X3-P9%f%XF7-R89%f%MY_Retail________VisioProRetail | ||
2383 | 15_3e4294dd-a765-49bc-8dbd-cf8b62a4bd3d_YN7%f%CF-XR%f%H6R-CGK%f%RY-GK%f%PV3-BG7%f%WF_MAK___________VisioProVolume | ||
2384 | 15_dae597ce-5823-4c77-9580-7268b93a4b23_G2N%f%2Q-4Q%f%D2T-DY4%f%TP-GY%f%489-3RQ%f%CG_Retail________VisioStdRetail | ||
2385 | 15_44a1f6ff-0876-4edb-9169-dbb43101ee89_RX6%f%3Y-4N%f%FK2-XTY%f%C8-C6%f%B3W-YPX%f%PJ_MAK___________VisioStdVolume | ||
2386 | 15_191509f2-6977-456f-ab30-cf0492b1e93a_NB7%f%7V-RP%f%FQ6-PMM%f%KQ-T8%f%7DV-M4D%f%84_Retail________WordRetail | ||
2387 | 15_9cedef15-be37-4ff0-a08a-13a045540641_RPH%f%PB-Y7%f%NC4-3VY%f%FM-DW%f%7VD-G8Y%f%J8_MAK___________WordVolume | ||
2388 | 15_befee371-a2f5-4648-85db-a2c55fdf324c_JXR%f%8H-NJ%f%3MK-X66%f%W8-78%f%CWD-QRQ%f%6C_Retail________O365BusinessRetail | ||
2389 | 15_537ea5b5-7d50-4876-bd38-a53a77caca32_J2W%f%28-TN%f%9C8-26P%f%WV-F7%f%J4G-72X%f%CB_Subscription1_O365HomePremRetail | ||
2390 | 15_0c4e5e7a-b436-4776-bb89-88e4b14687e2_T6J%f%JW-DY%f%N99-WK4%f%6B-9M%f%KKV-94P%f%2Y_Retail________O365ProPlusRetail | ||
2391 | 15_7a75647f-636f-4607-8e54-e1b7d1ad8930_B9V%f%9Q-F6%f%ND8-T4K%f%4K-88%f%68M-HT7%f%KT_Retail________O365SmallBusPremRetail | ||
2392 | 16_bfa358b0-98f1-4125-842e-585fa13032e6_WHK%f%4N-YQ%f%GHB-XWX%f%CC-G3%f%HYC-6JF%f%94_Retail________AccessRetail | ||
2393 | 16_9d9faf9e-d345-4b49-afce-68cb0a539c7c_RNB%f%7V-P4%f%8F4-3FY%f%Y6-2P%f%3R3-63B%f%QV_PrepidBypass__AccessRuntimeRetail | ||
2394 | 16_3b2fa33f-cd5a-43a5-bd95-f49f3f546b0b_JJ2%f%Y4-N8%f%KM3-Y8K%f%Y3-Y2%f%2FR-R3K%f%VK_MAK___________AccessVolume | ||
2395 | 16_424d52ff-7ad2-4bc7-8ac6-748d767b455d_RKJ%f%BN-VW%f%TM2-BDK%f%XX-RK%f%QFD-JTY%f%Q2_Retail________ExcelRetail | ||
2396 | 16_685062a7-6024-42e7-8c5f-6bb9e63e697f_FVG%f%NR-X8%f%2B2-6PR%f%JM-YT%f%4W7-8HV%f%36_MAK___________ExcelVolume | ||
2397 | 16_c02fb62e-1cd5-4e18-ba25-e0480467ffaa_2WQ%f%NF-GB%f%K4B-XVG%f%6F-BB%f%MX7-M4F%f%2Y_OEM-Perp______HomeBusinessPipcRetail | ||
2398 | 16_86834d00-7896-4a38-8fae-32f20b86fa2b_HM6%f%FM-NV%f%F78-KV9%f%PM-F3%f%6B8-D9M%f%XD_Retail________HomeBusinessRetail | ||
2399 | 16_c28acdb8-d8b3-4199-baa4-024d09e97c99_PNP%f%RV-F2%f%627-Q8J%f%VC-3D%f%GR9-WTY%f%RK_Retail________HomeStudentRetail | ||
2400 | 16_e2127526-b60c-43e0-bed1-3c9dc3d5a468_YWD%f%4R-CN%f%KVT-VG8%f%VJ-93%f%33B-RC3%f%B8_Retail________HomeStudentVNextRetail | ||
2401 | 16_b21367df-9545-4f02-9f24-240691da0e58_Y3X%f%PN-P7%f%PC4-MGP%f%TJ-2B%f%Y3Q-RJR%f%FV_Retail________MondoRetail | ||
2402 | 16_2cd0ea7e-749f-4288-a05e-567c573b2a6c_FMT%f%QQ-84%f%NR8-274%f%4R-MX%f%F4P-PGY%f%R3_MAK___________MondoVolume | ||
2403 | 16_436366de-5579-4f24-96db-3893e4400030_XYN%f%TG-R9%f%6FY-369%f%HX-YF%f%PHY-F9C%f%PM_Bypass________OneNoteFreeRetail | ||
2404 | 16_83ac4dd9-1b93-40ed-aa55-ede25bb6af38_FXF%f%6F-CN%f%C26-W64%f%3C-K6%f%KB7-6XX%f%W3_Retail________OneNoteRetail | ||
2405 | 16_23b672da-a456-4860-a8f3-e062a501d7e8_9TY%f%VN-D7%f%6HK-BVM%f%WT-Y7%f%G88-9TP%f%PV_MAK___________OneNoteVolume | ||
2406 | 16_5a670809-0983-4c2d-8aad-d3c2c5b7d5d1_7N4%f%KG-P2%f%QDH-86V%f%9C-DJ%f%FVF-369%f%W9_Retail________OutlookRetail | ||
2407 | 16_50059979-ac6f-4458-9e79-710bcb41721a_7QP%f%NR-3H%f%FDG-YP6%f%T9-JQ%f%CKQ-KKX%f%XC_MAK___________OutlookVolume | ||
2408 | 16_5aab8561-1686-43f7-9ff5-2c861da58d17_9CY%f%B3-NF%f%MRW-YFD%f%G6-XC%f%7TF-BY3%f%6J_OEM-Perp______PersonalPipcRetail | ||
2409 | 16_a9f645a1-0d6a-4978-926a-abcb363b72a6_FT7%f%VF-XB%f%N92-HPD%f%JV-RH%f%MBY-6VK%f%BF_Retail________PersonalRetail | ||
2410 | 16_f32d1284-0792-49da-9ac6-deb2bc9c80b6_N7G%f%CB-WQ%f%T7K-QRH%f%WG-TT%f%PYD-7T9%f%XF_Retail________PowerPointRetail | ||
2411 | 16_9b4060c9-a7f5-4a66-b732-faf248b7240f_X3R%f%T9-ND%f%G64-VMK%f%2M-KQ%f%6XY-DPF%f%GV_MAK___________PowerPointVolume | ||
2412 | 16_de52bd50-9564-4adc-8fcb-a345c17f84f9_GM4%f%3N-F7%f%42Q-6JD%f%DK-M6%f%22J-J8G%f%DV_Retail________ProPlusRetail | ||
2413 | 16_c47456e3-265d-47b6-8ca0-c30abbd0ca36_FNV%f%K8-8D%f%VCJ-F7X%f%3J-KG%f%VQB-RC2%f%QY_MAK___________ProPlusVolume | ||
2414 | 16_4e26cac1-e15a-4467-9069-cb47b67fe191_CF9%f%DD-6C%f%NW2-BJW%f%JQ-CV%f%CFX-Y7T%f%XD_OEM-Perp______ProfessionalPipcRetail | ||
2415 | 16_d64edc00-7453-4301-8428-197343fafb16_NXF%f%TK-YD%f%9Y7-X9M%f%MJ-9B%f%WM6-J2Q%f%VH_Retail________ProfessionalRetail | ||
2416 | 16_0f42f316-00b1-48c5-ada4-2f52b5720ad0_WKK%f%GF-TT%f%N8F-QC9%f%T2-6C%f%2DC-3YH%f%63_Retail________ProjectProRetail | ||
2417 | 16_82f502b5-b0b0-4349-bd2c-c560df85b248_PKC%f%3N-8F%f%99H-28M%f%VY-J4%f%RYY-CWG%f%DH_MAK___________ProjectProVolume | ||
2418 | 16_16728639-a9ab-4994-b6d8-f81051e69833_JBN%f%PH-YF%f%2F7-Q9Y%f%29-86%f%CTG-C9Y%f%GV_MAKC2R________ProjectProXVolume | ||
2419 | 16_e9f0b3fc-962f-4944-ad06-05c10b6bcd5e_4H6%f%NF-QD%f%PG8-83W%f%97-9K%f%8XY-XBT%f%9Y_Retail________ProjectStdRetail | ||
2420 | 16_82e6b314-2a62-4e51-9220-61358dd230e6_4TG%f%WV-6N%f%9P6-G2H%f%8Y-2H%f%WKB-B4G%f%93_MAK___________ProjectStdVolume | ||
2421 | 16_431058f0-c059-44c5-b9e7-ed2dd46b6789_N3W%f%2Q-69%f%MBT-27R%f%D9-BH%f%8V3-JT2%f%C8_MAKC2R________ProjectStdXVolume | ||
2422 | 16_6e0c1d99-c72e-4968-bcb7-ab79e03e201e_WKW%f%ND-X6%f%G9G-CDM%f%TV-CP%f%GYJ-6MV%f%BF_Retail________PublisherRetail | ||
2423 | 16_fcc1757b-5d5f-486a-87cf-c4d6dedb6032_9QV%f%N2-PX%f%XRX-8V4%f%W8-Q7%f%926-TJG%f%D8_MAK___________PublisherVolume | ||
2424 | 16_9103f3ce-1084-447a-827e-d6097f68c895_6MD%f%N4-WF%f%3FV-4WH%f%3Q-W6%f%99V-RGC%f%MY_PrepidBypass__SkypeServiceBypassRetail | ||
2425 | 16_971cd368-f2e1-49c1-aedd-330909ce18b6_4N4%f%D8-3J%f%7Y3-YYW%f%7C-73%f%HD2-V8R%f%HY_PrepidBypass__SkypeforBusinessEntryRetail | ||
2426 | 16_418d2b9f-b491-4d7f-84f1-49e27cc66597_PBJ%f%79-77%f%NY4-VRG%f%FG-Y8%f%WYC-CKC%f%RC_Retail________SkypeforBusinessRetail | ||
2427 | 16_03ca3b9a-0869-4749-8988-3cbc9d9f51bb_DMT%f%CJ-KN%f%RKR-JV8%f%TQ-V2%f%CR2-VFT%f%FH_MAK___________SkypeforBusinessVolume | ||
2428 | 16_4a31c291-3a12-4c64-b8ab-cd79212be45e_2FP%f%WN-4H%f%6CM-KD8%f%QQ-8H%f%CHC-P9X%f%YW_Retail________StandardRetail | ||
2429 | 16_0ed94aac-2234-4309-ba29-74bdbb887083_WHG%f%MQ-JN%f%MGT-MDQ%f%VF-WD%f%R69-KQB%f%WC_MAK___________StandardVolume | ||
2430 | 16_2dfe2075-2d04-4e43-816a-eb60bbb77574_7TM%f%6H-KN%f%R4K-Q7H%f%BX-72%f%T2Q-H22%f%RV_Retail________VisioProRetail | ||
2431 | 16_295b2c03-4b1c-4221-b292-1411f468bd02_NRK%f%T9-C8%f%GP2-XDY%f%XQ-YW%f%72K-MG9%f%2B_MAK___________VisioProVolume | ||
2432 | 16_0594dc12-8444-4912-936a-747ca742dbdb_G98%f%Q2-B6%f%N77-CFH%f%9J-K8%f%24G-XQC%f%C4_MAKC2R________VisioProXVolume | ||
2433 | 16_c76dbcbc-d71b-4f45-b5b3-b7494cb4e23e_Q8R%f%4N-GJ%f%CPG-CF3%f%2R-JF%f%CYR-K4T%f%F3_Retail________VisioStdRetail | ||
2434 | 16_44151c2d-c398-471f-946f-7660542e3369_XNC%f%JB-YY%f%883-JRW%f%64-DP%f%XMX-JXC%f%R6_MAK___________VisioStdVolume | ||
2435 | 16_1d1c6879-39a3-47a5-9a6d-aceefa6a289d_B2H%f%TN-JP%f%H8C-J6Y%f%6V-HC%f%HKB-43M%f%GT_MAKC2R________VisioStdXVolume | ||
2436 | 16_cacaa1bf-da53-4c3b-9700-11738ef1c2a5_P8K%f%82-NQ%f%7GG-JKY%f%8T-6V%f%HVY-88G%f%GD_Retail________WordRetail | ||
2437 | 16_c3000759-551f-4f4a-bcac-a4b42cbf1de2_YHM%f%WC-YN%f%6V9-WJP%f%XD-3W%f%QKP-TMV%f%CV_MAK___________WordVolume | ||
2438 | 16_518687bd-dc55-45b9-8fa6-f918e1082e83_WRY%f%J6-G3%f%NP7-7VH%f%94-8X%f%7KP-JB7%f%HC_Retail________Access2019Retail | ||
2439 | 16_385b91d6-9c2c-4a2e-86b5-f44d44a48c5f_6FW%f%HX-NK%f%YXK-BW3%f%4Q-7X%f%C9F-Q9P%f%X7_MAK-AE________Access2019Volume | ||
2440 | 16_22e6b96c-1011-4cd5-8b35-3c8fb6366b86_FGQ%f%NJ-JW%f%JCG-7Q8%f%MG-RM%f%RGJ-9TQ%f%VF_PrepidBypass__AccessRuntime2019Retail | ||
2441 | 16_c201c2b7-02a1-41a8-b496-37c72910cd4a_KBP%f%NW-64%f%CMM-8KW%f%CB-23%f%F44-8B7%f%HM_Retail________Excel2019Retail | ||
2442 | 16_05cb4e1d-cc81-45d5-a769-f34b09b9b391_8NT%f%4X-GQ%f%MCK-62X%f%4P-TW%f%6QP-YKP%f%YF_MAK-AE________Excel2019Volume | ||
2443 | 16_7fe09eef-5eed-4733-9a60-d7019df11cac_QBN%f%2Y-9B%f%284-9KW%f%78-K4%f%8PB-R62%f%YT_Retail________HomeBusiness2019Retail | ||
2444 | 16_4539aa2c-5c31-4d47-9139-543a868e5741_XNW%f%PM-32%f%XQC-Y7Q%f%JC-QG%f%GBV-YY7%f%JK_Retail________HomeStudent2019Retail | ||
2445 | 16_20e359d5-927f-47c0-8a27-38adbdd27124_WR4%f%3D-NM%f%WQQ-HCQ%f%R2-VK%f%XDR-37B%f%7H_Retail________Outlook2019Retail | ||
2446 | 16_92a99ed8-2923-4cb7-a4c5-31da6b0b8cf3_RN3%f%QB-GT%f%6D7-YB3%f%VH-F3%f%RPB-3GQ%f%YB_MAK-AE________Outlook2019Volume | ||
2447 | 16_2747b731-0f1f-413e-a92d-386ec1277dd8_NMB%f%Y8-V3%f%CV7-BX6%f%K6-29%f%22Y-43M%f%7T_Retail________Personal2019Retail | ||
2448 | 16_7e63cc20-ba37-42a1-822d-d5f29f33a108_HN2%f%7K-JH%f%J8R-7T7%f%KK-WJ%f%YC3-FM7%f%MM_Retail________PowerPoint2019Retail | ||
2449 | 16_13c2d7bf-f10d-42eb-9e93-abf846785434_29G%f%NM-VM%f%33V-WR2%f%3K-HG%f%2DT-KTQ%f%YR_MAK-AE________PowerPoint2019Volume | ||
2450 | 16_a3072b8f-adcc-4e75-8d62-fdeb9bdfae57_BN4%f%XJ-R9%f%DYY-96W%f%48-YK%f%8DM-MY7%f%PY_Retail________ProPlus2019Retail | ||
2451 | 16_6755c7a7-4dfe-46f5-bce8-427be8e9dc62_T8Y%f%BN-4Y%f%V3X-KK2%f%4Q-QX%f%BD7-T3C%f%63_MAK-AE________ProPlus2019Volume | ||
2452 | 16_1717c1e0-47d3-4899-a6d3-1022db7415e0_9NX%f%DK-MR%f%Y98-2VJ%f%V8-GF%f%73J-TQ9%f%FK_Retail________Professional2019Retail | ||
2453 | 16_0d270ef7-5aaf-4370-a372-bc806b96adb7_JDT%f%NC-PP%f%77T-T9H%f%2W-G4%f%J2J-VH8%f%JK_Retail________ProjectPro2019Retail | ||
2454 | 16_d4ebadd6-401b-40d5-adf4-a5d4accd72d1_TBX%f%BD-FN%f%WKJ-WRH%f%BD-KB%f%PHH-XD9%f%F2_MAK-AE________ProjectPro2019Volume | ||
2455 | 16_bb7ffe5f-daf9-4b79-b107-453e1c8427b5_R3J%f%NT-8P%f%BDP-MTW%f%CK-VD%f%2V8-HMK%f%F9_Retail________ProjectStd2019Retail | ||
2456 | 16_fdaa3c03-dc27-4a8d-8cbf-c3d843a28ddc_RBR%f%FX-MQ%f%NDJ-4XF%f%HF-7Q%f%VDR-JHX%f%GC_MAK-AE________ProjectStd2019Volume | ||
2457 | 16_f053a7c7-f342-4ab8-9526-a1d6e5105823_4QC%f%36-NW%f%3YH-D2Y%f%9D-RJ%f%PC7-VVB%f%9D_Retail________Publisher2019Retail | ||
2458 | 16_40055495-be00-444e-99cc-07446729b53e_K8F%f%2D-NB%f%M32-BF2%f%6V-YC%f%KFJ-29Y%f%9W_MAK-AE________Publisher2019Volume | ||
2459 | 16_b639e55c-8f3e-47fe-9761-26c6a786ad6b_JBD%f%KF-6N%f%CD6-49K%f%3G-2T%f%V79-BKP%f%73_Retail________SkypeforBusiness2019Retail | ||
2460 | 16_15a430d4-5e3f-4e6d-8a0a-14bf3caee4c7_9MN%f%Q7-YP%f%Q3B-6WJ%f%XM-G8%f%3T3-CBB%f%DK_MAK-AE________SkypeforBusiness2019Volume | ||
2461 | 16_f88cfdec-94ce-4463-a969-037be92bc0e7_N97%f%22-BV%f%9H6-WTJ%f%TT-FP%f%B93-978%f%MK_PrepidBypass__SkypeforBusinessEntry2019Retail | ||
2462 | 16_fdfa34dd-a472-4b85-bee6-cf07bf0aaa1c_NDG%f%VM-MD%f%27H-2XH%f%VC-KD%f%DX2-YKP%f%74_Retail________Standard2019Retail | ||
2463 | 16_beb5065c-1872-409e-94e2-403bcfb6a878_NT3%f%V6-XM%f%BK7-Q66%f%MF-VM%f%KR4-FC3%f%3M_MAK-AE________Standard2019Volume | ||
2464 | 16_a6f69d68-5590-4e02-80b9-e7233dff204e_2NW%f%VW-QG%f%F4T-9CP%f%MB-WY%f%DQ9-7XP%f%79_Retail________VisioPro2019Retail | ||
2465 | 16_f41abf81-f409-4b0d-889d-92b3e3d7d005_33Y%f%F4-GN%f%CQ3-J6G%f%DM-J6%f%7P3-FM7%f%QP_MAK-AE________VisioPro2019Volume | ||
2466 | 16_4a582021-18c2-489f-9b3d-5186de48f1cd_263%f%WK-3N%f%797-7R4%f%37-28%f%BKG-3V8%f%M8_Retail________VisioStd2019Retail | ||
2467 | 16_933ed0e3-747d-48b0-9c2c-7ceb4c7e473d_BGN%f%HX-QT%f%PRJ-F9C%f%9G-R8%f%QQG-8T2%f%7F_MAK-AE________VisioStd2019Volume | ||
2468 | 16_72cee1c2-3376-4377-9f25-4024b6baadf8_JXR%f%8H-NJ%f%3MK-X66%f%W8-78%f%CWD-QRV%f%R2_Retail________Word2019Retail | ||
2469 | 16_fe5fe9d5-3b06-4015-aa35-b146f85c4709_9F3%f%6R-PN%f%VHH-3DX%f%GQ-7C%f%D2H-R9D%f%3V_MAK-AE________Word2019Volume | ||
2470 | 16_f634398e-af69-48c9-b256-477bea3078b5_P28%f%6B-N3%f%XYP-36Q%f%RQ-29%f%CMP-RVX%f%9M_Retail________Access2021Retail | ||
2471 | 16_ae17db74-16b0-430b-912f-4fe456e271db_JBH%f%3N-P9%f%7FP-FRT%f%JD-MG%f%K2C-VFW%f%G6_MAK-AE________Access2021Volume | ||
2472 | 16_fb099c19-d48b-4a2f-a160-4383011060aa_V6Q%f%FB-7N%f%7G9-PF7%f%W9-M8%f%FQM-MY8%f%G9_Retail________Excel2021Retail | ||
2473 | 16_9da1ecdb-3a62-4273-a234-bf6d43dc0778_WNY%f%R4-KM%f%R9H-KVC%f%8W-7H%f%J8B-K79%f%DQ_MAK-AE________Excel2021Volume | ||
2474 | 16_0e878942-3ba1-48ee-a215-f64d10a9f97b_QV2%f%VN-37%f%WPX-DHH%f%4K-B8%f%2H6-PDP%f%3T_Retail1_______HomeBusiness2021Retail | ||
2475 | 16_9e7d5312-95fc-4443-a551-69c20624ec6b_3QN%f%G6-8F%f%JTH-88B%f%F9-KB%f%BVM-JMB%f%78_Retail________HomeStudent2021Retail | ||
2476 | 16_279706f4-3a4b-4877-949b-f8c299cf0cc5_NB2%f%TQ-3Y%f%79C-77C%f%6M-QM%f%Y7H-7QY%f%8P_Retail________OneNote2021Retail | ||
2477 | 16_ecea2cfa-d406-4a7f-be0d-c6163250d126_4NC%f%WR-9V%f%92Y-34V%f%B2-RP%f%THR-YTG%f%R7_Retail________Outlook2021Retail | ||
2478 | 16_45bf67f9-0fc8-4335-8b09-9226cef8a576_JQ9%f%MJ-QY%f%N6B-67P%f%X9-GY%f%FVY-QJ6%f%TB_MAK-AE________Outlook2021Volume | ||
2479 | 16_8f89391e-eedb-429d-af90-9d36fbf94de6_RRR%f%YB-DN%f%749-GCP%f%W4-9H%f%6VK-HCH%f%PT_Retail________Personal2021Retail | ||
2480 | 16_c9bf5e86-f5e3-4ac6-8d52-e114a604d7bf_3KX%f%XQ-PV%f%N2C-8P7%f%YY-HC%f%V88-GVM%f%96_Retail1_______PowerPoint2021Retail | ||
2481 | 16_716f2434-41b6-4969-ab73-e61e593a3875_39G%f%2N-3B%f%D9C-C4X%f%CM-BD%f%4QG-FVY%f%DY_MAK-AE________PowerPoint2021Volume | ||
2482 | 16_c2f04adf-a5de-45c5-99a5-f5fddbda74a8_8WX%f%TP-MN%f%628-KY4%f%4G-VJ%f%WCK-C7P%f%CF_Retail________ProPlus2021Retail | ||
2483 | 16_3f180b30-9b05-4fe2-aa8d-0c1c4790f811_RNH%f%JY-DT%f%FXW-HW9%f%F8-49%f%82D-MD2%f%CW_MAK-AE1_______ProPlus2021Volume | ||
2484 | 16_96097a68-b5c5-4b19-8600-2e8d6841a0db_JRJ%f%NJ-33%f%M7C-R73%f%X3-P9%f%XF7-R9F%f%6M_MAK-AE________ProPlusSPLA2021Volume | ||
2485 | 16_711e48a6-1a79-4b00-af10-73f4ca3aaac4_DJP%f%HV-NC%f%JV6-GWP%f%T6-K2%f%6JX-C7P%f%BG_Retail________Professional2021Retail | ||
2486 | 16_3747d1d5-55a8-4bc3-b53d-19fff1913195_QKH%f%NX-M9%f%GGH-T3Q%f%MW-YP%f%K4Q-QRW%f%MV_Retail________ProjectPro2021Retail | ||
2487 | 16_17739068-86c4-4924-8633-1e529abc7efc_HVC%f%34-CV%f%NPG-RVC%f%MT-X2%f%JRF-CR7%f%RK_MAK-AE1_______ProjectPro2021Volume | ||
2488 | 16_4ea64dca-227c-436b-813f-b6624be2d54c_2B9%f%6V-X9%f%NJY-WFB%f%RC-Q8%f%MP2-7CH%f%RR_Retail________ProjectStd2021Retail | ||
2489 | 16_84313d1e-47c8-4e27-8ced-0476b7ee46c4_3CN%f%QX-T3%f%4TY-99R%f%H4-C4%f%YD2-KW6%f%WH_MAK-AE________ProjectStd2021Volume | ||
2490 | 16_b769b746-53b1-4d89-8a68-41944dafe797_CDN%f%FG-77%f%T8D-VKQ%f%JX-B7%f%KT3-KK2%f%8V_Retail1_______Publisher2021Retail | ||
2491 | 16_a0234cfe-99bd-4586-a812-4f296323c760_2KX%f%JH-3N%f%HTW-RDB%f%PX-QF%f%RXJ-MTG%f%XF_MAK-AE________Publisher2021Volume | ||
2492 | 16_c3fb48b2-1fd4-4dc8-af39-819edf194288_DVB%f%XN-HF%f%T43-CVP%f%RQ-J8%f%9TF-VMM%f%HG_Retail________SkypeforBusiness2021Retail | ||
2493 | 16_6029109c-ceb8-4ee5-b324-f8eb2981e99a_R3F%f%CY-NH%f%GC7-CBP%f%VP-8Q%f%934-YTG%f%XG_MAK-AE________SkypeforBusiness2021Volume | ||
2494 | 16_9e7e7b8e-a0e7-467b-9749-d0de82fb7297_HXN%f%XB-J4%f%JGM-TCF%f%44-2X%f%2CV-FJV%f%VH_Retail________Standard2021Retail | ||
2495 | 16_223a60d8-9002-4a55-abac-593f5b66ca45_2CJ%f%N4-C9%f%XK2-HFP%f%Q6-YH%f%498-82T%f%XH_MAK-AE________Standard2021Volume | ||
2496 | 16_b99ba8c4-e257-4b70-a31a-8bd308ce7073_BQW%f%DW-NJ%f%9YF-P7Y%f%79-H6%f%DCT-MKQ%f%9C_MAK-AE________StandardSPLA2021Volume | ||
2497 | 16_814014d3-c30b-4f63-a493-3708e0dc0ba8_T6P%f%26-NJ%f%VBR-76B%f%K8-WB%f%CDY-TX3%f%BC_Retail________VisioPro2021Retail | ||
2498 | 16_c590605a-a08a-4cc7-8dc2-f1ffb3d06949_JNK%f%BX-MH%f%9P4-K8Y%f%YV-8C%f%G2Y-VQ2%f%C8_MAK-AE________VisioPro2021Volume | ||
2499 | 16_16d43989-a5ef-47e2-9ff1-272784caee24_89N%f%YY-KB%f%93R-7X2%f%2F-93%f%QDF-DJ6%f%YM_Retail________VisioStd2021Retail | ||
2500 | 16_d55f90ee-4ba2-4d02-b216-1300ee50e2af_BW4%f%3B-4P%f%NFP-V63%f%7F-23%f%TR2-J47%f%TX_MAK-AE________VisioStd2021Volume | ||
2501 | 16_fb33d997-4aa3-494e-8b58-03e9ab0f181d_VNC%f%C4-CJ%f%QVK-BKX%f%34-77%f%Y8H-CYX%f%MR_Retail________Word2021Retail | ||
2502 | 16_0c728382-95fb-4a55-8f12-62e605f91727_BJG%f%97-NW%f%3GM-8QQ%f%Q7-FH%f%76G-686%f%XM_MAK-AE________Word2021Volume | ||
2503 | 16_6337137e-7c07-4197-8986-bece6a76fc33_2P3%f%C9-BQ%f%NJH-VCV%f%PH-YD%f%Y6M-43J%f%PQ_Subscription__O365BusinessRetail | ||
2504 | 16_2f5c71b4-5b7a-4005-bb68-f9fac26f2ea3_W62%f%NQ-26%f%7QR-RTF%f%74-PF%f%2MH-JQM%f%TH_Subscription__O365EduCloudRetail | ||
2505 | 16_537ea5b5-7d50-4876-bd38-a53a77caca32_J2W%f%28-TN%f%9C8-26P%f%WV-F7%f%J4G-72X%f%CB_Subscription1_O365HomePremRetail | ||
2506 | 16_149dbce7-a48e-44db-8364-a53386cd4580_2N3%f%82-D6%f%PKK-QTX%f%4D-2J%f%JYK-M96%f%P2_Subscription1_O365ProPlusRetail | ||
2507 | 16_bacd4614-5bef-4a5e-bafc-de4c788037a2_HN8%f%JP-87%f%TQJ-PBF%f%3P-Y6%f%6KC-W2K%f%9V_Subscription1_O365SmallBusPremRetail | ||
2508 | ) do ( | ||
2509 | for /f "tokens=1-5 delims=_" %%A in ("%%#") do ( | ||
2510 | if %1==getinfo if %oVer%==%%A if "%2"=="%%E" (set _key=%%C& set _actid=%%B& set _allactid=!_allactid! %%B&set _lic=%%D) | ||
2511 | |||
2512 | if %1==getmsiprod if %oVer%==%%A (find /i "%%E" %msitemp% %nul% && (if defined _oIds (set _oIds=!_oIds! %%E) else (set _oIds=%%E))) | ||
2513 | |||
2514 | ) | ||
2515 | ) | ||
2516 | exit /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 | |||
2525 | set 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 | ||
2527 | exit /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 | ||
2574 | if ($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 | ||
2583 | Remove-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) | ||
2592 | if ($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: | ||
2620 | TVqQAAMAAAAEAAAA//8AALgAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAgAAAAA4fug4AtAnNIbgBTM0hVGhpcyBwcm9ncmFtIGNhbm5vdCBiZSBydW4gaW4gRE9TIG1vZGUuDQ0KJAAAAAAAAABQRQAATAEHAMDc0GQAAAAAAAAAAOAA | ||
2621 | DiMLAQIoAAIAAAAeAAAAAAAAABAAAAAQAAAAAAAAAACAagAQAAAAAgAABAAAAAEAAAAGAAAAAAAAAACQAAAABAAAi9MAAAIAQAEAACAAABAAAAAAEAAAEAAAAAAAABAAAAAAQAAAjRAAAABgAAAYAQAAAHAAAHgDAAAAAAAAAAAAAAAAAAAAAAAAAIAAABQAAAAAAAAA | ||
2622 | AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABsYAAAHAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAC50ZXh0AAAAcAEAAAAQAAAAAgAAAAQAAAAAAAAAAAAAAAAAACAAAGAucmRhdGEAABgAAAAAIAAAAAIAAAAGAAAAAAAAAAAAAAAA | ||
2623 | AABAAABALmVoX2ZyYW2AAAAAADAAAAACAAAACAAAAAAAAAAAAAAAAAAAQAAAQC5lZGF0YQAAjRAAAABAAAAAEgAAAAoAAAAAAAAAAAAAAAAAAEAAAEAuaWRhdGEAABgBAAAAYAAAAAIAAAAcAAAAAAAAAAAAAAAAAABAAADALnJzcmMAAAB4AwAAAHAAAAAEAAAAHgAA | ||
2624 | AAAAAAAAAAAAAAAAQAAAwC5yZWxvYwAAFAAAAACAAAAAAgAAACIAAAAAAAAAAAAAAAAAAEAAAEIAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA | ||
2625 | AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA | ||
2626 | AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAALgBAAAAwgwAVYnlVlONRfCD7DDHRfAAAAAA | ||
2627 | iUQkFI1F9IlEJBCLRQzHRCQMAAAAAIlEJASLRQjHRCQIACCAaokEJMdF9AAAAADoAgEAAIs1eGCAaoPsGIXAicOLRfB0CokEJDHb/9ZR6zKLVfTHRCQECiCAaokEJIlUJAj/FYBggGqD7AyFwItF8IkEJHQK/9a7AQAAAFLrA//WUI1l+InYW15dw1WJ5VdWU4PsPItF | ||
2628 | GIt1HIlEJBCLRRSJdCQUiUQkDItFEIlEJAiLRQyJRCQEi0UIiQQk6HwAAAAxyYPsGInHhcB1XItFGDkIdlVr2SiLBgHYg3gQAHRFiUQkBItFCIlN5IkEJOj7/v//i03khcB1LAMex0MQAQAAAMdDFAAAAADHQxgAAAAAx0McAAAAAMdDIAAAAADHQyQAAAAAQeukjWX0 | ||
2629 | ifhbXl9dwhgAkP8lcGCAapCQ/yVsYIBqkJD/////AAAAAP////8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA | ||
2630 | AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAATgBhAG0AZQAAAEcAcgBhAGMAZQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA | ||
2631 | AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA | ||
2632 | AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA | ||
2633 | AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUAAAAAAAAAAF6UgABfAgBGwwEBIgBAAAQAAAAHAAAAODf//8IAAAAAAAAACQAAAAwAAAA | ||
2634 | 1N///50AAAAAQQ4IhQJCDQVIhgODBAKPw0HGQcUMBAQoAAAAWAAAAEng//+qAAAAAEEOCIUCQg0FRocDhgSDBQKbw0HGQcdBxQwEBAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA | ||
2635 | AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA | ||
2636 | AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA | ||
2637 | AAAAAAAAAAAAAAAAAADA3NBkAAAAAMZCAAABAAAAQwAAAEMAAAAoQAAANEEAAEBCAADPQgAA70IAAAVDAAApQwAAXUMAAKFDAADpQwAAF0QAADVEAABnRAAAnUQAAONEAAAtRQAAYUUAAJ9FAADTRQAADUYAADtGAABxRgAAr0YAAM9GAAD7RgAApRAAAFFHAABvRwAA | ||
2638 | n0cAANNHAAARSAAATUgAAG9IAAClSAAAzUgAAAVJAABBSQAAbUkAAKdJAAC7SQAA+0kAADlKAABPSgAAdUoAAJ1KAADTSgAAB0sAAD1LAABpSwAApUsAAONLAAANTAAAOUwAAIlMAADRTAAAEU0AAFlNAACjTQAA8U0AABtOAABHTgAAh04AALtOAADnTgAAK08AAFtP | ||
2639 | AAC1TwAA608AACdQAABdUAAA4kIAAP1CAAAaQwAARkMAAIJDAADIQwAAA0QAAClEAABRRAAAhUQAAMNEAAALRQAASkUAAINFAAC8RQAA80UAACdGAABZRgAAk0YAAMJGAADoRgAAGUcAADFHAABjRwAAikcAALxHAAD1RwAAMkgAAGFIAACNSAAAvEgAAOxIAAAmSQAA | ||
2640 | WkkAAI1JAAC0SQAA3kkAAB1KAABHSgAAZUoAAIxKAAC7SgAA8EoAACVLAABWSwAAiksAAMdLAAD7SwAAJkwAAGRMAACwTAAA9EwAADhNAACBTQAAzU0AAAlOAAA0TgAAak4AAKROAADUTgAADE8AAEZPAACLTwAA008AAAxQAABFUAAAeFAAAAAAAQACAAMABAAFAAYA | ||
2641 | BwAIAAkACgALAAwADQAOAA8AEAARABIAEwAUABUAFgAXABgAGQAaABsAHAAdAB4AHwAgACEAIgAjACQAJQAmACcAKAApACoAKwAsAC0ALgAvADAAMQAyADMANAA1ADYANwA4ADkAOgA7ADwAPQA+AD8AQABBAEIAc3BwYy5kbGwAU1BQQ1MuU0xDYWxsU2VydmVyAFNM | ||
2642 | Q2FsbFNlcnZlcgBTUFBDUy5TTENsb3NlAFNMQ2xvc2UAU1BQQ1MuU0xDb25zdW1lUmlnaHQAU0xDb25zdW1lUmlnaHQAU1BQQ1MuU0xEZXBvc2l0TWlncmF0aW9uQmxvYgBTTERlcG9zaXRNaWdyYXRpb25CbG9iAFNQUENTLlNMRGVwb3NpdE9mZmxpbmVDb25maXJt | ||
2643 | YXRpb25JZABTTERlcG9zaXRPZmZsaW5lQ29uZmlybWF0aW9uSWQAU1BQQ1MuU0xEZXBvc2l0T2ZmbGluZUNvbmZpcm1hdGlvbklkRXgAU0xEZXBvc2l0T2ZmbGluZUNvbmZpcm1hdGlvbklkRXgAU1BQQ1MuU0xEZXBvc2l0U3RvcmVUb2tlbgBTTERlcG9zaXRTdG9y | ||
2644 | ZVRva2VuAFNQUENTLlNMRmlyZUV2ZW50AFNMRmlyZUV2ZW50AFNQUENTLlNMR2F0aGVyTWlncmF0aW9uQmxvYgBTTEdhdGhlck1pZ3JhdGlvbkJsb2IAU1BQQ1MuU0xHYXRoZXJNaWdyYXRpb25CbG9iRXgAU0xHYXRoZXJNaWdyYXRpb25CbG9iRXgAU1BQQ1MuU0xH | ||
2645 | ZW5lcmF0ZU9mZmxpbmVJbnN0YWxsYXRpb25JZABTTEdlbmVyYXRlT2ZmbGluZUluc3RhbGxhdGlvbklkAFNQUENTLlNMR2VuZXJhdGVPZmZsaW5lSW5zdGFsbGF0aW9uSWRFeABTTEdlbmVyYXRlT2ZmbGluZUluc3RhbGxhdGlvbklkRXgAU1BQQ1MuU0xHZXRBY3Rp | ||
2646 | dmVMaWNlbnNlSW5mbwBTTEdldEFjdGl2ZUxpY2Vuc2VJbmZvAFNQUENTLlNMR2V0QXBwbGljYXRpb25JbmZvcm1hdGlvbgBTTEdldEFwcGxpY2F0aW9uSW5mb3JtYXRpb24AU1BQQ1MuU0xHZXRBcHBsaWNhdGlvblBvbGljeQBTTEdldEFwcGxpY2F0aW9uUG9saWN5 | ||
2647 | AFNQUENTLlNMR2V0QXV0aGVudGljYXRpb25SZXN1bHQAU0xHZXRBdXRoZW50aWNhdGlvblJlc3VsdABTUFBDUy5TTEdldEVuY3J5cHRlZFBJREV4AFNMR2V0RW5jcnlwdGVkUElERXgAU1BQQ1MuU0xHZXRHZW51aW5lSW5mb3JtYXRpb24AU0xHZXRHZW51aW5lSW5m | ||
2648 | b3JtYXRpb24AU1BQQ1MuU0xHZXRJbnN0YWxsZWRQcm9kdWN0S2V5SWRzAFNMR2V0SW5zdGFsbGVkUHJvZHVjdEtleUlkcwBTUFBDUy5TTEdldExpY2Vuc2UAU0xHZXRMaWNlbnNlAFNQUENTLlNMR2V0TGljZW5zZUZpbGVJZABTTEdldExpY2Vuc2VGaWxlSWQAU1BQ | ||
2649 | Q1MuU0xHZXRMaWNlbnNlSW5mb3JtYXRpb24AU0xHZXRMaWNlbnNlSW5mb3JtYXRpb24AU0xHZXRMaWNlbnNpbmdTdGF0dXNJbmZvcm1hdGlvbgBTUFBDUy5TTEdldFBLZXlJZABTTEdldFBLZXlJZABTUFBDUy5TTEdldFBLZXlJbmZvcm1hdGlvbgBTTEdldFBLZXlJ | ||
2650 | bmZvcm1hdGlvbgBTUFBDUy5TTEdldFBvbGljeUluZm9ybWF0aW9uAFNMR2V0UG9saWN5SW5mb3JtYXRpb24AU1BQQ1MuU0xHZXRQb2xpY3lJbmZvcm1hdGlvbkRXT1JEAFNMR2V0UG9saWN5SW5mb3JtYXRpb25EV09SRABTUFBDUy5TTEdldFByb2R1Y3RTa3VJbmZv | ||
2651 | cm1hdGlvbgBTTEdldFByb2R1Y3RTa3VJbmZvcm1hdGlvbgBTUFBDUy5TTEdldFNMSURMaXN0AFNMR2V0U0xJRExpc3QAU1BQQ1MuU0xHZXRTZXJ2aWNlSW5mb3JtYXRpb24AU0xHZXRTZXJ2aWNlSW5mb3JtYXRpb24AU1BQQ1MuU0xJbnN0YWxsTGljZW5zZQBTTElu | ||
2652 | c3RhbGxMaWNlbnNlAFNQUENTLlNMSW5zdGFsbFByb29mT2ZQdXJjaGFzZQBTTEluc3RhbGxQcm9vZk9mUHVyY2hhc2UAU1BQQ1MuU0xJbnN0YWxsUHJvb2ZPZlB1cmNoYXNlRXgAU0xJbnN0YWxsUHJvb2ZPZlB1cmNoYXNlRXgAU1BQQ1MuU0xJc0dlbnVpbmVMb2Nh | ||
2653 | bEV4AFNMSXNHZW51aW5lTG9jYWxFeABTUFBDUy5TTExvYWRBcHBsaWNhdGlvblBvbGljaWVzAFNMTG9hZEFwcGxpY2F0aW9uUG9saWNpZXMAU1BQQ1MuU0xPcGVuAFNMT3BlbgBTUFBDUy5TTFBlcnNpc3RBcHBsaWNhdGlvblBvbGljaWVzAFNMUGVyc2lzdEFwcGxp | ||
2654 | Y2F0aW9uUG9saWNpZXMAU1BQQ1MuU0xQZXJzaXN0UlRTUGF5bG9hZE92ZXJyaWRlAFNMUGVyc2lzdFJUU1BheWxvYWRPdmVycmlkZQBTUFBDUy5TTFJlQXJtAFNMUmVBcm0AU1BQQ1MuU0xSZWdpc3RlckV2ZW50AFNMUmVnaXN0ZXJFdmVudABTUFBDUy5TTFJlZ2lz | ||
2655 | dGVyUGx1Z2luAFNMUmVnaXN0ZXJQbHVnaW4AU1BQQ1MuU0xTZXRBdXRoZW50aWNhdGlvbkRhdGEAU0xTZXRBdXRoZW50aWNhdGlvbkRhdGEAU1BQQ1MuU0xTZXRDdXJyZW50UHJvZHVjdEtleQBTTFNldEN1cnJlbnRQcm9kdWN0S2V5AFNQUENTLlNMU2V0R2VudWlu | ||
2656 | ZUluZm9ybWF0aW9uAFNMU2V0R2VudWluZUluZm9ybWF0aW9uAFNQUENTLlNMVW5pbnN0YWxsTGljZW5zZQBTTFVuaW5zdGFsbExpY2Vuc2UAU1BQQ1MuU0xVbmluc3RhbGxQcm9vZk9mUHVyY2hhc2UAU0xVbmluc3RhbGxQcm9vZk9mUHVyY2hhc2UAU1BQQ1MuU0xV | ||
2657 | bmxvYWRBcHBsaWNhdGlvblBvbGljaWVzAFNMVW5sb2FkQXBwbGljYXRpb25Qb2xpY2llcwBTUFBDUy5TTFVucmVnaXN0ZXJFdmVudABTTFVucmVnaXN0ZXJFdmVudABTUFBDUy5TTFVucmVnaXN0ZXJQbHVnaW4AU0xVbnJlZ2lzdGVyUGx1Z2luAFNQUENTLlNMcEF1 | ||
2658 | dGhlbnRpY2F0ZUdlbnVpbmVUaWNrZXRSZXNwb25zZQBTTHBBdXRoZW50aWNhdGVHZW51aW5lVGlja2V0UmVzcG9uc2UAU1BQQ1MuU0xwQmVnaW5HZW51aW5lVGlja2V0VHJhbnNhY3Rpb24AU0xwQmVnaW5HZW51aW5lVGlja2V0VHJhbnNhY3Rpb24AU1BQQ1MuU0xw | ||
2659 | Q2xlYXJBY3RpdmF0aW9uSW5Qcm9ncmVzcwBTTHBDbGVhckFjdGl2YXRpb25JblByb2dyZXNzAFNQUENTLlNMcERlcG9zaXREb3dubGV2ZWxHZW51aW5lVGlja2V0AFNMcERlcG9zaXREb3dubGV2ZWxHZW51aW5lVGlja2V0AFNQUENTLlNMcERlcG9zaXRUb2tlbkFj | ||
2660 | dGl2YXRpb25SZXNwb25zZQBTTHBEZXBvc2l0VG9rZW5BY3RpdmF0aW9uUmVzcG9uc2UAU1BQQ1MuU0xwR2VuZXJhdGVUb2tlbkFjdGl2YXRpb25DaGFsbGVuZ2UAU0xwR2VuZXJhdGVUb2tlbkFjdGl2YXRpb25DaGFsbGVuZ2UAU1BQQ1MuU0xwR2V0R2VudWluZUJs | ||
2661 | b2IAU0xwR2V0R2VudWluZUJsb2IAU1BQQ1MuU0xwR2V0R2VudWluZUxvY2FsAFNMcEdldEdlbnVpbmVMb2NhbABTUFBDUy5TTHBHZXRMaWNlbnNlQWNxdWlzaXRpb25JbmZvAFNMcEdldExpY2Vuc2VBY3F1aXNpdGlvbkluZm8AU1BQQ1MuU0xwR2V0TVNQaWRJbmZv | ||
2662 | cm1hdGlvbgBTTHBHZXRNU1BpZEluZm9ybWF0aW9uAFNQUENTLlNMcEdldE1hY2hpbmVVR1VJRABTTHBHZXRNYWNoaW5lVUdVSUQAU1BQQ1MuU0xwR2V0VG9rZW5BY3RpdmF0aW9uR3JhbnRJbmZvAFNMcEdldFRva2VuQWN0aXZhdGlvbkdyYW50SW5mbwBTUFBDUy5T | ||
2663 | THBJQUFjdGl2YXRlUHJvZHVjdABTTHBJQUFjdGl2YXRlUHJvZHVjdABTUFBDUy5TTHBJc0N1cnJlbnRJbnN0YWxsZWRQcm9kdWN0S2V5RGVmYXVsdEtleQBTTHBJc0N1cnJlbnRJbnN0YWxsZWRQcm9kdWN0S2V5RGVmYXVsdEtleQBTUFBDUy5TTHBQcm9jZXNzVk1Q | ||
2664 | aXBlTWVzc2FnZQBTTHBQcm9jZXNzVk1QaXBlTWVzc2FnZQBTUFBDUy5TTHBTZXRBY3RpdmF0aW9uSW5Qcm9ncmVzcwBTTHBTZXRBY3RpdmF0aW9uSW5Qcm9ncmVzcwBTUFBDUy5TTHBUcmlnZ2VyU2VydmljZVdvcmtlcgBTTHBUcmlnZ2VyU2VydmljZVdvcmtlcgBT | ||
2665 | UFBDUy5TTHBWTEFjdGl2YXRlUHJvZHVjdABTTHBWTEFjdGl2YXRlUHJvZHVjdAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA | ||
2666 | AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA | ||
2667 | AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFBgAAAAAAAAAAAAAOhgAABsYAAAXGAAAAAAAAAAAAAA | ||
2668 | +GAAAHhgAABkYAAAAAAAAAAAAAAMYQAAgGAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAiGAAAKpgAAAAAAAAyGAAAAAAAADUYAAAAAAAAIhgAACqYAAAAAAAAMhgAAAAAAAA1GAAAAAAAAACAFNMR2V0TGljZW5zaW5nU3RhdHVzSW5mb3JtYXRpb24AAQBTTEdldFByb2R1 | ||
2669 | Y3RTa3VJbmZvcm1hdGlvbgAA3QNMb2NhbEZyZWUARwFTdHJTdHJOSVcAAGAAAABgAABzcHBjcy5kbGwAAAAUYAAAS0VSTkVMMzIuZGxsAAAAAChgAABTSExXQVBJLmRsbAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA | ||
2670 | AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA | ||
2671 | AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABABAAAAAYAACAAAAAAAAAAAAAAAAAAAABAAEAAAAwAACAAAAAAAAAAAAAAAAAAAABAAkEAABIAAAAWHAAABwDAAAAAAAAAAAAABwDNAAAAFYAUwBfAFYARQBSAFMASQBPAE4AXwBJAE4A | ||
2672 | RgBPAAAAAAC9BO/+AAABAAMAAAAAAAAAAwAAAAAAAAAAAAAAAAAAAAQABAACAAAAAAAAAAAAAAAAAAAAfAIAAAEAUwB0AHIAaQBuAGcARgBpAGwAZQBJAG4AZgBvAAAAWAIAAAEAMAA0ADAAOQAwADQARQA0AAAAegAtAAEAQwBvAG0AcABhAG4AeQBOAGEAbQBlAAAA | ||
2673 | AABBAG4AbwBtAGEAbABvAHUAcwAgAFMAbwBmAHQAdwBhAHIAZQAgAEQAZQB0AGUAcgBpAG8AcgBhAHQAaQBvAG4AIABDAG8AcgBwAG8AcgBhAHQAaQBvAG4AAAAAAD4ACwABAEYAaQBsAGUARABlAHMAYwByAGkAcAB0AGkAbwBuAAAAAABvAGgAbwBvAGsAIABTAFAA | ||
2674 | UABDAAAAAAAwAAgAAQBGAGkAbABlAFYAZQByAHMAaQBvAG4AAAAAADAALgAzAC4AMAAuADAAAAAqAAUAAQBJAG4AdABlAHIAbgBhAGwATgBhAG0AZQAAAHMAcABwAGMAAAAAAIwANAABAEwAZQBnAGEAbABDAG8AcAB5AHIAaQBnAGgAdAAAAKkAIAAyADAAMgAzACAA | ||
2675 | QQBuAG8AbQBhAGwAbwB1AHMAIABTAG8AZgB0AHcAYQByAGUAIABEAGUAdABlAHIAaQBvAHIAYQB0AGkAbwBuACAAQwBvAHIAcABvAHIAYQB0AGkAbwBuAAAAOgAJAAEATwByAGkAZwBpAG4AYQBsAEYAaQBsAGUAbgBhAG0AZQAAAHMAcABwAGMALgBkAGwAbAAAAAAA | ||
2676 | LAAGAAEAUAByAG8AZAB1AGMAdABOAGEAbQBlAAAAAABvAGgAbwBvAGsAAAA0AAgAAQBQAHIAbwBkAHUAYwB0AFYAZQByAHMAaQBvAG4AAAAwAC4AMwAuADAALgAwAAAARAAAAAEAVgBhAHIARgBpAGwAZQBJAG4AZgBvAAAAAAAkAAQAAABUAHIAYQBuAHMAbABhAHQA | ||
2677 | aQBvAG4AAAAAAAkE5AQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA | ||
2678 | AAAAAAAQAAAUAAAAOzBQMHEwfjBSMVoxAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA | ||
2679 | AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA | ||
2680 | AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA | ||
2681 | AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA | ||
2682 | :sppc32.dll: | ||
2683 | |||
2684 | :======================================================================================================================================== | ||
2685 | |||
2686 | :sppc64.dll: | ||
2687 | TVqQAAMAAAAEAAAA//8AALgAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAgAAAAA4fug4AtAnNIbgBTM0hVGhpcyBwcm9ncmFtIGNhbm5vdCBiZSBydW4gaW4gRE9TIG1vZGUuDQ0KJAAAAAAAAABQRQAAZIYHAMDc0GQAAAAAAAAAAPAA | ||
2688 | LiILAgIoAAIAAAAeAAAAAAAAABAAAAAQAAAAAJIxAgAAAAAQAAAAAgAABAAAAAAAAAAGAAAAAAAAAACQAAAABAAA39AAAAIAYAEAACAAAAAAAAAQAAAAAAAAAAAQAAAAAAAAEAAAAAAAAAAAAAAQAAAAAFAAAI0QAAAAcAAAUAEAAACAAAB4AwAAADAAACQAAAAAAAAA | ||
2689 | AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAiHAAADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAudGV4dAAAAHABAAAAEAAAAAIAAAAEAAAAAAAAAAAAAAAAAAAgAABgLnJkYXRhAAAgAAAAACAAAAAC | ||
2690 | AAAABgAAAAAAAAAAAAAAAAAAQAAAQC5wZGF0YQAAJAAAAAAwAAAAAgAAAAgAAAAAAAAAAAAAAAAAAEAAAEAueGRhdGEAACQAAAAAQAAAAAIAAAAKAAAAAAAAAAAAAAAAAABAAABALmVkYXRhAACNEAAAAFAAAAASAAAADAAAAAAAAAAAAAAAAAAAQAAAQC5pZGF0YQAA | ||
2691 | UAEAAABwAAAAAgAAAB4AAAAAAAAAAAAAAAAAAEAAAMAucnNyYwAAAHgDAAAAgAAAAAQAAAAgAAAAAAAAAAAAAAAAAABAAADAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA | ||
2692 | AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA | ||
2693 | AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAALgBAAAAw0FUU0iD7EhFMclMjQXpDwAASI1E | ||
2694 | JDjHRCQ0AAAAAEiJRCQoSI1EJDRIiUQkIEjHRCQ4AAAAAOj/AAAASItMJDhIix1TYAAAhcBBicR0B//TRTHk6yhEi0QkNEiNFaMPAAD/FUNgAABIi0wkOEiFwHQK/9NBvAEAAADrAv/TRIngSIPESFtBXMNBVUFUVVdWU0iD7Dgx9kyLrCSQAAAASIusJJgAAABMiWwk | ||
2695 | IEiJz0iJbCQo6IoAAABBicSFwHVEQTl1AHY+SGveKEiLVQBIAdqDehAAdChIifnoIv///4XAdRxIA10ASMdDEAEAAABIx0MYAAAAAEjHQyAAAAAASP/G67xEieBIg8Q4W15fXUFcQV3DkJCQkJCQkP8lel8AAJCQDx+EAAAAAAD/JXpfAACQkA8fhAAAAAAA/yVKXwAA | ||
2696 | kJD/JTpfAACQkP//////////AAAAAAAAAAD//////////wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA | ||
2697 | AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAATgBhAG0AZQAAAEcAcgBhAGMAZQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA | ||
2698 | AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA | ||
2699 | AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA | ||
2700 | AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAABhAAAABAAAAGEAAAjhAAAARAAACOEAAAGREAABBAAAAAAAAAAAAAAAAAAAAAAAAA | ||
2701 | AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA | ||
2702 | AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA | ||
2703 | AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA | ||
2704 | AAAAAAAAAAAAAAEAAAABBwMAB4IDMALAAAABDAcADGIIMAdgBnAFUATAAtAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA | ||
2705 | AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA | ||
2706 | AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA | ||
2707 | AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAMDc0GQAAAAAxlIAAAEAAABDAAAAQwAAAChQAAA0UQAAQFIAAM9SAADvUgAABVMAAClTAABdUwAAoVMAAOlTAAAXVAAANVQAAGdU | ||
2708 | AACdVAAA41QAAC1VAABhVQAAn1UAANNVAAANVgAAO1YAAHFWAACvVgAAz1YAAPtWAACOEAAAUVcAAG9XAACfVwAA01cAABFYAABNWAAAb1gAAKVYAADNWAAABVkAAEFZAABtWQAAp1kAALtZAAD7WQAAOVoAAE9aAAB1WgAAnVoAANNaAAAHWwAAPVsAAGlbAAClWwAA | ||
2709 | 41sAAA1cAAA5XAAAiVwAANFcAAARXQAAWV0AAKNdAADxXQAAG14AAEdeAACHXgAAu14AAOdeAAArXwAAW18AALVfAADrXwAAJ2AAAF1gAADiUgAA/VIAABpTAABGUwAAglMAAMhTAAADVAAAKVQAAFFUAACFVAAAw1QAAAtVAABKVQAAg1UAALxVAADzVQAAJ1YAAFlW | ||
2710 | AACTVgAAwlYAAOhWAAAZVwAAMVcAAGNXAACKVwAAvFcAAPVXAAAyWAAAYVgAAI1YAAC8WAAA7FgAACZZAABaWQAAjVkAALRZAADeWQAAHVoAAEdaAABlWgAAjFoAALtaAADwWgAAJVsAAFZbAACKWwAAx1sAAPtbAAAmXAAAZFwAALBcAAD0XAAAOF0AAIFdAADNXQAA | ||
2711 | CV4AADReAABqXgAApF4AANReAAAMXwAARl8AAItfAADTXwAADGAAAEVgAAB4YAAAAAABAAIAAwAEAAUABgAHAAgACQAKAAsADAANAA4ADwAQABEAEgATABQAFQAWABcAGAAZABoAGwAcAB0AHgAfACAAIQAiACMAJAAlACYAJwAoACkAKgArACwALQAuAC8AMAAxADIA | ||
2712 | MwA0ADUANgA3ADgAOQA6ADsAPAA9AD4APwBAAEEAQgBzcHBjLmRsbABTUFBDUy5TTENhbGxTZXJ2ZXIAU0xDYWxsU2VydmVyAFNQUENTLlNMQ2xvc2UAU0xDbG9zZQBTUFBDUy5TTENvbnN1bWVSaWdodABTTENvbnN1bWVSaWdodABTUFBDUy5TTERlcG9zaXRNaWdy | ||
2713 | YXRpb25CbG9iAFNMRGVwb3NpdE1pZ3JhdGlvbkJsb2IAU1BQQ1MuU0xEZXBvc2l0T2ZmbGluZUNvbmZpcm1hdGlvbklkAFNMRGVwb3NpdE9mZmxpbmVDb25maXJtYXRpb25JZABTUFBDUy5TTERlcG9zaXRPZmZsaW5lQ29uZmlybWF0aW9uSWRFeABTTERlcG9zaXRP | ||
2714 | ZmZsaW5lQ29uZmlybWF0aW9uSWRFeABTUFBDUy5TTERlcG9zaXRTdG9yZVRva2VuAFNMRGVwb3NpdFN0b3JlVG9rZW4AU1BQQ1MuU0xGaXJlRXZlbnQAU0xGaXJlRXZlbnQAU1BQQ1MuU0xHYXRoZXJNaWdyYXRpb25CbG9iAFNMR2F0aGVyTWlncmF0aW9uQmxvYgBT | ||
2715 | UFBDUy5TTEdhdGhlck1pZ3JhdGlvbkJsb2JFeABTTEdhdGhlck1pZ3JhdGlvbkJsb2JFeABTUFBDUy5TTEdlbmVyYXRlT2ZmbGluZUluc3RhbGxhdGlvbklkAFNMR2VuZXJhdGVPZmZsaW5lSW5zdGFsbGF0aW9uSWQAU1BQQ1MuU0xHZW5lcmF0ZU9mZmxpbmVJbnN0 | ||
2716 | YWxsYXRpb25JZEV4AFNMR2VuZXJhdGVPZmZsaW5lSW5zdGFsbGF0aW9uSWRFeABTUFBDUy5TTEdldEFjdGl2ZUxpY2Vuc2VJbmZvAFNMR2V0QWN0aXZlTGljZW5zZUluZm8AU1BQQ1MuU0xHZXRBcHBsaWNhdGlvbkluZm9ybWF0aW9uAFNMR2V0QXBwbGljYXRpb25J | ||
2717 | bmZvcm1hdGlvbgBTUFBDUy5TTEdldEFwcGxpY2F0aW9uUG9saWN5AFNMR2V0QXBwbGljYXRpb25Qb2xpY3kAU1BQQ1MuU0xHZXRBdXRoZW50aWNhdGlvblJlc3VsdABTTEdldEF1dGhlbnRpY2F0aW9uUmVzdWx0AFNQUENTLlNMR2V0RW5jcnlwdGVkUElERXgAU0xH | ||
2718 | ZXRFbmNyeXB0ZWRQSURFeABTUFBDUy5TTEdldEdlbnVpbmVJbmZvcm1hdGlvbgBTTEdldEdlbnVpbmVJbmZvcm1hdGlvbgBTUFBDUy5TTEdldEluc3RhbGxlZFByb2R1Y3RLZXlJZHMAU0xHZXRJbnN0YWxsZWRQcm9kdWN0S2V5SWRzAFNQUENTLlNMR2V0TGljZW5z | ||
2719 | ZQBTTEdldExpY2Vuc2UAU1BQQ1MuU0xHZXRMaWNlbnNlRmlsZUlkAFNMR2V0TGljZW5zZUZpbGVJZABTUFBDUy5TTEdldExpY2Vuc2VJbmZvcm1hdGlvbgBTTEdldExpY2Vuc2VJbmZvcm1hdGlvbgBTTEdldExpY2Vuc2luZ1N0YXR1c0luZm9ybWF0aW9uAFNQUENT | ||
2720 | LlNMR2V0UEtleUlkAFNMR2V0UEtleUlkAFNQUENTLlNMR2V0UEtleUluZm9ybWF0aW9uAFNMR2V0UEtleUluZm9ybWF0aW9uAFNQUENTLlNMR2V0UG9saWN5SW5mb3JtYXRpb24AU0xHZXRQb2xpY3lJbmZvcm1hdGlvbgBTUFBDUy5TTEdldFBvbGljeUluZm9ybWF0 | ||
2721 | aW9uRFdPUkQAU0xHZXRQb2xpY3lJbmZvcm1hdGlvbkRXT1JEAFNQUENTLlNMR2V0UHJvZHVjdFNrdUluZm9ybWF0aW9uAFNMR2V0UHJvZHVjdFNrdUluZm9ybWF0aW9uAFNQUENTLlNMR2V0U0xJRExpc3QAU0xHZXRTTElETGlzdABTUFBDUy5TTEdldFNlcnZpY2VJ | ||
2722 | bmZvcm1hdGlvbgBTTEdldFNlcnZpY2VJbmZvcm1hdGlvbgBTUFBDUy5TTEluc3RhbGxMaWNlbnNlAFNMSW5zdGFsbExpY2Vuc2UAU1BQQ1MuU0xJbnN0YWxsUHJvb2ZPZlB1cmNoYXNlAFNMSW5zdGFsbFByb29mT2ZQdXJjaGFzZQBTUFBDUy5TTEluc3RhbGxQcm9v | ||
2723 | Zk9mUHVyY2hhc2VFeABTTEluc3RhbGxQcm9vZk9mUHVyY2hhc2VFeABTUFBDUy5TTElzR2VudWluZUxvY2FsRXgAU0xJc0dlbnVpbmVMb2NhbEV4AFNQUENTLlNMTG9hZEFwcGxpY2F0aW9uUG9saWNpZXMAU0xMb2FkQXBwbGljYXRpb25Qb2xpY2llcwBTUFBDUy5T | ||
2724 | TE9wZW4AU0xPcGVuAFNQUENTLlNMUGVyc2lzdEFwcGxpY2F0aW9uUG9saWNpZXMAU0xQZXJzaXN0QXBwbGljYXRpb25Qb2xpY2llcwBTUFBDUy5TTFBlcnNpc3RSVFNQYXlsb2FkT3ZlcnJpZGUAU0xQZXJzaXN0UlRTUGF5bG9hZE92ZXJyaWRlAFNQUENTLlNMUmVB | ||
2725 | cm0AU0xSZUFybQBTUFBDUy5TTFJlZ2lzdGVyRXZlbnQAU0xSZWdpc3RlckV2ZW50AFNQUENTLlNMUmVnaXN0ZXJQbHVnaW4AU0xSZWdpc3RlclBsdWdpbgBTUFBDUy5TTFNldEF1dGhlbnRpY2F0aW9uRGF0YQBTTFNldEF1dGhlbnRpY2F0aW9uRGF0YQBTUFBDUy5T | ||
2726 | TFNldEN1cnJlbnRQcm9kdWN0S2V5AFNMU2V0Q3VycmVudFByb2R1Y3RLZXkAU1BQQ1MuU0xTZXRHZW51aW5lSW5mb3JtYXRpb24AU0xTZXRHZW51aW5lSW5mb3JtYXRpb24AU1BQQ1MuU0xVbmluc3RhbGxMaWNlbnNlAFNMVW5pbnN0YWxsTGljZW5zZQBTUFBDUy5T | ||
2727 | TFVuaW5zdGFsbFByb29mT2ZQdXJjaGFzZQBTTFVuaW5zdGFsbFByb29mT2ZQdXJjaGFzZQBTUFBDUy5TTFVubG9hZEFwcGxpY2F0aW9uUG9saWNpZXMAU0xVbmxvYWRBcHBsaWNhdGlvblBvbGljaWVzAFNQUENTLlNMVW5yZWdpc3RlckV2ZW50AFNMVW5yZWdpc3Rl | ||
2728 | ckV2ZW50AFNQUENTLlNMVW5yZWdpc3RlclBsdWdpbgBTTFVucmVnaXN0ZXJQbHVnaW4AU1BQQ1MuU0xwQXV0aGVudGljYXRlR2VudWluZVRpY2tldFJlc3BvbnNlAFNMcEF1dGhlbnRpY2F0ZUdlbnVpbmVUaWNrZXRSZXNwb25zZQBTUFBDUy5TTHBCZWdpbkdlbnVp | ||
2729 | bmVUaWNrZXRUcmFuc2FjdGlvbgBTTHBCZWdpbkdlbnVpbmVUaWNrZXRUcmFuc2FjdGlvbgBTUFBDUy5TTHBDbGVhckFjdGl2YXRpb25JblByb2dyZXNzAFNMcENsZWFyQWN0aXZhdGlvbkluUHJvZ3Jlc3MAU1BQQ1MuU0xwRGVwb3NpdERvd25sZXZlbEdlbnVpbmVU | ||
2730 | aWNrZXQAU0xwRGVwb3NpdERvd25sZXZlbEdlbnVpbmVUaWNrZXQAU1BQQ1MuU0xwRGVwb3NpdFRva2VuQWN0aXZhdGlvblJlc3BvbnNlAFNMcERlcG9zaXRUb2tlbkFjdGl2YXRpb25SZXNwb25zZQBTUFBDUy5TTHBHZW5lcmF0ZVRva2VuQWN0aXZhdGlvbkNoYWxs | ||
2731 | ZW5nZQBTTHBHZW5lcmF0ZVRva2VuQWN0aXZhdGlvbkNoYWxsZW5nZQBTUFBDUy5TTHBHZXRHZW51aW5lQmxvYgBTTHBHZXRHZW51aW5lQmxvYgBTUFBDUy5TTHBHZXRHZW51aW5lTG9jYWwAU0xwR2V0R2VudWluZUxvY2FsAFNQUENTLlNMcEdldExpY2Vuc2VBY3F1 | ||
2732 | aXNpdGlvbkluZm8AU0xwR2V0TGljZW5zZUFjcXVpc2l0aW9uSW5mbwBTUFBDUy5TTHBHZXRNU1BpZEluZm9ybWF0aW9uAFNMcEdldE1TUGlkSW5mb3JtYXRpb24AU1BQQ1MuU0xwR2V0TWFjaGluZVVHVUlEAFNMcEdldE1hY2hpbmVVR1VJRABTUFBDUy5TTHBHZXRU | ||
2733 | b2tlbkFjdGl2YXRpb25HcmFudEluZm8AU0xwR2V0VG9rZW5BY3RpdmF0aW9uR3JhbnRJbmZvAFNQUENTLlNMcElBQWN0aXZhdGVQcm9kdWN0AFNMcElBQWN0aXZhdGVQcm9kdWN0AFNQUENTLlNMcElzQ3VycmVudEluc3RhbGxlZFByb2R1Y3RLZXlEZWZhdWx0S2V5 | ||
2734 | AFNMcElzQ3VycmVudEluc3RhbGxlZFByb2R1Y3RLZXlEZWZhdWx0S2V5AFNQUENTLlNMcFByb2Nlc3NWTVBpcGVNZXNzYWdlAFNMcFByb2Nlc3NWTVBpcGVNZXNzYWdlAFNQUENTLlNMcFNldEFjdGl2YXRpb25JblByb2dyZXNzAFNMcFNldEFjdGl2YXRpb25JblBy | ||
2735 | b2dyZXNzAFNQUENTLlNMcFRyaWdnZXJTZXJ2aWNlV29ya2VyAFNMcFRyaWdnZXJTZXJ2aWNlV29ya2VyAFNQUENTLlNMcFZMQWN0aXZhdGVQcm9kdWN0AFNMcFZMQWN0aXZhdGVQcm9kdWN0AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA | ||
2736 | AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA | ||
2737 | AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA | ||
2738 | AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUHAAAAAAAAAAAAAAIHEAAIhwAABocAAAAAAAAAAAAAAwcQAAoHAAAHhwAAAAAAAAAAAAAERxAACwcAAAAAAAAAAAAAAAAAAAAAAAAAAAAADAcAAAAAAAAOJwAAAAAAAAAAAAAAAAAAAAcQAAAAAAAAAAAAAAAAAA | ||
2739 | DHEAAAAAAAAAAAAAAAAAAMBwAAAAAAAA4nAAAAAAAAAAAAAAAAAAAABxAAAAAAAAAAAAAAAAAAAMcQAAAAAAAAAAAAAAAAAAAgBTTEdldExpY2Vuc2luZ1N0YXR1c0luZm9ybWF0aW9uAAEAU0xHZXRQcm9kdWN0U2t1SW5mb3JtYXRpb24AAOgDTG9jYWxGcmVlAFEB | ||
2740 | U3RyU3RyTklXAABwAAAAcAAAc3BwY3MuZGxsAAAAFHAAAEtFUk5FTDMyLmRsbAAAAAAocAAAU0hMV0FQSS5kbGwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA | ||
2741 | AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAEAAAABgAAIAAAAAAAAAAAAAAAAAAAAEAAQAAADAAAIAAAAAAAAAAAAAA | ||
2742 | AAAAAAEACQQAAEgAAABYgAAAHAMAAAAAAAAAAAAAHAM0AAAAVgBTAF8AVgBFAFIAUwBJAE8ATgBfAEkATgBGAE8AAAAAAL0E7/4AAAEAAwAAAAAAAAADAAAAAAAAAAAAAAAAAAAABAAEAAIAAAAAAAAAAAAAAAAAAAB8AgAAAQBTAHQAcgBpAG4AZwBGAGkAbABlAEkA | ||
2743 | bgBmAG8AAABYAgAAAQAwADQAMAA5ADAANABFADQAAAB6AC0AAQBDAG8AbQBwAGEAbgB5AE4AYQBtAGUAAAAAAEEAbgBvAG0AYQBsAG8AdQBzACAAUwBvAGYAdAB3AGEAcgBlACAARABlAHQAZQByAGkAbwByAGEAdABpAG8AbgAgAEMAbwByAHAAbwByAGEAdABpAG8A | ||
2744 | bgAAAAAAPgALAAEARgBpAGwAZQBEAGUAcwBjAHIAaQBwAHQAaQBvAG4AAAAAAG8AaABvAG8AawAgAFMAUABQAEMAAAAAADAACAABAEYAaQBsAGUAVgBlAHIAcwBpAG8AbgAAAAAAMAAuADMALgAwAC4AMAAAACoABQABAEkAbgB0AGUAcgBuAGEAbABOAGEAbQBlAAAA | ||
2745 | cwBwAHAAYwAAAAAAjAA0AAEATABlAGcAYQBsAEMAbwBwAHkAcgBpAGcAaAB0AAAAqQAgADIAMAAyADMAIABBAG4AbwBtAGEAbABvAHUAcwAgAFMAbwBmAHQAdwBhAHIAZQAgAEQAZQB0AGUAcgBpAG8AcgBhAHQAaQBvAG4AIABDAG8AcgBwAG8AcgBhAHQAaQBvAG4A | ||
2746 | AAA6AAkAAQBPAHIAaQBnAGkAbgBhAGwARgBpAGwAZQBuAGEAbQBlAAAAcwBwAHAAYwAuAGQAbABsAAAAAAAsAAYAAQBQAHIAbwBkAHUAYwB0AE4AYQBtAGUAAAAAAG8AaABvAG8AawAAADQACAABAFAAcgBvAGQAdQBjAHQAVgBlAHIAcwBpAG8AbgAAADAALgAzAC4A | ||
2747 | MAAuADAAAABEAAAAAQBWAGEAcgBGAGkAbABlAEkAbgBmAG8AAAAAACQABAAAAFQAcgBhAG4AcwBsAGEAdABpAG8AbgAAAAAACQTkBAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA | ||
2748 | AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA | ||
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 |
1403 | set _NoEditionChange=0 | 2765 | set _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 | ||
1411 | cls | 2769 | cls |
@@ -1431,21 +2789,25 @@ for %%A in (%_act% %_rem% %_NoEditionChange%) do (if "%%A"=="1" set _unattended= | |||
1431 | 2789 | ||
1432 | ::======================================================================================================================================== | 2790 | ::======================================================================================================================================== |
1433 | 2791 | ||
1434 | set winbuild=1 | 2792 | set "nul1=1>nul" |
2793 | set "nul2=2>nul" | ||
2794 | set "nul6=2^>nul" | ||
1435 | set "nul=>nul 2>&1" | 2795 | set "nul=>nul 2>&1" |
2796 | |||
1436 | set psc=powershell.exe | 2797 | set psc=powershell.exe |
2798 | set winbuild=1 | ||
1437 | for /f "tokens=6 delims=[]. " %%G in ('ver') do set winbuild=%%G | 2799 | for /f "tokens=6 delims=[]. " %%G in ('ver') do set winbuild=%%G |
1438 | 2800 | ||
1439 | set _NCS=1 | 2801 | set _NCS=1 |
1440 | if %winbuild% LSS 10586 set _NCS=0 | 2802 | if %winbuild% LSS 10586 set _NCS=0 |
1441 | if %winbuild% GEQ 10586 reg query "HKCU\Console" /v ForceV2 2>nul | find /i "0x0" 1>nul && (set _NCS=0) | 2803 | if %winbuild% GEQ 10586 reg query "HKCU\Console" /v ForceV2 %nul2% | find /i "0x0" %nul1% && (set _NCS=0) |
1442 | 2804 | ||
1443 | if %_NCS% EQU 1 ( | 2805 | if %_NCS% EQU 1 ( |
1444 | for /F %%a in ('echo prompt $E ^| cmd') do set "esc=%%a" | 2806 | for /F %%a in ('echo prompt $E ^| cmd') do set "esc=%%a" |
1445 | set "Red="41;97m"" | 2807 | set "Red="41;97m"" |
1446 | set "Gray="100;97m"" | 2808 | set "Gray="100;97m"" |
1447 | set "Green="42;97m"" | 2809 | set "Green="42;97m"" |
1448 | set "Magenta="45;97m"" | 2810 | set "Blue="44;97m"" |
1449 | set "_White="40;37m"" | 2811 | set "_White="40;37m"" |
1450 | set "_Green="40;92m"" | 2812 | set "_Green="40;92m"" |
1451 | set "_Yellow="40;93m"" | 2813 | set "_Yellow="40;93m"" |
@@ -1453,7 +2815,7 @@ set "_Yellow="40;93m"" | |||
1453 | set "Red="Red" "white"" | 2815 | set "Red="Red" "white"" |
1454 | set "Gray="Darkgray" "white"" | 2816 | set "Gray="Darkgray" "white"" |
1455 | set "Green="DarkGreen" "white"" | 2817 | set "Green="DarkGreen" "white"" |
1456 | set "Magenta="Darkmagenta" "white"" | 2818 | set "Blue="Blue" "white"" |
1457 | set "_White="Black" "Gray"" | 2819 | set "_White="Black" "Gray"" |
1458 | set "_Green="Black" "Green"" | 2820 | set "_Green="Black" "Green"" |
1459 | set "_Yellow="Black" "Yellow"" | 2821 | set "_Yellow="Black" "Yellow"" |
@@ -1462,14 +2824,21 @@ set "_Yellow="Black" "Yellow"" | |||
1462 | set _k38= | 2824 | set _k38= |
1463 | set "nceline=echo: &echo ==== ERROR ==== &echo:" | 2825 | set "nceline=echo: &echo ==== ERROR ==== &echo:" |
1464 | set "eline=echo: &call :dk_color %Red% "==== ERROR ====" &echo:" | 2826 | set "eline=echo: &call :dk_color %Red% "==== ERROR ====" &echo:" |
1465 | if %~z0 GEQ 200000 (set "_exitmsg=Go back") else (set "_exitmsg=Exit") | 2827 | if %~z0 GEQ 200000 ( |
2828 | set "_exitmsg=Go back" | ||
2829 | set "_fixmsg=Go back to Main Menu, select Troubleshoot and run Fix Licensing option." | ||
2830 | ) else ( | ||
2831 | set "_exitmsg=Exit" | ||
2832 | set "_fixmsg=In MAS folder, run Troubleshoot script and select Fix Licensing option." | ||
2833 | ) | ||
2834 | |||
1466 | set "specific_kms=SOFTWARE\Microsoft\Windows NT\CurrentVersion\SoftwareProtectionPlatform\55c92734-d682-4d71-983e-d6ec3f16059f" | 2835 | set "specific_kms=SOFTWARE\Microsoft\Windows NT\CurrentVersion\SoftwareProtectionPlatform\55c92734-d682-4d71-983e-d6ec3f16059f" |
1467 | 2836 | ||
1468 | ::======================================================================================================================================== | 2837 | ::======================================================================================================================================== |
1469 | 2838 | ||
1470 | if %winbuild% LSS 14393 ( | 2839 | if %winbuild% LSS 14393 ( |
1471 | %eline% | 2840 | %eline% |
1472 | echo Unsupported OS version detected. | 2841 | echo Unsupported OS version detected [%winbuild%]. |
1473 | echo KMS38 Activation is supported for Windows 10/11/Server, build 14393 and later. | 2842 | echo KMS38 Activation is supported for Windows 10/11/Server, build 14393 and later. |
1474 | goto dk_done | 2843 | goto dk_done |
1475 | ) | 2844 | ) |
@@ -1529,7 +2898,7 @@ goto :k_menu | |||
1529 | :k_menu2 | 2898 | :k_menu2 |
1530 | 2899 | ||
1531 | cls | 2900 | cls |
1532 | mode 102, 33 | 2901 | mode 108, 34 |
1533 | title KMS38 Activation | 2902 | title KMS38 Activation |
1534 | 2903 | ||
1535 | echo: | 2904 | echo: |
@@ -1578,7 +2947,7 @@ if exist "%SystemRoot%\Servicing\Packages\Microsoft-Windows-Server*EvalEdition~* | |||
1578 | if exist "%SystemRoot%\Servicing\Packages\Microsoft-Windows-Server*EvalCorEdition~*.mum" set _eval=1 & set _evalserv=1 | 2947 | if exist "%SystemRoot%\Servicing\Packages\Microsoft-Windows-Server*EvalCorEdition~*.mum" set _eval=1 & set _evalserv=1 |
1579 | 2948 | ||
1580 | if defined _eval ( | 2949 | if defined _eval ( |
1581 | reg query "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion" /v EditionID 2>nul | find /i "Eval" 1>nul && ( | 2950 | reg query "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion" /v EditionID %nul2% | find /i "Eval" %nul1% && ( |
1582 | %eline% | 2951 | %eline% |
1583 | echo [%winos% ^| %winbuild%] | 2952 | echo [%winos% ^| %winbuild%] |
1584 | if defined _evalserv ( | 2953 | if defined _evalserv ( |
@@ -1590,7 +2959,7 @@ echo Evaluation Editions cannot be activated. | |||
1590 | echo You need to install full version of %winos% | 2959 | echo You need to install full version of %winos% |
1591 | echo: | 2960 | echo: |
1592 | echo Download it from here, | 2961 | echo Download it from here, |
1593 | echo https://massgrave.dev/genuine-installation-media.html | 2962 | echo https://%mas%/genuine-installation-media.html |
1594 | ) | 2963 | ) |
1595 | goto dk_done | 2964 | goto dk_done |
1596 | ) | 2965 | ) |
@@ -1609,7 +2978,7 @@ if not exist "!_work!\clipup.exe" ( | |||
1609 | echo clipup.exe doesn't exist in Server Cor/Acor [No GUI] version. | 2978 | echo clipup.exe doesn't exist in Server Cor/Acor [No GUI] version. |
1610 | echo It's required for KMS38 Activation. | 2979 | echo It's required for KMS38 Activation. |
1611 | echo Check below page on how to activate it. | 2980 | echo Check below page on how to activate it. |
1612 | echo https://massgrave.dev/kms38.html | 2981 | echo https://%mas%/kms38.html |
1613 | goto dk_done | 2982 | goto 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 | ||
1621 | set osSKU= | 2990 | set osSKU= |
1622 | set regSKU= | 2991 | set slcSKU= |
1623 | set wmiSKU= | 2992 | set wmiSKU= |
2993 | set regSKU= | ||
2994 | |||
2995 | if %winbuild% GEQ 14393 (set info=Kernel-BrandingInfo) else (set info=Kernel-ProductInfo) | ||
2996 | set d1=%ref% [void]$TypeBuilder.DefinePInvokeMethod('SLGetWindowsInformationDWORD', 'slc.dll', 'Public, Static', 1, [int], @([String], [int].MakeByRefType()), 1, 3); | ||
2997 | set d1=%d1% $Sku = 0; [void]$TypeBuilder.CreateType()::SLGetWindowsInformationDWORD('%info%', [ref]$Sku); $Sku | ||
2998 | for /f "delims=" %%s in ('"%psc% %d1%"') do if not errorlevel 1 (set slcSKU=%%s) | ||
2999 | if "%slcSKU%"=="0" set slcSKU= | ||
3000 | if 1%slcSKU% NEQ +1%slcSKU% set slcSKU= | ||
1624 | 3001 | ||
1625 | for /f "tokens=3 delims=." %%a in ('reg query "HKLM\SYSTEM\CurrentControlSet\Control\ProductOptions" /v OSProductPfn 2^>nul') do set "regSKU=%%a" | 3002 | for /f "tokens=3 delims=." %%a in ('reg query "HKLM\SYSTEM\CurrentControlSet\Control\ProductOptions" /v OSProductPfn %nul6%') do set "regSKU=%%a" |
1626 | if %_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" | 3003 | if %_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" |
1627 | if %_wmic% EQU 0 for /f "tokens=1" %%a in ('%psc% "([WMI]'Win32_OperatingSystem=@').OperatingSystemSKU" 2^>nul') do if not errorlevel 1 set "wmiSKU=%%a" | 3004 | if %_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 | ||
1629 | set osSKU=%wmiSKU% | 3006 | set osSKU=%slcSKU% |
3007 | if not defined osSKU set osSKU=%wmiSKU% | ||
1630 | if not defined osSKU set osSKU=%regSKU% | 3008 | if not defined osSKU set osSKU=%regSKU% |
1631 | 3009 | ||
1632 | if not defined osSKU ( | 3010 | if not defined osSKU ( |
@@ -1642,15 +3020,16 @@ set error= | |||
1642 | cls | 3020 | cls |
1643 | echo: | 3021 | echo: |
1644 | for /f "skip=2 tokens=2*" %%a in ('reg query "HKLM\SYSTEM\CurrentControlSet\Control\Session Manager\Environment" /v PROCESSOR_ARCHITECTURE') do set arch=%%b | 3022 | for /f "skip=2 tokens=2*" %%a in ('reg query "HKLM\SYSTEM\CurrentControlSet\Control\Session Manager\Environment" /v PROCESSOR_ARCHITECTURE') do set arch=%%b |
1645 | echo Checking OS Info [%winos% ^| %winbuild% ^| %arch%] | 3023 | for /f "tokens=6-7 delims=[]. " %%i in ('ver') do if "%%j"=="" (set fullbuild=%%i) else (set fullbuild=%%i.%%j) |
3024 | echo Checking OS Info [%winos% ^| %fullbuild% ^| %arch%] | ||
1646 | 3025 | ||
1647 | ::======================================================================================================================================== | 3026 | ::======================================================================================================================================== |
1648 | 3027 | ||
1649 | :: Check Windows Script Host | 3028 | :: Check Windows Script Host |
1650 | 3029 | ||
1651 | set _WSH=1 | 3030 | set _WSH=1 |
1652 | reg query "HKCU\SOFTWARE\Microsoft\Windows Script Host\Settings" /v Enabled 2>nul | find /i "0x0" 1>nul && (set _WSH=0) | 3031 | reg query "HKCU\SOFTWARE\Microsoft\Windows Script Host\Settings" /v Enabled %nul2% | find /i "0x0" %nul1% && (set _WSH=0) |
1653 | reg query "HKLM\SOFTWARE\Microsoft\Windows Script Host\Settings" /v Enabled 2>nul | find /i "0x0" 1>nul && (set _WSH=0) | 3032 | reg query "HKLM\SOFTWARE\Microsoft\Windows Script Host\Settings" /v Enabled %nul2% | find /i "0x0" %nul1% && (set _WSH=0) |
1654 | 3033 | ||
1655 | if %_WSH% EQU 0 ( | 3034 | if %_WSH% EQU 0 ( |
1656 | reg add "HKLM\Software\Microsoft\Windows Script Host\Settings" /v Enabled /t REG_DWORD /d 1 /f %nul% | 3035 | reg add "HKLM\Software\Microsoft\Windows Script Host\Settings" /v Enabled /t REG_DWORD /d 1 /f %nul% |
@@ -1686,7 +3065,6 @@ set key= | |||
1686 | set pkey= | 3065 | set pkey= |
1687 | set altkey= | 3066 | set altkey= |
1688 | set changekey= | 3067 | set changekey= |
1689 | set curedition= | ||
1690 | set altedition= | 3068 | set altedition= |
1691 | 3069 | ||
1692 | if defined applist call :kms38data getkey | 3070 | if defined applist call :kms38data getkey |
@@ -1696,6 +3074,14 @@ if defined applist if not defined key call :kms38fallback | |||
1696 | 3074 | ||
1697 | if defined altkey (set key=%altkey%&set changekey=1) | 3075 | if defined altkey (set key=%altkey%&set changekey=1) |
1698 | 3076 | ||
3077 | set /a UBR=0 | ||
3078 | if %osSKU%==191 if defined altkey if defined altedition ( | ||
3079 | 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 | ||
3080 | if %winbuild% GEQ 19044 if !UBR! LSS 2788 ( | ||
3081 | call :dk_color %Blue% "Windows must to be updated to build 19044.2788 or higher for IotEnterpriseS KMS38 activation." | ||
3082 | ) | ||
3083 | ) | ||
3084 | |||
1699 | if not defined key if defined notfoundaltactID ( | 3085 | if not defined key if defined notfoundaltactID ( |
1700 | call :dk_color %Red% "Checking Alternate Edition For KMS38 [%altedition% Activation ID Not Found]" | 3086 | call :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 ( | |||
1705 | echo [%winos% ^| %winbuild% ^| SKU:%osSKU%] | 3091 | echo [%winos% ^| %winbuild% ^| SKU:%osSKU%] |
1706 | echo Unable to find this product in the supported product list. | 3092 | echo Unable to find this product in the supported product list. |
1707 | echo Make sure you are using updated version of the script. | 3093 | echo Make sure you are using updated version of the script. |
1708 | echo https://massgrave.dev | 3094 | echo https://%mas% |
1709 | echo: | 3095 | echo: |
1710 | goto dk_done | 3096 | goto dk_done |
1711 | ) | 3097 | ) |
@@ -1716,14 +3102,14 @@ goto dk_done | |||
1716 | 3102 | ||
1717 | echo: | 3103 | echo: |
1718 | if defined changekey ( | 3104 | if defined changekey ( |
1719 | call :dk_color %Magenta% "[%altedition%] Edition product key will be used to enable KMS38 activation." | 3105 | call :dk_color %Blue% "[%altedition%] Edition product key will be used to enable KMS38 activation." |
1720 | echo: | 3106 | echo: |
1721 | ) | 3107 | ) |
1722 | 3108 | ||
1723 | set _partial= | 3109 | set _partial= |
1724 | if not defined key ( | 3110 | if not defined key ( |
1725 | if %_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=%%#" | 3111 | if %_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=%%#" |
1726 | if %_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=%%#" | 3112 | if %_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=%%#" |
1727 | call echo Checking Installed Product Key [Partial Key - %%_partial%%] [Volume:GVLK] | 3113 | call 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 ( |
1743 | call :dk_color %Red% "Installing KMS Client Setup Key [%key%] [Failed] !error_code!" | 3129 | call :dk_color %Red% "Installing KMS Client Setup Key [%key%] [Failed] !error_code!" |
1744 | if not defined error ( | 3130 | if not defined error ( |
1745 | call :dk_color %Magenta% "In MAS, Goto Troubleshoot and run Fix Licensing option." | 3131 | call :dk_color %Blue% "%_fixmsg%" |
1746 | set showfix=1 | 3132 | set showfix=1 |
1747 | ) | 3133 | ) |
1748 | set error=1 | 3134 | set 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 | ||
1756 | set app= | 3142 | set app= |
1757 | if %_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" | 3143 | if %_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" |
1758 | if %_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" | 3144 | if %_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 | ||
1760 | if not defined app ( | 3146 | if not defined app ( |
1761 | call :dk_color %Red% "Checking Installed GVLK Activation ID [Not Found] Aborting..." | 3147 | call :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 | ||
3200 | if not exist %SystemRoot%\system32\ClipUp.exe ( | ||
3201 | call :dk_color %Red% "Checking ClipUp.exe File [Not found, aborting the process]" | ||
3202 | goto :k_final | ||
3203 | ) | ||
3204 | |||
1814 | set "tdir=%ProgramData%\Microsoft\Windows\ClipSVC\GenuineTicket" | 3205 | set "tdir=%ProgramData%\Microsoft\Windows\ClipSVC\GenuineTicket" |
1815 | if not exist "%tdir%\" md "%tdir%\" %nul% | 3206 | if 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 | ||
1825 | set "signature=C52iGEoH+1VqzI6kEAqOhUyrWuEObnivzaVjyef8WqItVYd/xGDTZZ3bkxAI9hTpobPFNJyJx6a3uriXq3HVd7mlXfSUK9ydeoUdG4eqMeLwkxeb6jQWJzLOz41rFVSMtBL0e+ycCATebTaXS4uvFYaDHDdPw2lKY8ADj3MLgsA=" | 3216 | set "signature=C52iGEoH+1VqzI6kEAqOhUyrWuEObnivzaVjyef8WqItVYd/xGDTZZ3bkxAI9hTpobPFNJyJx6a3uriXq3HVd7mlXfSUK9ydeoUdG4eqMeLwkxeb6jQWJzLOz41rFVSMtBL0e+ycCATebTaXS4uvFYaDHDdPw2lKY8ADj3MLgsA=" |
1826 | set "sessionId=TwBTAE0AYQBqAG8AcgBWAGUAcgBzAGkAbwBuAD0ANQA7AE8AUwBNAGkAbgBvAHIAVgBlAHIAcwBpAG8AbgA9ADEAOwBPAFMAUABsAGEAdABmAG8AcgBtAEkAZAA9ADIAOwBQAFAAPQAwADsARwBWAEwASwBFAHgAcAA9ADIAMAAzADgALQAwADEALQAxADkAVAAwADMAOgAxADQAOgAwADcAWgA7AEQAbwB3AG4AbABlAHYAZQBsAEcAZQBuAHUAaQBuAGUAUwB0AGEAdABlAD0AMQA7AAAA" | 3217 | set "sessionId=TwBTAE0AYQBqAG8AcgBWAGUAcgBzAGkAbwBuAD0ANQA7AE8AUwBNAGkAbgBvAHIAVgBlAHIAcwBpAG8AbgA9ADEAOwBPAFMAUABsAGEAdABmAG8AcgBtAEkAZAA9ADIAOwBQAFAAPQAwADsARwBWAEwASwBFAHgAcAA9ADIAMAAzADgALQAwADEALQAxADkAVAAwADMAOgAxADQAOgAwADcAWgA7AEQAbwB3AG4AbABlAHYAZQBsAEcAZQBuAHUAaQBuAGUAUwB0AGEAdABlAD0AMQA7AAAA" |
@@ -1829,7 +3220,7 @@ set "sessionId=TwBTAE0AYQBqAG8AcgBWAGUAcgBzAGkAbwBuAD0ANQA7AE8AUwBNAGkAbgBvAHIAV | |||
1829 | copy /y /b "%tdir%\GenuineTicket" "%tdir%\GenuineTicket.xml" %nul% | 3220 | copy /y /b "%tdir%\GenuineTicket" "%tdir%\GenuineTicket.xml" %nul% |
1830 | 3221 | ||
1831 | if not exist "%tdir%\GenuineTicket.xml" ( | 3222 | if not exist "%tdir%\GenuineTicket.xml" ( |
1832 | call :dk_color %Red% "Generating GenuineTicket.xml [Failed]" | 3223 | call :dk_color %Red% "Generating GenuineTicket.xml [Failed, aborting the process]" |
1833 | if exist "%tdir%\Genuine*" del /f /q "%tdir%\Genuine*" %nul% | 3224 | if exist "%tdir%\Genuine*" del /f /q "%tdir%\Genuine*" %nul% |
1834 | goto :k_final | 3225 | goto :k_final |
1835 | ) else ( | 3226 | ) else ( |
@@ -1844,10 +3235,10 @@ net stop sppsvc /y %nul% | |||
1844 | net stop sppsvc /y %nul% | 3235 | net stop sppsvc /y %nul% |
1845 | net stop sppsvc /y %nul% | 3236 | net stop sppsvc /y %nul% |
1846 | 3237 | ||
1847 | sc query sppsvc | find /i "1 STOPPED" %nul% && ( | 3238 | sc query sppsvc | find /i "STOPPED" %nul% && ( |
1848 | echo Stopping sppsvc Service [Successful] | 3239 | echo Stopping sppsvc Service [Successful] |
1849 | ) || ( | 3240 | ) || ( |
1850 | call :dk_color %Red% "Stopping sppsvc Service [Failed]" | 3241 | call :dk_color %Gray% "Stopping sppsvc Service [Failed]" |
1851 | ) | 3242 | ) |
1852 | 3243 | ||
1853 | %_xmlexist% ( | 3244 | %_xmlexist% ( |
@@ -1868,6 +3259,12 @@ clipup -v -o | |||
1868 | 3259 | ||
1869 | set rebuildinfo= | 3260 | set rebuildinfo= |
1870 | 3261 | ||
3262 | if not exist %ProgramData%\Microsoft\Windows\ClipSVC\tokens.dat ( | ||
3263 | set error=1 | ||
3264 | set rebuildinfo=1 | ||
3265 | call :dk_color %Red% "Checking ClipSVC tokens.dat [Not Found]" | ||
3266 | ) | ||
3267 | |||
1871 | %_xmlexist% ( | 3268 | %_xmlexist% ( |
1872 | set error=1 | 3269 | set error=1 |
1873 | set rebuildinfo=1 | 3270 | set rebuildinfo=1 |
@@ -1882,7 +3279,7 @@ call :dk_color %Red% "Checking Ticket Migration [Failed]" | |||
1882 | 3279 | ||
1883 | if defined applist if not defined showfix if defined rebuildinfo ( | 3280 | if defined applist if not defined showfix if defined rebuildinfo ( |
1884 | set showfix=1 | 3281 | set showfix=1 |
1885 | call :dk_color %Magenta% "In MAS, Goto Troubleshoot and run Fix Licensing option." | 3282 | call :dk_color %Blue% "%_fixmsg%" |
1886 | ) | 3283 | ) |
1887 | 3284 | ||
1888 | if exist "%tdir%\Genuine*" del /f /q "%tdir%\Genuine*" %nul% | 3285 | if exist "%tdir%\Genuine*" del /f /q "%tdir%\Genuine*" %nul% |
@@ -1921,8 +3318,8 @@ goto :k_final | |||
1921 | ) | 3318 | ) |
1922 | 3319 | ||
1923 | call :dk_color %Red% "Activation Failed" | 3320 | call :dk_color %Red% "Activation Failed" |
1924 | if not defined error call :dk_color %Magenta% "In MAS, Goto Troubleshoot and run Fix Licensing option." | 3321 | if not defined error call :dk_color %Blue% "%_fixmsg%" |
1925 | call :dk_color2 %Magenta% "Check this page for help" %_Yellow% " https://massgrave.dev/troubleshoot" | 3322 | call :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%" && ( |
1950 | call :dk_color %Magenta% "Protect KMS38 By KMS [Successful] [Locked A Registry Key]" | 3347 | call :dk_color %Blue% "Protect KMS38 From KMS [Successful] [Locked A Registry Key]" |
1951 | ) || ( | 3348 | ) || ( |
1952 | call :dk_color %Red% "Protect KMS38 By KMS [Failed To Lock A Registry Key]" | 3349 | call :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 | ||
2035 | set xpr= | 3432 | set xpr= |
2036 | for /f "tokens=* delims=" %%# in ('%psc% "$([DateTime]::Now.addMinutes(%gpr%)).ToString('yyyy-MM-dd HH:mm:ss')" 2^>nul') do set "xpr=%%#" | 3433 | for /f "tokens=* delims=" %%# in ('%psc% "$([DateTime]::Now.addMinutes(%gpr%)).ToString('yyyy-MM-dd HH:mm:ss')" %nul6%') do set "xpr=%%#" |
2037 | call :dk_color %Green% "%winos% is activated till !xpr!" | 3434 | call :dk_color %Green% "%winos% is activated till !xpr!" |
2038 | exit /b | 3435 | exit /b |
2039 | 3436 | ||
@@ -2042,8 +3439,8 @@ exit /b | |||
2042 | :k_checkexp | 3439 | :k_checkexp |
2043 | 3440 | ||
2044 | set gpr=0 | 3441 | set gpr=0 |
2045 | if %_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=%%#" | 3442 | if %_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=%%#" |
2046 | if %_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=%%#" | 3443 | if %_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=%%#" |
2047 | if %gpr% GTR 259200 (set _k38=1) else (set _k38=) | 3444 | if %gpr% GTR 259200 (set _k38=1) else (set _k38=) |
2048 | exit /b | 3445 | exit /b |
2049 | 3446 | ||
@@ -2051,8 +3448,8 @@ exit /b | |||
2051 | 3448 | ||
2052 | :dk_channel | 3449 | :dk_channel |
2053 | 3450 | ||
2054 | if %_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=%%#" | 3451 | if %_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=%%#" |
2055 | if %_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=%%#" | 3452 | if %_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=%%#" |
2056 | exit /b | 3453 | exit /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 | |||
2134 | 43d9af6e-5e86-4be8-a797-d072a046896c_K9F%f%YF-G6%f%NCK-73M%f%32-XM%f%VPY-F9%f%DRR_120_ServerARM64_RS4 | 3531 | 43d9af6e-5e86-4be8-a797-d072a046896c_K9F%f%YF-G6%f%NCK-73M%f%32-XM%f%VPY-F9%f%DRR_120_ServerARM64_RS4 |
2135 | e0c42288-980c-4788-a014-c080d2e1926e_NW6%f%C2-QM%f%PVW-D7K%f%KK-3G%f%KT6-VC%f%FB2_121_Education | 3532 | e0c42288-980c-4788-a014-c080d2e1926e_NW6%f%C2-QM%f%PVW-D7K%f%KK-3G%f%KT6-VC%f%FB2_121_Education |
2136 | 3c102355-d027-42c6-ad23-2e7ef8a02585_2WH%f%4N-8Q%f%GBV-H22%f%JP-CT%f%43Q-MD%f%WWJ_122_EducationN | 3533 | 3c102355-d027-42c6-ad23-2e7ef8a02585_2WH%f%4N-8Q%f%GBV-H22%f%JP-CT%f%43Q-MD%f%WWJ_122_EducationN |
2137 | 32d2fab3-e4a8-42c2-923b-4bf4fd13e6ee_M7X%f%TQ-FN%f%8P6-TTK%f%YV-9D%f%4CC-J4%f%62D_125_EnterpriseS_RS5,VB | 3534 | 32d2fab3-e4a8-42c2-923b-4bf4fd13e6ee_M7X%f%TQ-FN%f%8P6-TTK%f%YV-9D%f%4CC-J4%f%62D_125_EnterpriseS_RS5,VB,Ge |
2138 | 2d5a5a60-3040-48bf-beb0-fcd770c20ce0_DCP%f%HK-NF%f%MTC-H88%f%MJ-PF%f%HPY-QJ%f%4BJ_125_EnterpriseS_RS1 | 3535 | 2d5a5a60-3040-48bf-beb0-fcd770c20ce0_DCP%f%HK-NF%f%MTC-H88%f%MJ-PF%f%HPY-QJ%f%4BJ_125_EnterpriseS_RS1 |
2139 | 7b51a46c-0c04-4e8f-9af4-8496cca90d5e_WNM%f%TR-4C%f%88C-JK8%f%YV-HQ%f%7T2-76%f%DF9_125_EnterpriseS_TH1 | 3536 | 7b51a46c-0c04-4e8f-9af4-8496cca90d5e_WNM%f%TR-4C%f%88C-JK8%f%YV-HQ%f%7T2-76%f%DF9_125_EnterpriseS_TH1 |
2140 | 7103a333-b8c8-49cc-93ce-d37c09687f92_92N%f%FX-8D%f%JQP-P6B%f%BQ-TH%f%F9C-7C%f%G2H_126_EnterpriseSN_RS5,VB | 3537 | 7103a333-b8c8-49cc-93ce-d37c09687f92_92N%f%FX-8D%f%JQP-P6B%f%BQ-TH%f%F9C-7C%f%G2H_126_EnterpriseSN_RS5,VB,Ge |
2141 | 9f776d83-7156-45b2-8a5c-359b9c9f22a3_QFF%f%DN-GR%f%T3P-VKW%f%WX-X7%f%T3R-8B%f%639_126_EnterpriseSN_RS1 | 3538 | 9f776d83-7156-45b2-8a5c-359b9c9f22a3_QFF%f%DN-GR%f%T3P-VKW%f%WX-X7%f%T3R-8B%f%639_126_EnterpriseSN_RS1 |
2142 | 87b838b7-41b6-4590-8318-5797951d8529_2F7%f%7B-TN%f%FGY-69Q%f%QF-B8%f%YKP-D6%f%9TJ_126_EnterpriseSN_TH1 | 3539 | 87b838b7-41b6-4590-8318-5797951d8529_2F7%f%7B-TN%f%FGY-69Q%f%QF-B8%f%YKP-D6%f%9TJ_126_EnterpriseSN_TH1 |
2143 | 39e69c41-42b4-4a0a-abad-8e3c10a797cc_QFN%f%D9-D3%f%Y9C-J3K%f%KY-6R%f%PVP-2D%f%PYV_145_ServerDatacenterACor_FE | 3540 | 39e69c41-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 | |||
2158 | ec868e65-fadf-4759-b23e-93fe37f2cc29_CPW%f%HC-NT%f%2C7-VYW%f%78-DH%f%DB2-PG%f%3GK_175_ServerRdsh_RS5 | 3555 | ec868e65-fadf-4759-b23e-93fe37f2cc29_CPW%f%HC-NT%f%2C7-VYW%f%78-DH%f%DB2-PG%f%3GK_175_ServerRdsh_RS5 |
2159 | e4db50ea-bda1-4566-b047-0ca50abc6f07_7NB%f%T4-WG%f%BQX-MP4%f%H7-QX%f%FF8-YP%f%3KX_175_ServerRdsh_RS3 | 3556 | e4db50ea-bda1-4566-b047-0ca50abc6f07_7NB%f%T4-WG%f%BQX-MP4%f%H7-QX%f%FF8-YP%f%3KX_175_ServerRdsh_RS3 |
2160 | 0df4f814-3f57-4b8b-9a9d-fddadcd69fac_NBT%f%WJ-3D%f%R69-3C4%f%V8-C2%f%6MC-GQ%f%9M6_183_CloudE | 3557 | 0df4f814-3f57-4b8b-9a9d-fddadcd69fac_NBT%f%WJ-3D%f%R69-3C4%f%V8-C2%f%6MC-GQ%f%9M6_183_CloudE |
2161 | 59eb965c-9150-42b7-a0ec-22151b9897c5_KBN%f%8V-HF%f%GQ4-MGX%f%VD-34%f%7P6-PD%f%QGT_191_IoTEnterpriseS_NI | 3558 | 59eb965c-9150-42b7-a0ec-22151b9897c5_KBN%f%8V-HF%f%GQ4-MGX%f%VD-34%f%7P6-PD%f%QGT_191_IoTEnterpriseS_VB,NI |
2162 | d30136fc-cb4b-416e-a23d-87207abc44a9_6XN%f%7V-PC%f%BDC-BDB%f%RH-8D%f%QY7-G6%f%R44_202_CloudEditionN | 3559 | d30136fc-cb4b-416e-a23d-87207abc44a9_6XN%f%7V-PC%f%BDC-BDB%f%RH-8D%f%QY7-G6%f%R44_202_CloudEditionN |
2163 | ca7df2e3-5ea0-47b8-9ac1-b1be4d8edd69_37D%f%7F-N4%f%9CB-WQR%f%8W-TB%f%J73-FM%f%8RX_203_CloudEdition | 3560 | ca7df2e3-5ea0-47b8-9ac1-b1be4d8edd69_37D%f%7F-N4%f%9CB-WQR%f%8W-TB%f%J73-FM%f%8RX_203_CloudEdition |
2164 | 19b5e0fb-4431-46bc-bac1-2f1873e4ae73_NTB%f%V8-9K%f%7Q8-V27%f%C6-M2%f%BTV-KH%f%MXV_407_ServerTurbine | 3561 | 19b5e0fb-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 ( |
2166 | for /f "tokens=1-5 delims=_" %%A in ("%%#") do if %osSKU%==%%C ( | 3563 | for /f "tokens=1-5 delims=_" %%A in ("%%#") do if %osSKU%==%%C ( |
2167 | if %1==getkey if not defined key echo "!applist!" | find /i "%%A" >nul && set key=%%B | 3564 | if %1==getkey if not defined key echo "!applist!" | find /i "%%A" %nul1% && set key=%%B |
2168 | ) | 3565 | ) |
2169 | ) | 3566 | ) |
2170 | exit /b | 3567 | exit /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= | |||
2189 | if %_NoEditionChange%==1 exit /b | 3585 | if %_NoEditionChange%==1 exit /b |
2190 | 3586 | ||
2191 | for %%# in ( | 3587 | for %%# in ( |
2192 | 188_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 | 3588 | 188_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 |
2193 | 191_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 | 3589 | 191_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 |
2194 | 205_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 | 3590 | 205_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 |
2195 | 138_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 | 3591 | 138_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 |
3592 | 139_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 | ||
3593 | 139_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 ( |
2197 | for /f "tokens=1-6 delims=_" %%A in ("%%#") do if %osSKU%==%%A ( | 3595 | for /f "tokens=1-6 delims=_" %%A in ("%%#") do if %osSKU%==%%A ( |
2198 | echo "!applist!" | find /i "%%C" 1>nul && ( | 3596 | echo "!applist!" | find /i "%%C" %nul1% && ( |
2199 | echo "!applist!" | find /i "%%D" 1>nul && ( | 3597 | echo "!applist!" | find /i "%%D" %nul1% && ( |
2200 | set altkey=%%E | 3598 | set altkey=%%E |
2201 | set curedition=%%B | ||
2202 | set altedition=%%F | 3599 | set altedition=%%F |
2203 | ) || ( | 3600 | ) || ( |
2204 | set altedition=%%F | 3601 | set altedition=%%F |
@@ -2242,8 +3639,7 @@ set _unattendedact= | |||
2242 | set _args=%* | 3639 | set _args=%* |
2243 | if defined _args set _args=%_args:"=% | 3640 | if defined _args set _args=%_args:"=% |
2244 | if defined _args ( | 3641 | if defined _args ( |
2245 | set _unattended=1 | 3642 | echo "%_args%" | find /i "/KMS" >nul && set _unattended=1 |
2246 | if "%_args%"=="-el" set _unattended= | ||
2247 | 3643 | ||
2248 | for %%A in (%_args%) do ( | 3644 | for %%A in (%_args%) do ( |
2249 | if /i "%%A"=="-el" (set _elev=1 | 3645 | if /i "%%A"=="-el" (set _elev=1 |
@@ -2262,9 +3658,9 @@ if /i "%%A"=="-el" (set _elev=1 | |||
2262 | 3658 | ||
2263 | ::======================================================================================================================================== | 3659 | ::======================================================================================================================================== |
2264 | 3660 | ||
2265 | set winbuild=1 | ||
2266 | set "nul=>nul 2>&1" | 3661 | set "nul=>nul 2>&1" |
2267 | set psc=powershell.exe | 3662 | set psc=powershell.exe |
3663 | set winbuild=1 | ||
2268 | for /f "tokens=6 delims=[]. " %%G in ('ver') do set winbuild=%%G | 3664 | for /f "tokens=6 delims=[]. " %%G in ('ver') do set winbuild=%%G |
2269 | 3665 | ||
2270 | set _NCS=1 | 3666 | set _NCS=1 |
@@ -2358,7 +3754,7 @@ reg query %kNext% /v MigrationToV5Done 2>nul | find /i "0x1" %nul% && call :offi | |||
2358 | 3754 | ||
2359 | set _tskinstalled= | 3755 | set _tskinstalled= |
2360 | reg query "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Schedule\taskcache\tasks" /f Path /s | find /i "\Activation-Renewal" >nul && ( | 3756 | reg query "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Schedule\taskcache\tasks" /f Path /s | find /i "\Activation-Renewal" >nul && ( |
2361 | find /i "Ver:1.8" %ProgramData%\Activation-Renewal\Activation_task.cmd %nul% && set _tskinstalled=1 | 3757 | find /i "Ver:1.9" "%ProgramFiles%\Activation-Renewal\Activation_task.cmd" %nul% && set _tskinstalled=1 |
2362 | ) | 3758 | ) |
2363 | 3759 | ||
2364 | set _oldtsk= | 3760 | set _oldtsk= |
@@ -2488,7 +3884,12 @@ set "_log=%~dpn0" | |||
2488 | set "_work=%~dp0" | 3884 | set "_work=%~dp0" |
2489 | if "%_work:~-1%"=="\" set "_work=%_work:~0,-1%" | 3885 | if "%_work:~-1%"=="\" set "_work=%_work:~0,-1%" |
2490 | set _UNC=0 | 3886 | set _UNC=0 |
2491 | if "%_work:~0,2%"=="\\" set _UNC=1 | 3887 | if "%_work:~0,2%"=="\\" ( |
3888 | set _UNC=1 | ||
3889 | ) else ( | ||
3890 | net use %~d0 %_Null% | ||
3891 | if not errorlevel 1 set _UNC=1 | ||
3892 | ) | ||
2492 | for /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" | 3893 | for /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" |
2493 | if exist "%PUBLIC%\Desktop\desktop.ini" set "_dsk=%PUBLIC%\Desktop" | 3894 | if exist "%PUBLIC%\Desktop\desktop.ini" set "_dsk=%PUBLIC%\Desktop" |
2494 | set "_mO21a=Detected Office 2021 C2R Retail is activated" | 3895 | set "_mO21a=Detected Office 2021 C2R Retail is activated" |
@@ -2513,6 +3914,8 @@ if exist "%SystemRoot%\Servicing\Packages\Microsoft-Windows-Server*Edition~*.mum | |||
2513 | set "ESUEditions=ServerDatacenter,ServerDatacenterCore,ServerDatacenterV,ServerDatacenterVCore,ServerStandard,ServerStandardCore,ServerStandardV,ServerStandardVCore,ServerEnterprise,ServerEnterpriseCore,ServerEnterpriseV,ServerEnterpriseVCore" | 3914 | set "ESUEditions=ServerDatacenter,ServerDatacenterCore,ServerDatacenterV,ServerDatacenterVCore,ServerStandard,ServerStandardCore,ServerStandardV,ServerStandardVCore,ServerEnterprise,ServerEnterpriseCore,ServerEnterpriseV,ServerEnterpriseVCore" |
2514 | ) | 3915 | ) |
2515 | for /f "tokens=6 delims=[]. " %%G in ('ver') do set winbuild=%%G | 3916 | for /f "tokens=6 delims=[]. " %%G in ('ver') do set winbuild=%%G |
3917 | set UBR=0 | ||
3918 | if %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 | ||
2516 | set "_csq=cscript.exe //NoLogo //Job:WmiQuery "%~nx0?.wsf"" | 3919 | set "_csq=cscript.exe //NoLogo //Job:WmiQuery "%~nx0?.wsf"" |
2517 | set "_csm=cscript.exe //NoLogo //Job:WmiMethod "%~nx0?.wsf"" | 3920 | set "_csm=cscript.exe //NoLogo //Job:WmiMethod "%~nx0?.wsf"" |
2518 | set "_csp=cscript.exe //NoLogo //Job:WmiPKey "%~nx0?.wsf"" | 3921 | set "_csp=cscript.exe //NoLogo //Job:WmiPKey "%~nx0?.wsf"" |
@@ -2543,7 +3946,7 @@ pushd "!_work!" | |||
2543 | 3946 | ||
2544 | if not defined _unattended ( | 3947 | if not defined _unattended ( |
2545 | mode con cols=98 lines=31 | 3948 | mode con cols=98 lines=31 |
2546 | %nul% %psc% "&%_buf%" | 3949 | %psc% "&%_buf%" |
2547 | title %_title% | 3950 | title %_title% |
2548 | ) else ( | 3951 | ) else ( |
2549 | title Online KMS Activation | 3952 | title Online KMS Activation |
@@ -2714,7 +4117,10 @@ IF %winbuild% LSS 14393 ( | |||
2714 | ) | 4117 | ) |
2715 | IF NOT "%EditionWMI%"=="" SET "EditionID=%EditionWMI%" | 4118 | IF NOT "%EditionWMI%"=="" SET "EditionID=%EditionWMI%" |
2716 | IF /I "%EditionID%"=="IoTEnterprise" SET "EditionID=Enterprise" | 4119 | IF /I "%EditionID%"=="IoTEnterprise" SET "EditionID=Enterprise" |
2717 | IF /I "%EditionID%"=="IoTEnterpriseS" IF %winbuild% LSS 22610 SET "EditionID=EnterpriseS" | 4120 | IF /I "%EditionID%"=="IoTEnterpriseS" IF %winbuild% LSS 22610 ( |
4121 | SET "EditionID=EnterpriseS" | ||
4122 | IF %winbuild% GEQ 19041 IF %UBR% GEQ 2788 SET "EditionID=IoTEnterpriseS" | ||
4123 | ) | ||
2718 | IF /I "%EditionID%"=="ProfessionalSingleLanguage" SET "EditionID=Professional" | 4124 | IF /I "%EditionID%"=="ProfessionalSingleLanguage" SET "EditionID=Professional" |
2719 | IF /I "%EditionID%"=="ProfessionalCountrySpecific" SET "EditionID=Professional" | 4125 | IF /I "%EditionID%"=="ProfessionalCountrySpecific" SET "EditionID=Professional" |
2720 | IF /I "%EditionID%"=="EnterpriseG" SET Win10Gov=1 | 4126 | IF /I "%EditionID%"=="EnterpriseG" SET Win10Gov=1 |
@@ -4326,6 +5732,7 @@ if %_C16Msg% EQU 1 set _CtRMsg=1 | |||
4326 | if %_C15Msg% EQU 1 set _CtRMsg=1 | 5732 | if %_C15Msg% EQU 1 set _CtRMsg=1 |
4327 | if %_Office16% EQU 1 ( | 5733 | if %_Office16% EQU 1 ( |
4328 | for %%a in (%_RetIds%,ProPlus) do set "_%%a=" | 5734 | for %%a in (%_RetIds%,ProPlus) do set "_%%a=" |
5735 | for %%A in (19,21) do call :officeLoc %%A | ||
4329 | ) | 5736 | ) |
4330 | if %_Office15% EQU 1 ( | 5737 | if %_Office15% EQU 1 ( |
4331 | for %%a in (%_R15Ids%,ProPlus) do set "_%%a=" | 5738 | for %%a in (%_R15Ids%,ProPlus) do set "_%%a=" |
@@ -5155,7 +6562,7 @@ call :Clear-KMS-Cache | |||
5155 | 6562 | ||
5156 | if not [%Act_OK%]==[1] ( | 6563 | if not [%Act_OK%]==[1] ( |
5157 | echo. | 6564 | echo. |
5158 | echo In case of any issues, check https://massgrave.dev/troubleshoot | 6565 | echo In case of any issues, check https://mass%-%grave.dev/troubleshoot |
5159 | ) | 6566 | ) |
5160 | 6567 | ||
5161 | if defined _unattended exit /b | 6568 | if defined _unattended exit /b |
@@ -5420,6 +6827,11 @@ echo Deleting [Folder] %ProgramData%\Activation-Renewal\ | |||
5420 | rmdir /s /q "%ProgramData%\Activation-Renewal\" %nul% | 6827 | rmdir /s /q "%ProgramData%\Activation-Renewal\" %nul% |
5421 | ) | 6828 | ) |
5422 | 6829 | ||
6830 | If exist "%ProgramFiles%\Activation-Renewal\" ( | ||
6831 | echo Deleting [Folder] %ProgramFiles%\Activation-Renewal\ | ||
6832 | rmdir /s /q "%ProgramFiles%\Activation-Renewal\" %nul% | ||
6833 | ) | ||
6834 | |||
5423 | reg query "HKCR\DesktopBackground\shell\Activate Windows - Office" %nul% && ( | 6835 | reg query "HKCR\DesktopBackground\shell\Activate Windows - Office" %nul% && ( |
5424 | echo Deleting [Registry] HKCR\DesktopBackground\shell\Activate Windows - Office | 6836 | echo Deleting [Registry] HKCR\DesktopBackground\shell\Activate Windows - Office |
5425 | Reg delete "HKCR\DesktopBackground\shell\Activate Windows - Office" /f %nul% | 6837 | Reg 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 | ||
5428 | reg query "%key%" /f Path /s | find /i "\Activation-Renewal" >nul && (set error_=1) | 6840 | reg query "%key%" /f Path /s | find /i "\Activation-Renewal" >nul && (set error_=1) |
5429 | reg query "%key%" /f Path /s | find /i "\Activation-Run_Once" >nul && (set error_=1) | 6841 | reg query "%key%" /f Path /s | find /i "\Activation-Run_Once" >nul && (set error_=1) |
5430 | reg query "%key%" /f Path /s | find /i "\Online_KMS_Activation_Script-Run_Once" >nul && (set error_=1) | 6842 | reg query "%key%" /f Path /s | find /i "\Online_KMS_Activation_Script" >nul && (set error_=1) |
5431 | reg query "%key%" /f Path /s | find /i "\Online_KMS_Activation_Script-Run_Once" >nul && (set error_=1) | ||
5432 | If exist "%windir%\Online_KMS_Activation_Script\" (set error_=1) | 6843 | If exist "%windir%\Online_KMS_Activation_Script\" (set error_=1) |
5433 | reg query "HKCR\DesktopBackground\shell\Activate Windows - Office" %nul% && (set error_=1) | 6844 | reg query "HKCR\DesktopBackground\shell\Activate Windows - Office" %nul% && (set error_=1) |
5434 | if exist "%ProgramData%\Online_KMS_Activation.cmd" (set error_=1) | 6845 | if exist "%ProgramData%\Online_KMS_Activation.cmd" (set error_=1) |
5435 | if exist "%ProgramData%\Online_KMS_Activation\" (set error_=1) | 6846 | if exist "%ProgramData%\Online_KMS_Activation\" (set error_=1) |
5436 | if exist "%ProgramData%\Activation-Renewal\" (set error_=1) | 6847 | if exist "%ProgramData%\Activation-Renewal\" (set error_=1) |
6848 | if exist "%ProgramFiles%\Activation-Renewal\" (set error_=1) | ||
5437 | exit /b | 6849 | exit /b |
5438 | 6850 | ||
5439 | :========================================================================================================================================= | 6851 | :========================================================================================================================================= |
@@ -5445,7 +6857,7 @@ mode con cols=91 lines=30 | |||
5445 | title Install Activation Auto-Renewal | 6857 | title Install Activation Auto-Renewal |
5446 | 6858 | ||
5447 | set error_= | 6859 | set error_= |
5448 | set "_dest=%ProgramData%\Activation-Renewal" | 6860 | set "_dest=%ProgramFiles%\Activation-Renewal" |
5449 | set "key=HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Schedule\taskcache\tasks" | 6861 | set "key=HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Schedule\taskcache\tasks" |
5450 | 6862 | ||
5451 | call :clearstuff %nul% | 6863 | call :clearstuff %nul% |
@@ -5458,7 +6870,7 @@ goto :RenDone | |||
5458 | ) | 6870 | ) |
5459 | 6871 | ||
5460 | if not exist "%_dest%\" md "%_dest%\" %nul% | 6872 | if not exist "%_dest%\" md "%_dest%\" %nul% |
5461 | set "_temp=%SystemRoot%\Temp\_taskwork" | 6873 | set "_temp=%SystemRoot%\Temp\_taskwork_%Random%" |
5462 | 6874 | ||
5463 | set nil= | 6875 | set nil= |
5464 | if exist "%_temp%\.*" rmdir /s /q "%_temp%\" %nul% | 6876 | if 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 | |||
5470 | if exist "%_temp%\.*" rmdir /s /q "%_temp%\" %nul% | 6882 | if exist "%_temp%\.*" rmdir /s /q "%_temp%\" %nul% |
5471 | 6883 | ||
5472 | call :createInfo.txt | 6884 | call :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);" |
5474 | title Install Activation Auto-Renewal | 6886 | title Install Activation Auto-Renewal |
5475 | 6887 | ||
5476 | ::======================================================================================================================================== | 6888 | ::======================================================================================================================================== |
@@ -5551,9 +6963,9 @@ echo Activation-Run_Once [Activation Task - deletes itself once activated] | |||
5551 | echo The scheduled tasks runs only if the system is connected to the Internet. | 6963 | echo The scheduled tasks runs only if the system is connected to the Internet. |
5552 | echo: | 6964 | echo: |
5553 | echo - Files | 6965 | echo - Files |
5554 | echo C:\ProgramData\Activation-Renewal\Activation_task.cmd | 6966 | echo C:\Program Files\Activation-Renewal\Activation_task.cmd |
5555 | echo C:\ProgramData\Activation-Renewal\Info.txt | 6967 | echo C:\Program Files\Activation-Renewal\Info.txt |
5556 | echo C:\ProgramData\Activation-Renewal\Logs.txt | 6968 | echo C:\Program Files\Activation-Renewal\Logs.txt |
5557 | echo ______________________________________________________________________________________________ | 6969 | echo ______________________________________________________________________________________________ |
5558 | echo: | 6970 | echo: |
5559 | echo Online KMS Activation Script is a part of 'Microsoft_Activation_Scripts' [MAS] project. | 6971 | echo 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);" |
5696 | exit /b | 7108 | exit /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 | ||
5755 | setlocal EnableDelayedExpansion | 7167 | setlocal EnableDelayedExpansion |
5756 | if exist "%ProgramData%\Activation-Renewal\" call :_taskstart>>"%ProgramData%\Activation-Renewal\Logs.txt" & exit | 7168 | if 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 | |||
6153 | goto :_taskgetserv | 7565 | goto :_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 |
6307 | mode con cols=100 lines=32 | 7719 | mode 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;}" | 7720 | 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;}" |
6309 | color 07 | 7721 | color 07 |
6310 | title Check Activation Status [vbs] | 7722 | title Check Activation Status [vbs] |
6311 | set "SysPath=%SystemRoot%\System32" | 7723 | set "SysPath=%SystemRoot%\System32" |
@@ -6504,7 +7916,7 @@ exit /b | |||
6504 | @setlocal DisableDelayedExpansion | 7916 | @setlocal DisableDelayedExpansion |
6505 | @echo off | 7917 | @echo off |
6506 | mode con cols=100 lines=32 | 7918 | mode 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;}" | 7919 | 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;}" |
6508 | color 07 | 7920 | color 07 |
6509 | title Check Activation Status [wmi] | 7921 | title Check Activation Status [wmi] |
6510 | 7922 | ||
@@ -7012,21 +8424,32 @@ cls | |||
7012 | color 07 | 8424 | color 07 |
7013 | title Troubleshoot | 8425 | title Troubleshoot |
7014 | 8426 | ||
8427 | set _args= | ||
7015 | set _elev= | 8428 | set _elev= |
7016 | if /i "%~1"=="-el" set _elev=1 | ||
7017 | 8429 | ||
7018 | set winbuild=1 | 8430 | set _args=%* |
8431 | if defined _args set _args=%_args:"=% | ||
8432 | if defined _args ( | ||
8433 | for %%A in (%_args%) do ( | ||
8434 | if /i "%%A"=="-el" set _elev=1 | ||
8435 | ) | ||
8436 | ) | ||
8437 | |||
8438 | set "nul1=1>nul" | ||
8439 | set "nul2=2>nul" | ||
8440 | set "nul6=2^>nul" | ||
7019 | set "nul=>nul 2>&1" | 8441 | set "nul=>nul 2>&1" |
8442 | |||
7020 | set psc=powershell.exe | 8443 | set psc=powershell.exe |
8444 | set winbuild=1 | ||
7021 | for /f "tokens=6 delims=[]. " %%G in ('ver') do set winbuild=%%G | 8445 | for /f "tokens=6 delims=[]. " %%G in ('ver') do set winbuild=%%G |
7022 | 8446 | ||
7023 | set _NCS=1 | 8447 | set _NCS=1 |
7024 | if %winbuild% LSS 10586 set _NCS=0 | 8448 | if %winbuild% LSS 10586 set _NCS=0 |
7025 | if %winbuild% GEQ 10586 reg query "HKCU\Console" /v ForceV2 2>nul | find /i "0x0" 1>nul && (set _NCS=0) | 8449 | if %winbuild% GEQ 10586 reg query "HKCU\Console" /v ForceV2 %nul2% | find /i "0x0" %nul1% && (set _NCS=0) |
7026 | 8450 | ||
7027 | call :_colorprep | 8451 | call :_colorprep |
7028 | 8452 | ||
7029 | set cbs_log=%SystemRoot%\logs\cbs\cbs.log | ||
7030 | set "nceline=echo: &echo ==== ERROR ==== &echo:" | 8453 | set "nceline=echo: &echo ==== ERROR ==== &echo:" |
7031 | set "eline=echo: &call :_color %Red% "==== ERROR ====" &echo:" | 8454 | set "eline=echo: &call :_color %Red% "==== ERROR ====" &echo:" |
7032 | set "line=_________________________________________________________________________________________________" | 8455 | set "line=_________________________________________________________________________________________________" |
@@ -7094,12 +8517,12 @@ choice /C:1234560 /N | |||
7094 | set _erl=%errorlevel% | 8517 | set _erl=%errorlevel% |
7095 | 8518 | ||
7096 | if %_erl%==7 exit /b | 8519 | if %_erl%==7 exit /b |
7097 | if %_erl%==6 start https://massgrave.dev/fix-wpa-registry.html &goto at_menu | 8520 | if %_erl%==6 start https://%mas%/fix-wpa-registry.html &goto at_menu |
7098 | if %_erl%==5 goto:retokens | 8521 | if %_erl%==5 goto:retokens |
7099 | if %_erl%==4 goto:fixwmi | 8522 | if %_erl%==4 goto:fixwmi |
7100 | if %_erl%==3 goto:sfcscan | 8523 | if %_erl%==3 goto:sfcscan |
7101 | if %_erl%==2 goto:dism_rest | 8524 | if %_erl%==2 goto:dism_rest |
7102 | if %_erl%==1 start https://massgrave.dev/troubleshoot.html &goto at_menu | 8525 | if %_erl%==1 start https://%mas%/troubleshoot.html &goto at_menu |
7103 | goto :at_menu | 8526 | goto :at_menu |
7104 | 8527 | ||
7105 | ::======================================================================================================================================== | 8528 | ::======================================================================================================================================== |
@@ -7147,23 +8570,29 @@ if %errorlevel%==1 goto at_menu | |||
7147 | 8570 | ||
7148 | cls | 8571 | cls |
7149 | mode 110, 30 | 8572 | mode 110, 30 |
7150 | echo: | ||
7151 | |||
7152 | call :_stopservice TrustedInstaller | 8573 | call :_stopservice TrustedInstaller |
7153 | del /s /f /q "%SystemRoot%\logs\cbs\*.*" | ||
7154 | 8574 | ||
7155 | set _time= | 8575 | set _time= |
7156 | for /f %%a in ('%psc% "Get-Date -format HH_mm_ss"') do set _time=%%a | 8576 | for /f %%a in ('%psc% "Get-Date -format HH_mm_ss"') do set _time=%%a |
7157 | echo: | 8577 | echo: |
7158 | echo Applying the command, | 8578 | echo Applying the command, |
7159 | echo dism /english /online /cleanup-image /restorehealth | 8579 | echo dism /english /online /cleanup-image /restorehealth |
7160 | echo: | 8580 | dism /english /online /cleanup-image /restorehealth |
7161 | dism /english /online /cleanup-image /restorehealth /Logpath:"%SystemRoot%\Temp\RHealth_DISM_%_time%.txt" /loglevel:4 | 8581 | |
8582 | call :_stopservice TrustedInstaller | ||
7162 | 8583 | ||
7163 | if not exist "!desktop!\AT_Logs\" md "!desktop!\AT_Logs\" %nul% | 8584 | if not exist "!desktop!\AT_Logs\" md "!desktop!\AT_Logs\" %nul% |
7164 | copy /y /b "%SystemRoot%\Temp\RHealth_DISM_%_time%.txt" "!desktop!\AT_Logs\RHealth_DISM_%_time%.txt" %nul% | 8585 | |
7165 | copy /y /b "%cbs_log%" "!desktop!\AT_Logs\RHealth_CBS_%_time%.txt" %nul% | 8586 | call :compresslog cbs\CBS.log RHealth_CBS %nul% |
7166 | del /f /q "%SystemRoot%\Temp\RHealth_DISM_%_time%.txt" %nul% | 8587 | call :compresslog DISM\dism.log RHealth_DISM %nul% |
8588 | |||
8589 | if not exist "!desktop!\AT_Logs\RHealth_CBS_%_time%.cab" ( | ||
8590 | copy /y /b "%SystemRoot%\logs\cbs\cbs.log" "!desktop!\AT_Logs\RHealth_CBS_%_time%.log" %nul% | ||
8591 | ) | ||
8592 | |||
8593 | if not exist "!desktop!\AT_Logs\RHealth_DISM_%_time%.cab" ( | ||
8594 | copy /y /b "%SystemRoot%\logs\DISM\dism.log" "!desktop!\AT_Logs\RHealth_DISM_%_time%.log" %nul% | ||
8595 | ) | ||
7167 | 8596 | ||
7168 | echo: | 8597 | echo: |
7169 | call :_color %Gray% "CBS and DISM logs are copied to the AT_Logs folder on the dekstop." | 8598 | call :_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 : " | |||
7193 | if %errorlevel%==1 goto at_menu | 8622 | if %errorlevel%==1 goto at_menu |
7194 | 8623 | ||
7195 | cls | 8624 | cls |
7196 | echo: | ||
7197 | |||
7198 | call :_stopservice TrustedInstaller | 8625 | call :_stopservice TrustedInstaller |
7199 | del /s /f /q "%SystemRoot%\logs\cbs\*.*" | ||
7200 | 8626 | ||
7201 | set _time= | 8627 | set _time= |
7202 | for /f %%a in ('%psc% "Get-Date -format HH_mm_ss"') do set _time=%%a | 8628 | for /f %%a in ('%psc% "Get-Date -format HH_mm_ss"') do set _time=%%a |
7203 | echo: | 8629 | echo: |
7204 | echo Applying the command, | 8630 | echo Applying the command, |
7205 | echo sfc /scannow | 8631 | echo sfc /scannow |
7206 | echo: | ||
7207 | sfc /scannow | 8632 | sfc /scannow |
7208 | 8633 | ||
8634 | call :_stopservice TrustedInstaller | ||
8635 | |||
7209 | if not exist "!desktop!\AT_Logs\" md "!desktop!\AT_Logs\" %nul% | 8636 | if not exist "!desktop!\AT_Logs\" md "!desktop!\AT_Logs\" %nul% |
7210 | 8637 | ||
7211 | copy /y /b "%cbs_log%" "!desktop!\AT_Logs\SFC_CBS_%_time%.txt" %nul% | 8638 | call :compresslog cbs\CBS.log SFC_CBS %nul% |
8639 | |||
8640 | if not exist "!desktop!\AT_Logs\SFC_CBS_%_time%.cab" ( | ||
8641 | copy /y /b "%SystemRoot%\logs\cbs\cbs.log" "!desktop!\AT_Logs\SFC_CBS_%_time%.log" %nul% | ||
8642 | ) | ||
7212 | 8643 | ||
7213 | echo: | 8644 | echo: |
7214 | call :_color %Gray% "CBS log is copied to the AT_Logs folder on the dekstop." | 8645 | call :_color %Gray% "CBS log is copied to the AT_Logs folder on the dekstop." |
@@ -7220,7 +8651,7 @@ goto :at_back | |||
7220 | 8651 | ||
7221 | cls | 8652 | cls |
7222 | mode con cols=115 lines=32 | 8653 | mode 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;}" |
7224 | title Fix Licensing ^(ClipSVC ^+ Office vNext ^+ SPP ^+ OSPP^) | 8655 | title Fix Licensing ^(ClipSVC ^+ Office vNext ^+ SPP ^+ OSPP^) |
7225 | 8656 | ||
7226 | echo: | 8657 | echo: |
@@ -7253,7 +8684,7 @@ cls | |||
7253 | echo: | 8684 | echo: |
7254 | echo %line% | 8685 | echo %line% |
7255 | echo: | 8686 | echo: |
7256 | call :_color %Magenta% "Rebuilding ClipSVC Licences" | 8687 | call :_color %Blue% "Rebuilding ClipSVC Licences" |
7257 | echo: | 8688 | echo: |
7258 | 8689 | ||
7259 | if %winbuild% LSS 10240 ( | 8690 | if %winbuild% LSS 10240 ( |
@@ -7262,7 +8693,7 @@ echo Skipping... | |||
7262 | goto :cleanvnext | 8693 | goto :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% && ( |
7266 | echo Windows is permanently activated. | 8697 | echo Windows is permanently activated. |
7267 | echo Skipping rebuilding ClipSVC licences... | 8698 | echo Skipping rebuilding ClipSVC licences... |
7268 | goto :cleanvnext | 8699 | goto :cleanvnext |
@@ -7359,7 +8790,7 @@ for %%# in (wlidsvc LicenseManager) do (net stop %%# /y %nul% & net start %%# /y | |||
7359 | echo: | 8790 | echo: |
7360 | echo %line% | 8791 | echo %line% |
7361 | echo: | 8792 | echo: |
7362 | call :_color %Magenta% "Clearing Office vNext License" | 8793 | call :_color %Blue% "Clearing Office vNext License" |
7363 | echo: | 8794 | echo: |
7364 | 8795 | ||
7365 | setlocal DisableDelayedExpansion | 8796 | setlocal DisableDelayedExpansion |
@@ -7414,7 +8845,7 @@ echo Not Found Registry - %%# | |||
7414 | echo: | 8845 | echo: |
7415 | echo %line% | 8846 | echo %line% |
7416 | echo: | 8847 | echo: |
7417 | call :_color %Magenta% "Rebuilding SPP Licensing Tokens" | 8848 | call :_color %Blue% "Rebuilding SPP Licensing Tokens" |
7418 | echo: | 8849 | echo: |
7419 | 8850 | ||
7420 | call :scandat check | 8851 | call :scandat check |
@@ -7428,7 +8859,7 @@ echo tokens.dat file: [%token%] | |||
7428 | if %winbuild% GEQ 14393 ( | 8859 | if %winbuild% GEQ 14393 ( |
7429 | set wpaerror= | 8860 | set wpaerror= |
7430 | set /a count=0 | 8861 | set /a count=0 |
7431 | for /f %%a in ('reg query "HKLM\SYSTEM\WPA" 2^>nul') do set /a count+=1 | 8862 | for /f %%a in ('reg query "HKLM\SYSTEM\WPA" %nul6%') do set /a count+=1 |
7432 | for /L %%# in (1,1,!count!) do ( | 8863 | for /L %%# in (1,1,!count!) do ( |
7433 | reg query "HKLM\SYSTEM\WPA\8DEC0AF1-0341-4b93-85CD-72606C2DF94C-7P-%%#" /ve /t REG_BINARY %nul% || set wpaerror=1 | 8864 | reg 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 | ||
7443 | set tokenstore= | 8874 | set tokenstore= |
7444 | for /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" | 8875 | for /f "skip=2 tokens=2*" %%a in ('reg query "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\SoftwareProtectionPlatform" /v TokenStore %nul6%') do call set "tokenstore=%%b" |
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]" | |||
7479 | echo [Successfully Fixed] | 8910 | echo [Successfully Fixed] |
7480 | ) | 8911 | ) |
7481 | ) else ( | 8912 | ) else ( |
7482 | echo [Error Not Found] | 8913 | echo [No Error Found] |
7483 | ) | 8914 | ) |
7484 | ) | 8915 | ) |
7485 | 8916 | ||
@@ -7523,7 +8954,7 @@ echo tokens.dat file was rebuilt successfully. | |||
7523 | echo: | 8954 | echo: |
7524 | echo %line% | 8955 | echo %line% |
7525 | echo: | 8956 | echo: |
7526 | call :_color %Magenta% "Rebuilding OSPP Licensing Tokens" | 8957 | call :_color %Blue% "Rebuilding OSPP Licensing Tokens" |
7527 | echo: | 8958 | echo: |
7528 | 8959 | ||
7529 | sc qc osppsvc %nul% || ( | 8960 | sc qc osppsvc %nul% || ( |
@@ -7580,7 +9011,7 @@ echo tokens.dat file was rebuilt successfully. | |||
7580 | echo: | 9011 | echo: |
7581 | echo %line% | 9012 | echo %line% |
7582 | echo: | 9013 | echo: |
7583 | call :_color %Magenta% "Repairing Office Licenses" | 9014 | call :_color %Blue% "Repairing Office Licenses" |
7584 | echo: | 9015 | echo: |
7585 | 9016 | ||
7586 | for /f "skip=2 tokens=2*" %%a in ('reg query "HKLM\SYSTEM\CurrentControlSet\Control\Session Manager\Environment" /v PROCESSOR_ARCHITECTURE') do set arch=%%b | 9017 | for /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 | ||
7623 | set uwp16= | 9054 | set uwp16= |
7624 | if %winbuild% GEQ 10240 ( | 9055 | if %winbuild% GEQ 10240 ( |
7625 | dir /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 |
7626 | dir /b "%ProgramW6432%\WindowsApps\Microsoft.Office.Desktop*" %nul% && set uwp16=Office 16.0 UWP | ||
7627 | dir /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 | ||
7631 | set /a counter=0 | 9059 | set /a counter=0 |
@@ -7673,7 +9101,7 @@ echo: | |||
7673 | call :_color %_Yellow% "A Window will popup, in that Window you need to select [Quick] Repair Option..." | 9101 | call :_color %_Yellow% "A Window will popup, in that Window you need to select [Quick] Repair Option..." |
7674 | call :_color %_Yellow% "Press any key to continue..." | 9102 | call :_color %_Yellow% "Press any key to continue..." |
7675 | echo: | 9103 | echo: |
7676 | pause >nul | 9104 | pause %nul1% |
7677 | ) | 9105 | ) |
7678 | 9106 | ||
7679 | if defined uwp16 ( | 9107 | if defined uwp16 ( |
@@ -7742,12 +9170,15 @@ goto :at_back | |||
7742 | 9170 | ||
7743 | echo: | 9171 | echo: |
7744 | echo Checking WMI | 9172 | echo Checking WMI |
9173 | call :checkwmi | ||
7745 | 9174 | ||
7746 | set error= | 9175 | :: Apply basic fix first and check |
7747 | wmic path Win32_ComputerSystem get CreationClassName /value 2>nul | find /i "computersystem" 1>nul | 9176 | |
7748 | if %errorlevel% NEQ 0 set error=1 | 9177 | if defined error ( |
7749 | winmgmt /verifyrepository %nul% | 9178 | call :_stopservice Winmgmt |
7750 | if %errorlevel% NEQ 0 set error=1 | 9179 | winmgmt /salvagerepository %nul% |
9180 | call :checkwmi | ||
9181 | ) | ||
7751 | 9182 | ||
7752 | if not defined error ( | 9183 | if not defined error ( |
7753 | echo [Working] | 9184 | echo [Working] |
@@ -7757,10 +9188,16 @@ goto :at_back | |||
7757 | 9188 | ||
7758 | call :_color %Red% "[Not Responding]" | 9189 | call :_color %Red% "[Not Responding]" |
7759 | 9190 | ||
9191 | set _corrupt= | ||
9192 | sc start Winmgmt %nul% | ||
9193 | if %errorlevel% EQU 1060 set _corrupt=1 | ||
9194 | sc query Winmgmt %nul% || set _corrupt=1 | ||
9195 | for %%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 | |||
7760 | echo: | 9197 | echo: |
7761 | sc query Winmgmt %nul% || ( | 9198 | if defined _corrupt ( |
7762 | %eline% | 9199 | %eline% |
7763 | echo Winmgmt service is not installed. Aborting... | 9200 | echo Winmgmt service is corrupted. Aborting... |
7764 | goto :at_back | 9201 | goto :at_back |
7765 | ) | 9202 | ) |
7766 | 9203 | ||
@@ -7779,12 +9216,12 @@ echo Stopping Winmgmt service | |||
7779 | call :_stopservice Winmgmt | 9216 | call :_stopservice Winmgmt |
7780 | call :_stopservice Winmgmt | 9217 | call :_stopservice Winmgmt |
7781 | call :_stopservice Winmgmt | 9218 | call :_stopservice Winmgmt |
7782 | sc query Winmgmt | find /i "1 STOPPED" %nul% && ( | 9219 | sc query Winmgmt | find /i "STOPPED" %nul% && ( |
7783 | echo [Successful] | 9220 | echo [Successful] |
7784 | ) || ( | 9221 | ) || ( |
7785 | call :_color %Red% "[Failed]" | 9222 | call :_color %Red% "[Failed]" |
7786 | echo: | 9223 | echo: |
7787 | call :_color %Magenta% "Its recommended to select [Restart] option and then apply Fix WMI option again." | 9224 | call :_color %Blue% "Its recommended to select [Restart] option and then apply Fix WMI option again." |
7788 | echo %line% | 9225 | echo %line% |
7789 | echo: | 9226 | echo: |
7790 | choice /C:21 /N /M "> [1] Restart [2] Revert Back Changes :" | 9227 | choice /C:21 /N /M "> [1] Restart [2] Revert Back Changes :" |
@@ -7813,8 +9250,8 @@ echo [Successful] | |||
7813 | call :_color %Red% "[Failed]" | 9250 | call :_color %Red% "[Failed]" |
7814 | ) | 9251 | ) |
7815 | 9252 | ||
7816 | wmic path Win32_ComputerSystem get CreationClassName /value 2>nul | find /i "computersystem" 1>nul | 9253 | call :checkwmi |
7817 | if %errorlevel% EQU 0 ( | 9254 | if not defined error ( |
7818 | echo: | 9255 | echo: |
7819 | echo Checking WMI | 9256 | echo Checking WMI |
7820 | call :_color %Green% "[Working]" | 9257 | call :_color %Green% "[Working]" |
@@ -7827,8 +9264,8 @@ call :registerobj %nul% | |||
7827 | 9264 | ||
7828 | echo: | 9265 | echo: |
7829 | echo Checking WMI | 9266 | echo Checking WMI |
7830 | wmic path Win32_ComputerSystem get CreationClassName /value 2>nul | find /i "computersystem" 1>nul | 9267 | call :checkwmi |
7831 | if %errorlevel% NEQ 0 ( | 9268 | if defined error ( |
7832 | call :_color %Red% "[Not Responding]" | 9269 | call :_color %Red% "[Not Responding]" |
7833 | echo: | 9270 | echo: |
7834 | echo Run [Dism RestoreHealth] and [SFC Scannow] options and make sure there are no errors. | 9271 | echo Run [Dism RestoreHealth] and [SFC Scannow] options and make sure there are no errors. |
@@ -7858,6 +9295,22 @@ winmgmt /salvagerepository | |||
7858 | winmgmt /resetrepository | 9295 | winmgmt /resetrepository |
7859 | exit /b | 9296 | exit /b |
7860 | 9297 | ||
9298 | :checkwmi | ||
9299 | |||
9300 | :: https://learn.microsoft.com/en-us/windows/win32/wmisdk/wmi-error-constants | ||
9301 | |||
9302 | set error= | ||
9303 | wmic path Win32_ComputerSystem get CreationClassName /value %nul2% | find /i "computersystem" %nul1% | ||
9304 | if %errorlevel% NEQ 0 (set error=1& exit /b) | ||
9305 | winmgmt /verifyrepository %nul% | ||
9306 | if %errorlevel% NEQ 0 (set error=1& exit /b) | ||
9307 | |||
9308 | cscript //nologo %windir%\system32\slmgr.vbs /dlv %nul% | ||
9309 | cmd /c exit /b %errorlevel% | ||
9310 | echo "0x%=ExitCode%" | findstr /i "0x800410 0x800440" %nul1% | ||
9311 | if %errorlevel% EQU 0 set error=1 | ||
9312 | exit /b | ||
9313 | |||
7861 | ::======================================================================================================================================== | 9314 | ::======================================================================================================================================== |
7862 | 9315 | ||
7863 | :at_back | 9316 | :at_back |
@@ -7866,7 +9319,7 @@ echo: | |||
7866 | echo %line% | 9319 | echo %line% |
7867 | echo: | 9320 | echo: |
7868 | call :_color %_Yellow% "Press any key to go back..." | 9321 | call :_color %_Yellow% "Press any key to go back..." |
7869 | pause >nul | 9322 | pause %nul1% |
7870 | goto :at_menu | 9323 | goto :at_menu |
7871 | 9324 | ||
7872 | ::======================================================================================================================================== | 9325 | ::======================================================================================================================================== |
@@ -7875,7 +9328,39 @@ goto :at_menu | |||
7875 | 9328 | ||
7876 | echo: | 9329 | echo: |
7877 | echo Press any key to %_exitmsg%... | 9330 | echo Press any key to %_exitmsg%... |
7878 | pause >nul | 9331 | pause %nul1% |
9332 | exit /b | ||
9333 | |||
9334 | ::======================================================================================================================================== | ||
9335 | |||
9336 | :compresslog | ||
9337 | |||
9338 | :: https://stackoverflow.com/a/46268232 | ||
9339 | |||
9340 | set "ddf="%SystemRoot%\Temp\ddf"" | ||
9341 | %nul% del /q /f %ddf% | ||
9342 | echo/.New Cabinet>%ddf% | ||
9343 | echo/.set Cabinet=ON>>%ddf% | ||
9344 | echo/.set CabinetFileCountThreshold=0;>>%ddf% | ||
9345 | echo/.set Compress=ON>>%ddf% | ||
9346 | echo/.set CompressionType=LZX>>%ddf% | ||
9347 | echo/.set CompressionLevel=7;>>%ddf% | ||
9348 | echo/.set CompressionMemory=21;>>%ddf% | ||
9349 | echo/.set FolderFileCountThreshold=0;>>%ddf% | ||
9350 | echo/.set FolderSizeThreshold=0;>>%ddf% | ||
9351 | echo/.set GenerateInf=OFF>>%ddf% | ||
9352 | echo/.set InfFileName=nul>>%ddf% | ||
9353 | echo/.set MaxCabinetSize=0;>>%ddf% | ||
9354 | echo/.set MaxDiskFileCount=0;>>%ddf% | ||
9355 | echo/.set MaxDiskSize=0;>>%ddf% | ||
9356 | echo/.set MaxErrors=1;>>%ddf% | ||
9357 | echo/.set RptFileName=nul>>%ddf% | ||
9358 | echo/.set UniqueFiles=ON>>%ddf% | ||
9359 | for /f "tokens=* delims=" %%D in ('dir /a:-D/b/s "%SystemRoot%\logs\%1"') do ( | ||
9360 | echo/"%%~fD" /inf=no;>>%ddf% | ||
9361 | ) | ||
9362 | makecab /F %ddf% /D DiskDirectory1="" /D CabinetNameTemplate="!desktop!\AT_Logs\%2_%_time%.cab" | ||
9363 | del /q /f %ddf% | ||
7879 | exit /b | 9364 | exit /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 | ||
9491 | set _stg=0 | ||
9492 | |||
9493 | ::======================================================================================================================================== | ||
9494 | |||
8005 | cls | 9495 | cls |
8006 | color 07 | 9496 | color 07 |
8007 | title Install Windows HWID Key | 9497 | title Change Windows Edition |
8008 | 9498 | ||
8009 | set _args= | 9499 | set _args= |
8010 | set _elev= | 9500 | set _elev= |
8011 | set _unattended=0 | ||
8012 | 9501 | ||
8013 | set _args=%* | 9502 | set _args=%* |
8014 | if defined _args set _args=%_args:"=% | 9503 | if defined _args set _args=%_args:"=% |
8015 | if defined _args ( | 9504 | if defined _args ( |
8016 | for %%A in (%_args%) do ( | 9505 | for %%A in (%_args%) do ( |
8017 | if /i "%%A"=="-el" set _elev=1 | 9506 | if /i "%%A"=="-el" set _elev=1 |
8018 | if /i "%%A"=="/Insert-HWID-Key" set _unattended=1 | ||
8019 | ) | 9507 | ) |
8020 | ) | 9508 | ) |
8021 | 9509 | ||
8022 | ::======================================================================================================================================== | 9510 | set "nul1=1>nul" |
8023 | 9511 | set "nul2=2>nul" | |
8024 | set winbuild=1 | 9512 | set "nul6=2^>nul" |
8025 | set "nul=>nul 2>&1" | 9513 | set "nul=>nul 2>&1" |
8026 | set psc=powershell.exe | ||
8027 | for /f "tokens=6 delims=[]. " %%G in ('ver') do set winbuild=%%G | ||
8028 | |||
8029 | set _NCS=1 | ||
8030 | if %winbuild% LSS 10586 set _NCS=0 | ||
8031 | if %winbuild% GEQ 10586 reg query "HKCU\Console" /v ForceV2 2>nul | find /i "0x0" 1>nul && (set _NCS=0) | ||
8032 | |||
8033 | if %_NCS% EQU 1 ( | ||
8034 | for /F %%a in ('echo prompt $E ^| cmd') do set "esc=%%a" | ||
8035 | set "Red="41;97m"" | ||
8036 | set "Green="42;97m"" | ||
8037 | set "_Green="40;92m"" | ||
8038 | set "_Yellow="40;93m"" | ||
8039 | ) else ( | ||
8040 | set "Red="Red" "white"" | ||
8041 | set "Green="DarkGreen" "white"" | ||
8042 | set "_Green="Black" "Green"" | ||
8043 | set "_Yellow="Black" "Yellow"" | ||
8044 | ) | ||
8045 | |||
8046 | set "nceline=echo: &echo ==== ERROR ==== &echo:" | ||
8047 | set "eline=echo: &call :dk_color %Red% "==== ERROR ====" &echo:" | ||
8048 | set "line=echo ___________________________________________________________________________________________" | ||
8049 | if %~z0 GEQ 200000 (set "_exitmsg=Go back") else (set "_exitmsg=Exit") | ||
8050 | |||
8051 | ::======================================================================================================================================== | ||
8052 | |||
8053 | if %winbuild% LSS 10240 ( | ||
8054 | %eline% | ||
8055 | echo Unsupported OS version detected. | ||
8056 | echo This option is supported only for Windows 10/11. | ||
8057 | goto ins_done | ||
8058 | ) | ||
8059 | |||
8060 | if exist "%SystemRoot%\Servicing\Packages\Microsoft-Windows-Server*Edition~*.mum" ( | ||
8061 | %eline% | ||
8062 | echo HWID Activation is not supported for Windows Server. | ||
8063 | goto ins_done | ||
8064 | ) | ||
8065 | |||
8066 | ::======================================================================================================================================== | ||
8067 | |||
8068 | :: Fix for the special characters limitation in path name | ||
8069 | 9514 | ||
8070 | set "_work=%~dp0" | ||
8071 | if "%_work:~-1%"=="\" set "_work=%_work:~0,-1%" | ||
8072 | |||
8073 | set "_batf=%~f0" | ||
8074 | set "_batp=%_batf:'=''%" | ||
8075 | |||
8076 | set _PSarg="""%~f0""" -el %_args% | ||
8077 | |||
8078 | set "_ttemp=%temp%" | ||
8079 | |||
8080 | setlocal EnableDelayedExpansion | ||
8081 | |||
8082 | ::======================================================================================================================================== | ||
8083 | |||
8084 | cls | ||
8085 | mode 98, 30 | ||
8086 | echo: | ||
8087 | echo Initializing... | ||
8088 | call :dk_product | ||
8089 | call :dk_ckeckwmic | ||
8090 | call :dk_actids | ||
8091 | |||
8092 | ::======================================================================================================================================== | ||
8093 | |||
8094 | :: Check SKU value / Check in multiple places to find Edition change corruption | ||
8095 | |||
8096 | set osSKU= | ||
8097 | set regSKU= | ||
8098 | set wmiSKU= | ||
8099 | |||
8100 | for /f "tokens=3 delims=." %%a in ('reg query "HKLM\SYSTEM\CurrentControlSet\Control\ProductOptions" /v OSProductPfn 2^>nul') do set "regSKU=%%a" | ||
8101 | if %_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" | ||
8102 | if %_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 | |||
8104 | set osSKU=%wmiSKU% | ||
8105 | if not defined osSKU set osSKU=%regSKU% | ||
8106 | |||
8107 | if not defined osSKU ( | ||
8108 | %eline% | ||
8109 | echo SKU value was not detected properly. Aborting... | ||
8110 | goto ins_done | ||
8111 | ) | ||
8112 | |||
8113 | ::======================================================================================================================================== | ||
8114 | |||
8115 | :: Detect key | ||
8116 | |||
8117 | set key= | ||
8118 | set _channel= | ||
8119 | set actidnotfound= | ||
8120 | |||
8121 | for /f "skip=2 tokens=2*" %%a in ('reg query "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion" /v BuildBranch 2^>nul') do set "branch=%%b" | ||
8122 | |||
8123 | if defined applist call :hwiddata key attempt1 | ||
8124 | if not defined key call :hwiddata key attempt2 | ||
8125 | |||
8126 | if not defined key ( | ||
8127 | %eline% | ||
8128 | echo [%winos% ^| %winbuild% ^| SKU:%osSKU%] | ||
8129 | echo Unable to find this product in the HWID supported product list. | ||
8130 | echo Make sure you are using updated version of the script. | ||
8131 | echo https://massgrave.dev | ||
8132 | goto ins_done | ||
8133 | ) | ||
8134 | |||
8135 | ::======================================================================================================================================== | ||
8136 | |||
8137 | if %_unattended%==1 goto insertkey | ||
8138 | |||
8139 | cls | ||
8140 | %line% | ||
8141 | echo: | ||
8142 | echo Install [%winos% ^| SKU:%osSKU% ^| %winbuild%] %channel% Key | ||
8143 | echo [%key%] | ||
8144 | %line% | ||
8145 | echo: | ||
8146 | if not "%regSKU%"=="%wmiSKU%" ( | ||
8147 | echo Note: Difference Found In SKU Value- WMI:%wmiSKU% Reg:%regSKU% | ||
8148 | echo: | ||
8149 | ) | ||
8150 | call :dk_color %_Green% "Press [1] to Continue or [0] to %_exitmsg%" | ||
8151 | choice /C:01 /N | ||
8152 | if %errorlevel%==1 exit /b | ||
8153 | |||
8154 | ::======================================================================================================================================== | ||
8155 | |||
8156 | :insertkey | ||
8157 | |||
8158 | cls | ||
8159 | %line% | ||
8160 | |||
8161 | if %_wmic% EQU 1 wmic path SoftwareLicensingService where __CLASS='SoftwareLicensingService' call InstallProductKey ProductKey="%key%" %nul% | ||
8162 | if %_wmic% EQU 0 %psc% "(([WMISEARCHER]'SELECT Version FROM SoftwareLicensingService').Get()).InstallProductKey('%key%')" %nul% | ||
8163 | if not %errorlevel%==0 cscript //nologo %windir%\system32\slmgr.vbs /ipk %key% %nul% | ||
8164 | |||
8165 | set error_code=%errorlevel% | ||
8166 | cmd /c exit /b %error_code% | ||
8167 | if %error_code% NEQ 0 set "error_code=[0x%=ExitCode%]" | ||
8168 | |||
8169 | echo: | ||
8170 | echo [%winos% ^| SKU:%osSKU% ^| %winbuild%] | ||
8171 | |||
8172 | |||
8173 | if %error_code% EQU 0 ( | ||
8174 | call :dk_refresh | ||
8175 | call :dk_channel | ||
8176 | call echo Installing %%_channel%% [%key%] | ||
8177 | echo: | ||
8178 | call :dk_color %Green% "[Successful]" | ||
8179 | ) else ( | ||
8180 | echo Installing [%key%] | ||
8181 | echo: | ||
8182 | call :dk_color %Red% "[Unsuccessful] %error_code%" | ||
8183 | if defined actidnotfound call :dk_color %Red% "Activation ID not found for this key." | ||
8184 | echo Check this page for help https://massgrave.dev/troubleshoot | ||
8185 | ) | ||
8186 | %line% | ||
8187 | |||
8188 | ::======================================================================================================================================== | ||
8189 | |||
8190 | :ins_done | ||
8191 | |||
8192 | echo: | ||
8193 | if %_unattended%==1 timeout /t 2 & exit /b | ||
8194 | call :dk_color %_Yellow% "Press any key to %_exitmsg%..." | ||
8195 | pause >nul | ||
8196 | exit /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 | ||
8205 | set _stg=0 | ||
8206 | |||
8207 | cls | ||
8208 | color 07 | ||
8209 | title Change Windows Edition | ||
8210 | |||
8211 | set _elev= | ||
8212 | if /i "%~1"=="-el" set _elev=1 | ||
8213 | |||
8214 | set winbuild=1 | ||
8215 | set "nul=>nul 2>&1" | ||
8216 | set psc=powershell.exe | 9515 | set psc=powershell.exe |
9516 | set winbuild=1 | ||
8217 | for /f "tokens=6 delims=[]. " %%G in ('ver') do set winbuild=%%G | 9517 | for /f "tokens=6 delims=[]. " %%G in ('ver') do set winbuild=%%G |
8218 | 9518 | ||
8219 | set _NCS=1 | 9519 | set _NCS=1 |
8220 | if %winbuild% LSS 10586 set _NCS=0 | 9520 | if %winbuild% LSS 10586 set _NCS=0 |
8221 | if %winbuild% GEQ 10586 reg query "HKCU\Console" /v ForceV2 2>nul | find /i "0x0" 1>nul && (set _NCS=0) | 9521 | if %winbuild% GEQ 10586 reg query "HKCU\Console" /v ForceV2 %nul2% | find /i "0x0" %nul1% && (set _NCS=0) |
8222 | 9522 | ||
8223 | if %_NCS% EQU 1 ( | 9523 | if %_NCS% EQU 1 ( |
8224 | for /F %%a in ('echo prompt $E ^| cmd') do set "esc=%%a" | 9524 | for /F %%a in ('echo prompt $E ^| cmd') do set "esc=%%a" |
8225 | set "Red="41;97m"" | 9525 | set "Red="41;97m"" |
8226 | set "Gray="100;97m"" | 9526 | set "Gray="100;97m"" |
8227 | set "Green="42;97m"" | 9527 | set "Green="42;97m"" |
8228 | set "Magenta="45;97m"" | 9528 | set "Blue="44;97m"" |
8229 | set "_White="40;37m"" | 9529 | set "_White="40;37m"" |
8230 | set "_Green="40;92m"" | 9530 | set "_Green="40;92m"" |
8231 | set "_Yellow="40;93m"" | 9531 | set "_Yellow="40;93m"" |
@@ -8233,7 +9533,7 @@ set "_Yellow="40;93m"" | |||
8233 | set "Red="Red" "white"" | 9533 | set "Red="Red" "white"" |
8234 | set "Gray="Darkgray" "white"" | 9534 | set "Gray="Darkgray" "white"" |
8235 | set "Green="DarkGreen" "white"" | 9535 | set "Green="DarkGreen" "white"" |
8236 | set "Magenta="Darkmagenta" "white"" | 9536 | set "Blue="Blue" "white"" |
8237 | set "_White="Black" "Gray"" | 9537 | set "_White="Black" "Gray"" |
8238 | set "_Green="Black" "Green"" | 9538 | set "_Green="Black" "Green"" |
8239 | set "_Yellow="Black" "Yellow"" | 9539 | set "_Yellow="Black" "Yellow"" |
@@ -8286,43 +9586,41 @@ echo: | |||
8286 | :: Check Activation IDs | 9586 | :: Check Activation IDs |
8287 | 9587 | ||
8288 | call :dk_actids | 9588 | call :dk_actids |
8289 | 9589 | if not defined applist ( | |
9590 | net stop sppsvc /y %nul% | ||
9591 | cscript //nologo %windir%\system32\slmgr.vbs /rilc %nul% | ||
9592 | if !errorlevel! NEQ 0 cscript //nologo %windir%\system32\slmgr.vbs /rilc %nul% | ||
9593 | call :dk_refresh | ||
9594 | call :dk_actids | ||
8290 | if not defined applist ( | 9595 | if not defined applist ( |
8291 | %eline% | 9596 | %eline% |
8292 | echo Activation IDs not found. Aborting... | 9597 | echo Activation IDs not found. Aborting... |
8293 | echo: | 9598 | echo: |
8294 | echo Check this page for help. https://massgrave.dev/troubleshoot | 9599 | echo Check this page for help. https://%mas%/troubleshoot |
8295 | goto ced_done | 9600 | goto ced_done |
8296 | ) | 9601 | ) |
8297 | |||
8298 | :: Check Windows Edition | ||
8299 | |||
8300 | set osedition= | ||
8301 | for /f "tokens=3 delims=: " %%a in ('DISM /English /Online /Get-CurrentEdition 2^>nul ^| find /i "Current Edition :"') do set "osedition=%%a" | ||
8302 | |||
8303 | if "%osedition%"=="" ( | ||
8304 | %eline% | ||
8305 | DISM /English /Online /Get-CurrentEdition %nul% | ||
8306 | cmd /c exit /b !errorlevel! | ||
8307 | echo DISM command failed [Error Code - 0x!=ExitCode!] | ||
8308 | echo OS Edition was not detected properly. Aborting... | ||
8309 | echo: | ||
8310 | echo Check this page for help. https://massgrave.dev/troubleshoot | ||
8311 | goto ced_done | ||
8312 | ) | 9602 | ) |
8313 | 9603 | ||
9604 | ::======================================================================================================================================== | ||
9605 | |||
8314 | :: Check SKU value | 9606 | :: Check SKU value |
8315 | 9607 | ||
8316 | set osSKU= | 9608 | set osSKU= |
8317 | set regSKU= | 9609 | set slcSKU= |
8318 | set wmiSKU= | 9610 | set wmiSKU= |
8319 | 9611 | ||
8320 | for /f "tokens=3 delims=." %%a in ('reg query "HKLM\SYSTEM\CurrentControlSet\Control\ProductOptions" /v OSProductPfn 2^>nul') do set "regSKU=%%a" | 9612 | if %winbuild% GEQ 14393 (set info=Kernel-BrandingInfo) else (set info=Kernel-ProductInfo) |
8321 | if %_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" | 9613 | set d1=%ref% [void]$TypeBuilder.DefinePInvokeMethod('SLGetWindowsInformationDWORD', 'slc.dll', 'Public, Static', 1, [int], @([String], [int].MakeByRefType()), 1, 3); |
8322 | if %_wmic% EQU 0 for /f "tokens=1" %%a in ('%psc% "([WMI]'Win32_OperatingSystem=@').OperatingSystemSKU" 2^>nul') do if not errorlevel 1 set "wmiSKU=%%a" | 9614 | set d1=%d1% $Sku = 0; [void]$TypeBuilder.CreateType()::SLGetWindowsInformationDWORD('%info%', [ref]$Sku); $Sku |
9615 | for /f "delims=" %%s in ('"%psc% %d1%"') do if not errorlevel 1 (set slcSKU=%%s) | ||
9616 | if "%slcSKU%"=="0" set slcSKU= | ||
9617 | if 1%slcSKU% NEQ +1%slcSKU% set slcSKU= | ||
8323 | 9618 | ||
8324 | set osSKU=%wmiSKU% | 9619 | if %_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" |
8325 | if not defined osSKU set osSKU=%regSKU% | 9620 | if %_wmic% EQU 0 for /f "tokens=1" %%a in ('%psc% "([WMI]'Win32_OperatingSystem=@').OperatingSystemSKU" %nul6%') do if not errorlevel 1 set "wmiSKU=%%a" |
9621 | |||
9622 | set osSKU=%slcSKU% | ||
9623 | if not defined osSKU set osSKU=%wmiSKU% | ||
8326 | 9624 | ||
8327 | if not defined osSKU ( | 9625 | if not defined osSKU ( |
8328 | %eline% | 9626 | %eline% |
@@ -8330,14 +9628,56 @@ echo SKU value was not detected properly. Aborting... | |||
8330 | goto ced_done | 9628 | goto ced_done |
8331 | ) | 9629 | ) |
8332 | 9630 | ||
9631 | ::======================================================================================================================================== | ||
9632 | |||
9633 | :: Check Windows Edition | ||
9634 | |||
9635 | set osedition= | ||
9636 | set dismedition= | ||
9637 | set dismnotworking= | ||
9638 | |||
9639 | set d1=%ref% [void]$TypeBuilder.DefinePInvokeMethod('SLGetWindowsInformation', 'slc.dll', 22, 1, [int], @([String], [int], [int].MakeByRefType(), [String].MakeByRefType()), 1, 3); | ||
9640 | set d1=%d1% $editionName = 0; [void]$TypeBuilder.CreateType()::SLGetWindowsInformation('Kernel-EditionName', 0, [ref]0, [ref]$editionName); $editionName | ||
9641 | if %winbuild% GEQ 14393 for /f "delims=" %%s in ('"%psc% %d1%"') do if not errorlevel 1 (set osedition=%%s) | ||
9642 | if "%osedition%"=="0" set osedition= | ||
9643 | |||
9644 | if not defined osedition ( | ||
9645 | for /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 | |||
9650 | if %osSKU%==164 set osedition=ProfessionalEducation | ||
9651 | if %osSKU%==165 set osedition=ProfessionalEducationN | ||
9652 | |||
9653 | for /f "tokens=3 delims=: " %%a in ('DISM /English /Online /Get-CurrentEdition %nul6% ^| find /i "Current Edition :"') do set "dismedition=%%a" | ||
9654 | if not defined dismedition set dismnotworking=1 | ||
9655 | |||
9656 | if defined dismedition if not defined osedition set osedition=%dismedition% | ||
9657 | |||
9658 | if not defined osedition ( | ||
9659 | %eline% | ||
9660 | DISM /English /Online /Get-CurrentEdition %nul% | ||
9661 | cmd /c exit /b !errorlevel! | ||
9662 | echo DISM command failed [Error Code - 0x!=ExitCode!] | ||
9663 | echo OS Edition was not detected properly. Aborting... | ||
9664 | echo: | ||
9665 | echo Check this page for help. https://%mas%/troubleshoot | ||
9666 | goto ced_done | ||
9667 | ) | ||
9668 | |||
9669 | ::======================================================================================================================================== | ||
9670 | |||
8333 | set branch= | 9671 | set branch= |
8334 | for /f "skip=2 tokens=2*" %%a in ('reg query "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion" /v BuildBranch 2^>nul') do set "branch=%%b" | 9672 | for /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% |
8340 | echo PowerShell is not responding properly. Aborting... | 9678 | echo PowerShell is not responding properly. Aborting... |
9679 | echo: | ||
9680 | echo Check this page for help. https://%mas%/troubleshoot | ||
8341 | goto ced_done | 9681 | goto ced_done |
8342 | ) | 9682 | ) |
8343 | 9683 | ||
@@ -8349,15 +9689,22 @@ set _target= | |||
8349 | set _dtarget= | 9689 | set _dtarget= |
8350 | set _ptarget= | 9690 | set _ptarget= |
8351 | set _ntarget= | 9691 | set _ntarget= |
9692 | set _wtarget= | ||
9693 | |||
9694 | if %winbuild% GEQ 10240 for /f "tokens=4" %%a in ('dism /online /english /Get-TargetEditions ^| findstr /i /c:"Target Edition : "') do (if defined _dtarget (set "_dtarget= !_dtarget! %%a ") else (set "_dtarget= %%a ")) | ||
9695 | if %winbuild% LSS 10240 for /f "tokens=4" %%a in ('%psc% "$f=[io.file]::ReadAllText('!_batp!') -split ':cbsxml\:.*';& ([ScriptBlock]::Create($f[1])) -GetTargetEditions;" ^| findstr /i /c:"Target Edition : "') do (if defined _ptarget (set "_ptarget= !_ptarget! %%a ") else (set "_ptarget= %%a ")) | ||
8352 | 9696 | ||
8353 | if %winbuild% GEQ 10240 for /f "tokens=4" %%a in ('dism /online /english /Get-TargetEditions ^| findstr /i /c:"Target Edition : "') do (if defined _dtarget (set "_dtarget=!_dtarget! %%a") else (set "_dtarget=%%a")) | 9697 | if %winbuild% GEQ 10240 if not exist "%SystemRoot%\Servicing\Packages\Microsoft-Windows-Server*Edition~*.mum" ( |
8354 | 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")) | 9698 | call :ced_edilist |
9699 | if /i "%osedition:~0,4%"=="Core" (set "_wtarget= Professional !_wtarget! ") | ||
9700 | set "_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 | ||
8360 | for %%# in (99 139 202 203) do if %osSKU%==%%# ( | 9707 | for %%# in (202 203) do if %osSKU%==%%# ( |
8361 | %eline% | 9708 | %eline% |
8362 | echo [%winos% ^| SKU:%osSKU% ^| %winbuild%] | 9709 | echo [%winos% ^| SKU:%osSKU% ^| %winbuild%] |
8363 | echo It's not recommended to change this installed edition to any other. | 9710 | echo It's not recommended to change this installed edition to any other. |
@@ -8365,8 +9712,8 @@ echo Aborting... | |||
8365 | goto ced_done | 9712 | goto ced_done |
8366 | ) | 9713 | ) |
8367 | 9714 | ||
8368 | for %%# in ( %_dtarget% %_ptarget% ) do ( | 9715 | for %%# in ( %_dtarget% %_ptarget% ) do if /i not "%%#"=="%osedition%" ( |
8369 | echo "!_target!" | find /i " %%# " 1>nul || set "_target=!_target! %%# " | 9716 | echo "!_target!" | find /i " %%# " %nul1% || set "_target= !_target! %%# " |
8370 | ) | 9717 | ) |
8371 | 9718 | ||
8372 | if defined _target ( | 9719 | if defined _target ( |
@@ -8378,6 +9725,7 @@ echo %%# | findstr /i "CountrySpecific CloudEdition" %nul% || (set "_ntarget=!_n | |||
8378 | if not defined _ntarget ( | 9725 | if not defined _ntarget ( |
8379 | %line% | 9726 | %line% |
8380 | echo: | 9727 | echo: |
9728 | if defined dismnotworking call :dk_color %Red% "DISM.exe is not responding." | ||
8381 | call :dk_color %Gray% "Target Edition not found." | 9729 | call :dk_color %Gray% "Target Edition not found." |
8382 | echo Current Edition [%osedition% ^| %winbuild%] can not be changed to any other Edition. | 9730 | echo Current Edition [%osedition% ^| %winbuild%] can not be changed to any other Edition. |
8383 | %line% | 9731 | %line% |
@@ -8391,7 +9739,6 @@ goto ced_done | |||
8391 | cls | 9739 | cls |
8392 | mode 98, 30 | 9740 | mode 98, 30 |
8393 | set inpt= | 9741 | set inpt= |
8394 | set note= | ||
8395 | set counter=0 | 9742 | set counter=0 |
8396 | set verified=0 | 9743 | set verified=0 |
8397 | set targetedition= | 9744 | set targetedition= |
@@ -8399,21 +9746,16 @@ set targetedition= | |||
8399 | %line% | 9746 | %line% |
8400 | echo: | 9747 | echo: |
8401 | call :dk_color %Gray% "You can change the Edition [%osedition%] [%winbuild%] to one of the following." | 9748 | call :dk_color %Gray% "You can change the Edition [%osedition%] [%winbuild%] to one of the following." |
9749 | if defined dismnotworking ( | ||
9750 | call :dk_color %_Yellow% "Note - DISM.exe is not responding." | ||
9751 | if /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% |
8403 | echo: | 9754 | echo: |
8404 | 9755 | ||
8405 | for %%A in (%_ntarget%) do ( | 9756 | for %%A in (%_ntarget%) do ( |
8406 | set /a counter+=1 | 9757 | set /a counter+=1 |
8407 | if %winbuild% GEQ 10240 ( | ||
8408 | echo "%_ptarget%" | find /i "%%A" 1>nul && ( | ||
8409 | set note=1 | ||
8410 | call :dk_color2 %_White% "[!counter!] " %Magenta% "%%A" | ||
8411 | ) || ( | ||
8412 | echo [!counter!] %%A | ||
8413 | ) | ||
8414 | ) else ( | ||
8415 | echo [!counter!] %%A | 9758 | echo [!counter!] %%A |
8416 | ) | ||
8417 | set targetedition!counter!=%%A | 9759 | set targetedition!counter!=%%A |
8418 | ) | 9760 | ) |
8419 | 9761 | ||
@@ -8421,10 +9763,6 @@ set targetedition!counter!=%%A | |||
8421 | echo: | 9763 | echo: |
8422 | echo [0] %_exitmsg% | 9764 | echo [0] %_exitmsg% |
8423 | echo: | 9765 | echo: |
8424 | if defined note ( | ||
8425 | echo Note: CBS Upgrade Method is available for Purple colored editions. | ||
8426 | echo: | ||
8427 | ) | ||
8428 | call :dk_color %_Green% "Enter option number in keyboard, and press "Enter":" | 9766 | call :dk_color %_Green% "Enter option number in keyboard, and press "Enter":" |
8429 | set /p inpt= | 9767 | set /p inpt= |
8430 | if "%inpt%"=="" goto cedmenu2 | 9768 | if "%inpt%"=="" goto cedmenu2 |
@@ -8435,71 +9773,26 @@ if %verified%==0 goto cedmenu2 | |||
8435 | 9773 | ||
8436 | ::======================================================================================================================================== | 9774 | ::======================================================================================================================================== |
8437 | 9775 | ||
8438 | cls | 9776 | if %winbuild% LSS 10240 goto :cbsmethod |
8439 | if %winbuild% GEQ 10240 ( | 9777 | if exist "%SystemRoot%\Servicing\Packages\Microsoft-Windows-Server*Edition~*.mum" goto :ced_change_server |
8440 | echo "%_ptarget%" | find /i "%targetedition%" 1>nul && ( | ||
8441 | echo "%_dtarget%" | find /i "%targetedition%" 1>nul && ( | ||
8442 | echo: | ||
8443 | %line% | ||
8444 | echo: | ||
8445 | if exist "%SystemRoot%\Servicing\Packages\Microsoft-Windows-Server*Edition~*.mum" ( | ||
8446 | echo [1] DISM Method [Recommended] | ||
8447 | ) else ( | ||
8448 | echo [1] Changepk Method [Recommended] | ||
8449 | ) | ||
8450 | echo: | ||
8451 | echo [2] CBS Upgrade Method [Alternative] | ||
8452 | echo: | ||
8453 | echo [0] Go back | ||
8454 | %line% | ||
8455 | echo: | ||
8456 | echo Enter a menu option in the Keyboard: | ||
8457 | choice /C:120 /N | ||
8458 | set _el=!errorlevel! | ||
8459 | if !_el!==3 goto :cedmenu2 | ||
8460 | if !_el!==2 goto :cbsmethod | ||
8461 | if !_el!==1 REM | ||
8462 | ) | ||
8463 | ) | ||
8464 | ) else ( | ||
8465 | goto :cbsmethod | ||
8466 | ) | ||
8467 | |||
8468 | echo "%_ptarget%" | find /i "%targetedition%" 1>nul && ( | ||
8469 | echo "%_dtarget%" | find /i "%targetedition%" 1>nul || ( | ||
8470 | goto :cbsmethod | ||
8471 | ) | ||
8472 | ) | ||
8473 | |||
8474 | if exist "%SystemRoot%\Servicing\Packages\Microsoft-Windows-Server*Edition~*.mum" ( | ||
8475 | goto :ced_change_server | ||
8476 | ) | ||
8477 | 9778 | ||
8478 | cls | 9779 | cls |
9780 | mode con cols=105 lines=32 | ||
9781 | |||
8479 | set key= | 9782 | set key= |
8480 | set _chan= | 9783 | set _chan= |
8481 | set _changepk=0 | 9784 | set _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 | ||
8485 | if not exist "%SystemRoot%\System32\spp\tokens\skus\%targetedition%\" ( | 9788 | if not exist "%SystemRoot%\System32\spp\tokens\skus\%targetedition%\" ( |
8486 | set _changepk=1 | 9789 | set _dismapi=1 |
8487 | ) | ||
8488 | |||
8489 | if /i "%osedition:~0,4%"=="Core" ( | ||
8490 | if /i not "%targetedition:~0,4%"=="Core" ( | ||
8491 | set _changepk=1 | ||
8492 | ) | ||
8493 | ) | 9790 | ) |
8494 | 9791 | ||
8495 | if %_changepk%==1 ( | ||
8496 | set "keyflow=Retail Volume:MAK Volume:GVLK OEM:NONSLP OEM:DM" | ||
8497 | ) else ( | ||
8498 | set "keyflow=Retail OEM:NONSLP OEM:DM Volume:MAK Volume:GVLK" | 9792 | set "keyflow=Retail OEM:NONSLP OEM:DM Volume:MAK Volume:GVLK" |
8499 | ) | ||
8500 | 9793 | ||
8501 | if not defined key call :ced_targetSKU %targetedition% | 9794 | call :ced_targetSKU %targetedition% |
8502 | if not defined key if defined targetSKU call :ced_windowskey | 9795 | if defined targetSKU call :ced_windowskey |
8503 | if defined key if defined pkeychannel set _chan=%pkeychannel% | 9796 | if defined key if defined pkeychannel set _chan=%pkeychannel% |
8504 | if not defined key call :changeeditiondata | 9797 | if not defined key call :changeeditiondata |
8505 | 9798 | ||
@@ -8507,57 +9800,26 @@ if not defined key ( | |||
8507 | %eline% | 9800 | %eline% |
8508 | echo [%targetedition% ^| %winbuild%] | 9801 | echo [%targetedition% ^| %winbuild%] |
8509 | echo Unable to get product key from pkeyhelper.dll | 9802 | echo Unable to get product key from pkeyhelper.dll |
8510 | echo Make sure you are using updated version of the script. | 9803 | echo: |
8511 | echo https://massgrave.dev | 9804 | echo Check this page for help. https://%mas%/troubleshoot |
8512 | goto ced_done | 9805 | goto 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 | ||
8522 | cls | 9813 | cls |
8523 | if %_changepk%==1 ( | 9814 | %line% |
8524 | echo "%_chan%" | find /i "OEM" >NUL && ( | ||
8525 | %eline% | ||
8526 | echo [%osedition%] can not be changed to [%targetedition%] Edition due to lack of non OEM keys. | ||
8527 | echo Non-OEM keys are required to change from Core to Non-Core Editions. | ||
8528 | goto ced_done | ||
8529 | ) | ||
8530 | ) | ||
8531 | |||
8532 | :ced_loop | ||
8533 | |||
8534 | cls | ||
8535 | if %_changepk%==1 ( | ||
8536 | for %%a in (l.root-servers.net resolver1.opendns.com download.windowsupdate.com google.com) do ( | ||
8537 | for /f "delims=[] tokens=2" %%# in ('ping -n 1 %%a') do ( | ||
8538 | if not [%%#]==[] ( | ||
8539 | %eline% | ||
8540 | echo Internet needs to be disconnected to change edition [%osedition%] to [%targetedition%] | ||
8541 | echo Disconnect the Internet and then press any key... | ||
8542 | pause >nul | ||
8543 | goto ced_loop | ||
8544 | ) | ||
8545 | ) | ||
8546 | ) | ||
8547 | ) | ||
8548 | |||
8549 | echo: | 9815 | echo: |
8550 | echo Changing the Current Edition [%osedition%] to [%targetedition%] | 9816 | echo Changing the Current Edition [%osedition%] %winbuild% to [%targetedition%] |
8551 | echo: | 9817 | echo: |
8552 | 9818 | ||
8553 | if %_changepk%==1 ( | 9819 | if %_dismapi%==1 ( |
8554 | call :dk_color %Magenta% "Notes-" | 9820 | call :dk_color %Blue% "Notes-" |
8555 | echo: | ||
8556 | echo - You can safely ignore if error appears in the upgrade Window, | ||
8557 | echo but in that case you must manually reboot the system. | ||
8558 | echo: | 9821 | echo: |
8559 | echo - Save your work before continue, system will auto restart. | 9822 | echo - Save your work before continue, system will auto restart. |
8560 | echo - You can connect to Internet after the system restart. | ||
8561 | echo: | 9823 | echo: |
8562 | echo - You will need to activate with HWID option once the edition is changed. | 9824 | echo - You will need to activate with HWID option once the edition is changed. |
8563 | echo: | 9825 | echo: |
@@ -8567,7 +9829,7 @@ if !errorlevel!==1 exit /b | |||
8567 | 9829 | ||
8568 | ::======================================================================================================================================== | 9830 | ::======================================================================================================================================== |
8569 | 9831 | ||
8570 | if %_changepk%==0 ( | 9832 | if %_dismapi%==0 ( |
8571 | echo Installing %_chan% Key [%key%] | 9833 | echo Installing %_chan% Key [%key%] |
8572 | echo: | 9834 | echo: |
8573 | if %_wmic% EQU 1 wmic path SoftwareLicensingService where __CLASS='SoftwareLicensingService' call InstallProductKey ProductKey="%key%" %nul% | 9835 | if %_wmic% EQU 1 wmic path SoftwareLicensingService where __CLASS='SoftwareLicensingService' call InstallProductKey ProductKey="%key%" %nul% |
@@ -8585,14 +9847,19 @@ echo: | |||
8585 | call :dk_color %Gray% "Reboot is required to properly change the Edition." | 9847 | call :dk_color %Gray% "Reboot is required to properly change the Edition." |
8586 | ) else ( | 9848 | ) else ( |
8587 | call :dk_color %Red% "[Unsuccessful] [Error Code: 0x!=ExitCode!]" | 9849 | call :dk_color %Red% "[Unsuccessful] [Error Code: 0x!=ExitCode!]" |
9850 | echo Check this page for help. https://%mas%/troubleshoot | ||
8588 | ) | 9851 | ) |
8589 | ) | 9852 | ) |
8590 | 9853 | ||
8591 | if %_changepk%==1 ( | 9854 | if %_dismapi%==1 ( |
8592 | echo: | 9855 | echo: |
8593 | echo Applying the command with %_chan% Key | 9856 | echo Applying the DISM API method with %_chan% Key %key% |
8594 | echo start changepk.exe /ProductKey %key% | 9857 | echo: |
8595 | start changepk.exe /ProductKey %key% | 9858 | %psc% "$f=[io.file]::ReadAllText('!_batp!') -split ':dismapi\:.*';& ([ScriptBlock]::Create($f[1])) %targetedition% %key%;" |
9859 | timeout /t 3 %nul1% | ||
9860 | echo: | ||
9861 | call :dk_color %Blue% "Incase of errors, you must restart your system before trying again." | ||
9862 | echo 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 | ||
8605 | cls | 9872 | cls |
8606 | mode con cols=105 lines=32 | 9873 | mode 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 | ||
8609 | echo: | 9876 | echo: |
8610 | echo Changing the Current Edition [%osedition%] to [%targetedition%] | 9877 | echo Changing the Current Edition [%osedition%] %winbuild% to [%targetedition%] |
8611 | echo: | 9878 | echo: |
8612 | call :dk_color %Magenta% "Important - Save your work before continue, system will auto reboot." | 9879 | call :dk_color %Blue% "Important - Save your work before continue, system will auto reboot." |
8613 | if %winbuild% GEQ 17034 if %targetedition%==Professional echo - Enterprise Key will be installed instead of Pro, you can quickly change to Pro later. | ||
8614 | echo: | 9880 | echo: |
8615 | choice /C:01 /N /M "[1] Continue [0] %_exitmsg% : " | 9881 | choice /C:01 /N /M "[1] Continue [0] %_exitmsg% : " |
8616 | if %errorlevel%==1 exit /b | 9882 | if %errorlevel%==1 exit /b |
@@ -8621,9 +9887,11 @@ echo: | |||
8621 | 9887 | ||
8622 | if %_stg%==0 (set stage=) else (set stage=-StageCurrent) | 9888 | if %_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 | |||
8625 | echo: | 9890 | echo: |
9891 | call :dk_color %Blue% "Incase of errors, you must restart your system before trying again." | ||
9892 | echo Check this page for help. https://%mas%/troubleshoot | ||
8626 | %line% | 9893 | %line% |
9894 | |||
8627 | goto ced_done | 9895 | goto ced_done |
8628 | 9896 | ||
8629 | ::======================================================================================================================================== | 9897 | ::======================================================================================================================================== |
@@ -8632,23 +9900,23 @@ goto ced_done | |||
8632 | 9900 | ||
8633 | cls | 9901 | cls |
8634 | mode con cols=105 lines=32 | 9902 | mode 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 | ||
8637 | set key= | 9905 | set key= |
8638 | set pkeychannel= | 9906 | set _chan= |
8639 | set "keyflow=Volume:GVLK Retail Volume:MAK OEM:NONSLP OEM:DM" | 9907 | set "keyflow=Volume:GVLK Retail Volume:MAK OEM:NONSLP OEM:DM" |
8640 | call :changeeditionserverdata | ||
8641 | 9908 | ||
8642 | if not defined key call :ced_targetSKU %targetedition% | 9909 | call :ced_targetSKU %targetedition% |
8643 | if not defined key if defined targetSKU call :ced_windowskey | 9910 | if defined targetSKU call :ced_windowskey |
8644 | if defined key if not defined pkeychannel call :dk_pkeychannel %key% | 9911 | if defined key if defined pkeychannel set _chan=%pkeychannel% |
9912 | if not defined key call :changeeditiondata | ||
8645 | 9913 | ||
8646 | if not defined key ( | 9914 | if not defined key ( |
8647 | %eline% | 9915 | %eline% |
8648 | echo [%targetedition% ^| %winbuild%] | 9916 | echo [%targetedition% ^| %winbuild%] |
8649 | echo Unable to get product key from pkeyhelper.dll | 9917 | echo Unable to get product key from pkeyhelper.dll |
8650 | echo Make sure you are using updated version of the script. | 9918 | echo: |
8651 | echo https://massgrave.dev | 9919 | echo Check this page for help. https://%mas%/troubleshoot |
8652 | goto ced_done | 9920 | goto ced_done |
8653 | ) | 9921 | ) |
8654 | 9922 | ||
@@ -8656,13 +9924,14 @@ goto ced_done | |||
8656 | 9924 | ||
8657 | cls | 9925 | cls |
8658 | echo: | 9926 | echo: |
8659 | echo Changing the Current Edition [%osedition%] to [%targetedition%] | 9927 | echo Changing the Current Edition [%osedition%] %winbuild% to [%targetedition%] |
8660 | echo: | 9928 | echo: |
8661 | echo Applying the command with %pkeychannel% Key | 9929 | echo Applying the command with %_chan% Key |
8662 | echo DISM /online /Set-Edition:%targetedition% /ProductKey:%key% /AcceptEula | 9930 | echo DISM /online /Set-Edition:%targetedition% /ProductKey:%key% /AcceptEula |
8663 | DISM /online /Set-Edition:%targetedition% /ProductKey:%key% /AcceptEula | 9931 | DISM /online /Set-Edition:%targetedition% /ProductKey:%key% /AcceptEula |
8664 | 9932 | ||
8665 | call :dk_color %Magenta% "Make sure to restart the system." | 9933 | call :dk_color %Blue% "You must restart the system at this stage." |
9934 | echo 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 | ||
8671 | echo: | 9940 | echo: |
8672 | call :dk_color %_Yellow% "Press any key to %_exitmsg%..." | 9941 | call :dk_color %_Yellow% "Press any key to %_exitmsg%..." |
8673 | pause >nul | 9942 | pause %nul1% |
9943 | exit /b | ||
9944 | |||
9945 | ::======================================================================================================================================== | ||
9946 | |||
9947 | :: Get Edition list | ||
9948 | |||
9949 | :ced_edilist | ||
9950 | |||
9951 | if %_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%')" | ||
9952 | if %_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 ") | ||
8674 | exit /b | 9954 | exit /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:[ | ||
10219 | param ( | ||
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) | ||
10239 | if (!$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 | ||
10257 | if %winbuild% GTR 17763 exit /b | ||
10258 | if exist "%SystemRoot%\Servicing\Packages\Microsoft-Windows-Server*CorEdition~*.mum" (set Cor=Cor) else (set Cor=) | ||
10259 | |||
8947 | set h= | 10260 | set h= |
8948 | for %%# in ( | 10261 | for %%# in ( |
8949 | 44N%h%YX-TK%h%R9D-CCM2%h%D-V6%h%B8F-HQ%h%WWR__Volume:MAK_Enterprise | 10262 | XGV%h%PP-NM%h%H47-7TT%h%HJ-W%h%3FW7-8HV%h%2C__OEM:NONSLP_Enterprise |
8950 | D6R%h%D9-D4%h%N8T-RT9Q%h%X-YW%h%6YT-FC%h%WWJ______Retail_Starter | 10263 | D6R%h%D9-D4%h%N8T-RT9%h%QX-Y%h%W6YT-FCW%h%WJ______Retail_Starter |
8951 | 3V6%h%Q6-NQ%h%XCX-V8YX%h%R-9Q%h%CYV-QP%h%FCT__Volume:MAK_EnterpriseN | 10264 | 3V6%h%Q6-NQ%h%XCX-V8Y%h%XR-9%h%QCYV-QPF%h%CT__Volume:MAK_EnterpriseN |
8952 | 3NF%h%XW-2T%h%27M-2BDW%h%6-4G%h%HRV-68%h%XRX______Retail_StarterN | 10265 | 3NF%h%XW-2T%h%27M-2BD%h%W6-4%h%GHRV-68X%h%RX______Retail_StarterN |
8953 | VK7%h%JG-NP%h%HTM-C97J%h%M-9M%h%PGT-3V%h%66T______Retail_Professional | 10266 | VK7%h%JG-NP%h%HTM-C97%h%JM-9%h%MPGT-3V6%h%6T______Retail_Professional |
8954 | 2B8%h%7N-8K%h%FHP-DKV6%h%R-Y2%h%C8J-PK%h%CKT______Retail_ProfessionalN | 10267 | 2B8%h%7N-8K%h%FHP-DKV%h%6R-Y%h%2C8J-PKC%h%KT______Retail_ProfessionalN |
8955 | 4CP%h%RK-NM%h%3K3-X6XX%h%Q-RX%h%X86-WX%h%CHW______Retail_CoreN | 10268 | 4CP%h%RK-NM%h%3K3-X6X%h%XQ-R%h%XX86-WXC%h%HW______Retail_CoreN |
8956 | N24%h%34-X9%h%D7W-8PF6%h%X-8D%h%V9T-8T%h%YMD______Retail_CoreCountrySpecific | 10269 | N24%h%34-X9%h%D7W-8PF%h%6X-8%h%DV9T-8TY%h%MD______Retail_CoreCountrySpecific |
8957 | BT7%h%9Q-G7%h%N6G-PGBY%h%W-4Y%h%WX6-6F%h%4BT______Retail_CoreSingleLanguage | 10270 | BT7%h%9Q-G7%h%N6G-PGB%h%YW-4%h%YWX6-6F4%h%BT______Retail_CoreSingleLanguage |
8958 | YTM%h%G3-N6%h%DKC-DKB7%h%7-7M%h%9GH-8H%h%VX7______Retail_Core | 10271 | YTM%h%G3-N6%h%DKC-DKB%h%77-7%h%M9GH-8HV%h%X7______Retail_Core |
8959 | XKC%h%NC-J2%h%6Q9-KFHD%h%2-FK%h%THY-KD%h%72Y__OEM:NONSLP_PPIPro | 10272 | XKC%h%NC-J2%h%6Q9-KFH%h%D2-F%h%KTHY-KD7%h%2Y__OEM:NONSLP_PPIPro |
8960 | YNM%h%GQ-8R%h%YV3-4PGQ%h%3-C8%h%XTP-7C%h%FBY______Retail_Education | 10273 | YNM%h%GQ-8R%h%YV3-4PG%h%Q3-C%h%8XTP-7CF%h%BY______Retail_Education |
8961 | 84N%h%GF-MH%h%BT6-FXBX%h%8-QW%h%JK7-DR%h%R8H______Retail_EducationN | 10274 | 84N%h%GF-MH%h%BT6-FXB%h%X8-Q%h%WJK7-DRR%h%8H______Retail_EducationN |
8962 | KCN%h%VH-YK%h%WX8-GJJB%h%9-H9%h%FDT-6F%h%7W2__Volume:MAK_EnterpriseS_VB | 10275 | NK9%h%6Y-D9%h%CD8-W44%h%CQ-R%h%8YTK-DYJ%h%WX__OEM:NONSLP_EnterpriseS_RS1 |
8963 | VBX%h%36-N7%h%DDY-M9H6%h%2-83%h%BMJ-CP%h%R42__Volume:MAK_EnterpriseS_RS5 | 10276 | FWN%h%7H-PF%h%93Q-4GG%h%P8-M%h%8RF3-MDW%h%WW__OEM:NONSLP_EnterpriseS_TH |
8964 | PN3%h%KR-JX%h%M7T-46HM%h%4-MC%h%QGK-7X%h%PJQ__Volume:MAK_EnterpriseS_RS1 | 10277 | 2DB%h%W3-N2%h%PJG-MVH%h%W3-G%h%7TDK-9HK%h%R4__Volume:MAK_EnterpriseSN_RS1 |
8965 | DVW%h%KN-3G%h%CMV-Q2XF%h%4-DD%h%PGM-VQ%h%WWY__Volume:MAK_EnterpriseS_TH | 10278 | NTX%h%6B-BR%h%YC2-K67%h%86-F%h%6MVQ-M7V%h%2X__Volume:MAK_EnterpriseSN_TH |
8966 | RQF%h%NW-9T%h%PM3-JQ73%h%T-QV%h%4VQ-DV%h%9PT__Volume:MAK_EnterpriseSN_VB | 10279 | G3K%h%NM-CH%h%G6T-R36%h%X3-9%h%QDG6-8M8%h%K9______Retail_ProfessionalSingleLanguage |
8967 | M33%h%WV-NH%h%Y3C-R7FP%h%M-BQ%h%GPT-23%h%9PG__Volume:MAK_EnterpriseSN_RS5 | 10280 | HNG%h%CC-Y3%h%8KG-QVK%h%8D-W%h%MWRK-X86%h%VK______Retail_ProfessionalCountrySpecific |
8968 | 2DB%h%W3-N2%h%PJG-MVHW%h%3-G7%h%TDK-9H%h%KR4__Volume:MAK_EnterpriseSN_RS1 | 10281 | DXG%h%7C-N3%h%6C4-C4H%h%TG-X%h%4T3X-2YV%h%77______Retail_ProfessionalWorkstation |
8969 | NTX%h%6B-BR%h%YC2-K678%h%6-F6%h%MVQ-M7%h%V2X__Volume:MAK_EnterpriseSN_TH | 10282 | WYP%h%NQ-8C%h%467-V2W%h%6J-T%h%X4WX-WT2%h%RQ______Retail_ProfessionalWorkstationN |
8970 | G3K%h%NM-CH%h%G6T-R36X%h%3-9Q%h%DG6-8M%h%8K9______Retail_ProfessionalSingleLanguage | 10283 | 8PT%h%T6-RN%h%W4C-6V7%h%J2-C%h%2D3X-MHB%h%PB______Retail_ProfessionalEducation |
8971 | HNG%h%CC-Y3%h%8KG-QVK8%h%D-WM%h%WRK-X8%h%6VK______Retail_ProfessionalCountrySpecific | 10284 | GJT%h%YN-HD%h%MQY-FRR%h%76-H%h%VGC7-QPF%h%8P______Retail_ProfessionalEducationN |
8972 | DXG%h%7C-N3%h%6C4-C4HT%h%G-X4%h%T3X-2Y%h%V77______Retail_ProfessionalWorkstation | 10285 | C4N%h%TJ-CX%h%6Q2-VXD%h%MR-X%h%VKGM-F9D%h%JC__Volume:MAK_EnterpriseG |
8973 | WYP%h%NQ-8C%h%467-V2W6%h%J-TX%h%4WX-WT%h%2RQ______Retail_ProfessionalWorkstationN | 10286 | 46P%h%N6-R9%h%BK9-CVH%h%KB-H%h%WQ9V-MBJ%h%Y8__Volume:MAK_EnterpriseGN |
8974 | 8PT%h%T6-RN%h%W4C-6V7J%h%2-C2%h%D3X-MH%h%BPB______Retail_ProfessionalEducation | 10287 | NJC%h%F7-PW%h%8QT-332%h%4D-6%h%88JX-2YV%h%66______Retail_ServerRdsh |
8975 | GJT%h%YN-HD%h%MQY-FRR7%h%6-HV%h%GC7-QP%h%F8P______Retail_ProfessionalEducationN | 10288 | V3W%h%VW-N2%h%PV2-CGW%h%C3-3%h%4QGF-VMJ%h%2C______Retail_Cloud |
8976 | C4N%h%TJ-CX%h%6Q2-VXDM%h%R-XV%h%KGM-F9%h%DJC__Volume:MAK_EnterpriseG | 10289 | NH9%h%J3-68%h%WK7-6FB%h%93-4%h%K3DF-DJ4%h%F6______Retail_CloudN |
8977 | 46P%h%N6-R9%h%BK9-CVHK%h%B-HW%h%Q9V-MB%h%JY8__Volume:MAK_EnterpriseGN | 10290 | 2HN%h%6V-HG%h%TM8-6C9%h%7C-R%h%K67V-JQP%h%FD______Retail_CloudE |
8978 | NJC%h%F7-PW%h%8QT-3324%h%D-68%h%8JX-2Y%h%V66______Retail_ServerRdsh | 10291 | WC2%h%BQ-8N%h%RM3-FDD%h%YY-2%h%BFGV-KHK%h%QY_Volume:GVLK_ServerStandard%Cor%_RS1 |
8979 | V3W%h%VW-N2%h%PV2-CGWC%h%3-34%h%QGF-VM%h%J2C______Retail_Cloud | 10292 | CB7%h%KF-BW%h%N84-R7R%h%2Y-7%h%93K2-8XD%h%DG_Volume:GVLK_ServerDatacenter%Cor%_RS1 |
8980 | NH9%h%J3-68%h%WK7-6FB9%h%3-4K%h%3DF-DJ%h%4F6______Retail_CloudN | 10293 | JCK%h%RF-N3%h%7P4-C2D%h%82-9%h%YXRT-4M6%h%3B_Volume:GVLK_ServerSolution_RS1 |
8981 | 2HN%h%6V-HG%h%TM8-6C97%h%C-RK%h%67V-JQ%h%PFD______Retail_CloudE | 10294 | QN4%h%C6-GB%h%JD2-FB4%h%22-G%h%HWJK-GJG%h%2R_Volume:GVLK_ServerCloudStorage_RS1 |
8982 | XQQ%h%YW-NF%h%FMW-XJPB%h%H-K8%h%732-CK%h%FFD______OEM:DM_IoTEnterprise | 10295 | VP3%h%4G-4N%h%PPG-79J%h%TQ-8%h%64T4-R3M%h%QX_Volume:GVLK_ServerAzureCor_RS1 |
8983 | QPM%h%6N-7J%h%2WJ-P88H%h%H-P3%h%YRH-YY%h%74H__OEM:NONSLP_IoTEnterpriseS_VB | 10296 | 9JQ%h%NQ-V8%h%HQ6-PKB%h%8H-G%h%GHRY-R62%h%H6______Retail_ServerAzureNano_RS1 |
8984 | KBN%h%8V-HF%h%GQ4-MGXV%h%D-34%h%7P6-PD%h%QGT_Volume:GVLK_IoTEnterpriseS_NI | 10297 | VN8%h%D3-PR%h%82H-DB6%h%BJ-J%h%9P4M-92F%h%6J______Retail_ServerStorageStandard_RS1 |
8985 | K9V%h%KN-3B%h%GWV-Y624%h%W-MC%h%RMQ-BH%h%DCD______Retail_CloudEditionN | 10298 | 48T%h%QX-NV%h%K3R-D8Q%h%R3-G%h%THHM-8FH%h%XC______Retail_ServerStorageWorkgroup_RS1 |
8986 | KY7%h%PN-VR%h%6RX-83W6%h%Y-6D%h%DYQ-T6%h%R4W______Retail_CloudEdition | 10299 | 2HX%h%DN-KR%h%XHB-GPY%h%C7-Y%h%CKFJ-7FV%h%DG_Volume:GVLK_ServerDatacenterACor_RS3 |
8987 | MPB%h%3G-XN%h%BR7-CC43%h%M-FG%h%64B-F9%h%GBK______Retail_IoTEnterpriseSK | 10300 | PTX%h%N8-JF%h%HJM-4WC%h%78-M%h%PCBR-9W4%h%KR_Volume:GVLK_ServerStandardACor_RS3 |
8988 | ) do ( | 10301 | ) do ( |
8989 | for /f "tokens=1-4 delims=_" %%A in ("%%#") do if /i %targetedition%==%%C ( | 10302 | for /f "tokens=1-4 delims=_" %%A in ("%%#") do if /i %targetedition%==%%C ( |
8990 | 10303 | ||
@@ -8993,40 +10306,13 @@ set 4th=%%D | |||
8993 | if not defined 4th ( | 10306 | if not defined 4th ( |
8994 | set "key=%%A" & set "_chan=%%B" | 10307 | set "key=%%A" & set "_chan=%%B" |
8995 | ) else ( | 10308 | ) else ( |
8996 | echo "%branch%" | find "%%D" 1>nul && (set "key=%%A" & set "_chan=%%B") | 10309 | echo "%branch%" | find /i "%%D" %nul1% && (set "key=%%A" & set "_chan=%%B") |
8997 | ) | 10310 | ) |
8998 | ) | 10311 | ) |
8999 | ) | 10312 | ) |
9000 | ) | 10313 | ) |
9001 | exit /b | 10314 | exit /b |
9002 | 10315 | ||
9003 | ::======================================================================================================================================== | ||
9004 | |||
9005 | :changeeditionserverdata | ||
9006 | |||
9007 | if 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 | |||
9011 | set h= | ||
9012 | for %%# in ( | ||
9013 | WC2%h%BQ-8N%h%RM3-FDD%h%YY-2B%h%FGV-KHK%h%QY_RS1_ServerStandard%Cor% | ||
9014 | CB7%h%KF-BW%h%N84-R7R%h%2Y-79%h%3K2-8XD%h%DG_RS1_ServerDatacenter%Cor% | ||
9015 | JCK%h%RF-N3%h%7P4-C2D%h%82-9Y%h%XRT-4M6%h%3B_RS1_ServerSolution | ||
9016 | QN4%h%C6-GB%h%JD2-FB4%h%22-GH%h%WJK-GJG%h%2R_RS1_ServerCloudStorage | ||
9017 | VP3%h%4G-4N%h%PPG-79J%h%TQ-86%h%4T4-R3M%h%QX_RS1_ServerAzureCor | ||
9018 | 9JQ%h%NQ-V8%h%HQ6-PKB%h%8H-GG%h%HRY-R62%h%H6_RS1_ServerAzureNano | ||
9019 | VN8%h%D3-PR%h%82H-DB6%h%BJ-J9%h%P4M-92F%h%6J_RS1_ServerStorageStandard | ||
9020 | 48T%h%QX-NV%h%K3R-D8Q%h%R3-GT%h%HHM-8FH%h%XC_RS1_ServerStorageWorkgroup | ||
9021 | 2HX%h%DN-KR%h%XHB-GPY%h%C7-YC%h%KFJ-7FV%h%DG_RS3_ServerDatacenterACor | ||
9022 | PTX%h%N8-JF%h%HJM-4WC%h%78-MP%h%CBR-9W4%h%KR_RS3_ServerStandardACor | ||
9023 | ) do ( | ||
9024 | for /f "tokens=1-3 delims=_" %%A in ("%%#") do if /i %targetedition%==%%C ( | ||
9025 | echo "%branch%" | find /i "%%B" 1>nul && (set "key=%%A") | ||
9026 | ) | ||
9027 | ) | ||
9028 | exit /b | ||
9029 | |||
9030 | :+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ | 10316 | :+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
9031 | 10317 | ||
9032 | :MASend | 10318 | :MASend |
@@ -9036,4 +10322,5 @@ echo Press any key to exit... | |||
9036 | pause >nul | 10322 | pause >nul |
9037 | exit /b | 10323 | exit /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 | |||
31 | set "PATH=%SystemRoot%\System32;%SystemRoot%\System32\wbem;%SystemRoot%\System32\WindowsPowerShell\v1.0\" | ||
32 | if exist "%SystemRoot%\Sysnative\reg.exe" ( | ||
33 | set "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" | |||
33 | for %%# in (%*) do ( | 40 | for %%# in (%*) do ( |
34 | if /i "%%#"=="r1" set r1=1 | 41 | if /i "%%#"=="r1" set r1=1 |
35 | if /i "%%#"=="r2" set r2=1 | 42 | if /i "%%#"=="r2" set r2=1 |
43 | if /i "%%#"=="-qedit" ( | ||
44 | reg add HKCU\Console /v QuickEdit /t REG_DWORD /d "1" /f 1>nul | ||
45 | rem check the code below admin elevation to understand why it's here | ||
46 | ) | ||
36 | ) | 47 | ) |
37 | 48 | ||
38 | if exist %SystemRoot%\Sysnative\cmd.exe if not defined r1 ( | 49 | if exist %SystemRoot%\Sysnative\cmd.exe if not defined r1 ( |
@@ -49,22 +60,34 @@ start %SystemRoot%\SysArm32\cmd.exe /c ""!_cmdf!" %* r2" | |||
49 | exit /b | 60 | exit /b |
50 | ) | 61 | ) |
51 | 62 | ||
52 | :: Set Path variable, it helps if it is misconfigured in the system | 63 | ::======================================================================================================================================== |
53 | 64 | ||
54 | set "PATH=%SystemRoot%\System32;%SystemRoot%\System32\wbem;%SystemRoot%\System32\WindowsPowerShell\v1.0\" | 65 | set "blank=" |
55 | if exist "%SystemRoot%\Sysnative\reg.exe" ( | 66 | set "mas=mass%blank%grave.dev" |
56 | set "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 | |||
70 | sc query Null | find /i "RUNNING" | ||
71 | if %errorlevel% NEQ 0 ( | ||
72 | echo: | ||
73 | echo Null service is not running, script may crash... | ||
74 | echo: | ||
75 | echo: | ||
76 | echo Help - https://%mas%/troubleshoot.html | ||
77 | echo: | ||
78 | echo: | ||
79 | ping 127.0.0.1 -n 10 | ||
57 | ) | 80 | ) |
81 | cls | ||
58 | 82 | ||
59 | :: Check LF line ending | 83 | :: Check LF line ending |
60 | 84 | ||
61 | pushd "%~dp0" | 85 | pushd "%~dp0" |
62 | >nul findstr /rxc:".*" "%~nx0" | 86 | >nul findstr /v "$" "%~nx0" && ( |
63 | if not %errorlevel%==0 ( | ||
64 | echo: | 87 | echo: |
65 | echo Error: Script either has LF line ending issue, or it failed to read itself. | 88 | echo Error: Script either has LF line ending issue or an empty line at the end of the script is missing. |
66 | echo: | 89 | echo: |
67 | ping 127.0.0.1 -n 6 > nul | 90 | ping 127.0.0.1 -n 6 >nul |
68 | popd | 91 | popd |
69 | exit /b | 92 | exit /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 | ||
97 | set winbuild=1 | 120 | set "nul1=1>nul" |
121 | set "nul2=2>nul" | ||
122 | set "nul6=2^>nul" | ||
98 | set "nul=>nul 2>&1" | 123 | set "nul=>nul 2>&1" |
124 | |||
99 | set psc=powershell.exe | 125 | set psc=powershell.exe |
126 | set winbuild=1 | ||
100 | for /f "tokens=6 delims=[]. " %%G in ('ver') do set winbuild=%%G | 127 | for /f "tokens=6 delims=[]. " %%G in ('ver') do set winbuild=%%G |
101 | 128 | ||
102 | set _NCS=1 | 129 | set _NCS=1 |
103 | if %winbuild% LSS 10586 set _NCS=0 | 130 | if %winbuild% LSS 10586 set _NCS=0 |
104 | if %winbuild% GEQ 10586 reg query "HKCU\Console" /v ForceV2 2>nul | find /i "0x0" 1>nul && (set _NCS=0) | 131 | if %winbuild% GEQ 10586 reg query "HKCU\Console" /v ForceV2 %nul2% | find /i "0x0" %nul1% && (set _NCS=0) |
105 | 132 | ||
106 | if %_NCS% EQU 1 ( | 133 | if %_NCS% EQU 1 ( |
107 | for /F %%a in ('echo prompt $E ^| cmd') do set "esc=%%a" | 134 | for /F %%a in ('echo prompt $E ^| cmd') do set "esc=%%a" |
108 | set "Red="41;97m"" | 135 | set "Red="41;97m"" |
109 | set "Gray="100;97m"" | 136 | set "Gray="100;97m"" |
110 | set "Green="42;97m"" | 137 | set "Green="42;97m"" |
111 | set "Magenta="45;97m"" | 138 | set "Blue="44;97m"" |
112 | set "_White="40;37m"" | 139 | set "_White="40;37m"" |
113 | set "_Green="40;92m"" | 140 | set "_Green="40;92m"" |
114 | set "_Yellow="40;93m"" | 141 | set "_Yellow="40;93m"" |
@@ -116,7 +143,7 @@ set "_Yellow="40;93m"" | |||
116 | set "Red="Red" "white"" | 143 | set "Red="Red" "white"" |
117 | set "Gray="Darkgray" "white"" | 144 | set "Gray="Darkgray" "white"" |
118 | set "Green="DarkGreen" "white"" | 145 | set "Green="DarkGreen" "white"" |
119 | set "Magenta="Darkmagenta" "white"" | 146 | set "Blue="Blue" "white"" |
120 | set "_White="Black" "Gray"" | 147 | set "_White="Black" "Gray"" |
121 | set "_Green="Black" "Green"" | 148 | set "_Green="Black" "Green"" |
122 | set "_Yellow="Black" "Yellow"" | 149 | set "_Yellow="Black" "Yellow"" |
@@ -124,13 +151,19 @@ set "_Yellow="Black" "Yellow"" | |||
124 | 151 | ||
125 | set "nceline=echo: &echo ==== ERROR ==== &echo:" | 152 | set "nceline=echo: &echo ==== ERROR ==== &echo:" |
126 | set "eline=echo: &call :dk_color %Red% "==== ERROR ====" &echo:" | 153 | set "eline=echo: &call :dk_color %Red% "==== ERROR ====" &echo:" |
127 | if %~z0 GEQ 200000 (set "_exitmsg=Go back") else (set "_exitmsg=Exit") | 154 | if %~z0 GEQ 200000 ( |
155 | set "_exitmsg=Go back" | ||
156 | set "_fixmsg=Go back to Main Menu, select Troubleshoot and run Fix Licensing option." | ||
157 | ) else ( | ||
158 | set "_exitmsg=Exit" | ||
159 | set "_fixmsg=In MAS folder, run Troubleshoot script and select Fix Licensing option." | ||
160 | ) | ||
128 | 161 | ||
129 | ::======================================================================================================================================== | 162 | ::======================================================================================================================================== |
130 | 163 | ||
131 | if %winbuild% LSS 10240 ( | 164 | if %winbuild% LSS 10240 ( |
132 | %eline% | 165 | %eline% |
133 | echo Unsupported OS version detected. | 166 | echo Unsupported OS version detected [%winbuild%]. |
134 | echo HWID Activation is supported only for Windows 10/11. | 167 | echo HWID Activation is supported only for Windows 10/11. |
135 | echo Use Online KMS Activation option. | 168 | echo Use Online KMS Activation option. |
136 | goto dk_done | 169 | goto dk_done |
@@ -167,7 +200,7 @@ setlocal EnableDelayedExpansion | |||
167 | 200 | ||
168 | ::======================================================================================================================================== | 201 | ::======================================================================================================================================== |
169 | 202 | ||
170 | echo "!_batf!" | find /i "!_ttemp!" 1>nul && ( | 203 | echo "!_batf!" | find /i "!_ttemp!" %nul1% && ( |
171 | if /i not "!_work!"=="!_ttemp!" ( | 204 | if /i not "!_work!"=="!_ttemp!" ( |
172 | %eline% | 205 | %eline% |
173 | echo Script is launched from the temp folder, | 206 | echo 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 || ( |
186 | if not defined _elev %nul% %psc% "start cmd.exe -arg '/c \"!_PSarg:'=''!\"' -verb runas" && exit /b | 219 | if not defined _elev %psc% "start cmd.exe -arg '/c \"!_PSarg:'=''!\"' -verb runas" && exit /b |
187 | %eline% | 220 | %eline% |
188 | echo This script require admin privileges. | 221 | echo This script require admin privileges. |
189 | echo To do so, right click on this script and select 'Run as administrator'. | 222 | echo 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 | |||
231 | if %_unattended%==1 set quedit=1 | ||
232 | for %%# in (%_args%) do (if /i "%%#"=="-qedit" set quedit=1) | ||
233 | |||
234 | reg query HKCU\Console /v QuickEdit %nul2% | find /i "0x0" %nul1% || if not defined quedit ( | ||
235 | reg add HKCU\Console /v QuickEdit /t REG_DWORD /d "0" /f %nul1% | ||
236 | start cmd.exe /c ""!_batf!" %_args% -qedit" | ||
237 | rem quickedit reset code is added at the starting of the script instead of here because it takes time to reflect in some cases | ||
238 | exit /b | ||
239 | ) | ||
240 | |||
241 | ::======================================================================================================================================== | ||
242 | |||
195 | cls | 243 | cls |
196 | mode 102, 34 | 244 | mode 108, 34 |
197 | title HWID Activation | 245 | title 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 | |||
249 | sc start wuauserv %nul% | ||
250 | |||
199 | echo: | 251 | echo: |
200 | echo Initializing... | 252 | echo Initializing... |
201 | call :dk_product | 253 | call :dk_product |
@@ -235,7 +287,7 @@ cls | |||
235 | :: Check Evaluation version | 287 | :: Check Evaluation version |
236 | 288 | ||
237 | if exist "%SystemRoot%\Servicing\Packages\Microsoft-Windows-*EvalEdition~*.mum" ( | 289 | if exist "%SystemRoot%\Servicing\Packages\Microsoft-Windows-*EvalEdition~*.mum" ( |
238 | reg query "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion" /v EditionID 2>nul | find /i "Eval" 1>nul && ( | 290 | reg query "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion" /v EditionID %nul2% | find /i "Eval" %nul1% && ( |
239 | %eline% | 291 | %eline% |
240 | echo [%winos% ^| %winbuild%] | 292 | echo [%winos% ^| %winbuild%] |
241 | echo: | 293 | echo: |
@@ -243,7 +295,7 @@ echo Evaluation Editions cannot be activated. | |||
243 | echo You need to install full version of %winos% | 295 | echo You need to install full version of %winos% |
244 | echo: | 296 | echo: |
245 | echo Download it from here, | 297 | echo Download it from here, |
246 | echo https://massgrave.dev/genuine-installation-media.html | 298 | echo https://%mas%/genuine-installation-media.html |
247 | goto dk_done | 299 | goto 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 | ||
255 | set osSKU= | 307 | set osSKU= |
256 | set regSKU= | 308 | set slcSKU= |
257 | set wmiSKU= | 309 | set wmiSKU= |
310 | set regSKU= | ||
258 | 311 | ||
259 | for /f "tokens=3 delims=." %%a in ('reg query "HKLM\SYSTEM\CurrentControlSet\Control\ProductOptions" /v OSProductPfn 2^>nul') do set "regSKU=%%a" | 312 | if %winbuild% GEQ 14393 (set info=Kernel-BrandingInfo) else (set info=Kernel-ProductInfo) |
260 | if %_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" | 313 | set d1=%ref% [void]$TypeBuilder.DefinePInvokeMethod('SLGetWindowsInformationDWORD', 'slc.dll', 'Public, Static', 1, [int], @([String], [int].MakeByRefType()), 1, 3); |
261 | if %_wmic% EQU 0 for /f "tokens=1" %%a in ('%psc% "([WMI]'Win32_OperatingSystem=@').OperatingSystemSKU" 2^>nul') do if not errorlevel 1 set "wmiSKU=%%a" | 314 | set d1=%d1% $Sku = 0; [void]$TypeBuilder.CreateType()::SLGetWindowsInformationDWORD('%info%', [ref]$Sku); $Sku |
315 | for /f "delims=" %%s in ('"%psc% %d1%"') do if not errorlevel 1 (set slcSKU=%%s) | ||
316 | if "%slcSKU%"=="0" set slcSKU= | ||
317 | if 1%slcSKU% NEQ +1%slcSKU% set slcSKU= | ||
262 | 318 | ||
263 | set osSKU=%wmiSKU% | 319 | for /f "tokens=3 delims=." %%a in ('reg query "HKLM\SYSTEM\CurrentControlSet\Control\ProductOptions" /v OSProductPfn %nul6%') do set "regSKU=%%a" |
320 | if %_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" | ||
321 | if %_wmic% EQU 0 for /f "tokens=1" %%a in ('%psc% "([WMI]'Win32_OperatingSystem=@').OperatingSystemSKU" %nul6%') do if not errorlevel 1 set "wmiSKU=%%a" | ||
322 | |||
323 | set osSKU=%slcSKU% | ||
324 | if not defined osSKU set osSKU=%wmiSKU% | ||
264 | if not defined osSKU set osSKU=%regSKU% | 325 | if not defined osSKU set osSKU=%regSKU% |
265 | 326 | ||
266 | if not defined osSKU ( | 327 | if not defined osSKU ( |
@@ -276,7 +337,8 @@ set error= | |||
276 | cls | 337 | cls |
277 | echo: | 338 | echo: |
278 | for /f "skip=2 tokens=2*" %%a in ('reg query "HKLM\SYSTEM\CurrentControlSet\Control\Session Manager\Environment" /v PROCESSOR_ARCHITECTURE') do set arch=%%b | 339 | for /f "skip=2 tokens=2*" %%a in ('reg query "HKLM\SYSTEM\CurrentControlSet\Control\Session Manager\Environment" /v PROCESSOR_ARCHITECTURE') do set arch=%%b |
279 | echo Checking OS Info [%winos% ^| %winbuild% ^| %arch%] | 340 | for /f "tokens=6-7 delims=[]. " %%i in ('ver') do if "%%j"=="" (set fullbuild=%%i) else (set fullbuild=%%i.%%j) |
341 | echo 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 | ||
304 | set _WSH=1 | 366 | set _WSH=1 |
305 | reg query "HKCU\SOFTWARE\Microsoft\Windows Script Host\Settings" /v Enabled 2>nul | find /i "0x0" 1>nul && (set _WSH=0) | 367 | reg query "HKCU\SOFTWARE\Microsoft\Windows Script Host\Settings" /v Enabled %nul2% | find /i "0x0" %nul1% && (set _WSH=0) |
306 | reg query "HKLM\SOFTWARE\Microsoft\Windows Script Host\Settings" /v Enabled 2>nul | find /i "0x0" 1>nul && (set _WSH=0) | 368 | reg query "HKLM\SOFTWARE\Microsoft\Windows Script Host\Settings" /v Enabled %nul2% | find /i "0x0" %nul1% && (set _WSH=0) |
307 | 369 | ||
308 | if %_WSH% EQU 0 ( | 370 | if %_WSH% EQU 0 ( |
309 | reg add "HKLM\Software\Microsoft\Windows Script Host\Settings" /v Enabled /t REG_DWORD /d 1 /f %nul% | 371 | reg 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 | ||
333 | set updatesblock= | 395 | set updatesblock= |
334 | echo: %serv_ste% | findstr /i "wuauserv" %nul% && set updatesblock=1 | 396 | echo: %serv_cor% %serv_ste% | findstr /i "wuauserv" %nul% && set updatesblock=1 |
335 | for /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 | |
336 | if exist "%SystemRoot%\System32\WaaSMedicSvc.dll" ( | 398 | sc start UsoSvc %nul% |
337 | for /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 | 399 | if %errorlevel% NEQ 1056 if %errorlevel% NEQ 0 set updatesblock=1 |
400 | |||
401 | if %winbuild% GEQ 17134 ( | ||
402 | sc start WaaSMedicSvc %nul% | ||
403 | if !errorlevel! NEQ 1056 if !errorlevel! NEQ 0 set updatesblock=1 | ||
338 | ) | 404 | ) |
339 | 405 | ||
340 | reg query HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer /v SettingsPageVisibility 2>nul | find /i "windowsupdate" %nul% && set updatesblock=1 | 406 | reg query HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer /v SettingsPageVisibility %nul2% | find /i "windowsupdate" %nul% && set updatesblock=1 |
341 | reg query HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\WindowsUpdateSysprepInProgress %nul% && set updatesblock=1 | 407 | reg query HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\WindowsUpdateSysprepInProgress %nul% && set updatesblock=1 |
342 | reg query HKLM\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate /s 2>nul | findstr /i "NoAutoUpdate DisableWindowsUpdateAccess" %nul% && set updatesblock=1 | 408 | reg query HKLM\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate /s %nul2% | findstr /i "NoAutoUpdate DisableWindowsUpdateAccess" %nul% && set updatesblock=1 |
343 | 409 | ||
344 | if defined updatesblock ( | 410 | if defined updatesblock ( |
345 | call :dk_color %Gray% "Checking Windows Update Blockers [Found]" | 411 | call :dk_color %Gray% "Checking Windows Update Blockers [Found]" |
346 | if defined applist echo: %serv_e% | find /i "wuauserv" %nul% && ( | 412 | if defined applist echo: %serv_e% | find /i "wuauserv" %nul% && ( |
347 | call :dk_color %Magenta% "Windows Update Service [wuauserv] is not working. Enable it incase if you have disabled it." | 413 | call :dk_color %Blue% "Windows Update is not working. Enable it incase if you have disabled it." |
414 | reg 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 | ||
351 | reg query "HKLM\SOFTWARE\Policies\Microsoft\WindowsStore" /v DisableStoreApps 2>nul | find /i "0x1" %nul% && ( | 418 | reg query "HKLM\SOFTWARE\Policies\Microsoft\WindowsStore" /v DisableStoreApps %nul2% | find /i "0x1" %nul% && ( |
352 | call :dk_color %Gray% "Checking Store App Blocker [Found]" | 419 | call :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]" | |||
359 | set key= | 426 | set key= |
360 | set altkey= | 427 | set altkey= |
361 | set changekey= | 428 | set changekey= |
362 | set curedition= | 429 | set altapplist= |
363 | set altedition= | 430 | set altedition= |
364 | set notworking= | 431 | set notworking= |
365 | set actidnotfound= | ||
366 | |||
367 | for /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 | ||
369 | if defined applist call :hwiddata key attempt1 | 433 | if defined applist call :hwiddata key |
370 | if not defined key call :hwiddata key attempt2 | 434 | if not defined key ( |
435 | for /f "delims=" %%a in ('%psc% "$f=[io.file]::ReadAllText('!_batp!') -split ':getactivationid\:.*';iex ($f[1]);"') do (set altapplist=%%a) | ||
436 | if defined altapplist call :hwiddata key | ||
437 | ) | ||
371 | 438 | ||
372 | if defined notworking call :hwidfallback | 439 | if defined notworking call :hwidfallback |
373 | if not defined key call :hwidfallback | 440 | if not defined key call :hwidfallback |
@@ -376,10 +443,6 @@ if defined altkey (set key=%altkey%&set changekey=1&set notworking=) | |||
376 | 443 | ||
377 | if defined notworking if defined notfoundaltactID ( | 444 | if defined notworking if defined notfoundaltactID ( |
378 | call :dk_color %Red% "Checking Alternate Edition For HWID [%altedition% Activation ID Not Found]" | 445 | call :dk_color %Red% "Checking Alternate Edition For HWID [%altedition% Activation ID Not Found]" |
379 | if exist "%SystemRoot%\Servicing\Packages\Microsoft-Windows-*EvalEdition~*.mum" ( | ||
380 | call :dk_color %Magenta% "Evaluation Windows Found. Install Full version of %winos%" | ||
381 | call :dk_color %Magenta% "Download it from https://massgrave.dev/genuine-installation-media.html" | ||
382 | ) | ||
383 | ) | 446 | ) |
384 | 447 | ||
385 | if not defined key ( | 448 | if not defined key ( |
@@ -387,7 +450,7 @@ if not defined key ( | |||
387 | echo [%winos% ^| %winbuild% ^| SKU:%osSKU%] | 450 | echo [%winos% ^| %winbuild% ^| SKU:%osSKU%] |
388 | echo Unable to find this product in the supported product list. | 451 | echo Unable to find this product in the supported product list. |
389 | echo Make sure you are using updated version of the script. | 452 | echo Make sure you are using updated version of the script. |
390 | echo https://massgrave.dev | 453 | echo https://%mas% |
391 | echo: | 454 | echo: |
392 | goto dk_done | 455 | goto dk_done |
393 | ) | 456 | ) |
@@ -400,7 +463,7 @@ if defined notworking set error=1 | |||
400 | 463 | ||
401 | echo: | 464 | echo: |
402 | if defined changekey ( | 465 | if defined changekey ( |
403 | call :dk_color %Magenta% "[%altedition%] Edition product key will be used to enable HWID activation." | 466 | call :dk_color %Blue% "[%altedition%] Edition product key will be used to enable HWID activation." |
404 | echo: | 467 | echo: |
405 | ) | 468 | ) |
406 | 469 | ||
@@ -417,8 +480,8 @@ echo Installing Generic Product Key [%key%] [Successful] | |||
417 | ) else ( | 480 | ) else ( |
418 | call :dk_color %Red% "Installing Generic Product Key [%key%] [Failed] %errorcode%" | 481 | call :dk_color %Red% "Installing Generic Product Key [%key%] [Failed] %errorcode%" |
419 | if not defined error ( | 482 | if not defined error ( |
420 | call :dk_color %Magenta% "In MAS, Goto Troubleshoot and run Fix Licensing option." | 483 | if defined altapplist call :dk_color %Red% "Activation ID not found for this key." |
421 | if defined actidnotfound call :dk_color %Red% "Activation ID not found for this key. Make sure you are using updated version of MAS." | 484 | call :dk_color %Blue% "%_fixmsg%" |
422 | set showfix=1 | 485 | set showfix=1 |
423 | ) | 486 | ) |
424 | set error=1 | 487 | set 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 | ||
431 | for /f "skip=2 tokens=2*" %%a in ('reg query "HKCU\Control Panel\International\Geo" /v Name 2^>nul') do set "name=%%b" | 494 | for /f "skip=2 tokens=2*" %%a in ('reg query "HKCU\Control Panel\International\Geo" /v Name %nul6%') do set "name=%%b" |
432 | for /f "skip=2 tokens=2*" %%a in ('reg query "HKCU\Control Panel\International\Geo" /v Nation 2^>nul') do set "nation=%%b" | 495 | for /f "skip=2 tokens=2*" %%a in ('reg query "HKCU\Control Panel\International\Geo" /v Nation %nul6%') do set "nation=%%b" |
433 | 496 | ||
434 | set regionchange= | 497 | set regionchange= |
435 | if not "%name%"=="US" ( | 498 | if 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 | ||
514 | if not exist %SystemRoot%\system32\ClipUp.exe ( | ||
515 | call :dk_color %Red% "Checking ClipUp.exe File [Not found, aborting the process]" | ||
516 | goto :dl_final | ||
517 | ) | ||
518 | |||
451 | set "tdir=%ProgramData%\Microsoft\Windows\ClipSVC\GenuineTicket" | 519 | set "tdir=%ProgramData%\Microsoft\Windows\ClipSVC\GenuineTicket" |
452 | if not exist "%tdir%\" md "%tdir%\" %nul% | 520 | if not exist "%tdir%\" md "%tdir%\" %nul% |
453 | 521 | ||
@@ -460,7 +528,7 @@ call :hwiddata ticket | |||
460 | copy /y /b "%tdir%\GenuineTicket" "%tdir%\GenuineTicket.xml" %nul% | 528 | copy /y /b "%tdir%\GenuineTicket" "%tdir%\GenuineTicket.xml" %nul% |
461 | 529 | ||
462 | if not exist "%tdir%\GenuineTicket.xml" ( | 530 | if not exist "%tdir%\GenuineTicket.xml" ( |
463 | call :dk_color %Red% "Generating GenuineTicket.xml [Failed]" | 531 | call :dk_color %Red% "Generating GenuineTicket.xml [Failed, aborting the process]" |
464 | echo [%encoded%] | 532 | echo [%encoded%] |
465 | if exist "%tdir%\Genuine*" del /f /q "%tdir%\Genuine*" %nul% | 533 | if exist "%tdir%\Genuine*" del /f /q "%tdir%\Genuine*" %nul% |
466 | goto :dl_final | 534 | goto :dl_final |
@@ -488,6 +556,12 @@ clipup -v -o | |||
488 | 556 | ||
489 | set rebuildinfo= | 557 | set rebuildinfo= |
490 | 558 | ||
559 | if not exist %ProgramData%\Microsoft\Windows\ClipSVC\tokens.dat ( | ||
560 | set error=1 | ||
561 | set rebuildinfo=1 | ||
562 | call :dk_color %Red% "Checking ClipSVC tokens.dat [Not Found]" | ||
563 | ) | ||
564 | |||
491 | %_xmlexist% ( | 565 | %_xmlexist% ( |
492 | set error=1 | 566 | set error=1 |
493 | set rebuildinfo=1 | 567 | set rebuildinfo=1 |
@@ -502,7 +576,7 @@ call :dk_color %Red% "Checking Ticket Migration [Failed]" | |||
502 | 576 | ||
503 | if defined applist if not defined showfix if defined rebuildinfo ( | 577 | if defined applist if not defined showfix if defined rebuildinfo ( |
504 | set showfix=1 | 578 | set showfix=1 |
505 | call :dk_color %Magenta% "In MAS, Goto Troubleshoot and run Fix Licensing option." | 579 | call :dk_color %Blue% "%_fixmsg%" |
506 | ) | 580 | ) |
507 | 581 | ||
508 | if exist "%tdir%\Genuine*" del /f /q "%tdir%\Genuine*" %nul% | 582 | if 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. | |||
522 | goto :dl_final | 596 | goto :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 | ||
527 | set resfail= | 603 | set resfail= |
@@ -538,21 +614,23 @@ set "d1=Add-Type -AssemblyName System.Net.Http;" | |||
538 | set "d1=!d1! $client = [System.Net.Http.HttpClient]::new();" | 614 | set "d1=!d1! $client = [System.Net.Http.HttpClient]::new();" |
539 | set "d1=!d1! $response = $client.GetAsync('https://%%#').GetAwaiter().GetResult();" | 615 | set "d1=!d1! $response = $client.GetAsync('https://%%#').GetAwaiter().GetResult();" |
540 | set "d1=!d1! $response.Content.ReadAsStringAsync().GetAwaiter().GetResult()" | 616 | set "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 | ||
544 | if not defined resfail ( | 620 | if 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 | ||
548 | if defined resfail ( | 624 | if defined resfail ( |
549 | set error=1 | 625 | set error=1 |
550 | echo: | 626 | echo: |
551 | call :dk_color %Red% "Checking Licensing Servers [Failed To Connect]" | 627 | call :dk_color %Red% "Checking Licensing Servers [Failed To Connect]" |
552 | call :dk_color2 %Magenta% "Check this page for help" %_Yellow% " https://massgrave.dev/licensing-servers-issue" | 628 | call :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 | ||
558 | if not defined error ( | 636 | if not defined error ( |
@@ -573,17 +651,30 @@ call :dk_act | |||
573 | call :dk_checkperm | 651 | call :dk_checkperm |
574 | ) | 652 | ) |
575 | 653 | ||
654 | REM Check Internet related error codes | ||
655 | |||
656 | if not defined error if not defined _perm ( | ||
657 | echo "%error_code%" | findstr /i "0x80072e 0x80072f" %nul% && ( | ||
658 | set error=1 | ||
659 | echo: | ||
660 | call :dk_color %Red% "Checking Internet Issues [Found] [%error_code%]" | ||
661 | call :dk_color2 %Blue% "Check this page for help" %_Yellow% " https://%mas%/licensing-servers-issue" | ||
662 | ) | ||
663 | ) | ||
664 | |||
665 | ::========================================================================================================================================== | ||
666 | |||
576 | echo: | 667 | echo: |
577 | if defined _perm ( | 668 | if defined _perm ( |
578 | call :dk_color %Green% "%winos% is permanently activated with a digital license." | 669 | call :dk_color %Green% "%winos% is permanently activated with a digital license." |
579 | ) else ( | 670 | ) else ( |
580 | call :dk_color %Red% "Activation Failed %error_code%" | 671 | call :dk_color %Red% "Activation Failed %error_code%" |
581 | if defined notworking ( | 672 | if defined notworking ( |
582 | call :dk_color %Magenta% "At the time of writing this, HWID Activation was not supported for this product." | 673 | call :dk_color %Blue% "At the time of writing this, HWID Activation was not supported for this product." |
583 | call :dk_color %Magenta% "Use KMS38 Activation option." | 674 | call :dk_color %Blue% "Use KMS38 Activation option." |
584 | ) else ( | 675 | ) else ( |
585 | if not defined error call :dk_color %Magenta% "In MAS, Goto Troubleshoot and run Fix Licensing option." | 676 | if not defined error call :dk_color %Blue% "%_fixmsg%" |
586 | call :dk_color2 %Magenta% "Check this page for help" %_Yellow% " https://massgrave.dev/troubleshoot" | 677 | call :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 | ||
615 | if %_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= | 706 | if %_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= |
616 | if %_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= | 707 | if %_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= |
617 | exit /b | 708 | exit /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 | ||
644 | set applist= | 735 | set applist= |
645 | if %_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')" | 736 | if %_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%')" |
646 | if %_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')" | 737 | if %_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")) |
648 | exit /b | 739 | exit /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 = @() | ||
747 | foreach ($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 | ||
764 | if ($info.LastRunTime -match 99) { | ||
765 | $task | Start-ScheduledTask | ||
766 | Start-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 | ||
654 | set _wmic=0 | 776 | set _wmic=0 |
655 | for %%# in (wmic.exe) do @if not "%%~$PATH:#"=="" ( | 777 | for %%# in (wmic.exe) do @if not "%%~$PATH:#"=="" ( |
656 | wmic path Win32_ComputerSystem get CreationClassName /value 2>nul | find /i "computersystem" 1>nul && set _wmic=1 | 778 | wmic path Win32_ComputerSystem get CreationClassName /value %nul2% | find /i "computersystem" %nul1% && set _wmic=1 |
657 | ) | 779 | ) |
658 | exit /b | 780 | exit /b |
659 | 781 | ||
@@ -668,8 +790,8 @@ set d1=%d1% $meth.SetImplementationFlags(128); $TypeBuilder.CreateType()::Brandi | |||
668 | 790 | ||
669 | set winos= | 791 | set winos= |
670 | for /f "delims=" %%s in ('"%psc% %d1%"') do if not errorlevel 1 (set winos=%%s) | 792 | for /f "delims=" %%s in ('"%psc% %d1%"') do if not errorlevel 1 (set winos=%%s) |
671 | echo "%winos%" | find /i "Windows" 1>nul || ( | 793 | echo "%winos%" | find /i "Windows" %nul1% || ( |
672 | for /f "skip=2 tokens=2*" %%a in ('reg query "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion" /v ProductName 2^>nul') do set "winos=%%b" | 794 | for /f "skip=2 tokens=2*" %%a in ('reg query "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion" /v ProductName %nul6%') do set "winos=%%b" |
673 | if %winbuild% GEQ 22000 ( | 795 | if %winbuild% GEQ 22000 ( |
674 | set winos=!winos:Windows 10=Windows 11! | 796 | set winos=!winos:Windows 10=Windows 11! |
675 | ) | 797 | ) |
@@ -689,17 +811,33 @@ exit /b | |||
689 | 811 | ||
690 | :dk_errorcheck | 812 | :dk_errorcheck |
691 | 813 | ||
814 | set showfix= | ||
815 | |||
816 | :: Check corrupt services | ||
817 | |||
818 | set serv_cor= | ||
819 | for %%# in (%_serv%) do ( | ||
820 | set _corrupt= | ||
821 | sc start %%# %nul% | ||
822 | if !errorlevel! EQU 1060 set _corrupt=1 | ||
823 | sc query %%# %nul% || set _corrupt=1 | ||
824 | for %%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) | ||
825 | if defined _corrupt (if defined serv_cor (set "serv_cor=!serv_cor! %%#") else (set "serv_cor=%%#")) | ||
826 | ) | ||
827 | |||
828 | if defined serv_cor ( | ||
829 | set error=1 | ||
830 | call :dk_color %Red% "Checking Corrupt Services [%serv_cor%]" | ||
831 | ) | ||
832 | |||
833 | ::======================================================================================================================================== | ||
834 | |||
692 | :: Check disabled services | 835 | :: Check disabled services |
693 | 836 | ||
694 | set serv_ste= | 837 | set serv_ste= |
695 | for %%# in (%_serv%) do ( | 838 | for %%# in (%_serv%) do ( |
696 | set serv_dis= | ||
697 | reg query HKLM\SYSTEM\CurrentControlSet\Services\%%# /v ImagePath %nul% || set serv_dis=1 | ||
698 | for /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 | ||
699 | sc start %%# %nul% | 839 | sc start %%# %nul% |
700 | if !errorlevel! EQU 1058 set serv_dis=1 | 840 | if !errorlevel! EQU 1058 (if defined serv_ste (set "serv_ste=!serv_ste! %%#") else (set "serv_ste=%%#")) |
701 | sc query %%# %nul% || set serv_dis=1 | ||
702 | if 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= | |||
742 | set checkerror= | 880 | set checkerror= |
743 | net start %%# /y %nul% | 881 | net start %%# /y %nul% |
744 | set errorcode=!errorlevel! | 882 | set errorcode=!errorlevel! |
745 | sc query %%# | find /i "4 RUNNING" %nul% || set checkerror=1 | 883 | sc query %%# | find /i "RUNNING" %nul% || set checkerror=1 |
746 | 884 | ||
747 | sc start %%# %nul% | 885 | sc start %%# %nul% |
748 | if !errorlevel! NEQ 1056 if !errorlevel! NEQ 0 (set errorcode=!errorlevel!&set checkerror=1) | 886 | if !errorlevel! NEQ 1056 if !errorlevel! NEQ 0 (set errorcode=!errorlevel!&set checkerror=1) |
@@ -753,7 +891,8 @@ if defined serv_e ( | |||
753 | set error=1 | 891 | set error=1 |
754 | call :dk_color %Red% "Starting Services [Failed] [%serv_e%]" | 892 | call :dk_color %Red% "Starting Services [Failed] [%serv_e%]" |
755 | echo %serv_e% | findstr /i "ClipSVC-1058 sppsvc-1058" %nul% && ( | 893 | echo %serv_e% | findstr /i "ClipSVC-1058 sppsvc-1058" %nul% && ( |
756 | call :dk_color %Magenta% "Restart the system to fix disabled service error 1058." | 894 | call :dk_color %Blue% "Restart the system to fix disabled service error 1058." |
895 | set 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 | ||
764 | if defined safeboot_option ( | 903 | if defined safeboot_option ( |
765 | set error=1 | 904 | set error=1 |
766 | call :dk_color2 %Red% "Checking Boot Mode " %Magenta% "[System is running in safe mode. Run in normal mode.]" | 905 | set showfix=1 |
906 | call :dk_color2 %Red% "Checking Boot Mode " %Blue% "[System is running in safe mode. Run in normal mode.]" | ||
767 | ) | 907 | ) |
768 | 908 | ||
769 | 909 | ||
770 | reg query "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Setup\State" 2>nul | find /i "IMAGE_STATE_COMPLETE" 1>nul || ( | 910 | reg query "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Setup\State" %nul2% | find /i "IMAGE_STATE_COMPLETE" %nul1% || ( |
771 | set error=1 | 911 | set error=1 |
772 | call :dk_color2 %Red% "Checking Audit Mode " %Magenta% "[System is running in Audit mode. Run in normal mode.]" | 912 | set showfix=1 |
913 | call :dk_color2 %Red% "Checking Audit Mode " %Blue% "[IMAGE_STATE_COMPLETE status not found. Run in normal mode.]" | ||
773 | ) | 914 | ) |
774 | 915 | ||
775 | 916 | ||
776 | reg query "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\WinPE" /v InstRoot %nul% && ( | 917 | reg query "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\WinPE" /v InstRoot %nul% && ( |
777 | set error=1 | 918 | set error=1 |
778 | call :dk_color2 %Red% "Checking WinPE " %Magenta% "[System is running in WinPE mode. Run in normal mode.]" | 919 | set showfix=1 |
779 | ) | 920 | call :dk_color2 %Red% "Checking WinPE " %Blue% "[System is running in WinPE mode. Run in normal mode.]" |
780 | |||
781 | |||
782 | for %%# in (wmic.exe) do @if "%%~$PATH:#"=="" ( | ||
783 | call :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% || ( |
788 | set error=1 | 925 | set error=1 |
789 | call :dk_color %Red% "Checking Powershell [Not Responding]" | 926 | call :dk_color %Red% "Checking Powershell [Not Responding]" |
790 | ) | 927 | ) |
791 | 928 | ||
792 | 929 | ||
793 | set wmifailed= | ||
794 | if %_wmic% EQU 1 wmic path Win32_ComputerSystem get CreationClassName /value 2>nul | find /i "computersystem" 1>nul | ||
795 | if %_wmic% EQU 0 %psc% "Get-CIMInstance -Class Win32_ComputerSystem | Select-Object -Property CreationClassName" 2>nul | find /i "computersystem" 1>nul | ||
796 | if %errorlevel% NEQ 0 ( | ||
797 | set error=1 | ||
798 | set wmifailed=1 | ||
799 | call :dk_color %Red% "Checking WMI [Not Responding] %_wmic%" | ||
800 | call :dk_color %Magenta% "In MAS, Goto Troubleshoot and run Fix WMI option." | ||
801 | ) | ||
802 | |||
803 | |||
804 | if not "%regSKU%"=="%wmiSKU%" ( | ||
805 | call :dk_color %Red% "Checking WMI/REG SKU [Difference Found - WMI:%wmiSKU% Reg:%regSKU%]" | ||
806 | ) | ||
807 | |||
808 | |||
809 | DISM /English /Online /Get-CurrentEdition %nul% | 930 | DISM /English /Online /Get-CurrentEdition %nul% |
810 | set error_code=%errorlevel% | 931 | set dism_error=%errorlevel% |
811 | cmd /c exit /b %error_code% | 932 | cmd /c exit /b %dism_error% |
812 | if %error_code% NEQ 0 set "error_code=[0x%=ExitCode%]" | 933 | if %dism_error% NEQ 0 set "dism_error=[0x%=ExitCode%]" |
813 | if %error_code% NEQ 0 ( | 934 | if %dism_error% NEQ 0 ( |
814 | call :dk_color %Red% "Checking DISM [Not Responding] %error_code%" | 935 | call :dk_color %Red% "Checking DISM [Not Responding] %dism_error%" |
815 | ) | 936 | ) |
816 | 937 | ||
817 | 938 | ||
818 | if exist "%SystemRoot%\Servicing\Packages\Microsoft-Windows-*EvalEdition~*.mum" ( | 939 | if not defined officeact if exist "%SystemRoot%\Servicing\Packages\Microsoft-Windows-*EvalEdition~*.mum" ( |
819 | set error=1 | 940 | set error=1 |
820 | call :dk_color %Red% "Checking Eval Packages [Non-Eval Licenses are installed in Eval Windows]" | 941 | call :dk_color %Red% "Checking Eval Packages [Non-Eval Licenses are installed in Eval Windows]" |
942 | if /i %dism_error%==[0x800F0805] ( | ||
943 | for %%# in (4 125 126 188 191 205) do if "%osSKU%"=="%%#" ( | ||
944 | call :dk_color %Blue% "Evaluation Windows can not be activated and different License install may lead to errors." | ||
945 | call :dk_color %Blue% "It is recommended to install full version of %winos%." | ||
946 | call :dk_color %Blue% "You can download it from https://%mas%/genuine-installation-media.html" | ||
947 | set 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 | ||
963 | for %%# in (wmic.exe) do @if "%%~$PATH:#"=="" ( | ||
964 | call :dk_color %Gray% "Checking WMIC.exe [Not Found]" | ||
965 | ) | ||
966 | |||
967 | |||
968 | set wmifailed= | ||
969 | if %_wmic% EQU 1 wmic path Win32_ComputerSystem get CreationClassName /value %nul2% | find /i "computersystem" %nul1% | ||
970 | if %_wmic% EQU 0 %psc% "Get-CIMInstance -Class Win32_ComputerSystem | Select-Object -Property CreationClassName" %nul2% | find /i "computersystem" %nul1% | ||
971 | |||
972 | if %errorlevel% NEQ 0 set wmifailed=1 | ||
973 | echo "%error_code%" | findstr /i "0x800410 0x800440" %nul1% && set wmifailed=1& :: https://learn.microsoft.com/en-us/windows/win32/wmisdk/wmi-error-constants | ||
974 | if defined wmifailed ( | ||
975 | set error=1 | ||
976 | call :dk_color %Red% "Checking WMI [Not Responding]" | ||
977 | call :dk_color %Blue% "In MAS, Goto Troubleshoot and run Fix WMI option." | ||
978 | set showfix=1 | ||
979 | ) | ||
980 | |||
981 | |||
982 | %nul% set /a "sum=%slcSKU%+%regSKU%+%wmiSKU%" | ||
983 | set /a "sum/=3" | ||
984 | if not defined officeact if not "%sum%"=="%slcSKU%" ( | ||
985 | call :dk_color %Red% "Checking SLC/WMI/REG SKU [Difference Found - SLC:%slcSKU% WMI:%wmiSKU% Reg:%regSKU%]" | ||
986 | ) | ||
987 | |||
988 | |||
834 | reg query "HKU\S-1-5-20\Software\Microsoft\Windows NT\CurrentVersion\SoftwareProtectionPlatform\PersistedTSReArmed" %nul% && ( | 989 | reg query "HKU\S-1-5-20\Software\Microsoft\Windows NT\CurrentVersion\SoftwareProtectionPlatform\PersistedTSReArmed" %nul% && ( |
835 | set error=1 | 990 | set error=1 |
836 | call :dk_color2 %Red% "Checking Rearm " %Magenta% "[System Restart Is Required]" | 991 | set showfix=1 |
992 | call :dk_color2 %Red% "Checking Rearm " %Blue% "[System Restart Is Required]" | ||
837 | ) | 993 | ) |
838 | 994 | ||
839 | 995 | ||
840 | reg query "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\ClipSVC\Volatile\PersistedSystemState" %nul% && ( | 996 | reg query "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\ClipSVC\Volatile\PersistedSystemState" %nul% && ( |
841 | set error=1 | 997 | set error=1 |
842 | call :dk_color2 %Red% "Checking ClipSVC " %Magenta% "[System Restart Is Required]" | 998 | set showfix=1 |
999 | call :dk_color2 %Red% "Checking ClipSVC " %Blue% "[System Restart Is Required]" | ||
843 | ) | 1000 | ) |
844 | 1001 | ||
845 | 1002 | ||
846 | for /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 ( | 1003 | for /f "skip=2 tokens=2*" %%a in ('reg query "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\SoftwareProtectionPlatform" /v "SkipRearm" %nul6%') do if /i %%b NEQ 0x0 ( |
847 | reg add "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\SoftwareProtectionPlatform" /v "SkipRearm" /t REG_DWORD /d "0" /f %nul% | 1004 | reg add "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\SoftwareProtectionPlatform" /v "SkipRearm" /t REG_DWORD /d "0" /f %nul% |
848 | call :dk_color %Red% "Checking SkipRearm [Default 0 Value Not Found, Changing To 0]" | 1005 | call :dk_color %Red% "Checking SkipRearm [Default 0 Value Not Found. Changing To 0]" |
849 | net stop sppsvc /y %nul% | 1006 | net stop sppsvc /y %nul% |
850 | net start sppsvc /y %nul% | 1007 | net start sppsvc /y %nul% |
851 | set error=1 | 1008 | set error=1 |
@@ -854,7 +1011,24 @@ set error=1 | |||
854 | 1011 | ||
855 | reg query "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\SoftwareProtectionPlatform\Plugins\Objects\msft:rm/algorithm/hwid/4.0" /f ba02fed39662 /d %nul% || ( | 1012 | reg query "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\SoftwareProtectionPlatform\Plugins\Objects\msft:rm/algorithm/hwid/4.0" /f ba02fed39662 /d %nul% || ( |
856 | call :dk_color %Red% "Checking SPP Registry Key [Incorrect ModuleId Found]" | 1013 | call :dk_color %Red% "Checking SPP Registry Key [Incorrect ModuleId Found]" |
1014 | call :dk_color %Blue% "Possibly Caused By Gaming Spoofers. Help: https://%mas%/troubleshoot" | ||
1015 | set error=1 | ||
1016 | set showfix=1 | ||
1017 | ) | ||
1018 | |||
1019 | |||
1020 | set tokenstore= | ||
1021 | for /f "skip=2 tokens=2*" %%a in ('reg query "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\SoftwareProtectionPlatform" /v TokenStore %nul6%') do call set "tokenstore=%%b" | ||
1022 | if not exist "%tokenstore%\" ( | ||
857 | set error=1 | 1023 | set error=1 |
1024 | REM This code creates token folder only if it's missing and sets default permission for it | ||
1025 | mkdir "%tokenstore%" %nul% | ||
1026 | set "d=$sddl = 'O:BAG:BAD:PAI(A;OICI;FA;;;SY)(A;OICI;FA;;;BA)(A;OICIIO;GR;;;BU)(A;;FR;;;BU)(A;OICI;FA;;;S-1-5-80-123231216-2592883651-3715271367-3753151631-4175906628)';" | ||
1027 | set "d=!d! $AclObject = New-Object System.Security.AccessControl.DirectorySecurity;" | ||
1028 | set "d=!d! $AclObject.SetSecurityDescriptorSddlForm($sddl);" | ||
1029 | set "d=!d! Set-Acl -Path %tokenstore% -AclObject $AclObject;" | ||
1030 | %psc% "!d!" %nul% | ||
1031 | call :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 | ||
875 | set tokenstore= | ||
876 | for /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" | ||
877 | if not exist "%tokenstore%\" ( | ||
878 | set error=1 | ||
879 | call :dk_color %Red% "Checking SPP Token Folder [Not Found] [%tokenstore%\]" | ||
880 | ) | ||
881 | |||
882 | |||
883 | if exist "%tokenstore%\" if not exist "%tokenstore%\tokens.dat" ( | 1049 | if exist "%tokenstore%\" if not exist "%tokenstore%\tokens.dat" ( |
884 | set error=1 | 1050 | set error=1 |
885 | call :dk_color %Red% "Checking SPP tokens.dat [Not Found] [%tokenstore%\]" | 1051 | call :dk_color %Red% "Checking SPP tokens.dat [Not Found] [%tokenstore%\]" |
886 | ) | 1052 | ) |
887 | 1053 | ||
888 | 1054 | ||
889 | if not exist %ProgramData%\Microsoft\Windows\ClipSVC\tokens.dat ( | 1055 | if not exist %SystemRoot%\system32\sppsvc.exe ( |
890 | set error=1 | 1056 | set error=1 |
891 | call :dk_color %Red% "Checking ClipSVC tokens.dat [Not Found]" | 1057 | set showfix=1 |
1058 | call :dk_color %Red% "Checking sppsvc.exe File [Not Found]" | ||
892 | ) | 1059 | ) |
893 | 1060 | ||
894 | 1061 | ||
895 | if not exist %SystemRoot%\system32\sppsvc.exe ( | 1062 | set task= |
896 | set error=1 | 1063 | set taskerror= |
897 | call :dk_color %Red% "Checking sppsvc.exe File [Not Found]" | 1064 | if not defined wmifailed if not defined officeact ( |
1065 | for /f "delims=" %%a in ('%psc% "$f=[io.file]::ReadAllText('!_batp!') -split ':gettaskinfo\:.*';iex ($f[1]);"') do (set task=%%a) | ||
1066 | echo "!task!" | find /i "Ready 0 " %nul% || set taskerror=1 | ||
1067 | echo "!task!" | find "99" %nul% && set taskerror=1 | ||
1068 | if defined taskerror ( | ||
1069 | call :dk_color %Gray% "Checking SvcRestartTask Last Run [Issues Found, !task!]" | ||
1070 | call :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 | ||
903 | set showfix= | ||
904 | set wpaerror= | 1077 | set wpaerror= |
905 | set permerror= | 1078 | set permerror= |
906 | if not defined serv_cste if /i not %error_code%==0 if /i not %error_code%==0xC004D302 if not defined wmifailed ( | 1079 | if not defined serv_cor if not defined serv_cste if defined error if /i not %error_code%==0 if not defined showfix ( |
907 | 1080 | ||
908 | REM This code checks for invalid registry keys in HKLM\SYSTEM\WPA. This issue may appear even on healthy systems. | 1081 | REM This code checks for invalid registry keys in HKLM\SYSTEM\WPA. This issue may appear even on healthy systems. |
909 | 1082 | ||
910 | if %winbuild% GEQ 14393 ( | 1083 | if %winbuild% GEQ 14393 ( |
911 | set /a count=0 | 1084 | set /a count=0 |
912 | for /f %%a in ('reg query "HKLM\SYSTEM\WPA" 2^>nul') do set /a count+=1 | 1085 | for /f %%a in ('reg query "HKLM\SYSTEM\WPA" %nul6%') do set /a count+=1 |
913 | for /L %%# in (1,1,!count!) do ( | 1086 | for /L %%# in (1,1,!count!) do ( |
914 | reg query "HKLM\SYSTEM\WPA\8DEC0AF1-0341-4b93-85CD-72606C2DF94C-7P-%%#" /ve /t REG_BINARY %nul% || set wpaerror=1 | 1087 | reg 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 | |||
931 | if defined permerror call :dk_color %Red% "Checking SPP Permissions [Error Found]" | 1104 | if defined permerror call :dk_color %Red% "Checking SPP Permissions [Error Found]" |
932 | 1105 | ||
933 | set showfix=1 | 1106 | set showfix=1 |
934 | call :dk_color %Magenta% "In MAS, Goto Troubleshoot and run Fix Licensing option." | 1107 | call :dk_color %Blue% "%_fixmsg%" |
935 | if not defined permerror call :dk_color %Magenta% "If activation still fails then run Fix WPA Registry option." | 1108 | if not defined permerror call :dk_color %Blue% "If activation still fails then run Fix WPA Registry option." |
936 | ) | 1109 | ) |
937 | 1110 | ||
938 | exit /b | 1111 | exit /b |
@@ -964,7 +1137,7 @@ exit /b | |||
964 | echo: | 1137 | echo: |
965 | if %_unattended%==1 timeout /t 2 & exit /b | 1138 | if %_unattended%==1 timeout /t 2 & exit /b |
966 | call :dk_color %_Yellow% "Press any key to %_exitmsg%..." | 1139 | call :dk_color %_Yellow% "Press any key to %_exitmsg%..." |
967 | pause >nul | 1140 | pause %nul1% |
968 | exit /b | 1141 | exit /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 | |||
996 | 2a6137f3-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 | 1169 | 2a6137f3-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 |
997 | e558417a-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 | 1170 | e558417a-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 |
998 | c5198a66-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 | 1171 | c5198a66-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 |
1172 | f6e29426-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 | ||
999 | cce9d2de-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 | 1173 | cce9d2de-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 |
1000 | d06934ee-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 | 1174 | d06934ee-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 |
1001 | 706e0cfd-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 | 1175 | 706e0cfd-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 |
1002 | faa57748-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 | 1176 | faa57748-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 |
1177 | 837766ff-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 | ||
1003 | 2c060131-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 | 1178 | 2c060131-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 |
1004 | e8f74caa-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 | 1179 | e8f74caa-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 |
1005 | 3d1022d8-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 | 1180 | 3d1022d8-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 |
1006 | 60c243e1-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 | 1181 | 60c243e1-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 |
1182 | 01eb852c-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 | ||
1007 | eb6d346f-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 | 1183 | eb6d346f-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 |
1008 | 89e87510-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 | 1184 | 89e87510-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 |
1009 | 62f0c100-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 | 1185 | 62f0c100-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 | |||
1013 | af5c9381-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 | 1189 | af5c9381-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 |
1014 | 8ab9bdd1-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 | 1190 | 8ab9bdd1-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 |
1015 | ed655016-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 | 1191 | ed655016-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 |
1192 | 6c4de1b8-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 | ||
1016 | d4bdc678-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 | 1193 | d4bdc678-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 |
1017 | 92fb8726-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 | 1194 | 92fb8726-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 |
1018 | d4f9b41f-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 | 1195 | d4f9b41f-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 ( |
1020 | for /f "tokens=1-10 delims=_" %%A in ("%%#") do ( | 1197 | for /f "tokens=1-9 delims=_" %%A in ("%%#") do ( |
1021 | 1198 | ||
1022 | if %1==key if %osSKU%==%%C ( | 1199 | REM Detect key |
1023 | 1200 | ||
1024 | REM Detect key attempt 1 | 1201 | if %1==key if %osSKU%==%%C if not defined key ( |
1025 | 1202 | echo "!applist! !altapplist!" | find /i "%%A" %nul1% && ( | |
1026 | if "%2"=="attempt1" if not defined key ( | ||
1027 | echo "!applist!" | find /i "%%A" 1>nul && ( | ||
1028 | if %%F==1 set notworking=1 | 1203 | if %%F==1 set notworking=1 |
1029 | set key=%%B | 1204 | set key=%%B |
1030 | ) | 1205 | ) |
1031 | ) | 1206 | ) |
1032 | 1207 | ||
1033 | REM Detect key attempt 2 | ||
1034 | |||
1035 | if "%2"=="attempt2" if not defined key ( | ||
1036 | set actidnotfound=1 | ||
1037 | set 9th=%%I | ||
1038 | if not defined 9th ( | ||
1039 | if %%F==1 set notworking=1 | ||
1040 | set key=%%B | ||
1041 | ) else ( | ||
1042 | echo "%branch%" | find /i "%%I" 1>nul && ( | ||
1043 | if %%F==1 set notworking=1 | ||
1044 | set key=%%B | ||
1045 | ) | ||
1046 | ) | ||
1047 | ) | ||
1048 | ) | ||
1049 | |||
1050 | REM Generate ticket | 1208 | REM Generate ticket |
1051 | 1209 | ||
1052 | if %1==ticket if "%key%"=="%%B" ( | 1210 | if %1==ticket if "%key%"=="%%B" ( |
1053 | set "string=OSMajorVersion=5;OSMinorVersion=1;OSPlatformId=2;PP=0;Pfn=Microsoft.Windows.%%C.%%D_8wekyb3d8bbwe;DownlevelGenuineState=1;$([char]0)" | 1211 | set "string=OSMajorVersion=5;OSMinorVersion=1;OSPlatformId=2;PP=0;Pfn=Microsoft.Windows.%%C.%%D_8wekyb3d8bbwe;DownlevelGenuineState=1;$([char]0)" |
1054 | for /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" | 1212 | for /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" |
1055 | echo "!encoded!" | find "AAAA" 1>nul || exit /b | 1213 | echo "!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= | |||
1082 | if %_NoEditionChange%==1 exit /b | 1238 | if %_NoEditionChange%==1 exit /b |
1083 | 1239 | ||
1084 | for %%# in ( | 1240 | for %%# in ( |
1085 | 125_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 | 1241 | 125_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 |
1086 | 191_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 | 1242 | 125_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 |
1087 | 138_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 | 1243 | 138_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 |
1244 | 139_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 | ||
1245 | 139_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 ( |
1089 | for /f "tokens=1-6 delims=_" %%A in ("%%#") do if %osSKU%==%%A ( | 1247 | for /f "tokens=1-6 delims=_" %%A in ("%%#") do if %osSKU%==%%A ( |
1090 | echo "!applist!" | find /i "%%C" 1>nul && ( | 1248 | echo "!applist! !altapplist!" | find /i "%%C" %nul1% && ( |
1091 | echo "!applist!" | find /i "%%D" 1>nul && ( | 1249 | echo "!applist!" | find /i "%%D" %nul1% && ( |
1092 | set altkey=%%E | 1250 | set altkey=%%E |
1093 | set curedition=%%B | ||
1094 | set altedition=%%F | 1251 | set altedition=%%F |
1095 | ) || ( | 1252 | ) || ( |
1096 | set altedition=%%F | 1253 | set altedition=%%F |
@@ -1101,4 +1258,5 @@ set notfoundaltactID=1 | |||
1101 | ) | 1258 | ) |
1102 | exit /b | 1259 | exit /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 | |||
34 | set "PATH=%SystemRoot%\System32;%SystemRoot%\System32\wbem;%SystemRoot%\System32\WindowsPowerShell\v1.0\" | ||
35 | if exist "%SystemRoot%\Sysnative\reg.exe" ( | ||
36 | set "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" | |||
36 | for %%# in (%*) do ( | 43 | for %%# in (%*) do ( |
37 | if /i "%%#"=="r1" set r1=1 | 44 | if /i "%%#"=="r1" set r1=1 |
38 | if /i "%%#"=="r2" set r2=1 | 45 | if /i "%%#"=="r2" set r2=1 |
46 | if /i "%%#"=="-qedit" ( | ||
47 | reg add HKCU\Console /v QuickEdit /t REG_DWORD /d "1" /f 1>nul | ||
48 | rem check the code below admin elevation to understand why it's here | ||
49 | ) | ||
39 | ) | 50 | ) |
40 | 51 | ||
41 | if exist %SystemRoot%\Sysnative\cmd.exe if not defined r1 ( | 52 | if exist %SystemRoot%\Sysnative\cmd.exe if not defined r1 ( |
@@ -52,22 +63,34 @@ start %SystemRoot%\SysArm32\cmd.exe /c ""!_cmdf!" %* r2" | |||
52 | exit /b | 63 | exit /b |
53 | ) | 64 | ) |
54 | 65 | ||
55 | :: Set Path variable, it helps if it is misconfigured in the system | 66 | ::======================================================================================================================================== |
56 | 67 | ||
57 | set "PATH=%SystemRoot%\System32;%SystemRoot%\System32\wbem;%SystemRoot%\System32\WindowsPowerShell\v1.0\" | 68 | set "blank=" |
58 | if exist "%SystemRoot%\Sysnative\reg.exe" ( | 69 | set "mas=mass%blank%grave.dev" |
59 | set "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 | |||
73 | sc query Null | find /i "RUNNING" | ||
74 | if %errorlevel% NEQ 0 ( | ||
75 | echo: | ||
76 | echo Null service is not running, script may crash... | ||
77 | echo: | ||
78 | echo: | ||
79 | echo Help - https://%mas%/troubleshoot.html | ||
80 | echo: | ||
81 | echo: | ||
82 | ping 127.0.0.1 -n 10 | ||
60 | ) | 83 | ) |
84 | cls | ||
61 | 85 | ||
62 | :: Check LF line ending | 86 | :: Check LF line ending |
63 | 87 | ||
64 | pushd "%~dp0" | 88 | pushd "%~dp0" |
65 | >nul findstr /rxc:".*" "%~nx0" | 89 | >nul findstr /v "$" "%~nx0" && ( |
66 | if not %errorlevel%==0 ( | ||
67 | echo: | 90 | echo: |
68 | echo Error: Script either has LF line ending issue, or it failed to read itself. | 91 | echo Error: Script either has LF line ending issue or an empty line at the end of the script is missing. |
69 | echo: | 92 | echo: |
70 | ping 127.0.0.1 -n 6 > nul | 93 | ping 127.0.0.1 -n 6 >nul |
71 | popd | 94 | popd |
72 | exit /b | 95 | exit /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 | ||
101 | set winbuild=1 | 124 | set "nul1=1>nul" |
125 | set "nul2=2>nul" | ||
126 | set "nul6=2^>nul" | ||
102 | set "nul=>nul 2>&1" | 127 | set "nul=>nul 2>&1" |
128 | |||
103 | set psc=powershell.exe | 129 | set psc=powershell.exe |
130 | set winbuild=1 | ||
104 | for /f "tokens=6 delims=[]. " %%G in ('ver') do set winbuild=%%G | 131 | for /f "tokens=6 delims=[]. " %%G in ('ver') do set winbuild=%%G |
105 | 132 | ||
106 | set _NCS=1 | 133 | set _NCS=1 |
107 | if %winbuild% LSS 10586 set _NCS=0 | 134 | if %winbuild% LSS 10586 set _NCS=0 |
108 | if %winbuild% GEQ 10586 reg query "HKCU\Console" /v ForceV2 2>nul | find /i "0x0" 1>nul && (set _NCS=0) | 135 | if %winbuild% GEQ 10586 reg query "HKCU\Console" /v ForceV2 %nul2% | find /i "0x0" %nul1% && (set _NCS=0) |
109 | 136 | ||
110 | if %_NCS% EQU 1 ( | 137 | if %_NCS% EQU 1 ( |
111 | for /F %%a in ('echo prompt $E ^| cmd') do set "esc=%%a" | 138 | for /F %%a in ('echo prompt $E ^| cmd') do set "esc=%%a" |
112 | set "Red="41;97m"" | 139 | set "Red="41;97m"" |
113 | set "Gray="100;97m"" | 140 | set "Gray="100;97m"" |
114 | set "Green="42;97m"" | 141 | set "Green="42;97m"" |
115 | set "Magenta="45;97m"" | 142 | set "Blue="44;97m"" |
116 | set "_White="40;37m"" | 143 | set "_White="40;37m"" |
117 | set "_Green="40;92m"" | 144 | set "_Green="40;92m"" |
118 | set "_Yellow="40;93m"" | 145 | set "_Yellow="40;93m"" |
@@ -120,7 +147,7 @@ set "_Yellow="40;93m"" | |||
120 | set "Red="Red" "white"" | 147 | set "Red="Red" "white"" |
121 | set "Gray="Darkgray" "white"" | 148 | set "Gray="Darkgray" "white"" |
122 | set "Green="DarkGreen" "white"" | 149 | set "Green="DarkGreen" "white"" |
123 | set "Magenta="Darkmagenta" "white"" | 150 | set "Blue="Blue" "white"" |
124 | set "_White="Black" "Gray"" | 151 | set "_White="Black" "Gray"" |
125 | set "_Green="Black" "Green"" | 152 | set "_Green="Black" "Green"" |
126 | set "_Yellow="Black" "Yellow"" | 153 | set "_Yellow="Black" "Yellow"" |
@@ -129,14 +156,21 @@ set "_Yellow="Black" "Yellow"" | |||
129 | set _k38= | 156 | set _k38= |
130 | set "nceline=echo: &echo ==== ERROR ==== &echo:" | 157 | set "nceline=echo: &echo ==== ERROR ==== &echo:" |
131 | set "eline=echo: &call :dk_color %Red% "==== ERROR ====" &echo:" | 158 | set "eline=echo: &call :dk_color %Red% "==== ERROR ====" &echo:" |
132 | if %~z0 GEQ 200000 (set "_exitmsg=Go back") else (set "_exitmsg=Exit") | 159 | if %~z0 GEQ 200000 ( |
160 | set "_exitmsg=Go back" | ||
161 | set "_fixmsg=Go back to Main Menu, select Troubleshoot and run Fix Licensing option." | ||
162 | ) else ( | ||
163 | set "_exitmsg=Exit" | ||
164 | set "_fixmsg=In MAS folder, run Troubleshoot script and select Fix Licensing option." | ||
165 | ) | ||
166 | |||
133 | set "specific_kms=SOFTWARE\Microsoft\Windows NT\CurrentVersion\SoftwareProtectionPlatform\55c92734-d682-4d71-983e-d6ec3f16059f" | 167 | set "specific_kms=SOFTWARE\Microsoft\Windows NT\CurrentVersion\SoftwareProtectionPlatform\55c92734-d682-4d71-983e-d6ec3f16059f" |
134 | 168 | ||
135 | ::======================================================================================================================================== | 169 | ::======================================================================================================================================== |
136 | 170 | ||
137 | if %winbuild% LSS 14393 ( | 171 | if %winbuild% LSS 14393 ( |
138 | %eline% | 172 | %eline% |
139 | echo Unsupported OS version detected. | 173 | echo Unsupported OS version detected [%winbuild%]. |
140 | echo KMS38 Activation is supported for Windows 10/11/Server, build 14393 and later. | 174 | echo KMS38 Activation is supported for Windows 10/11/Server, build 14393 and later. |
141 | goto dk_done | 175 | goto dk_done |
142 | ) | 176 | ) |
@@ -165,7 +199,7 @@ setlocal EnableDelayedExpansion | |||
165 | 199 | ||
166 | ::======================================================================================================================================== | 200 | ::======================================================================================================================================== |
167 | 201 | ||
168 | echo "!_batf!" | find /i "!_ttemp!" 1>nul && ( | 202 | echo "!_batf!" | find /i "!_ttemp!" %nul1% && ( |
169 | if /i not "!_work!"=="!_ttemp!" ( | 203 | if /i not "!_work!"=="!_ttemp!" ( |
170 | %eline% | 204 | %eline% |
171 | echo Script is launched from the temp folder, | 205 | echo 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 || ( |
184 | if not defined _elev %nul% %psc% "start cmd.exe -arg '/c \"!_PSarg:'=''!\"' -verb runas" && exit /b | 218 | if not defined _elev %psc% "start cmd.exe -arg '/c \"!_PSarg:'=''!\"' -verb runas" && exit /b |
185 | %eline% | 219 | %eline% |
186 | echo This script require admin privileges. | 220 | echo This script require admin privileges. |
187 | echo To do so, right click on this script and select 'Run as administrator'. | 221 | echo 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 | |||
230 | if %_unattended%==1 set quedit=1 | ||
231 | for %%# in (%_args%) do (if /i "%%#"=="-qedit" set quedit=1) | ||
232 | |||
233 | reg query HKCU\Console /v QuickEdit %nul2% | find /i "0x0" %nul1% || if not defined quedit ( | ||
234 | reg add HKCU\Console /v QuickEdit /t REG_DWORD /d "0" /f %nul1% | ||
235 | start cmd.exe /c ""!_batf!" %_args% -qedit" | ||
236 | rem quickedit reset code is added at the starting of the script instead of here because it takes time to reflect in some cases | ||
237 | exit /b | ||
238 | ) | ||
239 | |||
240 | ::======================================================================================================================================== | ||
241 | |||
193 | if %_rem%==1 goto :k_uninstall | 242 | if %_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 | ||
229 | cls | 278 | cls |
230 | mode 102, 33 | 279 | mode 108, 34 |
231 | title KMS38 Activation | 280 | title KMS38 Activation |
232 | 281 | ||
233 | echo: | 282 | echo: |
@@ -276,7 +325,7 @@ if exist "%SystemRoot%\Servicing\Packages\Microsoft-Windows-Server*EvalEdition~* | |||
276 | if exist "%SystemRoot%\Servicing\Packages\Microsoft-Windows-Server*EvalCorEdition~*.mum" set _eval=1 & set _evalserv=1 | 325 | if exist "%SystemRoot%\Servicing\Packages\Microsoft-Windows-Server*EvalCorEdition~*.mum" set _eval=1 & set _evalserv=1 |
277 | 326 | ||
278 | if defined _eval ( | 327 | if defined _eval ( |
279 | reg query "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion" /v EditionID 2>nul | find /i "Eval" 1>nul && ( | 328 | reg query "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion" /v EditionID %nul2% | find /i "Eval" %nul1% && ( |
280 | %eline% | 329 | %eline% |
281 | echo [%winos% ^| %winbuild%] | 330 | echo [%winos% ^| %winbuild%] |
282 | if defined _evalserv ( | 331 | if defined _evalserv ( |
@@ -288,7 +337,7 @@ echo Evaluation Editions cannot be activated. | |||
288 | echo You need to install full version of %winos% | 337 | echo You need to install full version of %winos% |
289 | echo: | 338 | echo: |
290 | echo Download it from here, | 339 | echo Download it from here, |
291 | echo https://massgrave.dev/genuine-installation-media.html | 340 | echo https://%mas%/genuine-installation-media.html |
292 | ) | 341 | ) |
293 | goto dk_done | 342 | goto dk_done |
294 | ) | 343 | ) |
@@ -307,7 +356,7 @@ if not exist "!_work!\clipup.exe" ( | |||
307 | echo clipup.exe doesn't exist in Server Cor/Acor [No GUI] version. | 356 | echo clipup.exe doesn't exist in Server Cor/Acor [No GUI] version. |
308 | echo It's required for KMS38 Activation. | 357 | echo It's required for KMS38 Activation. |
309 | echo Check below page on how to activate it. | 358 | echo Check below page on how to activate it. |
310 | echo https://massgrave.dev/kms38.html | 359 | echo https://%mas%/kms38.html |
311 | goto dk_done | 360 | goto 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 | ||
319 | set osSKU= | 368 | set osSKU= |
320 | set regSKU= | 369 | set slcSKU= |
321 | set wmiSKU= | 370 | set wmiSKU= |
371 | set regSKU= | ||
322 | 372 | ||
323 | for /f "tokens=3 delims=." %%a in ('reg query "HKLM\SYSTEM\CurrentControlSet\Control\ProductOptions" /v OSProductPfn 2^>nul') do set "regSKU=%%a" | 373 | if %winbuild% GEQ 14393 (set info=Kernel-BrandingInfo) else (set info=Kernel-ProductInfo) |
324 | if %_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" | 374 | set d1=%ref% [void]$TypeBuilder.DefinePInvokeMethod('SLGetWindowsInformationDWORD', 'slc.dll', 'Public, Static', 1, [int], @([String], [int].MakeByRefType()), 1, 3); |
325 | if %_wmic% EQU 0 for /f "tokens=1" %%a in ('%psc% "([WMI]'Win32_OperatingSystem=@').OperatingSystemSKU" 2^>nul') do if not errorlevel 1 set "wmiSKU=%%a" | 375 | set d1=%d1% $Sku = 0; [void]$TypeBuilder.CreateType()::SLGetWindowsInformationDWORD('%info%', [ref]$Sku); $Sku |
376 | for /f "delims=" %%s in ('"%psc% %d1%"') do if not errorlevel 1 (set slcSKU=%%s) | ||
377 | if "%slcSKU%"=="0" set slcSKU= | ||
378 | if 1%slcSKU% NEQ +1%slcSKU% set slcSKU= | ||
326 | 379 | ||
327 | set osSKU=%wmiSKU% | 380 | for /f "tokens=3 delims=." %%a in ('reg query "HKLM\SYSTEM\CurrentControlSet\Control\ProductOptions" /v OSProductPfn %nul6%') do set "regSKU=%%a" |
381 | if %_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" | ||
382 | if %_wmic% EQU 0 for /f "tokens=1" %%a in ('%psc% "([WMI]'Win32_OperatingSystem=@').OperatingSystemSKU" %nul6%') do if not errorlevel 1 set "wmiSKU=%%a" | ||
383 | |||
384 | set osSKU=%slcSKU% | ||
385 | if not defined osSKU set osSKU=%wmiSKU% | ||
328 | if not defined osSKU set osSKU=%regSKU% | 386 | if not defined osSKU set osSKU=%regSKU% |
329 | 387 | ||
330 | if not defined osSKU ( | 388 | if not defined osSKU ( |
@@ -340,15 +398,16 @@ set error= | |||
340 | cls | 398 | cls |
341 | echo: | 399 | echo: |
342 | for /f "skip=2 tokens=2*" %%a in ('reg query "HKLM\SYSTEM\CurrentControlSet\Control\Session Manager\Environment" /v PROCESSOR_ARCHITECTURE') do set arch=%%b | 400 | for /f "skip=2 tokens=2*" %%a in ('reg query "HKLM\SYSTEM\CurrentControlSet\Control\Session Manager\Environment" /v PROCESSOR_ARCHITECTURE') do set arch=%%b |
343 | echo Checking OS Info [%winos% ^| %winbuild% ^| %arch%] | 401 | for /f "tokens=6-7 delims=[]. " %%i in ('ver') do if "%%j"=="" (set fullbuild=%%i) else (set fullbuild=%%i.%%j) |
402 | echo Checking OS Info [%winos% ^| %fullbuild% ^| %arch%] | ||
344 | 403 | ||
345 | ::======================================================================================================================================== | 404 | ::======================================================================================================================================== |
346 | 405 | ||
347 | :: Check Windows Script Host | 406 | :: Check Windows Script Host |
348 | 407 | ||
349 | set _WSH=1 | 408 | set _WSH=1 |
350 | reg query "HKCU\SOFTWARE\Microsoft\Windows Script Host\Settings" /v Enabled 2>nul | find /i "0x0" 1>nul && (set _WSH=0) | 409 | reg query "HKCU\SOFTWARE\Microsoft\Windows Script Host\Settings" /v Enabled %nul2% | find /i "0x0" %nul1% && (set _WSH=0) |
351 | reg query "HKLM\SOFTWARE\Microsoft\Windows Script Host\Settings" /v Enabled 2>nul | find /i "0x0" 1>nul && (set _WSH=0) | 410 | reg query "HKLM\SOFTWARE\Microsoft\Windows Script Host\Settings" /v Enabled %nul2% | find /i "0x0" %nul1% && (set _WSH=0) |
352 | 411 | ||
353 | if %_WSH% EQU 0 ( | 412 | if %_WSH% EQU 0 ( |
354 | reg add "HKLM\Software\Microsoft\Windows Script Host\Settings" /v Enabled /t REG_DWORD /d 1 /f %nul% | 413 | reg add "HKLM\Software\Microsoft\Windows Script Host\Settings" /v Enabled /t REG_DWORD /d 1 /f %nul% |
@@ -384,7 +443,6 @@ set key= | |||
384 | set pkey= | 443 | set pkey= |
385 | set altkey= | 444 | set altkey= |
386 | set changekey= | 445 | set changekey= |
387 | set curedition= | ||
388 | set altedition= | 446 | set altedition= |
389 | 447 | ||
390 | if defined applist call :kms38data getkey | 448 | if defined applist call :kms38data getkey |
@@ -394,6 +452,14 @@ if defined applist if not defined key call :kms38fallback | |||
394 | 452 | ||
395 | if defined altkey (set key=%altkey%&set changekey=1) | 453 | if defined altkey (set key=%altkey%&set changekey=1) |
396 | 454 | ||
455 | set /a UBR=0 | ||
456 | if %osSKU%==191 if defined altkey if defined altedition ( | ||
457 | 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 | ||
458 | if %winbuild% GEQ 19044 if !UBR! LSS 2788 ( | ||
459 | call :dk_color %Blue% "Windows must to be updated to build 19044.2788 or higher for IotEnterpriseS KMS38 activation." | ||
460 | ) | ||
461 | ) | ||
462 | |||
397 | if not defined key if defined notfoundaltactID ( | 463 | if not defined key if defined notfoundaltactID ( |
398 | call :dk_color %Red% "Checking Alternate Edition For KMS38 [%altedition% Activation ID Not Found]" | 464 | call :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 ( | |||
403 | echo [%winos% ^| %winbuild% ^| SKU:%osSKU%] | 469 | echo [%winos% ^| %winbuild% ^| SKU:%osSKU%] |
404 | echo Unable to find this product in the supported product list. | 470 | echo Unable to find this product in the supported product list. |
405 | echo Make sure you are using updated version of the script. | 471 | echo Make sure you are using updated version of the script. |
406 | echo https://massgrave.dev | 472 | echo https://%mas% |
407 | echo: | 473 | echo: |
408 | goto dk_done | 474 | goto dk_done |
409 | ) | 475 | ) |
@@ -414,14 +480,14 @@ goto dk_done | |||
414 | 480 | ||
415 | echo: | 481 | echo: |
416 | if defined changekey ( | 482 | if defined changekey ( |
417 | call :dk_color %Magenta% "[%altedition%] Edition product key will be used to enable KMS38 activation." | 483 | call :dk_color %Blue% "[%altedition%] Edition product key will be used to enable KMS38 activation." |
418 | echo: | 484 | echo: |
419 | ) | 485 | ) |
420 | 486 | ||
421 | set _partial= | 487 | set _partial= |
422 | if not defined key ( | 488 | if not defined key ( |
423 | if %_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=%%#" | 489 | if %_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=%%#" |
424 | if %_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=%%#" | 490 | if %_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=%%#" |
425 | call echo Checking Installed Product Key [Partial Key - %%_partial%%] [Volume:GVLK] | 491 | call 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 ( |
441 | call :dk_color %Red% "Installing KMS Client Setup Key [%key%] [Failed] !error_code!" | 507 | call :dk_color %Red% "Installing KMS Client Setup Key [%key%] [Failed] !error_code!" |
442 | if not defined error ( | 508 | if not defined error ( |
443 | call :dk_color %Magenta% "In MAS, Goto Troubleshoot and run Fix Licensing option." | 509 | call :dk_color %Blue% "%_fixmsg%" |
444 | set showfix=1 | 510 | set showfix=1 |
445 | ) | 511 | ) |
446 | set error=1 | 512 | set 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 | ||
454 | set app= | 520 | set app= |
455 | if %_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" | 521 | if %_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" |
456 | if %_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" | 522 | if %_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 | ||
458 | if not defined app ( | 524 | if not defined app ( |
459 | call :dk_color %Red% "Checking Installed GVLK Activation ID [Not Found] Aborting..." | 525 | call :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 | ||
578 | if not exist %SystemRoot%\system32\ClipUp.exe ( | ||
579 | call :dk_color %Red% "Checking ClipUp.exe File [Not found, aborting the process]" | ||
580 | goto :k_final | ||
581 | ) | ||
582 | |||
512 | set "tdir=%ProgramData%\Microsoft\Windows\ClipSVC\GenuineTicket" | 583 | set "tdir=%ProgramData%\Microsoft\Windows\ClipSVC\GenuineTicket" |
513 | if not exist "%tdir%\" md "%tdir%\" %nul% | 584 | if 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 | ||
523 | set "signature=C52iGEoH+1VqzI6kEAqOhUyrWuEObnivzaVjyef8WqItVYd/xGDTZZ3bkxAI9hTpobPFNJyJx6a3uriXq3HVd7mlXfSUK9ydeoUdG4eqMeLwkxeb6jQWJzLOz41rFVSMtBL0e+ycCATebTaXS4uvFYaDHDdPw2lKY8ADj3MLgsA=" | 594 | set "signature=C52iGEoH+1VqzI6kEAqOhUyrWuEObnivzaVjyef8WqItVYd/xGDTZZ3bkxAI9hTpobPFNJyJx6a3uriXq3HVd7mlXfSUK9ydeoUdG4eqMeLwkxeb6jQWJzLOz41rFVSMtBL0e+ycCATebTaXS4uvFYaDHDdPw2lKY8ADj3MLgsA=" |
524 | set "sessionId=TwBTAE0AYQBqAG8AcgBWAGUAcgBzAGkAbwBuAD0ANQA7AE8AUwBNAGkAbgBvAHIAVgBlAHIAcwBpAG8AbgA9ADEAOwBPAFMAUABsAGEAdABmAG8AcgBtAEkAZAA9ADIAOwBQAFAAPQAwADsARwBWAEwASwBFAHgAcAA9ADIAMAAzADgALQAwADEALQAxADkAVAAwADMAOgAxADQAOgAwADcAWgA7AEQAbwB3AG4AbABlAHYAZQBsAEcAZQBuAHUAaQBuAGUAUwB0AGEAdABlAD0AMQA7AAAA" | 595 | set "sessionId=TwBTAE0AYQBqAG8AcgBWAGUAcgBzAGkAbwBuAD0ANQA7AE8AUwBNAGkAbgBvAHIAVgBlAHIAcwBpAG8AbgA9ADEAOwBPAFMAUABsAGEAdABmAG8AcgBtAEkAZAA9ADIAOwBQAFAAPQAwADsARwBWAEwASwBFAHgAcAA9ADIAMAAzADgALQAwADEALQAxADkAVAAwADMAOgAxADQAOgAwADcAWgA7AEQAbwB3AG4AbABlAHYAZQBsAEcAZQBuAHUAaQBuAGUAUwB0AGEAdABlAD0AMQA7AAAA" |
@@ -527,7 +598,7 @@ set "sessionId=TwBTAE0AYQBqAG8AcgBWAGUAcgBzAGkAbwBuAD0ANQA7AE8AUwBNAGkAbgBvAHIAV | |||
527 | copy /y /b "%tdir%\GenuineTicket" "%tdir%\GenuineTicket.xml" %nul% | 598 | copy /y /b "%tdir%\GenuineTicket" "%tdir%\GenuineTicket.xml" %nul% |
528 | 599 | ||
529 | if not exist "%tdir%\GenuineTicket.xml" ( | 600 | if not exist "%tdir%\GenuineTicket.xml" ( |
530 | call :dk_color %Red% "Generating GenuineTicket.xml [Failed]" | 601 | call :dk_color %Red% "Generating GenuineTicket.xml [Failed, aborting the process]" |
531 | if exist "%tdir%\Genuine*" del /f /q "%tdir%\Genuine*" %nul% | 602 | if exist "%tdir%\Genuine*" del /f /q "%tdir%\Genuine*" %nul% |
532 | goto :k_final | 603 | goto :k_final |
533 | ) else ( | 604 | ) else ( |
@@ -542,10 +613,10 @@ net stop sppsvc /y %nul% | |||
542 | net stop sppsvc /y %nul% | 613 | net stop sppsvc /y %nul% |
543 | net stop sppsvc /y %nul% | 614 | net stop sppsvc /y %nul% |
544 | 615 | ||
545 | sc query sppsvc | find /i "1 STOPPED" %nul% && ( | 616 | sc query sppsvc | find /i "STOPPED" %nul% && ( |
546 | echo Stopping sppsvc Service [Successful] | 617 | echo Stopping sppsvc Service [Successful] |
547 | ) || ( | 618 | ) || ( |
548 | call :dk_color %Red% "Stopping sppsvc Service [Failed]" | 619 | call :dk_color %Gray% "Stopping sppsvc Service [Failed]" |
549 | ) | 620 | ) |
550 | 621 | ||
551 | %_xmlexist% ( | 622 | %_xmlexist% ( |
@@ -566,6 +637,12 @@ clipup -v -o | |||
566 | 637 | ||
567 | set rebuildinfo= | 638 | set rebuildinfo= |
568 | 639 | ||
640 | if not exist %ProgramData%\Microsoft\Windows\ClipSVC\tokens.dat ( | ||
641 | set error=1 | ||
642 | set rebuildinfo=1 | ||
643 | call :dk_color %Red% "Checking ClipSVC tokens.dat [Not Found]" | ||
644 | ) | ||
645 | |||
569 | %_xmlexist% ( | 646 | %_xmlexist% ( |
570 | set error=1 | 647 | set error=1 |
571 | set rebuildinfo=1 | 648 | set rebuildinfo=1 |
@@ -580,7 +657,7 @@ call :dk_color %Red% "Checking Ticket Migration [Failed]" | |||
580 | 657 | ||
581 | if defined applist if not defined showfix if defined rebuildinfo ( | 658 | if defined applist if not defined showfix if defined rebuildinfo ( |
582 | set showfix=1 | 659 | set showfix=1 |
583 | call :dk_color %Magenta% "In MAS, Goto Troubleshoot and run Fix Licensing option." | 660 | call :dk_color %Blue% "%_fixmsg%" |
584 | ) | 661 | ) |
585 | 662 | ||
586 | if exist "%tdir%\Genuine*" del /f /q "%tdir%\Genuine*" %nul% | 663 | if exist "%tdir%\Genuine*" del /f /q "%tdir%\Genuine*" %nul% |
@@ -619,8 +696,8 @@ goto :k_final | |||
619 | ) | 696 | ) |
620 | 697 | ||
621 | call :dk_color %Red% "Activation Failed" | 698 | call :dk_color %Red% "Activation Failed" |
622 | if not defined error call :dk_color %Magenta% "In MAS, Goto Troubleshoot and run Fix Licensing option." | 699 | if not defined error call :dk_color %Blue% "%_fixmsg%" |
623 | call :dk_color2 %Magenta% "Check this page for help" %_Yellow% " https://massgrave.dev/troubleshoot" | 700 | call :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%" && ( |
648 | call :dk_color %Magenta% "Protect KMS38 By KMS [Successful] [Locked A Registry Key]" | 725 | call :dk_color %Blue% "Protect KMS38 From KMS [Successful] [Locked A Registry Key]" |
649 | ) || ( | 726 | ) || ( |
650 | call :dk_color %Red% "Protect KMS38 By KMS [Failed To Lock A Registry Key]" | 727 | call :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 | ||
733 | set xpr= | 810 | set xpr= |
734 | for /f "tokens=* delims=" %%# in ('%psc% "$([DateTime]::Now.addMinutes(%gpr%)).ToString('yyyy-MM-dd HH:mm:ss')" 2^>nul') do set "xpr=%%#" | 811 | for /f "tokens=* delims=" %%# in ('%psc% "$([DateTime]::Now.addMinutes(%gpr%)).ToString('yyyy-MM-dd HH:mm:ss')" %nul6%') do set "xpr=%%#" |
735 | call :dk_color %Green% "%winos% is activated till !xpr!" | 812 | call :dk_color %Green% "%winos% is activated till !xpr!" |
736 | exit /b | 813 | exit /b |
737 | 814 | ||
@@ -740,8 +817,8 @@ exit /b | |||
740 | :k_checkexp | 817 | :k_checkexp |
741 | 818 | ||
742 | set gpr=0 | 819 | set gpr=0 |
743 | if %_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=%%#" | 820 | if %_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=%%#" |
744 | if %_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=%%#" | 821 | if %_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=%%#" |
745 | if %gpr% GTR 259200 (set _k38=1) else (set _k38=) | 822 | if %gpr% GTR 259200 (set _k38=1) else (set _k38=) |
746 | exit /b | 823 | exit /b |
747 | 824 | ||
@@ -749,8 +826,8 @@ exit /b | |||
749 | 826 | ||
750 | :dk_checkperm | 827 | :dk_checkperm |
751 | 828 | ||
752 | if %_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= | 829 | if %_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= |
753 | if %_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= | 830 | if %_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= |
754 | exit /b | 831 | exit /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 | ||
768 | if %_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=%%#" | 845 | if %_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=%%#" |
769 | if %_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=%%#" | 846 | if %_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=%%#" |
770 | exit /b | 847 | exit /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 | ||
776 | set applist= | 853 | set applist= |
777 | if %_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')" | 854 | if %_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%')" |
778 | if %_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')" | 855 | if %_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")) |
780 | exit /b | 857 | exit /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 | ||
864 | if ($info.LastRunTime -match 99) { | ||
865 | $task | Start-ScheduledTask | ||
866 | Start-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 | ||
786 | set _wmic=0 | 876 | set _wmic=0 |
787 | for %%# in (wmic.exe) do @if not "%%~$PATH:#"=="" ( | 877 | for %%# in (wmic.exe) do @if not "%%~$PATH:#"=="" ( |
788 | wmic path Win32_ComputerSystem get CreationClassName /value 2>nul | find /i "computersystem" 1>nul && set _wmic=1 | 878 | wmic path Win32_ComputerSystem get CreationClassName /value %nul2% | find /i "computersystem" %nul1% && set _wmic=1 |
789 | ) | 879 | ) |
790 | exit /b | 880 | exit /b |
791 | 881 | ||
@@ -800,8 +890,8 @@ set d1=%d1% $meth.SetImplementationFlags(128); $TypeBuilder.CreateType()::Brandi | |||
800 | 890 | ||
801 | set winos= | 891 | set winos= |
802 | for /f "delims=" %%s in ('"%psc% %d1%"') do if not errorlevel 1 (set winos=%%s) | 892 | for /f "delims=" %%s in ('"%psc% %d1%"') do if not errorlevel 1 (set winos=%%s) |
803 | echo "%winos%" | find /i "Windows" 1>nul || ( | 893 | echo "%winos%" | find /i "Windows" %nul1% || ( |
804 | for /f "skip=2 tokens=2*" %%a in ('reg query "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion" /v ProductName 2^>nul') do set "winos=%%b" | 894 | for /f "skip=2 tokens=2*" %%a in ('reg query "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion" /v ProductName %nul6%') do set "winos=%%b" |
805 | if %winbuild% GEQ 22000 ( | 895 | if %winbuild% GEQ 22000 ( |
806 | set winos=!winos:Windows 10=Windows 11! | 896 | set winos=!winos:Windows 10=Windows 11! |
807 | ) | 897 | ) |
@@ -866,17 +956,33 @@ exit /b | |||
866 | 956 | ||
867 | :dk_errorcheck | 957 | :dk_errorcheck |
868 | 958 | ||
959 | set showfix= | ||
960 | |||
961 | :: Check corrupt services | ||
962 | |||
963 | set serv_cor= | ||
964 | for %%# in (%_serv%) do ( | ||
965 | set _corrupt= | ||
966 | sc start %%# %nul% | ||
967 | if !errorlevel! EQU 1060 set _corrupt=1 | ||
968 | sc query %%# %nul% || set _corrupt=1 | ||
969 | for %%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) | ||
970 | if defined _corrupt (if defined serv_cor (set "serv_cor=!serv_cor! %%#") else (set "serv_cor=%%#")) | ||
971 | ) | ||
972 | |||
973 | if defined serv_cor ( | ||
974 | set error=1 | ||
975 | call :dk_color %Red% "Checking Corrupt Services [%serv_cor%]" | ||
976 | ) | ||
977 | |||
978 | ::======================================================================================================================================== | ||
979 | |||
869 | :: Check disabled services | 980 | :: Check disabled services |
870 | 981 | ||
871 | set serv_ste= | 982 | set serv_ste= |
872 | for %%# in (%_serv%) do ( | 983 | for %%# in (%_serv%) do ( |
873 | set serv_dis= | ||
874 | reg query HKLM\SYSTEM\CurrentControlSet\Services\%%# /v ImagePath %nul% || set serv_dis=1 | ||
875 | for /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 | ||
876 | sc start %%# %nul% | 984 | sc start %%# %nul% |
877 | if !errorlevel! EQU 1058 set serv_dis=1 | 985 | if !errorlevel! EQU 1058 (if defined serv_ste (set "serv_ste=!serv_ste! %%#") else (set "serv_ste=%%#")) |
878 | sc query %%# %nul% || set serv_dis=1 | ||
879 | if 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= | |||
919 | set checkerror= | 1025 | set checkerror= |
920 | net start %%# /y %nul% | 1026 | net start %%# /y %nul% |
921 | set errorcode=!errorlevel! | 1027 | set errorcode=!errorlevel! |
922 | sc query %%# | find /i "4 RUNNING" %nul% || set checkerror=1 | 1028 | sc query %%# | find /i "RUNNING" %nul% || set checkerror=1 |
923 | 1029 | ||
924 | sc start %%# %nul% | 1030 | sc start %%# %nul% |
925 | if !errorlevel! NEQ 1056 if !errorlevel! NEQ 0 (set errorcode=!errorlevel!&set checkerror=1) | 1031 | if !errorlevel! NEQ 1056 if !errorlevel! NEQ 0 (set errorcode=!errorlevel!&set checkerror=1) |
@@ -930,7 +1036,8 @@ if defined serv_e ( | |||
930 | set error=1 | 1036 | set error=1 |
931 | call :dk_color %Red% "Starting Services [Failed] [%serv_e%]" | 1037 | call :dk_color %Red% "Starting Services [Failed] [%serv_e%]" |
932 | echo %serv_e% | findstr /i "ClipSVC-1058 sppsvc-1058" %nul% && ( | 1038 | echo %serv_e% | findstr /i "ClipSVC-1058 sppsvc-1058" %nul% && ( |
933 | call :dk_color %Magenta% "Restart the system to fix disabled service error 1058." | 1039 | call :dk_color %Blue% "Restart the system to fix disabled service error 1058." |
1040 | set 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 | ||
941 | if defined safeboot_option ( | 1048 | if defined safeboot_option ( |
942 | set error=1 | 1049 | set error=1 |
943 | call :dk_color2 %Red% "Checking Boot Mode " %Magenta% "[System is running in safe mode. Run in normal mode.]" | 1050 | set showfix=1 |
1051 | call :dk_color2 %Red% "Checking Boot Mode " %Blue% "[System is running in safe mode. Run in normal mode.]" | ||
944 | ) | 1052 | ) |
945 | 1053 | ||
946 | 1054 | ||
947 | reg query "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Setup\State" 2>nul | find /i "IMAGE_STATE_COMPLETE" 1>nul || ( | 1055 | reg query "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Setup\State" %nul2% | find /i "IMAGE_STATE_COMPLETE" %nul1% || ( |
948 | set error=1 | 1056 | set error=1 |
949 | call :dk_color2 %Red% "Checking Audit Mode " %Magenta% "[System is running in Audit mode. Run in normal mode.]" | 1057 | set showfix=1 |
1058 | call :dk_color2 %Red% "Checking Audit Mode " %Blue% "[IMAGE_STATE_COMPLETE status not found. Run in normal mode.]" | ||
950 | ) | 1059 | ) |
951 | 1060 | ||
952 | 1061 | ||
953 | reg query "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\WinPE" /v InstRoot %nul% && ( | 1062 | reg query "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\WinPE" /v InstRoot %nul% && ( |
954 | set error=1 | 1063 | set error=1 |
955 | call :dk_color2 %Red% "Checking WinPE " %Magenta% "[System is running in WinPE mode. Run in normal mode.]" | 1064 | set showfix=1 |
956 | ) | 1065 | call :dk_color2 %Red% "Checking WinPE " %Blue% "[System is running in WinPE mode. Run in normal mode.]" |
957 | |||
958 | |||
959 | for %%# in (wmic.exe) do @if "%%~$PATH:#"=="" ( | ||
960 | call :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% || ( |
965 | set error=1 | 1070 | set error=1 |
966 | call :dk_color %Red% "Checking Powershell [Not Responding]" | 1071 | call :dk_color %Red% "Checking Powershell [Not Responding]" |
967 | ) | 1072 | ) |
968 | 1073 | ||
969 | 1074 | ||
970 | set wmifailed= | ||
971 | if %_wmic% EQU 1 wmic path Win32_ComputerSystem get CreationClassName /value 2>nul | find /i "computersystem" 1>nul | ||
972 | if %_wmic% EQU 0 %psc% "Get-CIMInstance -Class Win32_ComputerSystem | Select-Object -Property CreationClassName" 2>nul | find /i "computersystem" 1>nul | ||
973 | if %errorlevel% NEQ 0 ( | ||
974 | set error=1 | ||
975 | set wmifailed=1 | ||
976 | call :dk_color %Red% "Checking WMI [Not Responding] %_wmic%" | ||
977 | call :dk_color %Magenta% "In MAS, Goto Troubleshoot and run Fix WMI option." | ||
978 | ) | ||
979 | |||
980 | |||
981 | if not "%regSKU%"=="%wmiSKU%" ( | ||
982 | call :dk_color %Red% "Checking WMI/REG SKU [Difference Found - WMI:%wmiSKU% Reg:%regSKU%]" | ||
983 | ) | ||
984 | |||
985 | |||
986 | DISM /English /Online /Get-CurrentEdition %nul% | 1075 | DISM /English /Online /Get-CurrentEdition %nul% |
987 | set error_code=%errorlevel% | 1076 | set dism_error=%errorlevel% |
988 | cmd /c exit /b %error_code% | 1077 | cmd /c exit /b %dism_error% |
989 | if %error_code% NEQ 0 set "error_code=[0x%=ExitCode%]" | 1078 | if %dism_error% NEQ 0 set "dism_error=[0x%=ExitCode%]" |
990 | if %error_code% NEQ 0 ( | 1079 | if %dism_error% NEQ 0 ( |
991 | call :dk_color %Red% "Checking DISM [Not Responding] %error_code%" | 1080 | call :dk_color %Red% "Checking DISM [Not Responding] %dism_error%" |
992 | ) | 1081 | ) |
993 | 1082 | ||
994 | 1083 | ||
995 | if exist "%SystemRoot%\Servicing\Packages\Microsoft-Windows-*EvalEdition~*.mum" ( | 1084 | if not defined officeact if exist "%SystemRoot%\Servicing\Packages\Microsoft-Windows-*EvalEdition~*.mum" ( |
996 | set error=1 | 1085 | set error=1 |
997 | call :dk_color %Red% "Checking Eval Packages [Non-Eval Licenses are installed in Eval Windows]" | 1086 | call :dk_color %Red% "Checking Eval Packages [Non-Eval Licenses are installed in Eval Windows]" |
1087 | if /i %dism_error%==[0x800F0805] ( | ||
1088 | for %%# in (4 125 126 188 191 205) do if "%osSKU%"=="%%#" ( | ||
1089 | call :dk_color %Blue% "Evaluation Windows can not be activated and different License install may lead to errors." | ||
1090 | call :dk_color %Blue% "It is recommended to install full version of %winos%." | ||
1091 | call :dk_color %Blue% "You can download it from https://%mas%/genuine-installation-media.html" | ||
1092 | set 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 | ||
1108 | for %%# in (wmic.exe) do @if "%%~$PATH:#"=="" ( | ||
1109 | call :dk_color %Gray% "Checking WMIC.exe [Not Found]" | ||
1110 | ) | ||
1111 | |||
1112 | |||
1113 | set wmifailed= | ||
1114 | if %_wmic% EQU 1 wmic path Win32_ComputerSystem get CreationClassName /value %nul2% | find /i "computersystem" %nul1% | ||
1115 | if %_wmic% EQU 0 %psc% "Get-CIMInstance -Class Win32_ComputerSystem | Select-Object -Property CreationClassName" %nul2% | find /i "computersystem" %nul1% | ||
1116 | |||
1117 | if %errorlevel% NEQ 0 set wmifailed=1 | ||
1118 | echo "%error_code%" | findstr /i "0x800410 0x800440" %nul1% && set wmifailed=1& :: https://learn.microsoft.com/en-us/windows/win32/wmisdk/wmi-error-constants | ||
1119 | if defined wmifailed ( | ||
1120 | set error=1 | ||
1121 | call :dk_color %Red% "Checking WMI [Not Responding]" | ||
1122 | call :dk_color %Blue% "In MAS, Goto Troubleshoot and run Fix WMI option." | ||
1123 | set showfix=1 | ||
1124 | ) | ||
1125 | |||
1126 | |||
1127 | %nul% set /a "sum=%slcSKU%+%regSKU%+%wmiSKU%" | ||
1128 | set /a "sum/=3" | ||
1129 | if not defined officeact if not "%sum%"=="%slcSKU%" ( | ||
1130 | call :dk_color %Red% "Checking SLC/WMI/REG SKU [Difference Found - SLC:%slcSKU% WMI:%wmiSKU% Reg:%regSKU%]" | ||
1131 | ) | ||
1132 | |||
1133 | |||
1011 | reg query "HKU\S-1-5-20\Software\Microsoft\Windows NT\CurrentVersion\SoftwareProtectionPlatform\PersistedTSReArmed" %nul% && ( | 1134 | reg query "HKU\S-1-5-20\Software\Microsoft\Windows NT\CurrentVersion\SoftwareProtectionPlatform\PersistedTSReArmed" %nul% && ( |
1012 | set error=1 | 1135 | set error=1 |
1013 | call :dk_color2 %Red% "Checking Rearm " %Magenta% "[System Restart Is Required]" | 1136 | set showfix=1 |
1137 | call :dk_color2 %Red% "Checking Rearm " %Blue% "[System Restart Is Required]" | ||
1014 | ) | 1138 | ) |
1015 | 1139 | ||
1016 | 1140 | ||
1017 | reg query "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\ClipSVC\Volatile\PersistedSystemState" %nul% && ( | 1141 | reg query "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\ClipSVC\Volatile\PersistedSystemState" %nul% && ( |
1018 | set error=1 | 1142 | set error=1 |
1019 | call :dk_color2 %Red% "Checking ClipSVC " %Magenta% "[System Restart Is Required]" | 1143 | set showfix=1 |
1144 | call :dk_color2 %Red% "Checking ClipSVC " %Blue% "[System Restart Is Required]" | ||
1020 | ) | 1145 | ) |
1021 | 1146 | ||
1022 | 1147 | ||
1023 | for /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 ( | 1148 | for /f "skip=2 tokens=2*" %%a in ('reg query "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\SoftwareProtectionPlatform" /v "SkipRearm" %nul6%') do if /i %%b NEQ 0x0 ( |
1024 | reg add "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\SoftwareProtectionPlatform" /v "SkipRearm" /t REG_DWORD /d "0" /f %nul% | 1149 | reg add "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\SoftwareProtectionPlatform" /v "SkipRearm" /t REG_DWORD /d "0" /f %nul% |
1025 | call :dk_color %Red% "Checking SkipRearm [Default 0 Value Not Found, Changing To 0]" | 1150 | call :dk_color %Red% "Checking SkipRearm [Default 0 Value Not Found. Changing To 0]" |
1026 | net stop sppsvc /y %nul% | 1151 | net stop sppsvc /y %nul% |
1027 | net start sppsvc /y %nul% | 1152 | net start sppsvc /y %nul% |
1028 | set error=1 | 1153 | set error=1 |
@@ -1031,7 +1156,24 @@ set error=1 | |||
1031 | 1156 | ||
1032 | reg query "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\SoftwareProtectionPlatform\Plugins\Objects\msft:rm/algorithm/hwid/4.0" /f ba02fed39662 /d %nul% || ( | 1157 | reg query "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\SoftwareProtectionPlatform\Plugins\Objects\msft:rm/algorithm/hwid/4.0" /f ba02fed39662 /d %nul% || ( |
1033 | call :dk_color %Red% "Checking SPP Registry Key [Incorrect ModuleId Found]" | 1158 | call :dk_color %Red% "Checking SPP Registry Key [Incorrect ModuleId Found]" |
1159 | call :dk_color %Blue% "Possibly Caused By Gaming Spoofers. Help: https://%mas%/troubleshoot" | ||
1034 | set error=1 | 1160 | set error=1 |
1161 | set showfix=1 | ||
1162 | ) | ||
1163 | |||
1164 | |||
1165 | set tokenstore= | ||
1166 | for /f "skip=2 tokens=2*" %%a in ('reg query "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\SoftwareProtectionPlatform" /v TokenStore %nul6%') do call set "tokenstore=%%b" | ||
1167 | if not exist "%tokenstore%\" ( | ||
1168 | set error=1 | ||
1169 | REM This code creates token folder only if it's missing and sets default permission for it | ||
1170 | mkdir "%tokenstore%" %nul% | ||
1171 | set "d=$sddl = 'O:BAG:BAD:PAI(A;OICI;FA;;;SY)(A;OICI;FA;;;BA)(A;OICIIO;GR;;;BU)(A;;FR;;;BU)(A;OICI;FA;;;S-1-5-80-123231216-2592883651-3715271367-3753151631-4175906628)';" | ||
1172 | set "d=!d! $AclObject = New-Object System.Security.AccessControl.DirectorySecurity;" | ||
1173 | set "d=!d! $AclObject.SetSecurityDescriptorSddlForm($sddl);" | ||
1174 | set "d=!d! Set-Acl -Path %tokenstore% -AclObject $AclObject;" | ||
1175 | %psc% "!d!" %nul% | ||
1176 | call :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 | ||
1052 | set tokenstore= | ||
1053 | for /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" | ||
1054 | if not exist "%tokenstore%\" ( | ||
1055 | set error=1 | ||
1056 | call :dk_color %Red% "Checking SPP Token Folder [Not Found] [%tokenstore%\]" | ||
1057 | ) | ||
1058 | |||
1059 | |||
1060 | if exist "%tokenstore%\" if not exist "%tokenstore%\tokens.dat" ( | 1194 | if exist "%tokenstore%\" if not exist "%tokenstore%\tokens.dat" ( |
1061 | set error=1 | 1195 | set error=1 |
1062 | call :dk_color %Red% "Checking SPP tokens.dat [Not Found] [%tokenstore%\]" | 1196 | call :dk_color %Red% "Checking SPP tokens.dat [Not Found] [%tokenstore%\]" |
1063 | ) | 1197 | ) |
1064 | 1198 | ||
1065 | 1199 | ||
1066 | if not exist %ProgramData%\Microsoft\Windows\ClipSVC\tokens.dat ( | 1200 | if not exist %SystemRoot%\system32\sppsvc.exe ( |
1067 | set error=1 | 1201 | set error=1 |
1068 | call :dk_color %Red% "Checking ClipSVC tokens.dat [Not Found]" | 1202 | set showfix=1 |
1203 | call :dk_color %Red% "Checking sppsvc.exe File [Not Found]" | ||
1069 | ) | 1204 | ) |
1070 | 1205 | ||
1071 | 1206 | ||
1072 | if not exist %SystemRoot%\system32\sppsvc.exe ( | 1207 | set task= |
1073 | set error=1 | 1208 | set taskerror= |
1074 | call :dk_color %Red% "Checking sppsvc.exe File [Not Found]" | 1209 | if not defined wmifailed if not defined officeact ( |
1210 | for /f "delims=" %%a in ('%psc% "$f=[io.file]::ReadAllText('!_batp!') -split ':gettaskinfo\:.*';iex ($f[1]);"') do (set task=%%a) | ||
1211 | echo "!task!" | find /i "Ready 0 " %nul% || set taskerror=1 | ||
1212 | echo "!task!" | find "99" %nul% && set taskerror=1 | ||
1213 | if defined taskerror ( | ||
1214 | call :dk_color %Gray% "Checking SvcRestartTask Last Run [Issues Found, !task!]" | ||
1215 | call :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 | ||
1080 | set showfix= | ||
1081 | set wpaerror= | 1222 | set wpaerror= |
1082 | set permerror= | 1223 | set permerror= |
1083 | if not defined serv_cste if /i not %error_code%==0 if /i not %error_code%==0xC004D302 if not defined wmifailed ( | 1224 | if not defined serv_cor if not defined serv_cste if defined error if /i not %error_code%==0 if not defined showfix ( |
1084 | 1225 | ||
1085 | REM This code checks for invalid registry keys in HKLM\SYSTEM\WPA. This issue may appear even on healthy systems. | 1226 | REM This code checks for invalid registry keys in HKLM\SYSTEM\WPA. This issue may appear even on healthy systems. |
1086 | 1227 | ||
1087 | if %winbuild% GEQ 14393 ( | 1228 | if %winbuild% GEQ 14393 ( |
1088 | set /a count=0 | 1229 | set /a count=0 |
1089 | for /f %%a in ('reg query "HKLM\SYSTEM\WPA" 2^>nul') do set /a count+=1 | 1230 | for /f %%a in ('reg query "HKLM\SYSTEM\WPA" %nul6%') do set /a count+=1 |
1090 | for /L %%# in (1,1,!count!) do ( | 1231 | for /L %%# in (1,1,!count!) do ( |
1091 | reg query "HKLM\SYSTEM\WPA\8DEC0AF1-0341-4b93-85CD-72606C2DF94C-7P-%%#" /ve /t REG_BINARY %nul% || set wpaerror=1 | 1232 | reg 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 | |||
1108 | if defined permerror call :dk_color %Red% "Checking SPP Permissions [Error Found]" | 1249 | if defined permerror call :dk_color %Red% "Checking SPP Permissions [Error Found]" |
1109 | 1250 | ||
1110 | set showfix=1 | 1251 | set showfix=1 |
1111 | call :dk_color %Magenta% "In MAS, Goto Troubleshoot and run Fix Licensing option." | 1252 | call :dk_color %Blue% "%_fixmsg%" |
1112 | if not defined permerror call :dk_color %Magenta% "If activation still fails then run Fix WPA Registry option." | 1253 | if not defined permerror call :dk_color %Blue% "If activation still fails then run Fix WPA Registry option." |
1113 | ) | 1254 | ) |
1114 | 1255 | ||
1115 | exit /b | 1256 | exit /b |
@@ -1141,7 +1282,7 @@ exit /b | |||
1141 | echo: | 1282 | echo: |
1142 | if %_unattended%==1 timeout /t 2 & exit /b | 1283 | if %_unattended%==1 timeout /t 2 & exit /b |
1143 | call :dk_color %_Yellow% "Press any key to %_exitmsg%..." | 1284 | call :dk_color %_Yellow% "Press any key to %_exitmsg%..." |
1144 | pause >nul | 1285 | pause %nul1% |
1145 | exit /b | 1286 | exit /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 | |||
1178 | 43d9af6e-5e86-4be8-a797-d072a046896c_K9F%f%YF-G6%f%NCK-73M%f%32-XM%f%VPY-F9%f%DRR_120_ServerARM64_RS4 | 1319 | 43d9af6e-5e86-4be8-a797-d072a046896c_K9F%f%YF-G6%f%NCK-73M%f%32-XM%f%VPY-F9%f%DRR_120_ServerARM64_RS4 |
1179 | e0c42288-980c-4788-a014-c080d2e1926e_NW6%f%C2-QM%f%PVW-D7K%f%KK-3G%f%KT6-VC%f%FB2_121_Education | 1320 | e0c42288-980c-4788-a014-c080d2e1926e_NW6%f%C2-QM%f%PVW-D7K%f%KK-3G%f%KT6-VC%f%FB2_121_Education |
1180 | 3c102355-d027-42c6-ad23-2e7ef8a02585_2WH%f%4N-8Q%f%GBV-H22%f%JP-CT%f%43Q-MD%f%WWJ_122_EducationN | 1321 | 3c102355-d027-42c6-ad23-2e7ef8a02585_2WH%f%4N-8Q%f%GBV-H22%f%JP-CT%f%43Q-MD%f%WWJ_122_EducationN |
1181 | 32d2fab3-e4a8-42c2-923b-4bf4fd13e6ee_M7X%f%TQ-FN%f%8P6-TTK%f%YV-9D%f%4CC-J4%f%62D_125_EnterpriseS_RS5,VB | 1322 | 32d2fab3-e4a8-42c2-923b-4bf4fd13e6ee_M7X%f%TQ-FN%f%8P6-TTK%f%YV-9D%f%4CC-J4%f%62D_125_EnterpriseS_RS5,VB,Ge |
1182 | 2d5a5a60-3040-48bf-beb0-fcd770c20ce0_DCP%f%HK-NF%f%MTC-H88%f%MJ-PF%f%HPY-QJ%f%4BJ_125_EnterpriseS_RS1 | 1323 | 2d5a5a60-3040-48bf-beb0-fcd770c20ce0_DCP%f%HK-NF%f%MTC-H88%f%MJ-PF%f%HPY-QJ%f%4BJ_125_EnterpriseS_RS1 |
1183 | 7b51a46c-0c04-4e8f-9af4-8496cca90d5e_WNM%f%TR-4C%f%88C-JK8%f%YV-HQ%f%7T2-76%f%DF9_125_EnterpriseS_TH1 | 1324 | 7b51a46c-0c04-4e8f-9af4-8496cca90d5e_WNM%f%TR-4C%f%88C-JK8%f%YV-HQ%f%7T2-76%f%DF9_125_EnterpriseS_TH1 |
1184 | 7103a333-b8c8-49cc-93ce-d37c09687f92_92N%f%FX-8D%f%JQP-P6B%f%BQ-TH%f%F9C-7C%f%G2H_126_EnterpriseSN_RS5,VB | 1325 | 7103a333-b8c8-49cc-93ce-d37c09687f92_92N%f%FX-8D%f%JQP-P6B%f%BQ-TH%f%F9C-7C%f%G2H_126_EnterpriseSN_RS5,VB,Ge |
1185 | 9f776d83-7156-45b2-8a5c-359b9c9f22a3_QFF%f%DN-GR%f%T3P-VKW%f%WX-X7%f%T3R-8B%f%639_126_EnterpriseSN_RS1 | 1326 | 9f776d83-7156-45b2-8a5c-359b9c9f22a3_QFF%f%DN-GR%f%T3P-VKW%f%WX-X7%f%T3R-8B%f%639_126_EnterpriseSN_RS1 |
1186 | 87b838b7-41b6-4590-8318-5797951d8529_2F7%f%7B-TN%f%FGY-69Q%f%QF-B8%f%YKP-D6%f%9TJ_126_EnterpriseSN_TH1 | 1327 | 87b838b7-41b6-4590-8318-5797951d8529_2F7%f%7B-TN%f%FGY-69Q%f%QF-B8%f%YKP-D6%f%9TJ_126_EnterpriseSN_TH1 |
1187 | 39e69c41-42b4-4a0a-abad-8e3c10a797cc_QFN%f%D9-D3%f%Y9C-J3K%f%KY-6R%f%PVP-2D%f%PYV_145_ServerDatacenterACor_FE | 1328 | 39e69c41-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 | |||
1202 | ec868e65-fadf-4759-b23e-93fe37f2cc29_CPW%f%HC-NT%f%2C7-VYW%f%78-DH%f%DB2-PG%f%3GK_175_ServerRdsh_RS5 | 1343 | ec868e65-fadf-4759-b23e-93fe37f2cc29_CPW%f%HC-NT%f%2C7-VYW%f%78-DH%f%DB2-PG%f%3GK_175_ServerRdsh_RS5 |
1203 | e4db50ea-bda1-4566-b047-0ca50abc6f07_7NB%f%T4-WG%f%BQX-MP4%f%H7-QX%f%FF8-YP%f%3KX_175_ServerRdsh_RS3 | 1344 | e4db50ea-bda1-4566-b047-0ca50abc6f07_7NB%f%T4-WG%f%BQX-MP4%f%H7-QX%f%FF8-YP%f%3KX_175_ServerRdsh_RS3 |
1204 | 0df4f814-3f57-4b8b-9a9d-fddadcd69fac_NBT%f%WJ-3D%f%R69-3C4%f%V8-C2%f%6MC-GQ%f%9M6_183_CloudE | 1345 | 0df4f814-3f57-4b8b-9a9d-fddadcd69fac_NBT%f%WJ-3D%f%R69-3C4%f%V8-C2%f%6MC-GQ%f%9M6_183_CloudE |
1205 | 59eb965c-9150-42b7-a0ec-22151b9897c5_KBN%f%8V-HF%f%GQ4-MGX%f%VD-34%f%7P6-PD%f%QGT_191_IoTEnterpriseS_NI | 1346 | 59eb965c-9150-42b7-a0ec-22151b9897c5_KBN%f%8V-HF%f%GQ4-MGX%f%VD-34%f%7P6-PD%f%QGT_191_IoTEnterpriseS_VB,NI |
1206 | d30136fc-cb4b-416e-a23d-87207abc44a9_6XN%f%7V-PC%f%BDC-BDB%f%RH-8D%f%QY7-G6%f%R44_202_CloudEditionN | 1347 | d30136fc-cb4b-416e-a23d-87207abc44a9_6XN%f%7V-PC%f%BDC-BDB%f%RH-8D%f%QY7-G6%f%R44_202_CloudEditionN |
1207 | ca7df2e3-5ea0-47b8-9ac1-b1be4d8edd69_37D%f%7F-N4%f%9CB-WQR%f%8W-TB%f%J73-FM%f%8RX_203_CloudEdition | 1348 | ca7df2e3-5ea0-47b8-9ac1-b1be4d8edd69_37D%f%7F-N4%f%9CB-WQR%f%8W-TB%f%J73-FM%f%8RX_203_CloudEdition |
1208 | 19b5e0fb-4431-46bc-bac1-2f1873e4ae73_NTB%f%V8-9K%f%7Q8-V27%f%C6-M2%f%BTV-KH%f%MXV_407_ServerTurbine | 1349 | 19b5e0fb-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 ( |
1210 | for /f "tokens=1-5 delims=_" %%A in ("%%#") do if %osSKU%==%%C ( | 1351 | for /f "tokens=1-5 delims=_" %%A in ("%%#") do if %osSKU%==%%C ( |
1211 | if %1==getkey if not defined key echo "!applist!" | find /i "%%A" >nul && set key=%%B | 1352 | if %1==getkey if not defined key echo "!applist!" | find /i "%%A" %nul1% && set key=%%B |
1212 | ) | 1353 | ) |
1213 | ) | 1354 | ) |
1214 | exit /b | 1355 | exit /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= | |||
1233 | if %_NoEditionChange%==1 exit /b | 1373 | if %_NoEditionChange%==1 exit /b |
1234 | 1374 | ||
1235 | for %%# in ( | 1375 | for %%# in ( |
1236 | 188_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 | 1376 | 188_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 |
1237 | 191_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 | 1377 | 191_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 |
1238 | 205_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 | 1378 | 205_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 |
1239 | 138_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 | 1379 | 138_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 |
1380 | 139_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 | ||
1381 | 139_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 ( |
1241 | for /f "tokens=1-6 delims=_" %%A in ("%%#") do if %osSKU%==%%A ( | 1383 | for /f "tokens=1-6 delims=_" %%A in ("%%#") do if %osSKU%==%%A ( |
1242 | echo "!applist!" | find /i "%%C" 1>nul && ( | 1384 | echo "!applist!" | find /i "%%C" %nul1% && ( |
1243 | echo "!applist!" | find /i "%%D" 1>nul && ( | 1385 | echo "!applist!" | find /i "%%D" %nul1% && ( |
1244 | set altkey=%%E | 1386 | set altkey=%%E |
1245 | set curedition=%%B | ||
1246 | set altedition=%%F | 1387 | set altedition=%%F |
1247 | ) || ( | 1388 | ) || ( |
1248 | set altedition=%%F | 1389 | set altedition=%%F |
@@ -1253,4 +1394,5 @@ set notfoundaltactID=1 | |||
1253 | ) | 1394 | ) |
1254 | exit /b | 1395 | exit /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 | ||
18 | set _act=0 | ||
19 | |||
20 | :: To remove Ohook activation, run the script with /Ohook-Uninstall parameter or change 0 to 1 in below line | ||
21 | set _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 | |||
31 | set "PATH=%SystemRoot%\System32;%SystemRoot%\System32\wbem;%SystemRoot%\System32\WindowsPowerShell\v1.0\" | ||
32 | if exist "%SystemRoot%\Sysnative\reg.exe" ( | ||
33 | set "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 | |||
39 | set "_cmdf=%~f0" | ||
40 | for %%# in (%*) do ( | ||
41 | if /i "%%#"=="r1" set r1=1 | ||
42 | if /i "%%#"=="r2" set r2=1 | ||
43 | if /i "%%#"=="-qedit" ( | ||
44 | reg add HKCU\Console /v QuickEdit /t REG_DWORD /d "1" /f 1>nul | ||
45 | rem check the code below admin elevation to understand why it's here | ||
46 | ) | ||
47 | ) | ||
48 | |||
49 | if exist %SystemRoot%\Sysnative\cmd.exe if not defined r1 ( | ||
50 | setlocal EnableDelayedExpansion | ||
51 | start %SystemRoot%\Sysnative\cmd.exe /c ""!_cmdf!" %* r1" | ||
52 | exit /b | ||
53 | ) | ||
54 | |||
55 | :: Re-launch the script with ARM32 process if it was initiated by x64 process on ARM64 Windows | ||
56 | |||
57 | if exist %SystemRoot%\SysArm32\cmd.exe if %PROCESSOR_ARCHITECTURE%==AMD64 if not defined r2 ( | ||
58 | setlocal EnableDelayedExpansion | ||
59 | start %SystemRoot%\SysArm32\cmd.exe /c ""!_cmdf!" %* r2" | ||
60 | exit /b | ||
61 | ) | ||
62 | |||
63 | ::======================================================================================================================================== | ||
64 | |||
65 | set "blank=" | ||
66 | set "mas=mass%blank%grave.dev" | ||
67 | |||
68 | :: Check if Null service is working, it's important for the batch script | ||
69 | |||
70 | sc query Null | find /i "RUNNING" | ||
71 | if %errorlevel% NEQ 0 ( | ||
72 | echo: | ||
73 | echo Null service is not running, script may crash... | ||
74 | echo: | ||
75 | echo: | ||
76 | echo Help - https://%mas%/troubleshoot.html | ||
77 | echo: | ||
78 | echo: | ||
79 | ping 127.0.0.1 -n 10 | ||
80 | ) | ||
81 | cls | ||
82 | |||
83 | :: Check LF line ending | ||
84 | |||
85 | pushd "%~dp0" | ||
86 | >nul findstr /v "$" "%~nx0" && ( | ||
87 | echo: | ||
88 | echo Error: Script either has LF line ending issue or an empty line at the end of the script is missing. | ||
89 | echo: | ||
90 | ping 127.0.0.1 -n 6 >nul | ||
91 | popd | ||
92 | exit /b | ||
93 | ) | ||
94 | popd | ||
95 | |||
96 | ::======================================================================================================================================== | ||
97 | |||
98 | cls | ||
99 | color 07 | ||
100 | title Ohook Activation | ||
101 | |||
102 | set _args= | ||
103 | set _elev= | ||
104 | set _unattended=0 | ||
105 | |||
106 | set _args=%* | ||
107 | if defined _args set _args=%_args:"=% | ||
108 | if defined _args ( | ||
109 | for %%A in (%_args%) do ( | ||
110 | if /i "%%A"=="/Ohook" set _act=1 | ||
111 | if /i "%%A"=="/Ohook-Uninstall" set _rem=1 | ||
112 | if /i "%%A"=="-el" set _elev=1 | ||
113 | ) | ||
114 | ) | ||
115 | |||
116 | for %%A in (%_act% %_rem%) do (if "%%A"=="1" set _unattended=1) | ||
117 | |||
118 | ::======================================================================================================================================== | ||
119 | |||
120 | set "nul1=1>nul" | ||
121 | set "nul2=2>nul" | ||
122 | set "nul6=2^>nul" | ||
123 | set "nul=>nul 2>&1" | ||
124 | |||
125 | set psc=powershell.exe | ||
126 | set winbuild=1 | ||
127 | for /f "tokens=6 delims=[]. " %%G in ('ver') do set winbuild=%%G | ||
128 | |||
129 | set _NCS=1 | ||
130 | if %winbuild% LSS 10586 set _NCS=0 | ||
131 | if %winbuild% GEQ 10586 reg query "HKCU\Console" /v ForceV2 %nul2% | find /i "0x0" %nul1% && (set _NCS=0) | ||
132 | |||
133 | if %_NCS% EQU 1 ( | ||
134 | for /F %%a in ('echo prompt $E ^| cmd') do set "esc=%%a" | ||
135 | set "Red="41;97m"" | ||
136 | set "Gray="100;97m"" | ||
137 | set "Green="42;97m"" | ||
138 | set "Blue="44;97m"" | ||
139 | set "_White="40;37m"" | ||
140 | set "_Green="40;92m"" | ||
141 | set "_Yellow="40;93m"" | ||
142 | ) else ( | ||
143 | set "Red="Red" "white"" | ||
144 | set "Gray="Darkgray" "white"" | ||
145 | set "Green="DarkGreen" "white"" | ||
146 | set "Blue="Blue" "white"" | ||
147 | set "_White="Black" "Gray"" | ||
148 | set "_Green="Black" "Green"" | ||
149 | set "_Yellow="Black" "Yellow"" | ||
150 | ) | ||
151 | |||
152 | set "nceline=echo: &echo ==== ERROR ==== &echo:" | ||
153 | set "eline=echo: &call :dk_color %Red% "==== ERROR ====" &echo:" | ||
154 | if %~z0 GEQ 200000 ( | ||
155 | set "_exitmsg=Go back" | ||
156 | set "_fixmsg=Go back to Main Menu, select Troubleshoot and run Fix Licensing option." | ||
157 | ) else ( | ||
158 | set "_exitmsg=Exit" | ||
159 | set "_fixmsg=In MAS folder, run Troubleshoot script and select Fix Licensing option." | ||
160 | ) | ||
161 | |||
162 | ::======================================================================================================================================== | ||
163 | |||
164 | if %winbuild% LSS 9200 ( | ||
165 | %eline% | ||
166 | echo Unsupported OS version detected [%winbuild%]. | ||
167 | echo Ohook Activation is supported on Windows 8 and later and their server equivalent. | ||
168 | goto dk_done | ||
169 | ) | ||
170 | |||
171 | for %%# in (powershell.exe) do @if "%%~$PATH:#"=="" ( | ||
172 | %nceline% | ||
173 | echo Unable to find powershell.exe in the system. | ||
174 | goto dk_done | ||
175 | ) | ||
176 | |||
177 | ::======================================================================================================================================== | ||
178 | |||
179 | :: Fix for the special characters limitation in path name | ||
180 | |||
181 | set "_work=%~dp0" | ||
182 | if "%_work:~-1%"=="\" set "_work=%_work:~0,-1%" | ||
183 | |||
184 | set "_batf=%~f0" | ||
185 | set "_batp=%_batf:'=''%" | ||
186 | |||
187 | set _PSarg="""%~f0""" -el %_args% | ||
188 | |||
189 | set "_ttemp=%temp%" | ||
190 | |||
191 | setlocal EnableDelayedExpansion | ||
192 | |||
193 | ::======================================================================================================================================== | ||
194 | |||
195 | echo "!_batf!" | find /i "!_ttemp!" %nul1% && ( | ||
196 | if /i not "!_work!"=="!_ttemp!" ( | ||
197 | %eline% | ||
198 | echo Script is launched from the temp folder, | ||
199 | echo Most likely you are running the script directly from the archive file. | ||
200 | echo: | ||
201 | echo Extract the archive file and launch the script from the extracted folder. | ||
202 | goto dk_done | ||
203 | ) | ||
204 | ) | ||
205 | |||
206 | ::======================================================================================================================================== | ||
207 | |||
208 | :: Elevate script as admin and pass arguments and preventing loop | ||
209 | |||
210 | %nul1% fltmc || ( | ||
211 | if not defined _elev %psc% "start cmd.exe -arg '/c \"!_PSarg:'=''!\"' -verb runas" && exit /b | ||
212 | %eline% | ||
213 | echo This script require admin privileges. | ||
214 | echo To do so, right click on this script and select 'Run as administrator'. | ||
215 | goto 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 | |||
223 | if %_unattended%==1 set quedit=1 | ||
224 | for %%# in (%_args%) do (if /i "%%#"=="-qedit" set quedit=1) | ||
225 | |||
226 | reg query HKCU\Console /v QuickEdit %nul2% | find /i "0x0" %nul1% || if not defined quedit ( | ||
227 | reg add HKCU\Console /v QuickEdit /t REG_DWORD /d "0" /f %nul1% | ||
228 | start cmd.exe /c ""!_batf!" %_args% -qedit" | ||
229 | rem quickedit reset code is added at the starting of the script instead of here because it takes time to reflect in some cases | ||
230 | exit /b | ||
231 | ) | ||
232 | |||
233 | ::======================================================================================================================================== | ||
234 | |||
235 | if %_rem%==1 goto :oh_uninstall | ||
236 | |||
237 | :oh_menu | ||
238 | |||
239 | if %_unattended%==0 ( | ||
240 | cls | ||
241 | mode 76, 25 | ||
242 | title Ohook Activation | ||
243 | |||
244 | echo: | ||
245 | echo: | ||
246 | echo: | ||
247 | echo: | ||
248 | echo ____________________________________________________________ | ||
249 | echo: | ||
250 | echo [1] Install Ohook Office Activation | ||
251 | echo: | ||
252 | echo [2] Uninstall | ||
253 | echo ____________________________________________ | ||
254 | echo: | ||
255 | echo [3] Download Office | ||
256 | echo: | ||
257 | echo [0] %_exitmsg% | ||
258 | echo ____________________________________________________________ | ||
259 | echo: | ||
260 | call :dk_color2 %_White% " " %_Green% "Enter a menu option in the Keyboard [1,2,3,0]" | ||
261 | choice /C:1230 /N | ||
262 | set _el=!errorlevel! | ||
263 | if !_el!==4 exit /b | ||
264 | if !_el!==3 start https://%mas%/genuine-installation-media.html &goto :oh_menu | ||
265 | if !_el!==2 goto :oh_uninstall | ||
266 | if !_el!==1 goto :oh_menu2 | ||
267 | goto :oh_menu | ||
268 | ) | ||
269 | |||
270 | ::======================================================================================================================================== | ||
271 | |||
272 | :oh_menu2 | ||
273 | |||
274 | cls | ||
275 | mode 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 | |||
278 | title Ohook Activation | ||
279 | |||
280 | :: Check files | ||
281 | |||
282 | for %%# in (sppc32.dll sppc64.dll) do ( | ||
283 | if not exist "!_work!\BIN\%%#" ( | ||
284 | %eline% | ||
285 | echo '%%#' file is missing in 'BIN' folder. Aborting... | ||
286 | goto dk_done | ||
287 | ) | ||
288 | ) | ||
289 | |||
290 | echo: | ||
291 | echo Initializing... | ||
292 | call :dk_product | ||
293 | call :dk_ckeckwmic | ||
294 | |||
295 | :: Show info for potential script stuck scenario | ||
296 | |||
297 | sc start sppsvc %nul% | ||
298 | if %errorlevel% NEQ 1056 if %errorlevel% NEQ 0 ( | ||
299 | echo: | ||
300 | echo Error code: %errorlevel% | ||
301 | call :dk_color %Red% "Failed to start [sppsvc] service, rest of the process may take a long time..." | ||
302 | echo: | ||
303 | ) | ||
304 | |||
305 | ::======================================================================================================================================== | ||
306 | |||
307 | set error= | ||
308 | |||
309 | cls | ||
310 | echo: | ||
311 | for /f "skip=2 tokens=2*" %%a in ('reg query "HKLM\SYSTEM\CurrentControlSet\Control\Session Manager\Environment" /v PROCESSOR_ARCHITECTURE') do set osarch=%%b | ||
312 | for /f "tokens=6-7 delims=[]. " %%i in ('ver') do if "%%j"=="" (set fullbuild=%%i) else (set fullbuild=%%i.%%j) | ||
313 | echo Checking OS Info [%winos% ^| %fullbuild% ^| %osarch%] | ||
314 | |||
315 | ::======================================================================================================================================== | ||
316 | |||
317 | :: Check Windows Script Host | ||
318 | |||
319 | set _WSH=1 | ||
320 | reg query "HKCU\SOFTWARE\Microsoft\Windows Script Host\Settings" /v Enabled %nul2% | find /i "0x0" %nul1% && (set _WSH=0) | ||
321 | reg query "HKLM\SOFTWARE\Microsoft\Windows Script Host\Settings" /v Enabled %nul2% | find /i "0x0" %nul1% && (set _WSH=0) | ||
322 | |||
323 | if %_WSH% EQU 0 ( | ||
324 | reg add "HKLM\Software\Microsoft\Windows Script Host\Settings" /v Enabled /t REG_DWORD /d 1 /f %nul% | ||
325 | reg add "HKCU\Software\Microsoft\Windows Script Host\Settings" /v Enabled /t REG_DWORD /d 1 /f %nul% | ||
326 | if not "%arch%"=="x86" reg add "HKLM\Software\Microsoft\Windows Script Host\Settings" /v Enabled /t REG_DWORD /d 1 /f /reg:32 %nul% | ||
327 | echo Enabling Windows Script Host [Successful] | ||
328 | ) | ||
329 | |||
330 | ::======================================================================================================================================== | ||
331 | |||
332 | echo Initiating Diagnostic Tests... | ||
333 | |||
334 | set "_serv=sppsvc Winmgmt" | ||
335 | set officeact=1 | ||
336 | call :dk_errorcheck | ||
337 | |||
338 | :: Check unsupported office versions | ||
339 | |||
340 | set o14msi= | ||
341 | set o14c2r= | ||
342 | set o16uwp= | ||
343 | |||
344 | set _68=HKLM\SOFTWARE\Microsoft\Office | ||
345 | set _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 | |||
351 | if %winbuild% GEQ 10240 %psc% "Get-AppxPackage -name "Microsoft.Office.Desktop"" | find /i "Office" %nul1% && set o16uwp=Office UWP | ||
352 | |||
353 | if not "%o14msi%%o14c2r%%o16uwp%"=="" ( | ||
354 | echo: | ||
355 | set error=1 | ||
356 | call :dk_color %Red% "Checking Unsupported Office Install [ %o14msi%%o14c2r%%o16uwp%]" | ||
357 | ) | ||
358 | |||
359 | ::======================================================================================================================================== | ||
360 | |||
361 | :: Check supported office versions | ||
362 | |||
363 | call :oh_getpath | ||
364 | |||
365 | sc query ClickToRunSvc %nul% | ||
366 | set error1=%errorlevel% | ||
367 | |||
368 | if defined o16c2r if %error1% EQU 1060 ( | ||
369 | call :dk_color %Red% "Checking ClickToRun Service [Not found, Office 16.0 files found]" | ||
370 | set o16c2r= | ||
371 | set error=1 | ||
372 | ) | ||
373 | |||
374 | sc query OfficeSvc %nul% | ||
375 | set error2=%errorlevel% | ||
376 | |||
377 | if defined o15c2r if %error1% EQU 1060 if %error2% EQU 1060 ( | ||
378 | call :dk_color %Red% "Checking ClickToRun Service [Not found, Office 15.0 files found]" | ||
379 | set o15c2r= | ||
380 | set error=1 | ||
381 | ) | ||
382 | |||
383 | if "%o16c2r%%o15c2r%%o16msi%%o15msi%"=="" ( | ||
384 | set error=1 | ||
385 | echo: | ||
386 | if not "%o14msi%%o14c2r%%o16uwp%"=="" ( | ||
387 | call :dk_color %Red% "Checking Supported Office Install [Not Found]" | ||
388 | ) else ( | ||
389 | call :dk_color %Red% "Checking Installed Office [Not Found]" | ||
390 | ) | ||
391 | |||
392 | if %winbuild% GEQ 10240 %psc% "Get-AppxPackage -name "Microsoft.MicrosoftOfficeHub"" | find /i "Office" %nul1% && ( | ||
393 | echo: | ||
394 | echo You have only Office dashboard app installed, you need to install full Office version. | ||
395 | ) | ||
396 | echo: | ||
397 | call :dk_color %Blue% "Download and install Office from below URL and try again." | ||
398 | echo: | ||
399 | echo https://%mas%/genuine-installation-media.html | ||
400 | goto dk_done | ||
401 | ) | ||
402 | |||
403 | set multioffice= | ||
404 | if not "%o16c2r%%o15c2r%%o16msi%%o15msi%"=="1" set multioffice=1 | ||
405 | if not "%o14msi%%o14c2r%%o16uwp%"=="" set multioffice=1 | ||
406 | |||
407 | if defined multioffice ( | ||
408 | call :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 | |||
415 | if not defined o15c2r goto :starto16c2r | ||
416 | |||
417 | call :oh_reset | ||
418 | call :oh_actids | ||
419 | |||
420 | set oVer=15 | ||
421 | for /f "skip=2 tokens=2*" %%a in ('"reg query %o15c2r_reg% /v InstallPath" %nul6%') do (set "_oRoot=%%b\root") | ||
422 | for /f "skip=2 tokens=2*" %%a in ('"reg query %o15c2r_reg%\Configuration /v Platform" %nul6%') do (set "_oArch=%%b") | ||
423 | if not defined _oArch for /f "skip=2 tokens=2*" %%a in ('"reg query %o15c2r_reg%\propertyBag /v Platform" %nul6%') do (set "_oArch=%%b") | ||
424 | |||
425 | echo "%o15c2r_reg%" | find /i "Wow6432Node" %nul1% && (set _tok=10) || (set _tok=9) | ||
426 | for /f "tokens=%_tok% delims=\" %%a in ('reg query %o15c2r_reg%\ProductReleaseIDs\Active %nul6% ^| findstr /i "Retail Volume"') do ( | ||
427 | if not defined _oIds (set "_oIds=%%a") else (set "_oIds=!_oIds! %%a") | ||
428 | ) | ||
429 | |||
430 | set "_oLPath=%_oRoot%\Licenses" | ||
431 | |||
432 | if [%_oArch%]==[x64] (set "_hookPath=%_oRoot%\vfs\System" & set "_hook=sppc64.dll") | ||
433 | if [%_oArch%]==[x86] (set "_hookPath=%_oRoot%\vfs\SystemX86" & set "_hook=sppc32.dll") | ||
434 | if not [%osarch%]==[x86] ( | ||
435 | if [%_oArch%]==[x64] set "_sppcPath=%SystemRoot%\System32\sppc.dll" | ||
436 | if [%_oArch%]==[x86] set "_sppcPath=%SystemRoot%\SysWOW64\sppc.dll" | ||
437 | ) else ( | ||
438 | set "_sppcPath=%SystemRoot%\System32\sppc.dll" | ||
439 | ) | ||
440 | |||
441 | echo: | ||
442 | echo Activating Office 15.0 %_oArch% C2R... | ||
443 | |||
444 | if not defined _oIds ( | ||
445 | call :dk_color %Red% "Checking Installed Products [Product IDs not found. Aborting activation...]" | ||
446 | set error=1 | ||
447 | goto :starto16c2r | ||
448 | ) | ||
449 | |||
450 | call :oh_process | ||
451 | call :oh_hookinstall | ||
452 | |||
453 | ::======================================================================================================================================== | ||
454 | |||
455 | :starto16c2r | ||
456 | |||
457 | :: Process Office 16.0 C2R | ||
458 | |||
459 | if not defined o16c2r goto :startmsi | ||
460 | |||
461 | call :oh_reset | ||
462 | call :oh_actids | ||
463 | |||
464 | set oVer=16 | ||
465 | for /f "skip=2 tokens=2*" %%a in ('"reg query %o16c2r_reg% /v InstallPath" %nul6%') do (set "_oRoot=%%b\root") | ||
466 | for /f "skip=2 tokens=2*" %%a in ('"reg query %o16c2r_reg%\Configuration /v Platform" %nul6%') do (set "_oArch=%%b") | ||
467 | |||
468 | echo "%o16c2r_reg%" | find /i "Wow6432Node" %nul1% && (set _tok=9) || (set _tok=8) | ||
469 | for /f "tokens=%_tok% delims=\" %%a in ('reg query "%o16c2r_reg%\ProductReleaseIDs" /s /f ".16" /k %nul6% ^| findstr /i "Retail Volume"') do ( | ||
470 | if not defined _oIds (set "_oIds=%%a") else (set "_oIds=!_oIds! %%a") | ||
471 | ) | ||
472 | set _oIds=%_oIds:.16=% | ||
473 | |||
474 | set "_oLPath=%_oRoot%\Licenses16" | ||
475 | |||
476 | if [%_oArch%]==[x64] (set "_hookPath=%_oRoot%\vfs\System" & set "_hook=sppc64.dll") | ||
477 | if [%_oArch%]==[x86] (set "_hookPath=%_oRoot%\vfs\SystemX86" & set "_hook=sppc32.dll") | ||
478 | if not [%osarch%]==[x86] ( | ||
479 | if [%_oArch%]==[x64] set "_sppcPath=%SystemRoot%\System32\sppc.dll" | ||
480 | if [%_oArch%]==[x86] set "_sppcPath=%SystemRoot%\SysWOW64\sppc.dll" | ||
481 | ) else ( | ||
482 | set "_sppcPath=%SystemRoot%\System32\sppc.dll" | ||
483 | ) | ||
484 | |||
485 | echo: | ||
486 | echo Activating Office 16.0 %_oArch% C2R... | ||
487 | |||
488 | if not defined _oIds ( | ||
489 | call :dk_color %Red% "Checking Installed Products [Product IDs not found. Aborting activation...]" | ||
490 | set error=1 | ||
491 | goto :startmsi | ||
492 | ) | ||
493 | |||
494 | call :oh_process | ||
495 | call :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 | |||
501 | set sub_next= | ||
502 | set kNext=HKCU\SOFTWARE\Microsoft\Office\16.0\Common\Licensing | ||
503 | |||
504 | reg query %kNext%\LicensingNext /v MigrationToV5Done %nul2% | find /i "0x1" %nul% && ( | ||
505 | reg query %kNext%\LicensingNext %nul2% | findstr /i "volume retail" %nul2% | findstr /i "0x2 0x3" %nul% && ( | ||
506 | set sub_next=1 | ||
507 | reg delete %kNext% /f %nul% | ||
508 | ) | ||
509 | ) | ||
510 | |||
511 | if defined sub_next ( | ||
512 | reg query %kNext%\LicensingNext %nul% && ( | ||
513 | call :dk_color %Red% "Removing Office vNext Block [Failed]" | ||
514 | ) || ( | ||
515 | echo 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 | |||
524 | echo "%_lic%" | find /i "Subscription" %nul% && ( | ||
525 | echo Adding a Reg To Skip License Check [Successful] | ||
526 | reg 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 | |||
535 | echo "%_oIds%" | find /i "Volume" %nul1% && ( | ||
536 | if %winbuild% GEQ 9200 ( | ||
537 | if not [%osarch%]==[x86] ( | ||
538 | reg delete "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\SoftwareProtectionPlatform\0ff1ce15-a989-479d-af46-f275c6370663" /f /reg:32 %nul% | ||
539 | reg 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 | ) | ||
541 | reg delete "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\SoftwareProtectionPlatform\0ff1ce15-a989-479d-af46-f275c6370663" /f %nul% | ||
542 | reg 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% | ||
543 | echo Adding a Reg To Prevent Banner [Successful] | ||
544 | ) | ||
545 | ) | ||
546 | |||
547 | ::======================================================================================================================================== | ||
548 | |||
549 | :startmsi | ||
550 | |||
551 | if defined o15msi call :oh_processmsi 15 %o15msi_reg% | ||
552 | if defined o16msi call :oh_processmsi 16 %o16msi_reg% | ||
553 | |||
554 | ::======================================================================================================================================== | ||
555 | |||
556 | :: Uninstall other / grace Keys | ||
557 | |||
558 | set upk_result=0 | ||
559 | set allapplist= | ||
560 | |||
561 | if %_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%')" | ||
562 | if %_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 | |||
565 | for %%# in (%allapplist%) do ( | ||
566 | echo "%_allactid%" | find /i "%%#" %nul1% || ( | ||
567 | cscript //nologo %windir%\system32\slmgr.vbs /upk %%# %nul% && ( | ||
568 | set upk_result=1 | ||
569 | ) || ( | ||
570 | set error=1 | ||
571 | set upk_result=2 | ||
572 | ) | ||
573 | ) | ||
574 | ) | ||
575 | |||
576 | if not %upk_result%==0 echo: | ||
577 | if %upk_result%==1 echo Uninstalling Other/Grace Keys [Successful] | ||
578 | if %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 | |||
585 | if exist "%windir%\system32\spp\store_test\2.0\tokens.dat" ( | ||
586 | cscript //nologo %windir%\system32\slmgr.vbs /rilc %nul% | ||
587 | if !errorlevel! NEQ 0 cscript //nologo %windir%\system32\slmgr.vbs /rilc %nul% | ||
588 | ) | ||
589 | |||
590 | ::======================================================================================================================================== | ||
591 | |||
592 | echo: | ||
593 | if not defined error ( | ||
594 | call :dk_color %Green% "Office is permanently activated." | ||
595 | echo Help: https://%mas%/troubleshoot | ||
596 | ) else ( | ||
597 | call :dk_color %Red% "Some errors were detected." | ||
598 | if not defined ierror if not defined showfix if not defined serv_cor if not defined serv_cste call :dk_color %Blue% "%_fixmsg%" | ||
599 | echo: | ||
600 | call :dk_color2 %Blue% "Check this page for help" %_Yellow% " https://%mas%/troubleshoot" | ||
601 | ) | ||
602 | |||
603 | goto :dk_done | ||
604 | |||
605 | ::======================================================================================================================================== | ||
606 | |||
607 | :oh_uninstall | ||
608 | |||
609 | cls | ||
610 | mode 99, 28 | ||
611 | title Uninstall Ohook Activation | ||
612 | |||
613 | set _present= | ||
614 | set _unerror= | ||
615 | call :oh_reset | ||
616 | call :oh_getpath | ||
617 | |||
618 | echo: | ||
619 | echo Uninstalling Ohook Activation... | ||
620 | echo: | ||
621 | |||
622 | if defined o16c2r_reg (for /f "skip=2 tokens=2*" %%a in ('"reg query %o16c2r_reg% /v InstallPath" %nul6%') do (set "_16CHook=%%b\root\vfs")) | ||
623 | if defined o15c2r_reg (for /f "skip=2 tokens=2*" %%a in ('"reg query %o15c2r_reg% /v InstallPath" %nul6%') do (set "_15CHook=%%b\root\vfs")) | ||
624 | if defined o16msi_reg (for /f "skip=2 tokens=2*" %%a in ('"reg query %o16msi_reg%\Common\InstallRoot /v Path" %nul6%') do (set "_16MHook=%%b")) | ||
625 | if defined o15msi_reg (for /f "skip=2 tokens=2*" %%a in ('"reg query %o15msi_reg%\Common\InstallRoot /v Path" %nul6%') do (set "_15MHook=%%b")) | ||
626 | |||
627 | if defined _16CHook (if exist "%_16CHook%\System\sppc*dll" (set _present=1& del /s /f /q "%_16CHook%\System\sppc*dll" & if exist "%_16CHook%\System\sppc*dll" set _unerror=1)) | ||
628 | if defined _16CHook (if exist "%_16CHook%\SystemX86\sppc*dll" (set _present=1& del /s /f /q "%_16CHook%\SystemX86\sppc*dll" & if exist "%_16CHook%\SystemX86\sppc*dll" set _unerror=1)) | ||
629 | if 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)) | ||
630 | if defined _15CHook (if exist "%_15CHook%\SystemX86\sppc*dll" (set _present=1& del /s /f /q "%_15CHook%\SystemX86\sppc*dll" & if exist "%_15CHook%\SystemX86\sppc*dll" set _unerror=1)) | ||
631 | if defined _16MHook (if exist "%_16MHook%sppc*dll" (set _present=1& del /s /f /q "%_16MHook%sppc*dll" & if exist "%_16MHook%sppc*dll" set _unerror=1)) | ||
632 | if defined _15MHook (if exist "%_15MHook%sppc*dll" (set _present=1& del /s /f /q "%_15MHook%sppc*dll" & if exist "%_15MHook%sppc*dll" set _unerror=1)) | ||
633 | |||
634 | for %%# in (15 16) do ( | ||
635 | for %%A in ("%ProgramFiles%" "%ProgramW6432%" "%ProgramFiles(x86)%") do ( | ||
636 | if exist "%%~A\Microsoft Office\Office%%#\sppc*dll" (set _present=1& del /s /f /q "%%~A\Microsoft Office\Office%%#\sppc*dll" & if exist "%%~A\Microsoft Office\Office%%#\sppc*dll" set _unerror=1) | ||
637 | ) | ||
638 | ) | ||
639 | |||
640 | for %%# in (System SystemX86) do ( | ||
641 | for %%G in ("Office 15" "Office") do ( | ||
642 | for %%A in ("%ProgramFiles%" "%ProgramW6432%" "%ProgramFiles(x86)%") do ( | ||
643 | if 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 | |||
648 | reg query HKCU\Software\Microsoft\Office\16.0\Common\Licensing\Resiliency /s %nul2% | find /i "2033" %nul% && ( | ||
649 | echo: | ||
650 | echo Deleting - HKCU\Software\Microsoft\Office\16.0\Common\Licensing\Resiliency | ||
651 | reg delete HKCU\Software\Microsoft\Office\16.0\Common\Licensing\Resiliency /f | ||
652 | ) | ||
653 | |||
654 | reg query "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\SoftwareProtectionPlatform\0ff1ce15-a989-479d-af46-f275c6370663" %nul% && ( | ||
655 | echo: | ||
656 | echo Deleting - Registry key to prevent non-genuine banner | ||
657 | reg delete "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\SoftwareProtectionPlatform\0ff1ce15-a989-479d-af46-f275c6370663" /f | ||
658 | ) | ||
659 | |||
660 | reg query "HKLM\SOFTWARE\Wow6432Node\Microsoft\Windows NT\CurrentVersion\SoftwareProtectionPlatform\0ff1ce15-a989-479d-af46-f275c6370663" %nul% && ( | ||
661 | reg delete "HKLM\SOFTWARE\Wow6432Node\Microsoft\Windows NT\CurrentVersion\SoftwareProtectionPlatform\0ff1ce15-a989-479d-af46-f275c6370663" /f | ||
662 | ) | ||
663 | |||
664 | echo __________________________________________________________________________________________ | ||
665 | echo: | ||
666 | |||
667 | if not defined _present ( | ||
668 | echo Ohook Activation is not installed. | ||
669 | ) else ( | ||
670 | if defined _unerror ( | ||
671 | call :dk_color %Red% "Failed to uninstall Ohook activation." | ||
672 | call :dk_color %Blue% "Close Office apps if they are running and try again." | ||
673 | ) else ( | ||
674 | call :dk_color %Green% "Successfully uninstalled Ohook activation." | ||
675 | ) | ||
676 | ) | ||
677 | echo __________________________________________________________________________________________ | ||
678 | |||
679 | goto :dk_done | ||
680 | |||
681 | ::======================================================================================================================================== | ||
682 | |||
683 | :oh_reset | ||
684 | |||
685 | set _oRoot= | ||
686 | set _oArch= | ||
687 | set _oIds= | ||
688 | set _oLPath= | ||
689 | set _hookPath= | ||
690 | set _hook= | ||
691 | set _sppcPath= | ||
692 | set _key= | ||
693 | set _actid= | ||
694 | set _prod= | ||
695 | set _lic= | ||
696 | set _License= | ||
697 | exit /b | ||
698 | |||
699 | ::======================================================================================================================================== | ||
700 | |||
701 | :oh_getpath | ||
702 | |||
703 | set o16c2r= | ||
704 | set o15c2r= | ||
705 | set o16msi= | ||
706 | set o15msi= | ||
707 | |||
708 | set _68=HKLM\SOFTWARE\Microsoft\Office | ||
709 | set _86=HKLM\SOFTWARE\Wow6432Node\Microsoft\Office | ||
710 | |||
711 | for /f "skip=2 tokens=2*" %%a in ('"reg query %_86%\ClickToRun /v InstallPath" %nul6%') do if exist "%%b\root\Licenses16\ProPlus*.xrm-ms" (set o16c2r=1&set o16c2r_reg=%_86%\ClickToRun) | ||
712 | for /f "skip=2 tokens=2*" %%a in ('"reg query %_68%\ClickToRun /v InstallPath" %nul6%') do if exist "%%b\root\Licenses16\ProPlus*.xrm-ms" (set o16c2r=1&set o16c2r_reg=%_68%\ClickToRun) | ||
713 | for /f "skip=2 tokens=2*" %%a in ('"reg query %_86%\15.0\ClickToRun /v InstallPath" %nul6%') do if exist "%%b\root\Licenses\ProPlus*.xrm-ms" (set o15c2r=1&set o15c2r_reg=%_86%\15.0\ClickToRun) | ||
714 | for /f "skip=2 tokens=2*" %%a in ('"reg query %_68%\15.0\ClickToRun /v InstallPath" %nul6%') do if exist "%%b\root\Licenses\ProPlus*.xrm-ms" (set o15c2r=1&set o15c2r_reg=%_68%\15.0\ClickToRun) | ||
715 | |||
716 | for /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) | ||
717 | for /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) | ||
718 | for /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) | ||
719 | for /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 | |||
721 | exit /b | ||
722 | |||
723 | ::======================================================================================================================================== | ||
724 | |||
725 | :oh_installkey | ||
726 | |||
727 | if %_wmic% EQU 1 wmic path SoftwareLicensingService where __CLASS='SoftwareLicensingService' call InstallProductKey ProductKey="%_key%" %nul% | ||
728 | if %_wmic% EQU 0 %psc% "(([WMISEARCHER]'SELECT Version FROM SoftwareLicensingService').Get()).InstallProductKey('%_key%')" %nul% | ||
729 | if not %errorlevel%==0 cscript //nologo %windir%\system32\slmgr.vbs /ipk %_key% %nul% | ||
730 | set errorcode=%errorlevel% | ||
731 | cmd /c exit /b %errorcode% | ||
732 | if %errorcode% NEQ 0 set "errorcode=[0x%=ExitCode%]" | ||
733 | |||
734 | if %errorcode% EQU 0 ( | ||
735 | call :dk_refresh | ||
736 | echo Installing Generic Product Key [%_key%] [%_prod%] [%_lic%] [Successful] | ||
737 | ) else ( | ||
738 | call :dk_color %Red% "Installing Generic Product Key [%_key%] [%_prod%] [%_lic%] [Failed] %errorcode%" | ||
739 | if not defined error ( | ||
740 | call :dk_color %Blue% "%_fixmsg%" | ||
741 | set showfix=1 | ||
742 | ) | ||
743 | set error=1 | ||
744 | ) | ||
745 | |||
746 | exit /b | ||
747 | |||
748 | ::======================================================================================================================================== | ||
749 | |||
750 | :oh_installlic | ||
751 | |||
752 | if not defined _oLPath exit /b | ||
753 | |||
754 | set _License=%_prod:Retail=R_% | ||
755 | set _License=%_License:Volume=VL_% | ||
756 | |||
757 | for %%# in ("!_oLPath!\client-issuance-*.xrm-ms") do ( | ||
758 | cscript //nologo %windir%\system32\slmgr.vbs /ilc "!_oLPath!\%%~nx#" %nul% | ||
759 | ) | ||
760 | cscript //nologo %windir%\system32\slmgr.vbs /ilc "!_oLPath!\pkeyconfig-office.xrm-ms" %nul% | ||
761 | |||
762 | for %%# in ("!_oLPath!\%_License%*.xrm-ms") do ( | ||
763 | cscript //nologo %windir%\system32\slmgr.vbs /ilc "!_oLPath!\%%~nx#" %nul% | ||
764 | ) | ||
765 | |||
766 | call :oh_actids | ||
767 | |||
768 | echo "!oapplist!" | find /i "!_actid!" %nul1% && ( | ||
769 | call :dk_color %Gray% "Installing Missing License Files [Office %oVer%.0 %_prod%] [Successful]" | ||
770 | ) || ( | ||
771 | set error=1 | ||
772 | call :dk_color %Red% "Installing Missing License Files [Office %oVer%.0 %_prod%] [Failed]" | ||
773 | ) | ||
774 | |||
775 | exit /b | ||
776 | |||
777 | ::======================================================================================================================================== | ||
778 | |||
779 | :oh_hookinstall | ||
780 | |||
781 | set ierror= | ||
782 | set hasherror= | ||
783 | |||
784 | del /s /q "%_hookPath%\sppcs.dll" %nul% | ||
785 | del /s /q "%_hookPath%\sppc.dll" %nul% | ||
786 | |||
787 | if exist "%_hookPath%\sppcs.dll" set ierror=1 | ||
788 | if exist "%_hookPath%\sppc.dll" set ierror=1 | ||
789 | |||
790 | mklink "%_hookPath%\sppcs.dll" "%_sppcPath%" %nul% | ||
791 | if not %errorlevel%==0 set ierror=1 | ||
792 | |||
793 | pushd "!_work!\BIN\" | ||
794 | copy /y %_hook% "%_hookPath%\sppc.dll" %nul% | ||
795 | popd | ||
796 | if not exist "%_hookPath%\sppc.dll" set ierror=1 | ||
797 | |||
798 | echo: | ||
799 | if not defined ierror ( | ||
800 | echo Symlinking System's sppc.dll To ["%_hookPath%\sppcs.dll"] [Successful] | ||
801 | echo Copying Custom %_hook% To ["%_hookPath%\sppc.dll"] [Successful] | ||
802 | ) else ( | ||
803 | set error=1 | ||
804 | call :dk_color %Red% "Symlinking Systems sppc.dll [Failed]" | ||
805 | call :dk_color %Red% "Copying Custom %_hook% [Failed]" | ||
806 | echo ["%_hookPath%\sppc.dll"] | ||
807 | call :dk_color %Blue% "Close Office apps if they are running and try again." | ||
808 | ) | ||
809 | |||
810 | if not defined ierror call :oh_modify "%_hookPath%\sppc.dll" | ||
811 | |||
812 | if not defined ierror ( | ||
813 | if defined hasherror ( | ||
814 | set error=1 | ||
815 | set ierror=1 | ||
816 | call :dk_color %Red% "Modifying Hash of Custom %_hook% [Failed]" | ||
817 | ) else ( | ||
818 | echo Modifying Hash of Custom %_hook% [Successful] | ||
819 | ) | ||
820 | ) | ||
821 | |||
822 | exit /b | ||
823 | |||
824 | ::======================================================================================================================================== | ||
825 | |||
826 | :oh_process | ||
827 | |||
828 | for %%# in (%_oIds%) do ( | ||
829 | set _key= | ||
830 | set _actid= | ||
831 | set _lic= | ||
832 | set _prod=%%# | ||
833 | |||
834 | call :ohookdata getinfo %%# | ||
835 | |||
836 | if not [!_key!]==[] ( | ||
837 | echo "!oapplist!" | find /i "!_actid!" %nul1% || call :oh_installlic | ||
838 | call :oh_installkey | ||
839 | ) else ( | ||
840 | set error=1 | ||
841 | call :dk_color %Red% "Checking Product In Script [Office %oVer%.0 %%# not found in script]" | ||
842 | echo Make sure you are using Latest MAS script. | ||
843 | ) | ||
844 | ) | ||
845 | |||
846 | exit /b | ||
847 | |||
848 | ::======================================================================================================================================== | ||
849 | |||
850 | :oh_msiproducts | ||
851 | |||
852 | set msitemp=%SystemRoot%\Temp\_msitemp.txt | ||
853 | |||
854 | if %oVer%==15 set _psmsikey=%o15msi_reg:HKLM\=HKLM:% | ||
855 | if %oVer%==16 set _psmsikey=%o16msi_reg:HKLM\=HKLM:% | ||
856 | |||
857 | if 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 | |||
860 | if exist %msitemp% call :ohookdata getmsiprod | ||
861 | if exist %msitemp% del /f /q %msitemp% | ||
862 | |||
863 | exit /b | ||
864 | |||
865 | ::======================================================================================================================================== | ||
866 | |||
867 | :oh_processmsi | ||
868 | |||
869 | :: Process Office MSI Version | ||
870 | |||
871 | call :oh_reset | ||
872 | call :oh_actids | ||
873 | |||
874 | set oVer=%1 | ||
875 | for /f "skip=2 tokens=2*" %%a in ('"reg query %2\Common\InstallRoot /v Path" %nul6%') do (set "_oRoot=%%b") | ||
876 | if "%_oRoot:~-1%"=="\" set "_oRoot=%_oRoot:~0,-1%" | ||
877 | |||
878 | echo "%2" | find /i "Wow6432Node" %nul1% && set _oArch=x86 | ||
879 | if not [%osarch%]==[x86] if not defined _oArch set _oArch=x64 | ||
880 | if [%osarch%]==[x86] set _oArch=x86 | ||
881 | |||
882 | if [%_oArch%]==[x64] (set "_hookPath=%_oRoot%" & set "_hook=sppc64.dll") | ||
883 | if [%_oArch%]==[x86] (set "_hookPath=%_oRoot%" & set "_hook=sppc32.dll") | ||
884 | if not [%osarch%]==[x86] ( | ||
885 | if [%_oArch%]==[x64] set "_sppcPath=%SystemRoot%\System32\sppc.dll" | ||
886 | if [%_oArch%]==[x86] set "_sppcPath=%SystemRoot%\SysWOW64\sppc.dll" | ||
887 | ) else ( | ||
888 | set "_sppcPath=%SystemRoot%\System32\sppc.dll" | ||
889 | ) | ||
890 | |||
891 | call :oh_msiproducts | ||
892 | |||
893 | echo: | ||
894 | echo Activating Office %1.0 %_oArch% MSI... | ||
895 | |||
896 | if not defined _oIds ( | ||
897 | set error=1 | ||
898 | call :dk_color %Red% "Checking Installed Products [Product IDs not found. Aborting activation...]" | ||
899 | exit /b | ||
900 | ) | ||
901 | |||
902 | call :oh_process | ||
903 | call :oh_hookinstall | ||
904 | |||
905 | exit /b | ||
906 | |||
907 | ::======================================================================================================================================== | ||
908 | |||
909 | :: Refresh license status | ||
910 | |||
911 | :dk_refresh | ||
912 | |||
913 | if %_wmic% EQU 1 wmic path SoftwareLicensingService where __CLASS='SoftwareLicensingService' call RefreshLicenseStatus %nul% | ||
914 | if %_wmic% EQU 0 %psc% "$null=(([WMICLASS]'SoftwareLicensingService').GetInstances()).RefreshLicenseStatus()" %nul% | ||
915 | exit /b | ||
916 | |||
917 | :: Get Windows Activation IDs | ||
918 | |||
919 | :dk_actids | ||
920 | |||
921 | set applist= | ||
922 | if %_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%')" | ||
923 | if %_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")) | ||
925 | exit /b | ||
926 | |||
927 | :: Get Office Activation IDs | ||
928 | |||
929 | :oh_actids | ||
930 | |||
931 | set oapplist= | ||
932 | if %_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%')" | ||
933 | if %_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")) | ||
935 | exit /b | ||
936 | |||
937 | :: Check wmic.exe | ||
938 | |||
939 | :dk_ckeckwmic | ||
940 | |||
941 | set _wmic=0 | ||
942 | for %%# in (wmic.exe) do @if not "%%~$PATH:#"=="" ( | ||
943 | wmic path Win32_ComputerSystem get CreationClassName /value %nul2% | find /i "computersystem" %nul1% && set _wmic=1 | ||
944 | ) | ||
945 | exit /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 | |||
951 | call :dk_reflection | ||
952 | |||
953 | set d1=%ref% $meth = $TypeBuilder.DefinePInvokeMethod('BrandingFormatString', 'winbrand.dll', 'Public, Static', 1, [String], @([String]), 1, 3); | ||
954 | set d1=%d1% $meth.SetImplementationFlags(128); $TypeBuilder.CreateType()::BrandingFormatString('%%WINDOWS_LONG%%') | ||
955 | |||
956 | set winos= | ||
957 | for /f "delims=" %%s in ('"%psc% %d1%"') do if not errorlevel 1 (set winos=%%s) | ||
958 | echo "%winos%" | find /i "Windows" %nul1% || ( | ||
959 | for /f "skip=2 tokens=2*" %%a in ('reg query "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion" /v ProductName %nul6%') do set "winos=%%b" | ||
960 | if %winbuild% GEQ 22000 ( | ||
961 | set winos=!winos:Windows 10=Windows 11! | ||
962 | ) | ||
963 | ) | ||
964 | exit /b | ||
965 | |||
966 | :: Common lines used in PowerShell reflection code | ||
967 | |||
968 | :dk_reflection | ||
969 | |||
970 | set ref=$AssemblyBuilder = [AppDomain]::CurrentDomain.DefineDynamicAssembly(4, 1); | ||
971 | set ref=%ref% $ModuleBuilder = $AssemblyBuilder.DefineDynamicModule(2, $False); | ||
972 | set ref=%ref% $TypeBuilder = $ModuleBuilder.DefineType(0); | ||
973 | exit /b | ||
974 | |||
975 | ::======================================================================================================================================== | ||
976 | |||
977 | :dk_errorcheck | ||
978 | |||
979 | set showfix= | ||
980 | |||
981 | :: Check corrupt services | ||
982 | |||
983 | set serv_cor= | ||
984 | for %%# in (%_serv%) do ( | ||
985 | set _corrupt= | ||
986 | sc start %%# %nul% | ||
987 | if !errorlevel! EQU 1060 set _corrupt=1 | ||
988 | sc query %%# %nul% || set _corrupt=1 | ||
989 | for %%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) | ||
990 | if defined _corrupt (if defined serv_cor (set "serv_cor=!serv_cor! %%#") else (set "serv_cor=%%#")) | ||
991 | ) | ||
992 | |||
993 | if defined serv_cor ( | ||
994 | set error=1 | ||
995 | call :dk_color %Red% "Checking Corrupt Services [%serv_cor%]" | ||
996 | ) | ||
997 | |||
998 | ::======================================================================================================================================== | ||
999 | |||
1000 | :: Check disabled services | ||
1001 | |||
1002 | set serv_ste= | ||
1003 | for %%# in (%_serv%) do ( | ||
1004 | sc start %%# %nul% | ||
1005 | if !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 | |||
1010 | set serv_csts= | ||
1011 | set serv_cste= | ||
1012 | |||
1013 | if defined serv_ste ( | ||
1014 | for %%# in (%serv_ste%) do ( | ||
1015 | if /i %%#==ClipSVC (reg add "HKLM\SYSTEM\CurrentControlSet\Services\%%#" /v "Start" /t REG_DWORD /d "3" /f %nul% & sc config %%# start= demand %nul%) | ||
1016 | if /i %%#==wlidsvc sc config %%# start= demand %nul% | ||
1017 | if /i %%#==sppsvc (reg add "HKLM\SYSTEM\CurrentControlSet\Services\%%#" /v "Start" /t REG_DWORD /d "2" /f %nul% & sc config %%# start= delayed-auto %nul%) | ||
1018 | if /i %%#==KeyIso sc config %%# start= demand %nul% | ||
1019 | if /i %%#==LicenseManager sc config %%# start= demand %nul% | ||
1020 | if /i %%#==Winmgmt sc config %%# start= auto %nul% | ||
1021 | if /i %%#==wuauserv sc config %%# start= demand %nul% | ||
1022 | if !errorlevel!==0 ( | ||
1023 | if defined serv_csts (set "serv_csts=!serv_csts! %%#") else (set "serv_csts=%%#") | ||
1024 | ) else ( | ||
1025 | if defined serv_cste (set "serv_cste=!serv_cste! %%#") else (set "serv_cste=%%#") | ||
1026 | ) | ||
1027 | ) | ||
1028 | ) | ||
1029 | |||
1030 | if defined serv_csts call :dk_color %Gray% "Enabling Disabled Services [Successful] [%serv_csts%]" | ||
1031 | |||
1032 | if defined serv_cste ( | ||
1033 | set error=1 | ||
1034 | call :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 | |||
1042 | set serv_e= | ||
1043 | for %%# in (%_serv%) do ( | ||
1044 | set errorcode= | ||
1045 | set checkerror= | ||
1046 | net start %%# /y %nul% | ||
1047 | set errorcode=!errorlevel! | ||
1048 | sc query %%# | find /i "RUNNING" %nul% || set checkerror=1 | ||
1049 | |||
1050 | sc start %%# %nul% | ||
1051 | if !errorlevel! NEQ 1056 if !errorlevel! NEQ 0 (set errorcode=!errorlevel!&set checkerror=1) | ||
1052 | if defined checkerror if defined serv_e (set "serv_e=!serv_e!, %%#-!errorcode!") else (set "serv_e=%%#-!errorcode!") | ||
1053 | ) | ||
1054 | |||
1055 | if defined serv_e ( | ||
1056 | set error=1 | ||
1057 | call :dk_color %Red% "Starting Services [Failed] [%serv_e%]" | ||
1058 | echo %serv_e% | findstr /i "ClipSVC-1058 sppsvc-1058" %nul% && ( | ||
1059 | call :dk_color %Blue% "Restart the system to fix disabled service error 1058." | ||
1060 | set showfix=1 | ||
1061 | ) | ||
1062 | ) | ||
1063 | |||
1064 | ::======================================================================================================================================== | ||
1065 | |||
1066 | :: Various error checks | ||
1067 | |||
1068 | if defined safeboot_option ( | ||
1069 | set error=1 | ||
1070 | set showfix=1 | ||
1071 | call :dk_color2 %Red% "Checking Boot Mode " %Blue% "[System is running in safe mode. Run in normal mode.]" | ||
1072 | ) | ||
1073 | |||
1074 | |||
1075 | reg query "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Setup\State" %nul2% | find /i "IMAGE_STATE_COMPLETE" %nul1% || ( | ||
1076 | set error=1 | ||
1077 | set showfix=1 | ||
1078 | call :dk_color2 %Red% "Checking Audit Mode " %Blue% "[IMAGE_STATE_COMPLETE status not found. Run in normal mode.]" | ||
1079 | ) | ||
1080 | |||
1081 | |||
1082 | reg query "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\WinPE" /v InstRoot %nul% && ( | ||
1083 | set error=1 | ||
1084 | set showfix=1 | ||
1085 | call :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% || ( | ||
1090 | set error=1 | ||
1091 | call :dk_color %Red% "Checking Powershell [Not Responding]" | ||
1092 | ) | ||
1093 | |||
1094 | |||
1095 | DISM /English /Online /Get-CurrentEdition %nul% | ||
1096 | set dism_error=%errorlevel% | ||
1097 | cmd /c exit /b %dism_error% | ||
1098 | if %dism_error% NEQ 0 set "dism_error=[0x%=ExitCode%]" | ||
1099 | if %dism_error% NEQ 0 ( | ||
1100 | call :dk_color %Red% "Checking DISM [Not Responding] %dism_error%" | ||
1101 | ) | ||
1102 | |||
1103 | |||
1104 | cscript //nologo %windir%\system32\slmgr.vbs /dlv %nul% | ||
1105 | set error_code=%errorlevel% | ||
1106 | cmd /c exit /b %error_code% | ||
1107 | if %error_code% NEQ 0 set "error_code=0x%=ExitCode%" | ||
1108 | if %error_code% NEQ 0 ( | ||
1109 | set error=1 | ||
1110 | call :dk_color %Red% "Checking slmgr /dlv [Not Responding] %error_code%" | ||
1111 | ) | ||
1112 | |||
1113 | |||
1114 | for %%# in (wmic.exe) do @if "%%~$PATH:#"=="" ( | ||
1115 | call :dk_color %Gray% "Checking WMIC.exe [Not Found]" | ||
1116 | ) | ||
1117 | |||
1118 | |||
1119 | set wmifailed= | ||
1120 | if %_wmic% EQU 1 wmic path Win32_ComputerSystem get CreationClassName /value %nul2% | find /i "computersystem" %nul1% | ||
1121 | if %_wmic% EQU 0 %psc% "Get-CIMInstance -Class Win32_ComputerSystem | Select-Object -Property CreationClassName" %nul2% | find /i "computersystem" %nul1% | ||
1122 | |||
1123 | if %errorlevel% NEQ 0 set wmifailed=1 | ||
1124 | echo "%error_code%" | findstr /i "0x800410 0x800440" %nul1% && set wmifailed=1& :: https://learn.microsoft.com/en-us/windows/win32/wmisdk/wmi-error-constants | ||
1125 | if defined wmifailed ( | ||
1126 | set error=1 | ||
1127 | call :dk_color %Red% "Checking WMI [Not Responding]" | ||
1128 | call :dk_color %Blue% "In MAS, Goto Troubleshoot and run Fix WMI option." | ||
1129 | set showfix=1 | ||
1130 | ) | ||
1131 | |||
1132 | |||
1133 | reg query "HKU\S-1-5-20\Software\Microsoft\Windows NT\CurrentVersion\SoftwareProtectionPlatform\PersistedTSReArmed" %nul% && ( | ||
1134 | set error=1 | ||
1135 | set showfix=1 | ||
1136 | call :dk_color2 %Red% "Checking Rearm " %Blue% "[System Restart Is Required]" | ||
1137 | ) | ||
1138 | |||
1139 | |||
1140 | reg query "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\ClipSVC\Volatile\PersistedSystemState" %nul% && ( | ||
1141 | set error=1 | ||
1142 | set showfix=1 | ||
1143 | call :dk_color2 %Red% "Checking ClipSVC " %Blue% "[System Restart Is Required]" | ||
1144 | ) | ||
1145 | |||
1146 | |||
1147 | for /f "skip=2 tokens=2*" %%a in ('reg query "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\SoftwareProtectionPlatform" /v "SkipRearm" %nul6%') do if /i %%b NEQ 0x0 ( | ||
1148 | reg add "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\SoftwareProtectionPlatform" /v "SkipRearm" /t REG_DWORD /d "0" /f %nul% | ||
1149 | call :dk_color %Red% "Checking SkipRearm [Default 0 Value Not Found. Changing To 0]" | ||
1150 | net stop sppsvc /y %nul% | ||
1151 | net start sppsvc /y %nul% | ||
1152 | set error=1 | ||
1153 | ) | ||
1154 | |||
1155 | |||
1156 | reg query "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\SoftwareProtectionPlatform\Plugins\Objects\msft:rm/algorithm/hwid/4.0" /f ba02fed39662 /d %nul% || ( | ||
1157 | call :dk_color %Red% "Checking SPP Registry Key [Incorrect ModuleId Found]" | ||
1158 | call :dk_color %Blue% "Possibly Caused By Gaming Spoofers. Help: https://%mas%/troubleshoot" | ||
1159 | set error=1 | ||
1160 | set showfix=1 | ||
1161 | ) | ||
1162 | |||
1163 | |||
1164 | set tokenstore= | ||
1165 | for /f "skip=2 tokens=2*" %%a in ('reg query "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\SoftwareProtectionPlatform" /v TokenStore %nul6%') do call set "tokenstore=%%b" | ||
1166 | if not exist "%tokenstore%\" ( | ||
1167 | set error=1 | ||
1168 | REM This code creates token folder only if it's missing and sets default permission for it | ||
1169 | mkdir "%tokenstore%" %nul% | ||
1170 | set "d=$sddl = 'O:BAG:BAD:PAI(A;OICI;FA;;;SY)(A;OICI;FA;;;BA)(A;OICIIO;GR;;;BU)(A;;FR;;;BU)(A;OICI;FA;;;S-1-5-80-123231216-2592883651-3715271367-3753151631-4175906628)';" | ||
1171 | set "d=!d! $AclObject = New-Object System.Security.AccessControl.DirectorySecurity;" | ||
1172 | set "d=!d! $AclObject.SetSecurityDescriptorSddlForm($sddl);" | ||
1173 | set "d=!d! Set-Acl -Path %tokenstore% -AclObject $AclObject;" | ||
1174 | %psc% "!d!" %nul% | ||
1175 | call :dk_color %Gray% "Checking SPP Token Folder [Not Found. Creating Now] [%tokenstore%\]" | ||
1176 | ) | ||
1177 | |||
1178 | |||
1179 | call :dk_actids | ||
1180 | if not defined applist ( | ||
1181 | net stop sppsvc /y %nul% | ||
1182 | cscript //nologo %windir%\system32\slmgr.vbs /rilc %nul% | ||
1183 | if !errorlevel! NEQ 0 cscript //nologo %windir%\system32\slmgr.vbs /rilc %nul% | ||
1184 | call :dk_refresh | ||
1185 | call :dk_actids | ||
1186 | if not defined applist ( | ||
1187 | set error=1 | ||
1188 | call :dk_color %Red% "Checking Activation IDs [Not Found]" | ||
1189 | ) | ||
1190 | ) | ||
1191 | |||
1192 | |||
1193 | if exist "%tokenstore%\" if not exist "%tokenstore%\tokens.dat" ( | ||
1194 | set error=1 | ||
1195 | call :dk_color %Red% "Checking SPP tokens.dat [Not Found] [%tokenstore%\]" | ||
1196 | ) | ||
1197 | |||
1198 | |||
1199 | if not exist %SystemRoot%\system32\sppsvc.exe ( | ||
1200 | set error=1 | ||
1201 | set showfix=1 | ||
1202 | call :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 | |||
1208 | set wpaerror= | ||
1209 | set permerror= | ||
1210 | if not defined serv_cor if not defined serv_cste if defined error if /i not %error_code%==0 if not defined showfix ( | ||
1211 | |||
1212 | REM This code checks for invalid registry keys in HKLM\SYSTEM\WPA. This issue may appear even on healthy systems. | ||
1213 | |||
1214 | if %winbuild% GEQ 14393 ( | ||
1215 | set /a count=0 | ||
1216 | for /f %%a in ('reg query "HKLM\SYSTEM\WPA" %nul6%') do set /a count+=1 | ||
1217 | for /L %%# in (1,1,!count!) do ( | ||
1218 | reg query "HKLM\SYSTEM\WPA\8DEC0AF1-0341-4b93-85CD-72606C2DF94C-7P-%%#" /ve /t REG_BINARY %nul% || set wpaerror=1 | ||
1219 | ) | ||
1220 | if defined wpaerror call :dk_color %Red% "Checking WPA Registry Keys [Error Found] [Registry Count - !count!]" | ||
1221 | ) | ||
1222 | |||
1223 | REM 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 | |||
1225 | if not exist "%tokenstore%\" set permerror=1 | ||
1226 | |||
1227 | for %%# 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% | ||
1233 | if !errorlevel!==2 set permerror=1 | ||
1234 | ) | ||
1235 | if defined permerror call :dk_color %Red% "Checking SPP Permissions [Error Found]" | ||
1236 | |||
1237 | set showfix=1 | ||
1238 | call :dk_color %Blue% "%_fixmsg%" | ||
1239 | if not defined permerror call :dk_color %Blue% "If activation still fails then run Fix WPA Registry option." | ||
1240 | ) | ||
1241 | |||
1242 | exit /b | ||
1243 | |||
1244 | ::======================================================================================================================================== | ||
1245 | |||
1246 | :dk_color | ||
1247 | |||
1248 | if %_NCS% EQU 1 ( | ||
1249 | echo %esc%[%~1%~2%esc%[0m | ||
1250 | ) else ( | ||
1251 | %psc% write-host -back '%1' -fore '%2' '%3' | ||
1252 | ) | ||
1253 | exit /b | ||
1254 | |||
1255 | :dk_color2 | ||
1256 | |||
1257 | if %_NCS% EQU 1 ( | ||
1258 | echo %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 | ) | ||
1262 | exit /b | ||
1263 | |||
1264 | ::======================================================================================================================================== | ||
1265 | |||
1266 | :dk_done | ||
1267 | |||
1268 | echo: | ||
1269 | if %_unattended%==1 timeout /t 2 & exit /b | ||
1270 | call :dk_color %_Yellow% "Press any key to %_exitmsg%..." | ||
1271 | pause %nul1% | ||
1272 | exit /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 | |||
1285 | set f= | ||
1286 | for %%# in ( | ||
1287 | 15_ab4d047b-97cf-4126-a69f-34df08e2f254_B7R%f%FY-7N%f%XPK-Q43%f%42-Y9%f%X2H-3JX%f%4X_Retail________AccessRetail | ||
1288 | 15_4374022d-56b8-48c1-9bb7-d8f2fc726343_9MF%f%9G-CN%f%32B-HV7%f%XT-9X%f%J8T-9KV%f%F4_MAK___________AccessVolume | ||
1289 | 15_1b1d9bd5-12ea-4063-964c-16e7e87d6e08_NT8%f%89-MB%f%H4X-8MD%f%4H-X8%f%R2D-WQH%f%F8_Retail________ExcelRetail | ||
1290 | 15_ac1ae7fd-b949-4e04-a330-849bc40638cf_Y3N%f%36-YC%f%HDK-XYW%f%BG-KY%f%QVV-BDT%f%J2_MAK___________ExcelVolume | ||
1291 | 15_cfaf5356-49e3-48a8-ab3c-e729ab791250_BMK%f%4W-6N%f%88B-BP9%f%QR-PH%f%FCK-MG7%f%GF_Retail________GrooveRetail | ||
1292 | 15_4825ac28-ce41-45a7-9e6e-1fed74057601_RN8%f%4D-7H%f%CWY-FTC%f%BK-JM%f%XWM-HT7%f%GJ_MAK___________GrooveVolume | ||
1293 | 15_c02fb62e-1cd5-4e18-ba25-e0480467ffaa_2WQ%f%NF-GB%f%K4B-XVG%f%6F-BB%f%MX7-M4F%f%2Y_OEM-Perp______HomeBusinessPipcRetail | ||
1294 | 15_cd256150-a898-441f-aac0-9f8f33390e45_NVT%f%DK-QB%f%8J9-M28%f%GR-92%f%BPC-BR9%f%6Q_Retail________HomeBusinessRetail | ||
1295 | 15_98685d21-78bd-4c62-bc4f-653344a63035_R29%f%WQ-CM%f%NCM-2TH%f%CT-K4%f%H92-FX6%f%KR_Retail________HomeStudentRetail | ||
1296 | 15_44984381-406e-4a35-b1c3-e54f499556e2_RV7%f%NQ-HY%f%3WW-7CK%f%WH-QT%f%VMW-29V%f%HC_Retail________InfoPathRetail | ||
1297 | 15_9e016989-4007-42a6-8051-64eb97110cf2_C4T%f%GN-QQ%f%W6Y-FYK%f%XC-6W%f%JW7-X73%f%VG_MAK___________InfoPathVolume | ||
1298 | 15_9103f3ce-1084-447a-827e-d6097f68c895_6MD%f%N4-WF%f%3FV-4WH%f%3Q-W6%f%99V-RGC%f%MY_PrepidBypass__LyncAcademicRetail | ||
1299 | 15_ff693bf4-0276-4ddb-bb42-74ef1a0c9f4d_N42%f%BF-CB%f%Y9F-W2C%f%7R-X3%f%97X-DYF%f%QW_PrepidBypass__LyncEntryRetail | ||
1300 | 15_fada6658-bfc6-4c4e-825a-59a89822cda8_89P%f%23-2N%f%K2R-JXM%f%2M-3Q%f%8R8-BWM%f%3Y_Retail________LyncRetail | ||
1301 | 15_e1264e10-afaf-4439-a98b-256df8bb156f_3WK%f%CD-RN%f%489-4M7%f%XJ-GJ%f%2GQ-YBF%f%Q6_MAK___________LyncVolume | ||
1302 | 15_3169c8df-f659-4f95-9cc6-3115e6596e83_YYH%f%XG-KT%f%NKF-XGR%f%T7-H2%f%99D-8K6%f%MM_Retail________MondoRetail | ||
1303 | 15_f33485a0-310b-4b72-9a0e-b1d605510dbd_2YN%f%YQ-FQ%f%MVG-CB8%f%KW-6X%f%KYD-M7R%f%RJ_MAK___________MondoVolume | ||
1304 | 15_3391e125-f6e4-4b1e-899c-a25e6092d40d_4TG%f%WV-6N%f%9P6-G2H%f%8Y-2H%f%WKB-B4F%f%F4_Bypass________OneNoteFreeRetail | ||
1305 | 15_8b524bcc-67ea-4876-a509-45e46f6347e8_3KX%f%XQ-PV%f%N2C-8P7%f%YY-HC%f%V88-GVG%f%Q6_Retail________OneNoteRetail | ||
1306 | 15_b067e965-7521-455b-b9f7-c740204578a2_JDM%f%WF-NJ%f%C7B-HRC%f%HY-WF%f%T8G-BPX%f%D9_MAK___________OneNoteVolume | ||
1307 | 15_12004b48-e6c8-4ffa-ad5a-ac8d4467765a_9N4%f%RQ-CF%f%8R2-HBV%f%CB-J3%f%C9V-94P%f%4D_Retail________OutlookRetail | ||
1308 | 15_8d577c50-ae5e-47fd-a240-24986f73d503_HNG%f%29-GG%f%WRG-RFC%f%8C-JT%f%FP4-2J9%f%FH_MAK___________OutlookVolume | ||
1309 | 15_5aab8561-1686-43f7-9ff5-2c861da58d17_9CY%f%B3-NF%f%MRW-YFD%f%G6-XC%f%7TF-BY3%f%6J_OEM-Perp______PersonalPipcRetail | ||
1310 | 15_17e9df2d-ed91-4382-904b-4fed6a12caf0_2NC%f%QJ-MF%f%RMH-TXV%f%83-J7%f%V4C-RVR%f%WC_Retail________PersonalRetail | ||
1311 | 15_31743b82-bfbc-44b6-aa12-85d42e644d5b_HVM%f%N2-KP%f%HQH-DVQ%f%MK-7B%f%3CM-FGB%f%FC_Retail________PowerPointRetail | ||
1312 | 15_e40dcb44-1d5c-4085-8e8f-943f33c4f004_47D%f%KN-HP%f%JP7-RF9%f%M3-VC%f%YT2-TMQ%f%4G_MAK___________PowerPointVolume | ||
1313 | 15_064383fa-1538-491c-859b-0ecab169a0ab_N3Q%f%MM-GK%f%DT3-JQG%f%X6-7X%f%3MQ-4GB%f%G3_Retail________ProPlusRetail | ||
1314 | 15_2b88c4f2-ea8f-43cd-805e-4d41346e18a7_QKH%f%NX-M9%f%GGH-T3Q%f%MW-YP%f%K4Q-QRP%f%9V_MAK___________ProPlusVolume | ||
1315 | 15_4e26cac1-e15a-4467-9069-cb47b67fe191_CF9%f%DD-6C%f%NW2-BJW%f%JQ-CV%f%CFX-Y7T%f%XD_OEM-Perp______ProfessionalPipcRetail | ||
1316 | 15_44bc70e2-fb83-4b09-9082-e5557e0c2ede_MBQ%f%BN-CQ%f%PT6-PXR%f%MC-TY%f%JFR-3C8%f%MY_Retail________ProfessionalRetail | ||
1317 | 15_f2435de4-5fc0-4e5b-ac97-34f515ec5ee7_B4R%f%N4-H4%f%JYG-YMQ%f%MC-CY%f%GKH-46W%f%PH_Retail________ProjectProRetail | ||
1318 | 15_ed34dc89-1c27-4ecd-8b2f-63d0f4cedc32_WFC%f%T2-NB%f%FQ7-JD7%f%VV-MF%f%JX6-6F2%f%CM_MAK___________ProjectProVolume | ||
1319 | 15_5517e6a2-739b-4822-946f-7f0f1c5934b1_2B9%f%6V-X9%f%NJY-WFB%f%RC-Q8%f%MP2-7CC%f%C4_Retail________ProjectStdRetail | ||
1320 | 15_2b9e4a37-6230-4b42-bee2-e25ce86c8c7a_3CN%f%QX-T3%f%4TY-99R%f%H4-C4%f%YD2-KWY%f%GV_MAK___________ProjectStdVolume | ||
1321 | 15_c3a0814a-70a4-471f-af37-2313a6331111_TWN%f%CJ-YR%f%84W-X7P%f%PF-6D%f%PRP-D67%f%VC_Retail________PublisherRetail | ||
1322 | 15_38ea49f6-ad1d-43f1-9888-99a35d7c9409_DJP%f%HV-NC%f%JV6-GWP%f%T6-K2%f%6JX-C7G%f%X6_MAK___________PublisherVolume | ||
1323 | 15_ba3e3833-6a7e-445a-89d0-7802a9a68588_3NY%f%6J-WH%f%T3F-47B%f%DV-JH%f%F36-234%f%3W_PrepidBypass__SPDRetail | ||
1324 | 15_32255c0a-16b4-4ce2-b388-8a4267e219eb_V6V%f%WN-KC%f%2HR-YYD%f%D6-9V%f%7HQ-7T7%f%VP_Retail________StandardRetail | ||
1325 | 15_a24cca51-3d54-4c41-8a76-4031f5338cb2_9TN%f%6B-PC%f%YH4-MCV%f%DQ-KT%f%83C-TMQ%f%7T_MAK___________StandardVolume | ||
1326 | 15_15d12ad4-622d-4257-976c-5eb3282fb93d_JRJ%f%NJ-33%f%M7C-R73%f%X3-P9%f%XF7-R89%f%MY_Retail________VisioProRetail | ||
1327 | 15_3e4294dd-a765-49bc-8dbd-cf8b62a4bd3d_YN7%f%CF-XR%f%H6R-CGK%f%RY-GK%f%PV3-BG7%f%WF_MAK___________VisioProVolume | ||
1328 | 15_dae597ce-5823-4c77-9580-7268b93a4b23_G2N%f%2Q-4Q%f%D2T-DY4%f%TP-GY%f%489-3RQ%f%CG_Retail________VisioStdRetail | ||
1329 | 15_44a1f6ff-0876-4edb-9169-dbb43101ee89_RX6%f%3Y-4N%f%FK2-XTY%f%C8-C6%f%B3W-YPX%f%PJ_MAK___________VisioStdVolume | ||
1330 | 15_191509f2-6977-456f-ab30-cf0492b1e93a_NB7%f%7V-RP%f%FQ6-PMM%f%KQ-T8%f%7DV-M4D%f%84_Retail________WordRetail | ||
1331 | 15_9cedef15-be37-4ff0-a08a-13a045540641_RPH%f%PB-Y7%f%NC4-3VY%f%FM-DW%f%7VD-G8Y%f%J8_MAK___________WordVolume | ||
1332 | 15_befee371-a2f5-4648-85db-a2c55fdf324c_JXR%f%8H-NJ%f%3MK-X66%f%W8-78%f%CWD-QRQ%f%6C_Retail________O365BusinessRetail | ||
1333 | 15_537ea5b5-7d50-4876-bd38-a53a77caca32_J2W%f%28-TN%f%9C8-26P%f%WV-F7%f%J4G-72X%f%CB_Subscription1_O365HomePremRetail | ||
1334 | 15_0c4e5e7a-b436-4776-bb89-88e4b14687e2_T6J%f%JW-DY%f%N99-WK4%f%6B-9M%f%KKV-94P%f%2Y_Retail________O365ProPlusRetail | ||
1335 | 15_7a75647f-636f-4607-8e54-e1b7d1ad8930_B9V%f%9Q-F6%f%ND8-T4K%f%4K-88%f%68M-HT7%f%KT_Retail________O365SmallBusPremRetail | ||
1336 | 16_bfa358b0-98f1-4125-842e-585fa13032e6_WHK%f%4N-YQ%f%GHB-XWX%f%CC-G3%f%HYC-6JF%f%94_Retail________AccessRetail | ||
1337 | 16_9d9faf9e-d345-4b49-afce-68cb0a539c7c_RNB%f%7V-P4%f%8F4-3FY%f%Y6-2P%f%3R3-63B%f%QV_PrepidBypass__AccessRuntimeRetail | ||
1338 | 16_3b2fa33f-cd5a-43a5-bd95-f49f3f546b0b_JJ2%f%Y4-N8%f%KM3-Y8K%f%Y3-Y2%f%2FR-R3K%f%VK_MAK___________AccessVolume | ||
1339 | 16_424d52ff-7ad2-4bc7-8ac6-748d767b455d_RKJ%f%BN-VW%f%TM2-BDK%f%XX-RK%f%QFD-JTY%f%Q2_Retail________ExcelRetail | ||
1340 | 16_685062a7-6024-42e7-8c5f-6bb9e63e697f_FVG%f%NR-X8%f%2B2-6PR%f%JM-YT%f%4W7-8HV%f%36_MAK___________ExcelVolume | ||
1341 | 16_c02fb62e-1cd5-4e18-ba25-e0480467ffaa_2WQ%f%NF-GB%f%K4B-XVG%f%6F-BB%f%MX7-M4F%f%2Y_OEM-Perp______HomeBusinessPipcRetail | ||
1342 | 16_86834d00-7896-4a38-8fae-32f20b86fa2b_HM6%f%FM-NV%f%F78-KV9%f%PM-F3%f%6B8-D9M%f%XD_Retail________HomeBusinessRetail | ||
1343 | 16_c28acdb8-d8b3-4199-baa4-024d09e97c99_PNP%f%RV-F2%f%627-Q8J%f%VC-3D%f%GR9-WTY%f%RK_Retail________HomeStudentRetail | ||
1344 | 16_e2127526-b60c-43e0-bed1-3c9dc3d5a468_YWD%f%4R-CN%f%KVT-VG8%f%VJ-93%f%33B-RC3%f%B8_Retail________HomeStudentVNextRetail | ||
1345 | 16_b21367df-9545-4f02-9f24-240691da0e58_Y3X%f%PN-P7%f%PC4-MGP%f%TJ-2B%f%Y3Q-RJR%f%FV_Retail________MondoRetail | ||
1346 | 16_2cd0ea7e-749f-4288-a05e-567c573b2a6c_FMT%f%QQ-84%f%NR8-274%f%4R-MX%f%F4P-PGY%f%R3_MAK___________MondoVolume | ||
1347 | 16_436366de-5579-4f24-96db-3893e4400030_XYN%f%TG-R9%f%6FY-369%f%HX-YF%f%PHY-F9C%f%PM_Bypass________OneNoteFreeRetail | ||
1348 | 16_83ac4dd9-1b93-40ed-aa55-ede25bb6af38_FXF%f%6F-CN%f%C26-W64%f%3C-K6%f%KB7-6XX%f%W3_Retail________OneNoteRetail | ||
1349 | 16_23b672da-a456-4860-a8f3-e062a501d7e8_9TY%f%VN-D7%f%6HK-BVM%f%WT-Y7%f%G88-9TP%f%PV_MAK___________OneNoteVolume | ||
1350 | 16_5a670809-0983-4c2d-8aad-d3c2c5b7d5d1_7N4%f%KG-P2%f%QDH-86V%f%9C-DJ%f%FVF-369%f%W9_Retail________OutlookRetail | ||
1351 | 16_50059979-ac6f-4458-9e79-710bcb41721a_7QP%f%NR-3H%f%FDG-YP6%f%T9-JQ%f%CKQ-KKX%f%XC_MAK___________OutlookVolume | ||
1352 | 16_5aab8561-1686-43f7-9ff5-2c861da58d17_9CY%f%B3-NF%f%MRW-YFD%f%G6-XC%f%7TF-BY3%f%6J_OEM-Perp______PersonalPipcRetail | ||
1353 | 16_a9f645a1-0d6a-4978-926a-abcb363b72a6_FT7%f%VF-XB%f%N92-HPD%f%JV-RH%f%MBY-6VK%f%BF_Retail________PersonalRetail | ||
1354 | 16_f32d1284-0792-49da-9ac6-deb2bc9c80b6_N7G%f%CB-WQ%f%T7K-QRH%f%WG-TT%f%PYD-7T9%f%XF_Retail________PowerPointRetail | ||
1355 | 16_9b4060c9-a7f5-4a66-b732-faf248b7240f_X3R%f%T9-ND%f%G64-VMK%f%2M-KQ%f%6XY-DPF%f%GV_MAK___________PowerPointVolume | ||
1356 | 16_de52bd50-9564-4adc-8fcb-a345c17f84f9_GM4%f%3N-F7%f%42Q-6JD%f%DK-M6%f%22J-J8G%f%DV_Retail________ProPlusRetail | ||
1357 | 16_c47456e3-265d-47b6-8ca0-c30abbd0ca36_FNV%f%K8-8D%f%VCJ-F7X%f%3J-KG%f%VQB-RC2%f%QY_MAK___________ProPlusVolume | ||
1358 | 16_4e26cac1-e15a-4467-9069-cb47b67fe191_CF9%f%DD-6C%f%NW2-BJW%f%JQ-CV%f%CFX-Y7T%f%XD_OEM-Perp______ProfessionalPipcRetail | ||
1359 | 16_d64edc00-7453-4301-8428-197343fafb16_NXF%f%TK-YD%f%9Y7-X9M%f%MJ-9B%f%WM6-J2Q%f%VH_Retail________ProfessionalRetail | ||
1360 | 16_0f42f316-00b1-48c5-ada4-2f52b5720ad0_WKK%f%GF-TT%f%N8F-QC9%f%T2-6C%f%2DC-3YH%f%63_Retail________ProjectProRetail | ||
1361 | 16_82f502b5-b0b0-4349-bd2c-c560df85b248_PKC%f%3N-8F%f%99H-28M%f%VY-J4%f%RYY-CWG%f%DH_MAK___________ProjectProVolume | ||
1362 | 16_16728639-a9ab-4994-b6d8-f81051e69833_JBN%f%PH-YF%f%2F7-Q9Y%f%29-86%f%CTG-C9Y%f%GV_MAKC2R________ProjectProXVolume | ||
1363 | 16_e9f0b3fc-962f-4944-ad06-05c10b6bcd5e_4H6%f%NF-QD%f%PG8-83W%f%97-9K%f%8XY-XBT%f%9Y_Retail________ProjectStdRetail | ||
1364 | 16_82e6b314-2a62-4e51-9220-61358dd230e6_4TG%f%WV-6N%f%9P6-G2H%f%8Y-2H%f%WKB-B4G%f%93_MAK___________ProjectStdVolume | ||
1365 | 16_431058f0-c059-44c5-b9e7-ed2dd46b6789_N3W%f%2Q-69%f%MBT-27R%f%D9-BH%f%8V3-JT2%f%C8_MAKC2R________ProjectStdXVolume | ||
1366 | 16_6e0c1d99-c72e-4968-bcb7-ab79e03e201e_WKW%f%ND-X6%f%G9G-CDM%f%TV-CP%f%GYJ-6MV%f%BF_Retail________PublisherRetail | ||
1367 | 16_fcc1757b-5d5f-486a-87cf-c4d6dedb6032_9QV%f%N2-PX%f%XRX-8V4%f%W8-Q7%f%926-TJG%f%D8_MAK___________PublisherVolume | ||
1368 | 16_9103f3ce-1084-447a-827e-d6097f68c895_6MD%f%N4-WF%f%3FV-4WH%f%3Q-W6%f%99V-RGC%f%MY_PrepidBypass__SkypeServiceBypassRetail | ||
1369 | 16_971cd368-f2e1-49c1-aedd-330909ce18b6_4N4%f%D8-3J%f%7Y3-YYW%f%7C-73%f%HD2-V8R%f%HY_PrepidBypass__SkypeforBusinessEntryRetail | ||
1370 | 16_418d2b9f-b491-4d7f-84f1-49e27cc66597_PBJ%f%79-77%f%NY4-VRG%f%FG-Y8%f%WYC-CKC%f%RC_Retail________SkypeforBusinessRetail | ||
1371 | 16_03ca3b9a-0869-4749-8988-3cbc9d9f51bb_DMT%f%CJ-KN%f%RKR-JV8%f%TQ-V2%f%CR2-VFT%f%FH_MAK___________SkypeforBusinessVolume | ||
1372 | 16_4a31c291-3a12-4c64-b8ab-cd79212be45e_2FP%f%WN-4H%f%6CM-KD8%f%QQ-8H%f%CHC-P9X%f%YW_Retail________StandardRetail | ||
1373 | 16_0ed94aac-2234-4309-ba29-74bdbb887083_WHG%f%MQ-JN%f%MGT-MDQ%f%VF-WD%f%R69-KQB%f%WC_MAK___________StandardVolume | ||
1374 | 16_2dfe2075-2d04-4e43-816a-eb60bbb77574_7TM%f%6H-KN%f%R4K-Q7H%f%BX-72%f%T2Q-H22%f%RV_Retail________VisioProRetail | ||
1375 | 16_295b2c03-4b1c-4221-b292-1411f468bd02_NRK%f%T9-C8%f%GP2-XDY%f%XQ-YW%f%72K-MG9%f%2B_MAK___________VisioProVolume | ||
1376 | 16_0594dc12-8444-4912-936a-747ca742dbdb_G98%f%Q2-B6%f%N77-CFH%f%9J-K8%f%24G-XQC%f%C4_MAKC2R________VisioProXVolume | ||
1377 | 16_c76dbcbc-d71b-4f45-b5b3-b7494cb4e23e_Q8R%f%4N-GJ%f%CPG-CF3%f%2R-JF%f%CYR-K4T%f%F3_Retail________VisioStdRetail | ||
1378 | 16_44151c2d-c398-471f-946f-7660542e3369_XNC%f%JB-YY%f%883-JRW%f%64-DP%f%XMX-JXC%f%R6_MAK___________VisioStdVolume | ||
1379 | 16_1d1c6879-39a3-47a5-9a6d-aceefa6a289d_B2H%f%TN-JP%f%H8C-J6Y%f%6V-HC%f%HKB-43M%f%GT_MAKC2R________VisioStdXVolume | ||
1380 | 16_cacaa1bf-da53-4c3b-9700-11738ef1c2a5_P8K%f%82-NQ%f%7GG-JKY%f%8T-6V%f%HVY-88G%f%GD_Retail________WordRetail | ||
1381 | 16_c3000759-551f-4f4a-bcac-a4b42cbf1de2_YHM%f%WC-YN%f%6V9-WJP%f%XD-3W%f%QKP-TMV%f%CV_MAK___________WordVolume | ||
1382 | 16_518687bd-dc55-45b9-8fa6-f918e1082e83_WRY%f%J6-G3%f%NP7-7VH%f%94-8X%f%7KP-JB7%f%HC_Retail________Access2019Retail | ||
1383 | 16_385b91d6-9c2c-4a2e-86b5-f44d44a48c5f_6FW%f%HX-NK%f%YXK-BW3%f%4Q-7X%f%C9F-Q9P%f%X7_MAK-AE________Access2019Volume | ||
1384 | 16_22e6b96c-1011-4cd5-8b35-3c8fb6366b86_FGQ%f%NJ-JW%f%JCG-7Q8%f%MG-RM%f%RGJ-9TQ%f%VF_PrepidBypass__AccessRuntime2019Retail | ||
1385 | 16_c201c2b7-02a1-41a8-b496-37c72910cd4a_KBP%f%NW-64%f%CMM-8KW%f%CB-23%f%F44-8B7%f%HM_Retail________Excel2019Retail | ||
1386 | 16_05cb4e1d-cc81-45d5-a769-f34b09b9b391_8NT%f%4X-GQ%f%MCK-62X%f%4P-TW%f%6QP-YKP%f%YF_MAK-AE________Excel2019Volume | ||
1387 | 16_7fe09eef-5eed-4733-9a60-d7019df11cac_QBN%f%2Y-9B%f%284-9KW%f%78-K4%f%8PB-R62%f%YT_Retail________HomeBusiness2019Retail | ||
1388 | 16_4539aa2c-5c31-4d47-9139-543a868e5741_XNW%f%PM-32%f%XQC-Y7Q%f%JC-QG%f%GBV-YY7%f%JK_Retail________HomeStudent2019Retail | ||
1389 | 16_20e359d5-927f-47c0-8a27-38adbdd27124_WR4%f%3D-NM%f%WQQ-HCQ%f%R2-VK%f%XDR-37B%f%7H_Retail________Outlook2019Retail | ||
1390 | 16_92a99ed8-2923-4cb7-a4c5-31da6b0b8cf3_RN3%f%QB-GT%f%6D7-YB3%f%VH-F3%f%RPB-3GQ%f%YB_MAK-AE________Outlook2019Volume | ||
1391 | 16_2747b731-0f1f-413e-a92d-386ec1277dd8_NMB%f%Y8-V3%f%CV7-BX6%f%K6-29%f%22Y-43M%f%7T_Retail________Personal2019Retail | ||
1392 | 16_7e63cc20-ba37-42a1-822d-d5f29f33a108_HN2%f%7K-JH%f%J8R-7T7%f%KK-WJ%f%YC3-FM7%f%MM_Retail________PowerPoint2019Retail | ||
1393 | 16_13c2d7bf-f10d-42eb-9e93-abf846785434_29G%f%NM-VM%f%33V-WR2%f%3K-HG%f%2DT-KTQ%f%YR_MAK-AE________PowerPoint2019Volume | ||
1394 | 16_a3072b8f-adcc-4e75-8d62-fdeb9bdfae57_BN4%f%XJ-R9%f%DYY-96W%f%48-YK%f%8DM-MY7%f%PY_Retail________ProPlus2019Retail | ||
1395 | 16_6755c7a7-4dfe-46f5-bce8-427be8e9dc62_T8Y%f%BN-4Y%f%V3X-KK2%f%4Q-QX%f%BD7-T3C%f%63_MAK-AE________ProPlus2019Volume | ||
1396 | 16_1717c1e0-47d3-4899-a6d3-1022db7415e0_9NX%f%DK-MR%f%Y98-2VJ%f%V8-GF%f%73J-TQ9%f%FK_Retail________Professional2019Retail | ||
1397 | 16_0d270ef7-5aaf-4370-a372-bc806b96adb7_JDT%f%NC-PP%f%77T-T9H%f%2W-G4%f%J2J-VH8%f%JK_Retail________ProjectPro2019Retail | ||
1398 | 16_d4ebadd6-401b-40d5-adf4-a5d4accd72d1_TBX%f%BD-FN%f%WKJ-WRH%f%BD-KB%f%PHH-XD9%f%F2_MAK-AE________ProjectPro2019Volume | ||
1399 | 16_bb7ffe5f-daf9-4b79-b107-453e1c8427b5_R3J%f%NT-8P%f%BDP-MTW%f%CK-VD%f%2V8-HMK%f%F9_Retail________ProjectStd2019Retail | ||
1400 | 16_fdaa3c03-dc27-4a8d-8cbf-c3d843a28ddc_RBR%f%FX-MQ%f%NDJ-4XF%f%HF-7Q%f%VDR-JHX%f%GC_MAK-AE________ProjectStd2019Volume | ||
1401 | 16_f053a7c7-f342-4ab8-9526-a1d6e5105823_4QC%f%36-NW%f%3YH-D2Y%f%9D-RJ%f%PC7-VVB%f%9D_Retail________Publisher2019Retail | ||
1402 | 16_40055495-be00-444e-99cc-07446729b53e_K8F%f%2D-NB%f%M32-BF2%f%6V-YC%f%KFJ-29Y%f%9W_MAK-AE________Publisher2019Volume | ||
1403 | 16_b639e55c-8f3e-47fe-9761-26c6a786ad6b_JBD%f%KF-6N%f%CD6-49K%f%3G-2T%f%V79-BKP%f%73_Retail________SkypeforBusiness2019Retail | ||
1404 | 16_15a430d4-5e3f-4e6d-8a0a-14bf3caee4c7_9MN%f%Q7-YP%f%Q3B-6WJ%f%XM-G8%f%3T3-CBB%f%DK_MAK-AE________SkypeforBusiness2019Volume | ||
1405 | 16_f88cfdec-94ce-4463-a969-037be92bc0e7_N97%f%22-BV%f%9H6-WTJ%f%TT-FP%f%B93-978%f%MK_PrepidBypass__SkypeforBusinessEntry2019Retail | ||
1406 | 16_fdfa34dd-a472-4b85-bee6-cf07bf0aaa1c_NDG%f%VM-MD%f%27H-2XH%f%VC-KD%f%DX2-YKP%f%74_Retail________Standard2019Retail | ||
1407 | 16_beb5065c-1872-409e-94e2-403bcfb6a878_NT3%f%V6-XM%f%BK7-Q66%f%MF-VM%f%KR4-FC3%f%3M_MAK-AE________Standard2019Volume | ||
1408 | 16_a6f69d68-5590-4e02-80b9-e7233dff204e_2NW%f%VW-QG%f%F4T-9CP%f%MB-WY%f%DQ9-7XP%f%79_Retail________VisioPro2019Retail | ||
1409 | 16_f41abf81-f409-4b0d-889d-92b3e3d7d005_33Y%f%F4-GN%f%CQ3-J6G%f%DM-J6%f%7P3-FM7%f%QP_MAK-AE________VisioPro2019Volume | ||
1410 | 16_4a582021-18c2-489f-9b3d-5186de48f1cd_263%f%WK-3N%f%797-7R4%f%37-28%f%BKG-3V8%f%M8_Retail________VisioStd2019Retail | ||
1411 | 16_933ed0e3-747d-48b0-9c2c-7ceb4c7e473d_BGN%f%HX-QT%f%PRJ-F9C%f%9G-R8%f%QQG-8T2%f%7F_MAK-AE________VisioStd2019Volume | ||
1412 | 16_72cee1c2-3376-4377-9f25-4024b6baadf8_JXR%f%8H-NJ%f%3MK-X66%f%W8-78%f%CWD-QRV%f%R2_Retail________Word2019Retail | ||
1413 | 16_fe5fe9d5-3b06-4015-aa35-b146f85c4709_9F3%f%6R-PN%f%VHH-3DX%f%GQ-7C%f%D2H-R9D%f%3V_MAK-AE________Word2019Volume | ||
1414 | 16_f634398e-af69-48c9-b256-477bea3078b5_P28%f%6B-N3%f%XYP-36Q%f%RQ-29%f%CMP-RVX%f%9M_Retail________Access2021Retail | ||
1415 | 16_ae17db74-16b0-430b-912f-4fe456e271db_JBH%f%3N-P9%f%7FP-FRT%f%JD-MG%f%K2C-VFW%f%G6_MAK-AE________Access2021Volume | ||
1416 | 16_fb099c19-d48b-4a2f-a160-4383011060aa_V6Q%f%FB-7N%f%7G9-PF7%f%W9-M8%f%FQM-MY8%f%G9_Retail________Excel2021Retail | ||
1417 | 16_9da1ecdb-3a62-4273-a234-bf6d43dc0778_WNY%f%R4-KM%f%R9H-KVC%f%8W-7H%f%J8B-K79%f%DQ_MAK-AE________Excel2021Volume | ||
1418 | 16_0e878942-3ba1-48ee-a215-f64d10a9f97b_QV2%f%VN-37%f%WPX-DHH%f%4K-B8%f%2H6-PDP%f%3T_Retail1_______HomeBusiness2021Retail | ||
1419 | 16_9e7d5312-95fc-4443-a551-69c20624ec6b_3QN%f%G6-8F%f%JTH-88B%f%F9-KB%f%BVM-JMB%f%78_Retail________HomeStudent2021Retail | ||
1420 | 16_279706f4-3a4b-4877-949b-f8c299cf0cc5_NB2%f%TQ-3Y%f%79C-77C%f%6M-QM%f%Y7H-7QY%f%8P_Retail________OneNote2021Retail | ||
1421 | 16_ecea2cfa-d406-4a7f-be0d-c6163250d126_4NC%f%WR-9V%f%92Y-34V%f%B2-RP%f%THR-YTG%f%R7_Retail________Outlook2021Retail | ||
1422 | 16_45bf67f9-0fc8-4335-8b09-9226cef8a576_JQ9%f%MJ-QY%f%N6B-67P%f%X9-GY%f%FVY-QJ6%f%TB_MAK-AE________Outlook2021Volume | ||
1423 | 16_8f89391e-eedb-429d-af90-9d36fbf94de6_RRR%f%YB-DN%f%749-GCP%f%W4-9H%f%6VK-HCH%f%PT_Retail________Personal2021Retail | ||
1424 | 16_c9bf5e86-f5e3-4ac6-8d52-e114a604d7bf_3KX%f%XQ-PV%f%N2C-8P7%f%YY-HC%f%V88-GVM%f%96_Retail1_______PowerPoint2021Retail | ||
1425 | 16_716f2434-41b6-4969-ab73-e61e593a3875_39G%f%2N-3B%f%D9C-C4X%f%CM-BD%f%4QG-FVY%f%DY_MAK-AE________PowerPoint2021Volume | ||
1426 | 16_c2f04adf-a5de-45c5-99a5-f5fddbda74a8_8WX%f%TP-MN%f%628-KY4%f%4G-VJ%f%WCK-C7P%f%CF_Retail________ProPlus2021Retail | ||
1427 | 16_3f180b30-9b05-4fe2-aa8d-0c1c4790f811_RNH%f%JY-DT%f%FXW-HW9%f%F8-49%f%82D-MD2%f%CW_MAK-AE1_______ProPlus2021Volume | ||
1428 | 16_96097a68-b5c5-4b19-8600-2e8d6841a0db_JRJ%f%NJ-33%f%M7C-R73%f%X3-P9%f%XF7-R9F%f%6M_MAK-AE________ProPlusSPLA2021Volume | ||
1429 | 16_711e48a6-1a79-4b00-af10-73f4ca3aaac4_DJP%f%HV-NC%f%JV6-GWP%f%T6-K2%f%6JX-C7P%f%BG_Retail________Professional2021Retail | ||
1430 | 16_3747d1d5-55a8-4bc3-b53d-19fff1913195_QKH%f%NX-M9%f%GGH-T3Q%f%MW-YP%f%K4Q-QRW%f%MV_Retail________ProjectPro2021Retail | ||
1431 | 16_17739068-86c4-4924-8633-1e529abc7efc_HVC%f%34-CV%f%NPG-RVC%f%MT-X2%f%JRF-CR7%f%RK_MAK-AE1_______ProjectPro2021Volume | ||
1432 | 16_4ea64dca-227c-436b-813f-b6624be2d54c_2B9%f%6V-X9%f%NJY-WFB%f%RC-Q8%f%MP2-7CH%f%RR_Retail________ProjectStd2021Retail | ||
1433 | 16_84313d1e-47c8-4e27-8ced-0476b7ee46c4_3CN%f%QX-T3%f%4TY-99R%f%H4-C4%f%YD2-KW6%f%WH_MAK-AE________ProjectStd2021Volume | ||
1434 | 16_b769b746-53b1-4d89-8a68-41944dafe797_CDN%f%FG-77%f%T8D-VKQ%f%JX-B7%f%KT3-KK2%f%8V_Retail1_______Publisher2021Retail | ||
1435 | 16_a0234cfe-99bd-4586-a812-4f296323c760_2KX%f%JH-3N%f%HTW-RDB%f%PX-QF%f%RXJ-MTG%f%XF_MAK-AE________Publisher2021Volume | ||
1436 | 16_c3fb48b2-1fd4-4dc8-af39-819edf194288_DVB%f%XN-HF%f%T43-CVP%f%RQ-J8%f%9TF-VMM%f%HG_Retail________SkypeforBusiness2021Retail | ||
1437 | 16_6029109c-ceb8-4ee5-b324-f8eb2981e99a_R3F%f%CY-NH%f%GC7-CBP%f%VP-8Q%f%934-YTG%f%XG_MAK-AE________SkypeforBusiness2021Volume | ||
1438 | 16_9e7e7b8e-a0e7-467b-9749-d0de82fb7297_HXN%f%XB-J4%f%JGM-TCF%f%44-2X%f%2CV-FJV%f%VH_Retail________Standard2021Retail | ||
1439 | 16_223a60d8-9002-4a55-abac-593f5b66ca45_2CJ%f%N4-C9%f%XK2-HFP%f%Q6-YH%f%498-82T%f%XH_MAK-AE________Standard2021Volume | ||
1440 | 16_b99ba8c4-e257-4b70-a31a-8bd308ce7073_BQW%f%DW-NJ%f%9YF-P7Y%f%79-H6%f%DCT-MKQ%f%9C_MAK-AE________StandardSPLA2021Volume | ||
1441 | 16_814014d3-c30b-4f63-a493-3708e0dc0ba8_T6P%f%26-NJ%f%VBR-76B%f%K8-WB%f%CDY-TX3%f%BC_Retail________VisioPro2021Retail | ||
1442 | 16_c590605a-a08a-4cc7-8dc2-f1ffb3d06949_JNK%f%BX-MH%f%9P4-K8Y%f%YV-8C%f%G2Y-VQ2%f%C8_MAK-AE________VisioPro2021Volume | ||
1443 | 16_16d43989-a5ef-47e2-9ff1-272784caee24_89N%f%YY-KB%f%93R-7X2%f%2F-93%f%QDF-DJ6%f%YM_Retail________VisioStd2021Retail | ||
1444 | 16_d55f90ee-4ba2-4d02-b216-1300ee50e2af_BW4%f%3B-4P%f%NFP-V63%f%7F-23%f%TR2-J47%f%TX_MAK-AE________VisioStd2021Volume | ||
1445 | 16_fb33d997-4aa3-494e-8b58-03e9ab0f181d_VNC%f%C4-CJ%f%QVK-BKX%f%34-77%f%Y8H-CYX%f%MR_Retail________Word2021Retail | ||
1446 | 16_0c728382-95fb-4a55-8f12-62e605f91727_BJG%f%97-NW%f%3GM-8QQ%f%Q7-FH%f%76G-686%f%XM_MAK-AE________Word2021Volume | ||
1447 | 16_6337137e-7c07-4197-8986-bece6a76fc33_2P3%f%C9-BQ%f%NJH-VCV%f%PH-YD%f%Y6M-43J%f%PQ_Subscription__O365BusinessRetail | ||
1448 | 16_2f5c71b4-5b7a-4005-bb68-f9fac26f2ea3_W62%f%NQ-26%f%7QR-RTF%f%74-PF%f%2MH-JQM%f%TH_Subscription__O365EduCloudRetail | ||
1449 | 16_537ea5b5-7d50-4876-bd38-a53a77caca32_J2W%f%28-TN%f%9C8-26P%f%WV-F7%f%J4G-72X%f%CB_Subscription1_O365HomePremRetail | ||
1450 | 16_149dbce7-a48e-44db-8364-a53386cd4580_2N3%f%82-D6%f%PKK-QTX%f%4D-2J%f%JYK-M96%f%P2_Subscription1_O365ProPlusRetail | ||
1451 | 16_bacd4614-5bef-4a5e-bafc-de4c788037a2_HN8%f%JP-87%f%TQJ-PBF%f%3P-Y6%f%6KC-W2K%f%9V_Subscription1_O365SmallBusPremRetail | ||
1452 | ) do ( | ||
1453 | for /f "tokens=1-5 delims=_" %%A in ("%%#") do ( | ||
1454 | if %1==getinfo if %oVer%==%%A if "%2"=="%%E" (set _key=%%C& set _actid=%%B& set _allactid=!_allactid! %%B&set _lic=%%D) | ||
1455 | |||
1456 | if %1==getmsiprod if %oVer%==%%A (find /i "%%E" %msitemp% %nul% && (if defined _oIds (set _oIds=!_oIds! %%E) else (set _oIds=%%E))) | ||
1457 | |||
1458 | ) | ||
1459 | ) | ||
1460 | exit /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 | ||
1470 | exit /b | ||
1471 | |||
1472 | :hexedit: | ||
1473 | param ( | ||
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 | |||
1518 | if ($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 | |||
1528 | if ($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 | ||
18 | set _act=0 | ||
19 | |||
20 | :: To remove Ohook activation, run the script with /Ohook-Uninstall parameter or change 0 to 1 in below line | ||
21 | set _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 | |||
31 | set "PATH=%SystemRoot%\System32;%SystemRoot%\System32\wbem;%SystemRoot%\System32\WindowsPowerShell\v1.0\" | ||
32 | if exist "%SystemRoot%\Sysnative\reg.exe" ( | ||
33 | set "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 | |||
39 | set "_cmdf=%~f0" | ||
40 | for %%# in (%*) do ( | ||
41 | if /i "%%#"=="r1" set r1=1 | ||
42 | if /i "%%#"=="r2" set r2=1 | ||
43 | if /i "%%#"=="-qedit" ( | ||
44 | reg add HKCU\Console /v QuickEdit /t REG_DWORD /d "1" /f 1>nul | ||
45 | rem check the code below admin elevation to understand why it's here | ||
46 | ) | ||
47 | ) | ||
48 | |||
49 | if exist %SystemRoot%\Sysnative\cmd.exe if not defined r1 ( | ||
50 | setlocal EnableDelayedExpansion | ||
51 | start %SystemRoot%\Sysnative\cmd.exe /c ""!_cmdf!" %* r1" | ||
52 | exit /b | ||
53 | ) | ||
54 | |||
55 | :: Re-launch the script with ARM32 process if it was initiated by x64 process on ARM64 Windows | ||
56 | |||
57 | if exist %SystemRoot%\SysArm32\cmd.exe if %PROCESSOR_ARCHITECTURE%==AMD64 if not defined r2 ( | ||
58 | setlocal EnableDelayedExpansion | ||
59 | start %SystemRoot%\SysArm32\cmd.exe /c ""!_cmdf!" %* r2" | ||
60 | exit /b | ||
61 | ) | ||
62 | |||
63 | ::======================================================================================================================================== | ||
64 | |||
65 | set "blank=" | ||
66 | set "mas=mass%blank%grave.dev" | ||
67 | |||
68 | :: Check if Null service is working, it's important for the batch script | ||
69 | |||
70 | sc query Null | find /i "RUNNING" | ||
71 | if %errorlevel% NEQ 0 ( | ||
72 | echo: | ||
73 | echo Null service is not running, script may crash... | ||
74 | echo: | ||
75 | echo: | ||
76 | echo Help - https://%mas%/troubleshoot.html | ||
77 | echo: | ||
78 | echo: | ||
79 | ping 127.0.0.1 -n 10 | ||
80 | ) | ||
81 | cls | ||
82 | |||
83 | :: Check LF line ending | ||
84 | |||
85 | pushd "%~dp0" | ||
86 | >nul findstr /v "$" "%~nx0" && ( | ||
87 | echo: | ||
88 | echo Error: Script either has LF line ending issue or an empty line at the end of the script is missing. | ||
89 | echo: | ||
90 | ping 127.0.0.1 -n 6 >nul | ||
91 | popd | ||
92 | exit /b | ||
93 | ) | ||
94 | popd | ||
95 | |||
96 | ::======================================================================================================================================== | ||
97 | |||
98 | cls | ||
99 | color 07 | ||
100 | title Ohook Activation | ||
101 | |||
102 | set _args= | ||
103 | set _elev= | ||
104 | set _unattended=0 | ||
105 | |||
106 | set _args=%* | ||
107 | if defined _args set _args=%_args:"=% | ||
108 | if defined _args ( | ||
109 | for %%A in (%_args%) do ( | ||
110 | if /i "%%A"=="/Ohook" set _act=1 | ||
111 | if /i "%%A"=="/Ohook-Uninstall" set _rem=1 | ||
112 | if /i "%%A"=="-el" set _elev=1 | ||
113 | ) | ||
114 | ) | ||
115 | |||
116 | for %%A in (%_act% %_rem%) do (if "%%A"=="1" set _unattended=1) | ||
117 | |||
118 | ::======================================================================================================================================== | ||
119 | |||
120 | set "nul1=1>nul" | ||
121 | set "nul2=2>nul" | ||
122 | set "nul6=2^>nul" | ||
123 | set "nul=>nul 2>&1" | ||
124 | |||
125 | set psc=powershell.exe | ||
126 | set winbuild=1 | ||
127 | for /f "tokens=6 delims=[]. " %%G in ('ver') do set winbuild=%%G | ||
128 | |||
129 | set _NCS=1 | ||
130 | if %winbuild% LSS 10586 set _NCS=0 | ||
131 | if %winbuild% GEQ 10586 reg query "HKCU\Console" /v ForceV2 %nul2% | find /i "0x0" %nul1% && (set _NCS=0) | ||
132 | |||
133 | if %_NCS% EQU 1 ( | ||
134 | for /F %%a in ('echo prompt $E ^| cmd') do set "esc=%%a" | ||
135 | set "Red="41;97m"" | ||
136 | set "Gray="100;97m"" | ||
137 | set "Green="42;97m"" | ||
138 | set "Blue="44;97m"" | ||
139 | set "_White="40;37m"" | ||
140 | set "_Green="40;92m"" | ||
141 | set "_Yellow="40;93m"" | ||
142 | ) else ( | ||
143 | set "Red="Red" "white"" | ||
144 | set "Gray="Darkgray" "white"" | ||
145 | set "Green="DarkGreen" "white"" | ||
146 | set "Blue="Blue" "white"" | ||
147 | set "_White="Black" "Gray"" | ||
148 | set "_Green="Black" "Green"" | ||
149 | set "_Yellow="Black" "Yellow"" | ||
150 | ) | ||
151 | |||
152 | set "nceline=echo: &echo ==== ERROR ==== &echo:" | ||
153 | set "eline=echo: &call :dk_color %Red% "==== ERROR ====" &echo:" | ||
154 | if %~z0 GEQ 200000 ( | ||
155 | set "_exitmsg=Go back" | ||
156 | set "_fixmsg=Go back to Main Menu, select Troubleshoot and run Fix Licensing option." | ||
157 | ) else ( | ||
158 | set "_exitmsg=Exit" | ||
159 | set "_fixmsg=In MAS folder, run Troubleshoot script and select Fix Licensing option." | ||
160 | ) | ||
161 | |||
162 | ::======================================================================================================================================== | ||
163 | |||
164 | if %winbuild% LSS 9200 ( | ||
165 | %eline% | ||
166 | echo Unsupported OS version detected [%winbuild%]. | ||
167 | echo Ohook Activation is supported on Windows 8 and later and their server equivalent. | ||
168 | goto dk_done | ||
169 | ) | ||
170 | |||
171 | for %%# in (powershell.exe) do @if "%%~$PATH:#"=="" ( | ||
172 | %nceline% | ||
173 | echo Unable to find powershell.exe in the system. | ||
174 | goto dk_done | ||
175 | ) | ||
176 | |||
177 | ::======================================================================================================================================== | ||
178 | |||
179 | :: Fix for the special characters limitation in path name | ||
180 | |||
181 | set "_work=%~dp0" | ||
182 | if "%_work:~-1%"=="\" set "_work=%_work:~0,-1%" | ||
183 | |||
184 | set "_batf=%~f0" | ||
185 | set "_batp=%_batf:'=''%" | ||
186 | |||
187 | set _PSarg="""%~f0""" -el %_args% | ||
188 | |||
189 | set "_ttemp=%temp%" | ||
190 | |||
191 | setlocal EnableDelayedExpansion | ||
192 | |||
193 | ::======================================================================================================================================== | ||
194 | |||
195 | echo "!_batf!" | find /i "!_ttemp!" %nul1% && ( | ||
196 | if /i not "!_work!"=="!_ttemp!" ( | ||
197 | %eline% | ||
198 | echo Script is launched from the temp folder, | ||
199 | echo Most likely you are running the script directly from the archive file. | ||
200 | echo: | ||
201 | echo Extract the archive file and launch the script from the extracted folder. | ||
202 | goto dk_done | ||
203 | ) | ||
204 | ) | ||
205 | |||
206 | ::======================================================================================================================================== | ||
207 | |||
208 | :: Elevate script as admin and pass arguments and preventing loop | ||
209 | |||
210 | %nul1% fltmc || ( | ||
211 | if not defined _elev %psc% "start cmd.exe -arg '/c \"!_PSarg:'=''!\"' -verb runas" && exit /b | ||
212 | %eline% | ||
213 | echo This script require admin privileges. | ||
214 | echo To do so, right click on this script and select 'Run as administrator'. | ||
215 | goto 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 | |||
223 | if %_unattended%==1 set quedit=1 | ||
224 | for %%# in (%_args%) do (if /i "%%#"=="-qedit" set quedit=1) | ||
225 | |||
226 | reg query HKCU\Console /v QuickEdit %nul2% | find /i "0x0" %nul1% || if not defined quedit ( | ||
227 | reg add HKCU\Console /v QuickEdit /t REG_DWORD /d "0" /f %nul1% | ||
228 | start cmd.exe /c ""!_batf!" %_args% -qedit" | ||
229 | rem quickedit reset code is added at the starting of the script instead of here because it takes time to reflect in some cases | ||
230 | exit /b | ||
231 | ) | ||
232 | |||
233 | ::======================================================================================================================================== | ||
234 | |||
235 | if %_rem%==1 goto :oh_uninstall | ||
236 | |||
237 | :oh_menu | ||
238 | |||
239 | if %_unattended%==0 ( | ||
240 | cls | ||
241 | mode 76, 25 | ||
242 | title Ohook Activation | ||
243 | |||
244 | echo: | ||
245 | echo: | ||
246 | echo: | ||
247 | echo: | ||
248 | echo ____________________________________________________________ | ||
249 | echo: | ||
250 | echo [1] Install Ohook Office Activation | ||
251 | echo: | ||
252 | echo [2] Uninstall | ||
253 | echo ____________________________________________ | ||
254 | echo: | ||
255 | echo [3] Download Office | ||
256 | echo: | ||
257 | echo [0] %_exitmsg% | ||
258 | echo ____________________________________________________________ | ||
259 | echo: | ||
260 | call :dk_color2 %_White% " " %_Green% "Enter a menu option in the Keyboard [1,2,3,0]" | ||
261 | choice /C:1230 /N | ||
262 | set _el=!errorlevel! | ||
263 | if !_el!==4 exit /b | ||
264 | if !_el!==3 start https://%mas%/genuine-installation-media.html &goto :oh_menu | ||
265 | if !_el!==2 goto :oh_uninstall | ||
266 | if !_el!==1 goto :oh_menu2 | ||
267 | goto :oh_menu | ||
268 | ) | ||
269 | |||
270 | ::======================================================================================================================================== | ||
271 | |||
272 | :oh_menu2 | ||
273 | |||
274 | cls | ||
275 | mode 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 | |||
278 | title Ohook Activation | ||
279 | |||
280 | echo: | ||
281 | echo Initializing... | ||
282 | call :dk_product | ||
283 | call :dk_ckeckwmic | ||
284 | |||
285 | :: Show info for potential script stuck scenario | ||
286 | |||
287 | sc start sppsvc %nul% | ||
288 | if %errorlevel% NEQ 1056 if %errorlevel% NEQ 0 ( | ||
289 | echo: | ||
290 | echo Error code: %errorlevel% | ||
291 | call :dk_color %Red% "Failed to start [sppsvc] service, rest of the process may take a long time..." | ||
292 | echo: | ||
293 | ) | ||
294 | |||
295 | ::======================================================================================================================================== | ||
296 | |||
297 | set error= | ||
298 | |||
299 | cls | ||
300 | echo: | ||
301 | for /f "skip=2 tokens=2*" %%a in ('reg query "HKLM\SYSTEM\CurrentControlSet\Control\Session Manager\Environment" /v PROCESSOR_ARCHITECTURE') do set osarch=%%b | ||
302 | for /f "tokens=6-7 delims=[]. " %%i in ('ver') do if "%%j"=="" (set fullbuild=%%i) else (set fullbuild=%%i.%%j) | ||
303 | echo Checking OS Info [%winos% ^| %fullbuild% ^| %osarch%] | ||
304 | |||
305 | ::======================================================================================================================================== | ||
306 | |||
307 | :: Check Windows Script Host | ||
308 | |||
309 | set _WSH=1 | ||
310 | reg query "HKCU\SOFTWARE\Microsoft\Windows Script Host\Settings" /v Enabled %nul2% | find /i "0x0" %nul1% && (set _WSH=0) | ||
311 | reg query "HKLM\SOFTWARE\Microsoft\Windows Script Host\Settings" /v Enabled %nul2% | find /i "0x0" %nul1% && (set _WSH=0) | ||
312 | |||
313 | if %_WSH% EQU 0 ( | ||
314 | reg add "HKLM\Software\Microsoft\Windows Script Host\Settings" /v Enabled /t REG_DWORD /d 1 /f %nul% | ||
315 | reg add "HKCU\Software\Microsoft\Windows Script Host\Settings" /v Enabled /t REG_DWORD /d 1 /f %nul% | ||
316 | if not "%arch%"=="x86" reg add "HKLM\Software\Microsoft\Windows Script Host\Settings" /v Enabled /t REG_DWORD /d 1 /f /reg:32 %nul% | ||
317 | echo Enabling Windows Script Host [Successful] | ||
318 | ) | ||
319 | |||
320 | ::======================================================================================================================================== | ||
321 | |||
322 | echo Initiating Diagnostic Tests... | ||
323 | |||
324 | set "_serv=sppsvc Winmgmt" | ||
325 | set officeact=1 | ||
326 | call :dk_errorcheck | ||
327 | |||
328 | :: Check unsupported office versions | ||
329 | |||
330 | set o14msi= | ||
331 | set o14c2r= | ||
332 | set o16uwp= | ||
333 | |||
334 | set _68=HKLM\SOFTWARE\Microsoft\Office | ||
335 | set _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 | |||
341 | if %winbuild% GEQ 10240 %psc% "Get-AppxPackage -name "Microsoft.Office.Desktop"" | find /i "Office" %nul1% && set o16uwp=Office UWP | ||
342 | |||
343 | if not "%o14msi%%o14c2r%%o16uwp%"=="" ( | ||
344 | echo: | ||
345 | set error=1 | ||
346 | call :dk_color %Red% "Checking Unsupported Office Install [ %o14msi%%o14c2r%%o16uwp%]" | ||
347 | ) | ||
348 | |||
349 | ::======================================================================================================================================== | ||
350 | |||
351 | :: Check supported office versions | ||
352 | |||
353 | call :oh_getpath | ||
354 | |||
355 | sc query ClickToRunSvc %nul% | ||
356 | set error1=%errorlevel% | ||
357 | |||
358 | if defined o16c2r if %error1% EQU 1060 ( | ||
359 | call :dk_color %Red% "Checking ClickToRun Service [Not found, Office 16.0 files found]" | ||
360 | set o16c2r= | ||
361 | set error=1 | ||
362 | ) | ||
363 | |||
364 | sc query OfficeSvc %nul% | ||
365 | set error2=%errorlevel% | ||
366 | |||
367 | if defined o15c2r if %error1% EQU 1060 if %error2% EQU 1060 ( | ||
368 | call :dk_color %Red% "Checking ClickToRun Service [Not found, Office 15.0 files found]" | ||
369 | set o15c2r= | ||
370 | set error=1 | ||
371 | ) | ||
372 | |||
373 | if "%o16c2r%%o15c2r%%o16msi%%o15msi%"=="" ( | ||
374 | set error=1 | ||
375 | echo: | ||
376 | if not "%o14msi%%o14c2r%%o16uwp%"=="" ( | ||
377 | call :dk_color %Red% "Checking Supported Office Install [Not Found]" | ||
378 | ) else ( | ||
379 | call :dk_color %Red% "Checking Installed Office [Not Found]" | ||
380 | ) | ||
381 | |||
382 | if %winbuild% GEQ 10240 %psc% "Get-AppxPackage -name "Microsoft.MicrosoftOfficeHub"" | find /i "Office" %nul1% && ( | ||
383 | echo: | ||
384 | echo You have only Office dashboard app installed, you need to install full Office version. | ||
385 | ) | ||
386 | echo: | ||
387 | call :dk_color %Blue% "Download and install Office from below URL and try again." | ||
388 | echo: | ||
389 | echo https://%mas%/genuine-installation-media.html | ||
390 | goto dk_done | ||
391 | ) | ||
392 | |||
393 | set multioffice= | ||
394 | if not "%o16c2r%%o15c2r%%o16msi%%o15msi%"=="1" set multioffice=1 | ||
395 | if not "%o14msi%%o14c2r%%o16uwp%"=="" set multioffice=1 | ||
396 | |||
397 | if defined multioffice ( | ||
398 | call :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 | |||
405 | if not defined o15c2r goto :starto16c2r | ||
406 | |||
407 | call :oh_reset | ||
408 | call :oh_actids | ||
409 | |||
410 | set oVer=15 | ||
411 | for /f "skip=2 tokens=2*" %%a in ('"reg query %o15c2r_reg% /v InstallPath" %nul6%') do (set "_oRoot=%%b\root") | ||
412 | for /f "skip=2 tokens=2*" %%a in ('"reg query %o15c2r_reg%\Configuration /v Platform" %nul6%') do (set "_oArch=%%b") | ||
413 | if not defined _oArch for /f "skip=2 tokens=2*" %%a in ('"reg query %o15c2r_reg%\propertyBag /v Platform" %nul6%') do (set "_oArch=%%b") | ||
414 | |||
415 | echo "%o15c2r_reg%" | find /i "Wow6432Node" %nul1% && (set _tok=10) || (set _tok=9) | ||
416 | for /f "tokens=%_tok% delims=\" %%a in ('reg query %o15c2r_reg%\ProductReleaseIDs\Active %nul6% ^| findstr /i "Retail Volume"') do ( | ||
417 | if not defined _oIds (set "_oIds=%%a") else (set "_oIds=!_oIds! %%a") | ||
418 | ) | ||
419 | |||
420 | set "_oLPath=%_oRoot%\Licenses" | ||
421 | |||
422 | if [%_oArch%]==[x64] (set "_hookPath=%_oRoot%\vfs\System" & set "_hook=sppc64.dll") | ||
423 | if [%_oArch%]==[x86] (set "_hookPath=%_oRoot%\vfs\SystemX86" & set "_hook=sppc32.dll") | ||
424 | if not [%osarch%]==[x86] ( | ||
425 | if [%_oArch%]==[x64] set "_sppcPath=%SystemRoot%\System32\sppc.dll" | ||
426 | if [%_oArch%]==[x86] set "_sppcPath=%SystemRoot%\SysWOW64\sppc.dll" | ||
427 | ) else ( | ||
428 | set "_sppcPath=%SystemRoot%\System32\sppc.dll" | ||
429 | ) | ||
430 | |||
431 | echo: | ||
432 | echo Activating Office 15.0 %_oArch% C2R... | ||
433 | |||
434 | if not defined _oIds ( | ||
435 | call :dk_color %Red% "Checking Installed Products [Product IDs not found. Aborting activation...]" | ||
436 | set error=1 | ||
437 | goto :starto16c2r | ||
438 | ) | ||
439 | |||
440 | call :oh_process | ||
441 | call :oh_hookinstall | ||
442 | |||
443 | ::======================================================================================================================================== | ||
444 | |||
445 | :starto16c2r | ||
446 | |||
447 | :: Process Office 16.0 C2R | ||
448 | |||
449 | if not defined o16c2r goto :startmsi | ||
450 | |||
451 | call :oh_reset | ||
452 | call :oh_actids | ||
453 | |||
454 | set oVer=16 | ||
455 | for /f "skip=2 tokens=2*" %%a in ('"reg query %o16c2r_reg% /v InstallPath" %nul6%') do (set "_oRoot=%%b\root") | ||
456 | for /f "skip=2 tokens=2*" %%a in ('"reg query %o16c2r_reg%\Configuration /v Platform" %nul6%') do (set "_oArch=%%b") | ||
457 | |||
458 | echo "%o16c2r_reg%" | find /i "Wow6432Node" %nul1% && (set _tok=9) || (set _tok=8) | ||
459 | for /f "tokens=%_tok% delims=\" %%a in ('reg query "%o16c2r_reg%\ProductReleaseIDs" /s /f ".16" /k %nul6% ^| findstr /i "Retail Volume"') do ( | ||
460 | if not defined _oIds (set "_oIds=%%a") else (set "_oIds=!_oIds! %%a") | ||
461 | ) | ||
462 | set _oIds=%_oIds:.16=% | ||
463 | |||
464 | set "_oLPath=%_oRoot%\Licenses16" | ||
465 | |||
466 | if [%_oArch%]==[x64] (set "_hookPath=%_oRoot%\vfs\System" & set "_hook=sppc64.dll") | ||
467 | if [%_oArch%]==[x86] (set "_hookPath=%_oRoot%\vfs\SystemX86" & set "_hook=sppc32.dll") | ||
468 | if not [%osarch%]==[x86] ( | ||
469 | if [%_oArch%]==[x64] set "_sppcPath=%SystemRoot%\System32\sppc.dll" | ||
470 | if [%_oArch%]==[x86] set "_sppcPath=%SystemRoot%\SysWOW64\sppc.dll" | ||
471 | ) else ( | ||
472 | set "_sppcPath=%SystemRoot%\System32\sppc.dll" | ||
473 | ) | ||
474 | |||
475 | echo: | ||
476 | echo Activating Office 16.0 %_oArch% C2R... | ||
477 | |||
478 | if not defined _oIds ( | ||
479 | call :dk_color %Red% "Checking Installed Products [Product IDs not found. Aborting activation...]" | ||
480 | set error=1 | ||
481 | goto :startmsi | ||
482 | ) | ||
483 | |||
484 | call :oh_process | ||
485 | call :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 | |||
491 | set sub_next= | ||
492 | set kNext=HKCU\SOFTWARE\Microsoft\Office\16.0\Common\Licensing | ||
493 | |||
494 | reg query %kNext%\LicensingNext /v MigrationToV5Done %nul2% | find /i "0x1" %nul% && ( | ||
495 | reg query %kNext%\LicensingNext %nul2% | findstr /i "volume retail" %nul2% | findstr /i "0x2 0x3" %nul% && ( | ||
496 | set sub_next=1 | ||
497 | reg delete %kNext% /f %nul% | ||
498 | ) | ||
499 | ) | ||
500 | |||
501 | if defined sub_next ( | ||
502 | reg query %kNext%\LicensingNext %nul% && ( | ||
503 | call :dk_color %Red% "Removing Office vNext Block [Failed]" | ||
504 | ) || ( | ||
505 | echo 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 | |||
514 | echo "%_lic%" | find /i "Subscription" %nul% && ( | ||
515 | echo Adding a Reg To Skip License Check [Successful] | ||
516 | reg 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 | |||
525 | echo "%_oIds%" | find /i "Volume" %nul1% && ( | ||
526 | if %winbuild% GEQ 9200 ( | ||
527 | if not [%osarch%]==[x86] ( | ||
528 | reg delete "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\SoftwareProtectionPlatform\0ff1ce15-a989-479d-af46-f275c6370663" /f /reg:32 %nul% | ||
529 | reg 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 | ) | ||
531 | reg delete "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\SoftwareProtectionPlatform\0ff1ce15-a989-479d-af46-f275c6370663" /f %nul% | ||
532 | reg 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% | ||
533 | echo Adding a Reg To Prevent Banner [Successful] | ||
534 | ) | ||
535 | ) | ||
536 | |||
537 | ::======================================================================================================================================== | ||
538 | |||
539 | :startmsi | ||
540 | |||
541 | if defined o15msi call :oh_processmsi 15 %o15msi_reg% | ||
542 | if defined o16msi call :oh_processmsi 16 %o16msi_reg% | ||
543 | |||
544 | ::======================================================================================================================================== | ||
545 | |||
546 | :: Uninstall other / grace Keys | ||
547 | |||
548 | set upk_result=0 | ||
549 | set allapplist= | ||
550 | |||
551 | if %_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%')" | ||
552 | if %_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 | |||
555 | for %%# in (%allapplist%) do ( | ||
556 | echo "%_allactid%" | find /i "%%#" %nul1% || ( | ||
557 | cscript //nologo %windir%\system32\slmgr.vbs /upk %%# %nul% && ( | ||
558 | set upk_result=1 | ||
559 | ) || ( | ||
560 | set error=1 | ||
561 | set upk_result=2 | ||
562 | ) | ||
563 | ) | ||
564 | ) | ||
565 | |||
566 | if not %upk_result%==0 echo: | ||
567 | if %upk_result%==1 echo Uninstalling Other/Grace Keys [Successful] | ||
568 | if %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 | |||
575 | if exist "%windir%\system32\spp\store_test\2.0\tokens.dat" ( | ||
576 | cscript //nologo %windir%\system32\slmgr.vbs /rilc %nul% | ||
577 | if !errorlevel! NEQ 0 cscript //nologo %windir%\system32\slmgr.vbs /rilc %nul% | ||
578 | ) | ||
579 | |||
580 | ::======================================================================================================================================== | ||
581 | |||
582 | echo: | ||
583 | if not defined error ( | ||
584 | call :dk_color %Green% "Office is permanently activated." | ||
585 | echo Help: https://%mas%/troubleshoot | ||
586 | ) else ( | ||
587 | call :dk_color %Red% "Some errors were detected." | ||
588 | if not defined ierror if not defined showfix if not defined serv_cor if not defined serv_cste call :dk_color %Blue% "%_fixmsg%" | ||
589 | echo: | ||
590 | call :dk_color2 %Blue% "Check this page for help" %_Yellow% " https://%mas%/troubleshoot" | ||
591 | ) | ||
592 | |||
593 | goto :dk_done | ||
594 | |||
595 | ::======================================================================================================================================== | ||
596 | |||
597 | :oh_uninstall | ||
598 | |||
599 | cls | ||
600 | mode 99, 28 | ||
601 | title Uninstall Ohook Activation | ||
602 | |||
603 | set _present= | ||
604 | set _unerror= | ||
605 | call :oh_reset | ||
606 | call :oh_getpath | ||
607 | |||
608 | echo: | ||
609 | echo Uninstalling Ohook Activation... | ||
610 | echo: | ||
611 | |||
612 | if defined o16c2r_reg (for /f "skip=2 tokens=2*" %%a in ('"reg query %o16c2r_reg% /v InstallPath" %nul6%') do (set "_16CHook=%%b\root\vfs")) | ||
613 | if defined o15c2r_reg (for /f "skip=2 tokens=2*" %%a in ('"reg query %o15c2r_reg% /v InstallPath" %nul6%') do (set "_15CHook=%%b\root\vfs")) | ||
614 | if defined o16msi_reg (for /f "skip=2 tokens=2*" %%a in ('"reg query %o16msi_reg%\Common\InstallRoot /v Path" %nul6%') do (set "_16MHook=%%b")) | ||
615 | if defined o15msi_reg (for /f "skip=2 tokens=2*" %%a in ('"reg query %o15msi_reg%\Common\InstallRoot /v Path" %nul6%') do (set "_15MHook=%%b")) | ||
616 | |||
617 | if defined _16CHook (if exist "%_16CHook%\System\sppc*dll" (set _present=1& del /s /f /q "%_16CHook%\System\sppc*dll" & if exist "%_16CHook%\System\sppc*dll" set _unerror=1)) | ||
618 | if defined _16CHook (if exist "%_16CHook%\SystemX86\sppc*dll" (set _present=1& del /s /f /q "%_16CHook%\SystemX86\sppc*dll" & if exist "%_16CHook%\SystemX86\sppc*dll" set _unerror=1)) | ||
619 | if 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)) | ||
620 | if defined _15CHook (if exist "%_15CHook%\SystemX86\sppc*dll" (set _present=1& del /s /f /q "%_15CHook%\SystemX86\sppc*dll" & if exist "%_15CHook%\SystemX86\sppc*dll" set _unerror=1)) | ||
621 | if defined _16MHook (if exist "%_16MHook%sppc*dll" (set _present=1& del /s /f /q "%_16MHook%sppc*dll" & if exist "%_16MHook%sppc*dll" set _unerror=1)) | ||
622 | if defined _15MHook (if exist "%_15MHook%sppc*dll" (set _present=1& del /s /f /q "%_15MHook%sppc*dll" & if exist "%_15MHook%sppc*dll" set _unerror=1)) | ||
623 | |||
624 | for %%# in (15 16) do ( | ||
625 | for %%A in ("%ProgramFiles%" "%ProgramW6432%" "%ProgramFiles(x86)%") do ( | ||
626 | if exist "%%~A\Microsoft Office\Office%%#\sppc*dll" (set _present=1& del /s /f /q "%%~A\Microsoft Office\Office%%#\sppc*dll" & if exist "%%~A\Microsoft Office\Office%%#\sppc*dll" set _unerror=1) | ||
627 | ) | ||
628 | ) | ||
629 | |||
630 | for %%# in (System SystemX86) do ( | ||
631 | for %%G in ("Office 15" "Office") do ( | ||
632 | for %%A in ("%ProgramFiles%" "%ProgramW6432%" "%ProgramFiles(x86)%") do ( | ||
633 | if 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 | |||
638 | reg query HKCU\Software\Microsoft\Office\16.0\Common\Licensing\Resiliency /s %nul2% | find /i "2033" %nul% && ( | ||
639 | echo: | ||
640 | echo Deleting - HKCU\Software\Microsoft\Office\16.0\Common\Licensing\Resiliency | ||
641 | reg delete HKCU\Software\Microsoft\Office\16.0\Common\Licensing\Resiliency /f | ||
642 | ) | ||
643 | |||
644 | reg query "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\SoftwareProtectionPlatform\0ff1ce15-a989-479d-af46-f275c6370663" %nul% && ( | ||
645 | echo: | ||
646 | echo Deleting - Registry key to prevent non-genuine banner | ||
647 | reg delete "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\SoftwareProtectionPlatform\0ff1ce15-a989-479d-af46-f275c6370663" /f | ||
648 | ) | ||
649 | |||
650 | reg query "HKLM\SOFTWARE\Wow6432Node\Microsoft\Windows NT\CurrentVersion\SoftwareProtectionPlatform\0ff1ce15-a989-479d-af46-f275c6370663" %nul% && ( | ||
651 | reg delete "HKLM\SOFTWARE\Wow6432Node\Microsoft\Windows NT\CurrentVersion\SoftwareProtectionPlatform\0ff1ce15-a989-479d-af46-f275c6370663" /f | ||
652 | ) | ||
653 | |||
654 | echo __________________________________________________________________________________________ | ||
655 | echo: | ||
656 | |||
657 | if not defined _present ( | ||
658 | echo Ohook Activation is not installed. | ||
659 | ) else ( | ||
660 | if defined _unerror ( | ||
661 | call :dk_color %Red% "Failed to uninstall Ohook activation." | ||
662 | call :dk_color %Blue% "Close Office apps if they are running and try again." | ||
663 | ) else ( | ||
664 | call :dk_color %Green% "Successfully uninstalled Ohook activation." | ||
665 | ) | ||
666 | ) | ||
667 | echo __________________________________________________________________________________________ | ||
668 | |||
669 | goto :dk_done | ||
670 | |||
671 | ::======================================================================================================================================== | ||
672 | |||
673 | :oh_reset | ||
674 | |||
675 | set _oRoot= | ||
676 | set _oArch= | ||
677 | set _oIds= | ||
678 | set _oLPath= | ||
679 | set _hookPath= | ||
680 | set _hook= | ||
681 | set _sppcPath= | ||
682 | set _key= | ||
683 | set _actid= | ||
684 | set _prod= | ||
685 | set _lic= | ||
686 | set _License= | ||
687 | exit /b | ||
688 | |||
689 | ::======================================================================================================================================== | ||
690 | |||
691 | :oh_getpath | ||
692 | |||
693 | set o16c2r= | ||
694 | set o15c2r= | ||
695 | set o16msi= | ||
696 | set o15msi= | ||
697 | |||
698 | set _68=HKLM\SOFTWARE\Microsoft\Office | ||
699 | set _86=HKLM\SOFTWARE\Wow6432Node\Microsoft\Office | ||
700 | |||
701 | for /f "skip=2 tokens=2*" %%a in ('"reg query %_86%\ClickToRun /v InstallPath" %nul6%') do if exist "%%b\root\Licenses16\ProPlus*.xrm-ms" (set o16c2r=1&set o16c2r_reg=%_86%\ClickToRun) | ||
702 | for /f "skip=2 tokens=2*" %%a in ('"reg query %_68%\ClickToRun /v InstallPath" %nul6%') do if exist "%%b\root\Licenses16\ProPlus*.xrm-ms" (set o16c2r=1&set o16c2r_reg=%_68%\ClickToRun) | ||
703 | for /f "skip=2 tokens=2*" %%a in ('"reg query %_86%\15.0\ClickToRun /v InstallPath" %nul6%') do if exist "%%b\root\Licenses\ProPlus*.xrm-ms" (set o15c2r=1&set o15c2r_reg=%_86%\15.0\ClickToRun) | ||
704 | for /f "skip=2 tokens=2*" %%a in ('"reg query %_68%\15.0\ClickToRun /v InstallPath" %nul6%') do if exist "%%b\root\Licenses\ProPlus*.xrm-ms" (set o15c2r=1&set o15c2r_reg=%_68%\15.0\ClickToRun) | ||
705 | |||
706 | for /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) | ||
707 | for /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) | ||
708 | for /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) | ||
709 | for /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 | |||
711 | exit /b | ||
712 | |||
713 | ::======================================================================================================================================== | ||
714 | |||
715 | :oh_installkey | ||
716 | |||
717 | if %_wmic% EQU 1 wmic path SoftwareLicensingService where __CLASS='SoftwareLicensingService' call InstallProductKey ProductKey="%_key%" %nul% | ||
718 | if %_wmic% EQU 0 %psc% "(([WMISEARCHER]'SELECT Version FROM SoftwareLicensingService').Get()).InstallProductKey('%_key%')" %nul% | ||
719 | if not %errorlevel%==0 cscript //nologo %windir%\system32\slmgr.vbs /ipk %_key% %nul% | ||
720 | set errorcode=%errorlevel% | ||
721 | cmd /c exit /b %errorcode% | ||
722 | if %errorcode% NEQ 0 set "errorcode=[0x%=ExitCode%]" | ||
723 | |||
724 | if %errorcode% EQU 0 ( | ||
725 | call :dk_refresh | ||
726 | echo Installing Generic Product Key [%_key%] [%_prod%] [%_lic%] [Successful] | ||
727 | ) else ( | ||
728 | call :dk_color %Red% "Installing Generic Product Key [%_key%] [%_prod%] [%_lic%] [Failed] %errorcode%" | ||
729 | if not defined error ( | ||
730 | call :dk_color %Blue% "%_fixmsg%" | ||
731 | set showfix=1 | ||
732 | ) | ||
733 | set error=1 | ||
734 | ) | ||
735 | |||
736 | exit /b | ||
737 | |||
738 | ::======================================================================================================================================== | ||
739 | |||
740 | :oh_installlic | ||
741 | |||
742 | if not defined _oLPath exit /b | ||
743 | |||
744 | set _License=%_prod:Retail=R_% | ||
745 | set _License=%_License:Volume=VL_% | ||
746 | |||
747 | for %%# in ("!_oLPath!\client-issuance-*.xrm-ms") do ( | ||
748 | cscript //nologo %windir%\system32\slmgr.vbs /ilc "!_oLPath!\%%~nx#" %nul% | ||
749 | ) | ||
750 | cscript //nologo %windir%\system32\slmgr.vbs /ilc "!_oLPath!\pkeyconfig-office.xrm-ms" %nul% | ||
751 | |||
752 | for %%# in ("!_oLPath!\%_License%*.xrm-ms") do ( | ||
753 | cscript //nologo %windir%\system32\slmgr.vbs /ilc "!_oLPath!\%%~nx#" %nul% | ||
754 | ) | ||
755 | |||
756 | call :oh_actids | ||
757 | |||
758 | echo "!oapplist!" | find /i "!_actid!" %nul1% && ( | ||
759 | call :dk_color %Gray% "Installing Missing License Files [Office %oVer%.0 %_prod%] [Successful]" | ||
760 | ) || ( | ||
761 | set error=1 | ||
762 | call :dk_color %Red% "Installing Missing License Files [Office %oVer%.0 %_prod%] [Failed]" | ||
763 | ) | ||
764 | |||
765 | exit /b | ||
766 | |||
767 | ::======================================================================================================================================== | ||
768 | |||
769 | :oh_hookinstall | ||
770 | |||
771 | set ierror= | ||
772 | set hasherror= | ||
773 | |||
774 | del /s /q "%_hookPath%\sppcs.dll" %nul% | ||
775 | del /s /q "%_hookPath%\sppc.dll" %nul% | ||
776 | |||
777 | if exist "%_hookPath%\sppcs.dll" set ierror=1 | ||
778 | if exist "%_hookPath%\sppc.dll" set ierror=1 | ||
779 | |||
780 | mklink "%_hookPath%\sppcs.dll" "%_sppcPath%" %nul% | ||
781 | if not %errorlevel%==0 set ierror=1 | ||
782 | |||
783 | if not exist "%_hookPath%\sppc.dll" call :oh_extractdll "%_hookPath%\sppc.dll" | ||
784 | if not exist "%_hookPath%\sppc.dll" set ierror=1 | ||
785 | |||
786 | echo: | ||
787 | if not defined ierror ( | ||
788 | echo Symlinking System's sppc.dll To ["%_hookPath%\sppcs.dll"] [Successful] | ||
789 | echo Extracting Custom %_hook% To ["%_hookPath%\sppc.dll"] [Successful] | ||
790 | ) else ( | ||
791 | set error=1 | ||
792 | call :dk_color %Red% "Symlinking Systems sppc.dll [Failed]" | ||
793 | call :dk_color %Red% "Extracting Custom %_hook% [Failed]" | ||
794 | echo ["%_hookPath%\sppc.dll"] | ||
795 | call :dk_color %Blue% "Close Office apps if they are running and try again." | ||
796 | ) | ||
797 | |||
798 | if not defined ierror ( | ||
799 | if defined hasherror ( | ||
800 | set error=1 | ||
801 | set ierror=1 | ||
802 | call :dk_color %Red% "Modifying Hash of Custom %_hook% [Failed]" | ||
803 | ) else ( | ||
804 | echo Modifying Hash of Custom %_hook% [Successful] | ||
805 | ) | ||
806 | ) | ||
807 | |||
808 | exit /b | ||
809 | |||
810 | ::======================================================================================================================================== | ||
811 | |||
812 | :oh_process | ||
813 | |||
814 | for %%# in (%_oIds%) do ( | ||
815 | set _key= | ||
816 | set _actid= | ||
817 | set _lic= | ||
818 | set _prod=%%# | ||
819 | |||
820 | call :ohookdata getinfo %%# | ||
821 | |||
822 | if not [!_key!]==[] ( | ||
823 | echo "!oapplist!" | find /i "!_actid!" %nul1% || call :oh_installlic | ||
824 | call :oh_installkey | ||
825 | ) else ( | ||
826 | set error=1 | ||
827 | call :dk_color %Red% "Checking Product In Script [Office %oVer%.0 %%# not found in script]" | ||
828 | echo Make sure you are using Latest MAS script. | ||
829 | ) | ||
830 | ) | ||
831 | |||
832 | exit /b | ||
833 | |||
834 | ::======================================================================================================================================== | ||
835 | |||
836 | :oh_msiproducts | ||
837 | |||
838 | set msitemp=%SystemRoot%\Temp\_msitemp.txt | ||
839 | |||
840 | if %oVer%==15 set _psmsikey=%o15msi_reg:HKLM\=HKLM:% | ||
841 | if %oVer%==16 set _psmsikey=%o16msi_reg:HKLM\=HKLM:% | ||
842 | |||
843 | if 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 | |||
846 | if exist %msitemp% call :ohookdata getmsiprod | ||
847 | if exist %msitemp% del /f /q %msitemp% | ||
848 | |||
849 | exit /b | ||
850 | |||
851 | ::======================================================================================================================================== | ||
852 | |||
853 | :oh_processmsi | ||
854 | |||
855 | :: Process Office MSI Version | ||
856 | |||
857 | call :oh_reset | ||
858 | call :oh_actids | ||
859 | |||
860 | set oVer=%1 | ||
861 | for /f "skip=2 tokens=2*" %%a in ('"reg query %2\Common\InstallRoot /v Path" %nul6%') do (set "_oRoot=%%b") | ||
862 | if "%_oRoot:~-1%"=="\" set "_oRoot=%_oRoot:~0,-1%" | ||
863 | |||
864 | echo "%2" | find /i "Wow6432Node" %nul1% && set _oArch=x86 | ||
865 | if not [%osarch%]==[x86] if not defined _oArch set _oArch=x64 | ||
866 | if [%osarch%]==[x86] set _oArch=x86 | ||
867 | |||
868 | if [%_oArch%]==[x64] (set "_hookPath=%_oRoot%" & set "_hook=sppc64.dll") | ||
869 | if [%_oArch%]==[x86] (set "_hookPath=%_oRoot%" & set "_hook=sppc32.dll") | ||
870 | if not [%osarch%]==[x86] ( | ||
871 | if [%_oArch%]==[x64] set "_sppcPath=%SystemRoot%\System32\sppc.dll" | ||
872 | if [%_oArch%]==[x86] set "_sppcPath=%SystemRoot%\SysWOW64\sppc.dll" | ||
873 | ) else ( | ||
874 | set "_sppcPath=%SystemRoot%\System32\sppc.dll" | ||
875 | ) | ||
876 | |||
877 | call :oh_msiproducts | ||
878 | |||
879 | echo: | ||
880 | echo Activating Office %1.0 %_oArch% MSI... | ||
881 | |||
882 | if not defined _oIds ( | ||
883 | set error=1 | ||
884 | call :dk_color %Red% "Checking Installed Products [Product IDs not found. Aborting activation...]" | ||
885 | exit /b | ||
886 | ) | ||
887 | |||
888 | call :oh_process | ||
889 | call :oh_hookinstall | ||
890 | |||
891 | exit /b | ||
892 | |||
893 | ::======================================================================================================================================== | ||
894 | |||
895 | :: Refresh license status | ||
896 | |||
897 | :dk_refresh | ||
898 | |||
899 | if %_wmic% EQU 1 wmic path SoftwareLicensingService where __CLASS='SoftwareLicensingService' call RefreshLicenseStatus %nul% | ||
900 | if %_wmic% EQU 0 %psc% "$null=(([WMICLASS]'SoftwareLicensingService').GetInstances()).RefreshLicenseStatus()" %nul% | ||
901 | exit /b | ||
902 | |||
903 | :: Get Windows Activation IDs | ||
904 | |||
905 | :dk_actids | ||
906 | |||
907 | set applist= | ||
908 | if %_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%')" | ||
909 | if %_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")) | ||
911 | exit /b | ||
912 | |||
913 | :: Get Office Activation IDs | ||
914 | |||
915 | :oh_actids | ||
916 | |||
917 | set oapplist= | ||
918 | if %_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%')" | ||
919 | if %_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")) | ||
921 | exit /b | ||
922 | |||
923 | :: Check wmic.exe | ||
924 | |||
925 | :dk_ckeckwmic | ||
926 | |||
927 | set _wmic=0 | ||
928 | for %%# in (wmic.exe) do @if not "%%~$PATH:#"=="" ( | ||
929 | wmic path Win32_ComputerSystem get CreationClassName /value %nul2% | find /i "computersystem" %nul1% && set _wmic=1 | ||
930 | ) | ||
931 | exit /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 | |||
937 | call :dk_reflection | ||
938 | |||
939 | set d1=%ref% $meth = $TypeBuilder.DefinePInvokeMethod('BrandingFormatString', 'winbrand.dll', 'Public, Static', 1, [String], @([String]), 1, 3); | ||
940 | set d1=%d1% $meth.SetImplementationFlags(128); $TypeBuilder.CreateType()::BrandingFormatString('%%WINDOWS_LONG%%') | ||
941 | |||
942 | set winos= | ||
943 | for /f "delims=" %%s in ('"%psc% %d1%"') do if not errorlevel 1 (set winos=%%s) | ||
944 | echo "%winos%" | find /i "Windows" %nul1% || ( | ||
945 | for /f "skip=2 tokens=2*" %%a in ('reg query "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion" /v ProductName %nul6%') do set "winos=%%b" | ||
946 | if %winbuild% GEQ 22000 ( | ||
947 | set winos=!winos:Windows 10=Windows 11! | ||
948 | ) | ||
949 | ) | ||
950 | exit /b | ||
951 | |||
952 | :: Common lines used in PowerShell reflection code | ||
953 | |||
954 | :dk_reflection | ||
955 | |||
956 | set ref=$AssemblyBuilder = [AppDomain]::CurrentDomain.DefineDynamicAssembly(4, 1); | ||
957 | set ref=%ref% $ModuleBuilder = $AssemblyBuilder.DefineDynamicModule(2, $False); | ||
958 | set ref=%ref% $TypeBuilder = $ModuleBuilder.DefineType(0); | ||
959 | exit /b | ||
960 | |||
961 | ::======================================================================================================================================== | ||
962 | |||
963 | :dk_errorcheck | ||
964 | |||
965 | set showfix= | ||
966 | |||
967 | :: Check corrupt services | ||
968 | |||
969 | set serv_cor= | ||
970 | for %%# in (%_serv%) do ( | ||
971 | set _corrupt= | ||
972 | sc start %%# %nul% | ||
973 | if !errorlevel! EQU 1060 set _corrupt=1 | ||
974 | sc query %%# %nul% || set _corrupt=1 | ||
975 | for %%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) | ||
976 | if defined _corrupt (if defined serv_cor (set "serv_cor=!serv_cor! %%#") else (set "serv_cor=%%#")) | ||
977 | ) | ||
978 | |||
979 | if defined serv_cor ( | ||
980 | set error=1 | ||
981 | call :dk_color %Red% "Checking Corrupt Services [%serv_cor%]" | ||
982 | ) | ||
983 | |||
984 | ::======================================================================================================================================== | ||
985 | |||
986 | :: Check disabled services | ||
987 | |||
988 | set serv_ste= | ||
989 | for %%# in (%_serv%) do ( | ||
990 | sc start %%# %nul% | ||
991 | if !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 | |||
996 | set serv_csts= | ||
997 | set serv_cste= | ||
998 | |||
999 | if defined serv_ste ( | ||
1000 | for %%# in (%serv_ste%) do ( | ||
1001 | if /i %%#==ClipSVC (reg add "HKLM\SYSTEM\CurrentControlSet\Services\%%#" /v "Start" /t REG_DWORD /d "3" /f %nul% & sc config %%# start= demand %nul%) | ||
1002 | if /i %%#==wlidsvc sc config %%# start= demand %nul% | ||
1003 | if /i %%#==sppsvc (reg add "HKLM\SYSTEM\CurrentControlSet\Services\%%#" /v "Start" /t REG_DWORD /d "2" /f %nul% & sc config %%# start= delayed-auto %nul%) | ||
1004 | if /i %%#==KeyIso sc config %%# start= demand %nul% | ||
1005 | if /i %%#==LicenseManager sc config %%# start= demand %nul% | ||
1006 | if /i %%#==Winmgmt sc config %%# start= auto %nul% | ||
1007 | if /i %%#==wuauserv sc config %%# start= demand %nul% | ||
1008 | if !errorlevel!==0 ( | ||
1009 | if defined serv_csts (set "serv_csts=!serv_csts! %%#") else (set "serv_csts=%%#") | ||
1010 | ) else ( | ||
1011 | if defined serv_cste (set "serv_cste=!serv_cste! %%#") else (set "serv_cste=%%#") | ||
1012 | ) | ||
1013 | ) | ||
1014 | ) | ||
1015 | |||
1016 | if defined serv_csts call :dk_color %Gray% "Enabling Disabled Services [Successful] [%serv_csts%]" | ||
1017 | |||
1018 | if defined serv_cste ( | ||
1019 | set error=1 | ||
1020 | call :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 | |||
1028 | set serv_e= | ||
1029 | for %%# in (%_serv%) do ( | ||
1030 | set errorcode= | ||
1031 | set checkerror= | ||
1032 | net start %%# /y %nul% | ||
1033 | set errorcode=!errorlevel! | ||
1034 | sc query %%# | find /i "RUNNING" %nul% || set checkerror=1 | ||
1035 | |||
1036 | sc start %%# %nul% | ||
1037 | if !errorlevel! NEQ 1056 if !errorlevel! NEQ 0 (set errorcode=!errorlevel!&set checkerror=1) | ||
1038 | if defined checkerror if defined serv_e (set "serv_e=!serv_e!, %%#-!errorcode!") else (set "serv_e=%%#-!errorcode!") | ||
1039 | ) | ||
1040 | |||
1041 | if defined serv_e ( | ||
1042 | set error=1 | ||
1043 | call :dk_color %Red% "Starting Services [Failed] [%serv_e%]" | ||
1044 | echo %serv_e% | findstr /i "ClipSVC-1058 sppsvc-1058" %nul% && ( | ||
1045 | call :dk_color %Blue% "Restart the system to fix disabled service error 1058." | ||
1046 | set showfix=1 | ||
1047 | ) | ||
1048 | ) | ||
1049 | |||
1050 | ::======================================================================================================================================== | ||
1051 | |||
1052 | :: Various error checks | ||
1053 | |||
1054 | if defined safeboot_option ( | ||
1055 | set error=1 | ||
1056 | set showfix=1 | ||
1057 | call :dk_color2 %Red% "Checking Boot Mode " %Blue% "[System is running in safe mode. Run in normal mode.]" | ||
1058 | ) | ||
1059 | |||
1060 | |||
1061 | reg query "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Setup\State" %nul2% | find /i "IMAGE_STATE_COMPLETE" %nul1% || ( | ||
1062 | set error=1 | ||
1063 | set showfix=1 | ||
1064 | call :dk_color2 %Red% "Checking Audit Mode " %Blue% "[IMAGE_STATE_COMPLETE status not found. Run in normal mode.]" | ||
1065 | ) | ||
1066 | |||
1067 | |||
1068 | reg query "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\WinPE" /v InstRoot %nul% && ( | ||
1069 | set error=1 | ||
1070 | set showfix=1 | ||
1071 | call :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% || ( | ||
1076 | set error=1 | ||
1077 | call :dk_color %Red% "Checking Powershell [Not Responding]" | ||
1078 | ) | ||
1079 | |||
1080 | |||
1081 | DISM /English /Online /Get-CurrentEdition %nul% | ||
1082 | set dism_error=%errorlevel% | ||
1083 | cmd /c exit /b %dism_error% | ||
1084 | if %dism_error% NEQ 0 set "dism_error=[0x%=ExitCode%]" | ||
1085 | if %dism_error% NEQ 0 ( | ||
1086 | call :dk_color %Red% "Checking DISM [Not Responding] %dism_error%" | ||
1087 | ) | ||
1088 | |||
1089 | |||
1090 | cscript //nologo %windir%\system32\slmgr.vbs /dlv %nul% | ||
1091 | set error_code=%errorlevel% | ||
1092 | cmd /c exit /b %error_code% | ||
1093 | if %error_code% NEQ 0 set "error_code=0x%=ExitCode%" | ||
1094 | if %error_code% NEQ 0 ( | ||
1095 | set error=1 | ||
1096 | call :dk_color %Red% "Checking slmgr /dlv [Not Responding] %error_code%" | ||
1097 | ) | ||
1098 | |||
1099 | |||
1100 | for %%# in (wmic.exe) do @if "%%~$PATH:#"=="" ( | ||
1101 | call :dk_color %Gray% "Checking WMIC.exe [Not Found]" | ||
1102 | ) | ||
1103 | |||
1104 | |||
1105 | set wmifailed= | ||
1106 | if %_wmic% EQU 1 wmic path Win32_ComputerSystem get CreationClassName /value %nul2% | find /i "computersystem" %nul1% | ||
1107 | if %_wmic% EQU 0 %psc% "Get-CIMInstance -Class Win32_ComputerSystem | Select-Object -Property CreationClassName" %nul2% | find /i "computersystem" %nul1% | ||
1108 | |||
1109 | if %errorlevel% NEQ 0 set wmifailed=1 | ||
1110 | echo "%error_code%" | findstr /i "0x800410 0x800440" %nul1% && set wmifailed=1& :: https://learn.microsoft.com/en-us/windows/win32/wmisdk/wmi-error-constants | ||
1111 | if defined wmifailed ( | ||
1112 | set error=1 | ||
1113 | call :dk_color %Red% "Checking WMI [Not Responding]" | ||
1114 | call :dk_color %Blue% "In MAS, Goto Troubleshoot and run Fix WMI option." | ||
1115 | set showfix=1 | ||
1116 | ) | ||
1117 | |||
1118 | |||
1119 | reg query "HKU\S-1-5-20\Software\Microsoft\Windows NT\CurrentVersion\SoftwareProtectionPlatform\PersistedTSReArmed" %nul% && ( | ||
1120 | set error=1 | ||
1121 | set showfix=1 | ||
1122 | call :dk_color2 %Red% "Checking Rearm " %Blue% "[System Restart Is Required]" | ||
1123 | ) | ||
1124 | |||
1125 | |||
1126 | reg query "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\ClipSVC\Volatile\PersistedSystemState" %nul% && ( | ||
1127 | set error=1 | ||
1128 | set showfix=1 | ||
1129 | call :dk_color2 %Red% "Checking ClipSVC " %Blue% "[System Restart Is Required]" | ||
1130 | ) | ||
1131 | |||
1132 | |||
1133 | for /f "skip=2 tokens=2*" %%a in ('reg query "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\SoftwareProtectionPlatform" /v "SkipRearm" %nul6%') do if /i %%b NEQ 0x0 ( | ||
1134 | reg add "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\SoftwareProtectionPlatform" /v "SkipRearm" /t REG_DWORD /d "0" /f %nul% | ||
1135 | call :dk_color %Red% "Checking SkipRearm [Default 0 Value Not Found. Changing To 0]" | ||
1136 | net stop sppsvc /y %nul% | ||
1137 | net start sppsvc /y %nul% | ||
1138 | set error=1 | ||
1139 | ) | ||
1140 | |||
1141 | |||
1142 | reg query "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\SoftwareProtectionPlatform\Plugins\Objects\msft:rm/algorithm/hwid/4.0" /f ba02fed39662 /d %nul% || ( | ||
1143 | call :dk_color %Red% "Checking SPP Registry Key [Incorrect ModuleId Found]" | ||
1144 | call :dk_color %Blue% "Possibly Caused By Gaming Spoofers. Help: https://%mas%/troubleshoot" | ||
1145 | set error=1 | ||
1146 | set showfix=1 | ||
1147 | ) | ||
1148 | |||
1149 | |||
1150 | set tokenstore= | ||
1151 | for /f "skip=2 tokens=2*" %%a in ('reg query "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\SoftwareProtectionPlatform" /v TokenStore %nul6%') do call set "tokenstore=%%b" | ||
1152 | if not exist "%tokenstore%\" ( | ||
1153 | set error=1 | ||
1154 | REM This code creates token folder only if it's missing and sets default permission for it | ||
1155 | mkdir "%tokenstore%" %nul% | ||
1156 | set "d=$sddl = 'O:BAG:BAD:PAI(A;OICI;FA;;;SY)(A;OICI;FA;;;BA)(A;OICIIO;GR;;;BU)(A;;FR;;;BU)(A;OICI;FA;;;S-1-5-80-123231216-2592883651-3715271367-3753151631-4175906628)';" | ||
1157 | set "d=!d! $AclObject = New-Object System.Security.AccessControl.DirectorySecurity;" | ||
1158 | set "d=!d! $AclObject.SetSecurityDescriptorSddlForm($sddl);" | ||
1159 | set "d=!d! Set-Acl -Path %tokenstore% -AclObject $AclObject;" | ||
1160 | %psc% "!d!" %nul% | ||
1161 | call :dk_color %Gray% "Checking SPP Token Folder [Not Found. Creating Now] [%tokenstore%\]" | ||
1162 | ) | ||
1163 | |||
1164 | |||
1165 | call :dk_actids | ||
1166 | if not defined applist ( | ||
1167 | net stop sppsvc /y %nul% | ||
1168 | cscript //nologo %windir%\system32\slmgr.vbs /rilc %nul% | ||
1169 | if !errorlevel! NEQ 0 cscript //nologo %windir%\system32\slmgr.vbs /rilc %nul% | ||
1170 | call :dk_refresh | ||
1171 | call :dk_actids | ||
1172 | if not defined applist ( | ||
1173 | set error=1 | ||
1174 | call :dk_color %Red% "Checking Activation IDs [Not Found]" | ||
1175 | ) | ||
1176 | ) | ||
1177 | |||
1178 | |||
1179 | if exist "%tokenstore%\" if not exist "%tokenstore%\tokens.dat" ( | ||
1180 | set error=1 | ||
1181 | call :dk_color %Red% "Checking SPP tokens.dat [Not Found] [%tokenstore%\]" | ||
1182 | ) | ||
1183 | |||
1184 | |||
1185 | if not exist %SystemRoot%\system32\sppsvc.exe ( | ||
1186 | set error=1 | ||
1187 | set showfix=1 | ||
1188 | call :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 | |||
1194 | set wpaerror= | ||
1195 | set permerror= | ||
1196 | if not defined serv_cor if not defined serv_cste if defined error if /i not %error_code%==0 if not defined showfix ( | ||
1197 | |||
1198 | REM This code checks for invalid registry keys in HKLM\SYSTEM\WPA. This issue may appear even on healthy systems. | ||
1199 | |||
1200 | if %winbuild% GEQ 14393 ( | ||
1201 | set /a count=0 | ||
1202 | for /f %%a in ('reg query "HKLM\SYSTEM\WPA" %nul6%') do set /a count+=1 | ||
1203 | for /L %%# in (1,1,!count!) do ( | ||
1204 | reg query "HKLM\SYSTEM\WPA\8DEC0AF1-0341-4b93-85CD-72606C2DF94C-7P-%%#" /ve /t REG_BINARY %nul% || set wpaerror=1 | ||
1205 | ) | ||
1206 | if defined wpaerror call :dk_color %Red% "Checking WPA Registry Keys [Error Found] [Registry Count - !count!]" | ||
1207 | ) | ||
1208 | |||
1209 | REM 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 | |||
1211 | if not exist "%tokenstore%\" set permerror=1 | ||
1212 | |||
1213 | for %%# 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% | ||
1219 | if !errorlevel!==2 set permerror=1 | ||
1220 | ) | ||
1221 | if defined permerror call :dk_color %Red% "Checking SPP Permissions [Error Found]" | ||
1222 | |||
1223 | set showfix=1 | ||
1224 | call :dk_color %Blue% "%_fixmsg%" | ||
1225 | if not defined permerror call :dk_color %Blue% "If activation still fails then run Fix WPA Registry option." | ||
1226 | ) | ||
1227 | |||
1228 | exit /b | ||
1229 | |||
1230 | ::======================================================================================================================================== | ||
1231 | |||
1232 | :dk_color | ||
1233 | |||
1234 | if %_NCS% EQU 1 ( | ||
1235 | echo %esc%[%~1%~2%esc%[0m | ||
1236 | ) else ( | ||
1237 | %psc% write-host -back '%1' -fore '%2' '%3' | ||
1238 | ) | ||
1239 | exit /b | ||
1240 | |||
1241 | :dk_color2 | ||
1242 | |||
1243 | if %_NCS% EQU 1 ( | ||
1244 | echo %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 | ) | ||
1248 | exit /b | ||
1249 | |||
1250 | ::======================================================================================================================================== | ||
1251 | |||
1252 | :dk_done | ||
1253 | |||
1254 | echo: | ||
1255 | if %_unattended%==1 timeout /t 2 & exit /b | ||
1256 | call :dk_color %_Yellow% "Press any key to %_exitmsg%..." | ||
1257 | pause %nul1% | ||
1258 | exit /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 | |||
1271 | set f= | ||
1272 | for %%# in ( | ||
1273 | 15_ab4d047b-97cf-4126-a69f-34df08e2f254_B7R%f%FY-7N%f%XPK-Q43%f%42-Y9%f%X2H-3JX%f%4X_Retail________AccessRetail | ||
1274 | 15_4374022d-56b8-48c1-9bb7-d8f2fc726343_9MF%f%9G-CN%f%32B-HV7%f%XT-9X%f%J8T-9KV%f%F4_MAK___________AccessVolume | ||
1275 | 15_1b1d9bd5-12ea-4063-964c-16e7e87d6e08_NT8%f%89-MB%f%H4X-8MD%f%4H-X8%f%R2D-WQH%f%F8_Retail________ExcelRetail | ||
1276 | 15_ac1ae7fd-b949-4e04-a330-849bc40638cf_Y3N%f%36-YC%f%HDK-XYW%f%BG-KY%f%QVV-BDT%f%J2_MAK___________ExcelVolume | ||
1277 | 15_cfaf5356-49e3-48a8-ab3c-e729ab791250_BMK%f%4W-6N%f%88B-BP9%f%QR-PH%f%FCK-MG7%f%GF_Retail________GrooveRetail | ||
1278 | 15_4825ac28-ce41-45a7-9e6e-1fed74057601_RN8%f%4D-7H%f%CWY-FTC%f%BK-JM%f%XWM-HT7%f%GJ_MAK___________GrooveVolume | ||
1279 | 15_c02fb62e-1cd5-4e18-ba25-e0480467ffaa_2WQ%f%NF-GB%f%K4B-XVG%f%6F-BB%f%MX7-M4F%f%2Y_OEM-Perp______HomeBusinessPipcRetail | ||
1280 | 15_cd256150-a898-441f-aac0-9f8f33390e45_NVT%f%DK-QB%f%8J9-M28%f%GR-92%f%BPC-BR9%f%6Q_Retail________HomeBusinessRetail | ||
1281 | 15_98685d21-78bd-4c62-bc4f-653344a63035_R29%f%WQ-CM%f%NCM-2TH%f%CT-K4%f%H92-FX6%f%KR_Retail________HomeStudentRetail | ||
1282 | 15_44984381-406e-4a35-b1c3-e54f499556e2_RV7%f%NQ-HY%f%3WW-7CK%f%WH-QT%f%VMW-29V%f%HC_Retail________InfoPathRetail | ||
1283 | 15_9e016989-4007-42a6-8051-64eb97110cf2_C4T%f%GN-QQ%f%W6Y-FYK%f%XC-6W%f%JW7-X73%f%VG_MAK___________InfoPathVolume | ||
1284 | 15_9103f3ce-1084-447a-827e-d6097f68c895_6MD%f%N4-WF%f%3FV-4WH%f%3Q-W6%f%99V-RGC%f%MY_PrepidBypass__LyncAcademicRetail | ||
1285 | 15_ff693bf4-0276-4ddb-bb42-74ef1a0c9f4d_N42%f%BF-CB%f%Y9F-W2C%f%7R-X3%f%97X-DYF%f%QW_PrepidBypass__LyncEntryRetail | ||
1286 | 15_fada6658-bfc6-4c4e-825a-59a89822cda8_89P%f%23-2N%f%K2R-JXM%f%2M-3Q%f%8R8-BWM%f%3Y_Retail________LyncRetail | ||
1287 | 15_e1264e10-afaf-4439-a98b-256df8bb156f_3WK%f%CD-RN%f%489-4M7%f%XJ-GJ%f%2GQ-YBF%f%Q6_MAK___________LyncVolume | ||
1288 | 15_3169c8df-f659-4f95-9cc6-3115e6596e83_YYH%f%XG-KT%f%NKF-XGR%f%T7-H2%f%99D-8K6%f%MM_Retail________MondoRetail | ||
1289 | 15_f33485a0-310b-4b72-9a0e-b1d605510dbd_2YN%f%YQ-FQ%f%MVG-CB8%f%KW-6X%f%KYD-M7R%f%RJ_MAK___________MondoVolume | ||
1290 | 15_3391e125-f6e4-4b1e-899c-a25e6092d40d_4TG%f%WV-6N%f%9P6-G2H%f%8Y-2H%f%WKB-B4F%f%F4_Bypass________OneNoteFreeRetail | ||
1291 | 15_8b524bcc-67ea-4876-a509-45e46f6347e8_3KX%f%XQ-PV%f%N2C-8P7%f%YY-HC%f%V88-GVG%f%Q6_Retail________OneNoteRetail | ||
1292 | 15_b067e965-7521-455b-b9f7-c740204578a2_JDM%f%WF-NJ%f%C7B-HRC%f%HY-WF%f%T8G-BPX%f%D9_MAK___________OneNoteVolume | ||
1293 | 15_12004b48-e6c8-4ffa-ad5a-ac8d4467765a_9N4%f%RQ-CF%f%8R2-HBV%f%CB-J3%f%C9V-94P%f%4D_Retail________OutlookRetail | ||
1294 | 15_8d577c50-ae5e-47fd-a240-24986f73d503_HNG%f%29-GG%f%WRG-RFC%f%8C-JT%f%FP4-2J9%f%FH_MAK___________OutlookVolume | ||
1295 | 15_5aab8561-1686-43f7-9ff5-2c861da58d17_9CY%f%B3-NF%f%MRW-YFD%f%G6-XC%f%7TF-BY3%f%6J_OEM-Perp______PersonalPipcRetail | ||
1296 | 15_17e9df2d-ed91-4382-904b-4fed6a12caf0_2NC%f%QJ-MF%f%RMH-TXV%f%83-J7%f%V4C-RVR%f%WC_Retail________PersonalRetail | ||
1297 | 15_31743b82-bfbc-44b6-aa12-85d42e644d5b_HVM%f%N2-KP%f%HQH-DVQ%f%MK-7B%f%3CM-FGB%f%FC_Retail________PowerPointRetail | ||
1298 | 15_e40dcb44-1d5c-4085-8e8f-943f33c4f004_47D%f%KN-HP%f%JP7-RF9%f%M3-VC%f%YT2-TMQ%f%4G_MAK___________PowerPointVolume | ||
1299 | 15_064383fa-1538-491c-859b-0ecab169a0ab_N3Q%f%MM-GK%f%DT3-JQG%f%X6-7X%f%3MQ-4GB%f%G3_Retail________ProPlusRetail | ||
1300 | 15_2b88c4f2-ea8f-43cd-805e-4d41346e18a7_QKH%f%NX-M9%f%GGH-T3Q%f%MW-YP%f%K4Q-QRP%f%9V_MAK___________ProPlusVolume | ||
1301 | 15_4e26cac1-e15a-4467-9069-cb47b67fe191_CF9%f%DD-6C%f%NW2-BJW%f%JQ-CV%f%CFX-Y7T%f%XD_OEM-Perp______ProfessionalPipcRetail | ||
1302 | 15_44bc70e2-fb83-4b09-9082-e5557e0c2ede_MBQ%f%BN-CQ%f%PT6-PXR%f%MC-TY%f%JFR-3C8%f%MY_Retail________ProfessionalRetail | ||
1303 | 15_f2435de4-5fc0-4e5b-ac97-34f515ec5ee7_B4R%f%N4-H4%f%JYG-YMQ%f%MC-CY%f%GKH-46W%f%PH_Retail________ProjectProRetail | ||
1304 | 15_ed34dc89-1c27-4ecd-8b2f-63d0f4cedc32_WFC%f%T2-NB%f%FQ7-JD7%f%VV-MF%f%JX6-6F2%f%CM_MAK___________ProjectProVolume | ||
1305 | 15_5517e6a2-739b-4822-946f-7f0f1c5934b1_2B9%f%6V-X9%f%NJY-WFB%f%RC-Q8%f%MP2-7CC%f%C4_Retail________ProjectStdRetail | ||
1306 | 15_2b9e4a37-6230-4b42-bee2-e25ce86c8c7a_3CN%f%QX-T3%f%4TY-99R%f%H4-C4%f%YD2-KWY%f%GV_MAK___________ProjectStdVolume | ||
1307 | 15_c3a0814a-70a4-471f-af37-2313a6331111_TWN%f%CJ-YR%f%84W-X7P%f%PF-6D%f%PRP-D67%f%VC_Retail________PublisherRetail | ||
1308 | 15_38ea49f6-ad1d-43f1-9888-99a35d7c9409_DJP%f%HV-NC%f%JV6-GWP%f%T6-K2%f%6JX-C7G%f%X6_MAK___________PublisherVolume | ||
1309 | 15_ba3e3833-6a7e-445a-89d0-7802a9a68588_3NY%f%6J-WH%f%T3F-47B%f%DV-JH%f%F36-234%f%3W_PrepidBypass__SPDRetail | ||
1310 | 15_32255c0a-16b4-4ce2-b388-8a4267e219eb_V6V%f%WN-KC%f%2HR-YYD%f%D6-9V%f%7HQ-7T7%f%VP_Retail________StandardRetail | ||
1311 | 15_a24cca51-3d54-4c41-8a76-4031f5338cb2_9TN%f%6B-PC%f%YH4-MCV%f%DQ-KT%f%83C-TMQ%f%7T_MAK___________StandardVolume | ||
1312 | 15_15d12ad4-622d-4257-976c-5eb3282fb93d_JRJ%f%NJ-33%f%M7C-R73%f%X3-P9%f%XF7-R89%f%MY_Retail________VisioProRetail | ||
1313 | 15_3e4294dd-a765-49bc-8dbd-cf8b62a4bd3d_YN7%f%CF-XR%f%H6R-CGK%f%RY-GK%f%PV3-BG7%f%WF_MAK___________VisioProVolume | ||
1314 | 15_dae597ce-5823-4c77-9580-7268b93a4b23_G2N%f%2Q-4Q%f%D2T-DY4%f%TP-GY%f%489-3RQ%f%CG_Retail________VisioStdRetail | ||
1315 | 15_44a1f6ff-0876-4edb-9169-dbb43101ee89_RX6%f%3Y-4N%f%FK2-XTY%f%C8-C6%f%B3W-YPX%f%PJ_MAK___________VisioStdVolume | ||
1316 | 15_191509f2-6977-456f-ab30-cf0492b1e93a_NB7%f%7V-RP%f%FQ6-PMM%f%KQ-T8%f%7DV-M4D%f%84_Retail________WordRetail | ||
1317 | 15_9cedef15-be37-4ff0-a08a-13a045540641_RPH%f%PB-Y7%f%NC4-3VY%f%FM-DW%f%7VD-G8Y%f%J8_MAK___________WordVolume | ||
1318 | 15_befee371-a2f5-4648-85db-a2c55fdf324c_JXR%f%8H-NJ%f%3MK-X66%f%W8-78%f%CWD-QRQ%f%6C_Retail________O365BusinessRetail | ||
1319 | 15_537ea5b5-7d50-4876-bd38-a53a77caca32_J2W%f%28-TN%f%9C8-26P%f%WV-F7%f%J4G-72X%f%CB_Subscription1_O365HomePremRetail | ||
1320 | 15_0c4e5e7a-b436-4776-bb89-88e4b14687e2_T6J%f%JW-DY%f%N99-WK4%f%6B-9M%f%KKV-94P%f%2Y_Retail________O365ProPlusRetail | ||
1321 | 15_7a75647f-636f-4607-8e54-e1b7d1ad8930_B9V%f%9Q-F6%f%ND8-T4K%f%4K-88%f%68M-HT7%f%KT_Retail________O365SmallBusPremRetail | ||
1322 | 16_bfa358b0-98f1-4125-842e-585fa13032e6_WHK%f%4N-YQ%f%GHB-XWX%f%CC-G3%f%HYC-6JF%f%94_Retail________AccessRetail | ||
1323 | 16_9d9faf9e-d345-4b49-afce-68cb0a539c7c_RNB%f%7V-P4%f%8F4-3FY%f%Y6-2P%f%3R3-63B%f%QV_PrepidBypass__AccessRuntimeRetail | ||
1324 | 16_3b2fa33f-cd5a-43a5-bd95-f49f3f546b0b_JJ2%f%Y4-N8%f%KM3-Y8K%f%Y3-Y2%f%2FR-R3K%f%VK_MAK___________AccessVolume | ||
1325 | 16_424d52ff-7ad2-4bc7-8ac6-748d767b455d_RKJ%f%BN-VW%f%TM2-BDK%f%XX-RK%f%QFD-JTY%f%Q2_Retail________ExcelRetail | ||
1326 | 16_685062a7-6024-42e7-8c5f-6bb9e63e697f_FVG%f%NR-X8%f%2B2-6PR%f%JM-YT%f%4W7-8HV%f%36_MAK___________ExcelVolume | ||
1327 | 16_c02fb62e-1cd5-4e18-ba25-e0480467ffaa_2WQ%f%NF-GB%f%K4B-XVG%f%6F-BB%f%MX7-M4F%f%2Y_OEM-Perp______HomeBusinessPipcRetail | ||
1328 | 16_86834d00-7896-4a38-8fae-32f20b86fa2b_HM6%f%FM-NV%f%F78-KV9%f%PM-F3%f%6B8-D9M%f%XD_Retail________HomeBusinessRetail | ||
1329 | 16_c28acdb8-d8b3-4199-baa4-024d09e97c99_PNP%f%RV-F2%f%627-Q8J%f%VC-3D%f%GR9-WTY%f%RK_Retail________HomeStudentRetail | ||
1330 | 16_e2127526-b60c-43e0-bed1-3c9dc3d5a468_YWD%f%4R-CN%f%KVT-VG8%f%VJ-93%f%33B-RC3%f%B8_Retail________HomeStudentVNextRetail | ||
1331 | 16_b21367df-9545-4f02-9f24-240691da0e58_Y3X%f%PN-P7%f%PC4-MGP%f%TJ-2B%f%Y3Q-RJR%f%FV_Retail________MondoRetail | ||
1332 | 16_2cd0ea7e-749f-4288-a05e-567c573b2a6c_FMT%f%QQ-84%f%NR8-274%f%4R-MX%f%F4P-PGY%f%R3_MAK___________MondoVolume | ||
1333 | 16_436366de-5579-4f24-96db-3893e4400030_XYN%f%TG-R9%f%6FY-369%f%HX-YF%f%PHY-F9C%f%PM_Bypass________OneNoteFreeRetail | ||
1334 | 16_83ac4dd9-1b93-40ed-aa55-ede25bb6af38_FXF%f%6F-CN%f%C26-W64%f%3C-K6%f%KB7-6XX%f%W3_Retail________OneNoteRetail | ||
1335 | 16_23b672da-a456-4860-a8f3-e062a501d7e8_9TY%f%VN-D7%f%6HK-BVM%f%WT-Y7%f%G88-9TP%f%PV_MAK___________OneNoteVolume | ||
1336 | 16_5a670809-0983-4c2d-8aad-d3c2c5b7d5d1_7N4%f%KG-P2%f%QDH-86V%f%9C-DJ%f%FVF-369%f%W9_Retail________OutlookRetail | ||
1337 | 16_50059979-ac6f-4458-9e79-710bcb41721a_7QP%f%NR-3H%f%FDG-YP6%f%T9-JQ%f%CKQ-KKX%f%XC_MAK___________OutlookVolume | ||
1338 | 16_5aab8561-1686-43f7-9ff5-2c861da58d17_9CY%f%B3-NF%f%MRW-YFD%f%G6-XC%f%7TF-BY3%f%6J_OEM-Perp______PersonalPipcRetail | ||
1339 | 16_a9f645a1-0d6a-4978-926a-abcb363b72a6_FT7%f%VF-XB%f%N92-HPD%f%JV-RH%f%MBY-6VK%f%BF_Retail________PersonalRetail | ||
1340 | 16_f32d1284-0792-49da-9ac6-deb2bc9c80b6_N7G%f%CB-WQ%f%T7K-QRH%f%WG-TT%f%PYD-7T9%f%XF_Retail________PowerPointRetail | ||
1341 | 16_9b4060c9-a7f5-4a66-b732-faf248b7240f_X3R%f%T9-ND%f%G64-VMK%f%2M-KQ%f%6XY-DPF%f%GV_MAK___________PowerPointVolume | ||
1342 | 16_de52bd50-9564-4adc-8fcb-a345c17f84f9_GM4%f%3N-F7%f%42Q-6JD%f%DK-M6%f%22J-J8G%f%DV_Retail________ProPlusRetail | ||
1343 | 16_c47456e3-265d-47b6-8ca0-c30abbd0ca36_FNV%f%K8-8D%f%VCJ-F7X%f%3J-KG%f%VQB-RC2%f%QY_MAK___________ProPlusVolume | ||
1344 | 16_4e26cac1-e15a-4467-9069-cb47b67fe191_CF9%f%DD-6C%f%NW2-BJW%f%JQ-CV%f%CFX-Y7T%f%XD_OEM-Perp______ProfessionalPipcRetail | ||
1345 | 16_d64edc00-7453-4301-8428-197343fafb16_NXF%f%TK-YD%f%9Y7-X9M%f%MJ-9B%f%WM6-J2Q%f%VH_Retail________ProfessionalRetail | ||
1346 | 16_0f42f316-00b1-48c5-ada4-2f52b5720ad0_WKK%f%GF-TT%f%N8F-QC9%f%T2-6C%f%2DC-3YH%f%63_Retail________ProjectProRetail | ||
1347 | 16_82f502b5-b0b0-4349-bd2c-c560df85b248_PKC%f%3N-8F%f%99H-28M%f%VY-J4%f%RYY-CWG%f%DH_MAK___________ProjectProVolume | ||
1348 | 16_16728639-a9ab-4994-b6d8-f81051e69833_JBN%f%PH-YF%f%2F7-Q9Y%f%29-86%f%CTG-C9Y%f%GV_MAKC2R________ProjectProXVolume | ||
1349 | 16_e9f0b3fc-962f-4944-ad06-05c10b6bcd5e_4H6%f%NF-QD%f%PG8-83W%f%97-9K%f%8XY-XBT%f%9Y_Retail________ProjectStdRetail | ||
1350 | 16_82e6b314-2a62-4e51-9220-61358dd230e6_4TG%f%WV-6N%f%9P6-G2H%f%8Y-2H%f%WKB-B4G%f%93_MAK___________ProjectStdVolume | ||
1351 | 16_431058f0-c059-44c5-b9e7-ed2dd46b6789_N3W%f%2Q-69%f%MBT-27R%f%D9-BH%f%8V3-JT2%f%C8_MAKC2R________ProjectStdXVolume | ||
1352 | 16_6e0c1d99-c72e-4968-bcb7-ab79e03e201e_WKW%f%ND-X6%f%G9G-CDM%f%TV-CP%f%GYJ-6MV%f%BF_Retail________PublisherRetail | ||
1353 | 16_fcc1757b-5d5f-486a-87cf-c4d6dedb6032_9QV%f%N2-PX%f%XRX-8V4%f%W8-Q7%f%926-TJG%f%D8_MAK___________PublisherVolume | ||
1354 | 16_9103f3ce-1084-447a-827e-d6097f68c895_6MD%f%N4-WF%f%3FV-4WH%f%3Q-W6%f%99V-RGC%f%MY_PrepidBypass__SkypeServiceBypassRetail | ||
1355 | 16_971cd368-f2e1-49c1-aedd-330909ce18b6_4N4%f%D8-3J%f%7Y3-YYW%f%7C-73%f%HD2-V8R%f%HY_PrepidBypass__SkypeforBusinessEntryRetail | ||
1356 | 16_418d2b9f-b491-4d7f-84f1-49e27cc66597_PBJ%f%79-77%f%NY4-VRG%f%FG-Y8%f%WYC-CKC%f%RC_Retail________SkypeforBusinessRetail | ||
1357 | 16_03ca3b9a-0869-4749-8988-3cbc9d9f51bb_DMT%f%CJ-KN%f%RKR-JV8%f%TQ-V2%f%CR2-VFT%f%FH_MAK___________SkypeforBusinessVolume | ||
1358 | 16_4a31c291-3a12-4c64-b8ab-cd79212be45e_2FP%f%WN-4H%f%6CM-KD8%f%QQ-8H%f%CHC-P9X%f%YW_Retail________StandardRetail | ||
1359 | 16_0ed94aac-2234-4309-ba29-74bdbb887083_WHG%f%MQ-JN%f%MGT-MDQ%f%VF-WD%f%R69-KQB%f%WC_MAK___________StandardVolume | ||
1360 | 16_2dfe2075-2d04-4e43-816a-eb60bbb77574_7TM%f%6H-KN%f%R4K-Q7H%f%BX-72%f%T2Q-H22%f%RV_Retail________VisioProRetail | ||
1361 | 16_295b2c03-4b1c-4221-b292-1411f468bd02_NRK%f%T9-C8%f%GP2-XDY%f%XQ-YW%f%72K-MG9%f%2B_MAK___________VisioProVolume | ||
1362 | 16_0594dc12-8444-4912-936a-747ca742dbdb_G98%f%Q2-B6%f%N77-CFH%f%9J-K8%f%24G-XQC%f%C4_MAKC2R________VisioProXVolume | ||
1363 | 16_c76dbcbc-d71b-4f45-b5b3-b7494cb4e23e_Q8R%f%4N-GJ%f%CPG-CF3%f%2R-JF%f%CYR-K4T%f%F3_Retail________VisioStdRetail | ||
1364 | 16_44151c2d-c398-471f-946f-7660542e3369_XNC%f%JB-YY%f%883-JRW%f%64-DP%f%XMX-JXC%f%R6_MAK___________VisioStdVolume | ||
1365 | 16_1d1c6879-39a3-47a5-9a6d-aceefa6a289d_B2H%f%TN-JP%f%H8C-J6Y%f%6V-HC%f%HKB-43M%f%GT_MAKC2R________VisioStdXVolume | ||
1366 | 16_cacaa1bf-da53-4c3b-9700-11738ef1c2a5_P8K%f%82-NQ%f%7GG-JKY%f%8T-6V%f%HVY-88G%f%GD_Retail________WordRetail | ||
1367 | 16_c3000759-551f-4f4a-bcac-a4b42cbf1de2_YHM%f%WC-YN%f%6V9-WJP%f%XD-3W%f%QKP-TMV%f%CV_MAK___________WordVolume | ||
1368 | 16_518687bd-dc55-45b9-8fa6-f918e1082e83_WRY%f%J6-G3%f%NP7-7VH%f%94-8X%f%7KP-JB7%f%HC_Retail________Access2019Retail | ||
1369 | 16_385b91d6-9c2c-4a2e-86b5-f44d44a48c5f_6FW%f%HX-NK%f%YXK-BW3%f%4Q-7X%f%C9F-Q9P%f%X7_MAK-AE________Access2019Volume | ||
1370 | 16_22e6b96c-1011-4cd5-8b35-3c8fb6366b86_FGQ%f%NJ-JW%f%JCG-7Q8%f%MG-RM%f%RGJ-9TQ%f%VF_PrepidBypass__AccessRuntime2019Retail | ||
1371 | 16_c201c2b7-02a1-41a8-b496-37c72910cd4a_KBP%f%NW-64%f%CMM-8KW%f%CB-23%f%F44-8B7%f%HM_Retail________Excel2019Retail | ||
1372 | 16_05cb4e1d-cc81-45d5-a769-f34b09b9b391_8NT%f%4X-GQ%f%MCK-62X%f%4P-TW%f%6QP-YKP%f%YF_MAK-AE________Excel2019Volume | ||
1373 | 16_7fe09eef-5eed-4733-9a60-d7019df11cac_QBN%f%2Y-9B%f%284-9KW%f%78-K4%f%8PB-R62%f%YT_Retail________HomeBusiness2019Retail | ||
1374 | 16_4539aa2c-5c31-4d47-9139-543a868e5741_XNW%f%PM-32%f%XQC-Y7Q%f%JC-QG%f%GBV-YY7%f%JK_Retail________HomeStudent2019Retail | ||
1375 | 16_20e359d5-927f-47c0-8a27-38adbdd27124_WR4%f%3D-NM%f%WQQ-HCQ%f%R2-VK%f%XDR-37B%f%7H_Retail________Outlook2019Retail | ||
1376 | 16_92a99ed8-2923-4cb7-a4c5-31da6b0b8cf3_RN3%f%QB-GT%f%6D7-YB3%f%VH-F3%f%RPB-3GQ%f%YB_MAK-AE________Outlook2019Volume | ||
1377 | 16_2747b731-0f1f-413e-a92d-386ec1277dd8_NMB%f%Y8-V3%f%CV7-BX6%f%K6-29%f%22Y-43M%f%7T_Retail________Personal2019Retail | ||
1378 | 16_7e63cc20-ba37-42a1-822d-d5f29f33a108_HN2%f%7K-JH%f%J8R-7T7%f%KK-WJ%f%YC3-FM7%f%MM_Retail________PowerPoint2019Retail | ||
1379 | 16_13c2d7bf-f10d-42eb-9e93-abf846785434_29G%f%NM-VM%f%33V-WR2%f%3K-HG%f%2DT-KTQ%f%YR_MAK-AE________PowerPoint2019Volume | ||
1380 | 16_a3072b8f-adcc-4e75-8d62-fdeb9bdfae57_BN4%f%XJ-R9%f%DYY-96W%f%48-YK%f%8DM-MY7%f%PY_Retail________ProPlus2019Retail | ||
1381 | 16_6755c7a7-4dfe-46f5-bce8-427be8e9dc62_T8Y%f%BN-4Y%f%V3X-KK2%f%4Q-QX%f%BD7-T3C%f%63_MAK-AE________ProPlus2019Volume | ||
1382 | 16_1717c1e0-47d3-4899-a6d3-1022db7415e0_9NX%f%DK-MR%f%Y98-2VJ%f%V8-GF%f%73J-TQ9%f%FK_Retail________Professional2019Retail | ||
1383 | 16_0d270ef7-5aaf-4370-a372-bc806b96adb7_JDT%f%NC-PP%f%77T-T9H%f%2W-G4%f%J2J-VH8%f%JK_Retail________ProjectPro2019Retail | ||
1384 | 16_d4ebadd6-401b-40d5-adf4-a5d4accd72d1_TBX%f%BD-FN%f%WKJ-WRH%f%BD-KB%f%PHH-XD9%f%F2_MAK-AE________ProjectPro2019Volume | ||
1385 | 16_bb7ffe5f-daf9-4b79-b107-453e1c8427b5_R3J%f%NT-8P%f%BDP-MTW%f%CK-VD%f%2V8-HMK%f%F9_Retail________ProjectStd2019Retail | ||
1386 | 16_fdaa3c03-dc27-4a8d-8cbf-c3d843a28ddc_RBR%f%FX-MQ%f%NDJ-4XF%f%HF-7Q%f%VDR-JHX%f%GC_MAK-AE________ProjectStd2019Volume | ||
1387 | 16_f053a7c7-f342-4ab8-9526-a1d6e5105823_4QC%f%36-NW%f%3YH-D2Y%f%9D-RJ%f%PC7-VVB%f%9D_Retail________Publisher2019Retail | ||
1388 | 16_40055495-be00-444e-99cc-07446729b53e_K8F%f%2D-NB%f%M32-BF2%f%6V-YC%f%KFJ-29Y%f%9W_MAK-AE________Publisher2019Volume | ||
1389 | 16_b639e55c-8f3e-47fe-9761-26c6a786ad6b_JBD%f%KF-6N%f%CD6-49K%f%3G-2T%f%V79-BKP%f%73_Retail________SkypeforBusiness2019Retail | ||
1390 | 16_15a430d4-5e3f-4e6d-8a0a-14bf3caee4c7_9MN%f%Q7-YP%f%Q3B-6WJ%f%XM-G8%f%3T3-CBB%f%DK_MAK-AE________SkypeforBusiness2019Volume | ||
1391 | 16_f88cfdec-94ce-4463-a969-037be92bc0e7_N97%f%22-BV%f%9H6-WTJ%f%TT-FP%f%B93-978%f%MK_PrepidBypass__SkypeforBusinessEntry2019Retail | ||
1392 | 16_fdfa34dd-a472-4b85-bee6-cf07bf0aaa1c_NDG%f%VM-MD%f%27H-2XH%f%VC-KD%f%DX2-YKP%f%74_Retail________Standard2019Retail | ||
1393 | 16_beb5065c-1872-409e-94e2-403bcfb6a878_NT3%f%V6-XM%f%BK7-Q66%f%MF-VM%f%KR4-FC3%f%3M_MAK-AE________Standard2019Volume | ||
1394 | 16_a6f69d68-5590-4e02-80b9-e7233dff204e_2NW%f%VW-QG%f%F4T-9CP%f%MB-WY%f%DQ9-7XP%f%79_Retail________VisioPro2019Retail | ||
1395 | 16_f41abf81-f409-4b0d-889d-92b3e3d7d005_33Y%f%F4-GN%f%CQ3-J6G%f%DM-J6%f%7P3-FM7%f%QP_MAK-AE________VisioPro2019Volume | ||
1396 | 16_4a582021-18c2-489f-9b3d-5186de48f1cd_263%f%WK-3N%f%797-7R4%f%37-28%f%BKG-3V8%f%M8_Retail________VisioStd2019Retail | ||
1397 | 16_933ed0e3-747d-48b0-9c2c-7ceb4c7e473d_BGN%f%HX-QT%f%PRJ-F9C%f%9G-R8%f%QQG-8T2%f%7F_MAK-AE________VisioStd2019Volume | ||
1398 | 16_72cee1c2-3376-4377-9f25-4024b6baadf8_JXR%f%8H-NJ%f%3MK-X66%f%W8-78%f%CWD-QRV%f%R2_Retail________Word2019Retail | ||
1399 | 16_fe5fe9d5-3b06-4015-aa35-b146f85c4709_9F3%f%6R-PN%f%VHH-3DX%f%GQ-7C%f%D2H-R9D%f%3V_MAK-AE________Word2019Volume | ||
1400 | 16_f634398e-af69-48c9-b256-477bea3078b5_P28%f%6B-N3%f%XYP-36Q%f%RQ-29%f%CMP-RVX%f%9M_Retail________Access2021Retail | ||
1401 | 16_ae17db74-16b0-430b-912f-4fe456e271db_JBH%f%3N-P9%f%7FP-FRT%f%JD-MG%f%K2C-VFW%f%G6_MAK-AE________Access2021Volume | ||
1402 | 16_fb099c19-d48b-4a2f-a160-4383011060aa_V6Q%f%FB-7N%f%7G9-PF7%f%W9-M8%f%FQM-MY8%f%G9_Retail________Excel2021Retail | ||
1403 | 16_9da1ecdb-3a62-4273-a234-bf6d43dc0778_WNY%f%R4-KM%f%R9H-KVC%f%8W-7H%f%J8B-K79%f%DQ_MAK-AE________Excel2021Volume | ||
1404 | 16_0e878942-3ba1-48ee-a215-f64d10a9f97b_QV2%f%VN-37%f%WPX-DHH%f%4K-B8%f%2H6-PDP%f%3T_Retail1_______HomeBusiness2021Retail | ||
1405 | 16_9e7d5312-95fc-4443-a551-69c20624ec6b_3QN%f%G6-8F%f%JTH-88B%f%F9-KB%f%BVM-JMB%f%78_Retail________HomeStudent2021Retail | ||
1406 | 16_279706f4-3a4b-4877-949b-f8c299cf0cc5_NB2%f%TQ-3Y%f%79C-77C%f%6M-QM%f%Y7H-7QY%f%8P_Retail________OneNote2021Retail | ||
1407 | 16_ecea2cfa-d406-4a7f-be0d-c6163250d126_4NC%f%WR-9V%f%92Y-34V%f%B2-RP%f%THR-YTG%f%R7_Retail________Outlook2021Retail | ||
1408 | 16_45bf67f9-0fc8-4335-8b09-9226cef8a576_JQ9%f%MJ-QY%f%N6B-67P%f%X9-GY%f%FVY-QJ6%f%TB_MAK-AE________Outlook2021Volume | ||
1409 | 16_8f89391e-eedb-429d-af90-9d36fbf94de6_RRR%f%YB-DN%f%749-GCP%f%W4-9H%f%6VK-HCH%f%PT_Retail________Personal2021Retail | ||
1410 | 16_c9bf5e86-f5e3-4ac6-8d52-e114a604d7bf_3KX%f%XQ-PV%f%N2C-8P7%f%YY-HC%f%V88-GVM%f%96_Retail1_______PowerPoint2021Retail | ||
1411 | 16_716f2434-41b6-4969-ab73-e61e593a3875_39G%f%2N-3B%f%D9C-C4X%f%CM-BD%f%4QG-FVY%f%DY_MAK-AE________PowerPoint2021Volume | ||
1412 | 16_c2f04adf-a5de-45c5-99a5-f5fddbda74a8_8WX%f%TP-MN%f%628-KY4%f%4G-VJ%f%WCK-C7P%f%CF_Retail________ProPlus2021Retail | ||
1413 | 16_3f180b30-9b05-4fe2-aa8d-0c1c4790f811_RNH%f%JY-DT%f%FXW-HW9%f%F8-49%f%82D-MD2%f%CW_MAK-AE1_______ProPlus2021Volume | ||
1414 | 16_96097a68-b5c5-4b19-8600-2e8d6841a0db_JRJ%f%NJ-33%f%M7C-R73%f%X3-P9%f%XF7-R9F%f%6M_MAK-AE________ProPlusSPLA2021Volume | ||
1415 | 16_711e48a6-1a79-4b00-af10-73f4ca3aaac4_DJP%f%HV-NC%f%JV6-GWP%f%T6-K2%f%6JX-C7P%f%BG_Retail________Professional2021Retail | ||
1416 | 16_3747d1d5-55a8-4bc3-b53d-19fff1913195_QKH%f%NX-M9%f%GGH-T3Q%f%MW-YP%f%K4Q-QRW%f%MV_Retail________ProjectPro2021Retail | ||
1417 | 16_17739068-86c4-4924-8633-1e529abc7efc_HVC%f%34-CV%f%NPG-RVC%f%MT-X2%f%JRF-CR7%f%RK_MAK-AE1_______ProjectPro2021Volume | ||
1418 | 16_4ea64dca-227c-436b-813f-b6624be2d54c_2B9%f%6V-X9%f%NJY-WFB%f%RC-Q8%f%MP2-7CH%f%RR_Retail________ProjectStd2021Retail | ||
1419 | 16_84313d1e-47c8-4e27-8ced-0476b7ee46c4_3CN%f%QX-T3%f%4TY-99R%f%H4-C4%f%YD2-KW6%f%WH_MAK-AE________ProjectStd2021Volume | ||
1420 | 16_b769b746-53b1-4d89-8a68-41944dafe797_CDN%f%FG-77%f%T8D-VKQ%f%JX-B7%f%KT3-KK2%f%8V_Retail1_______Publisher2021Retail | ||
1421 | 16_a0234cfe-99bd-4586-a812-4f296323c760_2KX%f%JH-3N%f%HTW-RDB%f%PX-QF%f%RXJ-MTG%f%XF_MAK-AE________Publisher2021Volume | ||
1422 | 16_c3fb48b2-1fd4-4dc8-af39-819edf194288_DVB%f%XN-HF%f%T43-CVP%f%RQ-J8%f%9TF-VMM%f%HG_Retail________SkypeforBusiness2021Retail | ||
1423 | 16_6029109c-ceb8-4ee5-b324-f8eb2981e99a_R3F%f%CY-NH%f%GC7-CBP%f%VP-8Q%f%934-YTG%f%XG_MAK-AE________SkypeforBusiness2021Volume | ||
1424 | 16_9e7e7b8e-a0e7-467b-9749-d0de82fb7297_HXN%f%XB-J4%f%JGM-TCF%f%44-2X%f%2CV-FJV%f%VH_Retail________Standard2021Retail | ||
1425 | 16_223a60d8-9002-4a55-abac-593f5b66ca45_2CJ%f%N4-C9%f%XK2-HFP%f%Q6-YH%f%498-82T%f%XH_MAK-AE________Standard2021Volume | ||
1426 | 16_b99ba8c4-e257-4b70-a31a-8bd308ce7073_BQW%f%DW-NJ%f%9YF-P7Y%f%79-H6%f%DCT-MKQ%f%9C_MAK-AE________StandardSPLA2021Volume | ||
1427 | 16_814014d3-c30b-4f63-a493-3708e0dc0ba8_T6P%f%26-NJ%f%VBR-76B%f%K8-WB%f%CDY-TX3%f%BC_Retail________VisioPro2021Retail | ||
1428 | 16_c590605a-a08a-4cc7-8dc2-f1ffb3d06949_JNK%f%BX-MH%f%9P4-K8Y%f%YV-8C%f%G2Y-VQ2%f%C8_MAK-AE________VisioPro2021Volume | ||
1429 | 16_16d43989-a5ef-47e2-9ff1-272784caee24_89N%f%YY-KB%f%93R-7X2%f%2F-93%f%QDF-DJ6%f%YM_Retail________VisioStd2021Retail | ||
1430 | 16_d55f90ee-4ba2-4d02-b216-1300ee50e2af_BW4%f%3B-4P%f%NFP-V63%f%7F-23%f%TR2-J47%f%TX_MAK-AE________VisioStd2021Volume | ||
1431 | 16_fb33d997-4aa3-494e-8b58-03e9ab0f181d_VNC%f%C4-CJ%f%QVK-BKX%f%34-77%f%Y8H-CYX%f%MR_Retail________Word2021Retail | ||
1432 | 16_0c728382-95fb-4a55-8f12-62e605f91727_BJG%f%97-NW%f%3GM-8QQ%f%Q7-FH%f%76G-686%f%XM_MAK-AE________Word2021Volume | ||
1433 | 16_6337137e-7c07-4197-8986-bece6a76fc33_2P3%f%C9-BQ%f%NJH-VCV%f%PH-YD%f%Y6M-43J%f%PQ_Subscription__O365BusinessRetail | ||
1434 | 16_2f5c71b4-5b7a-4005-bb68-f9fac26f2ea3_W62%f%NQ-26%f%7QR-RTF%f%74-PF%f%2MH-JQM%f%TH_Subscription__O365EduCloudRetail | ||
1435 | 16_537ea5b5-7d50-4876-bd38-a53a77caca32_J2W%f%28-TN%f%9C8-26P%f%WV-F7%f%J4G-72X%f%CB_Subscription1_O365HomePremRetail | ||
1436 | 16_149dbce7-a48e-44db-8364-a53386cd4580_2N3%f%82-D6%f%PKK-QTX%f%4D-2J%f%JYK-M96%f%P2_Subscription1_O365ProPlusRetail | ||
1437 | 16_bacd4614-5bef-4a5e-bafc-de4c788037a2_HN8%f%JP-87%f%TQJ-PBF%f%3P-Y6%f%6KC-W2K%f%9V_Subscription1_O365SmallBusPremRetail | ||
1438 | ) do ( | ||
1439 | for /f "tokens=1-5 delims=_" %%A in ("%%#") do ( | ||
1440 | if %1==getinfo if %oVer%==%%A if "%2"=="%%E" (set _key=%%C& set _actid=%%B& set _allactid=!_allactid! %%B&set _lic=%%D) | ||
1441 | |||
1442 | if %1==getmsiprod if %oVer%==%%A (find /i "%%E" %msitemp% %nul% && (if defined _oIds (set _oIds=!_oIds! %%E) else (set _oIds=%%E))) | ||
1443 | |||
1444 | ) | ||
1445 | ) | ||
1446 | exit /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 | |||
1455 | set 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 | ||
1457 | exit /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 | ||
1504 | if ($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 | ||
1513 | Remove-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) | ||
1522 | if ($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: | ||
1550 | TVqQAAMAAAAEAAAA//8AALgAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAgAAAAA4fug4AtAnNIbgBTM0hVGhpcyBwcm9ncmFtIGNhbm5vdCBiZSBydW4gaW4gRE9TIG1vZGUuDQ0KJAAAAAAAAABQRQAATAEHAMDc0GQAAAAAAAAAAOAA | ||
1551 | DiMLAQIoAAIAAAAeAAAAAAAAABAAAAAQAAAAAAAAAACAagAQAAAAAgAABAAAAAEAAAAGAAAAAAAAAACQAAAABAAAi9MAAAIAQAEAACAAABAAAAAAEAAAEAAAAAAAABAAAAAAQAAAjRAAAABgAAAYAQAAAHAAAHgDAAAAAAAAAAAAAAAAAAAAAAAAAIAAABQAAAAAAAAA | ||
1552 | AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABsYAAAHAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAC50ZXh0AAAAcAEAAAAQAAAAAgAAAAQAAAAAAAAAAAAAAAAAACAAAGAucmRhdGEAABgAAAAAIAAAAAIAAAAGAAAAAAAAAAAAAAAA | ||
1553 | AABAAABALmVoX2ZyYW2AAAAAADAAAAACAAAACAAAAAAAAAAAAAAAAAAAQAAAQC5lZGF0YQAAjRAAAABAAAAAEgAAAAoAAAAAAAAAAAAAAAAAAEAAAEAuaWRhdGEAABgBAAAAYAAAAAIAAAAcAAAAAAAAAAAAAAAAAABAAADALnJzcmMAAAB4AwAAAHAAAAAEAAAAHgAA | ||
1554 | AAAAAAAAAAAAAAAAQAAAwC5yZWxvYwAAFAAAAACAAAAAAgAAACIAAAAAAAAAAAAAAAAAAEAAAEIAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA | ||
1555 | AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA | ||
1556 | AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAALgBAAAAwgwAVYnlVlONRfCD7DDHRfAAAAAA | ||
1557 | iUQkFI1F9IlEJBCLRQzHRCQMAAAAAIlEJASLRQjHRCQIACCAaokEJMdF9AAAAADoAgEAAIs1eGCAaoPsGIXAicOLRfB0CokEJDHb/9ZR6zKLVfTHRCQECiCAaokEJIlUJAj/FYBggGqD7AyFwItF8IkEJHQK/9a7AQAAAFLrA//WUI1l+InYW15dw1WJ5VdWU4PsPItF | ||
1558 | GIt1HIlEJBCLRRSJdCQUiUQkDItFEIlEJAiLRQyJRCQEi0UIiQQk6HwAAAAxyYPsGInHhcB1XItFGDkIdlVr2SiLBgHYg3gQAHRFiUQkBItFCIlN5IkEJOj7/v//i03khcB1LAMex0MQAQAAAMdDFAAAAADHQxgAAAAAx0McAAAAAMdDIAAAAADHQyQAAAAAQeukjWX0 | ||
1559 | ifhbXl9dwhgAkP8lcGCAapCQ/yVsYIBqkJD/////AAAAAP////8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA | ||
1560 | AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAATgBhAG0AZQAAAEcAcgBhAGMAZQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA | ||
1561 | AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA | ||
1562 | AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA | ||
1563 | AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUAAAAAAAAAAF6UgABfAgBGwwEBIgBAAAQAAAAHAAAAODf//8IAAAAAAAAACQAAAAwAAAA | ||
1564 | 1N///50AAAAAQQ4IhQJCDQVIhgODBAKPw0HGQcUMBAQoAAAAWAAAAEng//+qAAAAAEEOCIUCQg0FRocDhgSDBQKbw0HGQcdBxQwEBAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA | ||
1565 | AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA | ||
1566 | AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA | ||
1567 | AAAAAAAAAAAAAAAAAADA3NBkAAAAAMZCAAABAAAAQwAAAEMAAAAoQAAANEEAAEBCAADPQgAA70IAAAVDAAApQwAAXUMAAKFDAADpQwAAF0QAADVEAABnRAAAnUQAAONEAAAtRQAAYUUAAJ9FAADTRQAADUYAADtGAABxRgAAr0YAAM9GAAD7RgAApRAAAFFHAABvRwAA | ||
1568 | n0cAANNHAAARSAAATUgAAG9IAAClSAAAzUgAAAVJAABBSQAAbUkAAKdJAAC7SQAA+0kAADlKAABPSgAAdUoAAJ1KAADTSgAAB0sAAD1LAABpSwAApUsAAONLAAANTAAAOUwAAIlMAADRTAAAEU0AAFlNAACjTQAA8U0AABtOAABHTgAAh04AALtOAADnTgAAK08AAFtP | ||
1569 | AAC1TwAA608AACdQAABdUAAA4kIAAP1CAAAaQwAARkMAAIJDAADIQwAAA0QAAClEAABRRAAAhUQAAMNEAAALRQAASkUAAINFAAC8RQAA80UAACdGAABZRgAAk0YAAMJGAADoRgAAGUcAADFHAABjRwAAikcAALxHAAD1RwAAMkgAAGFIAACNSAAAvEgAAOxIAAAmSQAA | ||
1570 | WkkAAI1JAAC0SQAA3kkAAB1KAABHSgAAZUoAAIxKAAC7SgAA8EoAACVLAABWSwAAiksAAMdLAAD7SwAAJkwAAGRMAACwTAAA9EwAADhNAACBTQAAzU0AAAlOAAA0TgAAak4AAKROAADUTgAADE8AAEZPAACLTwAA008AAAxQAABFUAAAeFAAAAAAAQACAAMABAAFAAYA | ||
1571 | BwAIAAkACgALAAwADQAOAA8AEAARABIAEwAUABUAFgAXABgAGQAaABsAHAAdAB4AHwAgACEAIgAjACQAJQAmACcAKAApACoAKwAsAC0ALgAvADAAMQAyADMANAA1ADYANwA4ADkAOgA7ADwAPQA+AD8AQABBAEIAc3BwYy5kbGwAU1BQQ1MuU0xDYWxsU2VydmVyAFNM | ||
1572 | Q2FsbFNlcnZlcgBTUFBDUy5TTENsb3NlAFNMQ2xvc2UAU1BQQ1MuU0xDb25zdW1lUmlnaHQAU0xDb25zdW1lUmlnaHQAU1BQQ1MuU0xEZXBvc2l0TWlncmF0aW9uQmxvYgBTTERlcG9zaXRNaWdyYXRpb25CbG9iAFNQUENTLlNMRGVwb3NpdE9mZmxpbmVDb25maXJt | ||
1573 | YXRpb25JZABTTERlcG9zaXRPZmZsaW5lQ29uZmlybWF0aW9uSWQAU1BQQ1MuU0xEZXBvc2l0T2ZmbGluZUNvbmZpcm1hdGlvbklkRXgAU0xEZXBvc2l0T2ZmbGluZUNvbmZpcm1hdGlvbklkRXgAU1BQQ1MuU0xEZXBvc2l0U3RvcmVUb2tlbgBTTERlcG9zaXRTdG9y | ||
1574 | ZVRva2VuAFNQUENTLlNMRmlyZUV2ZW50AFNMRmlyZUV2ZW50AFNQUENTLlNMR2F0aGVyTWlncmF0aW9uQmxvYgBTTEdhdGhlck1pZ3JhdGlvbkJsb2IAU1BQQ1MuU0xHYXRoZXJNaWdyYXRpb25CbG9iRXgAU0xHYXRoZXJNaWdyYXRpb25CbG9iRXgAU1BQQ1MuU0xH | ||
1575 | ZW5lcmF0ZU9mZmxpbmVJbnN0YWxsYXRpb25JZABTTEdlbmVyYXRlT2ZmbGluZUluc3RhbGxhdGlvbklkAFNQUENTLlNMR2VuZXJhdGVPZmZsaW5lSW5zdGFsbGF0aW9uSWRFeABTTEdlbmVyYXRlT2ZmbGluZUluc3RhbGxhdGlvbklkRXgAU1BQQ1MuU0xHZXRBY3Rp | ||
1576 | dmVMaWNlbnNlSW5mbwBTTEdldEFjdGl2ZUxpY2Vuc2VJbmZvAFNQUENTLlNMR2V0QXBwbGljYXRpb25JbmZvcm1hdGlvbgBTTEdldEFwcGxpY2F0aW9uSW5mb3JtYXRpb24AU1BQQ1MuU0xHZXRBcHBsaWNhdGlvblBvbGljeQBTTEdldEFwcGxpY2F0aW9uUG9saWN5 | ||
1577 | AFNQUENTLlNMR2V0QXV0aGVudGljYXRpb25SZXN1bHQAU0xHZXRBdXRoZW50aWNhdGlvblJlc3VsdABTUFBDUy5TTEdldEVuY3J5cHRlZFBJREV4AFNMR2V0RW5jcnlwdGVkUElERXgAU1BQQ1MuU0xHZXRHZW51aW5lSW5mb3JtYXRpb24AU0xHZXRHZW51aW5lSW5m | ||
1578 | b3JtYXRpb24AU1BQQ1MuU0xHZXRJbnN0YWxsZWRQcm9kdWN0S2V5SWRzAFNMR2V0SW5zdGFsbGVkUHJvZHVjdEtleUlkcwBTUFBDUy5TTEdldExpY2Vuc2UAU0xHZXRMaWNlbnNlAFNQUENTLlNMR2V0TGljZW5zZUZpbGVJZABTTEdldExpY2Vuc2VGaWxlSWQAU1BQ | ||
1579 | Q1MuU0xHZXRMaWNlbnNlSW5mb3JtYXRpb24AU0xHZXRMaWNlbnNlSW5mb3JtYXRpb24AU0xHZXRMaWNlbnNpbmdTdGF0dXNJbmZvcm1hdGlvbgBTUFBDUy5TTEdldFBLZXlJZABTTEdldFBLZXlJZABTUFBDUy5TTEdldFBLZXlJbmZvcm1hdGlvbgBTTEdldFBLZXlJ | ||
1580 | bmZvcm1hdGlvbgBTUFBDUy5TTEdldFBvbGljeUluZm9ybWF0aW9uAFNMR2V0UG9saWN5SW5mb3JtYXRpb24AU1BQQ1MuU0xHZXRQb2xpY3lJbmZvcm1hdGlvbkRXT1JEAFNMR2V0UG9saWN5SW5mb3JtYXRpb25EV09SRABTUFBDUy5TTEdldFByb2R1Y3RTa3VJbmZv | ||
1581 | cm1hdGlvbgBTTEdldFByb2R1Y3RTa3VJbmZvcm1hdGlvbgBTUFBDUy5TTEdldFNMSURMaXN0AFNMR2V0U0xJRExpc3QAU1BQQ1MuU0xHZXRTZXJ2aWNlSW5mb3JtYXRpb24AU0xHZXRTZXJ2aWNlSW5mb3JtYXRpb24AU1BQQ1MuU0xJbnN0YWxsTGljZW5zZQBTTElu | ||
1582 | c3RhbGxMaWNlbnNlAFNQUENTLlNMSW5zdGFsbFByb29mT2ZQdXJjaGFzZQBTTEluc3RhbGxQcm9vZk9mUHVyY2hhc2UAU1BQQ1MuU0xJbnN0YWxsUHJvb2ZPZlB1cmNoYXNlRXgAU0xJbnN0YWxsUHJvb2ZPZlB1cmNoYXNlRXgAU1BQQ1MuU0xJc0dlbnVpbmVMb2Nh | ||
1583 | bEV4AFNMSXNHZW51aW5lTG9jYWxFeABTUFBDUy5TTExvYWRBcHBsaWNhdGlvblBvbGljaWVzAFNMTG9hZEFwcGxpY2F0aW9uUG9saWNpZXMAU1BQQ1MuU0xPcGVuAFNMT3BlbgBTUFBDUy5TTFBlcnNpc3RBcHBsaWNhdGlvblBvbGljaWVzAFNMUGVyc2lzdEFwcGxp | ||
1584 | Y2F0aW9uUG9saWNpZXMAU1BQQ1MuU0xQZXJzaXN0UlRTUGF5bG9hZE92ZXJyaWRlAFNMUGVyc2lzdFJUU1BheWxvYWRPdmVycmlkZQBTUFBDUy5TTFJlQXJtAFNMUmVBcm0AU1BQQ1MuU0xSZWdpc3RlckV2ZW50AFNMUmVnaXN0ZXJFdmVudABTUFBDUy5TTFJlZ2lz | ||
1585 | dGVyUGx1Z2luAFNMUmVnaXN0ZXJQbHVnaW4AU1BQQ1MuU0xTZXRBdXRoZW50aWNhdGlvbkRhdGEAU0xTZXRBdXRoZW50aWNhdGlvbkRhdGEAU1BQQ1MuU0xTZXRDdXJyZW50UHJvZHVjdEtleQBTTFNldEN1cnJlbnRQcm9kdWN0S2V5AFNQUENTLlNMU2V0R2VudWlu | ||
1586 | ZUluZm9ybWF0aW9uAFNMU2V0R2VudWluZUluZm9ybWF0aW9uAFNQUENTLlNMVW5pbnN0YWxsTGljZW5zZQBTTFVuaW5zdGFsbExpY2Vuc2UAU1BQQ1MuU0xVbmluc3RhbGxQcm9vZk9mUHVyY2hhc2UAU0xVbmluc3RhbGxQcm9vZk9mUHVyY2hhc2UAU1BQQ1MuU0xV | ||
1587 | bmxvYWRBcHBsaWNhdGlvblBvbGljaWVzAFNMVW5sb2FkQXBwbGljYXRpb25Qb2xpY2llcwBTUFBDUy5TTFVucmVnaXN0ZXJFdmVudABTTFVucmVnaXN0ZXJFdmVudABTUFBDUy5TTFVucmVnaXN0ZXJQbHVnaW4AU0xVbnJlZ2lzdGVyUGx1Z2luAFNQUENTLlNMcEF1 | ||
1588 | dGhlbnRpY2F0ZUdlbnVpbmVUaWNrZXRSZXNwb25zZQBTTHBBdXRoZW50aWNhdGVHZW51aW5lVGlja2V0UmVzcG9uc2UAU1BQQ1MuU0xwQmVnaW5HZW51aW5lVGlja2V0VHJhbnNhY3Rpb24AU0xwQmVnaW5HZW51aW5lVGlja2V0VHJhbnNhY3Rpb24AU1BQQ1MuU0xw | ||
1589 | Q2xlYXJBY3RpdmF0aW9uSW5Qcm9ncmVzcwBTTHBDbGVhckFjdGl2YXRpb25JblByb2dyZXNzAFNQUENTLlNMcERlcG9zaXREb3dubGV2ZWxHZW51aW5lVGlja2V0AFNMcERlcG9zaXREb3dubGV2ZWxHZW51aW5lVGlja2V0AFNQUENTLlNMcERlcG9zaXRUb2tlbkFj | ||
1590 | dGl2YXRpb25SZXNwb25zZQBTTHBEZXBvc2l0VG9rZW5BY3RpdmF0aW9uUmVzcG9uc2UAU1BQQ1MuU0xwR2VuZXJhdGVUb2tlbkFjdGl2YXRpb25DaGFsbGVuZ2UAU0xwR2VuZXJhdGVUb2tlbkFjdGl2YXRpb25DaGFsbGVuZ2UAU1BQQ1MuU0xwR2V0R2VudWluZUJs | ||
1591 | b2IAU0xwR2V0R2VudWluZUJsb2IAU1BQQ1MuU0xwR2V0R2VudWluZUxvY2FsAFNMcEdldEdlbnVpbmVMb2NhbABTUFBDUy5TTHBHZXRMaWNlbnNlQWNxdWlzaXRpb25JbmZvAFNMcEdldExpY2Vuc2VBY3F1aXNpdGlvbkluZm8AU1BQQ1MuU0xwR2V0TVNQaWRJbmZv | ||
1592 | cm1hdGlvbgBTTHBHZXRNU1BpZEluZm9ybWF0aW9uAFNQUENTLlNMcEdldE1hY2hpbmVVR1VJRABTTHBHZXRNYWNoaW5lVUdVSUQAU1BQQ1MuU0xwR2V0VG9rZW5BY3RpdmF0aW9uR3JhbnRJbmZvAFNMcEdldFRva2VuQWN0aXZhdGlvbkdyYW50SW5mbwBTUFBDUy5T | ||
1593 | THBJQUFjdGl2YXRlUHJvZHVjdABTTHBJQUFjdGl2YXRlUHJvZHVjdABTUFBDUy5TTHBJc0N1cnJlbnRJbnN0YWxsZWRQcm9kdWN0S2V5RGVmYXVsdEtleQBTTHBJc0N1cnJlbnRJbnN0YWxsZWRQcm9kdWN0S2V5RGVmYXVsdEtleQBTUFBDUy5TTHBQcm9jZXNzVk1Q | ||
1594 | aXBlTWVzc2FnZQBTTHBQcm9jZXNzVk1QaXBlTWVzc2FnZQBTUFBDUy5TTHBTZXRBY3RpdmF0aW9uSW5Qcm9ncmVzcwBTTHBTZXRBY3RpdmF0aW9uSW5Qcm9ncmVzcwBTUFBDUy5TTHBUcmlnZ2VyU2VydmljZVdvcmtlcgBTTHBUcmlnZ2VyU2VydmljZVdvcmtlcgBT | ||
1595 | UFBDUy5TTHBWTEFjdGl2YXRlUHJvZHVjdABTTHBWTEFjdGl2YXRlUHJvZHVjdAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA | ||
1596 | AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA | ||
1597 | AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFBgAAAAAAAAAAAAAOhgAABsYAAAXGAAAAAAAAAAAAAA | ||
1598 | +GAAAHhgAABkYAAAAAAAAAAAAAAMYQAAgGAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAiGAAAKpgAAAAAAAAyGAAAAAAAADUYAAAAAAAAIhgAACqYAAAAAAAAMhgAAAAAAAA1GAAAAAAAAACAFNMR2V0TGljZW5zaW5nU3RhdHVzSW5mb3JtYXRpb24AAQBTTEdldFByb2R1 | ||
1599 | Y3RTa3VJbmZvcm1hdGlvbgAA3QNMb2NhbEZyZWUARwFTdHJTdHJOSVcAAGAAAABgAABzcHBjcy5kbGwAAAAUYAAAS0VSTkVMMzIuZGxsAAAAAChgAABTSExXQVBJLmRsbAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA | ||
1600 | AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA | ||
1601 | AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABABAAAAAYAACAAAAAAAAAAAAAAAAAAAABAAEAAAAwAACAAAAAAAAAAAAAAAAAAAABAAkEAABIAAAAWHAAABwDAAAAAAAAAAAAABwDNAAAAFYAUwBfAFYARQBSAFMASQBPAE4AXwBJAE4A | ||
1602 | RgBPAAAAAAC9BO/+AAABAAMAAAAAAAAAAwAAAAAAAAAAAAAAAAAAAAQABAACAAAAAAAAAAAAAAAAAAAAfAIAAAEAUwB0AHIAaQBuAGcARgBpAGwAZQBJAG4AZgBvAAAAWAIAAAEAMAA0ADAAOQAwADQARQA0AAAAegAtAAEAQwBvAG0AcABhAG4AeQBOAGEAbQBlAAAA | ||
1603 | AABBAG4AbwBtAGEAbABvAHUAcwAgAFMAbwBmAHQAdwBhAHIAZQAgAEQAZQB0AGUAcgBpAG8AcgBhAHQAaQBvAG4AIABDAG8AcgBwAG8AcgBhAHQAaQBvAG4AAAAAAD4ACwABAEYAaQBsAGUARABlAHMAYwByAGkAcAB0AGkAbwBuAAAAAABvAGgAbwBvAGsAIABTAFAA | ||
1604 | UABDAAAAAAAwAAgAAQBGAGkAbABlAFYAZQByAHMAaQBvAG4AAAAAADAALgAzAC4AMAAuADAAAAAqAAUAAQBJAG4AdABlAHIAbgBhAGwATgBhAG0AZQAAAHMAcABwAGMAAAAAAIwANAABAEwAZQBnAGEAbABDAG8AcAB5AHIAaQBnAGgAdAAAAKkAIAAyADAAMgAzACAA | ||
1605 | QQBuAG8AbQBhAGwAbwB1AHMAIABTAG8AZgB0AHcAYQByAGUAIABEAGUAdABlAHIAaQBvAHIAYQB0AGkAbwBuACAAQwBvAHIAcABvAHIAYQB0AGkAbwBuAAAAOgAJAAEATwByAGkAZwBpAG4AYQBsAEYAaQBsAGUAbgBhAG0AZQAAAHMAcABwAGMALgBkAGwAbAAAAAAA | ||
1606 | LAAGAAEAUAByAG8AZAB1AGMAdABOAGEAbQBlAAAAAABvAGgAbwBvAGsAAAA0AAgAAQBQAHIAbwBkAHUAYwB0AFYAZQByAHMAaQBvAG4AAAAwAC4AMwAuADAALgAwAAAARAAAAAEAVgBhAHIARgBpAGwAZQBJAG4AZgBvAAAAAAAkAAQAAABUAHIAYQBuAHMAbABhAHQA | ||
1607 | aQBvAG4AAAAAAAkE5AQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA | ||
1608 | AAAAAAAQAAAUAAAAOzBQMHEwfjBSMVoxAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA | ||
1609 | AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA | ||
1610 | AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA | ||
1611 | AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA | ||
1612 | :sppc32.dll: | ||
1613 | |||
1614 | :======================================================================================================================================== | ||
1615 | |||
1616 | :sppc64.dll: | ||
1617 | TVqQAAMAAAAEAAAA//8AALgAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAgAAAAA4fug4AtAnNIbgBTM0hVGhpcyBwcm9ncmFtIGNhbm5vdCBiZSBydW4gaW4gRE9TIG1vZGUuDQ0KJAAAAAAAAABQRQAAZIYHAMDc0GQAAAAAAAAAAPAA | ||
1618 | LiILAgIoAAIAAAAeAAAAAAAAABAAAAAQAAAAAJIxAgAAAAAQAAAAAgAABAAAAAAAAAAGAAAAAAAAAACQAAAABAAA39AAAAIAYAEAACAAAAAAAAAQAAAAAAAAAAAQAAAAAAAAEAAAAAAAAAAAAAAQAAAAAFAAAI0QAAAAcAAAUAEAAACAAAB4AwAAADAAACQAAAAAAAAA | ||
1619 | AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAiHAAADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAudGV4dAAAAHABAAAAEAAAAAIAAAAEAAAAAAAAAAAAAAAAAAAgAABgLnJkYXRhAAAgAAAAACAAAAAC | ||
1620 | AAAABgAAAAAAAAAAAAAAAAAAQAAAQC5wZGF0YQAAJAAAAAAwAAAAAgAAAAgAAAAAAAAAAAAAAAAAAEAAAEAueGRhdGEAACQAAAAAQAAAAAIAAAAKAAAAAAAAAAAAAAAAAABAAABALmVkYXRhAACNEAAAAFAAAAASAAAADAAAAAAAAAAAAAAAAAAAQAAAQC5pZGF0YQAA | ||
1621 | UAEAAABwAAAAAgAAAB4AAAAAAAAAAAAAAAAAAEAAAMAucnNyYwAAAHgDAAAAgAAAAAQAAAAgAAAAAAAAAAAAAAAAAABAAADAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA | ||
1622 | AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA | ||
1623 | AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAALgBAAAAw0FUU0iD7EhFMclMjQXpDwAASI1E | ||
1624 | JDjHRCQ0AAAAAEiJRCQoSI1EJDRIiUQkIEjHRCQ4AAAAAOj/AAAASItMJDhIix1TYAAAhcBBicR0B//TRTHk6yhEi0QkNEiNFaMPAAD/FUNgAABIi0wkOEiFwHQK/9NBvAEAAADrAv/TRIngSIPESFtBXMNBVUFUVVdWU0iD7Dgx9kyLrCSQAAAASIusJJgAAABMiWwk | ||
1625 | IEiJz0iJbCQo6IoAAABBicSFwHVEQTl1AHY+SGveKEiLVQBIAdqDehAAdChIifnoIv///4XAdRxIA10ASMdDEAEAAABIx0MYAAAAAEjHQyAAAAAASP/G67xEieBIg8Q4W15fXUFcQV3DkJCQkJCQkP8lel8AAJCQDx+EAAAAAAD/JXpfAACQkA8fhAAAAAAA/yVKXwAA | ||
1626 | kJD/JTpfAACQkP//////////AAAAAAAAAAD//////////wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA | ||
1627 | AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAATgBhAG0AZQAAAEcAcgBhAGMAZQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA | ||
1628 | AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA | ||
1629 | AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA | ||
1630 | AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAABhAAAABAAAAGEAAAjhAAAARAAACOEAAAGREAABBAAAAAAAAAAAAAAAAAAAAAAAAA | ||
1631 | AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA | ||
1632 | AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA | ||
1633 | AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA | ||
1634 | AAAAAAAAAAAAAAEAAAABBwMAB4IDMALAAAABDAcADGIIMAdgBnAFUATAAtAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA | ||
1635 | AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA | ||
1636 | AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA | ||
1637 | AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAMDc0GQAAAAAxlIAAAEAAABDAAAAQwAAAChQAAA0UQAAQFIAAM9SAADvUgAABVMAAClTAABdUwAAoVMAAOlTAAAXVAAANVQAAGdU | ||
1638 | AACdVAAA41QAAC1VAABhVQAAn1UAANNVAAANVgAAO1YAAHFWAACvVgAAz1YAAPtWAACOEAAAUVcAAG9XAACfVwAA01cAABFYAABNWAAAb1gAAKVYAADNWAAABVkAAEFZAABtWQAAp1kAALtZAAD7WQAAOVoAAE9aAAB1WgAAnVoAANNaAAAHWwAAPVsAAGlbAAClWwAA | ||
1639 | 41sAAA1cAAA5XAAAiVwAANFcAAARXQAAWV0AAKNdAADxXQAAG14AAEdeAACHXgAAu14AAOdeAAArXwAAW18AALVfAADrXwAAJ2AAAF1gAADiUgAA/VIAABpTAABGUwAAglMAAMhTAAADVAAAKVQAAFFUAACFVAAAw1QAAAtVAABKVQAAg1UAALxVAADzVQAAJ1YAAFlW | ||
1640 | AACTVgAAwlYAAOhWAAAZVwAAMVcAAGNXAACKVwAAvFcAAPVXAAAyWAAAYVgAAI1YAAC8WAAA7FgAACZZAABaWQAAjVkAALRZAADeWQAAHVoAAEdaAABlWgAAjFoAALtaAADwWgAAJVsAAFZbAACKWwAAx1sAAPtbAAAmXAAAZFwAALBcAAD0XAAAOF0AAIFdAADNXQAA | ||
1641 | CV4AADReAABqXgAApF4AANReAAAMXwAARl8AAItfAADTXwAADGAAAEVgAAB4YAAAAAABAAIAAwAEAAUABgAHAAgACQAKAAsADAANAA4ADwAQABEAEgATABQAFQAWABcAGAAZABoAGwAcAB0AHgAfACAAIQAiACMAJAAlACYAJwAoACkAKgArACwALQAuAC8AMAAxADIA | ||
1642 | MwA0ADUANgA3ADgAOQA6ADsAPAA9AD4APwBAAEEAQgBzcHBjLmRsbABTUFBDUy5TTENhbGxTZXJ2ZXIAU0xDYWxsU2VydmVyAFNQUENTLlNMQ2xvc2UAU0xDbG9zZQBTUFBDUy5TTENvbnN1bWVSaWdodABTTENvbnN1bWVSaWdodABTUFBDUy5TTERlcG9zaXRNaWdy | ||
1643 | YXRpb25CbG9iAFNMRGVwb3NpdE1pZ3JhdGlvbkJsb2IAU1BQQ1MuU0xEZXBvc2l0T2ZmbGluZUNvbmZpcm1hdGlvbklkAFNMRGVwb3NpdE9mZmxpbmVDb25maXJtYXRpb25JZABTUFBDUy5TTERlcG9zaXRPZmZsaW5lQ29uZmlybWF0aW9uSWRFeABTTERlcG9zaXRP | ||
1644 | ZmZsaW5lQ29uZmlybWF0aW9uSWRFeABTUFBDUy5TTERlcG9zaXRTdG9yZVRva2VuAFNMRGVwb3NpdFN0b3JlVG9rZW4AU1BQQ1MuU0xGaXJlRXZlbnQAU0xGaXJlRXZlbnQAU1BQQ1MuU0xHYXRoZXJNaWdyYXRpb25CbG9iAFNMR2F0aGVyTWlncmF0aW9uQmxvYgBT | ||
1645 | UFBDUy5TTEdhdGhlck1pZ3JhdGlvbkJsb2JFeABTTEdhdGhlck1pZ3JhdGlvbkJsb2JFeABTUFBDUy5TTEdlbmVyYXRlT2ZmbGluZUluc3RhbGxhdGlvbklkAFNMR2VuZXJhdGVPZmZsaW5lSW5zdGFsbGF0aW9uSWQAU1BQQ1MuU0xHZW5lcmF0ZU9mZmxpbmVJbnN0 | ||
1646 | YWxsYXRpb25JZEV4AFNMR2VuZXJhdGVPZmZsaW5lSW5zdGFsbGF0aW9uSWRFeABTUFBDUy5TTEdldEFjdGl2ZUxpY2Vuc2VJbmZvAFNMR2V0QWN0aXZlTGljZW5zZUluZm8AU1BQQ1MuU0xHZXRBcHBsaWNhdGlvbkluZm9ybWF0aW9uAFNMR2V0QXBwbGljYXRpb25J | ||
1647 | bmZvcm1hdGlvbgBTUFBDUy5TTEdldEFwcGxpY2F0aW9uUG9saWN5AFNMR2V0QXBwbGljYXRpb25Qb2xpY3kAU1BQQ1MuU0xHZXRBdXRoZW50aWNhdGlvblJlc3VsdABTTEdldEF1dGhlbnRpY2F0aW9uUmVzdWx0AFNQUENTLlNMR2V0RW5jcnlwdGVkUElERXgAU0xH | ||
1648 | ZXRFbmNyeXB0ZWRQSURFeABTUFBDUy5TTEdldEdlbnVpbmVJbmZvcm1hdGlvbgBTTEdldEdlbnVpbmVJbmZvcm1hdGlvbgBTUFBDUy5TTEdldEluc3RhbGxlZFByb2R1Y3RLZXlJZHMAU0xHZXRJbnN0YWxsZWRQcm9kdWN0S2V5SWRzAFNQUENTLlNMR2V0TGljZW5z | ||
1649 | ZQBTTEdldExpY2Vuc2UAU1BQQ1MuU0xHZXRMaWNlbnNlRmlsZUlkAFNMR2V0TGljZW5zZUZpbGVJZABTUFBDUy5TTEdldExpY2Vuc2VJbmZvcm1hdGlvbgBTTEdldExpY2Vuc2VJbmZvcm1hdGlvbgBTTEdldExpY2Vuc2luZ1N0YXR1c0luZm9ybWF0aW9uAFNQUENT | ||
1650 | LlNMR2V0UEtleUlkAFNMR2V0UEtleUlkAFNQUENTLlNMR2V0UEtleUluZm9ybWF0aW9uAFNMR2V0UEtleUluZm9ybWF0aW9uAFNQUENTLlNMR2V0UG9saWN5SW5mb3JtYXRpb24AU0xHZXRQb2xpY3lJbmZvcm1hdGlvbgBTUFBDUy5TTEdldFBvbGljeUluZm9ybWF0 | ||
1651 | aW9uRFdPUkQAU0xHZXRQb2xpY3lJbmZvcm1hdGlvbkRXT1JEAFNQUENTLlNMR2V0UHJvZHVjdFNrdUluZm9ybWF0aW9uAFNMR2V0UHJvZHVjdFNrdUluZm9ybWF0aW9uAFNQUENTLlNMR2V0U0xJRExpc3QAU0xHZXRTTElETGlzdABTUFBDUy5TTEdldFNlcnZpY2VJ | ||
1652 | bmZvcm1hdGlvbgBTTEdldFNlcnZpY2VJbmZvcm1hdGlvbgBTUFBDUy5TTEluc3RhbGxMaWNlbnNlAFNMSW5zdGFsbExpY2Vuc2UAU1BQQ1MuU0xJbnN0YWxsUHJvb2ZPZlB1cmNoYXNlAFNMSW5zdGFsbFByb29mT2ZQdXJjaGFzZQBTUFBDUy5TTEluc3RhbGxQcm9v | ||
1653 | Zk9mUHVyY2hhc2VFeABTTEluc3RhbGxQcm9vZk9mUHVyY2hhc2VFeABTUFBDUy5TTElzR2VudWluZUxvY2FsRXgAU0xJc0dlbnVpbmVMb2NhbEV4AFNQUENTLlNMTG9hZEFwcGxpY2F0aW9uUG9saWNpZXMAU0xMb2FkQXBwbGljYXRpb25Qb2xpY2llcwBTUFBDUy5T | ||
1654 | TE9wZW4AU0xPcGVuAFNQUENTLlNMUGVyc2lzdEFwcGxpY2F0aW9uUG9saWNpZXMAU0xQZXJzaXN0QXBwbGljYXRpb25Qb2xpY2llcwBTUFBDUy5TTFBlcnNpc3RSVFNQYXlsb2FkT3ZlcnJpZGUAU0xQZXJzaXN0UlRTUGF5bG9hZE92ZXJyaWRlAFNQUENTLlNMUmVB | ||
1655 | cm0AU0xSZUFybQBTUFBDUy5TTFJlZ2lzdGVyRXZlbnQAU0xSZWdpc3RlckV2ZW50AFNQUENTLlNMUmVnaXN0ZXJQbHVnaW4AU0xSZWdpc3RlclBsdWdpbgBTUFBDUy5TTFNldEF1dGhlbnRpY2F0aW9uRGF0YQBTTFNldEF1dGhlbnRpY2F0aW9uRGF0YQBTUFBDUy5T | ||
1656 | TFNldEN1cnJlbnRQcm9kdWN0S2V5AFNMU2V0Q3VycmVudFByb2R1Y3RLZXkAU1BQQ1MuU0xTZXRHZW51aW5lSW5mb3JtYXRpb24AU0xTZXRHZW51aW5lSW5mb3JtYXRpb24AU1BQQ1MuU0xVbmluc3RhbGxMaWNlbnNlAFNMVW5pbnN0YWxsTGljZW5zZQBTUFBDUy5T | ||
1657 | TFVuaW5zdGFsbFByb29mT2ZQdXJjaGFzZQBTTFVuaW5zdGFsbFByb29mT2ZQdXJjaGFzZQBTUFBDUy5TTFVubG9hZEFwcGxpY2F0aW9uUG9saWNpZXMAU0xVbmxvYWRBcHBsaWNhdGlvblBvbGljaWVzAFNQUENTLlNMVW5yZWdpc3RlckV2ZW50AFNMVW5yZWdpc3Rl | ||
1658 | ckV2ZW50AFNQUENTLlNMVW5yZWdpc3RlclBsdWdpbgBTTFVucmVnaXN0ZXJQbHVnaW4AU1BQQ1MuU0xwQXV0aGVudGljYXRlR2VudWluZVRpY2tldFJlc3BvbnNlAFNMcEF1dGhlbnRpY2F0ZUdlbnVpbmVUaWNrZXRSZXNwb25zZQBTUFBDUy5TTHBCZWdpbkdlbnVp | ||
1659 | bmVUaWNrZXRUcmFuc2FjdGlvbgBTTHBCZWdpbkdlbnVpbmVUaWNrZXRUcmFuc2FjdGlvbgBTUFBDUy5TTHBDbGVhckFjdGl2YXRpb25JblByb2dyZXNzAFNMcENsZWFyQWN0aXZhdGlvbkluUHJvZ3Jlc3MAU1BQQ1MuU0xwRGVwb3NpdERvd25sZXZlbEdlbnVpbmVU | ||
1660 | aWNrZXQAU0xwRGVwb3NpdERvd25sZXZlbEdlbnVpbmVUaWNrZXQAU1BQQ1MuU0xwRGVwb3NpdFRva2VuQWN0aXZhdGlvblJlc3BvbnNlAFNMcERlcG9zaXRUb2tlbkFjdGl2YXRpb25SZXNwb25zZQBTUFBDUy5TTHBHZW5lcmF0ZVRva2VuQWN0aXZhdGlvbkNoYWxs | ||
1661 | ZW5nZQBTTHBHZW5lcmF0ZVRva2VuQWN0aXZhdGlvbkNoYWxsZW5nZQBTUFBDUy5TTHBHZXRHZW51aW5lQmxvYgBTTHBHZXRHZW51aW5lQmxvYgBTUFBDUy5TTHBHZXRHZW51aW5lTG9jYWwAU0xwR2V0R2VudWluZUxvY2FsAFNQUENTLlNMcEdldExpY2Vuc2VBY3F1 | ||
1662 | aXNpdGlvbkluZm8AU0xwR2V0TGljZW5zZUFjcXVpc2l0aW9uSW5mbwBTUFBDUy5TTHBHZXRNU1BpZEluZm9ybWF0aW9uAFNMcEdldE1TUGlkSW5mb3JtYXRpb24AU1BQQ1MuU0xwR2V0TWFjaGluZVVHVUlEAFNMcEdldE1hY2hpbmVVR1VJRABTUFBDUy5TTHBHZXRU | ||
1663 | b2tlbkFjdGl2YXRpb25HcmFudEluZm8AU0xwR2V0VG9rZW5BY3RpdmF0aW9uR3JhbnRJbmZvAFNQUENTLlNMcElBQWN0aXZhdGVQcm9kdWN0AFNMcElBQWN0aXZhdGVQcm9kdWN0AFNQUENTLlNMcElzQ3VycmVudEluc3RhbGxlZFByb2R1Y3RLZXlEZWZhdWx0S2V5 | ||
1664 | AFNMcElzQ3VycmVudEluc3RhbGxlZFByb2R1Y3RLZXlEZWZhdWx0S2V5AFNQUENTLlNMcFByb2Nlc3NWTVBpcGVNZXNzYWdlAFNMcFByb2Nlc3NWTVBpcGVNZXNzYWdlAFNQUENTLlNMcFNldEFjdGl2YXRpb25JblByb2dyZXNzAFNMcFNldEFjdGl2YXRpb25JblBy | ||
1665 | b2dyZXNzAFNQUENTLlNMcFRyaWdnZXJTZXJ2aWNlV29ya2VyAFNMcFRyaWdnZXJTZXJ2aWNlV29ya2VyAFNQUENTLlNMcFZMQWN0aXZhdGVQcm9kdWN0AFNMcFZMQWN0aXZhdGVQcm9kdWN0AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA | ||
1666 | AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA | ||
1667 | AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA | ||
1668 | AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUHAAAAAAAAAAAAAAIHEAAIhwAABocAAAAAAAAAAAAAAwcQAAoHAAAHhwAAAAAAAAAAAAAERxAACwcAAAAAAAAAAAAAAAAAAAAAAAAAAAAADAcAAAAAAAAOJwAAAAAAAAAAAAAAAAAAAAcQAAAAAAAAAAAAAAAAAA | ||
1669 | DHEAAAAAAAAAAAAAAAAAAMBwAAAAAAAA4nAAAAAAAAAAAAAAAAAAAABxAAAAAAAAAAAAAAAAAAAMcQAAAAAAAAAAAAAAAAAAAgBTTEdldExpY2Vuc2luZ1N0YXR1c0luZm9ybWF0aW9uAAEAU0xHZXRQcm9kdWN0U2t1SW5mb3JtYXRpb24AAOgDTG9jYWxGcmVlAFEB | ||
1670 | U3RyU3RyTklXAABwAAAAcAAAc3BwY3MuZGxsAAAAFHAAAEtFUk5FTDMyLmRsbAAAAAAocAAAU0hMV0FQSS5kbGwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA | ||
1671 | AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAEAAAABgAAIAAAAAAAAAAAAAAAAAAAAEAAQAAADAAAIAAAAAAAAAAAAAA | ||
1672 | AAAAAAEACQQAAEgAAABYgAAAHAMAAAAAAAAAAAAAHAM0AAAAVgBTAF8AVgBFAFIAUwBJAE8ATgBfAEkATgBGAE8AAAAAAL0E7/4AAAEAAwAAAAAAAAADAAAAAAAAAAAAAAAAAAAABAAEAAIAAAAAAAAAAAAAAAAAAAB8AgAAAQBTAHQAcgBpAG4AZwBGAGkAbABlAEkA | ||
1673 | bgBmAG8AAABYAgAAAQAwADQAMAA5ADAANABFADQAAAB6AC0AAQBDAG8AbQBwAGEAbgB5AE4AYQBtAGUAAAAAAEEAbgBvAG0AYQBsAG8AdQBzACAAUwBvAGYAdAB3AGEAcgBlACAARABlAHQAZQByAGkAbwByAGEAdABpAG8AbgAgAEMAbwByAHAAbwByAGEAdABpAG8A | ||
1674 | bgAAAAAAPgALAAEARgBpAGwAZQBEAGUAcwBjAHIAaQBwAHQAaQBvAG4AAAAAAG8AaABvAG8AawAgAFMAUABQAEMAAAAAADAACAABAEYAaQBsAGUAVgBlAHIAcwBpAG8AbgAAAAAAMAAuADMALgAwAC4AMAAAACoABQABAEkAbgB0AGUAcgBuAGEAbABOAGEAbQBlAAAA | ||
1675 | cwBwAHAAYwAAAAAAjAA0AAEATABlAGcAYQBsAEMAbwBwAHkAcgBpAGcAaAB0AAAAqQAgADIAMAAyADMAIABBAG4AbwBtAGEAbABvAHUAcwAgAFMAbwBmAHQAdwBhAHIAZQAgAEQAZQB0AGUAcgBpAG8AcgBhAHQAaQBvAG4AIABDAG8AcgBwAG8AcgBhAHQAaQBvAG4A | ||
1676 | AAA6AAkAAQBPAHIAaQBnAGkAbgBhAGwARgBpAGwAZQBuAGEAbQBlAAAAcwBwAHAAYwAuAGQAbABsAAAAAAAsAAYAAQBQAHIAbwBkAHUAYwB0AE4AYQBtAGUAAAAAAG8AaABvAG8AawAAADQACAABAFAAcgBvAGQAdQBjAHQAVgBlAHIAcwBpAG8AbgAAADAALgAzAC4A | ||
1677 | MAAuADAAAABEAAAAAQBWAGEAcgBGAGkAbABlAEkAbgBmAG8AAAAAACQABAAAAFQAcgBhAG4AcwBsAGEAdABpAG8AbgAAAAAACQTkBAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA | ||
1678 | AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA | ||
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 | |||
27 | set "PATH=%SystemRoot%\System32;%SystemRoot%\System32\wbem;%SystemRoot%\System32\WindowsPowerShell\v1.0\" | ||
28 | if exist "%SystemRoot%\Sysnative\reg.exe" ( | ||
29 | set "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" | |||
30 | for %%# in (%*) do ( | 36 | for %%# in (%*) do ( |
31 | if /i "%%#"=="r1" set r1=1 | 37 | if /i "%%#"=="r1" set r1=1 |
32 | if /i "%%#"=="r2" set r2=1 | 38 | if /i "%%#"=="r2" set r2=1 |
39 | if /i "%%#"=="-qedit" ( | ||
40 | reg add HKCU\Console /v QuickEdit /t REG_DWORD /d "1" /f 1>nul | ||
41 | rem check the code below admin elevation to understand why it's here | ||
42 | ) | ||
33 | ) | 43 | ) |
34 | 44 | ||
35 | if exist %SystemRoot%\Sysnative\cmd.exe if not defined r1 ( | 45 | if exist %SystemRoot%\Sysnative\cmd.exe if not defined r1 ( |
@@ -46,22 +56,34 @@ start %SystemRoot%\SysArm32\cmd.exe /c ""!_cmdf!" %* r2" | |||
46 | exit /b | 56 | exit /b |
47 | ) | 57 | ) |
48 | 58 | ||
49 | :: Set Path variable, it helps if it is misconfigured in the system | 59 | ::======================================================================================================================================== |
50 | 60 | ||
51 | set "PATH=%SystemRoot%\System32;%SystemRoot%\System32\wbem;%SystemRoot%\System32\WindowsPowerShell\v1.0\" | 61 | set "blank=" |
52 | if exist "%SystemRoot%\Sysnative\reg.exe" ( | 62 | set "mas=mass%blank%grave.dev" |
53 | set "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 | |||
66 | sc query Null | find /i "RUNNING" | ||
67 | if %errorlevel% NEQ 0 ( | ||
68 | echo: | ||
69 | echo Null service is not running, script may crash... | ||
70 | echo: | ||
71 | echo: | ||
72 | echo Help - https://%mas%/troubleshoot.html | ||
73 | echo: | ||
74 | echo: | ||
75 | ping 127.0.0.1 -n 10 | ||
54 | ) | 76 | ) |
77 | cls | ||
55 | 78 | ||
56 | :: Check LF line ending | 79 | :: Check LF line ending |
57 | 80 | ||
58 | pushd "%~dp0" | 81 | pushd "%~dp0" |
59 | >nul findstr /rxc:".*" "%~nx0" | 82 | >nul findstr /v "$" "%~nx0" && ( |
60 | if not %errorlevel%==0 ( | ||
61 | echo: | 83 | echo: |
62 | echo Error: Script either has LF line ending issue, or it failed to read itself. | 84 | echo Error: Script either has LF line ending issue or an empty line at the end of the script is missing. |
63 | echo: | 85 | echo: |
64 | ping 127.0.0.1 -n 6 > nul | 86 | ping 127.0.0.1 -n 6 >nul |
65 | popd | 87 | popd |
66 | exit /b | 88 | exit /b |
67 | ) | 89 | ) |
@@ -96,8 +118,7 @@ set _unattendedact= | |||
96 | set _args=%* | 118 | set _args=%* |
97 | if defined _args set _args=%_args:"=% | 119 | if defined _args set _args=%_args:"=% |
98 | if defined _args ( | 120 | if defined _args ( |
99 | set _unattended=1 | 121 | echo "%_args%" | find /i "/KMS" >nul && set _unattended=1 |
100 | if "%_args%"=="-el" set _unattended= | ||
101 | 122 | ||
102 | for %%A in (%_args%) do ( | 123 | for %%A in (%_args%) do ( |
103 | if /i "%%A"=="-el" (set _elev=1 | 124 | if /i "%%A"=="-el" (set _elev=1 |
@@ -116,9 +137,9 @@ if /i "%%A"=="-el" (set _elev=1 | |||
116 | 137 | ||
117 | ::======================================================================================================================================== | 138 | ::======================================================================================================================================== |
118 | 139 | ||
119 | set winbuild=1 | ||
120 | set "nul=>nul 2>&1" | 140 | set "nul=>nul 2>&1" |
121 | set psc=powershell.exe | 141 | set psc=powershell.exe |
142 | set winbuild=1 | ||
122 | for /f "tokens=6 delims=[]. " %%G in ('ver') do set winbuild=%%G | 143 | for /f "tokens=6 delims=[]. " %%G in ('ver') do set winbuild=%%G |
123 | 144 | ||
124 | set _NCS=1 | 145 | set _NCS=1 |
@@ -136,7 +157,7 @@ if %_Debug% EQU 1 set _unattended=1 | |||
136 | 157 | ||
137 | if %winbuild% LSS 7600 ( | 158 | if %winbuild% LSS 7600 ( |
138 | %nceline% | 159 | %nceline% |
139 | echo Unsupported OS version detected. | 160 | echo Unsupported OS version detected [%winbuild%]. |
140 | echo Project is supported for Windows 7/8/8.1/10/11 and their Server equivalent. | 161 | echo Project is supported for Windows 7/8/8.1/10/11 and their Server equivalent. |
141 | goto Done | 162 | goto 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 || ( |
185 | if not defined _elev %nul% %psc% "start cmd.exe -arg '/c \"!_PSarg:'=''!\"' -verb runas" && exit /b | 206 | if not defined _elev %psc% "start cmd.exe -arg '/c \"!_PSarg:'=''!\"' -verb runas" && exit /b |
186 | %nceline% | 207 | %nceline% |
187 | echo This script require admin privileges. | 208 | echo This script require admin privileges. |
188 | echo To do so, right click on this script and select 'Run as administrator'. | 209 | echo 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 | |||
218 | if defined _unattended set quedit=1 | ||
219 | for %%# in (%_args%) do (if /i "%%#"=="-qedit" set quedit=1) | ||
220 | |||
221 | reg query HKCU\Console /v QuickEdit 2>nul | find /i "0x0" %nul% || if not defined quedit ( | ||
222 | reg add HKCU\Console /v QuickEdit /t REG_DWORD /d "0" /f %nul% | ||
223 | start cmd.exe /c ""!_batf!" %_args% -qedit" | ||
224 | rem quickedit reset code is added at the starting of the script instead of here because it takes time to reflect in some cases | ||
225 | exit /b | ||
226 | ) | ||
227 | |||
228 | ::======================================================================================================================================== | ||
229 | |||
194 | if %~z0 GEQ 300000 (set "_exitmsg=Go back") else (set "_exitmsg=Exit") | 230 | if %~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 | ||
253 | set _tskinstalled= | 289 | set _tskinstalled= |
254 | reg query "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Schedule\taskcache\tasks" /f Path /s | find /i "\Activation-Renewal" >nul && ( | 290 | reg query "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Schedule\taskcache\tasks" /f Path /s | find /i "\Activation-Renewal" >nul && ( |
255 | find /i "Ver:1.8" %ProgramData%\Activation-Renewal\Activation_task.cmd %nul% && set _tskinstalled=1 | 291 | find /i "Ver:1.9" "%ProgramFiles%\Activation-Renewal\Activation_task.cmd" %nul% && set _tskinstalled=1 |
256 | ) | 292 | ) |
257 | 293 | ||
258 | set _oldtsk= | 294 | set _oldtsk= |
@@ -382,7 +418,12 @@ set "_log=%~dpn0" | |||
382 | set "_work=%~dp0" | 418 | set "_work=%~dp0" |
383 | if "%_work:~-1%"=="\" set "_work=%_work:~0,-1%" | 419 | if "%_work:~-1%"=="\" set "_work=%_work:~0,-1%" |
384 | set _UNC=0 | 420 | set _UNC=0 |
385 | if "%_work:~0,2%"=="\\" set _UNC=1 | 421 | if "%_work:~0,2%"=="\\" ( |
422 | set _UNC=1 | ||
423 | ) else ( | ||
424 | net use %~d0 %_Null% | ||
425 | if not errorlevel 1 set _UNC=1 | ||
426 | ) | ||
386 | for /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" | 427 | for /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" |
387 | if exist "%PUBLIC%\Desktop\desktop.ini" set "_dsk=%PUBLIC%\Desktop" | 428 | if exist "%PUBLIC%\Desktop\desktop.ini" set "_dsk=%PUBLIC%\Desktop" |
388 | set "_mO21a=Detected Office 2021 C2R Retail is activated" | 429 | set "_mO21a=Detected Office 2021 C2R Retail is activated" |
@@ -407,6 +448,8 @@ if exist "%SystemRoot%\Servicing\Packages\Microsoft-Windows-Server*Edition~*.mum | |||
407 | set "ESUEditions=ServerDatacenter,ServerDatacenterCore,ServerDatacenterV,ServerDatacenterVCore,ServerStandard,ServerStandardCore,ServerStandardV,ServerStandardVCore,ServerEnterprise,ServerEnterpriseCore,ServerEnterpriseV,ServerEnterpriseVCore" | 448 | set "ESUEditions=ServerDatacenter,ServerDatacenterCore,ServerDatacenterV,ServerDatacenterVCore,ServerStandard,ServerStandardCore,ServerStandardV,ServerStandardVCore,ServerEnterprise,ServerEnterpriseCore,ServerEnterpriseV,ServerEnterpriseVCore" |
408 | ) | 449 | ) |
409 | for /f "tokens=6 delims=[]. " %%G in ('ver') do set winbuild=%%G | 450 | for /f "tokens=6 delims=[]. " %%G in ('ver') do set winbuild=%%G |
451 | set UBR=0 | ||
452 | if %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 | ||
410 | set "_csq=cscript.exe //NoLogo //Job:WmiQuery "%~nx0?.wsf"" | 453 | set "_csq=cscript.exe //NoLogo //Job:WmiQuery "%~nx0?.wsf"" |
411 | set "_csm=cscript.exe //NoLogo //Job:WmiMethod "%~nx0?.wsf"" | 454 | set "_csm=cscript.exe //NoLogo //Job:WmiMethod "%~nx0?.wsf"" |
412 | set "_csp=cscript.exe //NoLogo //Job:WmiPKey "%~nx0?.wsf"" | 455 | set "_csp=cscript.exe //NoLogo //Job:WmiPKey "%~nx0?.wsf"" |
@@ -437,7 +480,7 @@ pushd "!_work!" | |||
437 | 480 | ||
438 | if not defined _unattended ( | 481 | if not defined _unattended ( |
439 | mode con cols=98 lines=31 | 482 | mode con cols=98 lines=31 |
440 | %nul% %psc% "&%_buf%" | 483 | %psc% "&%_buf%" |
441 | title %_title% | 484 | title %_title% |
442 | ) else ( | 485 | ) else ( |
443 | title Online KMS Activation | 486 | title Online KMS Activation |
@@ -608,7 +651,10 @@ IF %winbuild% LSS 14393 ( | |||
608 | ) | 651 | ) |
609 | IF NOT "%EditionWMI%"=="" SET "EditionID=%EditionWMI%" | 652 | IF NOT "%EditionWMI%"=="" SET "EditionID=%EditionWMI%" |
610 | IF /I "%EditionID%"=="IoTEnterprise" SET "EditionID=Enterprise" | 653 | IF /I "%EditionID%"=="IoTEnterprise" SET "EditionID=Enterprise" |
611 | IF /I "%EditionID%"=="IoTEnterpriseS" IF %winbuild% LSS 22610 SET "EditionID=EnterpriseS" | 654 | IF /I "%EditionID%"=="IoTEnterpriseS" IF %winbuild% LSS 22610 ( |
655 | SET "EditionID=EnterpriseS" | ||
656 | IF %winbuild% GEQ 19041 IF %UBR% GEQ 2788 SET "EditionID=IoTEnterpriseS" | ||
657 | ) | ||
612 | IF /I "%EditionID%"=="ProfessionalSingleLanguage" SET "EditionID=Professional" | 658 | IF /I "%EditionID%"=="ProfessionalSingleLanguage" SET "EditionID=Professional" |
613 | IF /I "%EditionID%"=="ProfessionalCountrySpecific" SET "EditionID=Professional" | 659 | IF /I "%EditionID%"=="ProfessionalCountrySpecific" SET "EditionID=Professional" |
614 | IF /I "%EditionID%"=="EnterpriseG" SET Win10Gov=1 | 660 | IF /I "%EditionID%"=="EnterpriseG" SET Win10Gov=1 |
@@ -2220,6 +2266,7 @@ if %_C16Msg% EQU 1 set _CtRMsg=1 | |||
2220 | if %_C15Msg% EQU 1 set _CtRMsg=1 | 2266 | if %_C15Msg% EQU 1 set _CtRMsg=1 |
2221 | if %_Office16% EQU 1 ( | 2267 | if %_Office16% EQU 1 ( |
2222 | for %%a in (%_RetIds%,ProPlus) do set "_%%a=" | 2268 | for %%a in (%_RetIds%,ProPlus) do set "_%%a=" |
2269 | for %%A in (19,21) do call :officeLoc %%A | ||
2223 | ) | 2270 | ) |
2224 | if %_Office15% EQU 1 ( | 2271 | if %_Office15% EQU 1 ( |
2225 | for %%a in (%_R15Ids%,ProPlus) do set "_%%a=" | 2272 | for %%a in (%_R15Ids%,ProPlus) do set "_%%a=" |
@@ -3314,6 +3361,11 @@ echo Deleting [Folder] %ProgramData%\Activation-Renewal\ | |||
3314 | rmdir /s /q "%ProgramData%\Activation-Renewal\" %nul% | 3361 | rmdir /s /q "%ProgramData%\Activation-Renewal\" %nul% |
3315 | ) | 3362 | ) |
3316 | 3363 | ||
3364 | If exist "%ProgramFiles%\Activation-Renewal\" ( | ||
3365 | echo Deleting [Folder] %ProgramFiles%\Activation-Renewal\ | ||
3366 | rmdir /s /q "%ProgramFiles%\Activation-Renewal\" %nul% | ||
3367 | ) | ||
3368 | |||
3317 | reg query "HKCR\DesktopBackground\shell\Activate Windows - Office" %nul% && ( | 3369 | reg query "HKCR\DesktopBackground\shell\Activate Windows - Office" %nul% && ( |
3318 | echo Deleting [Registry] HKCR\DesktopBackground\shell\Activate Windows - Office | 3370 | echo Deleting [Registry] HKCR\DesktopBackground\shell\Activate Windows - Office |
3319 | Reg delete "HKCR\DesktopBackground\shell\Activate Windows - Office" /f %nul% | 3371 | Reg 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 | ||
3322 | reg query "%key%" /f Path /s | find /i "\Activation-Renewal" >nul && (set error_=1) | 3374 | reg query "%key%" /f Path /s | find /i "\Activation-Renewal" >nul && (set error_=1) |
3323 | reg query "%key%" /f Path /s | find /i "\Activation-Run_Once" >nul && (set error_=1) | 3375 | reg query "%key%" /f Path /s | find /i "\Activation-Run_Once" >nul && (set error_=1) |
3324 | reg query "%key%" /f Path /s | find /i "\Online_KMS_Activation_Script-Run_Once" >nul && (set error_=1) | 3376 | reg query "%key%" /f Path /s | find /i "\Online_KMS_Activation_Script" >nul && (set error_=1) |
3325 | reg query "%key%" /f Path /s | find /i "\Online_KMS_Activation_Script-Run_Once" >nul && (set error_=1) | ||
3326 | If exist "%windir%\Online_KMS_Activation_Script\" (set error_=1) | 3377 | If exist "%windir%\Online_KMS_Activation_Script\" (set error_=1) |
3327 | reg query "HKCR\DesktopBackground\shell\Activate Windows - Office" %nul% && (set error_=1) | 3378 | reg query "HKCR\DesktopBackground\shell\Activate Windows - Office" %nul% && (set error_=1) |
3328 | if exist "%ProgramData%\Online_KMS_Activation.cmd" (set error_=1) | 3379 | if exist "%ProgramData%\Online_KMS_Activation.cmd" (set error_=1) |
3329 | if exist "%ProgramData%\Online_KMS_Activation\" (set error_=1) | 3380 | if exist "%ProgramData%\Online_KMS_Activation\" (set error_=1) |
3330 | if exist "%ProgramData%\Activation-Renewal\" (set error_=1) | 3381 | if exist "%ProgramData%\Activation-Renewal\" (set error_=1) |
3382 | if exist "%ProgramFiles%\Activation-Renewal\" (set error_=1) | ||
3331 | exit /b | 3383 | exit /b |
3332 | 3384 | ||
3333 | :========================================================================================================================================= | 3385 | :========================================================================================================================================= |
@@ -3339,7 +3391,7 @@ mode con cols=91 lines=30 | |||
3339 | title Install Activation Auto-Renewal | 3391 | title Install Activation Auto-Renewal |
3340 | 3392 | ||
3341 | set error_= | 3393 | set error_= |
3342 | set "_dest=%ProgramData%\Activation-Renewal" | 3394 | set "_dest=%ProgramFiles%\Activation-Renewal" |
3343 | set "key=HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Schedule\taskcache\tasks" | 3395 | set "key=HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Schedule\taskcache\tasks" |
3344 | 3396 | ||
3345 | call :clearstuff %nul% | 3397 | call :clearstuff %nul% |
@@ -3352,7 +3404,7 @@ goto :RenDone | |||
3352 | ) | 3404 | ) |
3353 | 3405 | ||
3354 | if not exist "%_dest%\" md "%_dest%\" %nul% | 3406 | if not exist "%_dest%\" md "%_dest%\" %nul% |
3355 | set "_temp=%SystemRoot%\Temp\_taskwork" | 3407 | set "_temp=%SystemRoot%\Temp\_taskwork_%Random%" |
3356 | 3408 | ||
3357 | set nil= | 3409 | set nil= |
3358 | if exist "%_temp%\.*" rmdir /s /q "%_temp%\" %nul% | 3410 | if 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 | |||
3364 | if exist "%_temp%\.*" rmdir /s /q "%_temp%\" %nul% | 3416 | if exist "%_temp%\.*" rmdir /s /q "%_temp%\" %nul% |
3365 | 3417 | ||
3366 | call :createInfo.txt | 3418 | call :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);" |
3368 | title Install Activation Auto-Renewal | 3420 | title Install Activation Auto-Renewal |
3369 | 3421 | ||
3370 | ::======================================================================================================================================== | 3422 | ::======================================================================================================================================== |
@@ -3445,9 +3497,9 @@ echo Activation-Run_Once [Activation Task - deletes itself once activated] | |||
3445 | echo The scheduled tasks runs only if the system is connected to the Internet. | 3497 | echo The scheduled tasks runs only if the system is connected to the Internet. |
3446 | echo: | 3498 | echo: |
3447 | echo - Files | 3499 | echo - Files |
3448 | echo C:\ProgramData\Activation-Renewal\Activation_task.cmd | 3500 | echo C:\Program Files\Activation-Renewal\Activation_task.cmd |
3449 | echo C:\ProgramData\Activation-Renewal\Info.txt | 3501 | echo C:\Program Files\Activation-Renewal\Info.txt |
3450 | echo C:\ProgramData\Activation-Renewal\Logs.txt | 3502 | echo C:\Program Files\Activation-Renewal\Logs.txt |
3451 | echo ______________________________________________________________________________________________ | 3503 | echo ______________________________________________________________________________________________ |
3452 | echo: | 3504 | echo: |
3453 | echo Online KMS Activation Script is a part of 'Microsoft_Activation_Scripts' [MAS] project. | 3505 | echo 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);" |
3590 | exit /b | 3642 | exit /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 | ||
3649 | setlocal EnableDelayedExpansion | 3701 | setlocal EnableDelayedExpansion |
3650 | if exist "%ProgramData%\Activation-Renewal\" call :_taskstart>>"%ProgramData%\Activation-Renewal\Logs.txt" & exit | 3702 | if 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 | |||
4047 | goto :_taskgetserv | 4099 | goto :_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) { | |||
4192 | UninstallLicenses("sppc.dll") | 4244 | UninstallLicenses("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 | |||
26 | set "PATH=%SystemRoot%\System32;%SystemRoot%\System32\wbem;%SystemRoot%\System32\WindowsPowerShell\v1.0\" | ||
27 | if exist "%SystemRoot%\Sysnative\reg.exe" ( | ||
28 | set "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" | |||
28 | for %%# in (%*) do ( | 35 | for %%# in (%*) do ( |
29 | if /i "%%#"=="r1" set r1=1 | 36 | if /i "%%#"=="r1" set r1=1 |
30 | if /i "%%#"=="r2" set r2=1 | 37 | if /i "%%#"=="r2" set r2=1 |
38 | if /i "%%#"=="-qedit" ( | ||
39 | reg add HKCU\Console /v QuickEdit /t REG_DWORD /d "1" /f %nul1% | ||
40 | rem check the code below admin elevation to understand why it's here | ||
41 | ) | ||
31 | ) | 42 | ) |
32 | 43 | ||
33 | if exist %SystemRoot%\Sysnative\cmd.exe if not defined r1 ( | 44 | if exist %SystemRoot%\Sysnative\cmd.exe if not defined r1 ( |
@@ -44,22 +55,34 @@ start %SystemRoot%\SysArm32\cmd.exe /c ""!_cmdf!" %* r2" | |||
44 | exit /b | 55 | exit /b |
45 | ) | 56 | ) |
46 | 57 | ||
47 | :: Set Path variable, it helps if it is misconfigured in the system | 58 | ::======================================================================================================================================== |
48 | 59 | ||
49 | set "PATH=%SystemRoot%\System32;%SystemRoot%\System32\wbem;%SystemRoot%\System32\WindowsPowerShell\v1.0\" | 60 | set "blank=" |
50 | if exist "%SystemRoot%\Sysnative\reg.exe" ( | 61 | set "mas=mass%blank%grave.dev" |
51 | set "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 | |||
65 | sc query Null | find /i "RUNNING" | ||
66 | if %errorlevel% NEQ 0 ( | ||
67 | echo: | ||
68 | echo Null service is not running, script may crash... | ||
69 | echo: | ||
70 | echo: | ||
71 | echo Help - https://%mas%/troubleshoot.html | ||
72 | echo: | ||
73 | echo: | ||
74 | ping 127.0.0.1 -n 10 | ||
52 | ) | 75 | ) |
76 | cls | ||
53 | 77 | ||
54 | :: Check LF line ending | 78 | :: Check LF line ending |
55 | 79 | ||
56 | pushd "%~dp0" | 80 | pushd "%~dp0" |
57 | >nul findstr /rxc:".*" "%~nx0" | 81 | >nul findstr /v "$" "%~nx0" && ( |
58 | if not %errorlevel%==0 ( | ||
59 | echo: | 82 | echo: |
60 | echo Error: Script either has LF line ending issue, or it failed to read itself. | 83 | echo Error: Script either has LF line ending issue or an empty line at the end of the script is missing. |
61 | echo: | 84 | echo: |
62 | ping 127.0.0.1 -n 6 > nul | 85 | ping 127.0.0.1 -n 6 >nul |
63 | popd | 86 | popd |
64 | exit /b | 87 | exit /b |
65 | ) | 88 | ) |
@@ -71,24 +94,36 @@ cls | |||
71 | color 07 | 94 | color 07 |
72 | title Change Windows Edition | 95 | title Change Windows Edition |
73 | 96 | ||
97 | set _args= | ||
74 | set _elev= | 98 | set _elev= |
75 | if /i "%~1"=="-el" set _elev=1 | ||
76 | 99 | ||
77 | set winbuild=1 | 100 | set _args=%* |
101 | if defined _args set _args=%_args:"=% | ||
102 | if defined _args ( | ||
103 | for %%A in (%_args%) do ( | ||
104 | if /i "%%A"=="-el" set _elev=1 | ||
105 | ) | ||
106 | ) | ||
107 | |||
108 | set "nul1=1>nul" | ||
109 | set "nul2=2>nul" | ||
110 | set "nul6=2^>nul" | ||
78 | set "nul=>nul 2>&1" | 111 | set "nul=>nul 2>&1" |
112 | |||
79 | set psc=powershell.exe | 113 | set psc=powershell.exe |
114 | set winbuild=1 | ||
80 | for /f "tokens=6 delims=[]. " %%G in ('ver') do set winbuild=%%G | 115 | for /f "tokens=6 delims=[]. " %%G in ('ver') do set winbuild=%%G |
81 | 116 | ||
82 | set _NCS=1 | 117 | set _NCS=1 |
83 | if %winbuild% LSS 10586 set _NCS=0 | 118 | if %winbuild% LSS 10586 set _NCS=0 |
84 | if %winbuild% GEQ 10586 reg query "HKCU\Console" /v ForceV2 2>nul | find /i "0x0" 1>nul && (set _NCS=0) | 119 | if %winbuild% GEQ 10586 reg query "HKCU\Console" /v ForceV2 %nul2% | find /i "0x0" %nul1% && (set _NCS=0) |
85 | 120 | ||
86 | if %_NCS% EQU 1 ( | 121 | if %_NCS% EQU 1 ( |
87 | for /F %%a in ('echo prompt $E ^| cmd') do set "esc=%%a" | 122 | for /F %%a in ('echo prompt $E ^| cmd') do set "esc=%%a" |
88 | set "Red="41;97m"" | 123 | set "Red="41;97m"" |
89 | set "Gray="100;97m"" | 124 | set "Gray="100;97m"" |
90 | set "Green="42;97m"" | 125 | set "Green="42;97m"" |
91 | set "Magenta="45;97m"" | 126 | set "Blue="44;97m"" |
92 | set "_White="40;37m"" | 127 | set "_White="40;37m"" |
93 | set "_Green="40;92m"" | 128 | set "_Green="40;92m"" |
94 | set "_Yellow="40;93m"" | 129 | set "_Yellow="40;93m"" |
@@ -96,7 +131,7 @@ set "_Yellow="40;93m"" | |||
96 | set "Red="Red" "white"" | 131 | set "Red="Red" "white"" |
97 | set "Gray="Darkgray" "white"" | 132 | set "Gray="Darkgray" "white"" |
98 | set "Green="DarkGreen" "white"" | 133 | set "Green="DarkGreen" "white"" |
99 | set "Magenta="Darkmagenta" "white"" | 134 | set "Blue="Blue" "white"" |
100 | set "_White="Black" "Gray"" | 135 | set "_White="Black" "Gray"" |
101 | set "_Green="Black" "Green"" | 136 | set "_Green="Black" "Green"" |
102 | set "_Yellow="Black" "Yellow"" | 137 | set "_Yellow="Black" "Yellow"" |
@@ -111,7 +146,7 @@ if %~z0 GEQ 200000 (set "_exitmsg=Go back") else (set "_exitmsg=Exit") | |||
111 | 146 | ||
112 | if %winbuild% LSS 7600 ( | 147 | if %winbuild% LSS 7600 ( |
113 | %nceline% | 148 | %nceline% |
114 | echo Unsupported OS version detected. | 149 | echo Unsupported OS version detected [%winbuild%]. |
115 | echo Project is supported only for Windows 7/8/8.1/10/11 and their Server equivalent. | 150 | echo Project is supported only for Windows 7/8/8.1/10/11 and their Server equivalent. |
116 | goto ced_done | 151 | goto ced_done |
117 | ) | 152 | ) |
@@ -140,7 +175,7 @@ setlocal EnableDelayedExpansion | |||
140 | 175 | ||
141 | ::======================================================================================================================================== | 176 | ::======================================================================================================================================== |
142 | 177 | ||
143 | echo "!_batf!" | find /i "!_ttemp!" 1>nul && ( | 178 | echo "!_batf!" | find /i "!_ttemp!" %nul1% && ( |
144 | if /i not "!_work!"=="!_ttemp!" ( | 179 | if /i not "!_work!"=="!_ttemp!" ( |
145 | %eline% | 180 | %eline% |
146 | echo Script is launched from the temp folder, | 181 | echo 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 || ( |
159 | if not defined _elev %nul% %psc% "start cmd.exe -arg '/c \"!_PSarg:'=''!\"' -verb runas" && exit /b | 194 | if not defined _elev %psc% "start cmd.exe -arg '/c \"!_PSarg:'=''!\"' -verb runas" && exit /b |
160 | %eline% | 195 | %eline% |
161 | echo This script require admin privileges. | 196 | echo This script require admin privileges. |
162 | echo To do so, right click on this script and select 'Run as administrator'. | 197 | echo 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 | |||
206 | for %%# in (%_args%) do (if /i "%%#"=="-qedit" set quedit=1) | ||
207 | |||
208 | reg query HKCU\Console /v QuickEdit %nul2% | find /i "0x0" %nul1% || if not defined quedit ( | ||
209 | reg add HKCU\Console /v QuickEdit /t REG_DWORD /d "0" /f %nul1% | ||
210 | start cmd.exe /c ""!_batf!" %_args% -qedit" | ||
211 | rem quickedit reset code is added at the starting of the script instead of here because it takes time to reflect in some cases | ||
212 | exit /b | ||
213 | ) | ||
214 | |||
215 | ::======================================================================================================================================== | ||
216 | |||
168 | cls | 217 | cls |
169 | mode 98, 30 | 218 | mode 98, 30 |
170 | 219 | ||
@@ -189,43 +238,41 @@ echo: | |||
189 | :: Check Activation IDs | 238 | :: Check Activation IDs |
190 | 239 | ||
191 | call :dk_actids | 240 | call :dk_actids |
192 | 241 | if not defined applist ( | |
242 | net stop sppsvc /y %nul% | ||
243 | cscript //nologo %windir%\system32\slmgr.vbs /rilc %nul% | ||
244 | if !errorlevel! NEQ 0 cscript //nologo %windir%\system32\slmgr.vbs /rilc %nul% | ||
245 | call :dk_refresh | ||
246 | call :dk_actids | ||
193 | if not defined applist ( | 247 | if not defined applist ( |
194 | %eline% | 248 | %eline% |
195 | echo Activation IDs not found. Aborting... | 249 | echo Activation IDs not found. Aborting... |
196 | echo: | 250 | echo: |
197 | echo Check this page for help. https://massgrave.dev/troubleshoot | 251 | echo Check this page for help. https://%mas%/troubleshoot |
198 | goto ced_done | 252 | goto ced_done |
199 | ) | 253 | ) |
200 | |||
201 | :: Check Windows Edition | ||
202 | |||
203 | set osedition= | ||
204 | for /f "tokens=3 delims=: " %%a in ('DISM /English /Online /Get-CurrentEdition 2^>nul ^| find /i "Current Edition :"') do set "osedition=%%a" | ||
205 | |||
206 | if "%osedition%"=="" ( | ||
207 | %eline% | ||
208 | DISM /English /Online /Get-CurrentEdition %nul% | ||
209 | cmd /c exit /b !errorlevel! | ||
210 | echo DISM command failed [Error Code - 0x!=ExitCode!] | ||
211 | echo OS Edition was not detected properly. Aborting... | ||
212 | echo: | ||
213 | echo Check this page for help. https://massgrave.dev/troubleshoot | ||
214 | goto ced_done | ||
215 | ) | 254 | ) |
216 | 255 | ||
256 | ::======================================================================================================================================== | ||
257 | |||
217 | :: Check SKU value | 258 | :: Check SKU value |
218 | 259 | ||
219 | set osSKU= | 260 | set osSKU= |
220 | set regSKU= | 261 | set slcSKU= |
221 | set wmiSKU= | 262 | set wmiSKU= |
222 | 263 | ||
223 | for /f "tokens=3 delims=." %%a in ('reg query "HKLM\SYSTEM\CurrentControlSet\Control\ProductOptions" /v OSProductPfn 2^>nul') do set "regSKU=%%a" | 264 | if %winbuild% GEQ 14393 (set info=Kernel-BrandingInfo) else (set info=Kernel-ProductInfo) |
224 | if %_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" | 265 | set d1=%ref% [void]$TypeBuilder.DefinePInvokeMethod('SLGetWindowsInformationDWORD', 'slc.dll', 'Public, Static', 1, [int], @([String], [int].MakeByRefType()), 1, 3); |
225 | if %_wmic% EQU 0 for /f "tokens=1" %%a in ('%psc% "([WMI]'Win32_OperatingSystem=@').OperatingSystemSKU" 2^>nul') do if not errorlevel 1 set "wmiSKU=%%a" | 266 | set d1=%d1% $Sku = 0; [void]$TypeBuilder.CreateType()::SLGetWindowsInformationDWORD('%info%', [ref]$Sku); $Sku |
267 | for /f "delims=" %%s in ('"%psc% %d1%"') do if not errorlevel 1 (set slcSKU=%%s) | ||
268 | if "%slcSKU%"=="0" set slcSKU= | ||
269 | if 1%slcSKU% NEQ +1%slcSKU% set slcSKU= | ||
270 | |||
271 | if %_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" | ||
272 | if %_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 | ||
227 | set osSKU=%wmiSKU% | 274 | set osSKU=%slcSKU% |
228 | if not defined osSKU set osSKU=%regSKU% | 275 | if not defined osSKU set osSKU=%wmiSKU% |
229 | 276 | ||
230 | if not defined osSKU ( | 277 | if not defined osSKU ( |
231 | %eline% | 278 | %eline% |
@@ -233,14 +280,56 @@ echo SKU value was not detected properly. Aborting... | |||
233 | goto ced_done | 280 | goto ced_done |
234 | ) | 281 | ) |
235 | 282 | ||
283 | ::======================================================================================================================================== | ||
284 | |||
285 | :: Check Windows Edition | ||
286 | |||
287 | set osedition= | ||
288 | set dismedition= | ||
289 | set dismnotworking= | ||
290 | |||
291 | set d1=%ref% [void]$TypeBuilder.DefinePInvokeMethod('SLGetWindowsInformation', 'slc.dll', 22, 1, [int], @([String], [int], [int].MakeByRefType(), [String].MakeByRefType()), 1, 3); | ||
292 | set d1=%d1% $editionName = 0; [void]$TypeBuilder.CreateType()::SLGetWindowsInformation('Kernel-EditionName', 0, [ref]0, [ref]$editionName); $editionName | ||
293 | if %winbuild% GEQ 14393 for /f "delims=" %%s in ('"%psc% %d1%"') do if not errorlevel 1 (set osedition=%%s) | ||
294 | if "%osedition%"=="0" set osedition= | ||
295 | |||
296 | if not defined osedition ( | ||
297 | for /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 | |||
302 | if %osSKU%==164 set osedition=ProfessionalEducation | ||
303 | if %osSKU%==165 set osedition=ProfessionalEducationN | ||
304 | |||
305 | for /f "tokens=3 delims=: " %%a in ('DISM /English /Online /Get-CurrentEdition %nul6% ^| find /i "Current Edition :"') do set "dismedition=%%a" | ||
306 | if not defined dismedition set dismnotworking=1 | ||
307 | |||
308 | if defined dismedition if not defined osedition set osedition=%dismedition% | ||
309 | |||
310 | if not defined osedition ( | ||
311 | %eline% | ||
312 | DISM /English /Online /Get-CurrentEdition %nul% | ||
313 | cmd /c exit /b !errorlevel! | ||
314 | echo DISM command failed [Error Code - 0x!=ExitCode!] | ||
315 | echo OS Edition was not detected properly. Aborting... | ||
316 | echo: | ||
317 | echo Check this page for help. https://%mas%/troubleshoot | ||
318 | goto ced_done | ||
319 | ) | ||
320 | |||
321 | ::======================================================================================================================================== | ||
322 | |||
236 | set branch= | 323 | set branch= |
237 | for /f "skip=2 tokens=2*" %%a in ('reg query "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion" /v BuildBranch 2^>nul') do set "branch=%%b" | 324 | for /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% |
243 | echo PowerShell is not responding properly. Aborting... | 330 | echo PowerShell is not responding properly. Aborting... |
331 | echo: | ||
332 | echo Check this page for help. https://%mas%/troubleshoot | ||
244 | goto ced_done | 333 | goto ced_done |
245 | ) | 334 | ) |
246 | 335 | ||
@@ -252,15 +341,22 @@ set _target= | |||
252 | set _dtarget= | 341 | set _dtarget= |
253 | set _ptarget= | 342 | set _ptarget= |
254 | set _ntarget= | 343 | set _ntarget= |
344 | set _wtarget= | ||
345 | |||
346 | if %winbuild% GEQ 10240 for /f "tokens=4" %%a in ('dism /online /english /Get-TargetEditions ^| findstr /i /c:"Target Edition : "') do (if defined _dtarget (set "_dtarget= !_dtarget! %%a ") else (set "_dtarget= %%a ")) | ||
347 | if %winbuild% LSS 10240 for /f "tokens=4" %%a in ('%psc% "$f=[io.file]::ReadAllText('!_batp!') -split ':cbsxml\:.*';& ([ScriptBlock]::Create($f[1])) -GetTargetEditions;" ^| findstr /i /c:"Target Edition : "') do (if defined _ptarget (set "_ptarget= !_ptarget! %%a ") else (set "_ptarget= %%a ")) | ||
255 | 348 | ||
256 | if %winbuild% GEQ 10240 for /f "tokens=4" %%a in ('dism /online /english /Get-TargetEditions ^| findstr /i /c:"Target Edition : "') do (if defined _dtarget (set "_dtarget=!_dtarget! %%a") else (set "_dtarget=%%a")) | 349 | if %winbuild% GEQ 10240 if not exist "%SystemRoot%\Servicing\Packages\Microsoft-Windows-Server*Edition~*.mum" ( |
257 | 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")) | 350 | call :ced_edilist |
351 | if /i "%osedition:~0,4%"=="Core" (set "_wtarget= Professional !_wtarget! ") | ||
352 | set "_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 | ||
263 | for %%# in (99 139 202 203) do if %osSKU%==%%# ( | 359 | for %%# in (202 203) do if %osSKU%==%%# ( |
264 | %eline% | 360 | %eline% |
265 | echo [%winos% ^| SKU:%osSKU% ^| %winbuild%] | 361 | echo [%winos% ^| SKU:%osSKU% ^| %winbuild%] |
266 | echo It's not recommended to change this installed edition to any other. | 362 | echo It's not recommended to change this installed edition to any other. |
@@ -268,8 +364,8 @@ echo Aborting... | |||
268 | goto ced_done | 364 | goto ced_done |
269 | ) | 365 | ) |
270 | 366 | ||
271 | for %%# in ( %_dtarget% %_ptarget% ) do ( | 367 | for %%# in ( %_dtarget% %_ptarget% ) do if /i not "%%#"=="%osedition%" ( |
272 | echo "!_target!" | find /i " %%# " 1>nul || set "_target=!_target! %%# " | 368 | echo "!_target!" | find /i " %%# " %nul1% || set "_target= !_target! %%# " |
273 | ) | 369 | ) |
274 | 370 | ||
275 | if defined _target ( | 371 | if defined _target ( |
@@ -281,6 +377,7 @@ echo %%# | findstr /i "CountrySpecific CloudEdition" %nul% || (set "_ntarget=!_n | |||
281 | if not defined _ntarget ( | 377 | if not defined _ntarget ( |
282 | %line% | 378 | %line% |
283 | echo: | 379 | echo: |
380 | if defined dismnotworking call :dk_color %Red% "DISM.exe is not responding." | ||
284 | call :dk_color %Gray% "Target Edition not found." | 381 | call :dk_color %Gray% "Target Edition not found." |
285 | echo Current Edition [%osedition% ^| %winbuild%] can not be changed to any other Edition. | 382 | echo Current Edition [%osedition% ^| %winbuild%] can not be changed to any other Edition. |
286 | %line% | 383 | %line% |
@@ -294,7 +391,6 @@ goto ced_done | |||
294 | cls | 391 | cls |
295 | mode 98, 30 | 392 | mode 98, 30 |
296 | set inpt= | 393 | set inpt= |
297 | set note= | ||
298 | set counter=0 | 394 | set counter=0 |
299 | set verified=0 | 395 | set verified=0 |
300 | set targetedition= | 396 | set targetedition= |
@@ -302,21 +398,16 @@ set targetedition= | |||
302 | %line% | 398 | %line% |
303 | echo: | 399 | echo: |
304 | call :dk_color %Gray% "You can change the Edition [%osedition%] [%winbuild%] to one of the following." | 400 | call :dk_color %Gray% "You can change the Edition [%osedition%] [%winbuild%] to one of the following." |
401 | if defined dismnotworking ( | ||
402 | call :dk_color %_Yellow% "Note - DISM.exe is not responding." | ||
403 | if /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% |
306 | echo: | 406 | echo: |
307 | 407 | ||
308 | for %%A in (%_ntarget%) do ( | 408 | for %%A in (%_ntarget%) do ( |
309 | set /a counter+=1 | 409 | set /a counter+=1 |
310 | if %winbuild% GEQ 10240 ( | ||
311 | echo "%_ptarget%" | find /i "%%A" 1>nul && ( | ||
312 | set note=1 | ||
313 | call :dk_color2 %_White% "[!counter!] " %Magenta% "%%A" | ||
314 | ) || ( | ||
315 | echo [!counter!] %%A | ||
316 | ) | ||
317 | ) else ( | ||
318 | echo [!counter!] %%A | 410 | echo [!counter!] %%A |
319 | ) | ||
320 | set targetedition!counter!=%%A | 411 | set targetedition!counter!=%%A |
321 | ) | 412 | ) |
322 | 413 | ||
@@ -324,10 +415,6 @@ set targetedition!counter!=%%A | |||
324 | echo: | 415 | echo: |
325 | echo [0] %_exitmsg% | 416 | echo [0] %_exitmsg% |
326 | echo: | 417 | echo: |
327 | if defined note ( | ||
328 | echo Note: CBS Upgrade Method is available for Purple colored editions. | ||
329 | echo: | ||
330 | ) | ||
331 | call :dk_color %_Green% "Enter option number in keyboard, and press "Enter":" | 418 | call :dk_color %_Green% "Enter option number in keyboard, and press "Enter":" |
332 | set /p inpt= | 419 | set /p inpt= |
333 | if "%inpt%"=="" goto cedmenu2 | 420 | if "%inpt%"=="" goto cedmenu2 |
@@ -338,71 +425,26 @@ if %verified%==0 goto cedmenu2 | |||
338 | 425 | ||
339 | ::======================================================================================================================================== | 426 | ::======================================================================================================================================== |
340 | 427 | ||
341 | cls | 428 | if %winbuild% LSS 10240 goto :cbsmethod |
342 | if %winbuild% GEQ 10240 ( | 429 | if exist "%SystemRoot%\Servicing\Packages\Microsoft-Windows-Server*Edition~*.mum" goto :ced_change_server |
343 | echo "%_ptarget%" | find /i "%targetedition%" 1>nul && ( | ||
344 | echo "%_dtarget%" | find /i "%targetedition%" 1>nul && ( | ||
345 | echo: | ||
346 | %line% | ||
347 | echo: | ||
348 | if exist "%SystemRoot%\Servicing\Packages\Microsoft-Windows-Server*Edition~*.mum" ( | ||
349 | echo [1] DISM Method [Recommended] | ||
350 | ) else ( | ||
351 | echo [1] Changepk Method [Recommended] | ||
352 | ) | ||
353 | echo: | ||
354 | echo [2] CBS Upgrade Method [Alternative] | ||
355 | echo: | ||
356 | echo [0] Go back | ||
357 | %line% | ||
358 | echo: | ||
359 | echo Enter a menu option in the Keyboard: | ||
360 | choice /C:120 /N | ||
361 | set _el=!errorlevel! | ||
362 | if !_el!==3 goto :cedmenu2 | ||
363 | if !_el!==2 goto :cbsmethod | ||
364 | if !_el!==1 REM | ||
365 | ) | ||
366 | ) | ||
367 | ) else ( | ||
368 | goto :cbsmethod | ||
369 | ) | ||
370 | |||
371 | echo "%_ptarget%" | find /i "%targetedition%" 1>nul && ( | ||
372 | echo "%_dtarget%" | find /i "%targetedition%" 1>nul || ( | ||
373 | goto :cbsmethod | ||
374 | ) | ||
375 | ) | ||
376 | |||
377 | if exist "%SystemRoot%\Servicing\Packages\Microsoft-Windows-Server*Edition~*.mum" ( | ||
378 | goto :ced_change_server | ||
379 | ) | ||
380 | 430 | ||
381 | cls | 431 | cls |
432 | mode con cols=105 lines=32 | ||
433 | |||
382 | set key= | 434 | set key= |
383 | set _chan= | 435 | set _chan= |
384 | set _changepk=0 | 436 | set _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 | ||
388 | if not exist "%SystemRoot%\System32\spp\tokens\skus\%targetedition%\" ( | 440 | if not exist "%SystemRoot%\System32\spp\tokens\skus\%targetedition%\" ( |
389 | set _changepk=1 | 441 | set _dismapi=1 |
390 | ) | 442 | ) |
391 | 443 | ||
392 | if /i "%osedition:~0,4%"=="Core" ( | ||
393 | if /i not "%targetedition:~0,4%"=="Core" ( | ||
394 | set _changepk=1 | ||
395 | ) | ||
396 | ) | ||
397 | |||
398 | if %_changepk%==1 ( | ||
399 | set "keyflow=Retail Volume:MAK Volume:GVLK OEM:NONSLP OEM:DM" | ||
400 | ) else ( | ||
401 | set "keyflow=Retail OEM:NONSLP OEM:DM Volume:MAK Volume:GVLK" | 444 | set "keyflow=Retail OEM:NONSLP OEM:DM Volume:MAK Volume:GVLK" |
402 | ) | ||
403 | 445 | ||
404 | if not defined key call :ced_targetSKU %targetedition% | 446 | call :ced_targetSKU %targetedition% |
405 | if not defined key if defined targetSKU call :ced_windowskey | 447 | if defined targetSKU call :ced_windowskey |
406 | if defined key if defined pkeychannel set _chan=%pkeychannel% | 448 | if defined key if defined pkeychannel set _chan=%pkeychannel% |
407 | if not defined key call :changeeditiondata | 449 | if not defined key call :changeeditiondata |
408 | 450 | ||
@@ -410,57 +452,26 @@ if not defined key ( | |||
410 | %eline% | 452 | %eline% |
411 | echo [%targetedition% ^| %winbuild%] | 453 | echo [%targetedition% ^| %winbuild%] |
412 | echo Unable to get product key from pkeyhelper.dll | 454 | echo Unable to get product key from pkeyhelper.dll |
413 | echo Make sure you are using updated version of the script. | 455 | echo: |
414 | echo https://massgrave.dev | 456 | echo Check this page for help. https://%mas%/troubleshoot |
415 | goto ced_done | 457 | goto 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 | ||
425 | cls | 465 | cls |
426 | if %_changepk%==1 ( | 466 | %line% |
427 | echo "%_chan%" | find /i "OEM" >NUL && ( | ||
428 | %eline% | ||
429 | echo [%osedition%] can not be changed to [%targetedition%] Edition due to lack of non OEM keys. | ||
430 | echo Non-OEM keys are required to change from Core to Non-Core Editions. | ||
431 | goto ced_done | ||
432 | ) | ||
433 | ) | ||
434 | |||
435 | :ced_loop | ||
436 | |||
437 | cls | ||
438 | if %_changepk%==1 ( | ||
439 | for %%a in (l.root-servers.net resolver1.opendns.com download.windowsupdate.com google.com) do ( | ||
440 | for /f "delims=[] tokens=2" %%# in ('ping -n 1 %%a') do ( | ||
441 | if not [%%#]==[] ( | ||
442 | %eline% | ||
443 | echo Internet needs to be disconnected to change edition [%osedition%] to [%targetedition%] | ||
444 | echo Disconnect the Internet and then press any key... | ||
445 | pause >nul | ||
446 | goto ced_loop | ||
447 | ) | ||
448 | ) | ||
449 | ) | ||
450 | ) | ||
451 | |||
452 | echo: | 467 | echo: |
453 | echo Changing the Current Edition [%osedition%] to [%targetedition%] | 468 | echo Changing the Current Edition [%osedition%] %winbuild% to [%targetedition%] |
454 | echo: | 469 | echo: |
455 | 470 | ||
456 | if %_changepk%==1 ( | 471 | if %_dismapi%==1 ( |
457 | call :dk_color %Magenta% "Notes-" | 472 | call :dk_color %Blue% "Notes-" |
458 | echo: | ||
459 | echo - You can safely ignore if error appears in the upgrade Window, | ||
460 | echo but in that case you must manually reboot the system. | ||
461 | echo: | 473 | echo: |
462 | echo - Save your work before continue, system will auto restart. | 474 | echo - Save your work before continue, system will auto restart. |
463 | echo - You can connect to Internet after the system restart. | ||
464 | echo: | 475 | echo: |
465 | echo - You will need to activate with HWID option once the edition is changed. | 476 | echo - You will need to activate with HWID option once the edition is changed. |
466 | echo: | 477 | echo: |
@@ -470,7 +481,7 @@ if !errorlevel!==1 exit /b | |||
470 | 481 | ||
471 | ::======================================================================================================================================== | 482 | ::======================================================================================================================================== |
472 | 483 | ||
473 | if %_changepk%==0 ( | 484 | if %_dismapi%==0 ( |
474 | echo Installing %_chan% Key [%key%] | 485 | echo Installing %_chan% Key [%key%] |
475 | echo: | 486 | echo: |
476 | if %_wmic% EQU 1 wmic path SoftwareLicensingService where __CLASS='SoftwareLicensingService' call InstallProductKey ProductKey="%key%" %nul% | 487 | if %_wmic% EQU 1 wmic path SoftwareLicensingService where __CLASS='SoftwareLicensingService' call InstallProductKey ProductKey="%key%" %nul% |
@@ -488,14 +499,19 @@ echo: | |||
488 | call :dk_color %Gray% "Reboot is required to properly change the Edition." | 499 | call :dk_color %Gray% "Reboot is required to properly change the Edition." |
489 | ) else ( | 500 | ) else ( |
490 | call :dk_color %Red% "[Unsuccessful] [Error Code: 0x!=ExitCode!]" | 501 | call :dk_color %Red% "[Unsuccessful] [Error Code: 0x!=ExitCode!]" |
502 | echo Check this page for help. https://%mas%/troubleshoot | ||
491 | ) | 503 | ) |
492 | ) | 504 | ) |
493 | 505 | ||
494 | if %_changepk%==1 ( | 506 | if %_dismapi%==1 ( |
495 | echo: | 507 | echo: |
496 | echo Applying the command with %_chan% Key | 508 | echo Applying the DISM API method with %_chan% Key %key% |
497 | echo start changepk.exe /ProductKey %key% | 509 | echo: |
498 | start changepk.exe /ProductKey %key% | 510 | %psc% "$f=[io.file]::ReadAllText('!_batp!') -split ':dismapi\:.*';& ([ScriptBlock]::Create($f[1])) %targetedition% %key%;" |
511 | timeout /t 3 %nul1% | ||
512 | echo: | ||
513 | call :dk_color %Blue% "Incase of errors, you must restart your system before trying again." | ||
514 | echo 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 | ||
508 | cls | 524 | cls |
509 | mode con cols=105 lines=32 | 525 | mode 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 | ||
512 | echo: | 528 | echo: |
513 | echo Changing the Current Edition [%osedition%] to [%targetedition%] | 529 | echo Changing the Current Edition [%osedition%] %winbuild% to [%targetedition%] |
514 | echo: | 530 | echo: |
515 | call :dk_color %Magenta% "Important - Save your work before continue, system will auto reboot." | 531 | call :dk_color %Blue% "Important - Save your work before continue, system will auto reboot." |
516 | if %winbuild% GEQ 17034 if %targetedition%==Professional echo - Enterprise Key will be installed instead of Pro, you can quickly change to Pro later. | ||
517 | echo: | 532 | echo: |
518 | choice /C:01 /N /M "[1] Continue [0] %_exitmsg% : " | 533 | choice /C:01 /N /M "[1] Continue [0] %_exitmsg% : " |
519 | if %errorlevel%==1 exit /b | 534 | if %errorlevel%==1 exit /b |
@@ -524,9 +539,11 @@ echo: | |||
524 | 539 | ||
525 | if %_stg%==0 (set stage=) else (set stage=-StageCurrent) | 540 | if %_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 | |||
528 | echo: | 542 | echo: |
543 | call :dk_color %Blue% "Incase of errors, you must restart your system before trying again." | ||
544 | echo Check this page for help. https://%mas%/troubleshoot | ||
529 | %line% | 545 | %line% |
546 | |||
530 | goto ced_done | 547 | goto ced_done |
531 | 548 | ||
532 | ::======================================================================================================================================== | 549 | ::======================================================================================================================================== |
@@ -535,23 +552,23 @@ goto ced_done | |||
535 | 552 | ||
536 | cls | 553 | cls |
537 | mode con cols=105 lines=32 | 554 | mode 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 | ||
540 | set key= | 557 | set key= |
541 | set pkeychannel= | 558 | set _chan= |
542 | set "keyflow=Volume:GVLK Retail Volume:MAK OEM:NONSLP OEM:DM" | 559 | set "keyflow=Volume:GVLK Retail Volume:MAK OEM:NONSLP OEM:DM" |
543 | call :changeeditionserverdata | ||
544 | 560 | ||
545 | if not defined key call :ced_targetSKU %targetedition% | 561 | call :ced_targetSKU %targetedition% |
546 | if not defined key if defined targetSKU call :ced_windowskey | 562 | if defined targetSKU call :ced_windowskey |
547 | if defined key if not defined pkeychannel call :dk_pkeychannel %key% | 563 | if defined key if defined pkeychannel set _chan=%pkeychannel% |
564 | if not defined key call :changeeditiondata | ||
548 | 565 | ||
549 | if not defined key ( | 566 | if not defined key ( |
550 | %eline% | 567 | %eline% |
551 | echo [%targetedition% ^| %winbuild%] | 568 | echo [%targetedition% ^| %winbuild%] |
552 | echo Unable to get product key from pkeyhelper.dll | 569 | echo Unable to get product key from pkeyhelper.dll |
553 | echo Make sure you are using updated version of the script. | 570 | echo: |
554 | echo https://massgrave.dev | 571 | echo Check this page for help. https://%mas%/troubleshoot |
555 | goto ced_done | 572 | goto ced_done |
556 | ) | 573 | ) |
557 | 574 | ||
@@ -559,13 +576,14 @@ goto ced_done | |||
559 | 576 | ||
560 | cls | 577 | cls |
561 | echo: | 578 | echo: |
562 | echo Changing the Current Edition [%osedition%] to [%targetedition%] | 579 | echo Changing the Current Edition [%osedition%] %winbuild% to [%targetedition%] |
563 | echo: | 580 | echo: |
564 | echo Applying the command with %pkeychannel% Key | 581 | echo Applying the command with %_chan% Key |
565 | echo DISM /online /Set-Edition:%targetedition% /ProductKey:%key% /AcceptEula | 582 | echo DISM /online /Set-Edition:%targetedition% /ProductKey:%key% /AcceptEula |
566 | DISM /online /Set-Edition:%targetedition% /ProductKey:%key% /AcceptEula | 583 | DISM /online /Set-Edition:%targetedition% /ProductKey:%key% /AcceptEula |
567 | 584 | ||
568 | call :dk_color %Magenta% "Make sure to restart the system." | 585 | call :dk_color %Blue% "You must restart the system at this stage." |
586 | echo 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 | ||
574 | echo: | 592 | echo: |
575 | call :dk_color %_Yellow% "Press any key to %_exitmsg%..." | 593 | call :dk_color %_Yellow% "Press any key to %_exitmsg%..." |
576 | pause >nul | 594 | pause %nul1% |
577 | exit /b | 595 | exit /b |
578 | 596 | ||
579 | ::======================================================================================================================================== | 597 | ::======================================================================================================================================== |
@@ -591,18 +609,27 @@ exit /b | |||
591 | :dk_actids | 609 | :dk_actids |
592 | 610 | ||
593 | set applist= | 611 | set applist= |
594 | if %_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')" | 612 | if %_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%')" |
595 | if %_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')" | 613 | if %_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")) |
597 | exit /b | 615 | exit /b |
598 | 616 | ||
617 | :: Get Edition list | ||
618 | |||
619 | :ced_edilist | ||
620 | |||
621 | if %_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%')" | ||
622 | if %_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 ") | ||
624 | exit /b | ||
625 | |||
599 | :: Check wmic.exe | 626 | :: Check wmic.exe |
600 | 627 | ||
601 | :dk_ckeckwmic | 628 | :dk_ckeckwmic |
602 | 629 | ||
603 | set _wmic=0 | 630 | set _wmic=0 |
604 | for %%# in (wmic.exe) do @if not "%%~$PATH:#"=="" ( | 631 | for %%# in (wmic.exe) do @if not "%%~$PATH:#"=="" ( |
605 | wmic path Win32_ComputerSystem get CreationClassName /value 2>nul | find /i "computersystem" 1>nul && set _wmic=1 | 632 | wmic path Win32_ComputerSystem get CreationClassName /value %nul2% | find /i "computersystem" %nul1% && set _wmic=1 |
606 | ) | 633 | ) |
607 | exit /b | 634 | exit /b |
608 | 635 | ||
@@ -617,8 +644,8 @@ set d1=%d1% $meth.SetImplementationFlags(128); $TypeBuilder.CreateType()::Brandi | |||
617 | 644 | ||
618 | set winos= | 645 | set winos= |
619 | for /f "delims=" %%s in ('"%psc% %d1%"') do if not errorlevel 1 (set winos=%%s) | 646 | for /f "delims=" %%s in ('"%psc% %d1%"') do if not errorlevel 1 (set winos=%%s) |
620 | echo "%winos%" | find /i "Windows" 1>nul || ( | 647 | echo "%winos%" | find /i "Windows" %nul1% || ( |
621 | for /f "skip=2 tokens=2*" %%a in ('reg query "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion" /v ProductName 2^>nul') do set "winos=%%b" | 648 | for /f "skip=2 tokens=2*" %%a in ('reg query "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion" /v ProductName %nul6%') do set "winos=%%b" |
622 | if %winbuild% GEQ 22000 ( | 649 | if %winbuild% GEQ 22000 ( |
623 | set winos=!winos:Windows 10=Windows 11! | 650 | set 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:[ | ||
978 | param ( | ||
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) | ||
998 | if (!$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 | ||
1016 | if %winbuild% GTR 17763 exit /b | ||
1017 | if exist "%SystemRoot%\Servicing\Packages\Microsoft-Windows-Server*CorEdition~*.mum" (set Cor=Cor) else (set Cor=) | ||
1018 | |||
959 | set h= | 1019 | set h= |
960 | for %%# in ( | 1020 | for %%# in ( |
961 | 44N%h%YX-TK%h%R9D-CCM2%h%D-V6%h%B8F-HQ%h%WWR__Volume:MAK_Enterprise | 1021 | XGV%h%PP-NM%h%H47-7TT%h%HJ-W%h%3FW7-8HV%h%2C__OEM:NONSLP_Enterprise |
962 | D6R%h%D9-D4%h%N8T-RT9Q%h%X-YW%h%6YT-FC%h%WWJ______Retail_Starter | 1022 | D6R%h%D9-D4%h%N8T-RT9%h%QX-Y%h%W6YT-FCW%h%WJ______Retail_Starter |
963 | 3V6%h%Q6-NQ%h%XCX-V8YX%h%R-9Q%h%CYV-QP%h%FCT__Volume:MAK_EnterpriseN | 1023 | 3V6%h%Q6-NQ%h%XCX-V8Y%h%XR-9%h%QCYV-QPF%h%CT__Volume:MAK_EnterpriseN |
964 | 3NF%h%XW-2T%h%27M-2BDW%h%6-4G%h%HRV-68%h%XRX______Retail_StarterN | 1024 | 3NF%h%XW-2T%h%27M-2BD%h%W6-4%h%GHRV-68X%h%RX______Retail_StarterN |
965 | VK7%h%JG-NP%h%HTM-C97J%h%M-9M%h%PGT-3V%h%66T______Retail_Professional | 1025 | VK7%h%JG-NP%h%HTM-C97%h%JM-9%h%MPGT-3V6%h%6T______Retail_Professional |
966 | 2B8%h%7N-8K%h%FHP-DKV6%h%R-Y2%h%C8J-PK%h%CKT______Retail_ProfessionalN | 1026 | 2B8%h%7N-8K%h%FHP-DKV%h%6R-Y%h%2C8J-PKC%h%KT______Retail_ProfessionalN |
967 | 4CP%h%RK-NM%h%3K3-X6XX%h%Q-RX%h%X86-WX%h%CHW______Retail_CoreN | 1027 | 4CP%h%RK-NM%h%3K3-X6X%h%XQ-R%h%XX86-WXC%h%HW______Retail_CoreN |
968 | N24%h%34-X9%h%D7W-8PF6%h%X-8D%h%V9T-8T%h%YMD______Retail_CoreCountrySpecific | 1028 | N24%h%34-X9%h%D7W-8PF%h%6X-8%h%DV9T-8TY%h%MD______Retail_CoreCountrySpecific |
969 | BT7%h%9Q-G7%h%N6G-PGBY%h%W-4Y%h%WX6-6F%h%4BT______Retail_CoreSingleLanguage | 1029 | BT7%h%9Q-G7%h%N6G-PGB%h%YW-4%h%YWX6-6F4%h%BT______Retail_CoreSingleLanguage |
970 | YTM%h%G3-N6%h%DKC-DKB7%h%7-7M%h%9GH-8H%h%VX7______Retail_Core | 1030 | YTM%h%G3-N6%h%DKC-DKB%h%77-7%h%M9GH-8HV%h%X7______Retail_Core |
971 | XKC%h%NC-J2%h%6Q9-KFHD%h%2-FK%h%THY-KD%h%72Y__OEM:NONSLP_PPIPro | 1031 | XKC%h%NC-J2%h%6Q9-KFH%h%D2-F%h%KTHY-KD7%h%2Y__OEM:NONSLP_PPIPro |
972 | YNM%h%GQ-8R%h%YV3-4PGQ%h%3-C8%h%XTP-7C%h%FBY______Retail_Education | 1032 | YNM%h%GQ-8R%h%YV3-4PG%h%Q3-C%h%8XTP-7CF%h%BY______Retail_Education |
973 | 84N%h%GF-MH%h%BT6-FXBX%h%8-QW%h%JK7-DR%h%R8H______Retail_EducationN | 1033 | 84N%h%GF-MH%h%BT6-FXB%h%X8-Q%h%WJK7-DRR%h%8H______Retail_EducationN |
974 | KCN%h%VH-YK%h%WX8-GJJB%h%9-H9%h%FDT-6F%h%7W2__Volume:MAK_EnterpriseS_VB | 1034 | NK9%h%6Y-D9%h%CD8-W44%h%CQ-R%h%8YTK-DYJ%h%WX__OEM:NONSLP_EnterpriseS_RS1 |
975 | VBX%h%36-N7%h%DDY-M9H6%h%2-83%h%BMJ-CP%h%R42__Volume:MAK_EnterpriseS_RS5 | 1035 | FWN%h%7H-PF%h%93Q-4GG%h%P8-M%h%8RF3-MDW%h%WW__OEM:NONSLP_EnterpriseS_TH |
976 | PN3%h%KR-JX%h%M7T-46HM%h%4-MC%h%QGK-7X%h%PJQ__Volume:MAK_EnterpriseS_RS1 | 1036 | 2DB%h%W3-N2%h%PJG-MVH%h%W3-G%h%7TDK-9HK%h%R4__Volume:MAK_EnterpriseSN_RS1 |
977 | DVW%h%KN-3G%h%CMV-Q2XF%h%4-DD%h%PGM-VQ%h%WWY__Volume:MAK_EnterpriseS_TH | 1037 | NTX%h%6B-BR%h%YC2-K67%h%86-F%h%6MVQ-M7V%h%2X__Volume:MAK_EnterpriseSN_TH |
978 | RQF%h%NW-9T%h%PM3-JQ73%h%T-QV%h%4VQ-DV%h%9PT__Volume:MAK_EnterpriseSN_VB | 1038 | G3K%h%NM-CH%h%G6T-R36%h%X3-9%h%QDG6-8M8%h%K9______Retail_ProfessionalSingleLanguage |
979 | M33%h%WV-NH%h%Y3C-R7FP%h%M-BQ%h%GPT-23%h%9PG__Volume:MAK_EnterpriseSN_RS5 | 1039 | HNG%h%CC-Y3%h%8KG-QVK%h%8D-W%h%MWRK-X86%h%VK______Retail_ProfessionalCountrySpecific |
980 | 2DB%h%W3-N2%h%PJG-MVHW%h%3-G7%h%TDK-9H%h%KR4__Volume:MAK_EnterpriseSN_RS1 | 1040 | DXG%h%7C-N3%h%6C4-C4H%h%TG-X%h%4T3X-2YV%h%77______Retail_ProfessionalWorkstation |
981 | NTX%h%6B-BR%h%YC2-K678%h%6-F6%h%MVQ-M7%h%V2X__Volume:MAK_EnterpriseSN_TH | 1041 | WYP%h%NQ-8C%h%467-V2W%h%6J-T%h%X4WX-WT2%h%RQ______Retail_ProfessionalWorkstationN |
982 | G3K%h%NM-CH%h%G6T-R36X%h%3-9Q%h%DG6-8M%h%8K9______Retail_ProfessionalSingleLanguage | 1042 | 8PT%h%T6-RN%h%W4C-6V7%h%J2-C%h%2D3X-MHB%h%PB______Retail_ProfessionalEducation |
983 | HNG%h%CC-Y3%h%8KG-QVK8%h%D-WM%h%WRK-X8%h%6VK______Retail_ProfessionalCountrySpecific | 1043 | GJT%h%YN-HD%h%MQY-FRR%h%76-H%h%VGC7-QPF%h%8P______Retail_ProfessionalEducationN |
984 | DXG%h%7C-N3%h%6C4-C4HT%h%G-X4%h%T3X-2Y%h%V77______Retail_ProfessionalWorkstation | 1044 | C4N%h%TJ-CX%h%6Q2-VXD%h%MR-X%h%VKGM-F9D%h%JC__Volume:MAK_EnterpriseG |
985 | WYP%h%NQ-8C%h%467-V2W6%h%J-TX%h%4WX-WT%h%2RQ______Retail_ProfessionalWorkstationN | 1045 | 46P%h%N6-R9%h%BK9-CVH%h%KB-H%h%WQ9V-MBJ%h%Y8__Volume:MAK_EnterpriseGN |
986 | 8PT%h%T6-RN%h%W4C-6V7J%h%2-C2%h%D3X-MH%h%BPB______Retail_ProfessionalEducation | 1046 | NJC%h%F7-PW%h%8QT-332%h%4D-6%h%88JX-2YV%h%66______Retail_ServerRdsh |
987 | GJT%h%YN-HD%h%MQY-FRR7%h%6-HV%h%GC7-QP%h%F8P______Retail_ProfessionalEducationN | 1047 | V3W%h%VW-N2%h%PV2-CGW%h%C3-3%h%4QGF-VMJ%h%2C______Retail_Cloud |
988 | C4N%h%TJ-CX%h%6Q2-VXDM%h%R-XV%h%KGM-F9%h%DJC__Volume:MAK_EnterpriseG | 1048 | NH9%h%J3-68%h%WK7-6FB%h%93-4%h%K3DF-DJ4%h%F6______Retail_CloudN |
989 | 46P%h%N6-R9%h%BK9-CVHK%h%B-HW%h%Q9V-MB%h%JY8__Volume:MAK_EnterpriseGN | 1049 | 2HN%h%6V-HG%h%TM8-6C9%h%7C-R%h%K67V-JQP%h%FD______Retail_CloudE |
990 | NJC%h%F7-PW%h%8QT-3324%h%D-68%h%8JX-2Y%h%V66______Retail_ServerRdsh | 1050 | WC2%h%BQ-8N%h%RM3-FDD%h%YY-2%h%BFGV-KHK%h%QY_Volume:GVLK_ServerStandard%Cor%_RS1 |
991 | V3W%h%VW-N2%h%PV2-CGWC%h%3-34%h%QGF-VM%h%J2C______Retail_Cloud | 1051 | CB7%h%KF-BW%h%N84-R7R%h%2Y-7%h%93K2-8XD%h%DG_Volume:GVLK_ServerDatacenter%Cor%_RS1 |
992 | NH9%h%J3-68%h%WK7-6FB9%h%3-4K%h%3DF-DJ%h%4F6______Retail_CloudN | 1052 | JCK%h%RF-N3%h%7P4-C2D%h%82-9%h%YXRT-4M6%h%3B_Volume:GVLK_ServerSolution_RS1 |
993 | 2HN%h%6V-HG%h%TM8-6C97%h%C-RK%h%67V-JQ%h%PFD______Retail_CloudE | 1053 | QN4%h%C6-GB%h%JD2-FB4%h%22-G%h%HWJK-GJG%h%2R_Volume:GVLK_ServerCloudStorage_RS1 |
994 | XQQ%h%YW-NF%h%FMW-XJPB%h%H-K8%h%732-CK%h%FFD______OEM:DM_IoTEnterprise | 1054 | VP3%h%4G-4N%h%PPG-79J%h%TQ-8%h%64T4-R3M%h%QX_Volume:GVLK_ServerAzureCor_RS1 |
995 | QPM%h%6N-7J%h%2WJ-P88H%h%H-P3%h%YRH-YY%h%74H__OEM:NONSLP_IoTEnterpriseS_VB | 1055 | 9JQ%h%NQ-V8%h%HQ6-PKB%h%8H-G%h%GHRY-R62%h%H6______Retail_ServerAzureNano_RS1 |
996 | KBN%h%8V-HF%h%GQ4-MGXV%h%D-34%h%7P6-PD%h%QGT_Volume:GVLK_IoTEnterpriseS_NI | 1056 | VN8%h%D3-PR%h%82H-DB6%h%BJ-J%h%9P4M-92F%h%6J______Retail_ServerStorageStandard_RS1 |
997 | K9V%h%KN-3B%h%GWV-Y624%h%W-MC%h%RMQ-BH%h%DCD______Retail_CloudEditionN | 1057 | 48T%h%QX-NV%h%K3R-D8Q%h%R3-G%h%THHM-8FH%h%XC______Retail_ServerStorageWorkgroup_RS1 |
998 | KY7%h%PN-VR%h%6RX-83W6%h%Y-6D%h%DYQ-T6%h%R4W______Retail_CloudEdition | 1058 | 2HX%h%DN-KR%h%XHB-GPY%h%C7-Y%h%CKFJ-7FV%h%DG_Volume:GVLK_ServerDatacenterACor_RS3 |
999 | MPB%h%3G-XN%h%BR7-CC43%h%M-FG%h%64B-F9%h%GBK______Retail_IoTEnterpriseSK | 1059 | PTX%h%N8-JF%h%HJM-4WC%h%78-M%h%PCBR-9W4%h%KR_Volume:GVLK_ServerStandardACor_RS3 |
1000 | ) do ( | 1060 | ) do ( |
1001 | for /f "tokens=1-4 delims=_" %%A in ("%%#") do if /i %targetedition%==%%C ( | 1061 | for /f "tokens=1-4 delims=_" %%A in ("%%#") do if /i %targetedition%==%%C ( |
1002 | 1062 | ||
@@ -1005,7 +1065,7 @@ set 4th=%%D | |||
1005 | if not defined 4th ( | 1065 | if not defined 4th ( |
1006 | set "key=%%A" & set "_chan=%%B" | 1066 | set "key=%%A" & set "_chan=%%B" |
1007 | ) else ( | 1067 | ) else ( |
1008 | echo "%branch%" | find "%%D" 1>nul && (set "key=%%A" & set "_chan=%%B") | 1068 | echo "%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") | |||
1013 | exit /b | 1073 | exit /b |
1014 | 1074 | ||
1015 | ::======================================================================================================================================== | 1075 | ::======================================================================================================================================== |
1016 | 1076 | :: Leave empty line below | |
1017 | :changeeditionserverdata | ||
1018 | |||
1019 | if 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 | |||
1023 | set h= | ||
1024 | for %%# in ( | ||
1025 | WC2%h%BQ-8N%h%RM3-FDD%h%YY-2B%h%FGV-KHK%h%QY_RS1_ServerStandard%Cor% | ||
1026 | CB7%h%KF-BW%h%N84-R7R%h%2Y-79%h%3K2-8XD%h%DG_RS1_ServerDatacenter%Cor% | ||
1027 | JCK%h%RF-N3%h%7P4-C2D%h%82-9Y%h%XRT-4M6%h%3B_RS1_ServerSolution | ||
1028 | QN4%h%C6-GB%h%JD2-FB4%h%22-GH%h%WJK-GJG%h%2R_RS1_ServerCloudStorage | ||
1029 | VP3%h%4G-4N%h%PPG-79J%h%TQ-86%h%4T4-R3M%h%QX_RS1_ServerAzureCor | ||
1030 | 9JQ%h%NQ-V8%h%HQ6-PKB%h%8H-GG%h%HRY-R62%h%H6_RS1_ServerAzureNano | ||
1031 | VN8%h%D3-PR%h%82H-DB6%h%BJ-J9%h%P4M-92F%h%6J_RS1_ServerStorageStandard | ||
1032 | 48T%h%QX-NV%h%K3R-D8Q%h%R3-GT%h%HHM-8FH%h%XC_RS1_ServerStorageWorkgroup | ||
1033 | 2HX%h%DN-KR%h%XHB-GPY%h%C7-YC%h%KFJ-7FV%h%DG_RS3_ServerDatacenterACor | ||
1034 | PTX%h%N8-JF%h%HJM-4WC%h%78-MP%h%CBR-9W4%h%KR_RS3_ServerStandardACor | ||
1035 | ) do ( | ||
1036 | for /f "tokens=1-3 delims=_" %%A in ("%%#") do if /i %targetedition%==%%C ( | ||
1037 | echo "%branch%" | find /i "%%B" 1>nul && (set "key=%%A") | ||
1038 | ) | ||
1039 | ) | ||
1040 | exit /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 | ||
41 | pushd "%~dp0" | 41 | pushd "%~dp0" |
42 | >nul findstr /rxc:".*" "%~nx0" | 42 | >nul findstr /v "$" "%~nx0" && ( |
43 | if not %errorlevel%==0 ( | ||
44 | echo: | 43 | echo: |
45 | echo Error: Script either has LF line ending issue, or it failed to read itself. | 44 | echo Error: Script either has LF line ending issue or an empty line at the end of the script is missing. |
46 | echo: | 45 | echo: |
47 | ping 127.0.0.1 -n 6 > nul | 46 | ping 127.0.0.1 -n 6 >nul |
48 | popd | 47 | popd |
49 | exit /b | 48 | exit /b |
50 | ) | 49 | ) |
@@ -230,4 +229,5 @@ cscript //nologo "!office!\ospp.vbs" /dstatus | |||
230 | echo. | 229 | echo. |
231 | echo Press any key to exit. | 230 | echo Press any key to exit. |
232 | pause >nul | 231 | pause >nul |
233 | exit /b \ No newline at end of file | 232 | exit /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 | ||
69 | pushd "%~dp0" | 69 | pushd "%~dp0" |
70 | >nul findstr /rxc:".*" "%~nx0" | 70 | >nul findstr /v "$" "%~nx0" && ( |
71 | if not %errorlevel%==0 ( | ||
72 | echo: | 71 | echo: |
73 | echo Error: Script either has LF line ending issue, or it failed to read itself. | 72 | echo Error: Script either has LF line ending issue or an empty line at the end of the script is missing. |
74 | echo: | 73 | echo: |
75 | ping 127.0.0.1 -n 6 > nul | 74 | ping 127.0.0.1 -n 6 >nul |
76 | popd | 75 | popd |
77 | exit /b | 76 | exit /b |
78 | ) | 77 | ) |
@@ -536,4 +535,5 @@ PrintLicensesInformation -Mode "NUL" | |||
536 | Write-Host | 535 | Write-Host |
537 | PrintLicensesInformation -Mode "Device" | 536 | PrintLicensesInformation -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 | |||
21 | set "PATH=%SystemRoot%\System32;%SystemRoot%\System32\wbem;%SystemRoot%\System32\WindowsPowerShell\v1.0\" | ||
22 | if exist "%SystemRoot%\Sysnative\reg.exe" ( | ||
23 | set "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" | |||
24 | for %%# in (%*) do ( | 30 | for %%# in (%*) do ( |
25 | if /i "%%#"=="r1" set r1=1 | 31 | if /i "%%#"=="r1" set r1=1 |
26 | if /i "%%#"=="r2" set r2=1 | 32 | if /i "%%#"=="r2" set r2=1 |
33 | if /i "%%#"=="-qedit" ( | ||
34 | reg add HKCU\Console /v QuickEdit /t REG_DWORD /d "1" /f %nul1% | ||
35 | rem check the code below admin elevation to understand why it's here | ||
36 | ) | ||
27 | ) | 37 | ) |
28 | 38 | ||
29 | if exist %SystemRoot%\Sysnative\cmd.exe if not defined r1 ( | 39 | if exist %SystemRoot%\Sysnative\cmd.exe if not defined r1 ( |
@@ -40,22 +50,34 @@ start %SystemRoot%\SysArm32\cmd.exe /c ""!_cmdf!" %* r2" | |||
40 | exit /b | 50 | exit /b |
41 | ) | 51 | ) |
42 | 52 | ||
43 | :: Set Path variable, it helps if it is misconfigured in the system | 53 | ::======================================================================================================================================== |
44 | 54 | ||
45 | set "PATH=%SystemRoot%\System32;%SystemRoot%\System32\wbem;%SystemRoot%\System32\WindowsPowerShell\v1.0\" | 55 | set "blank=" |
46 | if exist "%SystemRoot%\Sysnative\reg.exe" ( | 56 | set "mas=mass%blank%grave.dev" |
47 | set "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 | |||
60 | sc query Null | find /i "RUNNING" | ||
61 | if %errorlevel% NEQ 0 ( | ||
62 | echo: | ||
63 | echo Null service is not running, script may crash... | ||
64 | echo: | ||
65 | echo: | ||
66 | echo Help - https://%mas%/troubleshoot.html | ||
67 | echo: | ||
68 | echo: | ||
69 | ping 127.0.0.1 -n 10 | ||
48 | ) | 70 | ) |
71 | cls | ||
49 | 72 | ||
50 | :: Check LF line ending | 73 | :: Check LF line ending |
51 | 74 | ||
52 | pushd "%~dp0" | 75 | pushd "%~dp0" |
53 | >nul findstr /rxc:".*" "%~nx0" | 76 | >nul findstr /v "$" "%~nx0" && ( |
54 | if not %errorlevel%==0 ( | ||
55 | echo: | 77 | echo: |
56 | echo Error: Script either has LF line ending issue, or it failed to read itself. | 78 | echo Error: Script either has LF line ending issue or an empty line at the end of the script is missing. |
57 | echo: | 79 | echo: |
58 | ping 127.0.0.1 -n 6 > nul | 80 | ping 127.0.0.1 -n 6 >nul |
59 | popd | 81 | popd |
60 | exit /b | 82 | exit /b |
61 | ) | 83 | ) |
@@ -67,27 +89,44 @@ cls | |||
67 | color 07 | 89 | color 07 |
68 | title Extract $OEM$ Folder | 90 | title Extract $OEM$ Folder |
69 | 91 | ||
70 | set winbuild=1 | 92 | set _args= |
93 | set _elev= | ||
94 | |||
95 | set _args=%* | ||
96 | if defined _args set _args=%_args:"=% | ||
97 | if defined _args ( | ||
98 | for %%A in (%_args%) do ( | ||
99 | if /i "%%A"=="-el" set _elev=1 | ||
100 | ) | ||
101 | ) | ||
102 | |||
103 | set "nul1=1>nul" | ||
104 | set "nul2=2>nul" | ||
105 | set "nul6=2^>nul" | ||
71 | set "nul=>nul 2>&1" | 106 | set "nul=>nul 2>&1" |
107 | |||
72 | set psc=powershell.exe | 108 | set psc=powershell.exe |
109 | set winbuild=1 | ||
73 | for /f "tokens=6 delims=[]. " %%G in ('ver') do set winbuild=%%G | 110 | for /f "tokens=6 delims=[]. " %%G in ('ver') do set winbuild=%%G |
74 | 111 | ||
75 | set _NCS=1 | 112 | set _NCS=1 |
76 | if %winbuild% LSS 10586 set _NCS=0 | 113 | if %winbuild% LSS 10586 set _NCS=0 |
77 | if %winbuild% GEQ 10586 reg query "HKCU\Console" /v ForceV2 2>nul | find /i "0x0" 1>nul && (set _NCS=0) | 114 | if %winbuild% GEQ 10586 reg query "HKCU\Console" /v ForceV2 %nul2% | find /i "0x0" %nul1% && (set _NCS=0) |
78 | 115 | ||
79 | if %_NCS% EQU 1 ( | 116 | if %_NCS% EQU 1 ( |
80 | for /F %%a in ('echo prompt $E ^| cmd') do set "esc=%%a" | 117 | for /F %%a in ('echo prompt $E ^| cmd') do set "esc=%%a" |
81 | set "Red="41;97m"" | 118 | set "Red="41;97m"" |
119 | set "Gray="100;97m"" | ||
82 | set "Green="42;97m"" | 120 | set "Green="42;97m"" |
83 | set "Magenta="45;97m"" | 121 | set "Blue="44;97m"" |
84 | set "_White="40;37m"" | 122 | set "_White="40;37m"" |
85 | set "_Green="40;92m"" | 123 | set "_Green="40;92m"" |
86 | set "_Yellow="40;93m"" | 124 | set "_Yellow="40;93m"" |
87 | ) else ( | 125 | ) else ( |
88 | set "Red="Red" "white"" | 126 | set "Red="Red" "white"" |
127 | set "Gray="Darkgray" "white"" | ||
89 | set "Green="DarkGreen" "white"" | 128 | set "Green="DarkGreen" "white"" |
90 | set "Magenta="Darkmagenta" "white"" | 129 | set "Blue="Blue" "white"" |
91 | set "_White="Black" "Gray"" | 130 | set "_White="Black" "Gray"" |
92 | set "_Green="Black" "Green"" | 131 | set "_Green="Black" "Green"" |
93 | set "_Yellow="Black" "Yellow"" | 132 | set "_Yellow="Black" "Yellow"" |
@@ -100,7 +139,7 @@ set "eline=echo: &call :ex_color %Red% "==== ERROR ====" &echo:" | |||
100 | 139 | ||
101 | if %winbuild% LSS 7600 ( | 140 | if %winbuild% LSS 7600 ( |
102 | %nceline% | 141 | %nceline% |
103 | echo Unsupported OS version detected. | 142 | echo Unsupported OS version detected [%winbuild%]. |
104 | echo Project is supported only for Windows 7/8/8.1/10/11 and their Server equivalent. | 143 | echo Project is supported only for Windows 7/8/8.1/10/11 and their Server equivalent. |
105 | goto done2 | 144 | goto 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 | ||
118 | set desktop= | ||
119 | for /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" | ||
120 | if not defined desktop for /f "delims=" %%a in ('%psc% "& {write-host $([Environment]::GetFolderPath('Desktop'))}"') do call set "desktop=%%a" | ||
121 | |||
122 | set "_work=%~dp0" | 157 | set "_work=%~dp0" |
123 | if "%_work:~-1%"=="\" set "_work=%_work:~0,-1%" | 158 | if "%_work:~-1%"=="\" set "_work=%_work:~0,-1%" |
124 | 159 | ||
125 | set "_batf=%~f0" | 160 | set "_batf=%~f0" |
126 | set "_batp=%_batf:'=''%" | 161 | set "_batp=%_batf:'=''%" |
127 | set "_pdesk=%desktop:'=''%" | ||
128 | 162 | ||
129 | set _PSarg="""%~f0""" -el %_args% | 163 | set _PSarg="""%~f0""" -el %_args% |
130 | set "_ttemp=%temp%" | 164 | set "_ttemp=%temp%" |
131 | 165 | ||
132 | set "_dir=%desktop%\$OEM$\$$\Setup\Scripts" | ||
133 | |||
134 | setlocal EnableDelayedExpansion | 166 | setlocal EnableDelayedExpansion |
135 | 167 | ||
136 | ::======================================================================================================================================== | 168 | ::======================================================================================================================================== |
137 | 169 | ||
138 | echo "!_batf!" | find /i "!_ttemp!" 1>nul && ( | 170 | echo "!_batf!" | find /i "!_ttemp!" %nul1% && ( |
139 | if /i not "!_work!"=="!_ttemp!" ( | 171 | if /i not "!_work!"=="!_ttemp!" ( |
140 | %eline% | 172 | %eline% |
141 | echo Script is launched from the temp folder, | 173 | echo 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 || ( |
154 | if not defined _elev %nul% %psc% "start cmd.exe -arg '/c \"!_PSarg:'=''!\"' -verb runas" && exit /b | 186 | if not defined _elev %psc% "start cmd.exe -arg '/c \"!_PSarg:'=''!\"' -verb runas" && exit /b |
155 | %eline% | 187 | %eline% |
156 | echo This script require admin privileges. | 188 | echo This script require admin privileges. |
157 | echo To do so, right click on this script and select 'Run as administrator'. | 189 | echo 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 | ||
163 | if 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 | |||
198 | for %%# in (%_args%) do (if /i "%%#"=="-qedit" set quedit=1) | ||
199 | |||
200 | reg query HKCU\Console /v QuickEdit %nul2% | find /i "0x0" %nul1% || if not defined quedit ( | ||
201 | reg add HKCU\Console /v QuickEdit /t REG_DWORD /d "0" /f %nul1% | ||
202 | start cmd.exe /c ""!_batf!" %_args% -qedit" | ||
203 | rem quickedit reset code is added at the starting of the script instead of here because it takes time to reflect in some cases | ||
204 | exit /b | ||
205 | ) | ||
206 | |||
207 | ::======================================================================================================================================== | ||
208 | |||
209 | setlocal DisableDelayedExpansion | ||
210 | |||
211 | :: Check desktop location | ||
212 | |||
213 | set desktop= | ||
214 | for /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" | ||
215 | if not defined desktop for /f "delims=" %%a in ('%psc% "& {write-host $([Environment]::GetFolderPath('Desktop'))}"') do call set "desktop=%%a" | ||
216 | |||
217 | set "_pdesk=%desktop:'=''%" | ||
218 | set "_dir=%desktop%\$OEM$\$$\Setup\Scripts" | ||
219 | |||
220 | if exist "!desktop!\" ( | ||
164 | %eline% | 221 | %eline% |
165 | echo Desktop location was not detected, aborting... | 222 | echo Desktop location was not detected, aborting... |
166 | goto done2 | 223 | goto done2 |
167 | ) | 224 | ) |
168 | 225 | ||
226 | setlocal EnableDelayedExpansion | ||
227 | |||
169 | ::======================================================================================================================================== | 228 | ::======================================================================================================================================== |
170 | 229 | ||
171 | mode con cols=78 lines=30 | 230 | mode con cols=78 lines=30 |
@@ -181,7 +240,9 @@ goto done2 | |||
181 | set HWID_Activation.cmd=Activators\HWID_Activation.cmd | 240 | set HWID_Activation.cmd=Activators\HWID_Activation.cmd |
182 | set KMS38_Activation.cmd=Activators\KMS38_Activation.cmd | 241 | set KMS38_Activation.cmd=Activators\KMS38_Activation.cmd |
183 | set Online_KMS_Activation.cmd=Activators\Online_KMS_Activation.cmd | 242 | set Online_KMS_Activation.cmd=Activators\Online_KMS_Activation.cmd |
184 | 243 | set Ohook_Activation.cmd=Activators\Ohook_Activation\Ohook_Activation.cmd | |
244 | set sppc32.dll=Activators\Ohook_Activation\BIN\sppc32.dll | ||
245 | set sppc64.dll=Activators\Ohook_Activation\BIN\sppc64.dll | ||
185 | pushd "!_work!" | 246 | pushd "!_work!" |
186 | 247 | ||
187 | set _nofile= | 248 | set _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 ( |
193 | if not exist "%%#" set _nofile=1 | 257 | if not exist "%%#" set _nofile=1 |
194 | ) | 258 | ) |
@@ -213,29 +277,38 @@ echo: | |||
213 | echo: | 277 | echo: |
214 | echo: | 278 | echo: |
215 | echo: | 279 | echo: |
216 | echo: | ||
217 | echo: Extract $OEM$ folder on the desktop | 280 | echo: Extract $OEM$ folder on the desktop |
218 | echo: ________________________________________________________ | 281 | echo: ________________________________________________________ |
219 | echo: | 282 | echo: |
220 | echo: [1] HWID | 283 | echo: [1] HWID |
221 | echo: [2] KMS38 | 284 | echo: [2] Ohook |
222 | echo: [3] Online KMS | 285 | echo: [3] KMS38 |
223 | echo: | 286 | echo: [4] Online KMS |
224 | echo: [4] HWID ^(Windows^) ^+ Online KMS ^(Office^) | 287 | echo: |
225 | echo: [5] KMS38 ^(Windows^) ^+ Online KMS ^(Office^) | 288 | echo: [5] HWID ^(Windows^) ^+ Ohook ^(Office^) |
226 | echo: | 289 | echo: [6] HWID ^(Windows^) ^+ Online KMS ^(Office^) |
227 | echo: [0] Exit | 290 | echo: [7] KMS38 ^(Windows^) ^+ Ohook ^(Office^) |
291 | echo: [8] KMS38 ^(Windows^) ^+ Online KMS ^(Office^) | ||
292 | echo: [9] Online KMS ^(Windows^) ^+ Ohook ^(Office^) | ||
293 | echo: | ||
294 | call :ex_color2 %_White% " [R] " %_Green% "ReadMe" | ||
295 | echo: [0] Exit | ||
228 | echo: ________________________________________________________ | 296 | echo: ________________________________________________________ |
229 | echo: | 297 | echo: |
230 | call :ex_color2 %_White% " " %_Green% "Enter a menu option in the Keyboard [1,2,3,4,5,0]" | 298 | call :ex_color2 %_White% " " %_Green% "Enter a menu option in the Keyboard :" |
231 | choice /C:123450 /N | 299 | choice /C:123456789R0 /N |
232 | set _erl=%errorlevel% | 300 | set _erl=%errorlevel% |
233 | 301 | ||
234 | if %_erl%==6 exit /b | 302 | if %_erl%==11 exit /b |
235 | if %_erl%==5 goto:kms38_kms | 303 | if %_erl%==10 start https://%mas%/oem-folder.html &goto :Menu |
236 | if %_erl%==4 goto:hwid_kms | 304 | if %_erl%==9 goto:kms_ohook |
237 | if %_erl%==3 goto:kms | 305 | if %_erl%==8 goto:kms38_kms |
238 | if %_erl%==2 goto:kms38 | 306 | if %_erl%==7 goto:kms38_ohook |
307 | if %_erl%==6 goto:hwid_kms | ||
308 | if %_erl%==5 goto:hwid_ohook | ||
309 | if %_erl%==4 goto:kms | ||
310 | if %_erl%==3 goto:kms38 | ||
311 | if %_erl%==2 goto:ohook | ||
239 | if %_erl%==1 goto:hwid | 312 | if %_erl%==1 goto:hwid |
240 | goto :Menu | 313 | goto :Menu |
241 | 314 | ||
@@ -271,6 +344,40 @@ cd \ | |||
271 | 344 | ||
272 | ::======================================================================================================================================== | 345 | ::======================================================================================================================================== |
273 | 346 | ||
347 | :ohook | ||
348 | |||
349 | cls | ||
350 | md "!desktop!\$OEM$\$$\Setup\Scripts\BIN" | ||
351 | pushd "!_work!" | ||
352 | copy /y /b "%Ohook_Activation.cmd%" "!_dir!\Ohook_Activation.cmd" %nul% | ||
353 | copy /y /b "%sppc32.dll%" "!_dir!\BIN\sppc32.dll" %nul% | ||
354 | copy /y /b "%sppc64.dll%" "!_dir!\BIN\sppc64.dll" %nul% | ||
355 | popd | ||
356 | call :export ohook_setup | ||
357 | |||
358 | set _error= | ||
359 | if not exist "!_dir!\Ohook_Activation.cmd" set _error=1 | ||
360 | if not exist "!_dir!\BIN\sppc32.dll" set _error=1 | ||
361 | if not exist "!_dir!\BIN\sppc64.dll" set _error=1 | ||
362 | if not exist "!_dir!\SetupComplete.cmd" set _error=1 | ||
363 | if defined _error goto errorfound | ||
364 | |||
365 | set oem=Ohook | ||
366 | goto done | ||
367 | |||
368 | :ohook_setup: | ||
369 | @echo off | ||
370 | |||
371 | fltmc >nul || exit /b | ||
372 | |||
373 | start /b /wait cmd /c "%~dp0Ohook_Activation.cmd" /Ohook | ||
374 | |||
375 | cd \ | ||
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 | ||
276 | cls | 383 | cls |
@@ -331,6 +438,44 @@ cd \ | |||
331 | 438 | ||
332 | ::======================================================================================================================================== | 439 | ::======================================================================================================================================== |
333 | 440 | ||
441 | :hwid_ohook | ||
442 | |||
443 | cls | ||
444 | md "!desktop!\$OEM$\$$\Setup\Scripts\BIN" | ||
445 | pushd "!_work!" | ||
446 | copy /y /b "%HWID_Activation.cmd%" "!_dir!\HWID_Activation.cmd" %nul% | ||
447 | copy /y /b "%Ohook_Activation.cmd%" "!_dir!\Ohook_Activation.cmd" %nul% | ||
448 | copy /y /b "%sppc32.dll%" "!_dir!\BIN\sppc32.dll" %nul% | ||
449 | copy /y /b "%sppc64.dll%" "!_dir!\BIN\sppc64.dll" %nul% | ||
450 | popd | ||
451 | call :export hwid_ohook_setup | ||
452 | |||
453 | set _error= | ||
454 | if not exist "!_dir!\HWID_Activation.cmd" set _error=1 | ||
455 | if not exist "!_dir!\Ohook_Activation.cmd" set _error=1 | ||
456 | if not exist "!_dir!\BIN\sppc32.dll" set _error=1 | ||
457 | if not exist "!_dir!\BIN\sppc64.dll" set _error=1 | ||
458 | if not exist "!_dir!\SetupComplete.cmd" set _error=1 | ||
459 | if defined _error goto errorfound | ||
460 | |||
461 | set oem=HWID [Windows] + Ohook [Office] | ||
462 | goto done | ||
463 | |||
464 | :hwid_ohook_setup: | ||
465 | @echo off | ||
466 | |||
467 | fltmc >nul || exit /b | ||
468 | |||
469 | start /b /wait cmd /c "%~dp0HWID_Activation.cmd" /HWID | ||
470 | |||
471 | start /b /wait cmd /c "%~dp0Ohook_Activation.cmd" /Ohook | ||
472 | |||
473 | cd \ | ||
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 | ||
336 | cls | 481 | cls |
@@ -365,6 +510,44 @@ cd \ | |||
365 | 510 | ||
366 | ::======================================================================================================================================== | 511 | ::======================================================================================================================================== |
367 | 512 | ||
513 | :kms38_ohook | ||
514 | |||
515 | cls | ||
516 | md "!desktop!\$OEM$\$$\Setup\Scripts\BIN" | ||
517 | pushd "!_work!" | ||
518 | copy /y /b "%KMS38_Activation.cmd%" "!_dir!\KMS38_Activation.cmd" %nul% | ||
519 | copy /y /b "%Ohook_Activation.cmd%" "!_dir!\Ohook_Activation.cmd" %nul% | ||
520 | copy /y /b "%sppc32.dll%" "!_dir!\BIN\sppc32.dll" %nul% | ||
521 | copy /y /b "%sppc64.dll%" "!_dir!\BIN\sppc64.dll" %nul% | ||
522 | popd | ||
523 | call :export kms38_ohook_setup | ||
524 | |||
525 | set _error= | ||
526 | if not exist "!_dir!\KMS38_Activation.cmd" set _error=1 | ||
527 | if not exist "!_dir!\Ohook_Activation.cmd" set _error=1 | ||
528 | if not exist "!_dir!\BIN\sppc32.dll" set _error=1 | ||
529 | if not exist "!_dir!\BIN\sppc64.dll" set _error=1 | ||
530 | if not exist "!_dir!\SetupComplete.cmd" set _error=1 | ||
531 | if defined _error goto errorfound | ||
532 | |||
533 | set oem=KMS38 [Windows] + Ohook [Office] | ||
534 | goto done | ||
535 | |||
536 | :kms38_ohook_setup: | ||
537 | @echo off | ||
538 | |||
539 | fltmc >nul || exit /b | ||
540 | |||
541 | start /b /wait cmd /c "%~dp0KMS38_Activation.cmd" /KMS38 | ||
542 | |||
543 | start /b /wait cmd /c "%~dp0Ohook_Activation.cmd" /Ohook | ||
544 | |||
545 | cd \ | ||
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 | ||
370 | cls | 553 | cls |
@@ -399,6 +582,44 @@ cd \ | |||
399 | 582 | ||
400 | ::======================================================================================================================================== | 583 | ::======================================================================================================================================== |
401 | 584 | ||
585 | :kms_ohook | ||
586 | |||
587 | cls | ||
588 | md "!desktop!\$OEM$\$$\Setup\Scripts\BIN" | ||
589 | pushd "!_work!" | ||
590 | copy /y /b "%Online_KMS_Activation.cmd%" "!_dir!\Online_KMS_Activation.cmd" %nul% | ||
591 | copy /y /b "%Ohook_Activation.cmd%" "!_dir!\Ohook_Activation.cmd" %nul% | ||
592 | copy /y /b "%sppc32.dll%" "!_dir!\BIN\sppc32.dll" %nul% | ||
593 | copy /y /b "%sppc64.dll%" "!_dir!\BIN\sppc64.dll" %nul% | ||
594 | popd | ||
595 | call :export kms_ohook_setup | ||
596 | |||
597 | set _error= | ||
598 | if not exist "!_dir!\Online_KMS_Activation.cmd" set _error=1 | ||
599 | if not exist "!_dir!\Ohook_Activation.cmd" set _error=1 | ||
600 | if not exist "!_dir!\BIN\sppc32.dll" set _error=1 | ||
601 | if not exist "!_dir!\BIN\sppc64.dll" set _error=1 | ||
602 | if not exist "!_dir!\SetupComplete.cmd" set _error=1 | ||
603 | if defined _error goto errorfound | ||
604 | |||
605 | set oem=Online KMS [Windows] + Ohook [Office] | ||
606 | goto done | ||
607 | |||
608 | :kms_ohook_setup: | ||
609 | @echo off | ||
610 | |||
611 | fltmc >nul || exit /b | ||
612 | |||
613 | start /b /wait cmd /c "%~dp0Online_KMS_Activation.cmd" /KMS-ActAndRenewalTask /KMS-Windows | ||
614 | |||
615 | start /b /wait cmd /c "%~dp0Ohook_Activation.cmd" /Ohook | ||
616 | |||
617 | cd \ | ||
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 | ||
410 | set -= | ||
411 | echo ______________________________________________________________ | 631 | echo ______________________________________________________________ |
412 | echo: | 632 | echo: |
413 | call :ex_color %Magenta% "%oem%" | 633 | call :ex_color %Blue% "%oem%" |
414 | call :ex_color %Green% "$OEM$ folder is successfully created on the Desktop." | 634 | call :ex_color %Green% "$OEM$ folder is successfully created on the Desktop." |
415 | echo "%oem%" | find /i "38" %nul% && ( | 635 | echo "%oem%" | find /i "38" %nul% && ( |
416 | echo: | 636 | echo: |
417 | echo To KMS38 activate Server Cor/Acor editions ^(No GUI Versions^), | 637 | echo To KMS38 activate Server Cor/Acor editions ^(No GUI Versions^), |
418 | echo Check this page https://mass%-%grave.dev/oem-folder | 638 | echo Check this page https://%mas%/oem-folder |
419 | ) | 639 | ) |
420 | echo ______________________________________________________________ | 640 | echo ______________________________________________________________ |
421 | 641 | ||
@@ -423,7 +643,7 @@ echo ______________________________________________________________ | |||
423 | 643 | ||
424 | echo: | 644 | echo: |
425 | call :ex_color %_Yellow% "Press any key to exit..." | 645 | call :ex_color %_Yellow% "Press any key to exit..." |
426 | pause >nul | 646 | pause %nul1% |
427 | exit /b | 647 | exit /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);" |
436 | exit /b | 656 | exit /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 | ) |
456 | exit /b | 676 | exit /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 | |||
26 | set "_cmdf=%~f0" | ||
27 | for %%# in (%*) do ( | ||
28 | if /i "%%#"=="r1" set r1=1 | ||
29 | if /i "%%#"=="r2" set r2=1 | ||
30 | ) | ||
31 | |||
32 | if exist %SystemRoot%\Sysnative\cmd.exe if not defined r1 ( | ||
33 | setlocal EnableDelayedExpansion | ||
34 | start %SystemRoot%\Sysnative\cmd.exe /c ""!_cmdf!" %* r1" | ||
35 | exit /b | ||
36 | ) | ||
37 | |||
38 | :: Re-launch the script with ARM32 process if it was initiated by x64 process on ARM64 Windows | ||
39 | |||
40 | if exist %SystemRoot%\SysArm32\cmd.exe if %PROCESSOR_ARCHITECTURE%==AMD64 if not defined r2 ( | ||
41 | setlocal EnableDelayedExpansion | ||
42 | start %SystemRoot%\SysArm32\cmd.exe /c ""!_cmdf!" %* r2" | ||
43 | exit /b | ||
44 | ) | ||
45 | |||
46 | :: Set Path variable, it helps if it is misconfigured in the system | ||
47 | |||
48 | set "PATH=%SystemRoot%\System32;%SystemRoot%\System32\wbem;%SystemRoot%\System32\WindowsPowerShell\v1.0\" | ||
49 | if exist "%SystemRoot%\Sysnative\reg.exe" ( | ||
50 | set "PATH=%SystemRoot%\Sysnative;%SystemRoot%\Sysnative\wbem;%SystemRoot%\Sysnative\WindowsPowerShell\v1.0\;%PATH%" | ||
51 | ) | ||
52 | |||
53 | :: Check LF line ending | ||
54 | |||
55 | pushd "%~dp0" | ||
56 | >nul findstr /rxc:".*" "%~nx0" | ||
57 | if not %errorlevel%==0 ( | ||
58 | echo: | ||
59 | echo Error: Script either has LF line ending issue, or it failed to read itself. | ||
60 | echo: | ||
61 | ping 127.0.0.1 -n 6 > nul | ||
62 | popd | ||
63 | exit /b | ||
64 | ) | ||
65 | popd | ||
66 | |||
67 | ::======================================================================================================================================== | ||
68 | |||
69 | cls | ||
70 | color 07 | ||
71 | title Install Windows HWID Key | ||
72 | |||
73 | set _args= | ||
74 | set _elev= | ||
75 | set _unattended=0 | ||
76 | |||
77 | set _args=%* | ||
78 | if defined _args set _args=%_args:"=% | ||
79 | if defined _args ( | ||
80 | for %%A in (%_args%) do ( | ||
81 | if /i "%%A"=="-el" set _elev=1 | ||
82 | if /i "%%A"=="/Insert-HWID-Key" set _unattended=1 | ||
83 | ) | ||
84 | ) | ||
85 | |||
86 | ::======================================================================================================================================== | ||
87 | |||
88 | set winbuild=1 | ||
89 | set "nul=>nul 2>&1" | ||
90 | set psc=powershell.exe | ||
91 | for /f "tokens=6 delims=[]. " %%G in ('ver') do set winbuild=%%G | ||
92 | |||
93 | set _NCS=1 | ||
94 | if %winbuild% LSS 10586 set _NCS=0 | ||
95 | if %winbuild% GEQ 10586 reg query "HKCU\Console" /v ForceV2 2>nul | find /i "0x0" 1>nul && (set _NCS=0) | ||
96 | |||
97 | if %_NCS% EQU 1 ( | ||
98 | for /F %%a in ('echo prompt $E ^| cmd') do set "esc=%%a" | ||
99 | set "Red="41;97m"" | ||
100 | set "Green="42;97m"" | ||
101 | set "_Green="40;92m"" | ||
102 | set "_Yellow="40;93m"" | ||
103 | ) else ( | ||
104 | set "Red="Red" "white"" | ||
105 | set "Green="DarkGreen" "white"" | ||
106 | set "_Green="Black" "Green"" | ||
107 | set "_Yellow="Black" "Yellow"" | ||
108 | ) | ||
109 | |||
110 | set "nceline=echo: &echo ==== ERROR ==== &echo:" | ||
111 | set "eline=echo: &call :dk_color %Red% "==== ERROR ====" &echo:" | ||
112 | set "line=echo ___________________________________________________________________________________________" | ||
113 | if %~z0 GEQ 200000 (set "_exitmsg=Go back") else (set "_exitmsg=Exit") | ||
114 | |||
115 | ::======================================================================================================================================== | ||
116 | |||
117 | if %winbuild% LSS 10240 ( | ||
118 | %eline% | ||
119 | echo Unsupported OS version detected. | ||
120 | echo This option is supported only for Windows 10/11. | ||
121 | goto ins_done | ||
122 | ) | ||
123 | |||
124 | if exist "%SystemRoot%\Servicing\Packages\Microsoft-Windows-Server*Edition~*.mum" ( | ||
125 | %eline% | ||
126 | echo HWID Activation is not supported for Windows Server. | ||
127 | goto ins_done | ||
128 | ) | ||
129 | |||
130 | for %%# in (powershell.exe) do @if "%%~$PATH:#"=="" ( | ||
131 | %nceline% | ||
132 | echo Unable to find powershell.exe in the system. | ||
133 | goto ins_done | ||
134 | ) | ||
135 | |||
136 | ::======================================================================================================================================== | ||
137 | |||
138 | :: Fix for the special characters limitation in path name | ||
139 | |||
140 | set "_work=%~dp0" | ||
141 | if "%_work:~-1%"=="\" set "_work=%_work:~0,-1%" | ||
142 | |||
143 | set "_batf=%~f0" | ||
144 | set "_batp=%_batf:'=''%" | ||
145 | |||
146 | set _PSarg="""%~f0""" -el %_args% | ||
147 | |||
148 | set "_ttemp=%temp%" | ||
149 | |||
150 | setlocal EnableDelayedExpansion | ||
151 | |||
152 | ::======================================================================================================================================== | ||
153 | |||
154 | echo "!_batf!" | find /i "!_ttemp!" 1>nul && ( | ||
155 | if /i not "!_work!"=="!_ttemp!" ( | ||
156 | %eline% | ||
157 | echo Script is launched from the temp folder, | ||
158 | echo Most likely you are running the script directly from the archive file. | ||
159 | echo: | ||
160 | echo Extract the archive file and launch the script from the extracted folder. | ||
161 | goto ins_done | ||
162 | ) | ||
163 | ) | ||
164 | |||
165 | ::======================================================================================================================================== | ||
166 | |||
167 | :: Elevate script as admin and pass arguments and preventing loop | ||
168 | |||
169 | >nul fltmc || ( | ||
170 | if not defined _elev %nul% %psc% "start cmd.exe -arg '/c \"!_PSarg:'=''!\"' -verb runas" && exit /b | ||
171 | %eline% | ||
172 | echo This script require admin privileges. | ||
173 | echo To do so, right click on this script and select 'Run as administrator'. | ||
174 | goto ins_done | ||
175 | ) | ||
176 | |||
177 | ::======================================================================================================================================== | ||
178 | |||
179 | cls | ||
180 | mode 98, 30 | ||
181 | echo: | ||
182 | echo Initializing... | ||
183 | call :dk_product | ||
184 | call :dk_ckeckwmic | ||
185 | call :dk_actids | ||
186 | |||
187 | ::======================================================================================================================================== | ||
188 | |||
189 | :: Check SKU value / Check in multiple places to find Edition change corruption | ||
190 | |||
191 | set osSKU= | ||
192 | set regSKU= | ||
193 | set wmiSKU= | ||
194 | |||
195 | for /f "tokens=3 delims=." %%a in ('reg query "HKLM\SYSTEM\CurrentControlSet\Control\ProductOptions" /v OSProductPfn 2^>nul') do set "regSKU=%%a" | ||
196 | if %_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" | ||
197 | if %_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 | |||
199 | set osSKU=%wmiSKU% | ||
200 | if not defined osSKU set osSKU=%regSKU% | ||
201 | |||
202 | if not defined osSKU ( | ||
203 | %eline% | ||
204 | echo SKU value was not detected properly. Aborting... | ||
205 | goto ins_done | ||
206 | ) | ||
207 | |||
208 | ::======================================================================================================================================== | ||
209 | |||
210 | :: Detect key | ||
211 | |||
212 | set key= | ||
213 | set channel= | ||
214 | set actidnotfound= | ||
215 | |||
216 | for /f "skip=2 tokens=2*" %%a in ('reg query "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion" /v BuildBranch 2^>nul') do set "branch=%%b" | ||
217 | |||
218 | if defined applist call :hwidkey key attempt1 | ||
219 | if not defined key call :hwidkey key attempt2 | ||
220 | |||
221 | if not defined key ( | ||
222 | %eline% | ||
223 | echo [%winos% ^| %winbuild% ^| SKU:%osSKU%] | ||
224 | echo Unable to find this product in the HWID supported product list. | ||
225 | echo Make sure you are using updated version of the script. | ||
226 | echo https://massgrave.dev | ||
227 | goto ins_done | ||
228 | ) | ||
229 | |||
230 | ::======================================================================================================================================== | ||
231 | |||
232 | if %_unattended%==1 goto insertkey | ||
233 | |||
234 | cls | ||
235 | %line% | ||
236 | echo: | ||
237 | echo Install [%winos% ^| SKU:%osSKU% ^| %winbuild%] %channel% Key | ||
238 | echo [%key%] | ||
239 | %line% | ||
240 | echo: | ||
241 | if not "%regSKU%"=="%wmiSKU%" ( | ||
242 | echo Note: Difference Found In SKU Value- WMI:%wmiSKU% Reg:%regSKU% | ||
243 | echo: | ||
244 | ) | ||
245 | call :dk_color %_Green% "Press [1] to Continue or [0] to %_exitmsg%" | ||
246 | choice /C:01 /N | ||
247 | if %errorlevel%==1 exit /b | ||
248 | |||
249 | ::======================================================================================================================================== | ||
250 | |||
251 | :insertkey | ||
252 | |||
253 | cls | ||
254 | %line% | ||
255 | |||
256 | if %_wmic% EQU 1 wmic path SoftwareLicensingService where __CLASS='SoftwareLicensingService' call InstallProductKey ProductKey="%key%" %nul% | ||
257 | if %_wmic% EQU 0 %psc% "(([WMISEARCHER]'SELECT Version FROM SoftwareLicensingService').Get()).InstallProductKey('%key%')" %nul% | ||
258 | if not %errorlevel%==0 cscript //nologo %windir%\system32\slmgr.vbs /ipk %key% %nul% | ||
259 | |||
260 | set error_code=%errorlevel% | ||
261 | cmd /c exit /b %error_code% | ||
262 | if %error_code% NEQ 0 set "error_code=[0x%=ExitCode%]" | ||
263 | |||
264 | echo: | ||
265 | echo [%winos% ^| SKU:%osSKU% ^| %winbuild%] | ||
266 | echo Installing %channel% [%key%] | ||
267 | echo: | ||
268 | |||
269 | if %error_code% EQU 0 ( | ||
270 | call :dk_refresh | ||
271 | call :dk_color %Green% "[Successful]" | ||
272 | ) else ( | ||
273 | call :dk_color %Red% "[Unsuccessful] %error_code%" | ||
274 | if defined actidnotfound call :dk_color %Red% "Activation ID not found for this key." | ||
275 | echo Check this page for help https://massgrave.dev/troubleshoot | ||
276 | ) | ||
277 | %line% | ||
278 | |||
279 | ::======================================================================================================================================== | ||
280 | |||
281 | :ins_done | ||
282 | |||
283 | echo: | ||
284 | if %_unattended%==1 timeout /t 2 & exit /b | ||
285 | call :dk_color %_Yellow% "Press any key to %_exitmsg%..." | ||
286 | pause >nul | ||
287 | exit /b | ||
288 | |||
289 | ::======================================================================================================================================== | ||
290 | |||
291 | :: Refresh license status | ||
292 | |||
293 | :dk_refresh | ||
294 | |||
295 | if %_wmic% EQU 1 wmic path SoftwareLicensingService where __CLASS='SoftwareLicensingService' call RefreshLicenseStatus %nul% | ||
296 | if %_wmic% EQU 0 %psc% "$null=(([WMICLASS]'SoftwareLicensingService').GetInstances()).RefreshLicenseStatus()" %nul% | ||
297 | exit /b | ||
298 | |||
299 | :: Get Windows Activation IDs | ||
300 | |||
301 | :dk_actids | ||
302 | |||
303 | set applist= | ||
304 | if %_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')" | ||
305 | if %_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")) | ||
307 | exit /b | ||
308 | |||
309 | :: Check wmic.exe | ||
310 | |||
311 | :dk_ckeckwmic | ||
312 | |||
313 | set _wmic=0 | ||
314 | for %%# in (wmic.exe) do @if not "%%~$PATH:#"=="" ( | ||
315 | wmic path Win32_ComputerSystem get CreationClassName /value 2>nul | find /i "computersystem" 1>nul && set _wmic=1 | ||
316 | ) | ||
317 | exit /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 | |||
323 | call :dk_reflection | ||
324 | |||
325 | set d1=%ref% $meth = $TypeBuilder.DefinePInvokeMethod('BrandingFormatString', 'winbrand.dll', 'Public, Static', 1, [String], @([String]), 1, 3); | ||
326 | set d1=%d1% $meth.SetImplementationFlags(128); $TypeBuilder.CreateType()::BrandingFormatString('%%WINDOWS_LONG%%') | ||
327 | |||
328 | set winos= | ||
329 | for /f "delims=" %%s in ('"%psc% %d1%"') do if not errorlevel 1 (set winos=%%s) | ||
330 | echo "%winos%" | find /i "Windows" 1>nul || ( | ||
331 | for /f "skip=2 tokens=2*" %%a in ('reg query "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion" /v ProductName 2^>nul') do set "winos=%%b" | ||
332 | if %winbuild% GEQ 22000 ( | ||
333 | set winos=!winos:Windows 10=Windows 11! | ||
334 | ) | ||
335 | ) | ||
336 | exit /b | ||
337 | |||
338 | :: Common lines used in PowerShell reflection code | ||
339 | |||
340 | :dk_reflection | ||
341 | |||
342 | set ref=$AssemblyBuilder = [AppDomain]::CurrentDomain.DefineDynamicAssembly(4, 1); | ||
343 | set ref=%ref% $ModuleBuilder = $AssemblyBuilder.DefineDynamicModule(2, $False); | ||
344 | set ref=%ref% $TypeBuilder = $ModuleBuilder.DefineType(0); | ||
345 | exit /b | ||
346 | |||
347 | ::======================================================================================================================================== | ||
348 | |||
349 | :dk_color | ||
350 | |||
351 | if %_NCS% EQU 1 ( | ||
352 | echo %esc%[%~1%~2%esc%[0m | ||
353 | ) else ( | ||
354 | %psc% write-host -back '%1' -fore '%2' '%3' | ||
355 | ) | ||
356 | exit /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 | |||
371 | set f= | ||
372 | for %%# in ( | ||
373 | 8b351c9c-f398-4515-9900-09df49427262_XGV%f%PP-NM%f%H47-7TTH%f%J-W3F%f%W7-8HV%f%2C___4_OEM:NONSLP_Enterprise | ||
374 | c83cef07-6b72-4bbc-a28f-a00386872839_3V6%f%Q6-NQ%f%XCX-V8YX%f%R-9QC%f%YV-QPF%f%CT__27_Volume:MAK_EnterpriseN | ||
375 | 4de7cb65-cdf1-4de9-8ae8-e3cce27b9f2c_VK7%f%JG-NP%f%HTM-C97J%f%M-9MP%f%GT-3V6%f%6T__48_____Retail_Professional | ||
376 | 9fbaf5d6-4d83-4422-870d-fdda6e5858aa_2B8%f%7N-8K%f%FHP-DKV6%f%R-Y2C%f%8J-PKC%f%KT__49_____Retail_ProfessionalN | ||
377 | f742e4ff-909d-4fe9-aacb-3231d24a0c58_4CP%f%RK-NM%f%3K3-X6XX%f%Q-RXX%f%86-WXC%f%HW__98_____Retail_CoreN | ||
378 | 1d1bac85-7365-4fea-949a-96978ec91ae0_N24%f%34-X9%f%D7W-8PF6%f%X-8DV%f%9T-8TY%f%MD__99_____Retail_CoreCountrySpecific | ||
379 | 3ae2cc14-ab2d-41f4-972f-5e20142771dc_BT7%f%9Q-G7%f%N6G-PGBY%f%W-4YW%f%X6-6F4%f%BT_100_____Retail_CoreSingleLanguage | ||
380 | 2b1f36bb-c1cd-4306-bf5c-a0367c2d97d8_YTM%f%G3-N6%f%DKC-DKB7%f%7-7M9%f%GH-8HV%f%X7_101_____Retail_Core | ||
381 | 2a6137f3-75c0-4f26-8e3e-d83d802865a4_XKC%f%NC-J2%f%6Q9-KFHD%f%2-FKT%f%HY-KD7%f%2Y_119_OEM:NONSLP_PPIPro | ||
382 | e558417a-5123-4f6f-91e7-385c1c7ca9d4_YNM%f%GQ-8R%f%YV3-4PGQ%f%3-C8X%f%TP-7CF%f%BY_121_____Retail_Education | ||
383 | c5198a66-e435-4432-89cf-ec777c9d0352_84N%f%GF-MH%f%BT6-FXBX%f%8-QWJ%f%K7-DRR%f%8H_122_____Retail_EducationN | ||
384 | cce9d2de-98ee-4ce2-8113-222620c64a27_KCN%f%VH-YK%f%WX8-GJJB%f%9-H9F%f%DT-6F7%f%W2_125_Volume:MAK_EnterpriseS_VB | ||
385 | d06934ee-5448-4fd1-964a-cd077618aa06_43T%f%BQ-NH%f%92J-XKTM%f%7-KT3%f%KK-P39%f%PB_125_OEM:NONSLP_EnterpriseS_RS5 | ||
386 | 706e0cfd-23f4-43bb-a9af-1a492b9f1302_NK9%f%6Y-D9%f%CD8-W44C%f%Q-R8Y%f%TK-DYJ%f%WX_125_OEM:NONSLP_EnterpriseS_RS1 | ||
387 | faa57748-75c8-40a2-b851-71ce92aa8b45_FWN%f%7H-PF%f%93Q-4GGP%f%8-M8R%f%F3-MDW%f%WW_125_OEM:NONSLP_EnterpriseS_TH | ||
388 | 2c060131-0e43-4e01-adc1-cf5ad1100da8_RQF%f%NW-9T%f%PM3-JQ73%f%T-QV4%f%VQ-DV9%f%PT_126_Volume:MAK_EnterpriseSN_VB | ||
389 | e8f74caa-03fb-4839-8bcc-2e442b317e53_M33%f%WV-NH%f%Y3C-R7FP%f%M-BQG%f%PT-239%f%PG_126_Volume:MAK_EnterpriseSN_RS5 | ||
390 | 3d1022d8-969f-4222-b54b-327f5a5af4c9_2DB%f%W3-N2%f%PJG-MVHW%f%3-G7T%f%DK-9HK%f%R4_126_Volume:MAK_EnterpriseSN_RS1 | ||
391 | 60c243e1-f90b-4a1b-ba89-387294948fb6_NTX%f%6B-BR%f%YC2-K678%f%6-F6M%f%VQ-M7V%f%2X_126_Volume:MAK_EnterpriseSN_TH | ||
392 | eb6d346f-1c60-4643-b960-40ec31596c45_DXG%f%7C-N3%f%6C4-C4HT%f%G-X4T%f%3X-2YV%f%77_161_____Retail_ProfessionalWorkstation | ||
393 | 89e87510-ba92-45f6-8329-3afa905e3e83_WYP%f%NQ-8C%f%467-V2W6%f%J-TX4%f%WX-WT2%f%RQ_162_____Retail_ProfessionalWorkstationN | ||
394 | 62f0c100-9c53-4e02-b886-a3528ddfe7f6_8PT%f%T6-RN%f%W4C-6V7J%f%2-C2D%f%3X-MHB%f%PB_164_____Retail_ProfessionalEducation | ||
395 | 13a38698-4a49-4b9e-8e83-98fe51110953_GJT%f%YN-HD%f%MQY-FRR7%f%6-HVG%f%C7-QPF%f%8P_165_____Retail_ProfessionalEducationN | ||
396 | df96023b-dcd9-4be2-afa0-c6c871159ebe_NJC%f%F7-PW%f%8QT-3324%f%D-688%f%JX-2YV%f%66_175_____Retail_ServerRdsh | ||
397 | d4ef7282-3d2c-4cf0-9976-8854e64a8d1e_V3W%f%VW-N2%f%PV2-CGWC%f%3-34Q%f%GF-VMJ%f%2C_178_____Retail_Cloud | ||
398 | af5c9381-9240-417d-8d35-eb40cd03e484_NH9%f%J3-68%f%WK7-6FB9%f%3-4K3%f%DF-DJ4%f%F6_179_____Retail_CloudN | ||
399 | 8ab9bdd1-1f67-4997-82d9-8878520837d9_XQQ%f%YW-NF%f%FMW-XJPB%f%H-K87%f%32-CKF%f%FD_188_____OEM:DM_IoTEnterprise | ||
400 | ed655016-a9e8-4434-95d9-4345352c2552_QPM%f%6N-7J%f%2WJ-P88H%f%H-P3Y%f%RH-YY7%f%4H_191_OEM:NONSLP_IoTEnterpriseS_VB | ||
401 | d4bdc678-0a4b-4a32-a5b3-aaa24c3b0f24_K9V%f%KN-3B%f%GWV-Y624%f%W-MCR%f%MQ-BHD%f%CD_202_____Retail_CloudEditionN | ||
402 | 92fb8726-92a8-4ffc-94ce-f82e07444653_KY7%f%PN-VR%f%6RX-83W6%f%Y-6DD%f%YQ-T6R%f%4W_203_____Retail_CloudEdition | ||
403 | d4f9b41f-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 ( | ||
405 | for /f "tokens=1-6 delims=_" %%A in ("%%#") do ( | ||
406 | |||
407 | if %1==key if %osSKU%==%%C ( | ||
408 | |||
409 | REM Detect key attempt 1 | ||
410 | |||
411 | if "%2"=="attempt1" if not defined key ( | ||
412 | echo "!applist!" | find /i "%%A" 1>nul && ( | ||
413 | set key=%%B | ||
414 | set channel=%%D | ||
415 | ) | ||
416 | ) | ||
417 | |||
418 | REM Detect key attempt 2 | ||
419 | |||
420 | if "%2"=="attempt2" if not defined key ( | ||
421 | set actidnotfound=1 | ||
422 | set 6th=%%F | ||
423 | if not defined 6th ( | ||
424 | set key=%%B | ||
425 | set channel=%%D | ||
426 | ) else ( | ||
427 | echo "%branch%" | find /i "%%F" 1>nul && ( | ||
428 | set key=%%B | ||
429 | set channel=%%D | ||
430 | ) | ||
431 | ) | ||
432 | ) | ||
433 | ) | ||
434 | |||
435 | ) | ||
436 | ) | ||
437 | exit /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 | |||
21 | set "PATH=%SystemRoot%\System32;%SystemRoot%\System32\wbem;%SystemRoot%\System32\WindowsPowerShell\v1.0\" | ||
22 | if exist "%SystemRoot%\Sysnative\reg.exe" ( | ||
23 | set "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" | |||
24 | for %%# in (%*) do ( | 30 | for %%# in (%*) do ( |
25 | if /i "%%#"=="r1" set r1=1 | 31 | if /i "%%#"=="r1" set r1=1 |
26 | if /i "%%#"=="r2" set r2=1 | 32 | if /i "%%#"=="r2" set r2=1 |
33 | if /i "%%#"=="-qedit" ( | ||
34 | reg add HKCU\Console /v QuickEdit /t REG_DWORD /d "1" /f %nul1% | ||
35 | rem check the code below admin elevation to understand why it's here | ||
36 | ) | ||
27 | ) | 37 | ) |
28 | 38 | ||
29 | if exist %SystemRoot%\Sysnative\cmd.exe if not defined r1 ( | 39 | if exist %SystemRoot%\Sysnative\cmd.exe if not defined r1 ( |
@@ -40,22 +50,34 @@ start %SystemRoot%\SysArm32\cmd.exe /c ""!_cmdf!" %* r2" | |||
40 | exit /b | 50 | exit /b |
41 | ) | 51 | ) |
42 | 52 | ||
43 | :: Set Path variable, it helps if it is misconfigured in the system | 53 | ::======================================================================================================================================== |
44 | 54 | ||
45 | set "PATH=%SystemRoot%\System32;%SystemRoot%\System32\wbem;%SystemRoot%\System32\WindowsPowerShell\v1.0\" | 55 | set "blank=" |
46 | if exist "%SystemRoot%\Sysnative\reg.exe" ( | 56 | set "mas=mass%blank%grave.dev" |
47 | set "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 | |||
60 | sc query Null | find /i "RUNNING" | ||
61 | if %errorlevel% NEQ 0 ( | ||
62 | echo: | ||
63 | echo Null service is not running, script may crash... | ||
64 | echo: | ||
65 | echo: | ||
66 | echo Help - https://%mas%/troubleshoot.html | ||
67 | echo: | ||
68 | echo: | ||
69 | ping 127.0.0.1 -n 10 | ||
48 | ) | 70 | ) |
71 | cls | ||
49 | 72 | ||
50 | :: Check LF line ending | 73 | :: Check LF line ending |
51 | 74 | ||
52 | pushd "%~dp0" | 75 | pushd "%~dp0" |
53 | >nul findstr /rxc:".*" "%~nx0" | 76 | >nul findstr /v "$" "%~nx0" && ( |
54 | if not %errorlevel%==0 ( | ||
55 | echo: | 77 | echo: |
56 | echo Error: Script either has LF line ending issue, or it failed to read itself. | 78 | echo Error: Script either has LF line ending issue or an empty line at the end of the script is missing. |
57 | echo: | 79 | echo: |
58 | ping 127.0.0.1 -n 6 > nul | 80 | ping 127.0.0.1 -n 6 >nul |
59 | popd | 81 | popd |
60 | exit /b | 82 | exit /b |
61 | ) | 83 | ) |
@@ -67,21 +89,32 @@ cls | |||
67 | color 07 | 89 | color 07 |
68 | title Troubleshoot | 90 | title Troubleshoot |
69 | 91 | ||
92 | set _args= | ||
70 | set _elev= | 93 | set _elev= |
71 | if /i "%~1"=="-el" set _elev=1 | ||
72 | 94 | ||
73 | set winbuild=1 | 95 | set _args=%* |
96 | if defined _args set _args=%_args:"=% | ||
97 | if defined _args ( | ||
98 | for %%A in (%_args%) do ( | ||
99 | if /i "%%A"=="-el" set _elev=1 | ||
100 | ) | ||
101 | ) | ||
102 | |||
103 | set "nul1=1>nul" | ||
104 | set "nul2=2>nul" | ||
105 | set "nul6=2^>nul" | ||
74 | set "nul=>nul 2>&1" | 106 | set "nul=>nul 2>&1" |
107 | |||
75 | set psc=powershell.exe | 108 | set psc=powershell.exe |
109 | set winbuild=1 | ||
76 | for /f "tokens=6 delims=[]. " %%G in ('ver') do set winbuild=%%G | 110 | for /f "tokens=6 delims=[]. " %%G in ('ver') do set winbuild=%%G |
77 | 111 | ||
78 | set _NCS=1 | 112 | set _NCS=1 |
79 | if %winbuild% LSS 10586 set _NCS=0 | 113 | if %winbuild% LSS 10586 set _NCS=0 |
80 | if %winbuild% GEQ 10586 reg query "HKCU\Console" /v ForceV2 2>nul | find /i "0x0" 1>nul && (set _NCS=0) | 114 | if %winbuild% GEQ 10586 reg query "HKCU\Console" /v ForceV2 %nul2% | find /i "0x0" %nul1% && (set _NCS=0) |
81 | 115 | ||
82 | call :_colorprep | 116 | call :_colorprep |
83 | 117 | ||
84 | set cbs_log=%SystemRoot%\logs\cbs\cbs.log | ||
85 | set "nceline=echo: &echo ==== ERROR ==== &echo:" | 118 | set "nceline=echo: &echo ==== ERROR ==== &echo:" |
86 | set "eline=echo: &call :_color %Red% "==== ERROR ====" &echo:" | 119 | set "eline=echo: &call :_color %Red% "==== ERROR ====" &echo:" |
87 | set "line=_________________________________________________________________________________________________" | 120 | set "line=_________________________________________________________________________________________________" |
@@ -91,7 +124,7 @@ if %~z0 GEQ 200000 (set "_exitmsg=Go back") else (set "_exitmsg=Exit") | |||
91 | 124 | ||
92 | if %winbuild% LSS 7600 ( | 125 | if %winbuild% LSS 7600 ( |
93 | %nceline% | 126 | %nceline% |
94 | echo Unsupported OS version detected. | 127 | echo Unsupported OS version detected [%winbuild%]. |
95 | echo Project is supported only for Windows 7/8/8.1/10/11 and their Server equivalent. | 128 | echo Project is supported only for Windows 7/8/8.1/10/11 and their Server equivalent. |
96 | goto at_done | 129 | goto at_done |
97 | ) | 130 | ) |
@@ -120,7 +153,7 @@ setlocal EnableDelayedExpansion | |||
120 | 153 | ||
121 | ::======================================================================================================================================== | 154 | ::======================================================================================================================================== |
122 | 155 | ||
123 | echo "!_batf!" | find /i "!_ttemp!" 1>nul && ( | 156 | echo "!_batf!" | find /i "!_ttemp!" %nul1% && ( |
124 | if /i not "!_work!"=="!_ttemp!" ( | 157 | if /i not "!_work!"=="!_ttemp!" ( |
125 | %nceline% | 158 | %nceline% |
126 | echo Script is launched from the temp folder, | 159 | echo 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 || ( |
139 | if not defined _elev %nul% %psc% "start cmd.exe -arg '/c \"!_PSarg:'=''!\"' -verb runas" && exit /b | 172 | if not defined _elev %psc% "start cmd.exe -arg '/c \"!_PSarg:'=''!\"' -verb runas" && exit /b |
140 | %nceline% | 173 | %nceline% |
141 | echo This script require admin privileges. | 174 | echo This script require admin privileges. |
142 | echo To do so, right click on this script and select 'Run as administrator'. | 175 | echo 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 | |||
184 | for %%# in (%_args%) do (if /i "%%#"=="-qedit" set quedit=1) | ||
185 | |||
186 | reg query HKCU\Console /v QuickEdit %nul2% | find /i "0x0" %nul1% || if not defined quedit ( | ||
187 | reg add HKCU\Console /v QuickEdit /t REG_DWORD /d "0" /f %nul1% | ||
188 | start cmd.exe /c ""!_batf!" %_args% -qedit" | ||
189 | rem quickedit reset code is added at the starting of the script instead of here because it takes time to reflect in some cases | ||
190 | exit /b | ||
191 | ) | ||
192 | |||
193 | ::======================================================================================================================================== | ||
194 | |||
148 | setlocal DisableDelayedExpansion | 195 | setlocal DisableDelayedExpansion |
149 | 196 | ||
150 | :: Check desktop location | 197 | :: Check desktop location |
@@ -195,12 +242,12 @@ choice /C:1234560 /N | |||
195 | set _erl=%errorlevel% | 242 | set _erl=%errorlevel% |
196 | 243 | ||
197 | if %_erl%==7 exit /b | 244 | if %_erl%==7 exit /b |
198 | if %_erl%==6 start https://massgrave.dev/fix-wpa-registry.html &goto at_menu | 245 | if %_erl%==6 start https://%mas%/fix-wpa-registry.html &goto at_menu |
199 | if %_erl%==5 goto:retokens | 246 | if %_erl%==5 goto:retokens |
200 | if %_erl%==4 goto:fixwmi | 247 | if %_erl%==4 goto:fixwmi |
201 | if %_erl%==3 goto:sfcscan | 248 | if %_erl%==3 goto:sfcscan |
202 | if %_erl%==2 goto:dism_rest | 249 | if %_erl%==2 goto:dism_rest |
203 | if %_erl%==1 start https://massgrave.dev/troubleshoot.html &goto at_menu | 250 | if %_erl%==1 start https://%mas%/troubleshoot.html &goto at_menu |
204 | goto :at_menu | 251 | goto :at_menu |
205 | 252 | ||
206 | ::======================================================================================================================================== | 253 | ::======================================================================================================================================== |
@@ -248,23 +295,29 @@ if %errorlevel%==1 goto at_menu | |||
248 | 295 | ||
249 | cls | 296 | cls |
250 | mode 110, 30 | 297 | mode 110, 30 |
251 | echo: | ||
252 | |||
253 | call :_stopservice TrustedInstaller | 298 | call :_stopservice TrustedInstaller |
254 | del /s /f /q "%SystemRoot%\logs\cbs\*.*" | ||
255 | 299 | ||
256 | set _time= | 300 | set _time= |
257 | for /f %%a in ('%psc% "Get-Date -format HH_mm_ss"') do set _time=%%a | 301 | for /f %%a in ('%psc% "Get-Date -format HH_mm_ss"') do set _time=%%a |
258 | echo: | 302 | echo: |
259 | echo Applying the command, | 303 | echo Applying the command, |
260 | echo dism /english /online /cleanup-image /restorehealth | 304 | echo dism /english /online /cleanup-image /restorehealth |
261 | echo: | 305 | dism /english /online /cleanup-image /restorehealth |
262 | dism /english /online /cleanup-image /restorehealth /Logpath:"%SystemRoot%\Temp\RHealth_DISM_%_time%.txt" /loglevel:4 | 306 | |
307 | call :_stopservice TrustedInstaller | ||
263 | 308 | ||
264 | if not exist "!desktop!\AT_Logs\" md "!desktop!\AT_Logs\" %nul% | 309 | if not exist "!desktop!\AT_Logs\" md "!desktop!\AT_Logs\" %nul% |
265 | copy /y /b "%SystemRoot%\Temp\RHealth_DISM_%_time%.txt" "!desktop!\AT_Logs\RHealth_DISM_%_time%.txt" %nul% | 310 | |
266 | copy /y /b "%cbs_log%" "!desktop!\AT_Logs\RHealth_CBS_%_time%.txt" %nul% | 311 | call :compresslog cbs\CBS.log RHealth_CBS %nul% |
267 | del /f /q "%SystemRoot%\Temp\RHealth_DISM_%_time%.txt" %nul% | 312 | call :compresslog DISM\dism.log RHealth_DISM %nul% |
313 | |||
314 | if not exist "!desktop!\AT_Logs\RHealth_CBS_%_time%.cab" ( | ||
315 | copy /y /b "%SystemRoot%\logs\cbs\cbs.log" "!desktop!\AT_Logs\RHealth_CBS_%_time%.log" %nul% | ||
316 | ) | ||
317 | |||
318 | if not exist "!desktop!\AT_Logs\RHealth_DISM_%_time%.cab" ( | ||
319 | copy /y /b "%SystemRoot%\logs\DISM\dism.log" "!desktop!\AT_Logs\RHealth_DISM_%_time%.log" %nul% | ||
320 | ) | ||
268 | 321 | ||
269 | echo: | 322 | echo: |
270 | call :_color %Gray% "CBS and DISM logs are copied to the AT_Logs folder on the dekstop." | 323 | call :_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 : " | |||
294 | if %errorlevel%==1 goto at_menu | 347 | if %errorlevel%==1 goto at_menu |
295 | 348 | ||
296 | cls | 349 | cls |
297 | echo: | ||
298 | |||
299 | call :_stopservice TrustedInstaller | 350 | call :_stopservice TrustedInstaller |
300 | del /s /f /q "%SystemRoot%\logs\cbs\*.*" | ||
301 | 351 | ||
302 | set _time= | 352 | set _time= |
303 | for /f %%a in ('%psc% "Get-Date -format HH_mm_ss"') do set _time=%%a | 353 | for /f %%a in ('%psc% "Get-Date -format HH_mm_ss"') do set _time=%%a |
304 | echo: | 354 | echo: |
305 | echo Applying the command, | 355 | echo Applying the command, |
306 | echo sfc /scannow | 356 | echo sfc /scannow |
307 | echo: | ||
308 | sfc /scannow | 357 | sfc /scannow |
309 | 358 | ||
359 | call :_stopservice TrustedInstaller | ||
360 | |||
310 | if not exist "!desktop!\AT_Logs\" md "!desktop!\AT_Logs\" %nul% | 361 | if not exist "!desktop!\AT_Logs\" md "!desktop!\AT_Logs\" %nul% |
311 | 362 | ||
312 | copy /y /b "%cbs_log%" "!desktop!\AT_Logs\SFC_CBS_%_time%.txt" %nul% | 363 | call :compresslog cbs\CBS.log SFC_CBS %nul% |
364 | |||
365 | if not exist "!desktop!\AT_Logs\SFC_CBS_%_time%.cab" ( | ||
366 | copy /y /b "%SystemRoot%\logs\cbs\cbs.log" "!desktop!\AT_Logs\SFC_CBS_%_time%.log" %nul% | ||
367 | ) | ||
313 | 368 | ||
314 | echo: | 369 | echo: |
315 | call :_color %Gray% "CBS log is copied to the AT_Logs folder on the dekstop." | 370 | call :_color %Gray% "CBS log is copied to the AT_Logs folder on the dekstop." |
@@ -321,7 +376,7 @@ goto :at_back | |||
321 | 376 | ||
322 | cls | 377 | cls |
323 | mode con cols=115 lines=32 | 378 | mode 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;}" |
325 | title Fix Licensing ^(ClipSVC ^+ Office vNext ^+ SPP ^+ OSPP^) | 380 | title Fix Licensing ^(ClipSVC ^+ Office vNext ^+ SPP ^+ OSPP^) |
326 | 381 | ||
327 | echo: | 382 | echo: |
@@ -354,7 +409,7 @@ cls | |||
354 | echo: | 409 | echo: |
355 | echo %line% | 410 | echo %line% |
356 | echo: | 411 | echo: |
357 | call :_color %Magenta% "Rebuilding ClipSVC Licences" | 412 | call :_color %Blue% "Rebuilding ClipSVC Licences" |
358 | echo: | 413 | echo: |
359 | 414 | ||
360 | if %winbuild% LSS 10240 ( | 415 | if %winbuild% LSS 10240 ( |
@@ -363,7 +418,7 @@ echo Skipping... | |||
363 | goto :cleanvnext | 418 | goto :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% && ( |
367 | echo Windows is permanently activated. | 422 | echo Windows is permanently activated. |
368 | echo Skipping rebuilding ClipSVC licences... | 423 | echo Skipping rebuilding ClipSVC licences... |
369 | goto :cleanvnext | 424 | goto :cleanvnext |
@@ -460,7 +515,7 @@ for %%# in (wlidsvc LicenseManager) do (net stop %%# /y %nul% & net start %%# /y | |||
460 | echo: | 515 | echo: |
461 | echo %line% | 516 | echo %line% |
462 | echo: | 517 | echo: |
463 | call :_color %Magenta% "Clearing Office vNext License" | 518 | call :_color %Blue% "Clearing Office vNext License" |
464 | echo: | 519 | echo: |
465 | 520 | ||
466 | setlocal DisableDelayedExpansion | 521 | setlocal DisableDelayedExpansion |
@@ -515,7 +570,7 @@ echo Not Found Registry - %%# | |||
515 | echo: | 570 | echo: |
516 | echo %line% | 571 | echo %line% |
517 | echo: | 572 | echo: |
518 | call :_color %Magenta% "Rebuilding SPP Licensing Tokens" | 573 | call :_color %Blue% "Rebuilding SPP Licensing Tokens" |
519 | echo: | 574 | echo: |
520 | 575 | ||
521 | call :scandat check | 576 | call :scandat check |
@@ -529,7 +584,7 @@ echo tokens.dat file: [%token%] | |||
529 | if %winbuild% GEQ 14393 ( | 584 | if %winbuild% GEQ 14393 ( |
530 | set wpaerror= | 585 | set wpaerror= |
531 | set /a count=0 | 586 | set /a count=0 |
532 | for /f %%a in ('reg query "HKLM\SYSTEM\WPA" 2^>nul') do set /a count+=1 | 587 | for /f %%a in ('reg query "HKLM\SYSTEM\WPA" %nul6%') do set /a count+=1 |
533 | for /L %%# in (1,1,!count!) do ( | 588 | for /L %%# in (1,1,!count!) do ( |
534 | reg query "HKLM\SYSTEM\WPA\8DEC0AF1-0341-4b93-85CD-72606C2DF94C-7P-%%#" /ve /t REG_BINARY %nul% || set wpaerror=1 | 589 | reg 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 | ||
544 | set tokenstore= | 599 | set tokenstore= |
545 | for /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" | 600 | for /f "skip=2 tokens=2*" %%a in ('reg query "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\SoftwareProtectionPlatform" /v TokenStore %nul6%') do call set "tokenstore=%%b" |
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]" | |||
580 | echo [Successfully Fixed] | 635 | echo [Successfully Fixed] |
581 | ) | 636 | ) |
582 | ) else ( | 637 | ) else ( |
583 | echo [Error Not Found] | 638 | echo [No Error Found] |
584 | ) | 639 | ) |
585 | ) | 640 | ) |
586 | 641 | ||
@@ -624,7 +679,7 @@ echo tokens.dat file was rebuilt successfully. | |||
624 | echo: | 679 | echo: |
625 | echo %line% | 680 | echo %line% |
626 | echo: | 681 | echo: |
627 | call :_color %Magenta% "Rebuilding OSPP Licensing Tokens" | 682 | call :_color %Blue% "Rebuilding OSPP Licensing Tokens" |
628 | echo: | 683 | echo: |
629 | 684 | ||
630 | sc qc osppsvc %nul% || ( | 685 | sc qc osppsvc %nul% || ( |
@@ -681,7 +736,7 @@ echo tokens.dat file was rebuilt successfully. | |||
681 | echo: | 736 | echo: |
682 | echo %line% | 737 | echo %line% |
683 | echo: | 738 | echo: |
684 | call :_color %Magenta% "Repairing Office Licenses" | 739 | call :_color %Blue% "Repairing Office Licenses" |
685 | echo: | 740 | echo: |
686 | 741 | ||
687 | for /f "skip=2 tokens=2*" %%a in ('reg query "HKLM\SYSTEM\CurrentControlSet\Control\Session Manager\Environment" /v PROCESSOR_ARCHITECTURE') do set arch=%%b | 742 | for /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 | ||
724 | set uwp16= | 779 | set uwp16= |
725 | if %winbuild% GEQ 10240 ( | 780 | if %winbuild% GEQ 10240 ( |
726 | dir /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 |
727 | dir /b "%ProgramW6432%\WindowsApps\Microsoft.Office.Desktop*" %nul% && set uwp16=Office 16.0 UWP | ||
728 | dir /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 | ||
732 | set /a counter=0 | 784 | set /a counter=0 |
@@ -774,7 +826,7 @@ echo: | |||
774 | call :_color %_Yellow% "A Window will popup, in that Window you need to select [Quick] Repair Option..." | 826 | call :_color %_Yellow% "A Window will popup, in that Window you need to select [Quick] Repair Option..." |
775 | call :_color %_Yellow% "Press any key to continue..." | 827 | call :_color %_Yellow% "Press any key to continue..." |
776 | echo: | 828 | echo: |
777 | pause >nul | 829 | pause %nul1% |
778 | ) | 830 | ) |
779 | 831 | ||
780 | if defined uwp16 ( | 832 | if defined uwp16 ( |
@@ -843,12 +895,15 @@ goto :at_back | |||
843 | 895 | ||
844 | echo: | 896 | echo: |
845 | echo Checking WMI | 897 | echo Checking WMI |
898 | call :checkwmi | ||
846 | 899 | ||
847 | set error= | 900 | :: Apply basic fix first and check |
848 | wmic path Win32_ComputerSystem get CreationClassName /value 2>nul | find /i "computersystem" 1>nul | 901 | |
849 | if %errorlevel% NEQ 0 set error=1 | 902 | if defined error ( |
850 | winmgmt /verifyrepository %nul% | 903 | call :_stopservice Winmgmt |
851 | if %errorlevel% NEQ 0 set error=1 | 904 | winmgmt /salvagerepository %nul% |
905 | call :checkwmi | ||
906 | ) | ||
852 | 907 | ||
853 | if not defined error ( | 908 | if not defined error ( |
854 | echo [Working] | 909 | echo [Working] |
@@ -858,10 +913,16 @@ goto :at_back | |||
858 | 913 | ||
859 | call :_color %Red% "[Not Responding]" | 914 | call :_color %Red% "[Not Responding]" |
860 | 915 | ||
916 | set _corrupt= | ||
917 | sc start Winmgmt %nul% | ||
918 | if %errorlevel% EQU 1060 set _corrupt=1 | ||
919 | sc query Winmgmt %nul% || set _corrupt=1 | ||
920 | for %%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 | |||
861 | echo: | 922 | echo: |
862 | sc query Winmgmt %nul% || ( | 923 | if defined _corrupt ( |
863 | %eline% | 924 | %eline% |
864 | echo Winmgmt service is not installed. Aborting... | 925 | echo Winmgmt service is corrupted. Aborting... |
865 | goto :at_back | 926 | goto :at_back |
866 | ) | 927 | ) |
867 | 928 | ||
@@ -880,12 +941,12 @@ echo Stopping Winmgmt service | |||
880 | call :_stopservice Winmgmt | 941 | call :_stopservice Winmgmt |
881 | call :_stopservice Winmgmt | 942 | call :_stopservice Winmgmt |
882 | call :_stopservice Winmgmt | 943 | call :_stopservice Winmgmt |
883 | sc query Winmgmt | find /i "1 STOPPED" %nul% && ( | 944 | sc query Winmgmt | find /i "STOPPED" %nul% && ( |
884 | echo [Successful] | 945 | echo [Successful] |
885 | ) || ( | 946 | ) || ( |
886 | call :_color %Red% "[Failed]" | 947 | call :_color %Red% "[Failed]" |
887 | echo: | 948 | echo: |
888 | call :_color %Magenta% "Its recommended to select [Restart] option and then apply Fix WMI option again." | 949 | call :_color %Blue% "Its recommended to select [Restart] option and then apply Fix WMI option again." |
889 | echo %line% | 950 | echo %line% |
890 | echo: | 951 | echo: |
891 | choice /C:21 /N /M "> [1] Restart [2] Revert Back Changes :" | 952 | choice /C:21 /N /M "> [1] Restart [2] Revert Back Changes :" |
@@ -914,8 +975,8 @@ echo [Successful] | |||
914 | call :_color %Red% "[Failed]" | 975 | call :_color %Red% "[Failed]" |
915 | ) | 976 | ) |
916 | 977 | ||
917 | wmic path Win32_ComputerSystem get CreationClassName /value 2>nul | find /i "computersystem" 1>nul | 978 | call :checkwmi |
918 | if %errorlevel% EQU 0 ( | 979 | if not defined error ( |
919 | echo: | 980 | echo: |
920 | echo Checking WMI | 981 | echo Checking WMI |
921 | call :_color %Green% "[Working]" | 982 | call :_color %Green% "[Working]" |
@@ -928,8 +989,8 @@ call :registerobj %nul% | |||
928 | 989 | ||
929 | echo: | 990 | echo: |
930 | echo Checking WMI | 991 | echo Checking WMI |
931 | wmic path Win32_ComputerSystem get CreationClassName /value 2>nul | find /i "computersystem" 1>nul | 992 | call :checkwmi |
932 | if %errorlevel% NEQ 0 ( | 993 | if defined error ( |
933 | call :_color %Red% "[Not Responding]" | 994 | call :_color %Red% "[Not Responding]" |
934 | echo: | 995 | echo: |
935 | echo Run [Dism RestoreHealth] and [SFC Scannow] options and make sure there are no errors. | 996 | echo Run [Dism RestoreHealth] and [SFC Scannow] options and make sure there are no errors. |
@@ -959,6 +1020,22 @@ winmgmt /salvagerepository | |||
959 | winmgmt /resetrepository | 1020 | winmgmt /resetrepository |
960 | exit /b | 1021 | exit /b |
961 | 1022 | ||
1023 | :checkwmi | ||
1024 | |||
1025 | :: https://learn.microsoft.com/en-us/windows/win32/wmisdk/wmi-error-constants | ||
1026 | |||
1027 | set error= | ||
1028 | wmic path Win32_ComputerSystem get CreationClassName /value %nul2% | find /i "computersystem" %nul1% | ||
1029 | if %errorlevel% NEQ 0 (set error=1& exit /b) | ||
1030 | winmgmt /verifyrepository %nul% | ||
1031 | if %errorlevel% NEQ 0 (set error=1& exit /b) | ||
1032 | |||
1033 | cscript //nologo %windir%\system32\slmgr.vbs /dlv %nul% | ||
1034 | cmd /c exit /b %errorlevel% | ||
1035 | echo "0x%=ExitCode%" | findstr /i "0x800410 0x800440" %nul1% | ||
1036 | if %errorlevel% EQU 0 set error=1 | ||
1037 | exit /b | ||
1038 | |||
962 | ::======================================================================================================================================== | 1039 | ::======================================================================================================================================== |
963 | 1040 | ||
964 | :at_back | 1041 | :at_back |
@@ -967,7 +1044,7 @@ echo: | |||
967 | echo %line% | 1044 | echo %line% |
968 | echo: | 1045 | echo: |
969 | call :_color %_Yellow% "Press any key to go back..." | 1046 | call :_color %_Yellow% "Press any key to go back..." |
970 | pause >nul | 1047 | pause %nul1% |
971 | goto :at_menu | 1048 | goto :at_menu |
972 | 1049 | ||
973 | ::======================================================================================================================================== | 1050 | ::======================================================================================================================================== |
@@ -976,7 +1053,39 @@ goto :at_menu | |||
976 | 1053 | ||
977 | echo: | 1054 | echo: |
978 | echo Press any key to %_exitmsg%... | 1055 | echo Press any key to %_exitmsg%... |
979 | pause >nul | 1056 | pause %nul1% |
1057 | exit /b | ||
1058 | |||
1059 | ::======================================================================================================================================== | ||
1060 | |||
1061 | :compresslog | ||
1062 | |||
1063 | :: https://stackoverflow.com/a/46268232 | ||
1064 | |||
1065 | set "ddf="%SystemRoot%\Temp\ddf"" | ||
1066 | %nul% del /q /f %ddf% | ||
1067 | echo/.New Cabinet>%ddf% | ||
1068 | echo/.set Cabinet=ON>>%ddf% | ||
1069 | echo/.set CabinetFileCountThreshold=0;>>%ddf% | ||
1070 | echo/.set Compress=ON>>%ddf% | ||
1071 | echo/.set CompressionType=LZX>>%ddf% | ||
1072 | echo/.set CompressionLevel=7;>>%ddf% | ||
1073 | echo/.set CompressionMemory=21;>>%ddf% | ||
1074 | echo/.set FolderFileCountThreshold=0;>>%ddf% | ||
1075 | echo/.set FolderSizeThreshold=0;>>%ddf% | ||
1076 | echo/.set GenerateInf=OFF>>%ddf% | ||
1077 | echo/.set InfFileName=nul>>%ddf% | ||
1078 | echo/.set MaxCabinetSize=0;>>%ddf% | ||
1079 | echo/.set MaxDiskFileCount=0;>>%ddf% | ||
1080 | echo/.set MaxDiskSize=0;>>%ddf% | ||
1081 | echo/.set MaxErrors=1;>>%ddf% | ||
1082 | echo/.set RptFileName=nul>>%ddf% | ||
1083 | echo/.set UniqueFiles=ON>>%ddf% | ||
1084 | for /f "tokens=* delims=" %%D in ('dir /a:-D/b/s "%SystemRoot%\logs\%1"') do ( | ||
1085 | echo/"%%~fD" /inf=no;>>%ddf% | ||
1086 | ) | ||
1087 | makecab /F %ddf% /D DiskDirectory1="" /D CabinetNameTemplate="!desktop!\AT_Logs\%2_%_time%.cab" | ||
1088 | del /q /f %ddf% | ||
980 | exit /b | 1089 | exit /b |
981 | 1090 | ||
982 | ::======================================================================================================================================== | 1091 | ::======================================================================================================================================== |
@@ -1201,4 +1310,5 @@ set "_Yellow="0E"" | |||
1201 | 1310 | ||
1202 | exit /b | 1311 | exit /b |
1203 | 1312 | ||
1204 | ::======================================================================================================================================== \ No newline at end of file | 1313 | ::======================================================================================================================================== |
1314 | :: Leave empty line below | ||
@@ -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 @@ | |||
27 | To run the scripts in unattended mode, check [here](https://massgrave.dev/command_line_switches.html) | 27 | To run the scripts in unattended mode, check [here](https://massgrave.dev/command_line_switches.html) |
28 | 28 | ||
29 | ``` | 29 | ``` |
30 | Latest Version: 1.8 | 30 | Latest Version: 1.9 |
31 | Release date: 16-Mar-2023 | 31 | Release 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 | ||
53 | Made with Love ❤️ | 56 | <p align="center">Made with Love ❤️</p> |
54 | |||
55 | |||