mirror of
https://github.com/massgravel/Microsoft-Activation-Scripts.git
synced 2026-04-27 01:28:37 +00:00
Compare commits
168 Commits
962f7e326a
...
3.0
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
60c99742ce | ||
|
|
8f3f392517 | ||
|
|
af69d79c5c | ||
|
|
63045afc70 | ||
|
|
19c6612a47 | ||
|
|
9e6f386819 | ||
|
|
b5ba36c033 | ||
|
|
d10b6d691e | ||
|
|
de812acdc5 | ||
|
|
75c34cbf50 | ||
|
|
0d533338a1 | ||
|
|
411f387705 | ||
|
|
be44b2d887 | ||
|
|
0c88f6bc2c | ||
|
|
d31e4ab0cb | ||
|
|
9fd5a661ab | ||
|
|
b732e2c8d7 | ||
|
|
8e2677b1f9 | ||
|
|
f2e40bf88e | ||
|
|
a4f9b219ab | ||
|
|
7262a44ba2 | ||
|
|
37ec96504a | ||
|
|
051b4f673f | ||
|
|
3ef6d7292e | ||
|
|
0d9ffd2052 | ||
|
|
9f00df5aee | ||
|
|
d6aa8b97d1 | ||
|
|
c00b076a86 | ||
|
|
8fff2ccb9c | ||
|
|
5638898eaf | ||
|
|
22ed7a7a07 | ||
|
|
f1ddb83df0 | ||
|
|
4dd0215ccc | ||
|
|
ec259dfbd7 | ||
|
|
bbdc9bdfd8 | ||
|
|
7d036f57fd | ||
|
|
ab90514b0a | ||
|
|
25abc1f457 | ||
|
|
873c4bc4d8 | ||
|
|
0b402d9afe | ||
|
|
5141866f0a | ||
|
|
f0618824a4 | ||
|
|
03cc88193d | ||
|
|
897a9db808 | ||
|
|
9bbd02cc91 | ||
|
|
d1dca45710 | ||
|
|
5e71252993 | ||
|
|
1db017f1f1 | ||
|
|
d06ba7fc4c | ||
|
|
99954a9056 | ||
|
|
fcb710a48a | ||
|
|
0cbaa141c3 | ||
|
|
9d1964ceda | ||
|
|
0477cf13e1 | ||
|
|
9b568d4b4e | ||
|
|
1c9fe0815e | ||
|
|
a5dd99ac00 | ||
|
|
1849dd3075 | ||
|
|
8fe0b24945 | ||
|
|
7c69c471c5 | ||
|
|
f32cb934dc | ||
|
|
7a6e63a462 | ||
|
|
d76b2ea57e | ||
|
|
1f0e04519a | ||
|
|
d059952ecd | ||
|
|
6efb5d50fe | ||
|
|
b2831795a4 | ||
|
|
4e8ebecd3d | ||
|
|
d929cd8fa0 | ||
|
|
d384c5f2f7 | ||
|
|
643d4f077f | ||
|
|
db26b75b64 | ||
|
|
07ad5a208d | ||
|
|
b80a502086 | ||
|
|
104d0b0dda | ||
|
|
db218720f3 | ||
|
|
b8504cc21e | ||
|
|
2e6bfa94c2 | ||
|
|
a1244dcb3b | ||
|
|
06695612a8 | ||
|
|
323c6808af | ||
|
|
841d856a29 | ||
|
|
52d4c52dba | ||
|
|
c75cd29b9f | ||
|
|
b1b5299c47 | ||
|
|
652092e985 | ||
|
|
b06c83622a | ||
|
|
ce669809bf | ||
|
|
0afb09cbd1 | ||
|
|
5d8a463475 | ||
|
|
7044f37b44 | ||
|
|
08443039aa | ||
|
|
fd8b81411c | ||
|
|
213bc50b49 | ||
|
|
00e81be52f | ||
|
|
2443e1e471 | ||
|
|
ec31fef9b9 | ||
|
|
84f5516632 | ||
|
|
f9f386a896 | ||
|
|
8e3b4135f5 | ||
|
|
bacb32f4a1 | ||
|
|
86c86c179a | ||
|
|
445a74ccea | ||
|
|
69e6c9bf71 | ||
|
|
0ced0f5d8e | ||
|
|
19be25c029 | ||
|
|
d372b62280 | ||
|
|
9e5062e7cc | ||
|
|
ed3dace78f | ||
|
|
1f50e4ba98 | ||
|
|
af7d204c96 | ||
|
|
0d26ba046e | ||
|
|
3fd1666926 | ||
|
|
bf814304c6 | ||
|
|
1dfd3f6626 | ||
|
|
79bc7b0242 | ||
|
|
ae48118ddb | ||
|
|
b983bd41da | ||
|
|
d55b9fa78c | ||
|
|
fb113c7c24 | ||
|
|
9efc3e49b9 | ||
|
|
a62c3ac36d | ||
|
|
73eabbff59 | ||
|
|
bc5efae19d | ||
|
|
deb74ab9b8 | ||
|
|
d08ed1bd38 | ||
|
|
5f5a51322d | ||
|
|
fd0e25f477 | ||
|
|
b33dcb2f72 | ||
|
|
117ba004f0 | ||
|
|
b0d898973f | ||
|
|
63b3c5097b | ||
|
|
69430c6458 | ||
|
|
9f57f585d5 | ||
|
|
52decdde18 | ||
|
|
35e044ddc8 | ||
|
|
601bd0e420 | ||
|
|
5e4988a634 | ||
|
|
3a050f2da7 | ||
|
|
31b55fd0e3 | ||
|
|
62d5d5442e | ||
|
|
f2e6e6e389 | ||
|
|
b5a305a14e | ||
|
|
6c71e82ef3 | ||
|
|
66e8cda508 | ||
|
|
98027af16d | ||
|
|
be45752a21 | ||
|
|
a421b12ae4 | ||
|
|
d06185d7f7 | ||
|
|
a46bb78e5e | ||
|
|
2470963537 | ||
|
|
89bff68b28 | ||
|
|
191121c3d4 | ||
|
|
7bf55fc6ee | ||
|
|
816925bfef | ||
|
|
ad45cf0926 | ||
|
|
29eb5bd60d | ||
|
|
70b754657f | ||
|
|
8b58696455 | ||
|
|
5d47723d07 | ||
|
|
2b786e3037 | ||
|
|
4451a25e7f | ||
|
|
886745f103 | ||
|
|
5728ba2686 | ||
|
|
ddccc4025f | ||
|
|
1567903b09 | ||
|
|
f6125eaa5b | ||
|
|
07c4fcdc74 |
7
.gitattributes
vendored
7
.gitattributes
vendored
@@ -1,3 +1,4 @@
|
||||
# MAS export-ignore
|
||||
# LICENSE export-ignore
|
||||
# README.md export-ignore
|
||||
MAS export-ignore
|
||||
LICENSE export-ignore
|
||||
README.md export-ignore
|
||||
.gitattributes export-ignore
|
||||
|
||||
1
LICENSE
1
LICENSE
@@ -672,4 +672,3 @@ may consider it more useful to permit linking proprietary applications with
|
||||
the library. If this is what you want to do, use the GNU Lesser General
|
||||
Public License instead of this License. But first, please read
|
||||
<https://www.gnu.org/licenses/why-not-lgpl.html>.
|
||||
|
||||
|
||||
16580
MAS/All-In-One-Version-KL/MAS_AIO.cmd
Normal file
16580
MAS/All-In-One-Version-KL/MAS_AIO.cmd
Normal file
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -1,4 +1,4 @@
|
||||
@set masver=2.6
|
||||
@set masver=3.0
|
||||
@echo off
|
||||
|
||||
|
||||
@@ -27,7 +27,7 @@ set "_debug=0"
|
||||
|
||||
::========================================================================================================================================
|
||||
|
||||
:: Set Environment variables, it helps if they are misconfigured in the system
|
||||
:: Set environment variables, it helps if they are misconfigured in the system
|
||||
|
||||
setlocal EnableExtensions
|
||||
setlocal DisableDelayedExpansion
|
||||
@@ -44,26 +44,28 @@ set "Path=%SystemRoot%\Sysnative;%SystemRoot%;%SystemRoot%\Sysnative\Wbem;%Syste
|
||||
set "ComSpec=%SysPath%\cmd.exe"
|
||||
set "PSModulePath=%ProgramFiles%\WindowsPowerShell\Modules;%SysPath%\WindowsPowerShell\v1.0\Modules"
|
||||
|
||||
set re1=
|
||||
set re2=
|
||||
set "_cmdf=%~f0"
|
||||
for %%# in (%*) do (
|
||||
if /i "%%#"=="r1" set r1=1
|
||||
if /i "%%#"=="r2" set r2=1
|
||||
if /i "%%#"=="re1" set re1=1
|
||||
if /i "%%#"=="re2" set re2=1
|
||||
)
|
||||
|
||||
:: Re-launch the script with x64 process if it was initiated by x86 process on x64 bit Windows
|
||||
:: or with ARM64 process if it was initiated by x86/ARM32 process on ARM64 Windows
|
||||
|
||||
if exist %SystemRoot%\Sysnative\cmd.exe if not defined r1 (
|
||||
if exist %SystemRoot%\Sysnative\cmd.exe if not defined re1 (
|
||||
setlocal EnableDelayedExpansion
|
||||
start %SystemRoot%\Sysnative\cmd.exe /c ""!_cmdf!" %* r1"
|
||||
start %SystemRoot%\Sysnative\cmd.exe /c ""!_cmdf!" %* re1"
|
||||
exit /b
|
||||
)
|
||||
|
||||
:: Re-launch the script with ARM32 process if it was initiated by x64 process on ARM64 Windows
|
||||
|
||||
if exist %SystemRoot%\SysArm32\cmd.exe if %PROCESSOR_ARCHITECTURE%==AMD64 if not defined r2 (
|
||||
if exist %SystemRoot%\SysArm32\cmd.exe if %PROCESSOR_ARCHITECTURE%==AMD64 if not defined re2 (
|
||||
setlocal EnableDelayedExpansion
|
||||
start %SystemRoot%\SysArm32\cmd.exe /c ""!_cmdf!" %* r2"
|
||||
start %SystemRoot%\SysArm32\cmd.exe /c ""!_cmdf!" %* re2"
|
||||
exit /b
|
||||
)
|
||||
|
||||
@@ -107,7 +109,7 @@ echo:
|
||||
echo Null service is not running, script may crash...
|
||||
echo:
|
||||
echo:
|
||||
echo Help - %mas%troubleshoot
|
||||
echo Help - %mas%fix_service
|
||||
echo:
|
||||
echo:
|
||||
ping 127.0.0.1 -n 20
|
||||
@@ -143,6 +145,8 @@ set _unattended=0
|
||||
|
||||
set _args=%*
|
||||
if defined _args set _args=%_args:"=%
|
||||
if defined _args set _args=%_args:re1=%
|
||||
if defined _args set _args=%_args:re2=%
|
||||
if defined _args (
|
||||
for %%A in (%_args%) do (
|
||||
if /i "%%A"=="/HWID" set _act=1
|
||||
@@ -157,24 +161,35 @@ for %%A in (%_act% %_NoEditionChange%) do (if "%%A"=="1" set _unattended=1)
|
||||
|
||||
call :dk_setvar
|
||||
|
||||
if %winbuild% EQU 1 (
|
||||
%eline%
|
||||
echo Failed to detect Windows build number.
|
||||
echo:
|
||||
setlocal EnableDelayedExpansion
|
||||
set fixes=%fixes% %mas%troubleshoot
|
||||
call :dk_color2 %Blue% "Help - " %_Yellow% " %mas%troubleshoot"
|
||||
goto dk_done
|
||||
)
|
||||
|
||||
if %winbuild% LSS 10240 (
|
||||
%eline%
|
||||
echo Unsupported OS version detected [%winbuild%].
|
||||
echo HWID Activation is supported only for Windows 10/11.
|
||||
echo Use Online KMS Activation option.
|
||||
echo HWID Activation is only supported on Windows 10/11.
|
||||
echo:
|
||||
call :dk_color %Blue% "Use TSforge activation option from the main menu."
|
||||
goto dk_done
|
||||
)
|
||||
|
||||
if exist "%SystemRoot%\Servicing\Packages\Microsoft-Windows-Server*Edition~*.mum" (
|
||||
%eline%
|
||||
echo HWID Activation is not supported for Windows Server.
|
||||
echo Use KMS38 or Online KMS Activation option.
|
||||
echo HWID Activation is not supported on Windows Server.
|
||||
call :dk_color %Blue% "Use TSforge activation option from the main menu."
|
||||
goto dk_done
|
||||
)
|
||||
|
||||
::========================================================================================================================================
|
||||
|
||||
:: Fix special characters limitation in path name
|
||||
:: Fix special character limitations in path name
|
||||
|
||||
set "_work=%~dp0"
|
||||
if "%_work:~-1%"=="\" set "_work=%_work:~0,-1%"
|
||||
@@ -194,8 +209,8 @@ setlocal EnableDelayedExpansion
|
||||
echo "!_batf!" | find /i "!_ttemp!" %nul1% && (
|
||||
if /i not "!_work!"=="!_ttemp!" (
|
||||
%eline%
|
||||
echo Script is launched from the temp folder,
|
||||
echo Most likely you are running the script directly from the archive file.
|
||||
echo The script was launched from the temp folder.
|
||||
echo You are most likely running the script directly from the archive file.
|
||||
echo:
|
||||
echo Extract the archive file and launch the script from the extracted folder.
|
||||
goto dk_done
|
||||
@@ -206,22 +221,26 @@ goto dk_done
|
||||
|
||||
:: Check PowerShell
|
||||
|
||||
REM :PowerShellTest: $ExecutionContext.SessionState.LanguageMode :PowerShellTest:
|
||||
REM :PStest: $ExecutionContext.SessionState.LanguageMode :PStest:
|
||||
|
||||
cmd /c "%psc% "$f=[io.file]::ReadAllText('!_batp!') -split ':PowerShellTest:\s*';iex ($f[1])"" | find /i "FullLanguage" %nul1% || (
|
||||
cmd /c "%psc% "$f=[io.file]::ReadAllText('!_batp!') -split ':PStest:\s*';iex ($f[1])"" | find /i "FullLanguage" %nul1% || (
|
||||
%eline%
|
||||
cmd /c "%psc% "$ExecutionContext.SessionState.LanguageMode""
|
||||
echo:
|
||||
cmd /c "%psc% "$ExecutionContext.SessionState.LanguageMode"" | find /i "FullLanguage" %nul1% && (
|
||||
echo Failed to run Powershell command but Powershell is working.
|
||||
call :dk_color %Blue% "Check if your antivirus is blocking the script."
|
||||
) || (
|
||||
echo PowerShell is not working. Aborting...
|
||||
echo If you have applied restrictions on Powershell then undo those changes.
|
||||
)
|
||||
echo:
|
||||
cmd /c "%psc% ""$av = Get-WmiObject -Namespace root\SecurityCenter2 -Class AntiVirusProduct; $n = @(); foreach ($i in $av) { if ($i.displayName -notlike '*windows*') { $n += $i.displayName } }; if ($n) { Write-Host ('Installed 3rd party Antivirus might be blocking the script - ' + ($n -join ', ')) -ForegroundColor White -BackgroundColor Blue }"""
|
||||
echo:
|
||||
set fixes=%fixes% %mas%troubleshoot
|
||||
call :dk_color2 %Blue% "Help - " %_Yellow% " %mas%troubleshoot"
|
||||
) || (
|
||||
echo PowerShell is not working. Aborting...
|
||||
echo If you have applied restrictions on Powershell then undo those changes.
|
||||
echo:
|
||||
set fixes=%fixes% %mas%fix_powershell
|
||||
call :dk_color2 %Blue% "Help - " %_Yellow% " %mas%fix_powershell"
|
||||
)
|
||||
goto dk_done
|
||||
)
|
||||
|
||||
@@ -233,7 +252,7 @@ goto dk_done
|
||||
if not defined _elev %psc% "start cmd.exe -arg '/c \"!_PSarg!\"' -verb runas" && exit /b
|
||||
%eline%
|
||||
echo This script needs admin rights.
|
||||
echo To do so, right click on this script and select 'Run as administrator'.
|
||||
echo Right click on this script and select 'Run as administrator'.
|
||||
goto dk_done
|
||||
)
|
||||
|
||||
@@ -259,6 +278,7 @@ if defined terminal (
|
||||
%psc% "%d2%" %nul2% | find /i "True" %nul1% && set terminal=
|
||||
)
|
||||
|
||||
if defined ps32onArm goto :skipQE
|
||||
if %_unattended%==1 goto :skipQE
|
||||
for %%# in (%_args%) do (if /i "%%#"=="-qedit" goto :skipQE)
|
||||
|
||||
@@ -284,25 +304,29 @@ set "d4=$k=$t.CreateType(); $b=$k::SetConsoleMode($k::GetStdHandle(-10), 0x0080)
|
||||
|
||||
set -=
|
||||
set old=
|
||||
set upver=%masver:.=%
|
||||
|
||||
for /f "delims=[] tokens=2" %%# in ('ping -4 -n 1 updatecheck.mass%-%grave.dev') do (
|
||||
if not [%%#]==[] (echo "%%#" | find "127.69" %nul1% && (echo "%%#" | find "127.69.%masver%" %nul1% || set old=1))
|
||||
for /f "delims=[] tokens=2" %%# in ('ping -4 -n 1 activ%-%ated.win') do (
|
||||
if not "%%#"=="" set old=1
|
||||
for /f "delims=[] tokens=2" %%# in ('ping -4 -n 1 updatecheck%upver%.activ%-%ated.win') do (
|
||||
if not "%%#"=="" set old=
|
||||
)
|
||||
)
|
||||
|
||||
if defined old (
|
||||
echo ________________________________________________
|
||||
%eline%
|
||||
echo Version %masver% of MAS is outdated.
|
||||
echo Your version of MAS [%masver%] is outdated.
|
||||
echo ________________________________________________
|
||||
echo:
|
||||
if not %_unattended%==1 (
|
||||
echo [1] Get Latest MAS
|
||||
echo [0] Continue Anyway
|
||||
echo:
|
||||
call :dk_color %_Green% "Enter a menu option in the Keyboard [1,0] :"
|
||||
call :dk_color %_Green% "Choose a menu option using your keyboard [1,0] :"
|
||||
choice /C:10 /N
|
||||
if !errorlevel!==2 rem
|
||||
if !errorlevel!==1 (start ht%-%tps://github.com/mass%-%gravel/Microsoft-Acti%-%vation-Scripts & start %mas% & exit /b)
|
||||
if !errorlevel!==1 (start %mas% & exit /b)
|
||||
)
|
||||
)
|
||||
|
||||
@@ -325,7 +349,7 @@ ClipUp.exe
|
||||
) do (
|
||||
if not exist %SysPath%\%%# (
|
||||
%eline%
|
||||
echo [%SysPath%\%%#] file is missing. Aborting...
|
||||
echo [%SysPath%\%%#] file is missing, aborting...
|
||||
echo:
|
||||
set fixes=%fixes% %mas%troubleshoot
|
||||
call :dk_color2 %Blue% "Help - " %_Yellow% " %mas%troubleshoot"
|
||||
@@ -352,12 +376,11 @@ if defined _perm (
|
||||
cls
|
||||
echo ___________________________________________________________________________________________
|
||||
echo:
|
||||
call :dk_color2 %_White% " " %Green% "Checking: %winos% is Permanently Activated."
|
||||
call :dk_color2 %_White% " " %Gray% "Activation is not required."
|
||||
call :dk_color2 %_White% " " %Green% "%winos% is already permanently activated."
|
||||
echo ___________________________________________________________________________________________
|
||||
if %_unattended%==1 goto dk_done
|
||||
echo:
|
||||
choice /C:10 /N /M "> [1] Activate [0] %_exitmsg% : "
|
||||
choice /C:10 /N /M "> [1] Activate Anyway [0] %_exitmsg% : "
|
||||
if errorlevel 2 exit /b
|
||||
)
|
||||
cls
|
||||
@@ -371,10 +394,11 @@ reg query "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion" /v EditionID %nul2
|
||||
%eline%
|
||||
echo [%winos% ^| %winbuild%]
|
||||
echo:
|
||||
echo Evaluation Editions cannot be activated outside of evaluation period.
|
||||
echo Evaluation editions cannot be activated outside of their evaluation period.
|
||||
call :dk_color %Blue% "Use TSforge activation option from the main menu to reset evaluation period."
|
||||
echo:
|
||||
set fixes=%fixes% %mas%evaluation-editions
|
||||
call :dk_color2 %Blue% "Help - " %_Yellow% " %mas%evaluation-editions"
|
||||
set fixes=%fixes% %mas%evaluation_editions
|
||||
call :dk_color2 %Blue% "Help - " %_Yellow% " %mas%evaluation_editions"
|
||||
goto dk_done
|
||||
)
|
||||
)
|
||||
@@ -391,7 +415,7 @@ call :dk_showosinfo
|
||||
|
||||
set _int=
|
||||
for %%a in (l.root-servers.net resolver1.opendns.com download.windowsupdate.com google.com) do if not defined _int (
|
||||
for /f "delims=[] tokens=2" %%# in ('ping -n 1 %%a') do (if not [%%#]==[] set _int=1)
|
||||
for /f "delims=[] tokens=2" %%# in ('ping -n 1 %%a') do (if not "%%#"=="" set _int=1)
|
||||
)
|
||||
|
||||
if not defined _int (
|
||||
@@ -404,7 +428,7 @@ echo Checking Internet Connection [Connected%ping_f%]
|
||||
) else (
|
||||
set error=1
|
||||
call :dk_color %Red% "Checking Internet Connection [Not Connected]"
|
||||
call :dk_color %Blue% "Internet is required for HWID Activation."
|
||||
call :dk_color %Blue% "Internet is required for HWID activation."
|
||||
)
|
||||
|
||||
::========================================================================================================================================
|
||||
@@ -453,13 +477,13 @@ if not defined key (
|
||||
%eline%
|
||||
echo [%winos% ^| %winbuild% ^| SKU:%osSKU%]
|
||||
if not defined skunotfound (
|
||||
echo This product does not support HWID Activation.
|
||||
echo Try KMS38 Activation option.
|
||||
echo Make sure you are using updated version of the script.
|
||||
echo This product does not support HWID activation.
|
||||
echo Make sure you are using the latest version of the script.
|
||||
echo If you are, then try TSforge activation option from the main menu.
|
||||
set fixes=%fixes% %mas%
|
||||
echo %mas%
|
||||
) else (
|
||||
echo Required License files not found in %SysPath%\spp\tokens\skus\
|
||||
echo Required license files not found in %SysPath%\spp\tokens\skus\
|
||||
set fixes=%fixes% %mas%troubleshoot
|
||||
call :dk_color2 %Blue% "Help - " %_Yellow% " %mas%troubleshoot"
|
||||
)
|
||||
@@ -475,12 +499,12 @@ if defined notworking set error=1
|
||||
|
||||
echo:
|
||||
if defined changekey (
|
||||
call :dk_color %Blue% "[%altedition%] Edition product key will be used to enable HWID activation."
|
||||
call :dk_color %Blue% "[%altedition%] edition product key will be used to enable HWID activation."
|
||||
echo:
|
||||
)
|
||||
|
||||
if defined winsub (
|
||||
call :dk_color %Blue% "Windows Subscription [SKU ID-%slcSKU%] found. Script will activate base edition [SKU ID-%regSKU%]."
|
||||
call :dk_color %Blue% "Windows Subscription [SKU ID-%slcSKU%] detected. Script will activate base edition [SKU ID-%regSKU%]."
|
||||
echo:
|
||||
)
|
||||
|
||||
@@ -522,7 +546,7 @@ call :hwiddata ticket
|
||||
copy /y /b "%tdir%\GenuineTicket" "%tdir%\GenuineTicket.xml" %nul%
|
||||
|
||||
if not exist "%tdir%\GenuineTicket.xml" (
|
||||
call :dk_color %Red% "Generating GenuineTicket.xml [Failed, aborting the process]"
|
||||
call :dk_color %Red% "Generating GenuineTicket.xml [Failed, aborting...]"
|
||||
echo [%encoded%]
|
||||
if exist "%tdir%\Genuine*" del /f /q "%tdir%\Genuine*" %nul%
|
||||
goto :dl_final
|
||||
@@ -533,14 +557,14 @@ echo Generating GenuineTicket.xml [Successful]
|
||||
set "_xmlexist=if exist "%tdir%\GenuineTicket.xml""
|
||||
|
||||
%_xmlexist% (
|
||||
%psc% "Start-Job { Restart-Service ClipSVC } | Wait-Job -Timeout 10 | Out-Null"
|
||||
%psc% "Start-Job { Restart-Service ClipSVC } | Wait-Job -Timeout 20 | Out-Null"
|
||||
%_xmlexist% timeout /t 2 %nul%
|
||||
%_xmlexist% timeout /t 2 %nul%
|
||||
|
||||
%_xmlexist% (
|
||||
set error=1
|
||||
if exist "%tdir%\*.xml" del /f /q "%tdir%\*.xml" %nul%
|
||||
call :dk_color %Red% "Installing GenuineTicket.xml [Failed With ClipSVC Service Restart, Wait...]"
|
||||
call :dk_color %Gray% "Installing GenuineTicket.xml [Failed with ClipSVC service restart, wait...]"
|
||||
)
|
||||
)
|
||||
|
||||
@@ -595,17 +619,18 @@ goto :dl_final
|
||||
|
||||
set "_ident=HKU\S-1-5-19\SOFTWARE\Microsoft\IdentityCRL"
|
||||
|
||||
if defined _int (
|
||||
if %keyerror% EQU 0 if defined _int (
|
||||
reg delete "%_ident%" /f %nul%
|
||||
reg query "%_ident%" %nul% && (
|
||||
echo:
|
||||
set error=1
|
||||
call :dk_color %Red% "Deleting an IdentityCRL Registry [Failed] [%_ident%]"
|
||||
)
|
||||
for %%# in (wlidsvc LicenseManager sppsvc) do (%psc% "Start-Job { Restart-Service %%# } | Wait-Job -Timeout 10 | Out-Null")
|
||||
for %%# in (wlidsvc LicenseManager sppsvc) do (%psc% "Start-Job { Restart-Service %%# } | Wait-Job -Timeout 20 | Out-Null")
|
||||
call :dk_refresh
|
||||
call :dk_act
|
||||
call :dk_checkperm
|
||||
|
||||
reg query "%_ident%" %nul% || (
|
||||
set error=1
|
||||
echo:
|
||||
call :dk_color %Red% "Generating New IdentityCRL Registry [Failed] [%_ident%]"
|
||||
)
|
||||
)
|
||||
|
||||
::==========================================================================================================================================
|
||||
@@ -613,75 +638,91 @@ call :dk_checkperm
|
||||
:: Extended licensing servers tests incase error not found and activation failed
|
||||
|
||||
if %keyerror% EQU 0 if not defined _perm if defined _int (
|
||||
set resfail=
|
||||
ipconfig /flushdns %nul%
|
||||
set "tls=[Net.ServicePointManager]::SecurityProtocol=[Net.SecurityProtocolType]::Tls12;"
|
||||
|
||||
for %%# in (
|
||||
licensing.mp.microsoft.com/v7.0/licenses/content
|
||||
login.live.com/ppsecure/deviceaddcredential.srf
|
||||
purchase.mp.microsoft.com/v7.0/users/me/orders
|
||||
) do if not defined resfail (
|
||||
set "d1=Add-Type -AssemblyName System.Net.Http;"
|
||||
set "d1=!d1! $client = [System.Net.Http.HttpClient]::new();"
|
||||
set "d1=!d1! $response = $client.GetAsync('https://%%#').GetAwaiter().GetResult();"
|
||||
set "d1=!d1! $response.Content.ReadAsStringAsync().GetAwaiter().GetResult()"
|
||||
%psc% "!tls! !d1!" %nul2% | findstr /i "PurchaseFD DeviceAddResponse" %nul1% || set resfail=1
|
||||
%psc% "try { !tls! irm https://%%# -Method POST } catch { if ($_.Exception.Response -eq $null) { Write-Host """"[%%#] $($_.Exception.Message)"""" -ForegroundColor Red -BackgroundColor Black; exit 3 } }"
|
||||
if !errorlevel!==3 set resfail=1
|
||||
)
|
||||
|
||||
if not defined resfail (
|
||||
%psc% "!tls! irm https://licensing.mp.microsoft.com/v7.0/licenses/content -Method POST" | find /i "traceId" %nul1% || set resfail=1
|
||||
)
|
||||
|
||||
if defined resfail (
|
||||
set error=1
|
||||
echo:
|
||||
call :dk_color %Red% "Checking Licensing Servers [Failed To Connect]"
|
||||
for %%# in (
|
||||
live.com
|
||||
microsoft.com
|
||||
login.live.com
|
||||
purchase.mp.microsoft.com
|
||||
licensing.mp.microsoft.com
|
||||
) do (
|
||||
findstr /i "%%#" "%SysPath%\drivers\etc\hosts" %nul1% && set "hosfail= [%%# Blocked in Hosts]"
|
||||
)
|
||||
call :dk_color %Red% "Checking Licensing Servers [Failed to Connect]!hosfail!"
|
||||
set fixes=%fixes% %mas%licensing-servers-issue
|
||||
call :dk_color2 %Blue% "Help - " %_Yellow% " %mas%licensing-servers-issue"
|
||||
)
|
||||
|
||||
::==========================================================================================================================================
|
||||
|
||||
:: Windows update and store block check
|
||||
|
||||
if %keyerror% EQU 0 if not defined _perm if defined _int (
|
||||
|
||||
reg query "HKLM\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate" /v DisableWindowsUpdateAccess %nul2% | find /i "0x1" %nul% && set wublock=1
|
||||
reg query "HKLM\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate" /v DoNotConnectToWindowsUpdateInternetLocations %nul2% | find /i "0x1" %nul% && set wublock=1
|
||||
if defined wublock (
|
||||
call :dk_color %Red% "Checking Update Blocker In Registry [Found]"
|
||||
call :dk_color %Blue% "HWID activation needs working Windows updates, if you have used any tool to block updates, undo it."
|
||||
)
|
||||
|
||||
reg query "HKLM\SOFTWARE\Policies\Microsoft\WindowsStore" /v DisableStoreApps %nul2% | find /i "0x1" %nul% && (
|
||||
set storeblock=1
|
||||
call :dk_color %Red% "Checking Store Blocker In Registry [Found]"
|
||||
call :dk_color %Blue% "If you have used any tool to block Store, undo it."
|
||||
)
|
||||
|
||||
set wcount=0
|
||||
for %%G in (DependOnService Description DisplayName ErrorControl ImagePath ObjectName Start Type ServiceSidType RequiredPrivileges FailureActions) do (
|
||||
reg query HKLM\SYSTEM\CurrentControlSet\Services\wuauserv /v %%G %nul% || (set wucorrupt=1&set /a wcount+=1)
|
||||
)
|
||||
|
||||
for %%G in (Parameters Security) do (
|
||||
reg query HKLM\SYSTEM\CurrentControlSet\Services\wuauserv\%%G %nul% || (set wucorrupt=1&set /a wcount+=1)
|
||||
)
|
||||
|
||||
if defined wucorrupt (
|
||||
set error=1
|
||||
call :dk_color %Red% "Checking Windows Update Registry [Corruption Found]"
|
||||
if !wcount! GTR 2 (
|
||||
call :dk_color %Red% "Windows seems to be infected with Mal%w%ware."
|
||||
set fixes=%fixes% %mas%remove_mal%w%ware
|
||||
call :dk_color2 %Blue% "Help - " %_Yellow% " %mas%remove_mal%w%ware"
|
||||
) else (
|
||||
call :dk_color %Blue% "HWID activation needs working Windows updates, if you have used any tool to block updates, undo it."
|
||||
)
|
||||
) else (
|
||||
%psc% "Start-Job { Start-Service wuauserv } | Wait-Job -Timeout 20 | Out-Null"
|
||||
sc query wuauserv | find /i "RUNNING" %nul% || (
|
||||
set error=1
|
||||
set wuerror=1
|
||||
sc start wuauserv %nul%
|
||||
call :dk_color %Red% "Starting Windows Update Service [Failed] [!errorlevel!]"
|
||||
call :dk_color %Blue% "HWID activation needs working Windows updates, if you have used any tool to block updates, undo it."
|
||||
)
|
||||
)
|
||||
)
|
||||
|
||||
::==========================================================================================================================================
|
||||
|
||||
:: Check Internet related error codes
|
||||
|
||||
if %keyerror% EQU 0 if not defined _perm if defined _int (
|
||||
|
||||
reg query "%_ident%" %nul% || (
|
||||
set error=1
|
||||
echo:
|
||||
call :dk_color %Red% "Generating New IdentityCRL Registry [Failed] [%_ident%]"
|
||||
)
|
||||
|
||||
reg query "HKLM\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate" /v DisableWindowsUpdateAccess %nul2% | find /i "0x1" %nul% && set wublock=1
|
||||
reg query "HKLM\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate" /v DoNotConnectToWindowsUpdateInternetLocations %nul2% | find /i "0x1" %nul% && set wublock=1
|
||||
if defined wublock call :dk_color %Red% "Checking Update Blocker In Registry [Found]"
|
||||
|
||||
reg query "HKLM\SOFTWARE\Policies\Microsoft\WindowsStore" /v DisableStoreApps %nul2% | find /i "0x1" %nul% && (
|
||||
set storeblock=1
|
||||
call :dk_color %Red% "Checking Store Blocker In Registry [Found]"
|
||||
)
|
||||
|
||||
for %%G in (DependOnService Description DisplayName ErrorControl ImagePath ObjectName Start Type ServiceSidType RequiredPrivileges FailureActions) do if not defined wucorrupt (
|
||||
reg query HKLM\SYSTEM\CurrentControlSet\Services\wuauserv /v %%G %nul% || set wucorrupt=1
|
||||
)
|
||||
|
||||
for %%G in (Parameters Security TriggerInfo) do if not defined wucorrupt (
|
||||
reg query HKLM\SYSTEM\CurrentControlSet\Services\wuauserv\%%G %nul% || set wucorrupt=1
|
||||
)
|
||||
|
||||
if defined wucorrupt (
|
||||
call :dk_color %Red% "Checking Windows Update Registry [Corruption Found]"
|
||||
) else (
|
||||
%psc% "Start-Job { Start-Service wuauserv } | Wait-Job -Timeout 10 | Out-Null"
|
||||
sc query wuauserv | find /i "RUNNING" %nul% || (
|
||||
set wuerror=1
|
||||
sc start wuauserv %nul%
|
||||
call :dk_color %Red% "Starting Windows Update Service [Failed] [!errorlevel!]"
|
||||
)
|
||||
)
|
||||
|
||||
REM Check Internet related error codes
|
||||
|
||||
if not defined wucorrupt if not defined wublock if not defined wuerror if not defined storeblock (
|
||||
if not defined wucorrupt if not defined wublock if not defined wuerror if not defined storeblock if not defined resfail (
|
||||
echo "%error_code%" | findstr /i "0x80072e 0x80072f 0x800704cf 0x87e10bcf 0x800705b4" %nul% && (
|
||||
call :dk_color %Red% "Checking Internet Issues [Found] %error_code%"
|
||||
set fixes=%fixes% %mas%licensing-servers-issue
|
||||
@@ -698,8 +739,8 @@ call :dk_color %Green% "%winos% is permanently activated with a digital license.
|
||||
) else (
|
||||
call :dk_color %Red% "Activation Failed %error_code%"
|
||||
if defined notworking (
|
||||
call :dk_color %Blue% "At the time of writing this, HWID Activation was not supported for this product."
|
||||
call :dk_color %Blue% "Use KMS38 Activation option."
|
||||
call :dk_color %Blue% "At the time of writing, HWID Activation is not supported for this product."
|
||||
call :dk_color %Blue% "Use TSforge activation option from the main menu instead."
|
||||
) else (
|
||||
if not defined error call :dk_color %Blue% "%_fixmsg%"
|
||||
set fixes=%fixes% %mas%troubleshoot
|
||||
@@ -745,12 +786,16 @@ set _NCS=1
|
||||
if %winbuild% LSS 10586 set _NCS=0
|
||||
if %winbuild% GEQ 10586 reg query "HKCU\Console" /v ForceV2 %nul2% | find /i "0x0" %nul1% && (set _NCS=0)
|
||||
|
||||
echo "%PROCESSOR_ARCHITECTURE% %PROCESSOR_ARCHITEW6432%" | find /i "ARM64" %nul1% && (if %winbuild% LSS 21277 set ps32onArm=1)
|
||||
|
||||
if %_NCS% EQU 1 (
|
||||
for /F %%a in ('echo prompt $E ^| cmd') do set "esc=%%a"
|
||||
set "Red="41;97m""
|
||||
set "Gray="100;97m""
|
||||
set "Green="42;97m""
|
||||
set "Blue="44;97m""
|
||||
set "White="107;91m""
|
||||
set "_Red="40;91m""
|
||||
set "_White="40;37m""
|
||||
set "_Green="40;92m""
|
||||
set "_Yellow="40;93m""
|
||||
@@ -759,6 +804,8 @@ set "Red="Red" "white""
|
||||
set "Gray="Darkgray" "white""
|
||||
set "Green="DarkGreen" "white""
|
||||
set "Blue="Blue" "white""
|
||||
set "White="White" "Red""
|
||||
set "_Red="Black" "Red""
|
||||
set "_White="Black" "Gray""
|
||||
set "_Green="Black" "Green""
|
||||
set "_Yellow="Black" "Yellow""
|
||||
@@ -934,7 +981,7 @@ reg delete "%ruleskey%" /v "SuppressRulesEngine" /f %nul%
|
||||
set r1=$TB = [AppDomain]::CurrentDomain.DefineDynamicAssembly(4, 1).DefineDynamicModule(2, $False).DefineType(0);
|
||||
set r2=%r1% [void]$TB.DefinePInvokeMethod('SLpTriggerServiceWorker', 'sppc.dll', 22, 1, [Int32], @([UInt32], [IntPtr], [String], [UInt32]), 1, 3);
|
||||
set d1=%r2% [void]$TB.CreateType()::SLpTriggerServiceWorker(0, 0, 'reeval', 0)
|
||||
%psc% "Start-Job { Stop-Service sppsvc -force } | Wait-Job -Timeout 10 | Out-Null; %d1%"
|
||||
%psc% "Start-Job { Stop-Service sppsvc -force } | Wait-Job -Timeout 20 | Out-Null; %d1%"
|
||||
exit /b
|
||||
|
||||
:: Get Activation IDs from licensing files if not found through WMI
|
||||
@@ -986,7 +1033,7 @@ function ReinstallLicenses() {
|
||||
|
||||
set _wmic=0
|
||||
for %%# in (wmic.exe) do @if not "%%~$PATH:#"=="" (
|
||||
wmic path Win32_ComputerSystem get CreationClassName /value %nul2% | find /i "computersystem" %nul1% && set _wmic=1
|
||||
cmd /c "wmic path Win32_ComputerSystem get CreationClassName /value" %nul2% | find /i "computersystem" %nul1% && set _wmic=1
|
||||
)
|
||||
exit /b
|
||||
|
||||
@@ -1003,7 +1050,7 @@ echo sc start sppsvc [Error Code: %spperror%]
|
||||
)
|
||||
|
||||
echo:
|
||||
%psc% "$job = Start-Job { (Get-WmiObject -Query 'SELECT * FROM %sps%').Version }; if (-not (Wait-Job $job -Timeout 20)) {write-host 'sppsvc is not working correctly. Help - %mas%troubleshoot'}"
|
||||
%psc% "$job = Start-Job { (Get-WmiObject -Query 'SELECT * FROM %sps%').Version }; if (-not (Wait-Job $job -Timeout 30)) {write-host 'sppsvc is not working correctly. Help - %mas%troubleshoot'}"
|
||||
exit /b
|
||||
|
||||
:: Get Product name (WMI/REG methods are not reliable in all conditions, hence winbrand.dll method is used)
|
||||
@@ -1057,36 +1104,38 @@ exit /b
|
||||
|
||||
set w=
|
||||
set results=
|
||||
if exist "%ProgramFiles%\KM%w%Spico" set pupfound1= KM%w%Spico
|
||||
if exist "%SysPath%\Tasks\R@1n-KMS" set pupfound2= R@inKMS
|
||||
reg query "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Schedule\taskcache\tasks" /f Path /s | find /i "AutoPico" %nul% && set pupfound1= KM%w%Spico
|
||||
reg query "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Schedule\taskcache\tasks" /f Path /s | find /i "R@1n" %nul% && set pupfound2= R@inKMS
|
||||
set pupfound=%pupfound1%%pupfound2%
|
||||
if exist "%ProgramFiles%\KM%w%Spico" set pupfound= KM%w%Spico
|
||||
if not defined pupfound (
|
||||
reg query "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Schedule\taskcache\tasks" /f Path /s | find /i "AutoPico" %nul% && set pupfound= KM%w%Spico
|
||||
)
|
||||
|
||||
set hcount=0
|
||||
for %%# in (avira.com kaspersky.com virustotal.com mcafee.com) do (
|
||||
find /i "%%#" %SysPath%\drivers\etc\hosts %nul% && set /a hcount+=1)
|
||||
if %hcount%==4 set "results=[AV URLs are blocked in hosts]"
|
||||
|
||||
set wucount=0
|
||||
for %%# in (wuauserv) do (
|
||||
set _corrupt=
|
||||
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 & set /a wucount+=1)
|
||||
)
|
||||
)
|
||||
if %wucount% GEQ 1 set "results=%results%[WU registry is corrupt]"
|
||||
if %hcount%==4 set "results=[Antivirus URLs are blocked in hosts]"
|
||||
|
||||
sc start sppsvc %nul%
|
||||
echo "%errorlevel%" | findstr "577 225" %nul% && set "results=%results%[Likely File Infector]"
|
||||
echo "%errorlevel%" | findstr "577 225" %nul% && (
|
||||
set "results=%results%[Likely File Infector]"
|
||||
) || (
|
||||
if not exist %SysPath%\sppsvc.exe if not exist %SysPath%\alg.exe (set "results=%results%[Likely File Infector]")
|
||||
)
|
||||
|
||||
if not "%results%%pupfound%"=="" (
|
||||
if defined pupfound call :dk_color %Gray% "Checking PUP Activators [Found%pupfound%]"
|
||||
if defined results call :dk_color %Red% "Checking Probable Mal%w%ware Infection %results%"
|
||||
if defined results call :dk_color %Red% "Checking Probable Mal%w%ware Infection..."
|
||||
if defined results call :dk_color %Red% "%results%"
|
||||
set fixes=%fixes% %mas%remove_mal%w%ware
|
||||
call :dk_color2 %Blue% "Help - " %_Yellow% " %mas%remove_mal%w%ware"
|
||||
echo:
|
||||
)
|
||||
|
||||
:: Remove the scheduled task of R@1n-KMS (old version) that runs the activation command every minute, as it leads to high CPU usage.
|
||||
|
||||
if exist %SysPath%\Tasks\R@1n-KMS (
|
||||
for /f %%A in ('dir /b /a:-d %SysPath%\Tasks\R@1n-KMS %nul6%') do (schtasks /delete /tn \R@1n-KMS\%%A /f %nul%)
|
||||
)
|
||||
|
||||
exit /b
|
||||
|
||||
::========================================================================================================================================
|
||||
@@ -1096,6 +1145,18 @@ exit /b
|
||||
set showfix=
|
||||
call :dk_chkmal
|
||||
|
||||
:: Check Sandboxing
|
||||
|
||||
sc query Null %nul% || (
|
||||
set error=1
|
||||
set showfix=1
|
||||
call :dk_color %Red% "Checking Sandboxing [Found, script may not work properly.]"
|
||||
call :dk_color %Blue% "If you are using any third-party antivirus, check if it is blocking the script."
|
||||
echo:
|
||||
)
|
||||
|
||||
::========================================================================================================================================
|
||||
|
||||
:: Check corrupt services
|
||||
|
||||
set serv_cor=
|
||||
@@ -1113,6 +1174,7 @@ if defined _corrupt (if defined serv_cor (set "serv_cor=!serv_cor! %%#") else (s
|
||||
|
||||
if defined serv_cor (
|
||||
set error=1
|
||||
set showfix=1
|
||||
call :dk_color %Red% "Checking Corrupt Services [%serv_cor%]"
|
||||
)
|
||||
|
||||
@@ -1165,7 +1227,7 @@ set errorcode=
|
||||
set checkerror=
|
||||
|
||||
sc query %%# | find /i "RUNNING" %nul% || (
|
||||
%psc% "Start-Job { Start-Service %%# } | Wait-Job -Timeout 10 | Out-Null"
|
||||
%psc% "Start-Job { Start-Service %%# } | Wait-Job -Timeout 20 | Out-Null"
|
||||
set errorcode=!errorlevel!
|
||||
sc query %%# | find /i "RUNNING" %nul% || set checkerror=1
|
||||
)
|
||||
@@ -1179,7 +1241,12 @@ if defined serv_e (
|
||||
set error=1
|
||||
call :dk_color %Red% "Starting Services [Failed] [%serv_e%]"
|
||||
echo %serv_e% | findstr /i "ClipSVC-1058 sppsvc-1058" %nul% && (
|
||||
call :dk_color %Blue% "Restart the system to fix this error."
|
||||
call :dk_color %Blue% "Reboot your machine using the restart option to fix this error."
|
||||
set showfix=1
|
||||
)
|
||||
echo %serv_e% | findstr /i "sppsvc-1060" %nul% && (
|
||||
set fixes=%fixes% %mas%fix_service
|
||||
call :dk_color2 %Blue% "Help - " %_Yellow% " %mas%fix_service"
|
||||
set showfix=1
|
||||
)
|
||||
)
|
||||
@@ -1195,14 +1262,21 @@ call :dk_color2 %Red% "Checking Boot Mode [%safeboot_option
|
||||
)
|
||||
|
||||
|
||||
:: https://learn.microsoft.com/windows-hardware/manufacture/desktop/windows-setup-states
|
||||
|
||||
for /f "skip=2 tokens=2*" %%A in ('reg query "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Setup\State" /v ImageState') do (set imagestate=%%B)
|
||||
|
||||
if /i not "%imagestate%"=="IMAGE_STATE_COMPLETE" (
|
||||
set error=1
|
||||
call :dk_color %Red% "Checking Windows Setup State [%imagestate%]"
|
||||
call :dk_color %Gray% "Checking Windows Setup State [%imagestate%]"
|
||||
echo "%imagestate%" | find /i "RESEAL" %nul% && (
|
||||
set error=1
|
||||
set showfix=1
|
||||
call :dk_color %Blue% "You need to run it in normal mode in case you are running it in Audit Mode."
|
||||
)
|
||||
echo "%imagestate%" | find /i "UNDEPLOYABLE" %nul% && (
|
||||
set fixes=%fixes% %mas%in-place_repair_upgrade
|
||||
call :dk_color2 %Blue% "If the activation fails, do this - " %_Yellow% " %mas%in-place_repair_upgrade"
|
||||
)
|
||||
)
|
||||
|
||||
|
||||
@@ -1219,24 +1293,27 @@ for /f "delims=" %%a in ('%psc% "$f=[io.file]::ReadAllText('!_batp!') -split ':w
|
||||
echo "%wpainfo%" | find /i "Error Found" %nul% && (
|
||||
set error=1
|
||||
set wpaerror=1
|
||||
call :dk_color %Red% "Checking WPA Registry Error [%wpainfo%]"
|
||||
call :dk_color %Red% "Checking WPA Registry Errors [%wpainfo%]"
|
||||
) || (
|
||||
echo Checking WPA Registry Count [%wpainfo%]
|
||||
)
|
||||
|
||||
|
||||
if not defined officeact if exist "%SystemRoot%\Servicing\Packages\Microsoft-Windows-*EvalEdition~*.mum" (
|
||||
if not defined notwinact if exist "%SystemRoot%\Servicing\Packages\Microsoft-Windows-*EvalEdition~*.mum" (
|
||||
reg query "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion" /v EditionID %nul2% | find /i "Eval" %nul1% || (
|
||||
set error=1
|
||||
call :dk_color %Red% "Checking Eval Packages [Non-Eval Licenses are installed in Eval Windows]"
|
||||
set fixes=%fixes% %mas%evaluation-editions
|
||||
call :dk_color2 %Blue% "Help - " %_Yellow% " %mas%evaluation-editions"
|
||||
set fixes=%fixes% %mas%evaluation_editions
|
||||
call :dk_color2 %Blue% "Help - " %_Yellow% " %mas%evaluation_editions"
|
||||
)
|
||||
)
|
||||
|
||||
|
||||
set osedition=0
|
||||
for /f "skip=2 tokens=3" %%a in ('reg query "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion" /v EditionID %nul6%') do set "osedition=%%a"
|
||||
if %_wmic% EQU 1 set "chkedi=for /f "tokens=2 delims==" %%a in ('"wmic path %spp% where (ApplicationID='55c92734-d682-4d71-983e-d6ec3f16059f' AND LicenseDependsOn is NULL AND PartialProductKey IS NOT NULL) get LicenseFamily /VALUE" %nul6%')"
|
||||
if %_wmic% EQU 0 set "chkedi=for /f "tokens=2 delims==" %%a in ('%psc% "(([WMISEARCHER]'SELECT LicenseFamily FROM %spp% WHERE ApplicationID=''55c92734-d682-4d71-983e-d6ec3f16059f'' AND LicenseDependsOn is NULL AND PartialProductKey IS NOT NULL').Get()).LicenseFamily ^| %% {echo ('LicenseFamily='+$_)}" %nul6%')"
|
||||
%chkedi% do if not errorlevel 1 (call set "osedition=%%a")
|
||||
|
||||
if %osedition%==0 for /f "skip=2 tokens=3" %%a in ('reg query "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion" /v EditionID %nul6%') do set "osedition=%%a"
|
||||
|
||||
:: Workaround for an issue in builds between 1607 and 1709 where ProfessionalEducation is shown as Professional
|
||||
|
||||
@@ -1245,20 +1322,18 @@ if "%osSKU%"=="164" set osedition=ProfessionalEducation
|
||||
if "%osSKU%"=="165" set osedition=ProfessionalEducationN
|
||||
)
|
||||
|
||||
if not defined officeact (
|
||||
if not defined notwinact (
|
||||
if %osedition%==0 (
|
||||
call :dk_color %Red% "Checking Edition Name [Not Found In Registry]"
|
||||
) else (
|
||||
|
||||
if not exist "%SysPath%\spp\tokens\skus\%osedition%\%osedition%*.xrm-ms" if not exist "%SysPath%\spp\tokens\skus\Security-SPP-Component-SKU-%osedition%\*-%osedition%-*.xrm-ms" (
|
||||
set error=1
|
||||
set skunotfound=1
|
||||
call :dk_color %Red% "Checking License Files [Not Found] [%osedition%]"
|
||||
)
|
||||
|
||||
if not exist "%SystemRoot%\Servicing\Packages\Microsoft-Windows-*-%osedition%-*.mum" (
|
||||
set error=1
|
||||
call :dk_color %Red% "Checking Package File [Not Found] [%osedition%]"
|
||||
call :dk_color %Red% "Checking Package Files [Not Found] [%osedition%]"
|
||||
)
|
||||
)
|
||||
)
|
||||
@@ -1279,16 +1354,16 @@ if %_wmic% EQU 1 wmic path Win32_ComputerSystem get CreationClassName /value %nu
|
||||
if %_wmic% EQU 0 %psc% "Get-WmiObject -Class Win32_ComputerSystem | Select-Object -Property CreationClassName" %nul2% | find /i "computersystem" %nul1%
|
||||
|
||||
if %errorlevel% NEQ 0 set wmifailed=1
|
||||
echo "%error_code%" | findstr /i "0x800410 0x800440" %nul1% && set wmifailed=1& :: https://learn.microsoft.com/en-us/windows/win32/wmisdk/wmi-error-constants
|
||||
echo "%error_code%" | findstr /i "0x800410 0x800440 0x80131501" %nul1% && set wmifailed=1& :: https://learn.microsoft.com/en-us/windows/win32/wmisdk/wmi-error-constants
|
||||
if defined wmifailed (
|
||||
set error=1
|
||||
call :dk_color %Red% "Checking WMI [Not Working]"
|
||||
call :dk_color %Blue% "Go back to Main Menu, select Troubleshoot and run Fix WMI option."
|
||||
if not defined showfix call :dk_color %Blue% "Go back to Main Menu, select Troubleshoot and run Fix WMI option."
|
||||
set showfix=1
|
||||
)
|
||||
|
||||
|
||||
if not defined officeact (
|
||||
if not defined notwinact (
|
||||
if %winbuild% GEQ 10240 (
|
||||
%nul% set /a "sum=%slcSKU%+%regSKU%+%wmiSKU%"
|
||||
set /a "sum/=3"
|
||||
@@ -1321,47 +1396,44 @@ call :dk_color2 %Red% "Checking ClipSVC " %Blue% "[System
|
||||
:: This "WLMS" service was included in previous Eval editions (which were activable) to automatically shut down the system every hour after the evaluation period expired and prevent SPPSVC from stopping.
|
||||
|
||||
if exist "%SysPath%\wlms\wlms.exe" (
|
||||
sc query wlms | find /i "RUNNING" %nul% && (
|
||||
echo Checking Eval WLMS Service [Found]
|
||||
)
|
||||
)
|
||||
|
||||
|
||||
reg query "HKU\S-1-5-20" %nul% && (
|
||||
if %winbuild% GEQ 15063 reg query "HKU\S-1-5-20\Software\Microsoft\Windows NT\CurrentVersion\SoftwareProtectionPlatform" %nul% || (
|
||||
reg query "HKU\S-1-5-20\Software\Microsoft\Windows NT\CurrentVersion" %nul% || (
|
||||
set error=1
|
||||
call :dk_color %Red% "Checking S-1-5-20 SPP Reg [Not Found]"
|
||||
set fixes=%fixes% %mas%troubleshoot
|
||||
call :dk_color2 %Blue% "Help - " %_Yellow% " %mas%troubleshoot"
|
||||
)
|
||||
) || (
|
||||
set error=1
|
||||
call :dk_color %Red% "Checking HKU\S-1-5-20 Reg [Not Found]"
|
||||
set fixes=%fixes% %mas%troubleshoot
|
||||
call :dk_color2 %Blue% "Help - " %_Yellow% " %mas%troubleshoot"
|
||||
set showfix=1
|
||||
call :dk_color %Red% "Checking HKU\S-1-5-20 Registry [Not Found]"
|
||||
set fixes=%fixes% %mas%in-place_repair_upgrade
|
||||
call :dk_color2 %Blue% "In case of activation issues, do this - " %_Yellow% " %mas%in-place_repair_upgrade"
|
||||
)
|
||||
|
||||
|
||||
for %%# in (SppEx%w%tComObj.exe sppsvc.exe) do (
|
||||
for %%# in (SppEx%w%tComObj.exe sppsvc.exe sppsvc.exe\PerfOptions) do (
|
||||
reg query "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Ima%w%ge File Execu%w%tion Options\%%#" %nul% && (if defined _sppint (set "_sppint=!_sppint!, %%#") else (set "_sppint=%%#"))
|
||||
)
|
||||
if defined _sppint (
|
||||
echo Checking SPP Interference In IFEO [%_sppint%]
|
||||
echo %_sppint% | find /i "PerfOptions" %nul% && (
|
||||
call :dk_color %Red% "Checking SPP Interference In IFEO [%_sppint% - System might deactivate later]"
|
||||
if not defined showfix call :dk_color %Blue% "%_fixmsg%"
|
||||
set showfix=1
|
||||
) || (
|
||||
echo Checking SPP In IFEO [%_sppint%]
|
||||
)
|
||||
)
|
||||
|
||||
|
||||
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 (
|
||||
reg add "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\SoftwareProtectionPlatform" /v "SkipRearm" /t REG_DWORD /d "0" /f %nul%
|
||||
call :dk_color %Red% "Checking SkipRearm [Default 0 Value Not Found. Changing To 0]"
|
||||
%psc% "Start-Job { Stop-Service sppsvc -force } | Wait-Job -Timeout 10 | Out-Null"
|
||||
set error=1
|
||||
%psc% "Start-Job { Stop-Service sppsvc -force } | Wait-Job -Timeout 20 | Out-Null"
|
||||
)
|
||||
|
||||
|
||||
reg query "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\SoftwareProtectionPlatform\Plugins\Objects\msft:rm/algorithm/hwid/4.0" /f ba02fed39662 /d %nul% || (
|
||||
call :dk_color %Red% "Checking SPP Registry Key [Incorrect ModuleId Found]"
|
||||
set fixes=%fixes% %mas%issues_due_to_gaming_spoofers
|
||||
call :dk_color2 %Blue% "Possibly Caused By Gaming Spoofers. Help - " %_Yellow% " %mas%issues_due_to_gaming_spoofers"
|
||||
call :dk_color2 %Blue% "Most likely caused by gaming spoofers. Help - " %_Yellow% " %mas%issues_due_to_gaming_spoofers"
|
||||
set error=1
|
||||
set showfix=1
|
||||
)
|
||||
@@ -1391,28 +1463,31 @@ set "d=!d! $AclObject.SetSecurityDescriptorSddlForm($sddl);"
|
||||
set "d=!d! Set-Acl -Path %tokenstore% -AclObject $AclObject;"
|
||||
%psc% "!d!" %nul%
|
||||
if exist "%tokenstore%\" (
|
||||
call :dk_color %Gray% "Checking SPP Token Folder [Not Found. Created Now] [%tokenstore%\]"
|
||||
call :dk_color %Gray% "Checking SPP Token Folder [Not Found, Created Now] [%tokenstore%\]"
|
||||
) else (
|
||||
call :dk_color %Red% "Checking SPP Token Folder [Not Found. Failed To Create] [%tokenstore%\]"
|
||||
call :dk_color %Red% "Checking SPP Token Folder [Not Found, Failed to Create] [%tokenstore%\]"
|
||||
set error=1
|
||||
set showfix=1
|
||||
)
|
||||
)
|
||||
|
||||
|
||||
if not defined notwinact (
|
||||
call :dk_actid 55c92734-d682-4d71-983e-d6ec3f16059f
|
||||
if not defined apps (
|
||||
%psc% "Start-Job { Stop-Service sppsvc -force } | Wait-Job -Timeout 10 | Out-Null; $sls = Get-WmiObject SoftwareLicensingService; $f=[io.file]::ReadAllText('!_batp!') -split ':xrm\:.*';iex ($f[1]); ReinstallLicenses" %nul%
|
||||
%psc% "Start-Job { Stop-Service sppsvc -force } | Wait-Job -Timeout 20 | Out-Null; $sls = Get-WmiObject SoftwareLicensingService; $f=[io.file]::ReadAllText('!_batp!') -split ':xrm\:.*';iex ($f[1]); ReinstallLicenses" %nul%
|
||||
call :dk_actid 55c92734-d682-4d71-983e-d6ec3f16059f
|
||||
if not defined apps (
|
||||
set "_notfoundids=Key Not Installed / Act ID Not Found"
|
||||
call :dk_actids 55c92734-d682-4d71-983e-d6ec3f16059f
|
||||
if not defined allapps (
|
||||
set error=1
|
||||
set "_notfoundids=Not found"
|
||||
)
|
||||
set error=1
|
||||
call :dk_color %Red% "Checking Activation IDs [!_notfoundids!]"
|
||||
)
|
||||
)
|
||||
)
|
||||
|
||||
|
||||
if exist "%tokenstore%\" if not exist "%tokenstore%\tokens.dat" (
|
||||
@@ -1422,34 +1497,56 @@ call :dk_color %Red% "Checking SPP tokens.dat [Not Found] [%toke
|
||||
|
||||
|
||||
if %winbuild% GEQ 9200 if not exist "%SystemRoot%\Servicing\Packages\Microsoft-Windows-*EvalEdition~*.mum" (
|
||||
%psc% "Get-WmiObject -Query 'SELECT Description FROM SoftwareLicensingProduct WHERE PartialProductKey IS NOT NULL AND LicenseDependsOn IS NULL' | Select-Object -Property Description" %nul2% | findstr /i "KMS_" %nul1% || (
|
||||
for /f "delims=" %%a in ('%psc% "(Get-ScheduledTask -TaskName 'SvcRestartTask' -TaskPath '\Microsoft\Windows\SoftwareProtectionPlatform\').State" %nul6%') do (set taskinfo=%%a)
|
||||
echo !taskinfo! | find /i "Ready" %nul% || (
|
||||
reg delete "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\SoftwareProtectionPlatform" /v "actionlist" /f %nul%
|
||||
reg query "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Schedule\TaskCache\Tree\Microsoft\Windows\SoftwareProtectionPlatform\SvcRestartTask" %nul% || set taskinfo=Removed
|
||||
call :dk_color %Red% "Checking SvcRestartTask Status [!taskinfo!]"
|
||||
if "!taskinfo!"=="" set "taskinfo=Not Found"
|
||||
call :dk_color %Red% "Checking SvcRestartTask Status [!taskinfo!, System might deactivate later]"
|
||||
if not defined error call :dk_color %Blue% "Reboot your machine using the restart option."
|
||||
)
|
||||
)
|
||||
)
|
||||
|
||||
|
||||
:: This code checks if NT SERVICE\sppsvc has permission access to tokens folder and required registry keys. It's often caused by gaming spoofers.
|
||||
:: This code checks if SPP has permission access to tokens folder and required registry keys. It's often caused by gaming spoofers.
|
||||
|
||||
set permerror=
|
||||
if not exist "%tokenstore%\" set permerror=1
|
||||
if %winbuild% GEQ 9200 for %%# in (
|
||||
if %winbuild% GEQ 9200 if not defined ps32onArm (
|
||||
for %%# in (
|
||||
"%tokenstore%+FullControl"
|
||||
"HKLM:\SYSTEM\WPA+QueryValues, EnumerateSubKeys, WriteKey"
|
||||
"HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion\SoftwareProtectionPlatform+SetValue"
|
||||
) do for /f "tokens=1,2 delims=+" %%A in (%%#) do if not defined permerror (
|
||||
%psc% "$acl = (Get-Acl '%%A' | fl | Out-String); if (-not ($acl -match 'NT SERVICE\\sppsvc Allow %%B') -or ($acl -match 'NT SERVICE\\sppsvc Deny')) {Exit 2}" %nul%
|
||||
if !errorlevel!==2 set permerror=1
|
||||
if !errorlevel!==2 (
|
||||
if "%%A"=="%tokenstore%" (
|
||||
set "permerror=Error Found In Token Folder"
|
||||
) else (
|
||||
set "permerror=Error Found In SPP Registries"
|
||||
)
|
||||
)
|
||||
)
|
||||
|
||||
if %winbuild% GEQ 9200 if defined permerror (
|
||||
REM https://learn.microsoft.com/office/troubleshoot/activation/license-issue-when-start-office-application
|
||||
|
||||
if not defined permerror (
|
||||
reg query "HKU\S-1-5-20\Software\Microsoft\Windows NT\CurrentVersion" %nul% && (
|
||||
set "pol=HKU\S-1-5-20\Software\Microsoft\Windows NT\CurrentVersion\SoftwareProtectionPlatform\Policies"
|
||||
reg query "!pol!" %nul% || reg add "!pol!" %nul%
|
||||
%psc% "$netServ = (New-Object Security.Principal.SecurityIdentifier('S-1-5-20')).Translate([Security.Principal.NTAccount]).Value; $aclString = Get-Acl 'Registry::!pol!' | Format-List | Out-String; if (-not ($aclString.Contains($netServ + ' Allow FullControl') -or $aclString.Contains('NT SERVICE\sppsvc Allow FullControl')) -or ($aclString.Contains('Deny'))) {Exit 3}" %nul%
|
||||
if !errorlevel!==3 set "permerror=Error Found In S-1-5-20 SPP"
|
||||
)
|
||||
)
|
||||
|
||||
if defined permerror (
|
||||
set error=1
|
||||
call :dk_color %Red% "Checking SPP Permissions [Error Found]"
|
||||
call :dk_color %Red% "Checking SPP Permissions [!permerror!]"
|
||||
if not defined showfix call :dk_color %Blue% "%_fixmsg%"
|
||||
set showfix=1
|
||||
)
|
||||
)
|
||||
|
||||
|
||||
:: If required services are not disabled or corrupted + if there is any error + SoftwareLicensingService errorlevel is not Zero + no fix was shown before
|
||||
@@ -1492,7 +1589,7 @@ if ($osVersion.Build -ge $minBuildNumber) {
|
||||
}
|
||||
for ($i=1; $i -le $count; $i++) {
|
||||
if (-not $subkeyHashTable.ContainsKey("$i")) {
|
||||
Write-Output "Total Keys $count. Error Found- $i key does not exist"
|
||||
Write-Output "Total Keys $count. Error Found - $i key does not exist."
|
||||
$wpaKey.Close()
|
||||
exit
|
||||
}
|
||||
@@ -1503,7 +1600,7 @@ $wpaKey.GetSubKeyNames() | ForEach-Object {
|
||||
if ($PSVersionTable.PSVersion.Major -lt 3) {
|
||||
cmd /c "reg query "HKLM\SYSTEM\WPA\$_" /ve /t REG_BINARY >nul 2>&1"
|
||||
if ($LASTEXITCODE -ne 0) {
|
||||
Write-Host "Total Keys $count. Error Found- Binary Data is corrupt"
|
||||
Write-Host "Total Keys $count. Error Found - Binary Data is corrupt."
|
||||
$wpaKey.Close()
|
||||
exit
|
||||
}
|
||||
@@ -1511,7 +1608,7 @@ $wpaKey.GetSubKeyNames() | ForEach-Object {
|
||||
$subkey = $wpaKey.OpenSubKey($_)
|
||||
$p = $subkey.GetValueNames()
|
||||
if (($p | Where-Object { $subkey.GetValueKind($_) -eq [Microsoft.Win32.RegistryValueKind]::Binary }).Count -eq 0) {
|
||||
Write-Host "Total Keys $count. Error Found- Binary Data is corrupt"
|
||||
Write-Host "Total Keys $count. Error Found - Binary Data is corrupt."
|
||||
$wpaKey.Close()
|
||||
exit
|
||||
}
|
||||
@@ -1550,13 +1647,14 @@ echo:
|
||||
if %_unattended%==1 timeout /t 2 & exit /b
|
||||
|
||||
if defined fixes (
|
||||
call :dk_color2 %Blue% "Press [1] To Open Troubleshoot Page " %Gray% " Press [0] To Ignore"
|
||||
call :dk_color %White% "Follow ALL the ABOVE blue lines. "
|
||||
call :dk_color2 %Blue% "Press [1] to Open Support Webpage " %Gray% " Press [0] to Ignore"
|
||||
choice /C:10 /N
|
||||
if !errorlevel!==1 (for %%# in (%fixes%) do (start %%#))
|
||||
)
|
||||
|
||||
if defined terminal (
|
||||
call :dk_color %_Yellow% "Press 0 key to %_exitmsg%..."
|
||||
call :dk_color %_Yellow% "Press [0] key to %_exitmsg%..."
|
||||
choice /c 0 /n
|
||||
) else (
|
||||
call :dk_color %_Yellow% "Press any key to %_exitmsg%..."
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
@set masver=2.6
|
||||
@set masver=3.0
|
||||
@echo off
|
||||
|
||||
|
||||
@@ -30,7 +30,7 @@ set "_debug=0"
|
||||
|
||||
::========================================================================================================================================
|
||||
|
||||
:: Set Environment variables, it helps if they are misconfigured in the system
|
||||
:: Set environment variables, it helps if they are misconfigured in the system
|
||||
|
||||
setlocal EnableExtensions
|
||||
setlocal DisableDelayedExpansion
|
||||
@@ -47,26 +47,28 @@ set "Path=%SystemRoot%\Sysnative;%SystemRoot%;%SystemRoot%\Sysnative\Wbem;%Syste
|
||||
set "ComSpec=%SysPath%\cmd.exe"
|
||||
set "PSModulePath=%ProgramFiles%\WindowsPowerShell\Modules;%SysPath%\WindowsPowerShell\v1.0\Modules"
|
||||
|
||||
set re1=
|
||||
set re2=
|
||||
set "_cmdf=%~f0"
|
||||
for %%# in (%*) do (
|
||||
if /i "%%#"=="r1" set r1=1
|
||||
if /i "%%#"=="r2" set r2=1
|
||||
if /i "%%#"=="re1" set re1=1
|
||||
if /i "%%#"=="re2" set re2=1
|
||||
)
|
||||
|
||||
:: Re-launch the script with x64 process if it was initiated by x86 process on x64 bit Windows
|
||||
:: or with ARM64 process if it was initiated by x86/ARM32 process on ARM64 Windows
|
||||
|
||||
if exist %SystemRoot%\Sysnative\cmd.exe if not defined r1 (
|
||||
if exist %SystemRoot%\Sysnative\cmd.exe if not defined re1 (
|
||||
setlocal EnableDelayedExpansion
|
||||
start %SystemRoot%\Sysnative\cmd.exe /c ""!_cmdf!" %* r1"
|
||||
start %SystemRoot%\Sysnative\cmd.exe /c ""!_cmdf!" %* re1"
|
||||
exit /b
|
||||
)
|
||||
|
||||
:: Re-launch the script with ARM32 process if it was initiated by x64 process on ARM64 Windows
|
||||
|
||||
if exist %SystemRoot%\SysArm32\cmd.exe if %PROCESSOR_ARCHITECTURE%==AMD64 if not defined r2 (
|
||||
if exist %SystemRoot%\SysArm32\cmd.exe if %PROCESSOR_ARCHITECTURE%==AMD64 if not defined re2 (
|
||||
setlocal EnableDelayedExpansion
|
||||
start %SystemRoot%\SysArm32\cmd.exe /c ""!_cmdf!" %* r2"
|
||||
start %SystemRoot%\SysArm32\cmd.exe /c ""!_cmdf!" %* re2"
|
||||
exit /b
|
||||
)
|
||||
|
||||
@@ -110,7 +112,7 @@ echo:
|
||||
echo Null service is not running, script may crash...
|
||||
echo:
|
||||
echo:
|
||||
echo Help - %mas%troubleshoot
|
||||
echo Help - %mas%fix_service
|
||||
echo:
|
||||
echo:
|
||||
ping 127.0.0.1 -n 20
|
||||
@@ -146,6 +148,8 @@ set _unattended=0
|
||||
|
||||
set _args=%*
|
||||
if defined _args set _args=%_args:"=%
|
||||
if defined _args set _args=%_args:re1=%
|
||||
if defined _args set _args=%_args:re2=%
|
||||
if defined _args (
|
||||
for %%A in (%_args%) do (
|
||||
if /i "%%A"=="/KMS38" set _act=1
|
||||
@@ -163,16 +167,32 @@ set _k38=
|
||||
call :dk_setvar
|
||||
set "specific_kms=SOFTWARE\Microsoft\Windows NT\CurrentVersion\SoftwareProtectionPlatform\55c92734-d682-4d71-983e-d6ec3f16059f"
|
||||
|
||||
if %winbuild% EQU 1 (
|
||||
%eline%
|
||||
echo Failed to detect Windows build number.
|
||||
echo:
|
||||
setlocal EnableDelayedExpansion
|
||||
set fixes=%fixes% %mas%troubleshoot
|
||||
call :dk_color2 %Blue% "Help - " %_Yellow% " %mas%troubleshoot"
|
||||
goto dk_done
|
||||
)
|
||||
|
||||
if %winbuild% LSS 14393 (
|
||||
%eline%
|
||||
echo Unsupported OS version detected [%winbuild%].
|
||||
echo KMS38 Activation is supported for Windows 10/11/Server, build 14393 and later.
|
||||
echo KMS38 activation is only supported on Windows 10/11/Server, build 14393 and later.
|
||||
echo:
|
||||
if %winbuild% LSS 10240 (
|
||||
call :dk_color %Blue% "Use TSforge activation option from the main menu."
|
||||
) else (
|
||||
call :dk_color %Blue% "Use HWID activation option from the main menu."
|
||||
)
|
||||
goto dk_done
|
||||
)
|
||||
|
||||
::========================================================================================================================================
|
||||
|
||||
:: Fix special characters limitation in path name
|
||||
:: Fix special character limitations in path name
|
||||
|
||||
set "_work=%~dp0"
|
||||
if "%_work:~-1%"=="\" set "_work=%_work:~0,-1%"
|
||||
@@ -192,8 +212,8 @@ setlocal EnableDelayedExpansion
|
||||
echo "!_batf!" | find /i "!_ttemp!" %nul1% && (
|
||||
if /i not "!_work!"=="!_ttemp!" (
|
||||
%eline%
|
||||
echo Script is launched from the temp folder,
|
||||
echo Most likely you are running the script directly from the archive file.
|
||||
echo The script was launched from the temp folder.
|
||||
echo You are most likely running the script directly from the archive file.
|
||||
echo:
|
||||
echo Extract the archive file and launch the script from the extracted folder.
|
||||
goto dk_done
|
||||
@@ -204,22 +224,26 @@ goto dk_done
|
||||
|
||||
:: Check PowerShell
|
||||
|
||||
REM :PowerShellTest: $ExecutionContext.SessionState.LanguageMode :PowerShellTest:
|
||||
REM :PStest: $ExecutionContext.SessionState.LanguageMode :PStest:
|
||||
|
||||
cmd /c "%psc% "$f=[io.file]::ReadAllText('!_batp!') -split ':PowerShellTest:\s*';iex ($f[1])"" | find /i "FullLanguage" %nul1% || (
|
||||
cmd /c "%psc% "$f=[io.file]::ReadAllText('!_batp!') -split ':PStest:\s*';iex ($f[1])"" | find /i "FullLanguage" %nul1% || (
|
||||
%eline%
|
||||
cmd /c "%psc% "$ExecutionContext.SessionState.LanguageMode""
|
||||
echo:
|
||||
cmd /c "%psc% "$ExecutionContext.SessionState.LanguageMode"" | find /i "FullLanguage" %nul1% && (
|
||||
echo Failed to run Powershell command but Powershell is working.
|
||||
call :dk_color %Blue% "Check if your antivirus is blocking the script."
|
||||
) || (
|
||||
echo PowerShell is not working. Aborting...
|
||||
echo If you have applied restrictions on Powershell then undo those changes.
|
||||
)
|
||||
echo:
|
||||
cmd /c "%psc% ""$av = Get-WmiObject -Namespace root\SecurityCenter2 -Class AntiVirusProduct; $n = @(); foreach ($i in $av) { if ($i.displayName -notlike '*windows*') { $n += $i.displayName } }; if ($n) { Write-Host ('Installed 3rd party Antivirus might be blocking the script - ' + ($n -join ', ')) -ForegroundColor White -BackgroundColor Blue }"""
|
||||
echo:
|
||||
set fixes=%fixes% %mas%troubleshoot
|
||||
call :dk_color2 %Blue% "Help - " %_Yellow% " %mas%troubleshoot"
|
||||
) || (
|
||||
echo PowerShell is not working. Aborting...
|
||||
echo If you have applied restrictions on Powershell then undo those changes.
|
||||
echo:
|
||||
set fixes=%fixes% %mas%fix_powershell
|
||||
call :dk_color2 %Blue% "Help - " %_Yellow% " %mas%fix_powershell"
|
||||
)
|
||||
goto dk_done
|
||||
)
|
||||
|
||||
@@ -231,7 +255,7 @@ goto dk_done
|
||||
if not defined _elev %psc% "start cmd.exe -arg '/c \"!_PSarg!\"' -verb runas" && exit /b
|
||||
%eline%
|
||||
echo This script needs admin rights.
|
||||
echo To do so, right click on this script and select 'Run as administrator'.
|
||||
echo Right click on this script and select 'Run as administrator'.
|
||||
goto dk_done
|
||||
)
|
||||
|
||||
@@ -257,6 +281,7 @@ if defined terminal (
|
||||
%psc% "%d2%" %nul2% | find /i "True" %nul1% && set terminal=
|
||||
)
|
||||
|
||||
if defined ps32onArm goto :skipQE
|
||||
if %_unattended%==1 goto :skipQE
|
||||
for %%# in (%_args%) do (if /i "%%#"=="-qedit" goto :skipQE)
|
||||
|
||||
@@ -282,25 +307,29 @@ set "d4=$k=$t.CreateType(); $b=$k::SetConsoleMode($k::GetStdHandle(-10), 0x0080)
|
||||
|
||||
set -=
|
||||
set old=
|
||||
set upver=%masver:.=%
|
||||
|
||||
for /f "delims=[] tokens=2" %%# in ('ping -4 -n 1 updatecheck.mass%-%grave.dev') do (
|
||||
if not [%%#]==[] (echo "%%#" | find "127.69" %nul1% && (echo "%%#" | find "127.69.%masver%" %nul1% || set old=1))
|
||||
for /f "delims=[] tokens=2" %%# in ('ping -4 -n 1 activ%-%ated.win') do (
|
||||
if not "%%#"=="" set old=1
|
||||
for /f "delims=[] tokens=2" %%# in ('ping -4 -n 1 updatecheck%upver%.activ%-%ated.win') do (
|
||||
if not "%%#"=="" set old=
|
||||
)
|
||||
)
|
||||
|
||||
if defined old (
|
||||
echo ________________________________________________
|
||||
%eline%
|
||||
echo Version %masver% of MAS is outdated.
|
||||
echo Your version of MAS [%masver%] is outdated.
|
||||
echo ________________________________________________
|
||||
echo:
|
||||
if not %_unattended%==1 (
|
||||
echo [1] Get Latest MAS
|
||||
echo [0] Continue Anyway
|
||||
echo:
|
||||
call :dk_color %_Green% "Enter a menu option in the Keyboard [1,0] :"
|
||||
call :dk_color %_Green% "Choose a menu option using your keyboard [1,0] :"
|
||||
choice /C:10 /N
|
||||
if !errorlevel!==2 rem
|
||||
if !errorlevel!==1 (start ht%-%tps://github.com/mass%-%gravel/Microsoft-Acti%-%vation-Scripts & start %mas% & exit /b)
|
||||
if !errorlevel!==1 (start %mas% & exit /b)
|
||||
)
|
||||
)
|
||||
cls
|
||||
@@ -320,7 +349,7 @@ echo:
|
||||
echo:
|
||||
echo:
|
||||
echo:
|
||||
echo ____________________________________________________________
|
||||
echo: ______________________________________________________
|
||||
echo:
|
||||
echo [1] KMS38 Activation
|
||||
echo ____________________________________________
|
||||
@@ -328,9 +357,9 @@ echo:
|
||||
echo [2] Remove KM38 Protection
|
||||
echo:
|
||||
echo [0] %_exitmsg%
|
||||
echo ____________________________________________________________
|
||||
echo: ______________________________________________________
|
||||
echo:
|
||||
call :dk_color2 %_White% " " %_Green% "Enter a menu option in the Keyboard [1,2,0]"
|
||||
call :dk_color2 %_White% " " %_Green% "Choose a menu option using your keyboard [1,2,0]"
|
||||
choice /C:120 /N
|
||||
set _el=!errorlevel!
|
||||
if !_el!==3 exit /b
|
||||
@@ -360,7 +389,7 @@ if not exist %SysPath%\ClipUp.exe if not defined a_cor (set _fmiss=%_fmiss%ClipU
|
||||
|
||||
if defined _fmiss (
|
||||
%eline%
|
||||
echo [%_fmiss%] file is missing. Aborting...
|
||||
echo [%_fmiss%] file is missing, aborting...
|
||||
echo:
|
||||
set fixes=%fixes% %mas%troubleshoot
|
||||
call :dk_color2 %Blue% "Help - " %_Yellow% " %mas%troubleshoot"
|
||||
@@ -386,12 +415,12 @@ if defined _perm (
|
||||
cls
|
||||
echo ___________________________________________________________________________________________
|
||||
echo:
|
||||
call :dk_color2 %_White% " " %Green% "Checking: %winos% is Permanently Activated."
|
||||
call :dk_color2 %_White% " " %Green% "%winos% is already permanently activated."
|
||||
call :dk_color2 %_White% " " %Gray% "Activation is not required."
|
||||
echo ___________________________________________________________________________________________
|
||||
if %_unattended%==1 goto dk_done
|
||||
echo:
|
||||
choice /C:10 /N /M "> [1] Activate [0] %_exitmsg% : "
|
||||
choice /C:10 /N /M "> [1] Activate Anyway [0] %_exitmsg% : "
|
||||
if errorlevel 2 exit /b
|
||||
)
|
||||
cls
|
||||
@@ -416,10 +445,11 @@ echo Server Evaluation cannot be activated. Convert it to full Server OS.
|
||||
echo:
|
||||
call :dk_color %Blue% "Go Back to main menu and use [Change Edition] option."
|
||||
) else (
|
||||
echo Evaluation Editions cannot be activated outside of evaluation period.
|
||||
echo Evaluation editions cannot be activated outside of their evaluation period.
|
||||
call :dk_color %Blue% "Use TSforge activation option from the main menu to reset evaluation period."
|
||||
echo:
|
||||
set fixes=%fixes% %mas%evaluation-editions
|
||||
call :dk_color2 %Blue% "Help - " %_Yellow% " %mas%evaluation-editions"
|
||||
set fixes=%fixes% %mas%evaluation_editions
|
||||
call :dk_color2 %Blue% "Help - " %_Yellow% " %mas%evaluation_editions"
|
||||
)
|
||||
goto dk_done
|
||||
)
|
||||
@@ -432,11 +462,22 @@ goto dk_done
|
||||
if defined a_cor (
|
||||
if not exist "!_work!\clipup.exe" (
|
||||
%eline%
|
||||
echo clipup.exe doesn't exist in Server Cor/Acor [No GUI] version.
|
||||
echo It's required for KMS38 Activation.
|
||||
echo Check below page on how to activate it.
|
||||
set fixes=%fixes% %mas%kms38
|
||||
echo %mas%kms38
|
||||
echo clipup.exe doesn't exist in Server Cor/Acor [No GUI] versions.
|
||||
echo The file is required for KMS38 activation.
|
||||
echo Check the below page for instructions on how to activate it.
|
||||
call :dk_color2 %Blue% "Help - " %_Yellow% " %mas%kms38"
|
||||
goto dk_done
|
||||
)
|
||||
)
|
||||
|
||||
:: Check file signature
|
||||
|
||||
if defined a_cor (
|
||||
%psc% "if (-not (Get-AuthenticodeSignature -FilePath '!_work!\clipup.exe').IsOSBinary) {Exit 3}" %nul%
|
||||
if !errorlevel!==3 (
|
||||
%eline%
|
||||
echo Valid digital signature not found in clipup.exe file.
|
||||
call :dk_color2 %Blue% "Help - " %_Yellow% " %mas%troubleshoot"
|
||||
goto dk_done
|
||||
)
|
||||
)
|
||||
@@ -487,27 +528,38 @@ set /a UBR=0
|
||||
if %osSKU%==191 if defined altkey if defined altedition (
|
||||
for /f "skip=2 tokens=2*" %%a in ('reg query "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion" /v UBR %nul6%') do if not errorlevel 1 set /a UBR=%%b
|
||||
if %winbuild% LSS 22598 if !UBR! LSS 2788 (
|
||||
call :dk_color %Blue% "Windows must to be updated to build 19044.2788 or higher for IotEnterpriseS KMS38 activation."
|
||||
call :dk_color %Blue% "Windows must be updated to build 19044.2788 or higher for IotEnterpriseS KMS38 activation."
|
||||
)
|
||||
)
|
||||
|
||||
if not defined key if defined notfoundaltactID (
|
||||
call :dk_color %Red% "Checking Alternate Edition For KMS38 [%altedition% Activation ID Not Found]"
|
||||
call :dk_color %Red% "Checking Alternate Edition for KMS38 [%altedition% Activation ID Not Found]"
|
||||
)
|
||||
|
||||
if not defined key if not defined _gvlk (
|
||||
%eline%
|
||||
echo:
|
||||
echo [%winos% ^| %winbuild% ^| SKU:%osSKU%]
|
||||
if not defined skunotfound (
|
||||
echo This product does not support KMS38 Activation.
|
||||
echo Make sure you are using updated version of the script.
|
||||
set fixes=%fixes% %mas%
|
||||
echo %mas%
|
||||
) else (
|
||||
echo Required License files not found in %SysPath%\spp\tokens\skus\
|
||||
|
||||
if exist "%SysPath%\spp\tokens\skus\%osedition%\*GVLK*.xrm-ms" set sppks=1
|
||||
|
||||
if defined skunotfound (
|
||||
call :dk_color %Red% "Required license files not found in %SysPath%\spp\tokens\skus\"
|
||||
set fixes=%fixes% %mas%troubleshoot
|
||||
call :dk_color2 %Blue% "Help - " %_Yellow% " %mas%troubleshoot"
|
||||
)
|
||||
|
||||
if defined sppks (
|
||||
call :dk_color %Red% "KMS38 activation is supported but failed to find the key."
|
||||
set fixes=%fixes% %mas%troubleshoot
|
||||
call :dk_color2 %Blue% "Help - " %_Yellow% " %mas%troubleshoot"
|
||||
)
|
||||
|
||||
if not defined skunotfound if not defined sppks (
|
||||
call :dk_color %Red% "This product does not support KMS38 activation."
|
||||
call :dk_color %Blue% "Use TSforge activation option from the main menu."
|
||||
set fixes=%fixes% %mas%
|
||||
echo %mas%
|
||||
)
|
||||
echo:
|
||||
goto dk_done
|
||||
)
|
||||
@@ -518,12 +570,12 @@ goto dk_done
|
||||
|
||||
echo:
|
||||
if defined changekey (
|
||||
call :dk_color %Blue% "[%altedition%] Edition product key will be used to enable KMS38 activation."
|
||||
call :dk_color %Blue% "[%altedition%] edition product key will be used to enable KMS38 activation."
|
||||
echo:
|
||||
)
|
||||
|
||||
if defined winsub (
|
||||
call :dk_color %Blue% "Windows Subscription [SKU ID-%slcSKU%] found. Script will activate base edition [SKU ID-%regSKU%]."
|
||||
call :dk_color %Blue% "Windows Subscription edition [SKU ID-%slcSKU%] found. Script will activate the base edition [SKU ID-%regSKU%]."
|
||||
echo:
|
||||
)
|
||||
|
||||
@@ -620,7 +672,7 @@ set "sessionId=TwBTAE0AYQBqAG8AcgBWAGUAcgBzAGkAbwBuAD0ANQA7AE8AUwBNAGkAbgBvAHIAV
|
||||
copy /y /b "%tdir%\GenuineTicket" "%tdir%\GenuineTicket.xml" %nul%
|
||||
|
||||
if not exist "%tdir%\GenuineTicket.xml" (
|
||||
call :dk_color %Red% "Generating GenuineTicket.xml [Failed, aborting the process]"
|
||||
call :dk_color %Red% "Generating GenuineTicket.xml [Failed, aborting...]"
|
||||
if exist "%tdir%\Genuine*" del /f /q "%tdir%\Genuine*" %nul%
|
||||
goto :k_final
|
||||
) else (
|
||||
@@ -631,7 +683,7 @@ set "_xmlexist=if exist "%tdir%\GenuineTicket.xml""
|
||||
|
||||
:: Stop sppsvc
|
||||
|
||||
%psc% "Start-Job { Stop-Service sppsvc -force } | Wait-Job -Timeout 10 | Out-Null"
|
||||
%psc% "Start-Job { Stop-Service sppsvc -force } | Wait-Job -Timeout 20 | Out-Null"
|
||||
|
||||
sc query sppsvc | find /i "STOPPED" %nul% && (
|
||||
echo Stopping sppsvc Service [Successful]
|
||||
@@ -640,14 +692,14 @@ call :dk_color %Gray% "Stopping sppsvc Service [Failed]"
|
||||
)
|
||||
|
||||
%_xmlexist% (
|
||||
%psc% "Start-Job { Restart-Service ClipSVC } | Wait-Job -Timeout 10 | Out-Null"
|
||||
%psc% "Start-Job { Restart-Service ClipSVC } | Wait-Job -Timeout 20 | Out-Null"
|
||||
%_xmlexist% timeout /t 2 %nul%
|
||||
%_xmlexist% timeout /t 2 %nul%
|
||||
|
||||
%_xmlexist% (
|
||||
set error=1
|
||||
if exist "%tdir%\*.xml" del /f /q "%tdir%\*.xml" %nul%
|
||||
call :dk_color %Red% "Installing GenuineTicket.xml [Failed With ClipSVC Service Restart, Wait...]"
|
||||
call :dk_color %Gray% "Installing GenuineTicket.xml [Failed with ClipSVC service restart, wait...]"
|
||||
)
|
||||
)
|
||||
|
||||
@@ -723,16 +775,16 @@ call :dk_color2 %Blue% "Help - " %_Yellow% " %mas%troubleshoot"
|
||||
|
||||
:k_final
|
||||
|
||||
:: Remove the added Specific KMS Host (Local Host) if activation is not completed
|
||||
:: Remove the specific KMS host (LocalHost) added by the script if activation is not completed
|
||||
|
||||
echo:
|
||||
if not defined _k38 (
|
||||
%nul% reg delete "HKLM\%specific_kms%" /f
|
||||
%nul% reg delete "HKU\S-1-5-20\%specific_kms%" /f
|
||||
%nul% reg query "HKLM\%specific_kms%" && (
|
||||
call :dk_color %Red% "Removing The Added Specific KMS Host [Failed]"
|
||||
call :dk_color %Red% "Removing the Added Specific KMS Host [Failed]"
|
||||
) || (
|
||||
echo Removing The Added Specific KMS Host [Successful]
|
||||
echo Removing the Added Specific KMS Host [Successful]
|
||||
)
|
||||
)
|
||||
|
||||
@@ -742,9 +794,9 @@ if defined _k38 (
|
||||
%psc% "$f=[io.file]::ReadAllText('!_batp!') -split ':regdel\:.*';& ([ScriptBlock]::Create($f[1])) -protect"
|
||||
%nul% reg delete "HKLM\%specific_kms%" /f
|
||||
%nul% reg query "HKLM\%specific_kms%" && (
|
||||
echo Protect KMS38 From KMS [Successful] [Locked A Registry Key]
|
||||
echo Protect KMS38 From KMS [Successful] [Locked a Registry Key]
|
||||
) || (
|
||||
call :dk_color %Red% "Protect KMS38 From KMS [Failed To Lock A Registry Key]"
|
||||
call :dk_color %Red% "Protect KMS38 From KMS [Failed to Lock a Registry Key]"
|
||||
)
|
||||
)
|
||||
|
||||
@@ -754,9 +806,9 @@ if defined a_cor if exist "%_clipup%" del /f /q "%_clipup%" %nul%
|
||||
|
||||
if defined a_cor (
|
||||
if exist "%_clipup%" (
|
||||
call :dk_color %Red% "Deleting copied clipup.exe file [Failed]"
|
||||
call :dk_color %Red% "Deleting Copied clipup.exe File [Failed]"
|
||||
) else (
|
||||
echo Deleting copied clipup.exe file [Successful]
|
||||
echo Deleting Copied clipup.exe File [Successful]
|
||||
)
|
||||
)
|
||||
|
||||
@@ -840,12 +892,16 @@ set _NCS=1
|
||||
if %winbuild% LSS 10586 set _NCS=0
|
||||
if %winbuild% GEQ 10586 reg query "HKCU\Console" /v ForceV2 %nul2% | find /i "0x0" %nul1% && (set _NCS=0)
|
||||
|
||||
echo "%PROCESSOR_ARCHITECTURE% %PROCESSOR_ARCHITEW6432%" | find /i "ARM64" %nul1% && (if %winbuild% LSS 21277 set ps32onArm=1)
|
||||
|
||||
if %_NCS% EQU 1 (
|
||||
for /F %%a in ('echo prompt $E ^| cmd') do set "esc=%%a"
|
||||
set "Red="41;97m""
|
||||
set "Gray="100;97m""
|
||||
set "Green="42;97m""
|
||||
set "Blue="44;97m""
|
||||
set "White="107;91m""
|
||||
set "_Red="40;91m""
|
||||
set "_White="40;37m""
|
||||
set "_Green="40;92m""
|
||||
set "_Yellow="40;93m""
|
||||
@@ -854,6 +910,8 @@ set "Red="Red" "white""
|
||||
set "Gray="Darkgray" "white""
|
||||
set "Green="DarkGreen" "white""
|
||||
set "Blue="Blue" "white""
|
||||
set "White="White" "Red""
|
||||
set "_Red="Black" "Red""
|
||||
set "_White="Black" "Gray""
|
||||
set "_Green="Black" "Green""
|
||||
set "_Yellow="Black" "Yellow""
|
||||
@@ -1045,7 +1103,7 @@ reg delete "%ruleskey%" /v "SuppressRulesEngine" /f %nul%
|
||||
set r1=$TB = [AppDomain]::CurrentDomain.DefineDynamicAssembly(4, 1).DefineDynamicModule(2, $False).DefineType(0);
|
||||
set r2=%r1% [void]$TB.DefinePInvokeMethod('SLpTriggerServiceWorker', 'sppc.dll', 22, 1, [Int32], @([UInt32], [IntPtr], [String], [UInt32]), 1, 3);
|
||||
set d1=%r2% [void]$TB.CreateType()::SLpTriggerServiceWorker(0, 0, 'reeval', 0)
|
||||
%psc% "Start-Job { Stop-Service sppsvc -force } | Wait-Job -Timeout 10 | Out-Null; %d1%"
|
||||
%psc% "Start-Job { Stop-Service sppsvc -force } | Wait-Job -Timeout 20 | Out-Null; %d1%"
|
||||
exit /b
|
||||
|
||||
:: Install License files using Powershell/WMI instead of slmgr.vbs
|
||||
@@ -1079,7 +1137,7 @@ function ReinstallLicenses() {
|
||||
|
||||
set _wmic=0
|
||||
for %%# in (wmic.exe) do @if not "%%~$PATH:#"=="" (
|
||||
wmic path Win32_ComputerSystem get CreationClassName /value %nul2% | find /i "computersystem" %nul1% && set _wmic=1
|
||||
cmd /c "wmic path Win32_ComputerSystem get CreationClassName /value" %nul2% | find /i "computersystem" %nul1% && set _wmic=1
|
||||
)
|
||||
exit /b
|
||||
|
||||
@@ -1096,7 +1154,7 @@ echo sc start sppsvc [Error Code: %spperror%]
|
||||
)
|
||||
|
||||
echo:
|
||||
%psc% "$job = Start-Job { (Get-WmiObject -Query 'SELECT * FROM %sps%').Version }; if (-not (Wait-Job $job -Timeout 20)) {write-host 'sppsvc is not working correctly. Help - %mas%troubleshoot'}"
|
||||
%psc% "$job = Start-Job { (Get-WmiObject -Query 'SELECT * FROM %sps%').Version }; if (-not (Wait-Job $job -Timeout 30)) {write-host 'sppsvc is not working correctly. Help - %mas%troubleshoot'}"
|
||||
exit /b
|
||||
|
||||
:: Get Product name (WMI/REG methods are not reliable in all conditions, hence winbrand.dll method is used)
|
||||
@@ -1179,7 +1237,7 @@ for %%# in (pkeyhelper.dll) do @if "%%~$PATH:#"=="" exit /b
|
||||
for %%# in (Volume:GVLK) do (
|
||||
call :k_pkey %osSKU% '%%#'
|
||||
if defined pkey call :k_pkeychannel !pkey!
|
||||
if /i [!pkeychannel!]==[%%#] (
|
||||
if /i "!pkeychannel!"=="%%#" (
|
||||
set key=!pkey!
|
||||
exit /b
|
||||
)
|
||||
@@ -1195,36 +1253,38 @@ exit /b
|
||||
|
||||
set w=
|
||||
set results=
|
||||
if exist "%ProgramFiles%\KM%w%Spico" set pupfound1= KM%w%Spico
|
||||
if exist "%SysPath%\Tasks\R@1n-KMS" set pupfound2= R@inKMS
|
||||
reg query "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Schedule\taskcache\tasks" /f Path /s | find /i "AutoPico" %nul% && set pupfound1= KM%w%Spico
|
||||
reg query "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Schedule\taskcache\tasks" /f Path /s | find /i "R@1n" %nul% && set pupfound2= R@inKMS
|
||||
set pupfound=%pupfound1%%pupfound2%
|
||||
if exist "%ProgramFiles%\KM%w%Spico" set pupfound= KM%w%Spico
|
||||
if not defined pupfound (
|
||||
reg query "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Schedule\taskcache\tasks" /f Path /s | find /i "AutoPico" %nul% && set pupfound= KM%w%Spico
|
||||
)
|
||||
|
||||
set hcount=0
|
||||
for %%# in (avira.com kaspersky.com virustotal.com mcafee.com) do (
|
||||
find /i "%%#" %SysPath%\drivers\etc\hosts %nul% && set /a hcount+=1)
|
||||
if %hcount%==4 set "results=[AV URLs are blocked in hosts]"
|
||||
|
||||
set wucount=0
|
||||
for %%# in (wuauserv) do (
|
||||
set _corrupt=
|
||||
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 & set /a wucount+=1)
|
||||
)
|
||||
)
|
||||
if %wucount% GEQ 1 set "results=%results%[WU registry is corrupt]"
|
||||
if %hcount%==4 set "results=[Antivirus URLs are blocked in hosts]"
|
||||
|
||||
sc start sppsvc %nul%
|
||||
echo "%errorlevel%" | findstr "577 225" %nul% && set "results=%results%[Likely File Infector]"
|
||||
echo "%errorlevel%" | findstr "577 225" %nul% && (
|
||||
set "results=%results%[Likely File Infector]"
|
||||
) || (
|
||||
if not exist %SysPath%\sppsvc.exe if not exist %SysPath%\alg.exe (set "results=%results%[Likely File Infector]")
|
||||
)
|
||||
|
||||
if not "%results%%pupfound%"=="" (
|
||||
if defined pupfound call :dk_color %Gray% "Checking PUP Activators [Found%pupfound%]"
|
||||
if defined results call :dk_color %Red% "Checking Probable Mal%w%ware Infection %results%"
|
||||
if defined results call :dk_color %Red% "Checking Probable Mal%w%ware Infection..."
|
||||
if defined results call :dk_color %Red% "%results%"
|
||||
set fixes=%fixes% %mas%remove_mal%w%ware
|
||||
call :dk_color2 %Blue% "Help - " %_Yellow% " %mas%remove_mal%w%ware"
|
||||
echo:
|
||||
)
|
||||
|
||||
:: Remove the scheduled task of R@1n-KMS (old version) that runs the activation command every minute, as it leads to high CPU usage.
|
||||
|
||||
if exist %SysPath%\Tasks\R@1n-KMS (
|
||||
for /f %%A in ('dir /b /a:-d %SysPath%\Tasks\R@1n-KMS %nul6%') do (schtasks /delete /tn \R@1n-KMS\%%A /f %nul%)
|
||||
)
|
||||
|
||||
exit /b
|
||||
|
||||
::========================================================================================================================================
|
||||
@@ -1234,6 +1294,18 @@ exit /b
|
||||
set showfix=
|
||||
call :dk_chkmal
|
||||
|
||||
:: Check Sandboxing
|
||||
|
||||
sc query Null %nul% || (
|
||||
set error=1
|
||||
set showfix=1
|
||||
call :dk_color %Red% "Checking Sandboxing [Found, script may not work properly.]"
|
||||
call :dk_color %Blue% "If you are using any third-party antivirus, check if it is blocking the script."
|
||||
echo:
|
||||
)
|
||||
|
||||
::========================================================================================================================================
|
||||
|
||||
:: Check corrupt services
|
||||
|
||||
set serv_cor=
|
||||
@@ -1251,6 +1323,7 @@ if defined _corrupt (if defined serv_cor (set "serv_cor=!serv_cor! %%#") else (s
|
||||
|
||||
if defined serv_cor (
|
||||
set error=1
|
||||
set showfix=1
|
||||
call :dk_color %Red% "Checking Corrupt Services [%serv_cor%]"
|
||||
)
|
||||
|
||||
@@ -1303,7 +1376,7 @@ set errorcode=
|
||||
set checkerror=
|
||||
|
||||
sc query %%# | find /i "RUNNING" %nul% || (
|
||||
%psc% "Start-Job { Start-Service %%# } | Wait-Job -Timeout 10 | Out-Null"
|
||||
%psc% "Start-Job { Start-Service %%# } | Wait-Job -Timeout 20 | Out-Null"
|
||||
set errorcode=!errorlevel!
|
||||
sc query %%# | find /i "RUNNING" %nul% || set checkerror=1
|
||||
)
|
||||
@@ -1317,7 +1390,12 @@ if defined serv_e (
|
||||
set error=1
|
||||
call :dk_color %Red% "Starting Services [Failed] [%serv_e%]"
|
||||
echo %serv_e% | findstr /i "ClipSVC-1058 sppsvc-1058" %nul% && (
|
||||
call :dk_color %Blue% "Restart the system to fix this error."
|
||||
call :dk_color %Blue% "Reboot your machine using the restart option to fix this error."
|
||||
set showfix=1
|
||||
)
|
||||
echo %serv_e% | findstr /i "sppsvc-1060" %nul% && (
|
||||
set fixes=%fixes% %mas%fix_service
|
||||
call :dk_color2 %Blue% "Help - " %_Yellow% " %mas%fix_service"
|
||||
set showfix=1
|
||||
)
|
||||
)
|
||||
@@ -1333,14 +1411,21 @@ call :dk_color2 %Red% "Checking Boot Mode [%safeboot_option
|
||||
)
|
||||
|
||||
|
||||
:: https://learn.microsoft.com/windows-hardware/manufacture/desktop/windows-setup-states
|
||||
|
||||
for /f "skip=2 tokens=2*" %%A in ('reg query "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Setup\State" /v ImageState') do (set imagestate=%%B)
|
||||
|
||||
if /i not "%imagestate%"=="IMAGE_STATE_COMPLETE" (
|
||||
set error=1
|
||||
call :dk_color %Red% "Checking Windows Setup State [%imagestate%]"
|
||||
call :dk_color %Gray% "Checking Windows Setup State [%imagestate%]"
|
||||
echo "%imagestate%" | find /i "RESEAL" %nul% && (
|
||||
set error=1
|
||||
set showfix=1
|
||||
call :dk_color %Blue% "You need to run it in normal mode in case you are running it in Audit Mode."
|
||||
)
|
||||
echo "%imagestate%" | find /i "UNDEPLOYABLE" %nul% && (
|
||||
set fixes=%fixes% %mas%in-place_repair_upgrade
|
||||
call :dk_color2 %Blue% "If the activation fails, do this - " %_Yellow% " %mas%in-place_repair_upgrade"
|
||||
)
|
||||
)
|
||||
|
||||
|
||||
@@ -1357,24 +1442,27 @@ for /f "delims=" %%a in ('%psc% "$f=[io.file]::ReadAllText('!_batp!') -split ':w
|
||||
echo "%wpainfo%" | find /i "Error Found" %nul% && (
|
||||
set error=1
|
||||
set wpaerror=1
|
||||
call :dk_color %Red% "Checking WPA Registry Error [%wpainfo%]"
|
||||
call :dk_color %Red% "Checking WPA Registry Errors [%wpainfo%]"
|
||||
) || (
|
||||
echo Checking WPA Registry Count [%wpainfo%]
|
||||
)
|
||||
|
||||
|
||||
if not defined officeact if exist "%SystemRoot%\Servicing\Packages\Microsoft-Windows-*EvalEdition~*.mum" (
|
||||
if not defined notwinact if exist "%SystemRoot%\Servicing\Packages\Microsoft-Windows-*EvalEdition~*.mum" (
|
||||
reg query "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion" /v EditionID %nul2% | find /i "Eval" %nul1% || (
|
||||
set error=1
|
||||
call :dk_color %Red% "Checking Eval Packages [Non-Eval Licenses are installed in Eval Windows]"
|
||||
set fixes=%fixes% %mas%evaluation-editions
|
||||
call :dk_color2 %Blue% "Help - " %_Yellow% " %mas%evaluation-editions"
|
||||
set fixes=%fixes% %mas%evaluation_editions
|
||||
call :dk_color2 %Blue% "Help - " %_Yellow% " %mas%evaluation_editions"
|
||||
)
|
||||
)
|
||||
|
||||
|
||||
set osedition=0
|
||||
for /f "skip=2 tokens=3" %%a in ('reg query "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion" /v EditionID %nul6%') do set "osedition=%%a"
|
||||
if %_wmic% EQU 1 set "chkedi=for /f "tokens=2 delims==" %%a in ('"wmic path %spp% where (ApplicationID='55c92734-d682-4d71-983e-d6ec3f16059f' AND LicenseDependsOn is NULL AND PartialProductKey IS NOT NULL) get LicenseFamily /VALUE" %nul6%')"
|
||||
if %_wmic% EQU 0 set "chkedi=for /f "tokens=2 delims==" %%a in ('%psc% "(([WMISEARCHER]'SELECT LicenseFamily FROM %spp% WHERE ApplicationID=''55c92734-d682-4d71-983e-d6ec3f16059f'' AND LicenseDependsOn is NULL AND PartialProductKey IS NOT NULL').Get()).LicenseFamily ^| %% {echo ('LicenseFamily='+$_)}" %nul6%')"
|
||||
%chkedi% do if not errorlevel 1 (call set "osedition=%%a")
|
||||
|
||||
if %osedition%==0 for /f "skip=2 tokens=3" %%a in ('reg query "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion" /v EditionID %nul6%') do set "osedition=%%a"
|
||||
|
||||
:: Workaround for an issue in builds between 1607 and 1709 where ProfessionalEducation is shown as Professional
|
||||
|
||||
@@ -1383,20 +1471,18 @@ if "%osSKU%"=="164" set osedition=ProfessionalEducation
|
||||
if "%osSKU%"=="165" set osedition=ProfessionalEducationN
|
||||
)
|
||||
|
||||
if not defined officeact (
|
||||
if not defined notwinact (
|
||||
if %osedition%==0 (
|
||||
call :dk_color %Red% "Checking Edition Name [Not Found In Registry]"
|
||||
) else (
|
||||
|
||||
if not exist "%SysPath%\spp\tokens\skus\%osedition%\%osedition%*.xrm-ms" if not exist "%SysPath%\spp\tokens\skus\Security-SPP-Component-SKU-%osedition%\*-%osedition%-*.xrm-ms" (
|
||||
set error=1
|
||||
set skunotfound=1
|
||||
call :dk_color %Red% "Checking License Files [Not Found] [%osedition%]"
|
||||
)
|
||||
|
||||
if not exist "%SystemRoot%\Servicing\Packages\Microsoft-Windows-*-%osedition%-*.mum" (
|
||||
set error=1
|
||||
call :dk_color %Red% "Checking Package File [Not Found] [%osedition%]"
|
||||
call :dk_color %Red% "Checking Package Files [Not Found] [%osedition%]"
|
||||
)
|
||||
)
|
||||
)
|
||||
@@ -1417,16 +1503,16 @@ if %_wmic% EQU 1 wmic path Win32_ComputerSystem get CreationClassName /value %nu
|
||||
if %_wmic% EQU 0 %psc% "Get-WmiObject -Class Win32_ComputerSystem | Select-Object -Property CreationClassName" %nul2% | find /i "computersystem" %nul1%
|
||||
|
||||
if %errorlevel% NEQ 0 set wmifailed=1
|
||||
echo "%error_code%" | findstr /i "0x800410 0x800440" %nul1% && set wmifailed=1& :: https://learn.microsoft.com/en-us/windows/win32/wmisdk/wmi-error-constants
|
||||
echo "%error_code%" | findstr /i "0x800410 0x800440 0x80131501" %nul1% && set wmifailed=1& :: https://learn.microsoft.com/en-us/windows/win32/wmisdk/wmi-error-constants
|
||||
if defined wmifailed (
|
||||
set error=1
|
||||
call :dk_color %Red% "Checking WMI [Not Working]"
|
||||
call :dk_color %Blue% "Go back to Main Menu, select Troubleshoot and run Fix WMI option."
|
||||
if not defined showfix call :dk_color %Blue% "Go back to Main Menu, select Troubleshoot and run Fix WMI option."
|
||||
set showfix=1
|
||||
)
|
||||
|
||||
|
||||
if not defined officeact (
|
||||
if not defined notwinact (
|
||||
if %winbuild% GEQ 10240 (
|
||||
%nul% set /a "sum=%slcSKU%+%regSKU%+%wmiSKU%"
|
||||
set /a "sum/=3"
|
||||
@@ -1459,47 +1545,44 @@ call :dk_color2 %Red% "Checking ClipSVC " %Blue% "[System
|
||||
:: This "WLMS" service was included in previous Eval editions (which were activable) to automatically shut down the system every hour after the evaluation period expired and prevent SPPSVC from stopping.
|
||||
|
||||
if exist "%SysPath%\wlms\wlms.exe" (
|
||||
sc query wlms | find /i "RUNNING" %nul% && (
|
||||
echo Checking Eval WLMS Service [Found]
|
||||
)
|
||||
)
|
||||
|
||||
|
||||
reg query "HKU\S-1-5-20" %nul% && (
|
||||
if %winbuild% GEQ 15063 reg query "HKU\S-1-5-20\Software\Microsoft\Windows NT\CurrentVersion\SoftwareProtectionPlatform" %nul% || (
|
||||
reg query "HKU\S-1-5-20\Software\Microsoft\Windows NT\CurrentVersion" %nul% || (
|
||||
set error=1
|
||||
call :dk_color %Red% "Checking S-1-5-20 SPP Reg [Not Found]"
|
||||
set fixes=%fixes% %mas%troubleshoot
|
||||
call :dk_color2 %Blue% "Help - " %_Yellow% " %mas%troubleshoot"
|
||||
)
|
||||
) || (
|
||||
set error=1
|
||||
call :dk_color %Red% "Checking HKU\S-1-5-20 Reg [Not Found]"
|
||||
set fixes=%fixes% %mas%troubleshoot
|
||||
call :dk_color2 %Blue% "Help - " %_Yellow% " %mas%troubleshoot"
|
||||
set showfix=1
|
||||
call :dk_color %Red% "Checking HKU\S-1-5-20 Registry [Not Found]"
|
||||
set fixes=%fixes% %mas%in-place_repair_upgrade
|
||||
call :dk_color2 %Blue% "In case of activation issues, do this - " %_Yellow% " %mas%in-place_repair_upgrade"
|
||||
)
|
||||
|
||||
|
||||
for %%# in (SppEx%w%tComObj.exe sppsvc.exe) do (
|
||||
for %%# in (SppEx%w%tComObj.exe sppsvc.exe sppsvc.exe\PerfOptions) do (
|
||||
reg query "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Ima%w%ge File Execu%w%tion Options\%%#" %nul% && (if defined _sppint (set "_sppint=!_sppint!, %%#") else (set "_sppint=%%#"))
|
||||
)
|
||||
if defined _sppint (
|
||||
echo Checking SPP Interference In IFEO [%_sppint%]
|
||||
echo %_sppint% | find /i "PerfOptions" %nul% && (
|
||||
call :dk_color %Red% "Checking SPP Interference In IFEO [%_sppint% - System might deactivate later]"
|
||||
if not defined showfix call :dk_color %Blue% "%_fixmsg%"
|
||||
set showfix=1
|
||||
) || (
|
||||
echo Checking SPP In IFEO [%_sppint%]
|
||||
)
|
||||
)
|
||||
|
||||
|
||||
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 (
|
||||
reg add "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\SoftwareProtectionPlatform" /v "SkipRearm" /t REG_DWORD /d "0" /f %nul%
|
||||
call :dk_color %Red% "Checking SkipRearm [Default 0 Value Not Found. Changing To 0]"
|
||||
%psc% "Start-Job { Stop-Service sppsvc -force } | Wait-Job -Timeout 10 | Out-Null"
|
||||
set error=1
|
||||
%psc% "Start-Job { Stop-Service sppsvc -force } | Wait-Job -Timeout 20 | Out-Null"
|
||||
)
|
||||
|
||||
|
||||
reg query "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\SoftwareProtectionPlatform\Plugins\Objects\msft:rm/algorithm/hwid/4.0" /f ba02fed39662 /d %nul% || (
|
||||
call :dk_color %Red% "Checking SPP Registry Key [Incorrect ModuleId Found]"
|
||||
set fixes=%fixes% %mas%issues_due_to_gaming_spoofers
|
||||
call :dk_color2 %Blue% "Possibly Caused By Gaming Spoofers. Help - " %_Yellow% " %mas%issues_due_to_gaming_spoofers"
|
||||
call :dk_color2 %Blue% "Most likely caused by gaming spoofers. Help - " %_Yellow% " %mas%issues_due_to_gaming_spoofers"
|
||||
set error=1
|
||||
set showfix=1
|
||||
)
|
||||
@@ -1529,28 +1612,31 @@ set "d=!d! $AclObject.SetSecurityDescriptorSddlForm($sddl);"
|
||||
set "d=!d! Set-Acl -Path %tokenstore% -AclObject $AclObject;"
|
||||
%psc% "!d!" %nul%
|
||||
if exist "%tokenstore%\" (
|
||||
call :dk_color %Gray% "Checking SPP Token Folder [Not Found. Created Now] [%tokenstore%\]"
|
||||
call :dk_color %Gray% "Checking SPP Token Folder [Not Found, Created Now] [%tokenstore%\]"
|
||||
) else (
|
||||
call :dk_color %Red% "Checking SPP Token Folder [Not Found. Failed To Create] [%tokenstore%\]"
|
||||
call :dk_color %Red% "Checking SPP Token Folder [Not Found, Failed to Create] [%tokenstore%\]"
|
||||
set error=1
|
||||
set showfix=1
|
||||
)
|
||||
)
|
||||
|
||||
|
||||
if not defined notwinact (
|
||||
call :dk_actid 55c92734-d682-4d71-983e-d6ec3f16059f
|
||||
if not defined apps (
|
||||
%psc% "Start-Job { Stop-Service sppsvc -force } | Wait-Job -Timeout 10 | Out-Null; $sls = Get-WmiObject SoftwareLicensingService; $f=[io.file]::ReadAllText('!_batp!') -split ':xrm\:.*';iex ($f[1]); ReinstallLicenses" %nul%
|
||||
%psc% "Start-Job { Stop-Service sppsvc -force } | Wait-Job -Timeout 20 | Out-Null; $sls = Get-WmiObject SoftwareLicensingService; $f=[io.file]::ReadAllText('!_batp!') -split ':xrm\:.*';iex ($f[1]); ReinstallLicenses" %nul%
|
||||
call :dk_actid 55c92734-d682-4d71-983e-d6ec3f16059f
|
||||
if not defined apps (
|
||||
set "_notfoundids=Key Not Installed / Act ID Not Found"
|
||||
call :dk_actids 55c92734-d682-4d71-983e-d6ec3f16059f
|
||||
if not defined allapps (
|
||||
set error=1
|
||||
set "_notfoundids=Not found"
|
||||
)
|
||||
set error=1
|
||||
call :dk_color %Red% "Checking Activation IDs [!_notfoundids!]"
|
||||
)
|
||||
)
|
||||
)
|
||||
|
||||
|
||||
if exist "%tokenstore%\" if not exist "%tokenstore%\tokens.dat" (
|
||||
@@ -1560,34 +1646,56 @@ call :dk_color %Red% "Checking SPP tokens.dat [Not Found] [%toke
|
||||
|
||||
|
||||
if %winbuild% GEQ 9200 if not exist "%SystemRoot%\Servicing\Packages\Microsoft-Windows-*EvalEdition~*.mum" (
|
||||
%psc% "Get-WmiObject -Query 'SELECT Description FROM SoftwareLicensingProduct WHERE PartialProductKey IS NOT NULL AND LicenseDependsOn IS NULL' | Select-Object -Property Description" %nul2% | findstr /i "KMS_" %nul1% || (
|
||||
for /f "delims=" %%a in ('%psc% "(Get-ScheduledTask -TaskName 'SvcRestartTask' -TaskPath '\Microsoft\Windows\SoftwareProtectionPlatform\').State" %nul6%') do (set taskinfo=%%a)
|
||||
echo !taskinfo! | find /i "Ready" %nul% || (
|
||||
reg delete "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\SoftwareProtectionPlatform" /v "actionlist" /f %nul%
|
||||
reg query "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Schedule\TaskCache\Tree\Microsoft\Windows\SoftwareProtectionPlatform\SvcRestartTask" %nul% || set taskinfo=Removed
|
||||
call :dk_color %Red% "Checking SvcRestartTask Status [!taskinfo!]"
|
||||
if "!taskinfo!"=="" set "taskinfo=Not Found"
|
||||
call :dk_color %Red% "Checking SvcRestartTask Status [!taskinfo!, System might deactivate later]"
|
||||
if not defined error call :dk_color %Blue% "Reboot your machine using the restart option."
|
||||
)
|
||||
)
|
||||
)
|
||||
|
||||
|
||||
:: This code checks if NT SERVICE\sppsvc has permission access to tokens folder and required registry keys. It's often caused by gaming spoofers.
|
||||
:: This code checks if SPP has permission access to tokens folder and required registry keys. It's often caused by gaming spoofers.
|
||||
|
||||
set permerror=
|
||||
if not exist "%tokenstore%\" set permerror=1
|
||||
if %winbuild% GEQ 9200 for %%# in (
|
||||
if %winbuild% GEQ 9200 if not defined ps32onArm (
|
||||
for %%# in (
|
||||
"%tokenstore%+FullControl"
|
||||
"HKLM:\SYSTEM\WPA+QueryValues, EnumerateSubKeys, WriteKey"
|
||||
"HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion\SoftwareProtectionPlatform+SetValue"
|
||||
) do for /f "tokens=1,2 delims=+" %%A in (%%#) do if not defined permerror (
|
||||
%psc% "$acl = (Get-Acl '%%A' | fl | Out-String); if (-not ($acl -match 'NT SERVICE\\sppsvc Allow %%B') -or ($acl -match 'NT SERVICE\\sppsvc Deny')) {Exit 2}" %nul%
|
||||
if !errorlevel!==2 set permerror=1
|
||||
if !errorlevel!==2 (
|
||||
if "%%A"=="%tokenstore%" (
|
||||
set "permerror=Error Found In Token Folder"
|
||||
) else (
|
||||
set "permerror=Error Found In SPP Registries"
|
||||
)
|
||||
)
|
||||
)
|
||||
|
||||
if %winbuild% GEQ 9200 if defined permerror (
|
||||
REM https://learn.microsoft.com/office/troubleshoot/activation/license-issue-when-start-office-application
|
||||
|
||||
if not defined permerror (
|
||||
reg query "HKU\S-1-5-20\Software\Microsoft\Windows NT\CurrentVersion" %nul% && (
|
||||
set "pol=HKU\S-1-5-20\Software\Microsoft\Windows NT\CurrentVersion\SoftwareProtectionPlatform\Policies"
|
||||
reg query "!pol!" %nul% || reg add "!pol!" %nul%
|
||||
%psc% "$netServ = (New-Object Security.Principal.SecurityIdentifier('S-1-5-20')).Translate([Security.Principal.NTAccount]).Value; $aclString = Get-Acl 'Registry::!pol!' | Format-List | Out-String; if (-not ($aclString.Contains($netServ + ' Allow FullControl') -or $aclString.Contains('NT SERVICE\sppsvc Allow FullControl')) -or ($aclString.Contains('Deny'))) {Exit 3}" %nul%
|
||||
if !errorlevel!==3 set "permerror=Error Found In S-1-5-20 SPP"
|
||||
)
|
||||
)
|
||||
|
||||
if defined permerror (
|
||||
set error=1
|
||||
call :dk_color %Red% "Checking SPP Permissions [Error Found]"
|
||||
call :dk_color %Red% "Checking SPP Permissions [!permerror!]"
|
||||
if not defined showfix call :dk_color %Blue% "%_fixmsg%"
|
||||
set showfix=1
|
||||
)
|
||||
)
|
||||
|
||||
|
||||
:: If required services are not disabled or corrupted + if there is any error + SoftwareLicensingService errorlevel is not Zero + no fix was shown before
|
||||
@@ -1630,7 +1738,7 @@ if ($osVersion.Build -ge $minBuildNumber) {
|
||||
}
|
||||
for ($i=1; $i -le $count; $i++) {
|
||||
if (-not $subkeyHashTable.ContainsKey("$i")) {
|
||||
Write-Output "Total Keys $count. Error Found- $i key does not exist"
|
||||
Write-Output "Total Keys $count. Error Found - $i key does not exist."
|
||||
$wpaKey.Close()
|
||||
exit
|
||||
}
|
||||
@@ -1641,7 +1749,7 @@ $wpaKey.GetSubKeyNames() | ForEach-Object {
|
||||
if ($PSVersionTable.PSVersion.Major -lt 3) {
|
||||
cmd /c "reg query "HKLM\SYSTEM\WPA\$_" /ve /t REG_BINARY >nul 2>&1"
|
||||
if ($LASTEXITCODE -ne 0) {
|
||||
Write-Host "Total Keys $count. Error Found- Binary Data is corrupt"
|
||||
Write-Host "Total Keys $count. Error Found - Binary Data is corrupt."
|
||||
$wpaKey.Close()
|
||||
exit
|
||||
}
|
||||
@@ -1649,7 +1757,7 @@ $wpaKey.GetSubKeyNames() | ForEach-Object {
|
||||
$subkey = $wpaKey.OpenSubKey($_)
|
||||
$p = $subkey.GetValueNames()
|
||||
if (($p | Where-Object { $subkey.GetValueKind($_) -eq [Microsoft.Win32.RegistryValueKind]::Binary }).Count -eq 0) {
|
||||
Write-Host "Total Keys $count. Error Found- Binary Data is corrupt"
|
||||
Write-Host "Total Keys $count. Error Found - Binary Data is corrupt."
|
||||
$wpaKey.Close()
|
||||
exit
|
||||
}
|
||||
@@ -1688,13 +1796,14 @@ echo:
|
||||
if %_unattended%==1 timeout /t 2 & exit /b
|
||||
|
||||
if defined fixes (
|
||||
call :dk_color2 %Blue% "Press [1] To Open Troubleshoot Page " %Gray% " Press [0] To Ignore"
|
||||
call :dk_color %White% "Follow ALL the ABOVE blue lines. "
|
||||
call :dk_color2 %Blue% "Press [1] to Open Support Webpage " %Gray% " Press [0] to Ignore"
|
||||
choice /C:10 /N
|
||||
if !errorlevel!==1 (for %%# in (%fixes%) do (start %%#))
|
||||
)
|
||||
|
||||
if defined terminal (
|
||||
call :dk_color %_Yellow% "Press 0 key to %_exitmsg%..."
|
||||
call :dk_color %_Yellow% "Press [0] key to %_exitmsg%..."
|
||||
choice /c 0 /n
|
||||
) else (
|
||||
call :dk_color %_Yellow% "Press any key to %_exitmsg%..."
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -1,12 +0,0 @@
|
||||
--------------------------------------------------------------------------------------
|
||||
Activation Type Supported Product Activation Period
|
||||
--------------------------------------------------------------------------------------
|
||||
|
||||
HWID - Windows 10-11 - Permanent
|
||||
Ohook - Office - Permanent
|
||||
KMS38 - Windows 10-11-Server - Till the Year 2038
|
||||
Online KMS - Windows / Office - 180 Days. Lifetime With Renewal Task
|
||||
|
||||
--------------------------------------------------------------------------------------
|
||||
|
||||
For more details, use the respective docs section here https://massgrave.dev/
|
||||
7408
MAS/Separate-Files-Version/Activators/TSforge_Activation.cmd
Normal file
7408
MAS/Separate-Files-Version/Activators/TSforge_Activation.cmd
Normal file
File diff suppressed because it is too large
Load Diff
13
MAS/Separate-Files-Version/Activators/_ReadMe.txt
Normal file
13
MAS/Separate-Files-Version/Activators/_ReadMe.txt
Normal file
@@ -0,0 +1,13 @@
|
||||
--------------------------------------------------------------------------------------
|
||||
Activation Type Supported Product Activation Period
|
||||
--------------------------------------------------------------------------------------
|
||||
|
||||
HWID - Windows 10-11 - Permanent
|
||||
Ohook - Office - Permanent
|
||||
TSforge - Windows / ESU / Office - Permanent
|
||||
KMS38 - Windows 10-11-Server - Till the Year 2038
|
||||
Online KMS - Windows / Office - 180 Days. Lifetime With Renewal Task
|
||||
|
||||
--------------------------------------------------------------------------------------
|
||||
|
||||
For more details, check https://massgrave.dev/activations_comparison
|
||||
1451
MAS/Separate-Files-Version/Change_Office_Edition.cmd
Normal file
1451
MAS/Separate-Files-Version/Change_Office_Edition.cmd
Normal file
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -6,10 +6,23 @@
|
||||
:: https://gravesoft.dev/cas
|
||||
|
||||
|
||||
:: Set Environment variables, it helps if they are misconfigured in the system
|
||||
|
||||
setlocal EnableExtensions
|
||||
setlocal DisableDelayedExpansion
|
||||
|
||||
set "PathExt=.COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH;.MSC"
|
||||
|
||||
set "SysPath=%SystemRoot%\System32"
|
||||
set "Path=%SystemRoot%\System32;%SystemRoot%;%SystemRoot%\System32\Wbem;%SystemRoot%\System32\WindowsPowerShell\v1.0\"
|
||||
if exist "%SystemRoot%\Sysnative\reg.exe" (
|
||||
set "SysPath=%SystemRoot%\Sysnative"
|
||||
set "Path=%SystemRoot%\Sysnative;%SystemRoot%;%SystemRoot%\Sysnative\Wbem;%SystemRoot%\Sysnative\WindowsPowerShell\v1.0\;%Path%"
|
||||
)
|
||||
|
||||
set "ComSpec=%SysPath%\cmd.exe"
|
||||
set "PSModulePath=%ProgramFiles%\WindowsPowerShell\Modules;%SysPath%\WindowsPowerShell\v1.0\Modules"
|
||||
|
||||
set "_psc=powershell -nop -c"
|
||||
set "_err===== ERROR ===="
|
||||
set _pwsh=1
|
||||
@@ -29,25 +42,45 @@ setlocal EnableDelayedExpansion
|
||||
|
||||
:E_Exit
|
||||
echo.
|
||||
echo Press any key to exit.
|
||||
pause >nul
|
||||
echo Press 0 key to exit.
|
||||
choice /c 0 /n
|
||||
exit /b
|
||||
|
||||
:sppmgr:
|
||||
param (
|
||||
[Parameter()]
|
||||
[switch]
|
||||
$All,
|
||||
[Parameter()]
|
||||
[switch]
|
||||
$Dlv,
|
||||
[Parameter()]
|
||||
[switch]
|
||||
$IID,
|
||||
[Parameter()]
|
||||
[switch]
|
||||
$Pass
|
||||
)
|
||||
|
||||
function CONOUT($strObj)
|
||||
{
|
||||
Out-Host -Input $strObj
|
||||
}
|
||||
|
||||
function ExitScript($ExitCode = 0)
|
||||
{
|
||||
Exit $ExitCode
|
||||
}
|
||||
|
||||
if (-Not $PSVersionTable) {
|
||||
Write-Host "==== ERROR ====`r`n"
|
||||
Write-Host 'Windows PowerShell 1.0 is not supported by this script.'
|
||||
"==== ERROR ====`r`n"
|
||||
"Windows PowerShell 1.0 is not supported by this script."
|
||||
ExitScript 1
|
||||
}
|
||||
|
||||
if ($ExecutionContext.SessionState.LanguageMode.value__ -NE 0) {
|
||||
Write-Host "==== ERROR ====`r`n"
|
||||
Write-Host 'Windows PowerShell is not running in Full Language Mode.'
|
||||
"==== ERROR ====`r`n"
|
||||
"Windows PowerShell is not running in Full Language Mode."
|
||||
ExitScript 1
|
||||
}
|
||||
|
||||
@@ -55,21 +88,34 @@ $winbuild = 1
|
||||
try {
|
||||
$winbuild = [System.Diagnostics.FileVersionInfo]::GetVersionInfo("$env:SystemRoot\System32\kernel32.dll").FileBuildPart
|
||||
} catch {
|
||||
$winbuild = [int](Get-WmiObject Win32_OperatingSystem).BuildNumber
|
||||
$winbuild = [int]([wmi]'Win32_OperatingSystem=@').BuildNumber
|
||||
}
|
||||
|
||||
if ($winbuild -EQ 1) {
|
||||
Write-Host "==== ERROR ====`r`n"
|
||||
Write-Host 'Could not detect Windows build.'
|
||||
"==== ERROR ====`r`n"
|
||||
"Could not detect Windows build."
|
||||
ExitScript 1
|
||||
}
|
||||
|
||||
if ($winbuild -LT 2600) {
|
||||
Write-Host "==== ERROR ====`r`n"
|
||||
Write-Host 'This build of Windows is not supported by this script.'
|
||||
"==== ERROR ====`r`n"
|
||||
"This build of Windows is not supported by this script."
|
||||
ExitScript 1
|
||||
}
|
||||
|
||||
if ($All.IsPresent)
|
||||
{
|
||||
$isAll = {CONOUT "`r"}
|
||||
$noAll = {$null}
|
||||
}
|
||||
else
|
||||
{
|
||||
$isAll = {$null}
|
||||
$noAll = {CONOUT "`r"}
|
||||
}
|
||||
$Dlv = $Dlv.IsPresent
|
||||
$IID = $IID.IsPresent -Or $Dlv.IsPresent
|
||||
|
||||
$NT6 = $winbuild -GE 6000
|
||||
$NT7 = $winbuild -GE 7600
|
||||
$NT9 = $winbuild -GE 9600
|
||||
@@ -81,10 +127,10 @@ $line3 = "____________________________________________________________"
|
||||
|
||||
function echoWindows
|
||||
{
|
||||
Write-Host "$line2"
|
||||
Write-Host "=== Windows Status ==="
|
||||
Write-Host "$line2"
|
||||
if (!$All.IsPresent) {Write-Host}
|
||||
CONOUT "$line2"
|
||||
CONOUT "=== Windows Status ==="
|
||||
CONOUT "$line2"
|
||||
& $noAll
|
||||
}
|
||||
|
||||
function echoOffice
|
||||
@@ -93,18 +139,22 @@ function echoOffice
|
||||
return
|
||||
}
|
||||
|
||||
if ($All.IsPresent) {Write-Host}
|
||||
Write-Host "$line2"
|
||||
Write-Host "=== Office Status ==="
|
||||
Write-Host "$line2"
|
||||
if (!$All.IsPresent) {Write-Host}
|
||||
& $isAll
|
||||
CONOUT "$line2"
|
||||
CONOUT "=== Office Status ==="
|
||||
CONOUT "$line2"
|
||||
& $noAll
|
||||
|
||||
$script:doMSG = 0
|
||||
}
|
||||
|
||||
function strGetRegistry($strKey, $strName)
|
||||
{
|
||||
Get-ItemProperty -EA 0 $strKey | select -EA 0 -Expand $strName
|
||||
try {
|
||||
return [Microsoft.Win32.Registry]::GetValue($strKey, $strName, $null)
|
||||
} catch {
|
||||
return $null
|
||||
}
|
||||
}
|
||||
|
||||
function CheckOhook
|
||||
@@ -135,55 +185,57 @@ function CheckOhook
|
||||
return
|
||||
}
|
||||
|
||||
if ($All.IsPresent) {Write-Host}
|
||||
Write-Host "$line2"
|
||||
Write-Host "=== Office Ohook Status ==="
|
||||
Write-Host "$line2"
|
||||
Write-Host
|
||||
Write-Host -back 'Black' -fore 'Yellow' 'Ohook for permanent Office activation is installed.'
|
||||
Write-Host -back 'Black' -fore 'Yellow' 'You can ignore the below mentioned Office activation status.'
|
||||
if (!$All.IsPresent) {Write-Host}
|
||||
& $isAll
|
||||
CONOUT "$line2"
|
||||
CONOUT "=== Office Ohook Status ==="
|
||||
CONOUT "$line2"
|
||||
$host.UI.WriteLine('Yellow', 'Black', "`r`nOhook for permanent Office activation is installed.`r`nYou can ignore the below mentioned Office activation status.")
|
||||
& $noAll
|
||||
}
|
||||
|
||||
#region WMI
|
||||
function DetectID($strSLP, $strAppId, [ref]$strAppVar)
|
||||
function DetectID($strSLP, $strAppId)
|
||||
{
|
||||
$fltr = "ApplicationID='$strAppId'"
|
||||
if (!$All.IsPresent) {
|
||||
$fltr = $fltr + " AND PartialProductKey <> NULL"
|
||||
}
|
||||
Get-WmiObject $strSLP ID -Filter $fltr -EA 0 | select ID -EA 0 | foreach {
|
||||
$strAppVar.Value = 1
|
||||
}
|
||||
$ppk = (" AND PartialProductKey <> NULL)", ")")[$All.IsPresent]
|
||||
$fltr = "SELECT ID FROM $strSLP WHERE (ApplicationID='$strAppId'"
|
||||
$clause = $fltr + $ppk
|
||||
$sWmi = [wmisearcher]$clause
|
||||
$sWmi.Options.Rewindable = $false
|
||||
return ($sWmi.Get().Count -GT 0)
|
||||
}
|
||||
|
||||
function GetID($strSLP, $strAppId, $strProperty = "ID")
|
||||
function GetID($strSLP, $strAppId)
|
||||
{
|
||||
$NT5 = ($strSLP -EQ $wslp -And $winbuild -LT 6001)
|
||||
$IDs = [Collections.ArrayList]@()
|
||||
$isAdd = (" AND LicenseDependsOn <> NULL)", ")")[$NT5]
|
||||
$noAdd = " AND LicenseDependsOn IS NULL)"
|
||||
$query = "SELECT ID FROM $strSLP WHERE (ApplicationID='$strAppId' AND PartialProductKey"
|
||||
|
||||
if ($All.IsPresent) {
|
||||
$fltr = "ApplicationID='$strAppId' AND PartialProductKey IS NULL"
|
||||
$clause = $fltr
|
||||
$fltr = $query + " IS NULL"
|
||||
$clause = $fltr + $isAdd
|
||||
$sWmi = [wmisearcher]$clause
|
||||
$sWmi.Options.Rewindable = $false
|
||||
try {$sWmi.Get() | select -Expand Properties -EA 0 | foreach {$IDs += $_.Value}} catch {}
|
||||
if (-Not $NT5) {
|
||||
$clause = $fltr + " AND LicenseDependsOn <> NULL"
|
||||
}
|
||||
Get-WmiObject $strSLP $strProperty -Filter $clause -EA 0 | select -Expand $strProperty -EA 0 | foreach {$IDs += $_}
|
||||
if (-Not $NT5) {
|
||||
$clause = $fltr + " AND LicenseDependsOn IS NULL"
|
||||
Get-WmiObject $strSLP $strProperty -Filter $clause -EA 0 | select -Expand $strProperty -EA 0 | foreach {$IDs += $_}
|
||||
$clause = $fltr + $noAdd
|
||||
$sWmi = [wmisearcher]$clause
|
||||
$sWmi.Options.Rewindable = $false
|
||||
try {$sWmi.Get() | select -Expand Properties -EA 0 | foreach {$IDs += $_.Value}} catch {}
|
||||
}
|
||||
}
|
||||
|
||||
$fltr = "ApplicationID='$strAppId' AND PartialProductKey <> NULL"
|
||||
$clause = $fltr
|
||||
$fltr = $query + " <> NULL"
|
||||
$clause = $fltr + $isAdd
|
||||
$sWmi = [wmisearcher]$clause
|
||||
$sWmi.Options.Rewindable = $false
|
||||
try {$sWmi.Get() | select -Expand Properties -EA 0 | foreach {$IDs += $_.Value}} catch {}
|
||||
if (-Not $NT5) {
|
||||
$clause = $fltr + " AND LicenseDependsOn <> NULL"
|
||||
}
|
||||
Get-WmiObject $strSLP $strProperty -Filter $clause -EA 0 | select -Expand $strProperty -EA 0 | foreach {$IDs += $_}
|
||||
if (-Not $NT5) {
|
||||
$clause = $fltr + " AND LicenseDependsOn IS NULL"
|
||||
Get-WmiObject $strSLP $strProperty -Filter $clause -EA 0 | select -Expand $strProperty -EA 0 | foreach {$IDs += $_}
|
||||
$clause = $fltr + $noAdd
|
||||
$sWmi = [wmisearcher]$clause
|
||||
$sWmi.Options.Rewindable = $false
|
||||
try {$sWmi.Get() | select -Expand Properties -EA 0 | foreach {$IDs += $_.Value}} catch {}
|
||||
}
|
||||
|
||||
return $IDs
|
||||
@@ -220,38 +272,45 @@ function DetectSubscription {
|
||||
if ($objSvc.SubscriptionEdition.Contains("UNKNOWN") -EQ $false) {$SubMsgEdition = $objSvc.SubscriptionEdition}
|
||||
}
|
||||
|
||||
Write-Host
|
||||
Write-Host "Subscription information:"
|
||||
Write-Host " Edition: $SubMsgEdition"
|
||||
Write-Host " Type : $SubMsgType"
|
||||
Write-Host " Status : $SubMsgStatus"
|
||||
Write-Host " Expiry : $SubMsgExpiry"
|
||||
CONOUT "`nSubscription information:"
|
||||
CONOUT " Edition: $SubMsgEdition"
|
||||
CONOUT " Type : $SubMsgType"
|
||||
CONOUT " Status : $SubMsgStatus"
|
||||
CONOUT " Expiry : $SubMsgExpiry"
|
||||
}
|
||||
|
||||
function DetectAdbaClient
|
||||
{
|
||||
CONOUT "`nAD Activation client information:"
|
||||
CONOUT " Object Name: $ADActivationObjectName"
|
||||
CONOUT " Domain Name: $ADActivationObjectDN"
|
||||
CONOUT " CSVLK Extended PID: $ADActivationCsvlkPid"
|
||||
CONOUT " CSVLK Activation ID: $ADActivationCsvlkSkuId"
|
||||
}
|
||||
|
||||
function DetectAvmClient
|
||||
{
|
||||
Write-Host
|
||||
Write-Host "Automatic VM Activation client information:"
|
||||
CONOUT "`nAutomatic VM Activation client information:"
|
||||
if (-Not [String]::IsNullOrEmpty($IAID)) {
|
||||
Write-Host " Guest IAID: $IAID"
|
||||
CONOUT " Guest IAID: $IAID"
|
||||
} else {
|
||||
Write-Host " Guest IAID: Not Available"
|
||||
CONOUT " Guest IAID: Not Available"
|
||||
}
|
||||
if (-Not [String]::IsNullOrEmpty($AutomaticVMActivationHostMachineName)) {
|
||||
Write-Host " Host machine name: $AutomaticVMActivationHostMachineName"
|
||||
CONOUT " Host machine name: $AutomaticVMActivationHostMachineName"
|
||||
} else {
|
||||
Write-Host " Host machine name: Not Available"
|
||||
CONOUT " Host machine name: Not Available"
|
||||
}
|
||||
if ($AutomaticVMActivationLastActivationTime.Substring(0,4) -NE "1601") {
|
||||
$EED = [DateTime]::Parse([Management.ManagementDateTimeConverter]::ToDateTime($AutomaticVMActivationLastActivationTime),$null,48).ToString('yyyy-MM-dd hh:mm:ss tt')
|
||||
Write-Host " Activation time: $EED UTC"
|
||||
CONOUT " Activation time: $EED UTC"
|
||||
} else {
|
||||
Write-Host " Activation time: Not Available"
|
||||
CONOUT " Activation time: Not Available"
|
||||
}
|
||||
if (-Not [String]::IsNullOrEmpty($AutomaticVMActivationHostDigitalPid2)) {
|
||||
Write-Host " Host Digital PID2: $AutomaticVMActivationHostDigitalPid2"
|
||||
CONOUT " Host Digital PID2: $AutomaticVMActivationHostDigitalPid2"
|
||||
} else {
|
||||
Write-Host " Host Digital PID2: Not Available"
|
||||
CONOUT " Host Digital PID2: Not Available"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -281,32 +340,30 @@ function DetectKmsHost
|
||||
$KeyManagementServiceLowPriority = "Normal"
|
||||
}
|
||||
|
||||
Write-Host
|
||||
Write-Host "Key Management Service host information:"
|
||||
Write-Host " Current count: $KeyManagementServiceCurrentCount"
|
||||
Write-Host " Listening on Port: $KeyManagementServiceListeningPort"
|
||||
Write-Host " DNS publishing: $KeyManagementServiceDnsPublishing"
|
||||
Write-Host " KMS priority: $KeyManagementServiceLowPriority"
|
||||
CONOUT "`nKey Management Service host information:"
|
||||
CONOUT " Current count: $KeyManagementServiceCurrentCount"
|
||||
CONOUT " Listening on Port: $KeyManagementServiceListeningPort"
|
||||
CONOUT " DNS publishing: $KeyManagementServiceDnsPublishing"
|
||||
CONOUT " KMS priority: $KeyManagementServiceLowPriority"
|
||||
if (-Not [String]::IsNullOrEmpty($KeyManagementServiceTotalRequests)) {
|
||||
Write-Host
|
||||
Write-Host "Key Management Service cumulative requests received from clients:"
|
||||
Write-Host " Total: $KeyManagementServiceTotalRequests"
|
||||
Write-Host " Failed: $KeyManagementServiceFailedRequests"
|
||||
Write-Host " Unlicensed: $KeyManagementServiceUnlicensedRequests"
|
||||
Write-Host " Licensed: $KeyManagementServiceLicensedRequests"
|
||||
Write-Host " Initial grace period: $KeyManagementServiceOOBGraceRequests"
|
||||
Write-Host " Expired or Hardware out of tolerance: $KeyManagementServiceOOTGraceRequests"
|
||||
Write-Host " Non-genuine grace period: $KeyManagementServiceNonGenuineGraceRequests"
|
||||
Write-Host " Notification: $KeyManagementServiceNotificationRequests"
|
||||
CONOUT "`nKey Management Service cumulative requests received from clients:"
|
||||
CONOUT " Total: $KeyManagementServiceTotalRequests"
|
||||
CONOUT " Failed: $KeyManagementServiceFailedRequests"
|
||||
CONOUT " Unlicensed: $KeyManagementServiceUnlicensedRequests"
|
||||
CONOUT " Licensed: $KeyManagementServiceLicensedRequests"
|
||||
CONOUT " Initial grace period: $KeyManagementServiceOOBGraceRequests"
|
||||
CONOUT " Expired or Hardware out of tolerance: $KeyManagementServiceOOTGraceRequests"
|
||||
CONOUT " Non-genuine grace period: $KeyManagementServiceNonGenuineGraceRequests"
|
||||
if ($null -NE $KeyManagementServiceNotificationRequests) {CONOUT " Notification: $KeyManagementServiceNotificationRequests"}
|
||||
}
|
||||
}
|
||||
|
||||
function DetectKmsClient
|
||||
{
|
||||
if ($null -NE $VLActivationTypeEnabled) {Write-Host "Configured Activation Type: $($VLActTypes[$VLActivationTypeEnabled])"}
|
||||
Write-Host
|
||||
if ($null -NE $VLActivationTypeEnabled) {CONOUT "Configured Activation Type: $($VLActTypes[$VLActivationTypeEnabled])"}
|
||||
CONOUT "`r"
|
||||
if ($LicenseStatus -NE 1) {
|
||||
Write-Host "Please activate the product in order to update KMS client information values."
|
||||
CONOUT "Please activate the product in order to update KMS client information values."
|
||||
return
|
||||
}
|
||||
|
||||
@@ -339,33 +396,42 @@ function DetectKmsClient
|
||||
}
|
||||
}
|
||||
|
||||
Write-Host "Key Management Service client information:"
|
||||
Write-Host " Client Machine ID (CMID): $($objSvc.ClientMachineID)"
|
||||
CONOUT "Key Management Service client information:"
|
||||
CONOUT " Client Machine ID (CMID): $($objSvc.ClientMachineID)"
|
||||
if ($null -EQ $KmsReg) {
|
||||
Write-Host " $KmsDns"
|
||||
Write-Host " Registered KMS machine name: KMS name not available"
|
||||
CONOUT " $KmsDns"
|
||||
CONOUT " Registered KMS machine name: KMS name not available"
|
||||
} else {
|
||||
Write-Host " $KmsReg"
|
||||
CONOUT " $KmsReg"
|
||||
}
|
||||
if ($null -NE $DiscoveredKeyManagementServiceMachineIpAddress) {Write-Host " KMS machine IP address: $DiscoveredKeyManagementServiceMachineIpAddress"}
|
||||
Write-Host " KMS machine extended PID: $KeyManagementServiceProductKeyID"
|
||||
Write-Host " Activation interval: $VLActivationInterval minutes"
|
||||
Write-Host " Renewal interval: $VLRenewalInterval minutes"
|
||||
if ($null -NE $KeyManagementServiceHostCaching) {Write-Host " KMS host caching: $KeyManagementServiceHostCaching"}
|
||||
if (-Not [String]::IsNullOrEmpty($KeyManagementServiceLookupDomain)) {Write-Host " KMS SRV record lookup domain: $KeyManagementServiceLookupDomain"}
|
||||
if ($null -NE $DiscoveredKeyManagementServiceMachineIpAddress) {CONOUT " KMS machine IP address: $DiscoveredKeyManagementServiceMachineIpAddress"}
|
||||
CONOUT " KMS machine extended PID: $KeyManagementServiceProductKeyID"
|
||||
CONOUT " Activation interval: $VLActivationInterval minutes"
|
||||
CONOUT " Renewal interval: $VLRenewalInterval minutes"
|
||||
if ($null -NE $KeyManagementServiceHostCaching) {CONOUT " KMS host caching: $KeyManagementServiceHostCaching"}
|
||||
if (-Not [String]::IsNullOrEmpty($KeyManagementServiceLookupDomain)) {CONOUT " KMS SRV record lookup domain: $KeyManagementServiceLookupDomain"}
|
||||
}
|
||||
|
||||
function GetResult($strSLP, $strSLS, $strID)
|
||||
{
|
||||
try {$objPrd = Get-WmiObject $strSLP -Filter "ID='$strID'" -EA 1} catch {return}
|
||||
$objPrd | select -Expand Properties -EA 0 | foreach {
|
||||
if (-Not [String]::IsNullOrEmpty($_.Value)) {set $_.Name $_.Value}
|
||||
try
|
||||
{
|
||||
$objPrd = [wmisearcher]"SELECT * FROM $strSLP WHERE ID='$strID'"
|
||||
$objPrd.Options.Rewindable = $false
|
||||
$objPrd.Get() | select -Expand Properties -EA 0 | foreach { if (-Not [String]::IsNullOrEmpty($_.Value)) {set $_.Name $_.Value} }
|
||||
$objPrd.Dispose()
|
||||
}
|
||||
catch
|
||||
{
|
||||
return
|
||||
}
|
||||
|
||||
$winID = ($ApplicationID -EQ $winApp)
|
||||
$winPR = ($winID -And -Not $LicenseIsAddon)
|
||||
$Vista = ($winID -And $NT6 -And -Not $NT7)
|
||||
$NT5 = ($strSLP -EQ $wslp -And $winbuild -LT 6001)
|
||||
$reapp = ("Windows", "App")[!$winID]
|
||||
$prmnt = ("machine", "product")[!$winPR]
|
||||
|
||||
if ($Description | Select-String "VOLUME_KMSCLIENT") {$cKmsClient = 1; $_mTag = "Volume"}
|
||||
if ($Description | Select-String "TIMEBASED_") {$cTblClient = 1; $_mTag = "Timebased"}
|
||||
@@ -390,7 +456,7 @@ function GetResult($strSLP, $strSLS, $strID)
|
||||
$LicenseInf = "Licensed"
|
||||
$LicenseMsg = $null
|
||||
if ($GracePeriodRemaining -EQ 0) {
|
||||
if ($winPR) {$ExpireMsg = "The machine is permanently activated."} else {$ExpireMsg = "The product is permanently activated."}
|
||||
$ExpireMsg = "The $prmnt is permanently activated."
|
||||
} else {
|
||||
$LicenseMsg = "$_mTag activation expiration: $GracePeriodRemaining minute(s) ($_gpr day(s))"
|
||||
if ($null -NE $_xpr) {$ExpireMsg = "$_mTag activation will expire $_xpr"}
|
||||
@@ -411,8 +477,9 @@ function GetResult($strSLP, $strSLS, $strID)
|
||||
if ($LicenseStatus -EQ 5 -And -Not $NT5) {
|
||||
$LicenseInf = "Notification"
|
||||
$LicenseMsg = "Notification Reason: $LicenseReason"
|
||||
if ($LicenseReason -EQ "0xC004F00F") {if ($null -NE $cKmsClient) {$LicenseMsg = $LicenseMsg + " (KMS license expired)."} else {$LicenseMsg = $LicenseMsg + " (hardware out of tolerance)."}}
|
||||
if ($LicenseReason -EQ "0xC004F200") {$LicenseMsg = $LicenseMsg + " (non-genuine)."}
|
||||
if ($LicenseReason -EQ "0xC004F009") {$LicenseMsg = $LicenseMsg + " (grace time expired)."}
|
||||
if ($LicenseReason -EQ "0xC004F009" -Or $LicenseReason -EQ "0xC004F064") {$LicenseMsg = $LicenseMsg + " (grace time expired)."}
|
||||
}
|
||||
if ($LicenseStatus -GT 5 -Or ($LicenseStatus -GT 4 -And $NT5)) {
|
||||
$LicenseInf = "Unknown"
|
||||
@@ -424,25 +491,61 @@ function GetResult($strSLP, $strSLS, $strID)
|
||||
}
|
||||
|
||||
if ($winPR -And $PartialProductKey -And -Not $NT9) {
|
||||
$dp4 = Get-ItemProperty -EA 0 "HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion" | select -EA 0 -Expand DigitalProductId4
|
||||
$dp4 = strGetRegistry "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion" "DigitalProductId4"
|
||||
if ($null -NE $dp4) {
|
||||
$ProductKeyChannel = ([System.Text.Encoding]::Unicode.GetString($dp4, 1016, 128)).Trim([char]$null)
|
||||
}
|
||||
}
|
||||
|
||||
if ($All.IsPresent) {Write-Host}
|
||||
Write-Host "Name: $Name"
|
||||
Write-Host "Description: $Description"
|
||||
Write-Host "Activation ID: $ID"
|
||||
if ($null -NE $ProductKeyID) {Write-Host "Extended PID: $ProductKeyID"}
|
||||
if ($null -NE $OfflineInstallationId -And $IID.IsPresent) {Write-Host "Installation ID: $OfflineInstallationId"}
|
||||
if ($null -NE $ProductKeyChannel) {Write-Host "Product Key Channel: $ProductKeyChannel"}
|
||||
if ($null -NE $PartialProductKey) {Write-Host "Partial Product Key: $PartialProductKey"} else {Write-Host "Product Key: Not installed"}
|
||||
Write-Host "License Status: $LicenseInf"
|
||||
if ($null -NE $LicenseMsg) {Write-Host "$LicenseMsg"}
|
||||
if ($winPR -And $Dlv -And $NT7 -And $null -EQ $RemainingAppReArmCount) {
|
||||
try
|
||||
{
|
||||
$tmp = [wmisearcher]"SELECT RemainingWindowsReArmCount FROM $strSLS"
|
||||
$tmp.Options.Rewindable = $false
|
||||
$tmp.Get() | select -Expand Properties -EA 0 | foreach {set $_.Name $_.Value}
|
||||
$tmp.Dispose()
|
||||
}
|
||||
catch
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
$add_on = $Name.IndexOf("add-on for", 5)
|
||||
|
||||
& $isAll
|
||||
if ($add_on -EQ -1) {CONOUT "Name: $Name"} else {CONOUT "Name: $($Name.Substring(0, $add_on + 7))"}
|
||||
CONOUT "Description: $Description"
|
||||
CONOUT "Activation ID: $ID"
|
||||
if ($null -NE $ProductKeyID) {CONOUT "Extended PID: $ProductKeyID"}
|
||||
if ($null -NE $ProductKeyID2 -And $Dlv) {CONOUT "Product ID: $ProductKeyID2"}
|
||||
if ($null -NE $OfflineInstallationId -And $IID) {CONOUT "Installation ID: $OfflineInstallationId"}
|
||||
if ($null -NE $ProductKeyChannel) {CONOUT "Product Key Channel: $ProductKeyChannel"}
|
||||
if ($null -NE $PartialProductKey) {CONOUT "Partial Product Key: $PartialProductKey"}
|
||||
CONOUT "License Status: $LicenseInf"
|
||||
if ($null -NE $LicenseMsg) {CONOUT "$LicenseMsg"}
|
||||
if ($LicenseStatus -NE 0 -And $EvaluationEndDate.Substring(0,4) -NE "1601") {
|
||||
$EED = [DateTime]::Parse([Management.ManagementDateTimeConverter]::ToDateTime($EvaluationEndDate),$null,48).ToString('yyyy-MM-dd hh:mm:ss tt')
|
||||
Write-Host "Evaluation End Date: $EED UTC"
|
||||
CONOUT "Evaluation End Date: $EED UTC"
|
||||
}
|
||||
if ($Dlv) {
|
||||
if ($null -NE $RemainingWindowsReArmCount) {
|
||||
CONOUT "Remaining Windows rearm count: $RemainingWindowsReArmCount"
|
||||
}
|
||||
if ($null -NE $RemainingSkuReArmCount -And $RemainingSkuReArmCount -NE 4294967295) {
|
||||
CONOUT "Remaining $reapp rearm count: $RemainingAppReArmCount"
|
||||
CONOUT "Remaining SKU rearm count: $RemainingSkuReArmCount"
|
||||
}
|
||||
if ($null -NE $TrustedTime -And $LicenseStatus -NE 0) {
|
||||
$TTD = [DateTime]::Parse([Management.ManagementDateTimeConverter]::ToDateTime($TrustedTime),$null,32).ToString('yyyy-MM-dd hh:mm:ss tt')
|
||||
CONOUT "Trusted time: $TTD"
|
||||
}
|
||||
}
|
||||
if ($LicenseStatus -EQ 0) {
|
||||
return
|
||||
}
|
||||
|
||||
if ($strSLP -EQ $wslp -And $null -NE $PartialProductKey -And $null -NE $ADActivationObjectName -And $VLActivationType -EQ 1) {
|
||||
DetectAdbaClient
|
||||
}
|
||||
|
||||
if ($winID -And $null -NE $cAvmClient -And $null -NE $PartialProductKey) {
|
||||
@@ -454,16 +557,22 @@ function GetResult($strSLP, $strSLS, $strID)
|
||||
$chkSLS = ($null -NE $PartialProductKey) -And ($null -NE $cKmsClient -Or $null -NE $cKmsHost -Or $chkSub)
|
||||
|
||||
if (!$chkSLS) {
|
||||
if ($null -NE $ExpireMsg) {Write-Host; Write-Host " $ExpireMsg"}
|
||||
if ($null -NE $ExpireMsg) {CONOUT "`n $ExpireMsg"}
|
||||
return
|
||||
}
|
||||
|
||||
$objSvc = Get-WmiObject $strSLS -EA 0
|
||||
|
||||
if ($Vista) {
|
||||
$objSvc | select -Expand Properties -EA 0 | foreach {
|
||||
if (-Not [String]::IsNullOrEmpty($_.Value)) {set $_.Name $_.Value}
|
||||
}
|
||||
try
|
||||
{
|
||||
$objSvc = New-Object PSObject
|
||||
$wmiSvc = [wmisearcher]"SELECT * FROM $strSLS"
|
||||
$wmiSvc.Options.Rewindable = $false
|
||||
$wmiSvc.Get() | select -Expand Properties -EA 0 | foreach { if (-Not [String]::IsNullOrEmpty($_.Value)) {$objSvc | Add-Member 8 $_.Name $_.Value} }
|
||||
$wmiSvc.Dispose()
|
||||
if ($null -EQ $IsKeyManagementServiceMachine) {$objSvc.PSObject.Properties | foreach {set $_.Name $_.Value}}
|
||||
}
|
||||
catch
|
||||
{
|
||||
return
|
||||
}
|
||||
|
||||
if ($strSLS -EQ $wsls -And $NT9) {
|
||||
@@ -473,6 +582,7 @@ function GetResult($strSLP, $strSLS, $strID)
|
||||
}
|
||||
|
||||
if ($null -NE $cKmsHost -And $IsKeyManagementServiceMachine -GT 0) {
|
||||
if ($null -NE $ExpireMsg) {CONOUT "`n $ExpireMsg"}
|
||||
DetectKmsHost
|
||||
}
|
||||
|
||||
@@ -480,7 +590,9 @@ function GetResult($strSLP, $strSLS, $strID)
|
||||
DetectKmsClient
|
||||
}
|
||||
|
||||
if ($null -NE $ExpireMsg) {Write-Host; Write-Host " $ExpireMsg"}
|
||||
if ($null -EQ $cKmsHost) {
|
||||
if ($null -NE $ExpireMsg) {CONOUT "`n $ExpireMsg"}
|
||||
}
|
||||
|
||||
if ($chkSub) {
|
||||
DetectSubscription
|
||||
@@ -520,11 +632,10 @@ function PrintModePerPridFromRegistry
|
||||
$vNextPrids = Get-Item -Path $vNextRegkey -ErrorAction SilentlyContinue | Select-Object -ExpandProperty 'property' -ErrorAction SilentlyContinue | Where-Object -FilterScript {$_.ToLower() -like "*retail" -or $_.ToLower() -like "*volume"}
|
||||
If ($null -Eq $vNextPrids)
|
||||
{
|
||||
Write-Host
|
||||
Write-Host "No registry keys found."
|
||||
CONOUT "`nNo registry keys found."
|
||||
Return
|
||||
}
|
||||
Write-Host
|
||||
CONOUT "`r"
|
||||
$vNextPrids | ForEach `
|
||||
{
|
||||
$mode = (Get-ItemProperty -Path $vNextRegkey -Name $_).$_
|
||||
@@ -534,7 +645,7 @@ function PrintModePerPridFromRegistry
|
||||
3 { $mode = "Device"; Break }
|
||||
Default { $mode = "Legacy"; Break }
|
||||
}
|
||||
Write-Host $_ = $mode
|
||||
CONOUT "$_ = $mode"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -548,8 +659,7 @@ function PrintSharedComputerLicensing
|
||||
$scaPolicyValue = Get-ItemProperty -Path $scaPolicyKey -ErrorAction SilentlyContinue | Select-Object -ExpandProperty "SharedComputerLicensing" -ErrorAction SilentlyContinue
|
||||
If ($null -Eq $scaValue -And $null -Eq $scaValue2 -And $null -Eq $scaPolicyValue)
|
||||
{
|
||||
Write-Host
|
||||
Write-Host "No registry keys found."
|
||||
CONOUT "`nNo registry keys found."
|
||||
Return
|
||||
}
|
||||
$scaModeValue = $scaValue -Or $scaValue2 -Or $scaPolicyValue
|
||||
@@ -561,23 +671,17 @@ function PrintSharedComputerLicensing
|
||||
{
|
||||
$scaMode = "Enabled"
|
||||
}
|
||||
Write-Host
|
||||
Write-Host "Status:" $scaMode
|
||||
Write-Host
|
||||
CONOUT "`nStatus: $scaMode"
|
||||
CONOUT "`r"
|
||||
$tokenFiles = $null
|
||||
$tokenPath = "${env:LOCALAPPDATA}\Microsoft\Office\16.0\Licensing"
|
||||
If (Test-Path $tokenPath)
|
||||
{
|
||||
$tokenFiles = Get-ChildItem -Path $tokenPath -Filter "*authString*" -Recurse | Where-Object { !$_.PSIsContainer }
|
||||
}
|
||||
If ($null -Eq $tokenFiles)
|
||||
If ($null -Eq $tokenFiles -Or $tokenFiles.Length -Eq 0)
|
||||
{
|
||||
Write-Host "No tokens found."
|
||||
Return
|
||||
}
|
||||
If ($tokenFiles.Length -Eq 0)
|
||||
{
|
||||
Write-Host "No tokens found."
|
||||
CONOUT "No tokens found."
|
||||
Return
|
||||
}
|
||||
$tokenFiles | ForEach `
|
||||
@@ -611,16 +715,9 @@ function PrintLicensesInformation
|
||||
{
|
||||
$licenseFiles = Get-ChildItem -Path $licensePath -Recurse | Where-Object { !$_.PSIsContainer }
|
||||
}
|
||||
If ($null -Eq $licenseFiles)
|
||||
If ($null -Eq $licenseFiles -Or $licenseFiles.Length -Eq 0)
|
||||
{
|
||||
Write-Host
|
||||
Write-Host "No licenses found."
|
||||
Return
|
||||
}
|
||||
If ($licenseFiles.Length -Eq 0)
|
||||
{
|
||||
Write-Host
|
||||
Write-Host "No licenses found."
|
||||
CONOUT "`nNo licenses found."
|
||||
Return
|
||||
}
|
||||
$licenseFiles | ForEach `
|
||||
@@ -677,24 +774,20 @@ function vNextDiagRun
|
||||
Return
|
||||
}
|
||||
|
||||
if ($All.IsPresent) {Write-Host}
|
||||
Write-Host "$line2"
|
||||
Write-Host "=== Office vNext Status ==="
|
||||
Write-Host "$line2"
|
||||
Write-Host
|
||||
Write-Host "========== Mode per ProductReleaseId =========="
|
||||
& $isAll
|
||||
CONOUT "$line2"
|
||||
CONOUT "=== Office vNext Status ==="
|
||||
CONOUT "$line2"
|
||||
CONOUT "`n========== Mode per ProductReleaseId =========="
|
||||
PrintModePerPridFromRegistry
|
||||
Write-Host
|
||||
Write-Host "========== Shared Computer Licensing =========="
|
||||
CONOUT "`n========== Shared Computer Licensing =========="
|
||||
PrintSharedComputerLicensing
|
||||
Write-Host
|
||||
Write-Host "========== vNext licenses ==========="
|
||||
CONOUT "`n========== vNext licenses ==========="
|
||||
PrintLicensesInformation -Mode "NUL"
|
||||
Write-Host
|
||||
Write-Host "========== Device licenses =========="
|
||||
CONOUT "`n========== Device licenses =========="
|
||||
PrintLicensesInformation -Mode "Device"
|
||||
Write-Host "$line3"
|
||||
Write-Host
|
||||
CONOUT "$line3"
|
||||
CONOUT "`r"
|
||||
}
|
||||
#endregion
|
||||
|
||||
@@ -777,13 +870,13 @@ function PrintStateData {
|
||||
}
|
||||
|
||||
[string[]]$pwszStateString = $Marshal::PtrToStringUni($pwszStateData) -replace ";", "`n "
|
||||
Write-Host " $pwszStateString"
|
||||
CONOUT (" $pwszStateString")
|
||||
|
||||
$Marshal::FreeHGlobal($pwszStateData)
|
||||
return $TRUE
|
||||
}
|
||||
|
||||
function PrintLastActivationHRresult {
|
||||
function PrintLastActivationHResult {
|
||||
$pdwLastHResult = 0
|
||||
$cbSize = 0
|
||||
|
||||
@@ -796,12 +889,34 @@ function PrintLastActivationHRresult {
|
||||
return $FALSE
|
||||
}
|
||||
|
||||
Write-Host (" LastActivationHResult=0x{0:x8}" -f $Marshal::ReadInt32($pdwLastHResult))
|
||||
CONOUT (" LastActivationHResult=0x{0:x8}" -f $Marshal::ReadInt32($pdwLastHResult))
|
||||
|
||||
$Marshal::FreeHGlobal($pdwLastHResult)
|
||||
return $TRUE
|
||||
}
|
||||
|
||||
function PrintLastActivationTime {
|
||||
$pdwLastTime = 0
|
||||
$cbSize = 0
|
||||
|
||||
if ($Win32::SLGetWindowsInformation(
|
||||
"Security-SPP-LastWindowsActivationTime",
|
||||
[ref]$null,
|
||||
[ref]$cbSize,
|
||||
[ref]$pdwLastTime
|
||||
)) {
|
||||
return $FALSE
|
||||
}
|
||||
|
||||
$actTime = $Marshal::ReadInt64($pdwLastTime)
|
||||
if ($actTime -ne 0) {
|
||||
CONOUT (" LastActivationTime={0}" -f [DateTime]::FromFileTimeUtc($actTime).ToString("yyyy/MM/dd:HH:mm:ss"))
|
||||
}
|
||||
|
||||
$Marshal::FreeHGlobal($pdwLastTime)
|
||||
return $TRUE
|
||||
}
|
||||
|
||||
function PrintIsWindowsGenuine {
|
||||
$dwGenuine = 0
|
||||
$ppwszGenuineStates = @(
|
||||
@@ -817,9 +932,9 @@ function PrintIsWindowsGenuine {
|
||||
}
|
||||
|
||||
if ($dwGenuine -lt 5) {
|
||||
Write-Host (" IsWindowsGenuine={0}" -f $ppwszGenuineStates[$dwGenuine])
|
||||
CONOUT (" IsWindowsGenuine={0}" -f $ppwszGenuineStates[$dwGenuine])
|
||||
} else {
|
||||
Write-Host (" IsWindowsGenuine={0}" -f $dwGenuine)
|
||||
CONOUT (" IsWindowsGenuine={0}" -f $dwGenuine)
|
||||
}
|
||||
|
||||
return $TRUE
|
||||
@@ -843,7 +958,7 @@ function PrintDigitalLicenseStatus {
|
||||
[bool]$bDigitalLicense = $FALSE
|
||||
|
||||
$bDigitalLicense = (($dwReturnCode -ge 0) -and ($dwReturnCode -ne 1))
|
||||
Write-Host (" IsDigitalLicense={0}" -f (BoolToWStr $bDigitalLicense))
|
||||
CONOUT (" IsDigitalLicense={0}" -f (BoolToWStr $bDigitalLicense))
|
||||
|
||||
return $TRUE
|
||||
}
|
||||
@@ -861,7 +976,7 @@ function PrintSubscriptionStatus {
|
||||
return $FALSE
|
||||
}
|
||||
|
||||
Write-Host (" SubscriptionSupportedEdition={0}" -f (BoolToWStr $dwSupported))
|
||||
CONOUT (" SubscriptionSupportedEdition={0}" -f (BoolToWStr $dwSupported))
|
||||
|
||||
$pStatus = $Marshal::AllocHGlobal($Marshal::SizeOf([Type]$SubStatus))
|
||||
if ($Win32::ClipGetSubscriptionStatus([ref]$pStatus)) {
|
||||
@@ -872,25 +987,26 @@ function PrintSubscriptionStatus {
|
||||
$sStatus = $Marshal::PtrToStructure($pStatus, [Type]$SubStatus)
|
||||
$Marshal::FreeHGlobal($pStatus)
|
||||
|
||||
Write-Host (" SubscriptionEnabled={0}" -f (BoolToWStr $sStatus.dwEnabled))
|
||||
CONOUT (" SubscriptionEnabled={0}" -f (BoolToWStr $sStatus.dwEnabled))
|
||||
|
||||
if ($sStatus.dwEnabled -eq 0) {
|
||||
return $TRUE
|
||||
}
|
||||
|
||||
Write-Host (" SubscriptionSku={0}" -f $sStatus.dwSku)
|
||||
Write-Host (" SubscriptionState={0}" -f $sStatus.dwState)
|
||||
CONOUT (" SubscriptionSku={0}" -f $sStatus.dwSku)
|
||||
CONOUT (" SubscriptionState={0}" -f $sStatus.dwState)
|
||||
|
||||
return $TRUE
|
||||
}
|
||||
|
||||
function ClicRun
|
||||
{
|
||||
if ($All.IsPresent) {Write-Host}
|
||||
Write-Host "Client Licensing Check information:"
|
||||
& $isAll
|
||||
CONOUT "Client Licensing Check information:"
|
||||
|
||||
$null = PrintStateData
|
||||
$null = PrintLastActivationHRresult
|
||||
$null = PrintLastActivationHResult
|
||||
$null = PrintLastActivationTime
|
||||
$null = PrintIsWindowsGenuine
|
||||
|
||||
if ($DllDigital) {
|
||||
@@ -901,15 +1017,15 @@ function ClicRun
|
||||
$null = PrintSubscriptionStatus
|
||||
}
|
||||
|
||||
Write-Host "$line3"
|
||||
if (!$All.IsPresent) {Write-Host}
|
||||
CONOUT "$line3"
|
||||
& $noAll
|
||||
}
|
||||
#endregion
|
||||
|
||||
$Host.UI.RawUI.WindowTitle = "Check Activation Status"
|
||||
|
||||
if ($All.IsPresent) {
|
||||
$B=$Host.UI.RawUI.BufferSize;$B.Height=3000;$Host.UI.RawUI.BufferSize=$B;clear;
|
||||
$B=$Host.UI.RawUI.BufferSize;$B.Height=3000;$Host.UI.RawUI.BufferSize=$B;
|
||||
if (!$Pass.IsPresent) {clear;}
|
||||
}
|
||||
|
||||
$SysPath = "$env:SystemRoot\System32"
|
||||
@@ -928,46 +1044,43 @@ $cSub = ($winbuild -GE 19041) -And (Select-String -Path "$SysPath\wbem\sppwmi.mo
|
||||
$DllDigital = ($winbuild -GE 14393) -And (Test-Path "$SysPath\EditionUpgradeManagerObj.dll")
|
||||
$DllSubscription = ($winbuild -GE 14393) -And (Test-Path "$SysPath\Clipc.dll")
|
||||
$VLActTypes = @("All", "AD", "KMS", "Token")
|
||||
$SLKeyPath = "Registry::HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\SL"
|
||||
$NSKeyPath = "Registry::HKEY_USERS\S-1-5-20\SOFTWARE\Microsoft\Windows NT\CurrentVersion\SL"
|
||||
$SLKeyPath = "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\SL"
|
||||
$NSKeyPath = "HKEY_USERS\S-1-5-20\SOFTWARE\Microsoft\Windows NT\CurrentVersion\SL"
|
||||
|
||||
'cW1nd0ws', 'c0ff1ce15', 'c0ff1ce14', 'ospp14', 'ospp15' | foreach {set $_ $null}
|
||||
'cW1nd0ws', 'c0ff1ce15', 'c0ff1ce14', 'ospp14', 'ospp15' | foreach {set $_ $false}
|
||||
|
||||
$OsppHook = 1
|
||||
try {gsv osppsvc -EA 1 | Out-Null} catch {$OsppHook = 0}
|
||||
$offsvc = "osppsvc"
|
||||
if ($NT7 -Or -Not $NT6) {$winsvc = "sppsvc"} else {$winsvc = "slsvc"}
|
||||
|
||||
if ($NT7 -Or -Not $NT6) {
|
||||
try {sasv sppsvc -EA 1} catch {}
|
||||
try {gsv $winsvc -EA 1 | Out-Null; $WsppHook = 1} catch {$WsppHook = 0}
|
||||
try {gsv $offsvc -EA 1 | Out-Null; $OsppHook = 1} catch {$OsppHook = 0}
|
||||
|
||||
if ($WsppHook -NE 0) {
|
||||
try {sasv $winsvc -EA 1} catch {}
|
||||
$cW1nd0ws = DetectID $wslp $winApp
|
||||
$c0ff1ce15 = DetectID $wslp $o15App
|
||||
$c0ff1ce14 = DetectID $wslp $o14App
|
||||
}
|
||||
else
|
||||
{
|
||||
try {sasv slsvc -EA 1} catch {}
|
||||
}
|
||||
|
||||
DetectID $wslp $winApp ([ref]$cW1nd0ws)
|
||||
DetectID $wslp $o15App ([ref]$c0ff1ce15)
|
||||
DetectID $wslp $o14App ([ref]$c0ff1ce14)
|
||||
|
||||
if ($OsppHook -NE 0) {
|
||||
try {sasv osppsvc -EA 1} catch {}
|
||||
DetectID $oslp $o15App ([ref]$ospp15)
|
||||
DetectID $oslp $o14App ([ref]$ospp14)
|
||||
try {sasv $offsvc -EA 1} catch {}
|
||||
$ospp15 = DetectID $oslp $o15App
|
||||
$ospp14 = DetectID $oslp $o14App
|
||||
}
|
||||
|
||||
if ($null -NE $cW1nd0ws)
|
||||
if ($cW1nd0ws)
|
||||
{
|
||||
echoWindows
|
||||
GetID $wslp $winApp | foreach -EA 1 {
|
||||
GetResult $wslp $wsls $_
|
||||
Write-Host "$line3"
|
||||
if (!$All.IsPresent) {Write-Host}
|
||||
CONOUT "$line3"
|
||||
& $noAll
|
||||
}
|
||||
}
|
||||
elseif ($NT6)
|
||||
{
|
||||
echoWindows
|
||||
Write-Host
|
||||
Write-Host "Error: product key not found."
|
||||
CONOUT "`nError: product key not found."
|
||||
}
|
||||
|
||||
if ($winbuild -GE 9200) {
|
||||
@@ -981,39 +1094,43 @@ if ($c0ff1ce15 -Or $ospp15) {
|
||||
|
||||
$doMSG = 1
|
||||
|
||||
if ($null -NE $c0ff1ce15) {
|
||||
if ($c0ff1ce15)
|
||||
{
|
||||
echoOffice
|
||||
GetID $wslp $o15App | foreach -EA 1 {
|
||||
GetResult $wslp $wsls $_
|
||||
Write-Host "$line3"
|
||||
if (!$All.IsPresent) {Write-Host}
|
||||
CONOUT "$line3"
|
||||
& $noAll
|
||||
}
|
||||
}
|
||||
|
||||
if ($null -NE $c0ff1ce14) {
|
||||
if ($c0ff1ce14)
|
||||
{
|
||||
echoOffice
|
||||
GetID $wslp $o14App | foreach -EA 1 {
|
||||
GetResult $wslp $wsls $_
|
||||
Write-Host "$line3"
|
||||
if (!$All.IsPresent) {Write-Host}
|
||||
CONOUT "$line3"
|
||||
& $noAll
|
||||
}
|
||||
}
|
||||
|
||||
if ($null -NE $ospp15) {
|
||||
if ($ospp15)
|
||||
{
|
||||
echoOffice
|
||||
GetID $oslp $o15App | foreach -EA 1 {
|
||||
GetResult $oslp $osls $_
|
||||
Write-Host "$line3"
|
||||
if (!$All.IsPresent) {Write-Host}
|
||||
CONOUT "$line3"
|
||||
& $noAll
|
||||
}
|
||||
}
|
||||
|
||||
if ($null -NE $ospp14) {
|
||||
if ($ospp14)
|
||||
{
|
||||
echoOffice
|
||||
GetID $oslp $o14App | foreach -EA 1 {
|
||||
GetResult $oslp $osls $_
|
||||
Write-Host "$line3"
|
||||
if (!$All.IsPresent) {Write-Host}
|
||||
CONOUT "$line3"
|
||||
& $noAll
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,15 +1,12 @@
|
||||
@set masver=2.6
|
||||
@setlocal DisableDelayedExpansion
|
||||
@set masver=3.0
|
||||
@echo off
|
||||
|
||||
|
||||
|
||||
::============================================================================
|
||||
::
|
||||
:: This script is a part of 'Microsoft-Activation-Scripts' (MAS) project.
|
||||
::
|
||||
:: Homepage: mass grave[.]dev
|
||||
:: Email: windowsaddict@protonmail.com
|
||||
:: Email: mas.help@outlook.com
|
||||
::
|
||||
::============================================================================
|
||||
|
||||
@@ -17,37 +14,45 @@
|
||||
|
||||
::========================================================================================================================================
|
||||
|
||||
:: Set Path variable, it helps if it is misconfigured in the system
|
||||
:: Set environment variables, it helps if they are misconfigured in the system
|
||||
|
||||
set "PATH=%SystemRoot%\System32;%SystemRoot%\System32\wbem;%SystemRoot%\System32\WindowsPowerShell\v1.0\"
|
||||
setlocal EnableExtensions
|
||||
setlocal DisableDelayedExpansion
|
||||
|
||||
set "PathExt=.COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH;.MSC"
|
||||
|
||||
set "SysPath=%SystemRoot%\System32"
|
||||
set "Path=%SystemRoot%\System32;%SystemRoot%;%SystemRoot%\System32\Wbem;%SystemRoot%\System32\WindowsPowerShell\v1.0\"
|
||||
if exist "%SystemRoot%\Sysnative\reg.exe" (
|
||||
set "PATH=%SystemRoot%\Sysnative;%SystemRoot%\Sysnative\wbem;%SystemRoot%\Sysnative\WindowsPowerShell\v1.0\;%PATH%"
|
||||
set "SysPath=%SystemRoot%\Sysnative"
|
||||
set "Path=%SystemRoot%\Sysnative;%SystemRoot%;%SystemRoot%\Sysnative\Wbem;%SystemRoot%\Sysnative\WindowsPowerShell\v1.0\;%Path%"
|
||||
)
|
||||
|
||||
set "ComSpec=%SysPath%\cmd.exe"
|
||||
set "PSModulePath=%ProgramFiles%\WindowsPowerShell\Modules;%SysPath%\WindowsPowerShell\v1.0\Modules"
|
||||
|
||||
set re1=
|
||||
set re2=
|
||||
set "_cmdf=%~f0"
|
||||
for %%# in (%*) do (
|
||||
if /i "%%#"=="re1" set re1=1
|
||||
if /i "%%#"=="re2" set re2=1
|
||||
)
|
||||
|
||||
:: Re-launch the script with x64 process if it was initiated by x86 process on x64 bit Windows
|
||||
:: or with ARM64 process if it was initiated by x86/ARM32 process on ARM64 Windows
|
||||
|
||||
set "_cmdf=%~f0"
|
||||
for %%# in (%*) do (
|
||||
if /i "%%#"=="r1" set r1=1
|
||||
if /i "%%#"=="r2" set r2=1
|
||||
if /i "%%#"=="-qedit" (
|
||||
reg add HKCU\Console /v QuickEdit /t REG_DWORD /d "1" /f %nul1%
|
||||
rem check the code below admin elevation to understand why it's here
|
||||
)
|
||||
)
|
||||
|
||||
if exist %SystemRoot%\Sysnative\cmd.exe if not defined r1 (
|
||||
if exist %SystemRoot%\Sysnative\cmd.exe if not defined re1 (
|
||||
setlocal EnableDelayedExpansion
|
||||
start %SystemRoot%\Sysnative\cmd.exe /c ""!_cmdf!" %* r1"
|
||||
start %SystemRoot%\Sysnative\cmd.exe /c ""!_cmdf!" %* re1"
|
||||
exit /b
|
||||
)
|
||||
|
||||
:: Re-launch the script with ARM32 process if it was initiated by x64 process on ARM64 Windows
|
||||
|
||||
if exist %SystemRoot%\SysArm32\cmd.exe if %PROCESSOR_ARCHITECTURE%==AMD64 if not defined r2 (
|
||||
if exist %SystemRoot%\SysArm32\cmd.exe if %PROCESSOR_ARCHITECTURE%==AMD64 if not defined re2 (
|
||||
setlocal EnableDelayedExpansion
|
||||
start %SystemRoot%\SysArm32\cmd.exe /c ""!_cmdf!" %* r2"
|
||||
start %SystemRoot%\SysArm32\cmd.exe /c ""!_cmdf!" %* re2"
|
||||
exit /b
|
||||
)
|
||||
|
||||
@@ -64,10 +69,10 @@ echo:
|
||||
echo Null service is not running, script may crash...
|
||||
echo:
|
||||
echo:
|
||||
echo Help - %mas%troubleshoot.html
|
||||
echo Help - %mas%fix_service
|
||||
echo:
|
||||
echo:
|
||||
ping 127.0.0.1 -n 10
|
||||
ping 127.0.0.1 -n 20
|
||||
)
|
||||
cls
|
||||
|
||||
@@ -76,9 +81,13 @@ cls
|
||||
pushd "%~dp0"
|
||||
>nul findstr /v "$" "%~nx0" && (
|
||||
echo:
|
||||
echo Error: Script either has LF line ending issue or an empty line at the end of the script is missing.
|
||||
echo Error - Script either has LF line ending issue or an empty line at the end of the script is missing.
|
||||
echo:
|
||||
ping 127.0.0.1 -n 6 >nul
|
||||
echo:
|
||||
echo Help - %mas%troubleshoot
|
||||
echo:
|
||||
echo:
|
||||
ping 127.0.0.1 -n 20 >nul
|
||||
popd
|
||||
exit /b
|
||||
)
|
||||
@@ -88,13 +97,16 @@ popd
|
||||
|
||||
cls
|
||||
color 07
|
||||
title Extract $OEM$ Folder %masver%
|
||||
title Extract $OEM$ Folder %masver%
|
||||
|
||||
set _args=
|
||||
set _elev=
|
||||
set _unattended=0
|
||||
|
||||
set _args=%*
|
||||
if defined _args set _args=%_args:"=%
|
||||
if defined _args set _args=%_args:re1=%
|
||||
if defined _args set _args=%_args:re2=%
|
||||
if defined _args (
|
||||
for %%A in (%_args%) do (
|
||||
if /i "%%A"=="-el" set _elev=1
|
||||
@@ -106,54 +118,30 @@ set "nul2=2>nul"
|
||||
set "nul6=2^>nul"
|
||||
set "nul=>nul 2>&1"
|
||||
|
||||
set psc=powershell.exe
|
||||
set winbuild=1
|
||||
for /f "tokens=6 delims=[]. " %%G in ('ver') do set winbuild=%%G
|
||||
|
||||
set _NCS=1
|
||||
if %winbuild% LSS 10586 set _NCS=0
|
||||
if %winbuild% GEQ 10586 reg query "HKCU\Console" /v ForceV2 %nul2% | find /i "0x0" %nul1% && (set _NCS=0)
|
||||
|
||||
if %_NCS% EQU 1 (
|
||||
for /F %%a in ('echo prompt $E ^| cmd') do set "esc=%%a"
|
||||
set "Red="41;97m""
|
||||
set "Gray="100;97m""
|
||||
set "Green="42;97m""
|
||||
set "Blue="44;97m""
|
||||
set "_White="40;37m""
|
||||
set "_Green="40;92m""
|
||||
set "_Yellow="40;93m""
|
||||
) else (
|
||||
set "Red="Red" "white""
|
||||
set "Gray="Darkgray" "white""
|
||||
set "Green="DarkGreen" "white""
|
||||
set "Blue="Blue" "white""
|
||||
set "_White="Black" "Gray""
|
||||
set "_Green="Black" "Green""
|
||||
set "_Yellow="Black" "Yellow""
|
||||
)
|
||||
|
||||
set "nceline=echo: &echo ==== ERROR ==== &echo:"
|
||||
set "eline=echo: &call :ex_color %Red% "==== ERROR ====" &echo:"
|
||||
call :dk_setvar
|
||||
|
||||
::========================================================================================================================================
|
||||
|
||||
if %winbuild% EQU 1 (
|
||||
%eline%
|
||||
echo Failed to detect Windows build number.
|
||||
echo:
|
||||
setlocal EnableDelayedExpansion
|
||||
set fixes=%fixes% %mas%troubleshoot
|
||||
call :dk_color2 %Blue% "Help - " %_Yellow% " %mas%troubleshoot"
|
||||
goto dk_done
|
||||
)
|
||||
|
||||
if %winbuild% LSS 7600 (
|
||||
%nceline%
|
||||
echo Unsupported OS version detected [%winbuild%].
|
||||
echo Project is supported only for Windows 7/8/8.1/10/11 and their Server equivalent.
|
||||
goto done2
|
||||
)
|
||||
|
||||
for %%# in (powershell.exe) do @if "%%~$PATH:#"=="" (
|
||||
%nceline%
|
||||
echo Unable to find powershell.exe in the system.
|
||||
echo Project is supported only for Windows 7/8/8.1/10/11 and their Server equivalents.
|
||||
goto done2
|
||||
)
|
||||
|
||||
::========================================================================================================================================
|
||||
|
||||
:: Fix special characters limitation in path name
|
||||
:: Fix special character limitations in path name
|
||||
|
||||
set "_work=%~dp0"
|
||||
if "%_work:~-1%"=="\" set "_work=%_work:~0,-1%"
|
||||
@@ -162,6 +150,8 @@ set "_batf=%~f0"
|
||||
set "_batp=%_batf:'=''%"
|
||||
|
||||
set _PSarg="""%~f0""" -el %_args%
|
||||
set _PSarg=%_PSarg:'=''%
|
||||
|
||||
set "_ttemp=%userprofile%\AppData\Local\Temp"
|
||||
|
||||
setlocal EnableDelayedExpansion
|
||||
@@ -171,8 +161,8 @@ setlocal EnableDelayedExpansion
|
||||
echo "!_batf!" | find /i "!_ttemp!" %nul1% && (
|
||||
if /i not "!_work!"=="!_ttemp!" (
|
||||
%eline%
|
||||
echo Script is launched from the temp folder,
|
||||
echo Most likely you are running the script directly from the archive file.
|
||||
echo The script was launched from the temp folder.
|
||||
echo You are most likely running the script directly from the archive file.
|
||||
echo:
|
||||
echo Extract the archive file and launch the script from the extracted folder.
|
||||
goto done2
|
||||
@@ -181,56 +171,116 @@ goto done2
|
||||
|
||||
::========================================================================================================================================
|
||||
|
||||
:: Elevate script as admin and pass arguments and preventing loop
|
||||
:: Check PowerShell
|
||||
|
||||
%nul1% fltmc || (
|
||||
if not defined _elev %psc% "start cmd.exe -arg '/c \"!_PSarg:'=''!\"' -verb runas" && exit /b
|
||||
REM :PStest: $ExecutionContext.SessionState.LanguageMode :PStest:
|
||||
|
||||
cmd /c "%psc% "$f=[io.file]::ReadAllText('!_batp!') -split ':PStest:\s*';iex ($f[1])"" | find /i "FullLanguage" %nul1% || (
|
||||
%eline%
|
||||
echo This script needs admin rights.
|
||||
echo To do so, right click on this script and select 'Run as administrator'.
|
||||
cmd /c "%psc% "$ExecutionContext.SessionState.LanguageMode""
|
||||
echo:
|
||||
cmd /c "%psc% "$ExecutionContext.SessionState.LanguageMode"" | find /i "FullLanguage" %nul1% && (
|
||||
echo Failed to run Powershell command but Powershell is working.
|
||||
echo:
|
||||
cmd /c "%psc% ""$av = Get-WmiObject -Namespace root\SecurityCenter2 -Class AntiVirusProduct; $n = @(); foreach ($i in $av) { if ($i.displayName -notlike '*windows*') { $n += $i.displayName } }; if ($n) { Write-Host ('Installed 3rd party Antivirus might be blocking the script - ' + ($n -join ', ')) -ForegroundColor White -BackgroundColor Blue }"""
|
||||
echo:
|
||||
set fixes=%fixes% %mas%troubleshoot
|
||||
call :dk_color2 %Blue% "Help - " %_Yellow% " %mas%troubleshoot"
|
||||
) || (
|
||||
echo PowerShell is not working. Aborting...
|
||||
echo If you have applied restrictions on Powershell then undo those changes.
|
||||
echo:
|
||||
set fixes=%fixes% %mas%fix_powershell
|
||||
call :dk_color2 %Blue% "Help - " %_Yellow% " %mas%fix_powershell"
|
||||
)
|
||||
goto done2
|
||||
)
|
||||
|
||||
::========================================================================================================================================
|
||||
|
||||
:: This code disables QuickEdit for this cmd.exe session only without making permanent changes to the registry
|
||||
:: It is added because clicking on the script window pauses the operation and leads to the confusion that script stopped due to an error
|
||||
:: Elevate script as admin and pass arguments and preventing loop
|
||||
|
||||
for %%# in (%_args%) do (if /i "%%#"=="-qedit" set quedit=1)
|
||||
|
||||
reg query HKCU\Console /v QuickEdit %nul2% | find /i "0x0" %nul1% || if not defined quedit (
|
||||
reg add HKCU\Console /v QuickEdit /t REG_DWORD /d "0" /f %nul1%
|
||||
start cmd.exe /c ""!_batf!" %_args% -qedit"
|
||||
rem quickedit reset code is added at the starting of the script instead of here because it takes time to reflect in some cases
|
||||
exit /b
|
||||
%nul1% fltmc || (
|
||||
if not defined _elev %psc% "start cmd.exe -arg '/c \"!_PSarg!\"' -verb runas" && exit /b
|
||||
%eline%
|
||||
echo This script needs admin rights.
|
||||
echo Right click on this script and select 'Run as administrator'.
|
||||
goto done2
|
||||
)
|
||||
|
||||
::========================================================================================================================================
|
||||
|
||||
:: Disable QuickEdit and launch from conhost.exe to avoid Terminal app
|
||||
|
||||
if %winbuild% GEQ 17763 (
|
||||
set terminal=1
|
||||
) else (
|
||||
set terminal=
|
||||
)
|
||||
|
||||
:: Check if script is running in Terminal app
|
||||
|
||||
set r1=$TB = [AppDomain]::CurrentDomain.DefineDynamicAssembly(4, 1).DefineDynamicModule(2, $False).DefineType(0);
|
||||
set r2=%r1% [void]$TB.DefinePInvokeMethod('GetConsoleWindow', 'kernel32.dll', 22, 1, [IntPtr], @(), 1, 3).SetImplementationFlags(128);
|
||||
set r3=%r2% [void]$TB.DefinePInvokeMethod('SendMessageW', 'user32.dll', 22, 1, [IntPtr], @([IntPtr], [UInt32], [IntPtr], [IntPtr]), 1, 3).SetImplementationFlags(128);
|
||||
set d1=%r3% $hIcon = $TB.CreateType(); $hWnd = $hIcon::GetConsoleWindow();
|
||||
set d2=%d1% echo $($hIcon::SendMessageW($hWnd, 127, 0, 0) -ne [IntPtr]::Zero);
|
||||
|
||||
if defined terminal (
|
||||
%psc% "%d2%" %nul2% | find /i "True" %nul1% && set terminal=
|
||||
)
|
||||
|
||||
if defined ps32onArm goto :skipQE
|
||||
if %_unattended%==1 goto :skipQE
|
||||
for %%# in (%_args%) do (if /i "%%#"=="-qedit" goto :skipQE)
|
||||
|
||||
if defined terminal (
|
||||
set "launchcmd=start conhost.exe %psc%"
|
||||
) else (
|
||||
set "launchcmd=%psc%"
|
||||
)
|
||||
|
||||
:: Disable QuickEdit in current session
|
||||
|
||||
set "d1=$t=[AppDomain]::CurrentDomain.DefineDynamicAssembly(4, 1).DefineDynamicModule(2, $False).DefineType(0);"
|
||||
set "d2=$t.DefinePInvokeMethod('GetStdHandle', 'kernel32.dll', 22, 1, [IntPtr], @([Int32]), 1, 3).SetImplementationFlags(128);"
|
||||
set "d3=$t.DefinePInvokeMethod('SetConsoleMode', 'kernel32.dll', 22, 1, [Boolean], @([IntPtr], [Int32]), 1, 3).SetImplementationFlags(128);"
|
||||
set "d4=$k=$t.CreateType(); $b=$k::SetConsoleMode($k::GetStdHandle(-10), 0x0080);"
|
||||
|
||||
%launchcmd% "%d1% %d2% %d3% %d4% & cmd.exe '/c' '!_PSarg! -qedit'" && (exit /b) || (set terminal=1)
|
||||
:skipQE
|
||||
|
||||
::========================================================================================================================================
|
||||
|
||||
:: Check for updates
|
||||
|
||||
set -=
|
||||
set old=
|
||||
set upver=%masver:.=%
|
||||
|
||||
for /f "delims=[] tokens=2" %%# in ('ping -4 -n 1 updatecheck.mass%-%grave.dev') do (
|
||||
if not [%%#]==[] (echo "%%#" | find "127.69" %nul1% && (echo "%%#" | find "127.69.%masver%" %nul1% || set old=1))
|
||||
for /f "delims=[] tokens=2" %%# in ('ping -4 -n 1 activ%-%ated.win') do (
|
||||
if not "%%#"=="" set old=1
|
||||
for /f "delims=[] tokens=2" %%# in ('ping -4 -n 1 updatecheck%upver%.activ%-%ated.win') do (
|
||||
if not "%%#"=="" set old=
|
||||
)
|
||||
)
|
||||
|
||||
if defined old (
|
||||
echo ________________________________________________
|
||||
%eline%
|
||||
echo You are running outdated version MAS %masver%
|
||||
echo Your version of MAS [%masver%] is outdated.
|
||||
echo ________________________________________________
|
||||
echo:
|
||||
if not %_unattended%==1 (
|
||||
echo [1] Get Latest MAS
|
||||
echo [0] Continue Anyway
|
||||
echo:
|
||||
call :ex_color %_Green% "Enter a menu option in the Keyboard [1,0] :"
|
||||
call :dk_color %_Green% "Choose a menu option using your keyboard [1,0] :"
|
||||
choice /C:10 /N
|
||||
if !errorlevel!==2 rem
|
||||
if !errorlevel!==1 (start ht%-%tps://github.com/mass%-%gravel/Microsoft-Acti%-%vation-Scripts & start %mas% & exit /b)
|
||||
if !errorlevel!==1 (start %mas% & exit /b)
|
||||
)
|
||||
)
|
||||
cls
|
||||
|
||||
::========================================================================================================================================
|
||||
|
||||
@@ -247,7 +297,7 @@ set "_dir=%desktop%\$OEM$\$$\Setup\Scripts"
|
||||
|
||||
if exist "!desktop!\" (
|
||||
%eline%
|
||||
echo Desktop location was not detected, aborting...
|
||||
echo Unable to detect Desktop location, aborting...
|
||||
goto done2
|
||||
)
|
||||
|
||||
@@ -255,12 +305,12 @@ setlocal EnableDelayedExpansion
|
||||
|
||||
::========================================================================================================================================
|
||||
|
||||
mode con cols=78 lines=30
|
||||
if not defined terminal mode 78, 30
|
||||
|
||||
if exist "!desktop!\$OEM$\" (
|
||||
echo _____________________________________________________
|
||||
%eline%
|
||||
echo $OEM$ folder already exists on the Desktop.
|
||||
echo The $OEM$ folder already exists on your Desktop.
|
||||
echo _____________________________________________________
|
||||
goto done2
|
||||
)
|
||||
@@ -269,6 +319,7 @@ set HWID_Activation.cmd=Activators\HWID_Activation.cmd
|
||||
set KMS38_Activation.cmd=Activators\KMS38_Activation.cmd
|
||||
set Online_KMS_Activation.cmd=Activators\Online_KMS_Activation.cmd
|
||||
set Ohook_Activation_AIO.cmd=Activators\Ohook_Activation_AIO.cmd
|
||||
set TSforge_Activation.cmd=Activators\TSforge_Activation.cmd
|
||||
pushd "!_work!"
|
||||
|
||||
set _nofile=
|
||||
@@ -277,6 +328,7 @@ for %%# in (
|
||||
%KMS38_Activation.cmd%
|
||||
%Online_KMS_Activation.cmd%
|
||||
%Ohook_Activation_AIO.cmd%
|
||||
%TSforge_Activation.cmd%
|
||||
) do (
|
||||
if not exist "%%#" set _nofile=1
|
||||
)
|
||||
@@ -296,42 +348,40 @@ goto done2
|
||||
:Menu
|
||||
|
||||
cls
|
||||
mode con cols=78 lines=30
|
||||
if not defined terminal mode 78, 30
|
||||
echo:
|
||||
echo:
|
||||
echo:
|
||||
echo:
|
||||
echo: Extract $OEM$ folder on the desktop
|
||||
echo: ________________________________________________________
|
||||
echo: ____________________________________________________________
|
||||
echo:
|
||||
echo: [1] HWID
|
||||
echo: [2] Ohook
|
||||
echo: [3] KMS38
|
||||
echo: [4] Online KMS
|
||||
echo: [1] HWID [Windows]
|
||||
echo: [2] Ohook [Office]
|
||||
echo: [3] TSforge [Windows / ESU / Office]
|
||||
echo: [4] KMS38 [Windows]
|
||||
echo: [5] Online KMS [Windows / Office]
|
||||
echo:
|
||||
echo: [5] HWID ^(Windows^) ^+ Ohook ^(Office^)
|
||||
echo: [6] HWID ^(Windows^) ^+ Online KMS ^(Office^)
|
||||
echo: [7] KMS38 ^(Windows^) ^+ Ohook ^(Office^)
|
||||
echo: [8] KMS38 ^(Windows^) ^+ Online KMS ^(Office^)
|
||||
echo: [9] Online KMS ^(Windows^) ^+ Ohook ^(Office^)
|
||||
echo: [6] HWID [Windows] ^+ Ohook [Office]
|
||||
echo: [7] HWID [Windows] ^+ Ohook [Office] ^+ TSforge [ESU]
|
||||
echo: [8] TSforge [Windows] ^+ Online KMS [Office]
|
||||
echo:
|
||||
call :ex_color2 %_White% " [R] " %_Green% "ReadMe"
|
||||
echo: [0] Exit
|
||||
echo: ________________________________________________________
|
||||
call :dk_color2 %_White% " [R] " %_Green% "ReadMe"
|
||||
echo: [0] Exit
|
||||
echo: ____________________________________________________________
|
||||
echo:
|
||||
call :ex_color2 %_White% " " %_Green% "Enter a menu option in the Keyboard :"
|
||||
choice /C:123456789R0 /N
|
||||
call :dk_color2 %_White% " " %_Green% "Choose a menu option using your keyboard :"
|
||||
choice /C:12345678R0 /N
|
||||
set _erl=%errorlevel%
|
||||
|
||||
if %_erl%==11 exit /b
|
||||
if %_erl%==10 start %mas%oem-folder.html &goto :Menu
|
||||
if %_erl%==9 goto:kms_ohook
|
||||
if %_erl%==8 goto:kms38_kms
|
||||
if %_erl%==7 goto:kms38_ohook
|
||||
if %_erl%==6 goto:hwid_kms
|
||||
if %_erl%==5 goto:hwid_ohook
|
||||
if %_erl%==4 goto:kms
|
||||
if %_erl%==3 goto:kms38
|
||||
if %_erl%==10 exit /b
|
||||
if %_erl%==9 start %mas%oem-folder &goto :Menu
|
||||
if %_erl%==8 goto:tsforge_kms
|
||||
if %_erl%==7 goto:hwid_ohook_tsforge
|
||||
if %_erl%==6 goto:hwid_ohook
|
||||
if %_erl%==5 goto:kms
|
||||
if %_erl%==4 goto:kms38
|
||||
if %_erl%==3 goto:tsforge
|
||||
if %_erl%==2 goto:ohook
|
||||
if %_erl%==1 goto:hwid
|
||||
goto :Menu
|
||||
@@ -398,6 +448,36 @@ cd \
|
||||
|
||||
::========================================================================================================================================
|
||||
|
||||
:tsforge
|
||||
|
||||
cls
|
||||
md "!desktop!\$OEM$\$$\Setup\Scripts"
|
||||
pushd "!_work!"
|
||||
copy /y /b "%TSforge_Activation.cmd%" "!_dir!\TSforge_Activation.cmd" %nul%
|
||||
popd
|
||||
call :export tsforge_setup
|
||||
|
||||
set _error=
|
||||
if not exist "!_dir!\TSforge_Activation.cmd" set _error=1
|
||||
if not exist "!_dir!\SetupComplete.cmd" set _error=1
|
||||
if defined _error goto errorfound
|
||||
|
||||
set oem=TSforge
|
||||
goto done
|
||||
|
||||
:tsforge_setup:
|
||||
@echo off
|
||||
|
||||
fltmc >nul || exit /b
|
||||
|
||||
call "%~dp0TSforge_Activation.cmd" /Z-WindowsESUOffice
|
||||
|
||||
cd \
|
||||
(goto) 2>nul & (if "%~dp0"=="%SystemRoot%\Setup\Scripts\" rd /s /q "%~dp0")
|
||||
:tsforge_setup:
|
||||
|
||||
::========================================================================================================================================
|
||||
|
||||
:kms38
|
||||
|
||||
cls
|
||||
@@ -450,7 +530,7 @@ goto done
|
||||
|
||||
fltmc >nul || exit /b
|
||||
|
||||
call "%~dp0Online_KMS_Activation.cmd" /KMS-ActAndRenewalTask /KMS-WindowsOffice
|
||||
call "%~dp0Online_KMS_Activation.cmd" /K-WindowsOffice
|
||||
|
||||
cd \
|
||||
(goto) 2>nul & (if "%~dp0"=="%SystemRoot%\Setup\Scripts\" rd /s /q "%~dp0")
|
||||
@@ -496,26 +576,28 @@ cd \
|
||||
|
||||
::========================================================================================================================================
|
||||
|
||||
:hwid_kms
|
||||
:hwid_ohook_tsforge
|
||||
|
||||
cls
|
||||
md "!desktop!\$OEM$\$$\Setup\Scripts"
|
||||
pushd "!_work!"
|
||||
copy /y /b "%HWID_Activation.cmd%" "!_dir!\HWID_Activation.cmd" %nul%
|
||||
copy /y /b "%Online_KMS_Activation.cmd%" "!_dir!\Online_KMS_Activation.cmd" %nul%
|
||||
copy /y /b "%Ohook_Activation_AIO.cmd%" "!_dir!\Ohook_Activation_AIO.cmd" %nul%
|
||||
copy /y /b "%TSforge_Activation.cmd%" "!_dir!\TSforge_Activation.cmd" %nul%
|
||||
popd
|
||||
call :export hwid_kms_setup
|
||||
call :export hwid_ohook_tsforge_setup
|
||||
|
||||
set _error=
|
||||
if not exist "!_dir!\HWID_Activation.cmd" set _error=1
|
||||
if not exist "!_dir!\Online_KMS_Activation.cmd" set _error=1
|
||||
if not exist "!_dir!\Ohook_Activation_AIO.cmd" set _error=1
|
||||
if not exist "!_dir!\TSforge_Activation.cmd" set _error=1
|
||||
if not exist "!_dir!\SetupComplete.cmd" set _error=1
|
||||
if defined _error goto errorfound
|
||||
|
||||
set oem=HWID [Windows] + Online KMS [Office]
|
||||
set oem=HWID [Windows] + Ohook [Office] + TSforge [ESU]
|
||||
goto done
|
||||
|
||||
:hwid_kms_setup:
|
||||
:hwid_ohook_tsforge_setup:
|
||||
@echo off
|
||||
|
||||
fltmc >nul || exit /b
|
||||
@@ -524,145 +606,73 @@ setlocal
|
||||
call "%~dp0HWID_Activation.cmd" /HWID
|
||||
endlocal
|
||||
|
||||
setlocal
|
||||
call "%~dp0Online_KMS_Activation.cmd" /KMS-ActAndRenewalTask /KMS-Office
|
||||
endlocal
|
||||
|
||||
cd \
|
||||
(goto) 2>nul & (if "%~dp0"=="%SystemRoot%\Setup\Scripts\" rd /s /q "%~dp0")
|
||||
:hwid_kms_setup:
|
||||
|
||||
::========================================================================================================================================
|
||||
|
||||
:kms38_ohook
|
||||
|
||||
cls
|
||||
md "!desktop!\$OEM$\$$\Setup\Scripts"
|
||||
pushd "!_work!"
|
||||
copy /y /b "%KMS38_Activation.cmd%" "!_dir!\KMS38_Activation.cmd" %nul%
|
||||
copy /y /b "%Ohook_Activation_AIO.cmd%" "!_dir!\Ohook_Activation_AIO.cmd" %nul%
|
||||
popd
|
||||
call :export kms38_ohook_setup
|
||||
|
||||
set _error=
|
||||
if not exist "!_dir!\KMS38_Activation.cmd" set _error=1
|
||||
if not exist "!_dir!\Ohook_Activation_AIO.cmd" set _error=1
|
||||
if not exist "!_dir!\SetupComplete.cmd" set _error=1
|
||||
if defined _error goto errorfound
|
||||
|
||||
set oem=KMS38 [Windows] + Ohook [Office]
|
||||
goto done
|
||||
|
||||
:kms38_ohook_setup:
|
||||
@echo off
|
||||
|
||||
fltmc >nul || exit /b
|
||||
|
||||
setlocal
|
||||
call "%~dp0KMS38_Activation.cmd" /KMS38
|
||||
endlocal
|
||||
|
||||
setlocal
|
||||
call "%~dp0Ohook_Activation_AIO.cmd" /Ohook
|
||||
endlocal
|
||||
|
||||
setlocal
|
||||
call "%~dp0TSforge_Activation.cmd" /Z-ESU
|
||||
endlocal
|
||||
|
||||
cd \
|
||||
(goto) 2>nul & (if "%~dp0"=="%SystemRoot%\Setup\Scripts\" rd /s /q "%~dp0")
|
||||
:kms38_ohook_setup:
|
||||
:hwid_ohook_tsforge_setup:
|
||||
|
||||
::========================================================================================================================================
|
||||
|
||||
:kms38_kms
|
||||
:tsforge_kms
|
||||
|
||||
cls
|
||||
md "!desktop!\$OEM$\$$\Setup\Scripts"
|
||||
pushd "!_work!"
|
||||
copy /y /b "%KMS38_Activation.cmd%" "!_dir!\KMS38_Activation.cmd" %nul%
|
||||
copy /y /b "%TSforge_Activation.cmd%" "!_dir!\TSforge_Activation.cmd" %nul%
|
||||
copy /y /b "%Online_KMS_Activation.cmd%" "!_dir!\Online_KMS_Activation.cmd" %nul%
|
||||
popd
|
||||
call :export kms38_kms_setup
|
||||
call :export tsforge_kms_setup
|
||||
|
||||
set _error=
|
||||
if not exist "!_dir!\KMS38_Activation.cmd" set _error=1
|
||||
if not exist "!_dir!\TSforge_Activation.cmd" set _error=1
|
||||
if not exist "!_dir!\Online_KMS_Activation.cmd" set _error=1
|
||||
if not exist "!_dir!\SetupComplete.cmd" set _error=1
|
||||
if defined _error goto errorfound
|
||||
|
||||
set oem=KMS38 [Windows] + Online KMS [Office]
|
||||
set oem=TSforge [Windows] + Online KMS [Office]
|
||||
goto done
|
||||
|
||||
:kms38_kms_setup:
|
||||
:tsforge_kms_setup:
|
||||
@echo off
|
||||
|
||||
fltmc >nul || exit /b
|
||||
|
||||
setlocal
|
||||
call "%~dp0KMS38_Activation.cmd" /KMS38
|
||||
call "%~dp0TSforge_Activation.cmd" /Z-Windows
|
||||
endlocal
|
||||
|
||||
setlocal
|
||||
call "%~dp0Online_KMS_Activation.cmd" /KMS-ActAndRenewalTask /KMS-Office
|
||||
call "%~dp0Online_KMS_Activation.cmd" /K-Office
|
||||
endlocal
|
||||
|
||||
cd \
|
||||
(goto) 2>nul & (if "%~dp0"=="%SystemRoot%\Setup\Scripts\" rd /s /q "%~dp0")
|
||||
:kms38_kms_setup:
|
||||
|
||||
::========================================================================================================================================
|
||||
|
||||
:kms_ohook
|
||||
|
||||
cls
|
||||
md "!desktop!\$OEM$\$$\Setup\Scripts"
|
||||
pushd "!_work!"
|
||||
copy /y /b "%Online_KMS_Activation.cmd%" "!_dir!\Online_KMS_Activation.cmd" %nul%
|
||||
copy /y /b "%Ohook_Activation_AIO.cmd%" "!_dir!\Ohook_Activation_AIO.cmd" %nul%
|
||||
popd
|
||||
call :export kms_ohook_setup
|
||||
|
||||
set _error=
|
||||
if not exist "!_dir!\Online_KMS_Activation.cmd" set _error=1
|
||||
if not exist "!_dir!\Ohook_Activation_AIO.cmd" set _error=1
|
||||
if not exist "!_dir!\SetupComplete.cmd" set _error=1
|
||||
if defined _error goto errorfound
|
||||
|
||||
set oem=Online KMS [Windows] + Ohook [Office]
|
||||
goto done
|
||||
|
||||
:kms_ohook_setup:
|
||||
@echo off
|
||||
|
||||
fltmc >nul || exit /b
|
||||
|
||||
setlocal
|
||||
call "%~dp0Online_KMS_Activation.cmd" /KMS-ActAndRenewalTask /KMS-Windows
|
||||
endlocal
|
||||
|
||||
setlocal
|
||||
call "%~dp0Ohook_Activation_AIO.cmd" /Ohook
|
||||
endlocal
|
||||
|
||||
cd \
|
||||
(goto) 2>nul & (if "%~dp0"=="%SystemRoot%\Setup\Scripts\" rd /s /q "%~dp0")
|
||||
:kms_ohook_setup:
|
||||
:tsforge_kms_setup:
|
||||
|
||||
::========================================================================================================================================
|
||||
|
||||
:errorfound
|
||||
|
||||
%eline%
|
||||
echo $OEM$ Folder was not created successfully...
|
||||
echo The script failed to create the $OEM$ folder.
|
||||
goto :done2
|
||||
|
||||
:done
|
||||
|
||||
echo ______________________________________________________________
|
||||
echo:
|
||||
call :ex_color %Blue% "%oem%"
|
||||
call :ex_color %Green% "$OEM$ folder is successfully created on the Desktop."
|
||||
call :dk_color %Blue% "%oem%"
|
||||
call :dk_color %Green% "$OEM$ folder was successfully created on your Desktop."
|
||||
echo "%oem%" | find /i "38" %nul% && (
|
||||
echo:
|
||||
echo To KMS38 activate Server Cor/Acor editions ^(No GUI Versions^),
|
||||
echo To KMS38 activate Server Cor/Acor editions [No GUI Versions],
|
||||
echo Check this page %mas%oem-folder
|
||||
)
|
||||
echo ______________________________________________________________
|
||||
@@ -670,8 +680,70 @@ echo ______________________________________________________________
|
||||
:done2
|
||||
|
||||
echo:
|
||||
call :ex_color %_Yellow% "Press any key to exit..."
|
||||
if defined fixes (
|
||||
call :dk_color %White% "Follow ALL the ABOVE blue lines. "
|
||||
call :dk_color2 %Blue% "Press [1] to Open Support Webpage " %Gray% " Press [0] to Ignore"
|
||||
choice /C:10 /N
|
||||
if !errorlevel!==1 (for %%# in (%fixes%) do (start %%#))
|
||||
)
|
||||
|
||||
if defined terminal (
|
||||
call :dk_color %_Yellow% "Press [0] key to %_exitmsg%..."
|
||||
choice /c 0 /n
|
||||
) else (
|
||||
call :dk_color %_Yellow% "Press any key to %_exitmsg%..."
|
||||
pause %nul1%
|
||||
)
|
||||
exit /b
|
||||
|
||||
::========================================================================================================================================
|
||||
|
||||
:: Set variables
|
||||
|
||||
:dk_setvar
|
||||
|
||||
set psc=powershell.exe
|
||||
set winbuild=1
|
||||
for /f "tokens=6 delims=[]. " %%G in ('ver') do set winbuild=%%G
|
||||
|
||||
set _NCS=1
|
||||
if %winbuild% LSS 10586 set _NCS=0
|
||||
if %winbuild% GEQ 10586 reg query "HKCU\Console" /v ForceV2 %nul2% | find /i "0x0" %nul1% && (set _NCS=0)
|
||||
|
||||
echo "%PROCESSOR_ARCHITECTURE% %PROCESSOR_ARCHITEW6432%" | find /i "ARM64" %nul1% && (if %winbuild% LSS 21277 set ps32onArm=1)
|
||||
|
||||
if %_NCS% EQU 1 (
|
||||
for /F %%a in ('echo prompt $E ^| cmd') do set "esc=%%a"
|
||||
set "Red="41;97m""
|
||||
set "Gray="100;97m""
|
||||
set "Green="42;97m""
|
||||
set "Blue="44;97m""
|
||||
set "White="107;91m""
|
||||
set "_Red="40;91m""
|
||||
set "_White="40;37m""
|
||||
set "_Green="40;92m""
|
||||
set "_Yellow="40;93m""
|
||||
) else (
|
||||
set "Red="Red" "white""
|
||||
set "Gray="Darkgray" "white""
|
||||
set "Green="DarkGreen" "white""
|
||||
set "Blue="Blue" "white""
|
||||
set "White="White" "Red""
|
||||
set "_Red="Black" "Red""
|
||||
set "_White="Black" "Gray""
|
||||
set "_Green="Black" "Green""
|
||||
set "_Yellow="Black" "Yellow""
|
||||
)
|
||||
|
||||
set "nceline=echo: &echo ==== ERROR ==== &echo:"
|
||||
set "eline=echo: &call :dk_color %Red% "==== ERROR ====" &echo:"
|
||||
if %~z0 GEQ 200000 (
|
||||
set "_exitmsg=Go back"
|
||||
set "_fixmsg=Go back to Main Menu, select Troubleshoot and run Fix Licensing option."
|
||||
) else (
|
||||
set "_exitmsg=Exit"
|
||||
set "_fixmsg=In MAS folder, run Troubleshoot script and select Fix Licensing option."
|
||||
)
|
||||
exit /b
|
||||
|
||||
::========================================================================================================================================
|
||||
@@ -685,21 +757,21 @@ exit /b
|
||||
|
||||
::========================================================================================================================================
|
||||
|
||||
:ex_color
|
||||
:dk_color
|
||||
|
||||
if %_NCS% EQU 1 (
|
||||
echo %esc%[%~1%~2%esc%[0m
|
||||
) else (
|
||||
if not exist %psc% (echo %~3) else (%psc% write-host -back '%1' -fore '%2' '%3')
|
||||
%psc% write-host -back '%1' -fore '%2' '%3'
|
||||
)
|
||||
exit /b
|
||||
|
||||
:ex_color2
|
||||
:dk_color2
|
||||
|
||||
if %_NCS% EQU 1 (
|
||||
echo %esc%[%~1%~2%esc%[%~3%~4%esc%[0m
|
||||
) else (
|
||||
if not exist %psc% (echo %~3%~6) else (%psc% write-host -back '%1' -fore '%2' '%3' -NoNewline; write-host -back '%4' -fore '%5' '%6')
|
||||
%psc% write-host -back '%1' -fore '%2' '%3' -NoNewline; write-host -back '%4' -fore '%5' '%6'
|
||||
)
|
||||
exit /b
|
||||
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
103
README.md
103
README.md
@@ -2,61 +2,108 @@
|
||||
|
||||
<h1 align="center">Microsoft Activation Scripts (MAS)</h1>
|
||||
|
||||
<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>
|
||||
|
||||
<p align="center">
|
||||
<a href="https://discord.gg/tVFN4N84PP"><img src="https://img.shields.io/badge/Chat%20with%20us%20on%20Discord--blue?style=social&logo=discord" alt="Chat with us without signup" title="Chat with us without signup"></a>
|
||||
<a href="https://www.reddit.com/r/MAS_Activator"><img src="https://img.shields.io/badge/MAS%20on%20Reddit--orange?style=social&logo=reddit" alt="MAS on Reddit" title="MAS on Reddit"></a>
|
||||
<a href="https://twitter.com/massgravel"><img src="https://img.shields.io/twitter/follow/massgravel" alt="Follow us on X" title="Follow us on X"></a>
|
||||
</p>
|
||||
<p align="center">Open-source Windows and Office activator featuring HWID, Ohook, TSforge, KMS38, and Online KMS activation methods, along with advanced troubleshooting.</p>
|
||||
|
||||
<hr>
|
||||
|
||||
## Download / How to use it?
|
||||
|
||||
### Method 1 - PowerShell (Recommended)
|
||||
### Method 1 - PowerShell (Windows 8 and later) ❤️
|
||||
|
||||
- Right-click on the Windows start menu and select PowerShell or Terminal (Not CMD).
|
||||
- Copy and paste the code below and press enter
|
||||
1. Open PowerShell (Not CMD). To do that, right-click on the Windows start menu and select PowerShell or Terminal.
|
||||
2. Copy and paste the code below and press enter
|
||||
```
|
||||
irm https://get.activated.win | iex
|
||||
```
|
||||
or (deprecated, will be retired on Aug 31 2024, use above instead)
|
||||
Alternatively, you can use the following (It will be deprecated in the future.)
|
||||
```
|
||||
irm https://massgrave.dev/get | iex
|
||||
```
|
||||
- You will see the activation options. Follow the on-screen instructions.
|
||||
- That's all.
|
||||
3. You will see the activation options. Choose (1) HWID for Windows activation. Choose (2) Ohook for Office activation.
|
||||
4. That's all.
|
||||
|
||||
---
|
||||
|
||||
- On older Windows builds you may need to run the below command before,
|
||||
`[Net.ServicePointManager]::SecurityProtocol=[Net.SecurityProtocolType]::Tls12`
|
||||
- The Powershell method does not work on Windows 7. Use the Method 2 - Traditional instead.
|
||||
- The URL get.activated.win may be blocked by some DNS services because it is a new domain.
|
||||
### Method 2 - Traditional (Windows 7 and later)
|
||||
|
||||
### Method 2 - Traditional
|
||||
<details>
|
||||
<summary>Click here for info</summary>
|
||||
|
||||
- Download the file under the code button from [GitHub](https://github.com/massgravel/Microsoft-Activation-Scripts) or [Bitbucket](https://bitbucket.org/WindowsAddict/microsoft-activation-scripts)
|
||||
- Right-click on the downloaded zip file and extract
|
||||
- In the extracted folder, find the folder named `All-In-One-Version`
|
||||
- Run the file named `MAS_AIO-CRC32_XXXXXXXX.cmd`
|
||||
- You will see the activation options, follow the on-screen instructions.
|
||||
- That's all.
|
||||
1. Download the file using the links provided below.
|
||||
`https://github.com/massgravel/Microsoft-Activation-Scripts/archive/refs/heads/master.zip`
|
||||
or
|
||||
`https://git.activated.win/massgrave/Microsoft-Activation-Scripts/archive/master.zip`
|
||||
2. Right-click on the downloaded zip file and extract
|
||||
3. In the extracted folder, find the folder named `All-In-One-Version`
|
||||
4. Run the file named `MAS_AIO.cmd`
|
||||
5. You will see the activation options, follow the on-screen instructions.
|
||||
6. That's all.
|
||||
|
||||
To run the scripts in unattended mode, check [here](https://massgrave.dev/command_line_switches)
|
||||
</details>
|
||||
|
||||
</br>
|
||||
---
|
||||
|
||||
### Not working ❓
|
||||
|
||||
- If you are **unable to launch MAS** using the PowerShell method, please refer to **Method 2** listed above.
|
||||
- If MAS is launched and the script shows any errors, check for any troubleshooting steps mentioned in blue color and try to follow those.
|
||||
- If you have any issues, please feel free to reach out to us [here](https://massgrave.dev/troubleshoot).
|
||||
|
||||
---
|
||||
|
||||
> [!NOTE]
|
||||
>
|
||||
> - The IRM command in PowerShell downloads a script from a specified URL, and the IEX command executes it.
|
||||
> - Always double-check the URL before executing the command and verify the source if manually downloading files.
|
||||
> - Be cautious, as some spread malware disguised as MAS by using different URLs in the IRM command.
|
||||
|
||||
---
|
||||
|
||||
To run the scripts in unattended mode, check [here](https://massgrave.dev/command_line_switches).
|
||||
|
||||
```
|
||||
Latest Version: 2.6
|
||||
Release date: 20-Apr-2024
|
||||
Latest Version: 3.0
|
||||
Release date: 14-Feb-2025
|
||||
```
|
||||
|
||||
### [Troubleshooting / Help](https://massgrave.dev/troubleshoot)
|
||||
### [Download Original Windows & Office](https://massgrave.dev/genuine-installation-media)
|
||||
### Homepage - [https://massgrave.dev/](https://massgrave.dev/)
|
||||
|
||||
<div align="center">
|
||||
|
||||
[![1.1]][1]
|
||||
[![1.2]][2]
|
||||
[![1.3]][3]
|
||||
|
||||
</div>
|
||||
|
||||
<div align="center">
|
||||
|
||||
[![1.4]][4]
|
||||
[![1.5]][5]
|
||||
[![1.6]][6]
|
||||
[![1.7]][7]
|
||||
|
||||
</div>
|
||||
|
||||
[1.1]: https://massgrave.dev/img/logo_github.png (GitHub)
|
||||
[1.2]: https://massgrave.dev/img/logo_azuredevops.png (AzureDevOps)
|
||||
[1.3]: https://massgrave.dev/img/logo_gitea.png (Self-hosted Git)
|
||||
|
||||
[1.4]: https://massgrave.dev/img/logo_discord.png (Chat with us without signup)
|
||||
[1.5]: https://massgrave.dev/img/logo_reddit.png (Reddit)
|
||||
[1.6]: https://massgrave.dev/img/logo_bluesky.png (Bluesky)
|
||||
[1.7]: https://massgrave.dev/img/logo_x.png (Twitter)
|
||||
|
||||
[1]: https://github.com/massgravel/Microsoft-Activation-Scripts
|
||||
[2]: https://dev.azure.com/massgrave/_git/Microsoft-Activation-Scripts
|
||||
[3]: https://git.activated.win/massgrave/Microsoft-Activation-Scripts
|
||||
[4]: https://discord.gg/j2yFsV5ZVC
|
||||
[5]: https://www.reddit.com/r/MAS_Activator
|
||||
[6]: https://bsky.app/profile/massgrave.dev
|
||||
[7]: https://twitter.com/massgravel
|
||||
|
||||
---
|
||||
|
||||
<p align="center">Made with Love ❤️</p>
|
||||
|
||||
Reference in New Issue
Block a user