mirror of
https://github.com/massgravel/Microsoft-Activation-Scripts.git
synced 2026-05-07 06:28:11 +00:00
Compare commits
41 Commits
deb74ab9b8
...
2.7
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
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 | ||
|
|
35e044ddc8 |
7
.gitattributes
vendored
7
.gitattributes
vendored
@@ -1,3 +1,4 @@
|
|||||||
# MAS export-ignore
|
MAS export-ignore
|
||||||
# LICENSE export-ignore
|
LICENSE export-ignore
|
||||||
# README.md 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
|
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
|
Public License instead of this License. But first, please read
|
||||||
<https://www.gnu.org/licenses/why-not-lgpl.html>.
|
<https://www.gnu.org/licenses/why-not-lgpl.html>.
|
||||||
|
|
||||||
|
|||||||
10255
MAS/All-In-One-Version-KL/MAS_AIO.cmd
Normal file
10255
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=2.7
|
||||||
@echo off
|
@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 EnableExtensions
|
||||||
setlocal DisableDelayedExpansion
|
setlocal DisableDelayedExpansion
|
||||||
@@ -160,22 +160,22 @@ call :dk_setvar
|
|||||||
if %winbuild% LSS 10240 (
|
if %winbuild% LSS 10240 (
|
||||||
%eline%
|
%eline%
|
||||||
echo Unsupported OS version detected [%winbuild%].
|
echo Unsupported OS version detected [%winbuild%].
|
||||||
echo HWID Activation is supported only for Windows 10/11.
|
echo HWID Activation is only supported on Windows 10/11.
|
||||||
echo:
|
echo:
|
||||||
call :dk_color %Blue% "Use Online KMS Activation option."
|
call :dk_color %Blue% "Use Online KMS activation option."
|
||||||
goto dk_done
|
goto dk_done
|
||||||
)
|
)
|
||||||
|
|
||||||
if exist "%SystemRoot%\Servicing\Packages\Microsoft-Windows-Server*Edition~*.mum" (
|
if exist "%SystemRoot%\Servicing\Packages\Microsoft-Windows-Server*Edition~*.mum" (
|
||||||
%eline%
|
%eline%
|
||||||
echo HWID Activation is not supported for Windows Server.
|
echo HWID Activation is not supported on Windows Server.
|
||||||
call :dk_color %Blue% "Use KMS38 or Online KMS Activation option."
|
call :dk_color %Blue% "Use KMS38 or Online KMS activation option."
|
||||||
goto dk_done
|
goto dk_done
|
||||||
)
|
)
|
||||||
|
|
||||||
::========================================================================================================================================
|
::========================================================================================================================================
|
||||||
|
|
||||||
:: Fix special characters limitation in path name
|
:: Fix special character limitations in path name
|
||||||
|
|
||||||
set "_work=%~dp0"
|
set "_work=%~dp0"
|
||||||
if "%_work:~-1%"=="\" set "_work=%_work:~0,-1%"
|
if "%_work:~-1%"=="\" set "_work=%_work:~0,-1%"
|
||||||
@@ -195,8 +195,8 @@ setlocal EnableDelayedExpansion
|
|||||||
echo "!_batf!" | find /i "!_ttemp!" %nul1% && (
|
echo "!_batf!" | find /i "!_ttemp!" %nul1% && (
|
||||||
if /i not "!_work!"=="!_ttemp!" (
|
if /i not "!_work!"=="!_ttemp!" (
|
||||||
%eline%
|
%eline%
|
||||||
echo Script is launched from the temp folder,
|
echo The script was launched from the temp folder.
|
||||||
echo Most likely you are running the script directly from the archive file.
|
echo You are most likely running the script directly from the archive file.
|
||||||
echo:
|
echo:
|
||||||
echo Extract the archive file and launch the script from the extracted folder.
|
echo Extract the archive file and launch the script from the extracted folder.
|
||||||
goto dk_done
|
goto dk_done
|
||||||
@@ -237,7 +237,7 @@ goto dk_done
|
|||||||
if not defined _elev %psc% "start cmd.exe -arg '/c \"!_PSarg!\"' -verb runas" && exit /b
|
if not defined _elev %psc% "start cmd.exe -arg '/c \"!_PSarg!\"' -verb runas" && exit /b
|
||||||
%eline%
|
%eline%
|
||||||
echo This script needs admin rights.
|
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
|
goto dk_done
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -290,20 +290,20 @@ set -=
|
|||||||
set old=
|
set old=
|
||||||
|
|
||||||
for /f "delims=[] tokens=2" %%# in ('ping -4 -n 1 updatecheck.mass%-%grave.dev') do (
|
for /f "delims=[] tokens=2" %%# in ('ping -4 -n 1 updatecheck.mass%-%grave.dev') do (
|
||||||
if not [%%#]==[] (echo "%%#" | find "127.69" %nul1% && (echo "%%#" | find "127.69.%masver%" %nul1% || set old=1))
|
if not "%%#"=="" (echo "%%#" | find "127.69" %nul1% && (echo "%%#" | find "127.69.%masver%" %nul1% || set old=1))
|
||||||
)
|
)
|
||||||
|
|
||||||
if defined old (
|
if defined old (
|
||||||
echo ________________________________________________
|
echo ________________________________________________
|
||||||
%eline%
|
%eline%
|
||||||
echo Version %masver% of MAS is outdated.
|
echo Your version of MAS [%masver%] is outdated.
|
||||||
echo ________________________________________________
|
echo ________________________________________________
|
||||||
echo:
|
echo:
|
||||||
if not %_unattended%==1 (
|
if not %_unattended%==1 (
|
||||||
echo [1] Get Latest MAS
|
echo [1] Get Latest MAS
|
||||||
echo [0] Continue Anyway
|
echo [0] Continue Anyway
|
||||||
echo:
|
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
|
choice /C:10 /N
|
||||||
if !errorlevel!==2 rem
|
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 ht%-%tps://github.com/mass%-%gravel/Microsoft-Acti%-%vation-Scripts & start %mas% & exit /b)
|
||||||
@@ -329,7 +329,7 @@ ClipUp.exe
|
|||||||
) do (
|
) do (
|
||||||
if not exist %SysPath%\%%# (
|
if not exist %SysPath%\%%# (
|
||||||
%eline%
|
%eline%
|
||||||
echo [%SysPath%\%%#] file is missing. Aborting...
|
echo [%SysPath%\%%#] file is missing, aborting...
|
||||||
echo:
|
echo:
|
||||||
set fixes=%fixes% %mas%troubleshoot
|
set fixes=%fixes% %mas%troubleshoot
|
||||||
call :dk_color2 %Blue% "Help - " %_Yellow% " %mas%troubleshoot"
|
call :dk_color2 %Blue% "Help - " %_Yellow% " %mas%troubleshoot"
|
||||||
@@ -356,12 +356,12 @@ if defined _perm (
|
|||||||
cls
|
cls
|
||||||
echo ___________________________________________________________________________________________
|
echo ___________________________________________________________________________________________
|
||||||
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."
|
call :dk_color2 %_White% " " %Gray% "Activation is not required."
|
||||||
echo ___________________________________________________________________________________________
|
echo ___________________________________________________________________________________________
|
||||||
if %_unattended%==1 goto dk_done
|
if %_unattended%==1 goto dk_done
|
||||||
echo:
|
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
|
if errorlevel 2 exit /b
|
||||||
)
|
)
|
||||||
cls
|
cls
|
||||||
@@ -375,7 +375,7 @@ reg query "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion" /v EditionID %nul2
|
|||||||
%eline%
|
%eline%
|
||||||
echo [%winos% ^| %winbuild%]
|
echo [%winos% ^| %winbuild%]
|
||||||
echo:
|
echo:
|
||||||
echo Evaluation Editions cannot be activated outside of evaluation period.
|
echo Evaluation editions cannot be activated outside of their evaluation period.
|
||||||
echo:
|
echo:
|
||||||
set fixes=%fixes% %mas%evaluation_editions
|
set fixes=%fixes% %mas%evaluation_editions
|
||||||
call :dk_color2 %Blue% "Help - " %_Yellow% " %mas%evaluation_editions"
|
call :dk_color2 %Blue% "Help - " %_Yellow% " %mas%evaluation_editions"
|
||||||
@@ -395,7 +395,7 @@ call :dk_showosinfo
|
|||||||
|
|
||||||
set _int=
|
set _int=
|
||||||
for %%a in (l.root-servers.net resolver1.opendns.com download.windowsupdate.com google.com) do if not defined _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 (
|
if not defined _int (
|
||||||
@@ -408,7 +408,7 @@ echo Checking Internet Connection [Connected%ping_f%]
|
|||||||
) else (
|
) else (
|
||||||
set error=1
|
set error=1
|
||||||
call :dk_color %Red% "Checking Internet Connection [Not Connected]"
|
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."
|
||||||
)
|
)
|
||||||
|
|
||||||
::========================================================================================================================================
|
::========================================================================================================================================
|
||||||
@@ -457,13 +457,13 @@ if not defined key (
|
|||||||
%eline%
|
%eline%
|
||||||
echo [%winos% ^| %winbuild% ^| SKU:%osSKU%]
|
echo [%winos% ^| %winbuild% ^| SKU:%osSKU%]
|
||||||
if not defined skunotfound (
|
if not defined skunotfound (
|
||||||
echo This product does not support HWID Activation.
|
echo This product does not support HWID activation.
|
||||||
echo Try KMS38 Activation option.
|
echo Make sure you are using the latest version of the script.
|
||||||
echo Make sure you are using updated version of the script.
|
echo If you are, then try KMS38 activation option.
|
||||||
set fixes=%fixes% %mas%
|
set fixes=%fixes% %mas%
|
||||||
echo %mas%
|
echo %mas%
|
||||||
) else (
|
) 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
|
set fixes=%fixes% %mas%troubleshoot
|
||||||
call :dk_color2 %Blue% "Help - " %_Yellow% " %mas%troubleshoot"
|
call :dk_color2 %Blue% "Help - " %_Yellow% " %mas%troubleshoot"
|
||||||
)
|
)
|
||||||
@@ -479,12 +479,12 @@ if defined notworking set error=1
|
|||||||
|
|
||||||
echo:
|
echo:
|
||||||
if defined changekey (
|
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:
|
echo:
|
||||||
)
|
)
|
||||||
|
|
||||||
if defined winsub (
|
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:
|
echo:
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -526,7 +526,7 @@ call :hwiddata ticket
|
|||||||
copy /y /b "%tdir%\GenuineTicket" "%tdir%\GenuineTicket.xml" %nul%
|
copy /y /b "%tdir%\GenuineTicket" "%tdir%\GenuineTicket.xml" %nul%
|
||||||
|
|
||||||
if not exist "%tdir%\GenuineTicket.xml" (
|
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%]
|
echo [%encoded%]
|
||||||
if exist "%tdir%\Genuine*" del /f /q "%tdir%\Genuine*" %nul%
|
if exist "%tdir%\Genuine*" del /f /q "%tdir%\Genuine*" %nul%
|
||||||
goto :dl_final
|
goto :dl_final
|
||||||
@@ -544,7 +544,7 @@ set "_xmlexist=if exist "%tdir%\GenuineTicket.xml""
|
|||||||
%_xmlexist% (
|
%_xmlexist% (
|
||||||
set error=1
|
set error=1
|
||||||
if exist "%tdir%\*.xml" del /f /q "%tdir%\*.xml" %nul%
|
if exist "%tdir%\*.xml" del /f /q "%tdir%\*.xml" %nul%
|
||||||
call :dk_color %Red% "Installing GenuineTicket.xml [Failed With ClipSVC Service Restart, Wait...]"
|
call :dk_color %Red% "Installing GenuineTicket.xml [Failed with ClipSVC service restart, wait...]"
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -604,7 +604,7 @@ reg delete "%_ident%" /f %nul%
|
|||||||
reg query "%_ident%" %nul% && (
|
reg query "%_ident%" %nul% && (
|
||||||
echo:
|
echo:
|
||||||
set error=1
|
set error=1
|
||||||
call :dk_color %Red% "Deleting an IdentityCRL Registry [Failed] [%_ident%]"
|
call :dk_color %Red% "Deleting IdentityCRL Registry [Failed] [%_ident%]"
|
||||||
)
|
)
|
||||||
for %%# in (wlidsvc LicenseManager sppsvc) do (%psc% "Start-Job { Restart-Service %%# } | Wait-Job -Timeout 10 | Out-Null")
|
for %%# in (wlidsvc LicenseManager sppsvc) do (%psc% "Start-Job { Restart-Service %%# } | Wait-Job -Timeout 10 | Out-Null")
|
||||||
call :dk_refresh
|
call :dk_refresh
|
||||||
@@ -639,7 +639,7 @@ if not defined resfail (
|
|||||||
if defined resfail (
|
if defined resfail (
|
||||||
set error=1
|
set error=1
|
||||||
echo:
|
echo:
|
||||||
call :dk_color %Red% "Checking Licensing Servers [Failed To Connect]"
|
call :dk_color %Red% "Checking Licensing Servers [Failed to Connect]"
|
||||||
set fixes=%fixes% %mas%licensing-servers-issue
|
set fixes=%fixes% %mas%licensing-servers-issue
|
||||||
call :dk_color2 %Blue% "Help - " %_Yellow% " %mas%licensing-servers-issue"
|
call :dk_color2 %Blue% "Help - " %_Yellow% " %mas%licensing-servers-issue"
|
||||||
)
|
)
|
||||||
@@ -702,8 +702,8 @@ call :dk_color %Green% "%winos% is permanently activated with a digital license.
|
|||||||
) else (
|
) else (
|
||||||
call :dk_color %Red% "Activation Failed %error_code%"
|
call :dk_color %Red% "Activation Failed %error_code%"
|
||||||
if defined notworking (
|
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% "At the time of writing, HWID Activation is not supported for this product."
|
||||||
call :dk_color %Blue% "Use KMS38 Activation option."
|
call :dk_color %Blue% "Use KMS38 activation option instead."
|
||||||
) else (
|
) else (
|
||||||
if not defined error call :dk_color %Blue% "%_fixmsg%"
|
if not defined error call :dk_color %Blue% "%_fixmsg%"
|
||||||
set fixes=%fixes% %mas%troubleshoot
|
set fixes=%fixes% %mas%troubleshoot
|
||||||
@@ -992,7 +992,7 @@ function ReinstallLicenses() {
|
|||||||
|
|
||||||
set _wmic=0
|
set _wmic=0
|
||||||
for %%# in (wmic.exe) do @if not "%%~$PATH:#"=="" (
|
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
|
exit /b
|
||||||
|
|
||||||
@@ -1072,7 +1072,7 @@ set pupfound=%pupfound1%%pupfound2%
|
|||||||
set hcount=0
|
set hcount=0
|
||||||
for %%# in (avira.com kaspersky.com virustotal.com mcafee.com) do (
|
for %%# in (avira.com kaspersky.com virustotal.com mcafee.com) do (
|
||||||
find /i "%%#" %SysPath%\drivers\etc\hosts %nul% && set /a hcount+=1)
|
find /i "%%#" %SysPath%\drivers\etc\hosts %nul% && set /a hcount+=1)
|
||||||
if %hcount%==4 set "results=[AV URLs are blocked in hosts]"
|
if %hcount%==4 set "results=[Antivirus URLs are blocked in hosts]"
|
||||||
|
|
||||||
set wucount=0
|
set wucount=0
|
||||||
for %%# in (wuauserv) do (
|
for %%# in (wuauserv) do (
|
||||||
@@ -1081,7 +1081,7 @@ for %%G in (DependOnService Description DisplayName ErrorControl ImagePath Objec
|
|||||||
reg query HKLM\SYSTEM\CurrentControlSet\Services\%%# /v %%G %nul% || (set _corrupt=1 & set /a wucount+=1)
|
reg query HKLM\SYSTEM\CurrentControlSet\Services\%%# /v %%G %nul% || (set _corrupt=1 & set /a wucount+=1)
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
if %wucount% GEQ 1 set "results=%results%[WU registry is corrupt]"
|
if %wucount% GEQ 1 set "results=%results%[Windows Update registry is corrupt]"
|
||||||
|
|
||||||
sc start sppsvc %nul%
|
sc start sppsvc %nul%
|
||||||
echo "%errorlevel%" | findstr "577 225" %nul% && (
|
echo "%errorlevel%" | findstr "577 225" %nul% && (
|
||||||
@@ -1092,7 +1092,8 @@ if not exist %SysPath%\sppsvc.exe if not exist %SysPath%\alg.exe (set "results=%
|
|||||||
|
|
||||||
if not "%results%%pupfound%"=="" (
|
if not "%results%%pupfound%"=="" (
|
||||||
if defined pupfound call :dk_color %Gray% "Checking PUP Activators [Found%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
|
set fixes=%fixes% %mas%remove_mal%w%ware
|
||||||
call :dk_color2 %Blue% "Help - " %_Yellow% " %mas%remove_mal%w%ware"
|
call :dk_color2 %Blue% "Help - " %_Yellow% " %mas%remove_mal%w%ware"
|
||||||
echo:
|
echo:
|
||||||
@@ -1111,7 +1112,7 @@ call :dk_chkmal
|
|||||||
sc query Null %nul% || (
|
sc query Null %nul% || (
|
||||||
set error=1
|
set error=1
|
||||||
set showfix=1
|
set showfix=1
|
||||||
call :dk_color %Red% "Checking Sandboxing [Found. Script may not work properly.]"
|
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."
|
call :dk_color %Blue% "If you are using any third-party antivirus, check if it is blocking the script."
|
||||||
echo:
|
echo:
|
||||||
)
|
)
|
||||||
@@ -1202,7 +1203,7 @@ if defined serv_e (
|
|||||||
set error=1
|
set error=1
|
||||||
call :dk_color %Red% "Starting Services [Failed] [%serv_e%]"
|
call :dk_color %Red% "Starting Services [Failed] [%serv_e%]"
|
||||||
echo %serv_e% | findstr /i "ClipSVC-1058 sppsvc-1058" %nul% && (
|
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
|
set showfix=1
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
@@ -1242,7 +1243,7 @@ for /f "delims=" %%a in ('%psc% "$f=[io.file]::ReadAllText('!_batp!') -split ':w
|
|||||||
echo "%wpainfo%" | find /i "Error Found" %nul% && (
|
echo "%wpainfo%" | find /i "Error Found" %nul% && (
|
||||||
set error=1
|
set error=1
|
||||||
set wpaerror=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%]
|
echo Checking WPA Registry Count [%wpainfo%]
|
||||||
)
|
)
|
||||||
@@ -1281,7 +1282,7 @@ call :dk_color %Red% "Checking License Files [Not Found] [%osed
|
|||||||
|
|
||||||
if not exist "%SystemRoot%\Servicing\Packages\Microsoft-Windows-*-%osedition%-*.mum" (
|
if not exist "%SystemRoot%\Servicing\Packages\Microsoft-Windows-*-%osedition%-*.mum" (
|
||||||
set error=1
|
set error=1
|
||||||
call :dk_color %Red% "Checking Package File [Not Found] [%osedition%]"
|
call :dk_color %Red% "Checking Package Files [Not Found] [%osedition%]"
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
@@ -1352,17 +1353,23 @@ echo Checking Eval WLMS Service [Found]
|
|||||||
|
|
||||||
reg query "HKU\S-1-5-20\Software\Microsoft\Windows NT\CurrentVersion" %nul% || (
|
reg query "HKU\S-1-5-20\Software\Microsoft\Windows NT\CurrentVersion" %nul% || (
|
||||||
set error=1
|
set error=1
|
||||||
call :dk_color %Red% "Checking HKU\S-1-5-20 Reg [Not Found]"
|
call :dk_color %Red% "Checking HKU\S-1-5-20 Registry [Not Found]"
|
||||||
set fixes=%fixes% %mas%troubleshoot
|
set fixes=%fixes% %mas%troubleshoot
|
||||||
call :dk_color2 %Blue% "Help - " %_Yellow% " %mas%troubleshoot"
|
call :dk_color2 %Blue% "Help - " %_Yellow% " %mas%troubleshoot"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
for %%# in (SppEx%w%tComObj.exe sppsvc.exe) do (
|
for %%# in (SppEx%w%tComObj.exe sppsvc.exe sppsvc.exe\PerfOptions) do (
|
||||||
reg query "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Ima%w%ge File Execu%w%tion Options\%%#" %nul% && (if defined _sppint (set "_sppint=!_sppint!, %%#") else (set "_sppint=%%#"))
|
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 (
|
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%]
|
||||||
|
)
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
@@ -1377,7 +1384,7 @@ set error=1
|
|||||||
reg query "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\SoftwareProtectionPlatform\Plugins\Objects\msft:rm/algorithm/hwid/4.0" /f ba02fed39662 /d %nul% || (
|
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]"
|
call :dk_color %Red% "Checking SPP Registry Key [Incorrect ModuleId Found]"
|
||||||
set fixes=%fixes% %mas%issues_due_to_gaming_spoofers
|
set fixes=%fixes% %mas%issues_due_to_gaming_spoofers
|
||||||
call :dk_color2 %Blue% "Possibly Caused By Gaming Spoofers. Help - " %_Yellow% " %mas%issues_due_to_gaming_spoofers"
|
call :dk_color2 %Blue% "Most likely caused by HWID spoofers. Help - " %_Yellow% " %mas%issues_due_to_gaming_spoofers"
|
||||||
set error=1
|
set error=1
|
||||||
set showfix=1
|
set showfix=1
|
||||||
)
|
)
|
||||||
@@ -1407,9 +1414,9 @@ set "d=!d! $AclObject.SetSecurityDescriptorSddlForm($sddl);"
|
|||||||
set "d=!d! Set-Acl -Path %tokenstore% -AclObject $AclObject;"
|
set "d=!d! Set-Acl -Path %tokenstore% -AclObject $AclObject;"
|
||||||
%psc% "!d!" %nul%
|
%psc% "!d!" %nul%
|
||||||
if exist "%tokenstore%\" (
|
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 (
|
) 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 error=1
|
||||||
set showfix=1
|
set showfix=1
|
||||||
)
|
)
|
||||||
@@ -1443,7 +1450,7 @@ for /f "delims=" %%a in ('%psc% "(Get-ScheduledTask -TaskName 'SvcRestartTask' -
|
|||||||
echo !taskinfo! | find /i "Ready" %nul% || (
|
echo !taskinfo! | find /i "Ready" %nul% || (
|
||||||
reg delete "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\SoftwareProtectionPlatform" /v "actionlist" /f %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
|
reg query "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Schedule\TaskCache\Tree\Microsoft\Windows\SoftwareProtectionPlatform\SvcRestartTask" %nul% || set taskinfo=Removed
|
||||||
call :dk_color %Red% "Checking SvcRestartTask Status [!taskinfo!]"
|
call :dk_color %Red% "Checking SvcRestartTask Status [!taskinfo!, System might deactivate later]"
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -1458,7 +1465,13 @@ for %%# in (
|
|||||||
"HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion\SoftwareProtectionPlatform+SetValue"
|
"HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion\SoftwareProtectionPlatform+SetValue"
|
||||||
) do for /f "tokens=1,2 delims=+" %%A in (%%#) do if not defined permerror (
|
) 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%
|
%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=Error_Found
|
if !errorlevel!==2 (
|
||||||
|
if "%%A"=="%tokenstore%" (
|
||||||
|
set "permerror=Error Found In Token Folder"
|
||||||
|
) else (
|
||||||
|
set "permerror=Error Found In SPP Registries"
|
||||||
|
)
|
||||||
|
)
|
||||||
)
|
)
|
||||||
|
|
||||||
REM https://learn.microsoft.com/office/troubleshoot/activation/license-issue-when-start-office-application
|
REM https://learn.microsoft.com/office/troubleshoot/activation/license-issue-when-start-office-application
|
||||||
@@ -1521,7 +1534,7 @@ if ($osVersion.Build -ge $minBuildNumber) {
|
|||||||
}
|
}
|
||||||
for ($i=1; $i -le $count; $i++) {
|
for ($i=1; $i -le $count; $i++) {
|
||||||
if (-not $subkeyHashTable.ContainsKey("$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()
|
$wpaKey.Close()
|
||||||
exit
|
exit
|
||||||
}
|
}
|
||||||
@@ -1532,7 +1545,7 @@ $wpaKey.GetSubKeyNames() | ForEach-Object {
|
|||||||
if ($PSVersionTable.PSVersion.Major -lt 3) {
|
if ($PSVersionTable.PSVersion.Major -lt 3) {
|
||||||
cmd /c "reg query "HKLM\SYSTEM\WPA\$_" /ve /t REG_BINARY >nul 2>&1"
|
cmd /c "reg query "HKLM\SYSTEM\WPA\$_" /ve /t REG_BINARY >nul 2>&1"
|
||||||
if ($LASTEXITCODE -ne 0) {
|
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()
|
$wpaKey.Close()
|
||||||
exit
|
exit
|
||||||
}
|
}
|
||||||
@@ -1540,7 +1553,7 @@ $wpaKey.GetSubKeyNames() | ForEach-Object {
|
|||||||
$subkey = $wpaKey.OpenSubKey($_)
|
$subkey = $wpaKey.OpenSubKey($_)
|
||||||
$p = $subkey.GetValueNames()
|
$p = $subkey.GetValueNames()
|
||||||
if (($p | Where-Object { $subkey.GetValueKind($_) -eq [Microsoft.Win32.RegistryValueKind]::Binary }).Count -eq 0) {
|
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()
|
$wpaKey.Close()
|
||||||
exit
|
exit
|
||||||
}
|
}
|
||||||
@@ -1579,13 +1592,13 @@ echo:
|
|||||||
if %_unattended%==1 timeout /t 2 & exit /b
|
if %_unattended%==1 timeout /t 2 & exit /b
|
||||||
|
|
||||||
if defined fixes (
|
if defined fixes (
|
||||||
call :dk_color2 %Blue% "Press [1] To Open Troubleshoot Page " %Gray% " Press [0] To Ignore"
|
call :dk_color2 %Blue% "Press [1] to Open Troubleshoot Page " %Gray% " Press [0] to Ignore"
|
||||||
choice /C:10 /N
|
choice /C:10 /N
|
||||||
if !errorlevel!==1 (for %%# in (%fixes%) do (start %%#))
|
if !errorlevel!==1 (for %%# in (%fixes%) do (start %%#))
|
||||||
)
|
)
|
||||||
|
|
||||||
if defined terminal (
|
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
|
choice /c 0 /n
|
||||||
) else (
|
) else (
|
||||||
call :dk_color %_Yellow% "Press any key to %_exitmsg%..."
|
call :dk_color %_Yellow% "Press any key to %_exitmsg%..."
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
@set masver=2.6
|
@set masver=2.7
|
||||||
@echo off
|
@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 EnableExtensions
|
||||||
setlocal DisableDelayedExpansion
|
setlocal DisableDelayedExpansion
|
||||||
@@ -166,19 +166,19 @@ set "specific_kms=SOFTWARE\Microsoft\Windows NT\CurrentVersion\SoftwareProtectio
|
|||||||
if %winbuild% LSS 14393 (
|
if %winbuild% LSS 14393 (
|
||||||
%eline%
|
%eline%
|
||||||
echo Unsupported OS version detected [%winbuild%].
|
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:
|
echo:
|
||||||
if %winbuild% LSS 10240 (
|
if %winbuild% LSS 10240 (
|
||||||
call :dk_color %Blue% "Use Online KMS Activation option."
|
call :dk_color %Blue% "Use Online KMS activation option."
|
||||||
) else (
|
) else (
|
||||||
call :dk_color %Blue% "Use HWID Activation option."
|
call :dk_color %Blue% "Use HWID activation option."
|
||||||
)
|
)
|
||||||
goto dk_done
|
goto dk_done
|
||||||
)
|
)
|
||||||
|
|
||||||
::========================================================================================================================================
|
::========================================================================================================================================
|
||||||
|
|
||||||
:: Fix special characters limitation in path name
|
:: Fix special character limitations in path name
|
||||||
|
|
||||||
set "_work=%~dp0"
|
set "_work=%~dp0"
|
||||||
if "%_work:~-1%"=="\" set "_work=%_work:~0,-1%"
|
if "%_work:~-1%"=="\" set "_work=%_work:~0,-1%"
|
||||||
@@ -198,8 +198,8 @@ setlocal EnableDelayedExpansion
|
|||||||
echo "!_batf!" | find /i "!_ttemp!" %nul1% && (
|
echo "!_batf!" | find /i "!_ttemp!" %nul1% && (
|
||||||
if /i not "!_work!"=="!_ttemp!" (
|
if /i not "!_work!"=="!_ttemp!" (
|
||||||
%eline%
|
%eline%
|
||||||
echo Script is launched from the temp folder,
|
echo The script was launched from the temp folder.
|
||||||
echo Most likely you are running the script directly from the archive file.
|
echo You are most likely running the script directly from the archive file.
|
||||||
echo:
|
echo:
|
||||||
echo Extract the archive file and launch the script from the extracted folder.
|
echo Extract the archive file and launch the script from the extracted folder.
|
||||||
goto dk_done
|
goto dk_done
|
||||||
@@ -240,7 +240,7 @@ goto dk_done
|
|||||||
if not defined _elev %psc% "start cmd.exe -arg '/c \"!_PSarg!\"' -verb runas" && exit /b
|
if not defined _elev %psc% "start cmd.exe -arg '/c \"!_PSarg!\"' -verb runas" && exit /b
|
||||||
%eline%
|
%eline%
|
||||||
echo This script needs admin rights.
|
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
|
goto dk_done
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -293,20 +293,20 @@ set -=
|
|||||||
set old=
|
set old=
|
||||||
|
|
||||||
for /f "delims=[] tokens=2" %%# in ('ping -4 -n 1 updatecheck.mass%-%grave.dev') do (
|
for /f "delims=[] tokens=2" %%# in ('ping -4 -n 1 updatecheck.mass%-%grave.dev') do (
|
||||||
if not [%%#]==[] (echo "%%#" | find "127.69" %nul1% && (echo "%%#" | find "127.69.%masver%" %nul1% || set old=1))
|
if not "%%#"=="" (echo "%%#" | find "127.69" %nul1% && (echo "%%#" | find "127.69.%masver%" %nul1% || set old=1))
|
||||||
)
|
)
|
||||||
|
|
||||||
if defined old (
|
if defined old (
|
||||||
echo ________________________________________________
|
echo ________________________________________________
|
||||||
%eline%
|
%eline%
|
||||||
echo Version %masver% of MAS is outdated.
|
echo Your version of MAS [%masver%] is outdated.
|
||||||
echo ________________________________________________
|
echo ________________________________________________
|
||||||
echo:
|
echo:
|
||||||
if not %_unattended%==1 (
|
if not %_unattended%==1 (
|
||||||
echo [1] Get Latest MAS
|
echo [1] Get Latest MAS
|
||||||
echo [0] Continue Anyway
|
echo [0] Continue Anyway
|
||||||
echo:
|
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
|
choice /C:10 /N
|
||||||
if !errorlevel!==2 rem
|
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 ht%-%tps://github.com/mass%-%gravel/Microsoft-Acti%-%vation-Scripts & start %mas% & exit /b)
|
||||||
@@ -329,7 +329,7 @@ echo:
|
|||||||
echo:
|
echo:
|
||||||
echo:
|
echo:
|
||||||
echo:
|
echo:
|
||||||
echo ____________________________________________________________
|
echo: ______________________________________________________
|
||||||
echo:
|
echo:
|
||||||
echo [1] KMS38 Activation
|
echo [1] KMS38 Activation
|
||||||
echo ____________________________________________
|
echo ____________________________________________
|
||||||
@@ -337,9 +337,9 @@ echo:
|
|||||||
echo [2] Remove KM38 Protection
|
echo [2] Remove KM38 Protection
|
||||||
echo:
|
echo:
|
||||||
echo [0] %_exitmsg%
|
echo [0] %_exitmsg%
|
||||||
echo ____________________________________________________________
|
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
|
choice /C:120 /N
|
||||||
set _el=!errorlevel!
|
set _el=!errorlevel!
|
||||||
if !_el!==3 exit /b
|
if !_el!==3 exit /b
|
||||||
@@ -369,7 +369,7 @@ if not exist %SysPath%\ClipUp.exe if not defined a_cor (set _fmiss=%_fmiss%ClipU
|
|||||||
|
|
||||||
if defined _fmiss (
|
if defined _fmiss (
|
||||||
%eline%
|
%eline%
|
||||||
echo [%_fmiss%] file is missing. Aborting...
|
echo [%_fmiss%] file is missing, aborting...
|
||||||
echo:
|
echo:
|
||||||
set fixes=%fixes% %mas%troubleshoot
|
set fixes=%fixes% %mas%troubleshoot
|
||||||
call :dk_color2 %Blue% "Help - " %_Yellow% " %mas%troubleshoot"
|
call :dk_color2 %Blue% "Help - " %_Yellow% " %mas%troubleshoot"
|
||||||
@@ -395,12 +395,12 @@ if defined _perm (
|
|||||||
cls
|
cls
|
||||||
echo ___________________________________________________________________________________________
|
echo ___________________________________________________________________________________________
|
||||||
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."
|
call :dk_color2 %_White% " " %Gray% "Activation is not required."
|
||||||
echo ___________________________________________________________________________________________
|
echo ___________________________________________________________________________________________
|
||||||
if %_unattended%==1 goto dk_done
|
if %_unattended%==1 goto dk_done
|
||||||
echo:
|
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
|
if errorlevel 2 exit /b
|
||||||
)
|
)
|
||||||
cls
|
cls
|
||||||
@@ -425,7 +425,7 @@ echo Server Evaluation cannot be activated. Convert it to full Server OS.
|
|||||||
echo:
|
echo:
|
||||||
call :dk_color %Blue% "Go Back to main menu and use [Change Edition] option."
|
call :dk_color %Blue% "Go Back to main menu and use [Change Edition] option."
|
||||||
) else (
|
) else (
|
||||||
echo Evaluation Editions cannot be activated outside of evaluation period.
|
echo Evaluation editions cannot be activated outside of their evaluation period.
|
||||||
echo:
|
echo:
|
||||||
set fixes=%fixes% %mas%evaluation_editions
|
set fixes=%fixes% %mas%evaluation_editions
|
||||||
call :dk_color2 %Blue% "Help - " %_Yellow% " %mas%evaluation_editions"
|
call :dk_color2 %Blue% "Help - " %_Yellow% " %mas%evaluation_editions"
|
||||||
@@ -441,11 +441,22 @@ goto dk_done
|
|||||||
if defined a_cor (
|
if defined a_cor (
|
||||||
if not exist "!_work!\clipup.exe" (
|
if not exist "!_work!\clipup.exe" (
|
||||||
%eline%
|
%eline%
|
||||||
echo clipup.exe doesn't exist in Server Cor/Acor [No GUI] version.
|
echo clipup.exe doesn't exist in Server Cor/Acor [No GUI] versions.
|
||||||
echo It's required for KMS38 Activation.
|
echo The file is required for KMS38 activation.
|
||||||
echo Check below page on how to activate it.
|
echo Check the below page for instructions on how to activate it.
|
||||||
set fixes=%fixes% %mas%kms38
|
call :dk_color2 %Blue% "Help - " %_Yellow% " %mas%kms38"
|
||||||
echo %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
|
goto dk_done
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
@@ -496,24 +507,24 @@ set /a UBR=0
|
|||||||
if %osSKU%==191 if defined altkey if defined altedition (
|
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
|
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 (
|
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 (
|
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 (
|
if not defined key if not defined _gvlk (
|
||||||
%eline%
|
%eline%
|
||||||
echo [%winos% ^| %winbuild% ^| SKU:%osSKU%]
|
echo [%winos% ^| %winbuild% ^| SKU:%osSKU%]
|
||||||
if not defined skunotfound (
|
if not defined skunotfound (
|
||||||
echo This product does not support KMS38 Activation.
|
echo This product does not support KMS38 activation.
|
||||||
echo Make sure you are using updated version of the script.
|
echo Make sure you are using the latest version of the script.
|
||||||
set fixes=%fixes% %mas%
|
set fixes=%fixes% %mas%
|
||||||
echo %mas%
|
echo %mas%
|
||||||
) else (
|
) else (
|
||||||
echo Required License files not found in %SysPath%\spp\tokens\skus\
|
echo Required license files were not found in %SysPath%\spp\tokens\skus\
|
||||||
set fixes=%fixes% %mas%troubleshoot
|
set fixes=%fixes% %mas%troubleshoot
|
||||||
call :dk_color2 %Blue% "Help - " %_Yellow% " %mas%troubleshoot"
|
call :dk_color2 %Blue% "Help - " %_Yellow% " %mas%troubleshoot"
|
||||||
)
|
)
|
||||||
@@ -527,12 +538,12 @@ goto dk_done
|
|||||||
|
|
||||||
echo:
|
echo:
|
||||||
if defined changekey (
|
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:
|
echo:
|
||||||
)
|
)
|
||||||
|
|
||||||
if defined winsub (
|
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:
|
echo:
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -629,7 +640,7 @@ set "sessionId=TwBTAE0AYQBqAG8AcgBWAGUAcgBzAGkAbwBuAD0ANQA7AE8AUwBNAGkAbgBvAHIAV
|
|||||||
copy /y /b "%tdir%\GenuineTicket" "%tdir%\GenuineTicket.xml" %nul%
|
copy /y /b "%tdir%\GenuineTicket" "%tdir%\GenuineTicket.xml" %nul%
|
||||||
|
|
||||||
if not exist "%tdir%\GenuineTicket.xml" (
|
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%
|
if exist "%tdir%\Genuine*" del /f /q "%tdir%\Genuine*" %nul%
|
||||||
goto :k_final
|
goto :k_final
|
||||||
) else (
|
) else (
|
||||||
@@ -656,7 +667,7 @@ call :dk_color %Gray% "Stopping sppsvc Service [Failed]"
|
|||||||
%_xmlexist% (
|
%_xmlexist% (
|
||||||
set error=1
|
set error=1
|
||||||
if exist "%tdir%\*.xml" del /f /q "%tdir%\*.xml" %nul%
|
if exist "%tdir%\*.xml" del /f /q "%tdir%\*.xml" %nul%
|
||||||
call :dk_color %Red% "Installing GenuineTicket.xml [Failed With ClipSVC Service Restart, Wait...]"
|
call :dk_color %Red% "Installing GenuineTicket.xml [Failed with ClipSVC service restart, wait...]"
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -732,16 +743,16 @@ call :dk_color2 %Blue% "Help - " %_Yellow% " %mas%troubleshoot"
|
|||||||
|
|
||||||
:k_final
|
: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:
|
echo:
|
||||||
if not defined _k38 (
|
if not defined _k38 (
|
||||||
%nul% reg delete "HKLM\%specific_kms%" /f
|
%nul% reg delete "HKLM\%specific_kms%" /f
|
||||||
%nul% reg delete "HKU\S-1-5-20\%specific_kms%" /f
|
%nul% reg delete "HKU\S-1-5-20\%specific_kms%" /f
|
||||||
%nul% reg query "HKLM\%specific_kms%" && (
|
%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]
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -751,9 +762,9 @@ if defined _k38 (
|
|||||||
%psc% "$f=[io.file]::ReadAllText('!_batp!') -split ':regdel\:.*';& ([ScriptBlock]::Create($f[1])) -protect"
|
%psc% "$f=[io.file]::ReadAllText('!_batp!') -split ':regdel\:.*';& ([ScriptBlock]::Create($f[1])) -protect"
|
||||||
%nul% reg delete "HKLM\%specific_kms%" /f
|
%nul% reg delete "HKLM\%specific_kms%" /f
|
||||||
%nul% reg query "HKLM\%specific_kms%" && (
|
%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]"
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -763,9 +774,9 @@ if defined a_cor if exist "%_clipup%" del /f /q "%_clipup%" %nul%
|
|||||||
|
|
||||||
if defined a_cor (
|
if defined a_cor (
|
||||||
if exist "%_clipup%" (
|
if exist "%_clipup%" (
|
||||||
call :dk_color %Red% "Deleting copied clipup.exe file [Failed]"
|
call :dk_color %Red% "Deleting Copied clipup.exe File [Failed]"
|
||||||
) else (
|
) else (
|
||||||
echo Deleting copied clipup.exe file [Successful]
|
echo Deleting Copied clipup.exe File [Successful]
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -1090,7 +1101,7 @@ function ReinstallLicenses() {
|
|||||||
|
|
||||||
set _wmic=0
|
set _wmic=0
|
||||||
for %%# in (wmic.exe) do @if not "%%~$PATH:#"=="" (
|
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
|
exit /b
|
||||||
|
|
||||||
@@ -1190,7 +1201,7 @@ for %%# in (pkeyhelper.dll) do @if "%%~$PATH:#"=="" exit /b
|
|||||||
for %%# in (Volume:GVLK) do (
|
for %%# in (Volume:GVLK) do (
|
||||||
call :k_pkey %osSKU% '%%#'
|
call :k_pkey %osSKU% '%%#'
|
||||||
if defined pkey call :k_pkeychannel !pkey!
|
if defined pkey call :k_pkeychannel !pkey!
|
||||||
if /i [!pkeychannel!]==[%%#] (
|
if /i "!pkeychannel!"=="%%#" (
|
||||||
set key=!pkey!
|
set key=!pkey!
|
||||||
exit /b
|
exit /b
|
||||||
)
|
)
|
||||||
@@ -1215,7 +1226,7 @@ set pupfound=%pupfound1%%pupfound2%
|
|||||||
set hcount=0
|
set hcount=0
|
||||||
for %%# in (avira.com kaspersky.com virustotal.com mcafee.com) do (
|
for %%# in (avira.com kaspersky.com virustotal.com mcafee.com) do (
|
||||||
find /i "%%#" %SysPath%\drivers\etc\hosts %nul% && set /a hcount+=1)
|
find /i "%%#" %SysPath%\drivers\etc\hosts %nul% && set /a hcount+=1)
|
||||||
if %hcount%==4 set "results=[AV URLs are blocked in hosts]"
|
if %hcount%==4 set "results=[Antivirus URLs are blocked in hosts]"
|
||||||
|
|
||||||
set wucount=0
|
set wucount=0
|
||||||
for %%# in (wuauserv) do (
|
for %%# in (wuauserv) do (
|
||||||
@@ -1224,7 +1235,7 @@ for %%G in (DependOnService Description DisplayName ErrorControl ImagePath Objec
|
|||||||
reg query HKLM\SYSTEM\CurrentControlSet\Services\%%# /v %%G %nul% || (set _corrupt=1 & set /a wucount+=1)
|
reg query HKLM\SYSTEM\CurrentControlSet\Services\%%# /v %%G %nul% || (set _corrupt=1 & set /a wucount+=1)
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
if %wucount% GEQ 1 set "results=%results%[WU registry is corrupt]"
|
if %wucount% GEQ 1 set "results=%results%[Windows Update registry is corrupt]"
|
||||||
|
|
||||||
sc start sppsvc %nul%
|
sc start sppsvc %nul%
|
||||||
echo "%errorlevel%" | findstr "577 225" %nul% && (
|
echo "%errorlevel%" | findstr "577 225" %nul% && (
|
||||||
@@ -1235,7 +1246,8 @@ if not exist %SysPath%\sppsvc.exe if not exist %SysPath%\alg.exe (set "results=%
|
|||||||
|
|
||||||
if not "%results%%pupfound%"=="" (
|
if not "%results%%pupfound%"=="" (
|
||||||
if defined pupfound call :dk_color %Gray% "Checking PUP Activators [Found%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
|
set fixes=%fixes% %mas%remove_mal%w%ware
|
||||||
call :dk_color2 %Blue% "Help - " %_Yellow% " %mas%remove_mal%w%ware"
|
call :dk_color2 %Blue% "Help - " %_Yellow% " %mas%remove_mal%w%ware"
|
||||||
echo:
|
echo:
|
||||||
@@ -1254,7 +1266,7 @@ call :dk_chkmal
|
|||||||
sc query Null %nul% || (
|
sc query Null %nul% || (
|
||||||
set error=1
|
set error=1
|
||||||
set showfix=1
|
set showfix=1
|
||||||
call :dk_color %Red% "Checking Sandboxing [Found. Script may not work properly.]"
|
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."
|
call :dk_color %Blue% "If you are using any third-party antivirus, check if it is blocking the script."
|
||||||
echo:
|
echo:
|
||||||
)
|
)
|
||||||
@@ -1345,7 +1357,7 @@ if defined serv_e (
|
|||||||
set error=1
|
set error=1
|
||||||
call :dk_color %Red% "Starting Services [Failed] [%serv_e%]"
|
call :dk_color %Red% "Starting Services [Failed] [%serv_e%]"
|
||||||
echo %serv_e% | findstr /i "ClipSVC-1058 sppsvc-1058" %nul% && (
|
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
|
set showfix=1
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
@@ -1385,7 +1397,7 @@ for /f "delims=" %%a in ('%psc% "$f=[io.file]::ReadAllText('!_batp!') -split ':w
|
|||||||
echo "%wpainfo%" | find /i "Error Found" %nul% && (
|
echo "%wpainfo%" | find /i "Error Found" %nul% && (
|
||||||
set error=1
|
set error=1
|
||||||
set wpaerror=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%]
|
echo Checking WPA Registry Count [%wpainfo%]
|
||||||
)
|
)
|
||||||
@@ -1424,7 +1436,7 @@ call :dk_color %Red% "Checking License Files [Not Found] [%osed
|
|||||||
|
|
||||||
if not exist "%SystemRoot%\Servicing\Packages\Microsoft-Windows-*-%osedition%-*.mum" (
|
if not exist "%SystemRoot%\Servicing\Packages\Microsoft-Windows-*-%osedition%-*.mum" (
|
||||||
set error=1
|
set error=1
|
||||||
call :dk_color %Red% "Checking Package File [Not Found] [%osedition%]"
|
call :dk_color %Red% "Checking Package Files [Not Found] [%osedition%]"
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
@@ -1495,17 +1507,23 @@ echo Checking Eval WLMS Service [Found]
|
|||||||
|
|
||||||
reg query "HKU\S-1-5-20\Software\Microsoft\Windows NT\CurrentVersion" %nul% || (
|
reg query "HKU\S-1-5-20\Software\Microsoft\Windows NT\CurrentVersion" %nul% || (
|
||||||
set error=1
|
set error=1
|
||||||
call :dk_color %Red% "Checking HKU\S-1-5-20 Reg [Not Found]"
|
call :dk_color %Red% "Checking HKU\S-1-5-20 Registry [Not Found]"
|
||||||
set fixes=%fixes% %mas%troubleshoot
|
set fixes=%fixes% %mas%troubleshoot
|
||||||
call :dk_color2 %Blue% "Help - " %_Yellow% " %mas%troubleshoot"
|
call :dk_color2 %Blue% "Help - " %_Yellow% " %mas%troubleshoot"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
for %%# in (SppEx%w%tComObj.exe sppsvc.exe) do (
|
for %%# in (SppEx%w%tComObj.exe sppsvc.exe sppsvc.exe\PerfOptions) do (
|
||||||
reg query "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Ima%w%ge File Execu%w%tion Options\%%#" %nul% && (if defined _sppint (set "_sppint=!_sppint!, %%#") else (set "_sppint=%%#"))
|
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 (
|
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%]
|
||||||
|
)
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
@@ -1520,7 +1538,7 @@ set error=1
|
|||||||
reg query "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\SoftwareProtectionPlatform\Plugins\Objects\msft:rm/algorithm/hwid/4.0" /f ba02fed39662 /d %nul% || (
|
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]"
|
call :dk_color %Red% "Checking SPP Registry Key [Incorrect ModuleId Found]"
|
||||||
set fixes=%fixes% %mas%issues_due_to_gaming_spoofers
|
set fixes=%fixes% %mas%issues_due_to_gaming_spoofers
|
||||||
call :dk_color2 %Blue% "Possibly Caused By Gaming Spoofers. Help - " %_Yellow% " %mas%issues_due_to_gaming_spoofers"
|
call :dk_color2 %Blue% "Most likely caused by HWID spoofers. Help - " %_Yellow% " %mas%issues_due_to_gaming_spoofers"
|
||||||
set error=1
|
set error=1
|
||||||
set showfix=1
|
set showfix=1
|
||||||
)
|
)
|
||||||
@@ -1550,9 +1568,9 @@ set "d=!d! $AclObject.SetSecurityDescriptorSddlForm($sddl);"
|
|||||||
set "d=!d! Set-Acl -Path %tokenstore% -AclObject $AclObject;"
|
set "d=!d! Set-Acl -Path %tokenstore% -AclObject $AclObject;"
|
||||||
%psc% "!d!" %nul%
|
%psc% "!d!" %nul%
|
||||||
if exist "%tokenstore%\" (
|
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 (
|
) 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 error=1
|
||||||
set showfix=1
|
set showfix=1
|
||||||
)
|
)
|
||||||
@@ -1586,7 +1604,7 @@ for /f "delims=" %%a in ('%psc% "(Get-ScheduledTask -TaskName 'SvcRestartTask' -
|
|||||||
echo !taskinfo! | find /i "Ready" %nul% || (
|
echo !taskinfo! | find /i "Ready" %nul% || (
|
||||||
reg delete "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\SoftwareProtectionPlatform" /v "actionlist" /f %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
|
reg query "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Schedule\TaskCache\Tree\Microsoft\Windows\SoftwareProtectionPlatform\SvcRestartTask" %nul% || set taskinfo=Removed
|
||||||
call :dk_color %Red% "Checking SvcRestartTask Status [!taskinfo!]"
|
call :dk_color %Red% "Checking SvcRestartTask Status [!taskinfo!, System might deactivate later]"
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -1601,7 +1619,13 @@ for %%# in (
|
|||||||
"HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion\SoftwareProtectionPlatform+SetValue"
|
"HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion\SoftwareProtectionPlatform+SetValue"
|
||||||
) do for /f "tokens=1,2 delims=+" %%A in (%%#) do if not defined permerror (
|
) 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%
|
%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=Error_Found
|
if !errorlevel!==2 (
|
||||||
|
if "%%A"=="%tokenstore%" (
|
||||||
|
set "permerror=Error Found In Token Folder"
|
||||||
|
) else (
|
||||||
|
set "permerror=Error Found In SPP Registries"
|
||||||
|
)
|
||||||
|
)
|
||||||
)
|
)
|
||||||
|
|
||||||
REM https://learn.microsoft.com/office/troubleshoot/activation/license-issue-when-start-office-application
|
REM https://learn.microsoft.com/office/troubleshoot/activation/license-issue-when-start-office-application
|
||||||
@@ -1664,7 +1688,7 @@ if ($osVersion.Build -ge $minBuildNumber) {
|
|||||||
}
|
}
|
||||||
for ($i=1; $i -le $count; $i++) {
|
for ($i=1; $i -le $count; $i++) {
|
||||||
if (-not $subkeyHashTable.ContainsKey("$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()
|
$wpaKey.Close()
|
||||||
exit
|
exit
|
||||||
}
|
}
|
||||||
@@ -1675,7 +1699,7 @@ $wpaKey.GetSubKeyNames() | ForEach-Object {
|
|||||||
if ($PSVersionTable.PSVersion.Major -lt 3) {
|
if ($PSVersionTable.PSVersion.Major -lt 3) {
|
||||||
cmd /c "reg query "HKLM\SYSTEM\WPA\$_" /ve /t REG_BINARY >nul 2>&1"
|
cmd /c "reg query "HKLM\SYSTEM\WPA\$_" /ve /t REG_BINARY >nul 2>&1"
|
||||||
if ($LASTEXITCODE -ne 0) {
|
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()
|
$wpaKey.Close()
|
||||||
exit
|
exit
|
||||||
}
|
}
|
||||||
@@ -1683,7 +1707,7 @@ $wpaKey.GetSubKeyNames() | ForEach-Object {
|
|||||||
$subkey = $wpaKey.OpenSubKey($_)
|
$subkey = $wpaKey.OpenSubKey($_)
|
||||||
$p = $subkey.GetValueNames()
|
$p = $subkey.GetValueNames()
|
||||||
if (($p | Where-Object { $subkey.GetValueKind($_) -eq [Microsoft.Win32.RegistryValueKind]::Binary }).Count -eq 0) {
|
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()
|
$wpaKey.Close()
|
||||||
exit
|
exit
|
||||||
}
|
}
|
||||||
@@ -1722,13 +1746,13 @@ echo:
|
|||||||
if %_unattended%==1 timeout /t 2 & exit /b
|
if %_unattended%==1 timeout /t 2 & exit /b
|
||||||
|
|
||||||
if defined fixes (
|
if defined fixes (
|
||||||
call :dk_color2 %Blue% "Press [1] To Open Troubleshoot Page " %Gray% " Press [0] To Ignore"
|
call :dk_color2 %Blue% "Press [1] to Open Troubleshoot Page " %Gray% " Press [0] to Ignore"
|
||||||
choice /C:10 /N
|
choice /C:10 /N
|
||||||
if !errorlevel!==1 (for %%# in (%fixes%) do (start %%#))
|
if !errorlevel!==1 (for %%# in (%fixes%) do (start %%#))
|
||||||
)
|
)
|
||||||
|
|
||||||
if defined terminal (
|
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
|
choice /c 0 /n
|
||||||
) else (
|
) else (
|
||||||
call :dk_color %_Yellow% "Press any key to %_exitmsg%..."
|
call :dk_color %_Yellow% "Press any key to %_exitmsg%..."
|
||||||
@@ -1805,36 +1829,6 @@ a99cc1f0-7719-4306-9645-294102fbff95_FDNH6-VW9RW-BXPJ7-4XTYG-23%f%9TB_168_Server
|
|||||||
3dbf341b-5f6c-4fa7-b936-699dce9e263f_VP34G-4NPPG-79JTQ-864T4-R3%f%MQX_168_ServerAzureCor_RS1
|
3dbf341b-5f6c-4fa7-b936-699dce9e263f_VP34G-4NPPG-79JTQ-864T4-R3%f%MQX_168_ServerAzureCor_RS1
|
||||||
c2e946d1-cfa2-4523-8c87-30bc696ee584_XGN3F-F394H-FD2MY-PP6FD-8M%f%CRC_407_ServerTurbine_Ge
|
c2e946d1-cfa2-4523-8c87-30bc696ee584_XGN3F-F394H-FD2MY-PP6FD-8M%f%CRC_407_ServerTurbine_Ge
|
||||||
19b5e0fb-4431-46bc-bac1-2f1873e4ae73_NTBV8-9K7Q8-V27C6-M2BTV-KH%f%MXV_407_ServerTurbine_RS5
|
19b5e0fb-4431-46bc-bac1-2f1873e4ae73_NTBV8-9K7Q8-V27C6-M2BTV-KH%f%MXV_407_ServerTurbine_RS5
|
||||||
:: Old Preview editions from build 14393 - Generated keys
|
|
||||||
43f2ab05-7c87-4d56-b27c-44d0f9a3dabd_JDTNC-PP77T-T9H2W-G4J2J-VH%f%7MW___4_Enterprise
|
|
||||||
d3872724-5c08-4b1b-91f2-fc9eafed4990_3NMDC-G7C3W-68RGP-CQK9H-B7%f%QK9___7_ServerStandard
|
|
||||||
ba947c44-d19d-4786-b6ae-22770bc94c54_T8N4T-C6P4F-W48KM-CYJT9-KP%f%69Y___8_ServerDatacenter
|
|
||||||
e5676f13-9b66-4a1f-8b0c-43490e236202_RN84D-7HCWY-FTCBK-J3GHK-RM%f%YVT__17_ServerWeb
|
|
||||||
6ae51eeb-c268-4a21-9aae-df74c38b586d_RN3QB-GT6D7-YB3VH-F3RPB-3G%f%P42__27_EnterpriseN
|
|
||||||
ff808201-fec6-4fd4-ae16-abbddade5706_CC6JP-VN67C-8KCJ4-4V48V-HX%f%M9B__48_Professional
|
|
||||||
34260150-69ac-49a3-8a0d-4a403ab55763_TNYKV-X79V3-CPD6X-Y2MRW-D9%f%M9H__49_ProfessionalN
|
|
||||||
9cc2564c-292e-4d8a-b9f9-1f5007d9409a_82CNJ-W82TW-BY23W-BVJ6W-W4%f%2Y2__86_EmbeddedIndustryA
|
|
||||||
c35a9336-fb02-48db-8f4d-245c17f03667_NXTJV-CRQYQ-W77JR-GG84R-HQ%f%VHX__89_EmbeddedIndustry
|
|
||||||
4daf1e3e-6be9-4848-8f5a-a18a0d2895e1_7MNJY-B88MV-WQKVP-BQ6DK-6C%f%M4G__91_EmbeddedIndustryE
|
|
||||||
b554b49f-4d57-4f08-955e-87886f514d49_4QC36-NW3YH-D2Y9D-RJPC7-VV%f%BDF__97_CoreARM
|
|
||||||
4dfd543d-caa6-4f69-a95f-5ddfe2b89567_KG3N2-VRJ6F-P36TD-6MMCF-PP%f%QX7__98_CoreN
|
|
||||||
5fe40dd6-cf1f-4cf2-8729-92121ac2e997_XFNM6-P9FYP-MRF6P-MM6V2-27%f%KDP__99_CoreCountrySpecific
|
|
||||||
2cc171ef-db48-4adc-af09-7c574b37f139_N47PH-2Y8Q8-DGMMV-3PGD8-WB%f%6Q2_100_CoreSingleLanguage
|
|
||||||
903663f7-d2ab-49c9-8942-14aa9e0a9c72_VWCNX-7FKBD-FHJYG-XBR4B-88%f%GQH_101_Core
|
|
||||||
cc17e18a-fa93-43d6-9179-72950a1e931a_FDF9N-KGHKC-R9G6Y-W2TGC-9Q%f%CCB_103_ProfessionalWMC
|
|
||||||
c436def1-0dcc-4849-9a59-8b6142eb70f3_2FNVD-CPYC6-WXD8M-T64BF-84%f%3GJ_111_CoreConnected
|
|
||||||
fd5ae385-f5cf-4b53-b1fa-1af6fff7c0d8_HJN63-7Q4G4-VDW7X-TRMW8-GV%f%H3Q_112_ProfessionalStudent
|
|
||||||
86f72c8d-8363-4188-b574-1a53cb374711_JGRP6-TNJWX-KQWHJ-6D3FJ-RX%f%73B_113_CoreConnectedN
|
|
||||||
687f6358-6a21-453a-a712-3b3b57123827_3K4DY-NVP2W-H8DGV-42K3B-2P%f%PK9_114_ProfessionalStudentN
|
|
||||||
5b120df4-ea3f-4e82-b0c0-6568f719730e_2N382-D6PKK-QTX4D-2JJYK-M9%f%73H_115_CoreConnectedSingleLanguage
|
|
||||||
a8651bfb-7fe0-40df-b156-87337ecd5acc_RPM6J-N62DM-DC6XH-2JXMG-23%f%66R_116_CoreConnectedCountrySpecific
|
|
||||||
5b2add49-b8f4-42e0-a77c-adad4efeeeb1_NT3V6-XMBK7-Q66MF-VMKR4-FC%f%26C_119_PPIPro
|
|
||||||
af43f7f0-3b1e-4266-a123-1fdb53f4323b_BNJR8-P8QHP-VQ4QY-MVPQP-8X%f%C37_121_Education
|
|
||||||
075aca1f-05d7-42e5-a3ce-e349e7be7078_RFNBP-FDD7Q-6FHYQ-9M9Y7-MB%f%JH3_122_EducationN
|
|
||||||
2cf5af84-abab-4ff0-83f8-f040fb2576eb_NVYRQ-D2F32-6HGXW-DKGWM-R6%f%Y8H_125_EnterpriseS
|
|
||||||
11a37f09-fb7f-4002-bd84-f3ae71d11e90_NMBY8-V3CV7-BX6K6-2922Y-43%f%MCH_126_EnterpriseSN
|
|
||||||
aa234c15-ee34-4e5f-adb5-73afafb77143_DNJYG-CM8W6-4W3TX-VCK66-FV%f%WCC_127_ProfessionalS
|
|
||||||
9f6a1bc9-5278-4991-88c9-7301c87a75ea_XB9DG-NPJ72-XRH69-7DF3Q-G8%f%3R4_128_ProfessionalSN
|
|
||||||
) do (
|
) do (
|
||||||
for /f "tokens=1-5 delims=_" %%A in ("%%#") do if %osSKU%==%%C (
|
for /f "tokens=1-5 delims=_" %%A in ("%%#") do if %osSKU%==%%C (
|
||||||
if %1==key if not defined key echo "!allapps!" | find /i "%%A" %nul1% && set key=%%B
|
if %1==key if not defined key echo "!allapps!" | find /i "%%A" %nul1% && set key=%%B
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
@set masver=2.6
|
@set masver=2.7
|
||||||
@echo off
|
@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 EnableExtensions
|
||||||
setlocal DisableDelayedExpansion
|
setlocal DisableDelayedExpansion
|
||||||
@@ -160,15 +160,15 @@ call :dk_setvar
|
|||||||
if %winbuild% LSS 9200 (
|
if %winbuild% LSS 9200 (
|
||||||
%eline%
|
%eline%
|
||||||
echo Unsupported OS version detected [%winbuild%].
|
echo Unsupported OS version detected [%winbuild%].
|
||||||
echo Ohook Activation is supported on Windows 8 and later and their server equivalent.
|
echo Ohook Activation is supported only on Windows 8/10/11 and their server equivalents.
|
||||||
echo:
|
echo:
|
||||||
call :dk_color %Blue% "Use Online KMS Activation option."
|
call :dk_color %Blue% "Use Online KMS activation option instead."
|
||||||
goto dk_done
|
goto dk_done
|
||||||
)
|
)
|
||||||
|
|
||||||
::========================================================================================================================================
|
::========================================================================================================================================
|
||||||
|
|
||||||
:: Fix special characters limitation in path name
|
:: Fix special character limitations in path name
|
||||||
|
|
||||||
set "_work=%~dp0"
|
set "_work=%~dp0"
|
||||||
if "%_work:~-1%"=="\" set "_work=%_work:~0,-1%"
|
if "%_work:~-1%"=="\" set "_work=%_work:~0,-1%"
|
||||||
@@ -188,8 +188,8 @@ setlocal EnableDelayedExpansion
|
|||||||
echo "!_batf!" | find /i "!_ttemp!" %nul1% && (
|
echo "!_batf!" | find /i "!_ttemp!" %nul1% && (
|
||||||
if /i not "!_work!"=="!_ttemp!" (
|
if /i not "!_work!"=="!_ttemp!" (
|
||||||
%eline%
|
%eline%
|
||||||
echo Script is launched from the temp folder,
|
echo The script was launched from the temp folder.
|
||||||
echo Most likely you are running the script directly from the archive file.
|
echo You are most likely running the script directly from the archive file.
|
||||||
echo:
|
echo:
|
||||||
echo Extract the archive file and launch the script from the extracted folder.
|
echo Extract the archive file and launch the script from the extracted folder.
|
||||||
goto dk_done
|
goto dk_done
|
||||||
@@ -230,7 +230,7 @@ goto dk_done
|
|||||||
if not defined _elev %psc% "start cmd.exe -arg '/c \"!_PSarg!\"' -verb runas" && exit /b
|
if not defined _elev %psc% "start cmd.exe -arg '/c \"!_PSarg!\"' -verb runas" && exit /b
|
||||||
%eline%
|
%eline%
|
||||||
echo This script needs admin rights.
|
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
|
goto dk_done
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -283,20 +283,20 @@ set -=
|
|||||||
set old=
|
set old=
|
||||||
|
|
||||||
for /f "delims=[] tokens=2" %%# in ('ping -4 -n 1 updatecheck.mass%-%grave.dev') do (
|
for /f "delims=[] tokens=2" %%# in ('ping -4 -n 1 updatecheck.mass%-%grave.dev') do (
|
||||||
if not [%%#]==[] (echo "%%#" | find "127.69" %nul1% && (echo "%%#" | find "127.69.%masver%" %nul1% || set old=1))
|
if not "%%#"=="" (echo "%%#" | find "127.69" %nul1% && (echo "%%#" | find "127.69.%masver%" %nul1% || set old=1))
|
||||||
)
|
)
|
||||||
|
|
||||||
if defined old (
|
if defined old (
|
||||||
echo ________________________________________________
|
echo ________________________________________________
|
||||||
%eline%
|
%eline%
|
||||||
echo Version %masver% of MAS is outdated.
|
echo Your version of MAS [%masver%] is outdated.
|
||||||
echo ________________________________________________
|
echo ________________________________________________
|
||||||
echo:
|
echo:
|
||||||
if not %_unattended%==1 (
|
if not %_unattended%==1 (
|
||||||
echo [1] Get Latest MAS
|
echo [1] Get Latest MAS
|
||||||
echo [0] Continue Anyway
|
echo [0] Continue Anyway
|
||||||
echo:
|
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
|
choice /C:10 /N
|
||||||
if !errorlevel!==2 rem
|
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 ht%-%tps://github.com/mass%-%gravel/Microsoft-Acti%-%vation-Scripts & start %mas% & exit /b)
|
||||||
@@ -332,7 +332,7 @@ echo:
|
|||||||
echo [0] %_exitmsg%
|
echo [0] %_exitmsg%
|
||||||
echo ____________________________________________________________
|
echo ____________________________________________________________
|
||||||
echo:
|
echo:
|
||||||
call :dk_color2 %_White% " " %_Green% "Enter a menu option in the Keyboard [1,2,3,0]"
|
call :dk_color2 %_White% " " %_Green% "Choose a menu option using your keyboard [1,2,3,0]"
|
||||||
choice /C:1230 /N
|
choice /C:1230 /N
|
||||||
set _el=!errorlevel!
|
set _el=!errorlevel!
|
||||||
if !_el!==4 exit /b
|
if !_el!==4 exit /b
|
||||||
@@ -360,7 +360,7 @@ call :dk_chkmal
|
|||||||
|
|
||||||
if not exist %SysPath%\sppsvc.exe (
|
if not exist %SysPath%\sppsvc.exe (
|
||||||
%eline%
|
%eline%
|
||||||
echo [%SysPath%\sppsvc.exe] file is missing. Aborting...
|
echo [%SysPath%\sppsvc.exe] file is missing, aborting...
|
||||||
echo:
|
echo:
|
||||||
set fixes=%fixes% %mas%troubleshoot
|
set fixes=%fixes% %mas%troubleshoot
|
||||||
call :dk_color2 %Blue% "Help - " %_Yellow% " %mas%troubleshoot"
|
call :dk_color2 %Blue% "Help - " %_Yellow% " %mas%troubleshoot"
|
||||||
@@ -456,10 +456,10 @@ call :dk_color %Red% "Checking Installed Office [Not Found]"
|
|||||||
|
|
||||||
if defined ohub (
|
if defined ohub (
|
||||||
echo:
|
echo:
|
||||||
echo You have only Office dashboard app installed, you need to install full Office version.
|
echo You only have the Office dashboard app installed, you need to install the full version of Office.
|
||||||
)
|
)
|
||||||
echo:
|
echo:
|
||||||
call :dk_color %Blue% "Download and install Office from below URL and try again."
|
call :dk_color %Blue% "Download and install Office from the below URL and then try again."
|
||||||
echo:
|
echo:
|
||||||
set fixes=%fixes% %mas%genuine-installation-media
|
set fixes=%fixes% %mas%genuine-installation-media
|
||||||
call :dk_color %_Yellow% "%mas%genuine-installation-media"
|
call :dk_color %_Yellow% "%mas%genuine-installation-media"
|
||||||
@@ -471,7 +471,7 @@ if not "%o16c2r%%o15c2r%%o16msi%%o15msi%"=="1" set multioffice=1
|
|||||||
if not "%o14msi%%o14c2r%%o16uwp%"=="" set multioffice=1
|
if not "%o14msi%%o14c2r%%o16uwp%"=="" set multioffice=1
|
||||||
|
|
||||||
if defined multioffice (
|
if defined multioffice (
|
||||||
call :dk_color %Gray% "Checking Multiple Office Install [Found. Recommended to install one version only]"
|
call :dk_color %Gray% "Checking Multiple Office Install [Found, its recommended to install only one version]"
|
||||||
)
|
)
|
||||||
|
|
||||||
::========================================================================================================================================
|
::========================================================================================================================================
|
||||||
@@ -520,11 +520,11 @@ echo "!_oIds!" | find /i " %%a " %nul1% || (set "_oIds= !_oIds! %%a ")
|
|||||||
set "_oLPath=%_oRoot%\Licenses"
|
set "_oLPath=%_oRoot%\Licenses"
|
||||||
set "_oIntegrator=%_oRoot%\integration\integrator.exe"
|
set "_oIntegrator=%_oRoot%\integration\integrator.exe"
|
||||||
|
|
||||||
if [%_oArch%]==[x64] (set "_hookPath=%_oRoot%\vfs\System" & set "_hook=sppc64.dll")
|
if "%_oArch%"=="x64" (set "_hookPath=%_oRoot%\vfs\System" & set "_hook=sppc64.dll")
|
||||||
if [%_oArch%]==[x86] (set "_hookPath=%_oRoot%\vfs\SystemX86" & set "_hook=sppc32.dll")
|
if "%_oArch%"=="x86" (set "_hookPath=%_oRoot%\vfs\SystemX86" & set "_hook=sppc32.dll")
|
||||||
if not [%osarch%]==[x86] (
|
if not "%osarch%"=="x86" (
|
||||||
if [%_oArch%]==[x64] set "_sppcPath=%SystemRoot%\System32\sppc.dll"
|
if "%_oArch%"=="x64" set "_sppcPath=%SystemRoot%\System32\sppc.dll"
|
||||||
if [%_oArch%]==[x86] set "_sppcPath=%SystemRoot%\SysWOW64\sppc.dll"
|
if "%_oArch%"=="x86" set "_sppcPath=%SystemRoot%\SysWOW64\sppc.dll"
|
||||||
) else (
|
) else (
|
||||||
set "_sppcPath=%SystemRoot%\System32\sppc.dll"
|
set "_sppcPath=%SystemRoot%\System32\sppc.dll"
|
||||||
)
|
)
|
||||||
@@ -570,11 +570,11 @@ set _o16c2rIds=%_oIds%
|
|||||||
set "_oLPath=%_oRoot%\Licenses16"
|
set "_oLPath=%_oRoot%\Licenses16"
|
||||||
set "_oIntegrator=%_oRoot%\integration\integrator.exe"
|
set "_oIntegrator=%_oRoot%\integration\integrator.exe"
|
||||||
|
|
||||||
if [%_oArch%]==[x64] (set "_hookPath=%_oRoot%\vfs\System" & set "_hook=sppc64.dll")
|
if "%_oArch%"=="x64" (set "_hookPath=%_oRoot%\vfs\System" & set "_hook=sppc64.dll")
|
||||||
if [%_oArch%]==[x86] (set "_hookPath=%_oRoot%\vfs\SystemX86" & set "_hook=sppc32.dll")
|
if "%_oArch%"=="x86" (set "_hookPath=%_oRoot%\vfs\SystemX86" & set "_hook=sppc32.dll")
|
||||||
if not [%osarch%]==[x86] (
|
if not "%osarch%"=="x86" (
|
||||||
if [%_oArch%]==[x64] set "_sppcPath=%SystemRoot%\System32\sppc.dll"
|
if "%_oArch%"=="x64" set "_sppcPath=%SystemRoot%\System32\sppc.dll"
|
||||||
if [%_oArch%]==[x86] set "_sppcPath=%SystemRoot%\SysWOW64\sppc.dll"
|
if "%_oArch%"=="x86" set "_sppcPath=%SystemRoot%\SysWOW64\sppc.dll"
|
||||||
) else (
|
) else (
|
||||||
set "_sppcPath=%SystemRoot%\System32\sppc.dll"
|
set "_sppcPath=%SystemRoot%\System32\sppc.dll"
|
||||||
)
|
)
|
||||||
@@ -613,13 +613,13 @@ call :dk_color %Gray% "Checking Old Office With Sub License [Found. Update Of
|
|||||||
set "kmskey=HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\SoftwareProtectionPlatform\0ff1ce15-a989-479d-af46-f275c6370663"
|
set "kmskey=HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\SoftwareProtectionPlatform\0ff1ce15-a989-479d-af46-f275c6370663"
|
||||||
echo "%_oIds%" | find /i "Volume" %nul1% && (
|
echo "%_oIds%" | find /i "Volume" %nul1% && (
|
||||||
if %winbuild% GEQ 9200 (
|
if %winbuild% GEQ 9200 (
|
||||||
if not [%osarch%]==[x86] (
|
if not "%osarch%"=="x86" (
|
||||||
reg delete "%kmskey%" /f /reg:32 %nul%
|
reg delete "%kmskey%" /f /reg:32 %nul%
|
||||||
reg add "%kmskey%" /f /v KeyManagementServiceName /t REG_SZ /d "10.0.0.10" /reg:32 %nul%
|
reg add "%kmskey%" /f /v KeyManagementServiceName /t REG_SZ /d "10.0.0.10" /reg:32 %nul%
|
||||||
)
|
)
|
||||||
reg delete "%kmskey%" /f %nul%
|
reg delete "%kmskey%" /f %nul%
|
||||||
reg add "%kmskey%" /f /v KeyManagementServiceName /t REG_SZ /d "10.0.0.10" %nul%
|
reg add "%kmskey%" /f /v KeyManagementServiceName /t REG_SZ /d "10.0.0.10" %nul%
|
||||||
echo Adding a Reg To Prevent Banner [Successful]
|
echo Adding a Registry to Prevent Banner [Successful]
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -667,7 +667,7 @@ call :oh_reset
|
|||||||
call :oh_getpath
|
call :oh_getpath
|
||||||
|
|
||||||
echo:
|
echo:
|
||||||
echo Uninstalling Ohook Activation...
|
echo Uninstalling Ohook activation...
|
||||||
echo:
|
echo:
|
||||||
|
|
||||||
if defined o16c2r_reg (for /f "skip=2 tokens=2*" %%a in ('"reg query %o16c2r_reg% /v InstallPath" %nul6%') do (set "_16CHook=%%b\root\vfs"))
|
if defined o16c2r_reg (for /f "skip=2 tokens=2*" %%a in ('"reg query %o16c2r_reg% /v InstallPath" %nul6%') do (set "_16CHook=%%b\root\vfs"))
|
||||||
@@ -698,7 +698,7 @@ if exist "%%~A\Microsoft %%~G\root\vfs\%%#\sppc*dll" (set _present=1& del /s /f
|
|||||||
|
|
||||||
reg query HKCU\Software\Microsoft\Office\16.0\Common\Licensing\Resiliency %nul% && (
|
reg query HKCU\Software\Microsoft\Office\16.0\Common\Licensing\Resiliency %nul% && (
|
||||||
echo:
|
echo:
|
||||||
echo Deleting - Registry keys to skip license check from all ^& future new useraccounts
|
echo Deleting - Registry keys for skipping license check
|
||||||
|
|
||||||
reg load HKU\DEF_TEMP %SystemDrive%\Users\Default\NTUSER.DAT %nul%
|
reg load HKU\DEF_TEMP %SystemDrive%\Users\Default\NTUSER.DAT %nul%
|
||||||
reg query HKU\DEF_TEMP\Software\Microsoft\Office\16.0\Common\Licensing\Resiliency %nul% && reg delete HKU\DEF_TEMP\Software\Microsoft\Office\16.0\Common\Licensing\Resiliency /f
|
reg query HKU\DEF_TEMP\Software\Microsoft\Office\16.0\Common\Licensing\Resiliency %nul% && reg delete HKU\DEF_TEMP\Software\Microsoft\Office\16.0\Common\Licensing\Resiliency /f
|
||||||
@@ -723,7 +723,7 @@ reg unload HKU\%%# %nul%
|
|||||||
set "kmskey=HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\SoftwareProtectionPlatform\0ff1ce15-a989-479d-af46-f275c6370663"
|
set "kmskey=HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\SoftwareProtectionPlatform\0ff1ce15-a989-479d-af46-f275c6370663"
|
||||||
reg query "%kmskey%" %nul% && (
|
reg query "%kmskey%" %nul% && (
|
||||||
echo:
|
echo:
|
||||||
echo Deleting - Registry keys to prevent non-genuine banner
|
echo Deleting - Registry keys for preventing non-genuine banner
|
||||||
reg delete "%kmskey%" /f
|
reg delete "%kmskey%" /f
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -735,16 +735,16 @@ echo ___________________________________________________________________________
|
|||||||
echo:
|
echo:
|
||||||
|
|
||||||
if not defined _present (
|
if not defined _present (
|
||||||
echo Ohook Activation is not installed.
|
echo Ohook activation is not installed.
|
||||||
) else (
|
) else (
|
||||||
if defined _unerror (
|
if defined _unerror (
|
||||||
call :dk_color %Red% "Failed to uninstall Ohook activation."
|
call :dk_color %Red% "Failed to uninstall Ohook activation."
|
||||||
call :oh_checkapps
|
call :oh_checkapps
|
||||||
if defined checknames (
|
if defined checknames (
|
||||||
call :dk_color %Blue% "Close [!checknames!] and try again."
|
call :dk_color %Blue% "Close [!checknames!] and try again."
|
||||||
call :dk_color %Blue% "If its still not resolved then restart system and try again."
|
call :dk_color %Blue% "If it is still not fixed, reboot your machine using the restart option and try again."
|
||||||
) else (
|
) else (
|
||||||
call :dk_color %Blue% "Restart system and try again."
|
call :dk_color %Blue% "Reboot your machine using the restart option and try again."
|
||||||
)
|
)
|
||||||
) else (
|
) else (
|
||||||
call :dk_color %Green% "Successfully uninstalled Ohook activation."
|
call :dk_color %Green% "Successfully uninstalled Ohook activation."
|
||||||
@@ -919,11 +919,11 @@ if not exist "%_hookPath%\sppc.dll" (if not defined ierror set ierror=Copy)
|
|||||||
|
|
||||||
echo:
|
echo:
|
||||||
if not defined ierror (
|
if not defined ierror (
|
||||||
echo Symlinking System's sppc.dll To ["%_hookPath%\sppcs.dll"] [Successful]
|
echo Symlinking System's sppc.dll to ["%_hookPath%\sppcs.dll"] [Successful]
|
||||||
if defined exhook (
|
if defined exhook (
|
||||||
echo Copying Custom %_hook% To ["%_hookPath%\sppc.dll"] [Successful]
|
echo Copying Custom %_hook% to ["%_hookPath%\sppc.dll"] [Successful]
|
||||||
) else (
|
) else (
|
||||||
echo Extracting Custom %_hook% To ["%_hookPath%\sppc.dll"] [Successful]
|
echo Extracting Custom %_hook% to ["%_hookPath%\sppc.dll"] [Successful]
|
||||||
)
|
)
|
||||||
) else (
|
) else (
|
||||||
set error=1
|
set error=1
|
||||||
@@ -932,9 +932,9 @@ echo:
|
|||||||
call :oh_checkapps
|
call :oh_checkapps
|
||||||
if defined checknames (
|
if defined checknames (
|
||||||
call :dk_color %Blue% "Close [!checknames!] and try again."
|
call :dk_color %Blue% "Close [!checknames!] and try again."
|
||||||
call :dk_color %Blue% "If its still not resolved then restart system and try again."
|
call :dk_color %Blue% "If it is still not fixed, reboot your machine using the restart option and try again."
|
||||||
) else (
|
) else (
|
||||||
if /i not "%ierror%"=="Copy" call :dk_color %Blue% "Restart system and try again."
|
if /i not "%ierror%"=="Copy" call :dk_color %Blue% "Reboot your machine using the restart option and try again."
|
||||||
if /i "%ierror%"=="Copy" call :dk_color %Blue% "If you are using any third-party antivirus, check if it is blocking the script."
|
if /i "%ierror%"=="Copy" call :dk_color %Blue% "If you are using any third-party antivirus, check if it is blocking the script."
|
||||||
)
|
)
|
||||||
echo:
|
echo:
|
||||||
@@ -976,13 +976,13 @@ set _prod=%%#!_preview!
|
|||||||
|
|
||||||
call :ohookdata getinfo !_prod!
|
call :ohookdata getinfo !_prod!
|
||||||
|
|
||||||
if not [!key!]==[] (
|
if not "!key!"=="" (
|
||||||
echo "!allapps!" | find /i "!_actid!" %nul1% || call :oh_installlic
|
echo "!allapps!" | find /i "!_actid!" %nul1% || call :oh_installlic
|
||||||
call :dk_inskey "[!key!] [!_prod!] [!_lic!]"
|
call :dk_inskey "[!key!] [!_prod!] [!_lic!]"
|
||||||
) else (
|
) else (
|
||||||
set error=1
|
set error=1
|
||||||
call :dk_color %Red% "Checking Product In Script [Office %oVer%.0 !_prod! not found in script]"
|
call :dk_color %Red% "Checking Product In Script [Office %oVer%.0 !_prod! not found in script]"
|
||||||
call :dk_color %Blue% "Make sure you are using Latest MAS script."
|
call :dk_color %Blue% "Make sure you are using the latest version of MAS."
|
||||||
set fixes=%fixes% %mas%
|
set fixes=%fixes% %mas%
|
||||||
call :dk_color %_Yellow% "%mas%"
|
call :dk_color %_Yellow% "%mas%"
|
||||||
)
|
)
|
||||||
@@ -996,7 +996,7 @@ if defined winserver if defined _config (
|
|||||||
echo %_oIds% | find /i "Retail" %nul1% && (
|
echo %_oIds% | find /i "Retail" %nul1% && (
|
||||||
set scaIsNeeded=1
|
set scaIsNeeded=1
|
||||||
reg add %_config% /v SharedComputerLicensing /t REG_SZ /d "1" /f %nul1%
|
reg add %_config% /v SharedComputerLicensing /t REG_SZ /d "1" /f %nul1%
|
||||||
echo Adding SharedComputerLicensing Reg [Successful] [Needed On Server With Retail Office]"
|
echo Adding SharedComputerLicensing Reg [Successful] [Needed on Server With Retail Office]"
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -1017,14 +1017,14 @@ for /f "skip=2 tokens=2*" %%a in ('"reg query %2\Common\ProductVersion /v LastPr
|
|||||||
if "%_oRoot:~-1%"=="\" set "_oRoot=%_oRoot:~0,-1%"
|
if "%_oRoot:~-1%"=="\" set "_oRoot=%_oRoot:~0,-1%"
|
||||||
|
|
||||||
echo "%2" | find /i "Wow6432Node" %nul1% && set _oArch=x86
|
echo "%2" | find /i "Wow6432Node" %nul1% && set _oArch=x86
|
||||||
if not [%osarch%]==[x86] if not defined _oArch set _oArch=x64
|
if not "%osarch%"=="x86" if not defined _oArch set _oArch=x64
|
||||||
if [%osarch%]==[x86] set _oArch=x86
|
if "%osarch%"=="x86" set _oArch=x86
|
||||||
|
|
||||||
if [%_oArch%]==[x64] (set "_hookPath=%_oRoot%" & set "_hook=sppc64.dll")
|
if "%_oArch%"=="x64" (set "_hookPath=%_oRoot%" & set "_hook=sppc64.dll")
|
||||||
if [%_oArch%]==[x86] (set "_hookPath=%_oRoot%" & set "_hook=sppc32.dll")
|
if "%_oArch%"=="x86" (set "_hookPath=%_oRoot%" & set "_hook=sppc32.dll")
|
||||||
if not [%osarch%]==[x86] (
|
if not "%osarch%"=="x86" (
|
||||||
if [%_oArch%]==[x64] set "_sppcPath=%SystemRoot%\System32\sppc.dll"
|
if "%_oArch%"=="x64" set "_sppcPath=%SystemRoot%\System32\sppc.dll"
|
||||||
if [%_oArch%]==[x86] set "_sppcPath=%SystemRoot%\SysWOW64\sppc.dll"
|
if "%_oArch%"=="x86" set "_sppcPath=%SystemRoot%\SysWOW64\sppc.dll"
|
||||||
) else (
|
) else (
|
||||||
set "_sppcPath=%SystemRoot%\System32\sppc.dll"
|
set "_sppcPath=%SystemRoot%\System32\sppc.dll"
|
||||||
)
|
)
|
||||||
@@ -1043,13 +1043,13 @@ echo Activating Office... [MSI ^| %_version% ^| %_oArch%]
|
|||||||
|
|
||||||
if not defined _oBranding (
|
if not defined _oBranding (
|
||||||
set error=1
|
set error=1
|
||||||
call :dk_color %Red% "Checking BRANDING.XML [Not Found. Aborting activation...]"
|
call :dk_color %Red% "Checking BRANDING.XML [Not Found, aborting activation...]"
|
||||||
exit /b
|
exit /b
|
||||||
)
|
)
|
||||||
|
|
||||||
if not defined _oIds (
|
if not defined _oIds (
|
||||||
set error=1
|
set error=1
|
||||||
call :dk_color %Red% "Checking Installed Products [Product IDs not found. Aborting activation...]"
|
call :dk_color %Red% "Checking Installed Products [Product IDs not found, aborting activation...]"
|
||||||
exit /b
|
exit /b
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -1187,8 +1187,10 @@ reg delete "HKLM\SOFTWARE\Microsoft\Office\%%#.0\Common\OEM" /f /reg:32 %nul%
|
|||||||
)
|
)
|
||||||
|
|
||||||
reg delete "HKU\S-1-5-20\Software\Microsoft\Windows NT\CurrentVersion\SoftwareProtectionPlatform\Policies\0ff1ce15-a989-479d-af46-f275c6370663" /f %nul%
|
reg delete "HKU\S-1-5-20\Software\Microsoft\Windows NT\CurrentVersion\SoftwareProtectionPlatform\Policies\0ff1ce15-a989-479d-af46-f275c6370663" /f %nul%
|
||||||
|
reg delete "HKU\S-1-5-20\Software\Microsoft\OfficeSoftwareProtectionPlatform\Policies\0ff1ce15-a989-479d-af46-f275c6370663" /f %nul%
|
||||||
|
reg delete "HKU\S-1-5-20\Software\Microsoft\OfficeSoftwareProtectionPlatform\Policies\59a52881-a989-479d-af46-f275c6370663" /f %nul%
|
||||||
|
|
||||||
echo Clearing Office License Blocks [Successfully Cleared From All %counter% Useraccounts]
|
echo Clearing Office License Blocks [Successfully cleared from all %counter% user accounts]
|
||||||
|
|
||||||
::==========================
|
::==========================
|
||||||
|
|
||||||
@@ -1206,7 +1208,7 @@ for %%# in (%_sidlist%) do (
|
|||||||
reg delete HKU\%%#\Software\Microsoft\Office\16.0\Common\Licensing\Resiliency /f %nul%
|
reg delete HKU\%%#\Software\Microsoft\Office\16.0\Common\Licensing\Resiliency /f %nul%
|
||||||
reg add HKU\%%#\Software\Microsoft\Office\16.0\Common\Licensing\Resiliency /v "TimeOfLastHeartbeatFailure" /t REG_SZ /d "2040-01-01T00:00:00Z" /f %nul%
|
reg add HKU\%%#\Software\Microsoft\Office\16.0\Common\Licensing\Resiliency /v "TimeOfLastHeartbeatFailure" /t REG_SZ /d "2040-01-01T00:00:00Z" /f %nul%
|
||||||
)
|
)
|
||||||
echo Adding Reg Keys To Skip License Check [Successfully Added To All %counter% ^& Future New Useraccounts]
|
echo Adding Reg Keys to Skip License Check [Successfully added to all %counter% ^& future new user accounts]
|
||||||
)
|
)
|
||||||
|
|
||||||
::==========================
|
::==========================
|
||||||
@@ -1220,14 +1222,14 @@ reg query HKU\%%# %nul% && set failedtounload=1
|
|||||||
|
|
||||||
if defined failedtoload (
|
if defined failedtoload (
|
||||||
set error=1
|
set error=1
|
||||||
call :dk_color %Red% "Loading Unloaded accounts Registry [Failed For Some Useraccounts]"
|
call :dk_color %Red% "Loading Unloaded Accounts Registry [Failed for some user accounts]"
|
||||||
call :dk_color %Blue% "Restart the system and try again."
|
call :dk_color %Blue% "Reboot your machine using the restart option and try again."
|
||||||
)
|
)
|
||||||
|
|
||||||
if defined failedtounload (
|
if defined failedtounload (
|
||||||
set error=1
|
set error=1
|
||||||
call :dk_color %Red% "Unloading loaded accounts Registry [Failed For Some Useraccounts]"
|
call :dk_color %Red% "Unloading Loaded Account Registries [Failed for some user accounts]"
|
||||||
call :dk_color %Blue% "Restart the system and try again."
|
call :dk_color %Blue% "Reboot your machine using the restart option and try again."
|
||||||
)
|
)
|
||||||
|
|
||||||
exit /b
|
exit /b
|
||||||
@@ -1458,7 +1460,7 @@ function ReinstallLicenses() {
|
|||||||
|
|
||||||
set _wmic=0
|
set _wmic=0
|
||||||
for %%# in (wmic.exe) do @if not "%%~$PATH:#"=="" (
|
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
|
exit /b
|
||||||
|
|
||||||
@@ -1522,7 +1524,7 @@ set pupfound=%pupfound1%%pupfound2%
|
|||||||
set hcount=0
|
set hcount=0
|
||||||
for %%# in (avira.com kaspersky.com virustotal.com mcafee.com) do (
|
for %%# in (avira.com kaspersky.com virustotal.com mcafee.com) do (
|
||||||
find /i "%%#" %SysPath%\drivers\etc\hosts %nul% && set /a hcount+=1)
|
find /i "%%#" %SysPath%\drivers\etc\hosts %nul% && set /a hcount+=1)
|
||||||
if %hcount%==4 set "results=[AV URLs are blocked in hosts]"
|
if %hcount%==4 set "results=[Antivirus URLs are blocked in hosts]"
|
||||||
|
|
||||||
set wucount=0
|
set wucount=0
|
||||||
for %%# in (wuauserv) do (
|
for %%# in (wuauserv) do (
|
||||||
@@ -1531,7 +1533,7 @@ for %%G in (DependOnService Description DisplayName ErrorControl ImagePath Objec
|
|||||||
reg query HKLM\SYSTEM\CurrentControlSet\Services\%%# /v %%G %nul% || (set _corrupt=1 & set /a wucount+=1)
|
reg query HKLM\SYSTEM\CurrentControlSet\Services\%%# /v %%G %nul% || (set _corrupt=1 & set /a wucount+=1)
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
if %wucount% GEQ 1 set "results=%results%[WU registry is corrupt]"
|
if %wucount% GEQ 1 set "results=%results%[Windows Update registry is corrupt]"
|
||||||
|
|
||||||
sc start sppsvc %nul%
|
sc start sppsvc %nul%
|
||||||
echo "%errorlevel%" | findstr "577 225" %nul% && (
|
echo "%errorlevel%" | findstr "577 225" %nul% && (
|
||||||
@@ -1542,7 +1544,8 @@ if not exist %SysPath%\sppsvc.exe if not exist %SysPath%\alg.exe (set "results=%
|
|||||||
|
|
||||||
if not "%results%%pupfound%"=="" (
|
if not "%results%%pupfound%"=="" (
|
||||||
if defined pupfound call :dk_color %Gray% "Checking PUP Activators [Found%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
|
set fixes=%fixes% %mas%remove_mal%w%ware
|
||||||
call :dk_color2 %Blue% "Help - " %_Yellow% " %mas%remove_mal%w%ware"
|
call :dk_color2 %Blue% "Help - " %_Yellow% " %mas%remove_mal%w%ware"
|
||||||
echo:
|
echo:
|
||||||
@@ -1561,7 +1564,7 @@ call :dk_chkmal
|
|||||||
sc query Null %nul% || (
|
sc query Null %nul% || (
|
||||||
set error=1
|
set error=1
|
||||||
set showfix=1
|
set showfix=1
|
||||||
call :dk_color %Red% "Checking Sandboxing [Found. Script may not work properly.]"
|
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."
|
call :dk_color %Blue% "If you are using any third-party antivirus, check if it is blocking the script."
|
||||||
echo:
|
echo:
|
||||||
)
|
)
|
||||||
@@ -1652,7 +1655,7 @@ if defined serv_e (
|
|||||||
set error=1
|
set error=1
|
||||||
call :dk_color %Red% "Starting Services [Failed] [%serv_e%]"
|
call :dk_color %Red% "Starting Services [Failed] [%serv_e%]"
|
||||||
echo %serv_e% | findstr /i "ClipSVC-1058 sppsvc-1058" %nul% && (
|
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
|
set showfix=1
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
@@ -1692,7 +1695,7 @@ for /f "delims=" %%a in ('%psc% "$f=[io.file]::ReadAllText('!_batp!') -split ':w
|
|||||||
echo "%wpainfo%" | find /i "Error Found" %nul% && (
|
echo "%wpainfo%" | find /i "Error Found" %nul% && (
|
||||||
set error=1
|
set error=1
|
||||||
set wpaerror=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%]
|
echo Checking WPA Registry Count [%wpainfo%]
|
||||||
)
|
)
|
||||||
@@ -1731,7 +1734,7 @@ call :dk_color %Red% "Checking License Files [Not Found] [%osed
|
|||||||
|
|
||||||
if not exist "%SystemRoot%\Servicing\Packages\Microsoft-Windows-*-%osedition%-*.mum" (
|
if not exist "%SystemRoot%\Servicing\Packages\Microsoft-Windows-*-%osedition%-*.mum" (
|
||||||
set error=1
|
set error=1
|
||||||
call :dk_color %Red% "Checking Package File [Not Found] [%osedition%]"
|
call :dk_color %Red% "Checking Package Files [Not Found] [%osedition%]"
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
@@ -1802,17 +1805,23 @@ echo Checking Eval WLMS Service [Found]
|
|||||||
|
|
||||||
reg query "HKU\S-1-5-20\Software\Microsoft\Windows NT\CurrentVersion" %nul% || (
|
reg query "HKU\S-1-5-20\Software\Microsoft\Windows NT\CurrentVersion" %nul% || (
|
||||||
set error=1
|
set error=1
|
||||||
call :dk_color %Red% "Checking HKU\S-1-5-20 Reg [Not Found]"
|
call :dk_color %Red% "Checking HKU\S-1-5-20 Registry [Not Found]"
|
||||||
set fixes=%fixes% %mas%troubleshoot
|
set fixes=%fixes% %mas%troubleshoot
|
||||||
call :dk_color2 %Blue% "Help - " %_Yellow% " %mas%troubleshoot"
|
call :dk_color2 %Blue% "Help - " %_Yellow% " %mas%troubleshoot"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
for %%# in (SppEx%w%tComObj.exe sppsvc.exe) do (
|
for %%# in (SppEx%w%tComObj.exe sppsvc.exe sppsvc.exe\PerfOptions) do (
|
||||||
reg query "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Ima%w%ge File Execu%w%tion Options\%%#" %nul% && (if defined _sppint (set "_sppint=!_sppint!, %%#") else (set "_sppint=%%#"))
|
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 (
|
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%]
|
||||||
|
)
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
@@ -1827,7 +1836,7 @@ set error=1
|
|||||||
reg query "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\SoftwareProtectionPlatform\Plugins\Objects\msft:rm/algorithm/hwid/4.0" /f ba02fed39662 /d %nul% || (
|
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]"
|
call :dk_color %Red% "Checking SPP Registry Key [Incorrect ModuleId Found]"
|
||||||
set fixes=%fixes% %mas%issues_due_to_gaming_spoofers
|
set fixes=%fixes% %mas%issues_due_to_gaming_spoofers
|
||||||
call :dk_color2 %Blue% "Possibly Caused By Gaming Spoofers. Help - " %_Yellow% " %mas%issues_due_to_gaming_spoofers"
|
call :dk_color2 %Blue% "Most likely caused by HWID spoofers. Help - " %_Yellow% " %mas%issues_due_to_gaming_spoofers"
|
||||||
set error=1
|
set error=1
|
||||||
set showfix=1
|
set showfix=1
|
||||||
)
|
)
|
||||||
@@ -1857,9 +1866,9 @@ set "d=!d! $AclObject.SetSecurityDescriptorSddlForm($sddl);"
|
|||||||
set "d=!d! Set-Acl -Path %tokenstore% -AclObject $AclObject;"
|
set "d=!d! Set-Acl -Path %tokenstore% -AclObject $AclObject;"
|
||||||
%psc% "!d!" %nul%
|
%psc% "!d!" %nul%
|
||||||
if exist "%tokenstore%\" (
|
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 (
|
) 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 error=1
|
||||||
set showfix=1
|
set showfix=1
|
||||||
)
|
)
|
||||||
@@ -1893,7 +1902,7 @@ for /f "delims=" %%a in ('%psc% "(Get-ScheduledTask -TaskName 'SvcRestartTask' -
|
|||||||
echo !taskinfo! | find /i "Ready" %nul% || (
|
echo !taskinfo! | find /i "Ready" %nul% || (
|
||||||
reg delete "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\SoftwareProtectionPlatform" /v "actionlist" /f %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
|
reg query "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Schedule\TaskCache\Tree\Microsoft\Windows\SoftwareProtectionPlatform\SvcRestartTask" %nul% || set taskinfo=Removed
|
||||||
call :dk_color %Red% "Checking SvcRestartTask Status [!taskinfo!]"
|
call :dk_color %Red% "Checking SvcRestartTask Status [!taskinfo!, System might deactivate later]"
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -1908,7 +1917,13 @@ for %%# in (
|
|||||||
"HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion\SoftwareProtectionPlatform+SetValue"
|
"HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion\SoftwareProtectionPlatform+SetValue"
|
||||||
) do for /f "tokens=1,2 delims=+" %%A in (%%#) do if not defined permerror (
|
) 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%
|
%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=Error_Found
|
if !errorlevel!==2 (
|
||||||
|
if "%%A"=="%tokenstore%" (
|
||||||
|
set "permerror=Error Found In Token Folder"
|
||||||
|
) else (
|
||||||
|
set "permerror=Error Found In SPP Registries"
|
||||||
|
)
|
||||||
|
)
|
||||||
)
|
)
|
||||||
|
|
||||||
REM https://learn.microsoft.com/office/troubleshoot/activation/license-issue-when-start-office-application
|
REM https://learn.microsoft.com/office/troubleshoot/activation/license-issue-when-start-office-application
|
||||||
@@ -1971,7 +1986,7 @@ if ($osVersion.Build -ge $minBuildNumber) {
|
|||||||
}
|
}
|
||||||
for ($i=1; $i -le $count; $i++) {
|
for ($i=1; $i -le $count; $i++) {
|
||||||
if (-not $subkeyHashTable.ContainsKey("$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()
|
$wpaKey.Close()
|
||||||
exit
|
exit
|
||||||
}
|
}
|
||||||
@@ -1982,7 +1997,7 @@ $wpaKey.GetSubKeyNames() | ForEach-Object {
|
|||||||
if ($PSVersionTable.PSVersion.Major -lt 3) {
|
if ($PSVersionTable.PSVersion.Major -lt 3) {
|
||||||
cmd /c "reg query "HKLM\SYSTEM\WPA\$_" /ve /t REG_BINARY >nul 2>&1"
|
cmd /c "reg query "HKLM\SYSTEM\WPA\$_" /ve /t REG_BINARY >nul 2>&1"
|
||||||
if ($LASTEXITCODE -ne 0) {
|
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()
|
$wpaKey.Close()
|
||||||
exit
|
exit
|
||||||
}
|
}
|
||||||
@@ -1990,7 +2005,7 @@ $wpaKey.GetSubKeyNames() | ForEach-Object {
|
|||||||
$subkey = $wpaKey.OpenSubKey($_)
|
$subkey = $wpaKey.OpenSubKey($_)
|
||||||
$p = $subkey.GetValueNames()
|
$p = $subkey.GetValueNames()
|
||||||
if (($p | Where-Object { $subkey.GetValueKind($_) -eq [Microsoft.Win32.RegistryValueKind]::Binary }).Count -eq 0) {
|
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()
|
$wpaKey.Close()
|
||||||
exit
|
exit
|
||||||
}
|
}
|
||||||
@@ -2029,13 +2044,13 @@ echo:
|
|||||||
if %_unattended%==1 timeout /t 2 & exit /b
|
if %_unattended%==1 timeout /t 2 & exit /b
|
||||||
|
|
||||||
if defined fixes (
|
if defined fixes (
|
||||||
call :dk_color2 %Blue% "Press [1] To Open Troubleshoot Page " %Gray% " Press [0] To Ignore"
|
call :dk_color2 %Blue% "Press [1] to Open Troubleshoot Page " %Gray% " Press [0] to Ignore"
|
||||||
choice /C:10 /N
|
choice /C:10 /N
|
||||||
if !errorlevel!==1 (for %%# in (%fixes%) do (start %%#))
|
if !errorlevel!==1 (for %%# in (%fixes%) do (start %%#))
|
||||||
)
|
)
|
||||||
|
|
||||||
if defined terminal (
|
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
|
choice /c 0 /n
|
||||||
) else (
|
) else (
|
||||||
call :dk_color %_Yellow% "Press any key to %_exitmsg%..."
|
call :dk_color %_Yellow% "Press any key to %_exitmsg%..."
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
@set masver=2.6
|
@set masver=2.7
|
||||||
@echo off
|
@echo off
|
||||||
|
|
||||||
|
|
||||||
@@ -52,7 +52,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 EnableExtensions
|
||||||
setlocal DisableDelayedExpansion
|
setlocal DisableDelayedExpansion
|
||||||
@@ -191,13 +191,13 @@ call :dk_setvar
|
|||||||
if %winbuild% LSS 7600 (
|
if %winbuild% LSS 7600 (
|
||||||
%nceline%
|
%nceline%
|
||||||
echo Unsupported OS version detected [%winbuild%].
|
echo Unsupported OS version detected [%winbuild%].
|
||||||
echo Project is supported for Windows 7/8/8.1/10/11 and their Server equivalent.
|
echo MAS only supports Windows 7/8/8.1/10/11 and their Server equivalents.
|
||||||
goto dk_done
|
goto dk_done
|
||||||
)
|
)
|
||||||
|
|
||||||
::========================================================================================================================================
|
::========================================================================================================================================
|
||||||
|
|
||||||
:: Fix special characters limitation in path name
|
:: Fix special character limitations in path name
|
||||||
|
|
||||||
set "_work=%~dp0"
|
set "_work=%~dp0"
|
||||||
if "%_work:~-1%"=="\" set "_work=%_work:~0,-1%"
|
if "%_work:~-1%"=="\" set "_work=%_work:~0,-1%"
|
||||||
@@ -217,8 +217,8 @@ setlocal EnableDelayedExpansion
|
|||||||
echo "!_batf!" | find /i "!_ttemp!" %nul1% && (
|
echo "!_batf!" | find /i "!_ttemp!" %nul1% && (
|
||||||
if /i not "!_work!"=="!_ttemp!" (
|
if /i not "!_work!"=="!_ttemp!" (
|
||||||
%eline%
|
%eline%
|
||||||
echo Script is launched from the temp folder,
|
echo The script was launched from the temp folder.
|
||||||
echo Most likely you are running the script directly from the archive file.
|
echo You are most likely running the script directly from the archive file.
|
||||||
echo:
|
echo:
|
||||||
echo Extract the archive file and launch the script from the extracted folder.
|
echo Extract the archive file and launch the script from the extracted folder.
|
||||||
goto dk_done
|
goto dk_done
|
||||||
@@ -259,7 +259,7 @@ goto dk_done
|
|||||||
if not defined _elev %psc% "start cmd.exe -arg '/c \"!_PSarg!\"' -verb runas" && exit /b
|
if not defined _elev %psc% "start cmd.exe -arg '/c \"!_PSarg!\"' -verb runas" && exit /b
|
||||||
%eline%
|
%eline%
|
||||||
echo This script needs admin rights.
|
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
|
goto dk_done
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -312,20 +312,20 @@ set -=
|
|||||||
set old=
|
set old=
|
||||||
|
|
||||||
for /f "delims=[] tokens=2" %%# in ('ping -4 -n 1 updatecheck.mass%-%grave.dev') do (
|
for /f "delims=[] tokens=2" %%# in ('ping -4 -n 1 updatecheck.mass%-%grave.dev') do (
|
||||||
if not [%%#]==[] (echo "%%#" | find "127.69" %nul1% && (echo "%%#" | find "127.69.%masver%" %nul1% || set old=1))
|
if not "%%#"=="" (echo "%%#" | find "127.69" %nul1% && (echo "%%#" | find "127.69.%masver%" %nul1% || set old=1))
|
||||||
)
|
)
|
||||||
|
|
||||||
if defined old (
|
if defined old (
|
||||||
echo ________________________________________________
|
echo ________________________________________________
|
||||||
%eline%
|
%eline%
|
||||||
echo Version %masver% of MAS is outdated.
|
echo Your version of MAS [%masver%] is outdated.
|
||||||
echo ________________________________________________
|
echo ________________________________________________
|
||||||
echo:
|
echo:
|
||||||
if not %_unattended%==1 (
|
if not %_unattended%==1 (
|
||||||
echo [1] Get Latest MAS
|
echo [1] Get Latest MAS
|
||||||
echo [0] Continue Anyway
|
echo [0] Continue Anyway
|
||||||
echo:
|
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
|
choice /C:10 /N
|
||||||
if !errorlevel!==2 rem
|
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 ht%-%tps://github.com/mass%-%gravel/Microsoft-Acti%-%vation-Scripts & start %mas% & exit /b)
|
||||||
@@ -385,7 +385,7 @@ echo [9] Download Office
|
|||||||
echo [0] %_exitmsg%
|
echo [0] %_exitmsg%
|
||||||
echo ______________________________________________________________
|
echo ______________________________________________________________
|
||||||
echo:
|
echo:
|
||||||
call :dk_color2 %_White% " " %_Green% "Enter a menu option in the Keyboard [1,2,3,4,5,6,7,8,9,0]"
|
call :dk_color2 %_White% " " %_Green% "Choose a menu option using your keyboard [1,2,3,4,5,6,7,8,9,0]"
|
||||||
choice /C:1234567890 /N
|
choice /C:1234567890 /N
|
||||||
set _el=!errorlevel!
|
set _el=!errorlevel!
|
||||||
|
|
||||||
@@ -420,7 +420,7 @@ call :dk_chkmal
|
|||||||
|
|
||||||
if not exist %SysPath%\sppsvc.exe (
|
if not exist %SysPath%\sppsvc.exe (
|
||||||
%eline%
|
%eline%
|
||||||
echo [%SysPath%\sppsvc.exe] file is missing. Aborting...
|
echo [%SysPath%\sppsvc.exe] file is missing, aborting...
|
||||||
echo:
|
echo:
|
||||||
set fixes=%fixes% %mas%troubleshoot
|
set fixes=%fixes% %mas%troubleshoot
|
||||||
call :dk_color2 %Blue% "Help - " %_Yellow% " %mas%troubleshoot"
|
call :dk_color2 %Blue% "Help - " %_Yellow% " %mas%troubleshoot"
|
||||||
@@ -452,7 +452,7 @@ call :dk_showosinfo
|
|||||||
|
|
||||||
set _int=
|
set _int=
|
||||||
for %%a in (l.root-servers.net resolver1.opendns.com download.windowsupdate.com google.com) do if not defined _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 (
|
if not defined _int (
|
||||||
@@ -508,7 +508,7 @@ if exist "%SystemRoot%\Servicing\Packages\Microsoft-Windows-Server*EvalCorEditio
|
|||||||
|
|
||||||
if defined _eval (
|
if defined _eval (
|
||||||
reg query "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion" /v EditionID %nul2% | find /i "Eval" %nul1% && (
|
reg query "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion" /v EditionID %nul2% | find /i "Eval" %nul1% && (
|
||||||
call :dk_color %Red% "Checking Eval Edition [Evaluation Editions cannot be activated outside of evaluation period.]"
|
call :dk_color %Red% "Checking Evaluation Edition [Evaluation editions cannot be activated outside of evaluation period.]"
|
||||||
|
|
||||||
if defined _evalserv (
|
if defined _evalserv (
|
||||||
call :dk_color %Blue% "Go back to main menu and use [Change Edition] option."
|
call :dk_color %Blue% "Go back to main menu and use [Change Edition] option."
|
||||||
@@ -546,7 +546,7 @@ set /a UBR=0
|
|||||||
if %osSKU%==191 if defined altkey if defined altedition (
|
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
|
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 (
|
if %winbuild% LSS 22598 if !UBR! LSS 2788 (
|
||||||
call :dk_color %Blue% "Windows must to be updated to build 19044.2788 or higher for IotEnterpriseS %KS% activation."
|
call :dk_color %Blue% "Windows must be updated to build 19044.2788 or higher for IotEnterpriseS %KS% activation."
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -557,11 +557,11 @@ call :dk_color %Red% "Checking Alternate Edition For %KS% [%altedition% Act
|
|||||||
if not defined key if not defined _gvlk (
|
if not defined key if not defined _gvlk (
|
||||||
echo [%winos% ^| %winbuild% ^| SKU:%osSKU%]
|
echo [%winos% ^| %winbuild% ^| SKU:%osSKU%]
|
||||||
if not defined skunotfound (
|
if not defined skunotfound (
|
||||||
echo This product does not support %KS% Activation.
|
echo This product does not support %KS% activation.
|
||||||
set fixes=%fixes% %mas%unsupported_products_activation
|
set fixes=%fixes% %mas%unsupported_products_activation
|
||||||
call :dk_color2 %Blue% "Help - " %_Yellow% " %mas%unsupported_products_activation"
|
call :dk_color2 %Blue% "Help - " %_Yellow% " %mas%unsupported_products_activation"
|
||||||
) else (
|
) 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
|
set fixes=%fixes% %mas%troubleshoot
|
||||||
call :dk_color2 %Blue% "Help - " %_Yellow% " %mas%troubleshoot"
|
call :dk_color2 %Blue% "Help - " %_Yellow% " %mas%troubleshoot"
|
||||||
)
|
)
|
||||||
@@ -574,7 +574,7 @@ goto :ks_office
|
|||||||
:: Install key
|
:: Install key
|
||||||
|
|
||||||
if defined changekey (
|
if defined changekey (
|
||||||
call :dk_color %Blue% "[%altedition%] Edition product key will be used to enable %KS% activation."
|
call :dk_color %Blue% "[%altedition%] edition product key will be used to enable %KS% activation."
|
||||||
echo:
|
echo:
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -1079,7 +1079,7 @@ set _prod=!_altoffid!
|
|||||||
call :ks_osppready
|
call :ks_osppready
|
||||||
)
|
)
|
||||||
|
|
||||||
if not [!key!]==[] (
|
if not "!key!"=="" (
|
||||||
echo "!allapps!" | find /i "!_actid!" %nul1% || call :oh_installlic
|
echo "!allapps!" | find /i "!_actid!" %nul1% || call :oh_installlic
|
||||||
call :dk_inskey "[!key!] [!_prod!]"
|
call :dk_inskey "[!key!] [!_prod!]"
|
||||||
) else (
|
) else (
|
||||||
@@ -1119,8 +1119,8 @@ for /f "skip=2 tokens=2*" %%a in ('"reg query %2\Common\ProductVersion /v LastPr
|
|||||||
if "%_oRoot:~-1%"=="\" set "_oRoot=%_oRoot:~0,-1%"
|
if "%_oRoot:~-1%"=="\" set "_oRoot=%_oRoot:~0,-1%"
|
||||||
|
|
||||||
echo "%2" | find /i "Wow6432Node" %nul1% && set _oArch=x86
|
echo "%2" | find /i "Wow6432Node" %nul1% && set _oArch=x86
|
||||||
if not [%osarch%]==[x86] if not defined _oArch set _oArch=x64
|
if not "%osarch%"=="x86" if not defined _oArch set _oArch=x64
|
||||||
if [%osarch%]==[x86] set _oArch=x86
|
if "%osarch%"=="x86" set _oArch=x86
|
||||||
|
|
||||||
set "_common=%CommonProgramFiles%"
|
set "_common=%CommonProgramFiles%"
|
||||||
if defined PROCESSOR_ARCHITEW6432 set "_common=%CommonProgramW6432%"
|
if defined PROCESSOR_ARCHITEW6432 set "_common=%CommonProgramW6432%"
|
||||||
@@ -1288,8 +1288,10 @@ reg delete "HKLM\SOFTWARE\Microsoft\Office\%%#.0\Common\OEM" /f /reg:32 %nul%
|
|||||||
)
|
)
|
||||||
|
|
||||||
reg delete "HKU\S-1-5-20\Software\Microsoft\Windows NT\CurrentVersion\SoftwareProtectionPlatform\Policies\0ff1ce15-a989-479d-af46-f275c6370663" /f %nul%
|
reg delete "HKU\S-1-5-20\Software\Microsoft\Windows NT\CurrentVersion\SoftwareProtectionPlatform\Policies\0ff1ce15-a989-479d-af46-f275c6370663" /f %nul%
|
||||||
|
reg delete "HKU\S-1-5-20\Software\Microsoft\OfficeSoftwareProtectionPlatform\Policies\0ff1ce15-a989-479d-af46-f275c6370663" /f %nul%
|
||||||
|
reg delete "HKU\S-1-5-20\Software\Microsoft\OfficeSoftwareProtectionPlatform\Policies\59a52881-a989-479d-af46-f275c6370663" /f %nul%
|
||||||
|
|
||||||
echo Clearing Office License Blocks [Successfully Cleared From All %counter% Useraccounts]
|
echo Clearing Office License Blocks [Successfully cleared from all %counter% user accounts]
|
||||||
|
|
||||||
::==========================
|
::==========================
|
||||||
|
|
||||||
@@ -1307,7 +1309,7 @@ for %%# in (%_sidlist%) do (
|
|||||||
reg delete HKU\%%#\Software\Microsoft\Office\16.0\Common\Licensing\Resiliency /f %nul%
|
reg delete HKU\%%#\Software\Microsoft\Office\16.0\Common\Licensing\Resiliency /f %nul%
|
||||||
reg add HKU\%%#\Software\Microsoft\Office\16.0\Common\Licensing\Resiliency /v "TimeOfLastHeartbeatFailure" /t REG_SZ /d "2040-01-01T00:00:00Z" /f %nul%
|
reg add HKU\%%#\Software\Microsoft\Office\16.0\Common\Licensing\Resiliency /v "TimeOfLastHeartbeatFailure" /t REG_SZ /d "2040-01-01T00:00:00Z" /f %nul%
|
||||||
)
|
)
|
||||||
echo Adding Reg Keys To Skip License Check [Successfully Added To All %counter% ^& Future New Useraccounts]
|
echo Adding Reg Keys to Skip License Check [Successfully added to all %counter% ^& future new user accounts]
|
||||||
)
|
)
|
||||||
|
|
||||||
::==========================
|
::==========================
|
||||||
@@ -1321,14 +1323,14 @@ reg query HKU\%%# %nul% && set failedtounload=1
|
|||||||
|
|
||||||
if defined failedtoload (
|
if defined failedtoload (
|
||||||
set error=1
|
set error=1
|
||||||
call :dk_color %Red% "Loading Unloaded accounts Registry [Failed For Some Useraccounts]"
|
call :dk_color %Red% "Loading Unloaded Accounts Registry [Failed for some user accounts]"
|
||||||
call :dk_color %Blue% "Restart the system and try again."
|
call :dk_color %Blue% "Reboot your machine using the restart option and try again."
|
||||||
)
|
)
|
||||||
|
|
||||||
if defined failedtounload (
|
if defined failedtounload (
|
||||||
set error=1
|
set error=1
|
||||||
call :dk_color %Red% "Unloading loaded accounts Registry [Failed For Some Useraccounts]"
|
call :dk_color %Red% "Unloading Loaded Account Registries [Failed for some user accounts]"
|
||||||
call :dk_color %Blue% "Restart the system and try again."
|
call :dk_color %Blue% "Reboot your machine using the restart option and try again."
|
||||||
)
|
)
|
||||||
|
|
||||||
exit /b
|
exit /b
|
||||||
@@ -1540,7 +1542,7 @@ set t_name=Run Once Task
|
|||||||
|
|
||||||
set _wmic=0
|
set _wmic=0
|
||||||
for %%# in (wmic.exe) do @if not "%%~$PATH:#"=="" (
|
for %%# in (wmic.exe) do @if not "%%~$PATH:#"=="" (
|
||||||
wmic path Win32_ComputerSystem get CreationClassName /value 2>nul | find /i "computersystem" 1>nul && set _wmic=1
|
cmd /c "wmic path Win32_ComputerSystem get CreationClassName /value" 2>nul | find /i "computersystem" 1>nul && set _wmic=1
|
||||||
)
|
)
|
||||||
|
|
||||||
setlocal EnableDelayedExpansion
|
setlocal EnableDelayedExpansion
|
||||||
@@ -1565,12 +1567,12 @@ call :_tasksetserv
|
|||||||
|
|
||||||
for %%a in (%srvlist%) do (
|
for %%a in (%srvlist%) do (
|
||||||
for /f "delims=[] tokens=2" %%# in ('ping -n 1 %%a') do (
|
for /f "delims=[] tokens=2" %%# in ('ping -n 1 %%a') do (
|
||||||
if not [%%#]==[] goto _taskIntConnected
|
if not "%%#"=="" goto _taskIntConnected
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
|
||||||
nslookup dns.msftncsi.com 2>nul | find "131.107.255.255" 1>nul
|
nslookup dns.msftncsi.com 2>nul | find "131.107.255.255" 1>nul
|
||||||
if [%errorlevel%]==[0] goto _taskIntConnected
|
if "%errorlevel%"=="0" goto _taskIntConnected
|
||||||
|
|
||||||
if %loop%==%max_loop% (
|
if %loop%==%max_loop% (
|
||||||
set _tserror=1
|
set _tserror=1
|
||||||
@@ -1681,14 +1683,14 @@ set /a act_attempt=0
|
|||||||
|
|
||||||
if %act_attempt% GTR 4 exit /b
|
if %act_attempt% GTR 4 exit /b
|
||||||
|
|
||||||
if not [%act_ok%]==[1] (
|
if not "%act_ok%"=="1" (
|
||||||
if not defined _server call :_taskgetserv
|
if not defined _server call :_taskgetserv
|
||||||
call :_taskregserv
|
call :_taskregserv
|
||||||
)
|
)
|
||||||
|
|
||||||
if not !server_num! GTR %max_servers% (
|
if not !server_num! GTR %max_servers% (
|
||||||
|
|
||||||
if [%1]==[act_win] if %_kms38% EQU 1 (
|
if "%1"=="act_win" if %_kms38% EQU 1 (
|
||||||
set act_ok=1
|
set act_ok=1
|
||||||
exit /b
|
exit /b
|
||||||
)
|
)
|
||||||
@@ -1702,7 +1704,7 @@ if !errorcode! EQU 0 (
|
|||||||
set act_ok=1
|
set act_ok=1
|
||||||
exit /b
|
exit /b
|
||||||
)
|
)
|
||||||
if [%1]==[act_win] if !errorcode! EQU -1073418187 if %winbuild% LSS 9200 (
|
if "%1"=="act_win" if !errorcode! EQU -1073418187 if %winbuild% LSS 9200 (
|
||||||
set act_ok=1
|
set act_ok=1
|
||||||
exit /b
|
exit /b
|
||||||
)
|
)
|
||||||
@@ -1717,9 +1719,9 @@ exit /b
|
|||||||
|
|
||||||
:_actinfo
|
:_actinfo
|
||||||
|
|
||||||
if [%1]==[act_win] if not defined t_name (set prodname=%winos%)
|
if "%1"=="act_win" if not defined t_name (set prodname=%winos%)
|
||||||
|
|
||||||
if [%1]==[act_win] if %_kms38% EQU 1 (
|
if "%1"=="act_win" if %_kms38% EQU 1 (
|
||||||
if defined t_name (
|
if defined t_name (
|
||||||
echo %prodname% is already activated with KMS38.
|
echo %prodname% is already activated with KMS38.
|
||||||
) else (
|
) else (
|
||||||
@@ -1739,7 +1741,7 @@ set _tserror=1
|
|||||||
exit /b
|
exit /b
|
||||||
)
|
)
|
||||||
|
|
||||||
if %errorcode% EQU -1073418187 if [%1]==[act_win] if %winbuild% LSS 9200 (
|
if %errorcode% EQU -1073418187 if "%1"=="act_win" if %winbuild% LSS 9200 (
|
||||||
if defined t_name (
|
if defined t_name (
|
||||||
echo %prodname% cannot be KMS-activated on this computer due to unqualified OEM BIOS [0xC004F035].
|
echo %prodname% cannot be KMS-activated on this computer due to unqualified OEM BIOS [0xC004F035].
|
||||||
) else (
|
) else (
|
||||||
@@ -1784,9 +1786,9 @@ exit /b
|
|||||||
)
|
)
|
||||||
|
|
||||||
set _actpass=1
|
set _actpass=1
|
||||||
if %gpr% EQU 43200 if [%1]==[act_win] if %winbuild% GEQ 9200 set _actpass=0
|
if %gpr% EQU 43200 if "%1"=="act_win" if %winbuild% GEQ 9200 set _actpass=0
|
||||||
if %gpr% EQU 64800 set _actpass=0
|
if %gpr% EQU 64800 set _actpass=0
|
||||||
if %gpr% GTR 259200 if [%1]==[act_win] call :_taskchkEnterpriseG _actpass
|
if %gpr% GTR 259200 if "%1"=="act_win" call :_taskchkEnterpriseG _actpass
|
||||||
if %gpr% EQU 259200 set _actpass=0
|
if %gpr% EQU 259200 set _actpass=0
|
||||||
|
|
||||||
if %errorcode% EQU 0 if %_actpass% EQU 0 (
|
if %errorcode% EQU 0 if %_actpass% EQU 0 (
|
||||||
@@ -1990,8 +1992,8 @@ set !server%rand%!=1
|
|||||||
|
|
||||||
set /a server_num+=1
|
set /a server_num+=1
|
||||||
(for /f "delims=[] tokens=2" %%a in ('ping -4 -n 1 %KMS_IP% 2^>nul') do set "KMS_IP=%%a"
|
(for /f "delims=[] tokens=2" %%a in ('ping -4 -n 1 %KMS_IP% 2^>nul') do set "KMS_IP=%%a"
|
||||||
if [%KMS_IP%]==[!KMS_IP!] for /f "delims=[] tokens=2" %%# in ('pathping -4 -h 1 -n -p 1 -q 1 -w 1 %KMS_IP% 2^>nul') do set "KMS_IP=%%#"
|
if "%KMS_IP%"=="!KMS_IP!" for /f "delims=[] tokens=2" %%# in ('pathping -4 -h 1 -n -p 1 -q 1 -w 1 %KMS_IP% 2^>nul') do set "KMS_IP=%%#"
|
||||||
if not [%KMS_IP%]==[!KMS_IP!] exit /b
|
if not "%KMS_IP%"=="!KMS_IP!" exit /b
|
||||||
goto :_taskgetserv
|
goto :_taskgetserv
|
||||||
)
|
)
|
||||||
::Ver:2.7
|
::Ver:2.7
|
||||||
@@ -2446,7 +2448,7 @@ function ReinstallLicenses() {
|
|||||||
|
|
||||||
set _wmic=0
|
set _wmic=0
|
||||||
for %%# in (wmic.exe) do @if not "%%~$PATH:#"=="" (
|
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
|
exit /b
|
||||||
|
|
||||||
@@ -2546,7 +2548,7 @@ for %%# in (pkeyhelper.dll) do @if "%%~$PATH:#"=="" exit /b
|
|||||||
for %%# in (Volume:GVLK) do (
|
for %%# in (Volume:GVLK) do (
|
||||||
call :k_pkey %osSKU% '%%#'
|
call :k_pkey %osSKU% '%%#'
|
||||||
if defined pkey call :k_pkeychannel !pkey!
|
if defined pkey call :k_pkeychannel !pkey!
|
||||||
if /i [!pkeychannel!]==[%%#] (
|
if /i "!pkeychannel!"=="%%#" (
|
||||||
set key=!pkey!
|
set key=!pkey!
|
||||||
exit /b
|
exit /b
|
||||||
)
|
)
|
||||||
@@ -2571,7 +2573,7 @@ set pupfound=%pupfound1%%pupfound2%
|
|||||||
set hcount=0
|
set hcount=0
|
||||||
for %%# in (avira.com kaspersky.com virustotal.com mcafee.com) do (
|
for %%# in (avira.com kaspersky.com virustotal.com mcafee.com) do (
|
||||||
find /i "%%#" %SysPath%\drivers\etc\hosts %nul% && set /a hcount+=1)
|
find /i "%%#" %SysPath%\drivers\etc\hosts %nul% && set /a hcount+=1)
|
||||||
if %hcount%==4 set "results=[AV URLs are blocked in hosts]"
|
if %hcount%==4 set "results=[Antivirus URLs are blocked in hosts]"
|
||||||
|
|
||||||
set wucount=0
|
set wucount=0
|
||||||
for %%# in (wuauserv) do (
|
for %%# in (wuauserv) do (
|
||||||
@@ -2580,7 +2582,7 @@ for %%G in (DependOnService Description DisplayName ErrorControl ImagePath Objec
|
|||||||
reg query HKLM\SYSTEM\CurrentControlSet\Services\%%# /v %%G %nul% || (set _corrupt=1 & set /a wucount+=1)
|
reg query HKLM\SYSTEM\CurrentControlSet\Services\%%# /v %%G %nul% || (set _corrupt=1 & set /a wucount+=1)
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
if %wucount% GEQ 1 set "results=%results%[WU registry is corrupt]"
|
if %wucount% GEQ 1 set "results=%results%[Windows Update registry is corrupt]"
|
||||||
|
|
||||||
sc start sppsvc %nul%
|
sc start sppsvc %nul%
|
||||||
echo "%errorlevel%" | findstr "577 225" %nul% && (
|
echo "%errorlevel%" | findstr "577 225" %nul% && (
|
||||||
@@ -2591,7 +2593,8 @@ if not exist %SysPath%\sppsvc.exe if not exist %SysPath%\alg.exe (set "results=%
|
|||||||
|
|
||||||
if not "%results%%pupfound%"=="" (
|
if not "%results%%pupfound%"=="" (
|
||||||
if defined pupfound call :dk_color %Gray% "Checking PUP Activators [Found%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
|
set fixes=%fixes% %mas%remove_mal%w%ware
|
||||||
call :dk_color2 %Blue% "Help - " %_Yellow% " %mas%remove_mal%w%ware"
|
call :dk_color2 %Blue% "Help - " %_Yellow% " %mas%remove_mal%w%ware"
|
||||||
echo:
|
echo:
|
||||||
@@ -2610,7 +2613,7 @@ call :dk_chkmal
|
|||||||
sc query Null %nul% || (
|
sc query Null %nul% || (
|
||||||
set error=1
|
set error=1
|
||||||
set showfix=1
|
set showfix=1
|
||||||
call :dk_color %Red% "Checking Sandboxing [Found. Script may not work properly.]"
|
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."
|
call :dk_color %Blue% "If you are using any third-party antivirus, check if it is blocking the script."
|
||||||
echo:
|
echo:
|
||||||
)
|
)
|
||||||
@@ -2701,7 +2704,7 @@ if defined serv_e (
|
|||||||
set error=1
|
set error=1
|
||||||
call :dk_color %Red% "Starting Services [Failed] [%serv_e%]"
|
call :dk_color %Red% "Starting Services [Failed] [%serv_e%]"
|
||||||
echo %serv_e% | findstr /i "ClipSVC-1058 sppsvc-1058" %nul% && (
|
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
|
set showfix=1
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
@@ -2741,7 +2744,7 @@ for /f "delims=" %%a in ('%psc% "$f=[io.file]::ReadAllText('!_batp!') -split ':w
|
|||||||
echo "%wpainfo%" | find /i "Error Found" %nul% && (
|
echo "%wpainfo%" | find /i "Error Found" %nul% && (
|
||||||
set error=1
|
set error=1
|
||||||
set wpaerror=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%]
|
echo Checking WPA Registry Count [%wpainfo%]
|
||||||
)
|
)
|
||||||
@@ -2780,7 +2783,7 @@ call :dk_color %Red% "Checking License Files [Not Found] [%osed
|
|||||||
|
|
||||||
if not exist "%SystemRoot%\Servicing\Packages\Microsoft-Windows-*-%osedition%-*.mum" (
|
if not exist "%SystemRoot%\Servicing\Packages\Microsoft-Windows-*-%osedition%-*.mum" (
|
||||||
set error=1
|
set error=1
|
||||||
call :dk_color %Red% "Checking Package File [Not Found] [%osedition%]"
|
call :dk_color %Red% "Checking Package Files [Not Found] [%osedition%]"
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
@@ -2851,17 +2854,23 @@ echo Checking Eval WLMS Service [Found]
|
|||||||
|
|
||||||
reg query "HKU\S-1-5-20\Software\Microsoft\Windows NT\CurrentVersion" %nul% || (
|
reg query "HKU\S-1-5-20\Software\Microsoft\Windows NT\CurrentVersion" %nul% || (
|
||||||
set error=1
|
set error=1
|
||||||
call :dk_color %Red% "Checking HKU\S-1-5-20 Reg [Not Found]"
|
call :dk_color %Red% "Checking HKU\S-1-5-20 Registry [Not Found]"
|
||||||
set fixes=%fixes% %mas%troubleshoot
|
set fixes=%fixes% %mas%troubleshoot
|
||||||
call :dk_color2 %Blue% "Help - " %_Yellow% " %mas%troubleshoot"
|
call :dk_color2 %Blue% "Help - " %_Yellow% " %mas%troubleshoot"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
for %%# in (SppEx%w%tComObj.exe sppsvc.exe) do (
|
for %%# in (SppEx%w%tComObj.exe sppsvc.exe sppsvc.exe\PerfOptions) do (
|
||||||
reg query "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Ima%w%ge File Execu%w%tion Options\%%#" %nul% && (if defined _sppint (set "_sppint=!_sppint!, %%#") else (set "_sppint=%%#"))
|
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 (
|
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%]
|
||||||
|
)
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
@@ -2876,7 +2885,7 @@ set error=1
|
|||||||
reg query "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\SoftwareProtectionPlatform\Plugins\Objects\msft:rm/algorithm/hwid/4.0" /f ba02fed39662 /d %nul% || (
|
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]"
|
call :dk_color %Red% "Checking SPP Registry Key [Incorrect ModuleId Found]"
|
||||||
set fixes=%fixes% %mas%issues_due_to_gaming_spoofers
|
set fixes=%fixes% %mas%issues_due_to_gaming_spoofers
|
||||||
call :dk_color2 %Blue% "Possibly Caused By Gaming Spoofers. Help - " %_Yellow% " %mas%issues_due_to_gaming_spoofers"
|
call :dk_color2 %Blue% "Most likely caused by HWID spoofers. Help - " %_Yellow% " %mas%issues_due_to_gaming_spoofers"
|
||||||
set error=1
|
set error=1
|
||||||
set showfix=1
|
set showfix=1
|
||||||
)
|
)
|
||||||
@@ -2906,9 +2915,9 @@ set "d=!d! $AclObject.SetSecurityDescriptorSddlForm($sddl);"
|
|||||||
set "d=!d! Set-Acl -Path %tokenstore% -AclObject $AclObject;"
|
set "d=!d! Set-Acl -Path %tokenstore% -AclObject $AclObject;"
|
||||||
%psc% "!d!" %nul%
|
%psc% "!d!" %nul%
|
||||||
if exist "%tokenstore%\" (
|
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 (
|
) 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 error=1
|
||||||
set showfix=1
|
set showfix=1
|
||||||
)
|
)
|
||||||
@@ -2942,7 +2951,7 @@ for /f "delims=" %%a in ('%psc% "(Get-ScheduledTask -TaskName 'SvcRestartTask' -
|
|||||||
echo !taskinfo! | find /i "Ready" %nul% || (
|
echo !taskinfo! | find /i "Ready" %nul% || (
|
||||||
reg delete "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\SoftwareProtectionPlatform" /v "actionlist" /f %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
|
reg query "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Schedule\TaskCache\Tree\Microsoft\Windows\SoftwareProtectionPlatform\SvcRestartTask" %nul% || set taskinfo=Removed
|
||||||
call :dk_color %Red% "Checking SvcRestartTask Status [!taskinfo!]"
|
call :dk_color %Red% "Checking SvcRestartTask Status [!taskinfo!, System might deactivate later]"
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -2957,7 +2966,13 @@ for %%# in (
|
|||||||
"HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion\SoftwareProtectionPlatform+SetValue"
|
"HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion\SoftwareProtectionPlatform+SetValue"
|
||||||
) do for /f "tokens=1,2 delims=+" %%A in (%%#) do if not defined permerror (
|
) 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%
|
%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=Error_Found
|
if !errorlevel!==2 (
|
||||||
|
if "%%A"=="%tokenstore%" (
|
||||||
|
set "permerror=Error Found In Token Folder"
|
||||||
|
) else (
|
||||||
|
set "permerror=Error Found In SPP Registries"
|
||||||
|
)
|
||||||
|
)
|
||||||
)
|
)
|
||||||
|
|
||||||
REM https://learn.microsoft.com/office/troubleshoot/activation/license-issue-when-start-office-application
|
REM https://learn.microsoft.com/office/troubleshoot/activation/license-issue-when-start-office-application
|
||||||
@@ -3020,7 +3035,7 @@ if ($osVersion.Build -ge $minBuildNumber) {
|
|||||||
}
|
}
|
||||||
for ($i=1; $i -le $count; $i++) {
|
for ($i=1; $i -le $count; $i++) {
|
||||||
if (-not $subkeyHashTable.ContainsKey("$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()
|
$wpaKey.Close()
|
||||||
exit
|
exit
|
||||||
}
|
}
|
||||||
@@ -3031,7 +3046,7 @@ $wpaKey.GetSubKeyNames() | ForEach-Object {
|
|||||||
if ($PSVersionTable.PSVersion.Major -lt 3) {
|
if ($PSVersionTable.PSVersion.Major -lt 3) {
|
||||||
cmd /c "reg query "HKLM\SYSTEM\WPA\$_" /ve /t REG_BINARY >nul 2>&1"
|
cmd /c "reg query "HKLM\SYSTEM\WPA\$_" /ve /t REG_BINARY >nul 2>&1"
|
||||||
if ($LASTEXITCODE -ne 0) {
|
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()
|
$wpaKey.Close()
|
||||||
exit
|
exit
|
||||||
}
|
}
|
||||||
@@ -3039,7 +3054,7 @@ $wpaKey.GetSubKeyNames() | ForEach-Object {
|
|||||||
$subkey = $wpaKey.OpenSubKey($_)
|
$subkey = $wpaKey.OpenSubKey($_)
|
||||||
$p = $subkey.GetValueNames()
|
$p = $subkey.GetValueNames()
|
||||||
if (($p | Where-Object { $subkey.GetValueKind($_) -eq [Microsoft.Win32.RegistryValueKind]::Binary }).Count -eq 0) {
|
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()
|
$wpaKey.Close()
|
||||||
exit
|
exit
|
||||||
}
|
}
|
||||||
@@ -3078,13 +3093,13 @@ echo:
|
|||||||
if %_unattended%==1 timeout /t 2 & exit /b
|
if %_unattended%==1 timeout /t 2 & exit /b
|
||||||
|
|
||||||
if defined fixes (
|
if defined fixes (
|
||||||
call :dk_color2 %Blue% "Press [1] To Open Troubleshoot Page " %Gray% " Press [0] To Ignore"
|
call :dk_color2 %Blue% "Press [1] to Open Troubleshoot Page " %Gray% " Press [0] to Ignore"
|
||||||
choice /C:10 /N
|
choice /C:10 /N
|
||||||
if !errorlevel!==1 (for %%# in (%fixes%) do (start %%#))
|
if !errorlevel!==1 (for %%# in (%fixes%) do (start %%#))
|
||||||
)
|
)
|
||||||
|
|
||||||
if defined terminal (
|
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
|
choice /c 0 /n
|
||||||
) else (
|
) else (
|
||||||
call :dk_color %_Yellow% "Press any key to %_exitmsg%..."
|
call :dk_color %_Yellow% "Press any key to %_exitmsg%..."
|
||||||
@@ -3362,80 +3377,6 @@ a78b8bd9-8017-4df5-b86a-09f756affa7c_6TPJF-RBVHG-WBW2R-86QPH-6R%f%TM4__17_Server
|
|||||||
cda18cf3-c196-46ad-b289-60c072869994_TT8MH-CG224-D3D7Q-498W2-9Q%f%CTX__18_ServerHPC
|
cda18cf3-c196-46ad-b289-60c072869994_TT8MH-CG224-D3D7Q-498W2-9Q%f%CTX__18_ServerHPC
|
||||||
a78b8bd9-8017-4df5-b86a-09f756affa7c_6TPJF-RBVHG-WBW2R-86QPH-6R%f%TM4__29_ServerWebCore
|
a78b8bd9-8017-4df5-b86a-09f756affa7c_6TPJF-RBVHG-WBW2R-86QPH-6R%f%TM4__29_ServerWebCore
|
||||||
f772515c-0e87-48d5-a676-e6962c3e1195_736RG-XDKJK-V34PF-BHK87-J6%f%X3K__56_ServerEmbeddedSolution
|
f772515c-0e87-48d5-a676-e6962c3e1195_736RG-XDKJK-V34PF-BHK87-J6%f%X3K__56_ServerEmbeddedSolution
|
||||||
:: Old Preview editions - Generated keys
|
|
||||||
43f2ab05-7c87-4d56-b27c-44d0f9a3dabd_JDTNC-PP77T-T9H2W-G4J2J-VH%f%7MW___4_Enterprise
|
|
||||||
cde952c7-2f96-4d9d-8f2b-2d349f64fc51_VHF9H-NXBBB-63VJD-4V8GJ-2R%f%YK8___4_Enterprise
|
|
||||||
2a4403df-877f-4046-8271-db6fb6ec54c8_N896F-VG44B-HF8HC-XW23F-MW%f%8YB___4_Enterprise
|
|
||||||
d3872724-5c08-4b1b-91f2-fc9eafed4990_3NMDC-G7C3W-68RGP-CQK9H-B7%f%QK9___7_ServerStandard
|
|
||||||
ba947c44-d19d-4786-b6ae-22770bc94c54_T8N4T-C6P4F-W48KM-CYJT9-KP%f%69Y___8_ServerDatacenter
|
|
||||||
8a409d61-30fe-4903-bdbc-1fb28603ba3a_NBBBB-BBBBB-BBBBB-BPTW9-H4%f%83R__10_ServerEnterprise
|
|
||||||
e5676f13-9b66-4a1f-8b0c-43490e236202_RN84D-7HCWY-FTCBK-J3GHK-RM%f%YVT__17_ServerWeb
|
|
||||||
2412bea9-b6e0-441e-8dc2-a13720b42de9_2FNVD-CPYC6-WXD8M-VJKXF-GX%f%TCB__18_ServerHPC
|
|
||||||
6ae51eeb-c268-4a21-9aae-df74c38b586d_RN3QB-GT6D7-YB3VH-F3RPB-3G%f%P42__27_EnterpriseN
|
|
||||||
c23947f3-3f2e-401f-a38c-f38fe0ecb0bd_NKX82-GPWWM-C2KPY-VG78C-FF%f%9R9__27_EnterpriseN
|
|
||||||
ff808201-fec6-4fd4-ae16-abbddade5706_CC6JP-VN67C-8KCJ4-4V48V-HX%f%M9B__48_Professional
|
|
||||||
a4383e6b-dada-423d-a43d-f25678429676_Q8MK8-DNHMX-2XWHV-X66TM-CD%f%G33__48_Professional
|
|
||||||
34260150-69ac-49a3-8a0d-4a403ab55763_TNYKV-X79V3-CPD6X-Y2MRW-D9%f%M9H__49_ProfessionalN
|
|
||||||
64192251-81b0-4898-ac63-913cc3edf919_9CYB3-NFMRW-YFDG6-XRQFD-J4%f%YPJ__49_ProfessionalN
|
|
||||||
2b9c337f-7a1d-4271-90a3-c6855a2b8a1c_992NC-RYK89-M9XBG-4DCB3-GF%f%XVK__74_Prerelease
|
|
||||||
bfa6b683-56be-47b8-a22e-461b27b9cf11_2WFGX-YXN3B-BT46K-4DPYX-T8%f%W2J__76_ServerMultiPointStandard
|
|
||||||
bc20fb5b-4097-484f-84d2-55b18dac95eb_CQN7Q-KH97X-TH9G4-JRGWM-R6%f%T86__77_ServerMultiPointPremium
|
|
||||||
631ead72-a8ab-4df8-bbdf-372029989bdd_N92MW-K723D-FCBCQ-CGPPQ-3M%f%9VR__81_PrereleaseARM
|
|
||||||
9cc2564c-292e-4d8a-b9f9-1f5007d9409a_82CNJ-W82TW-BY23W-BVJ6W-W4%f%2Y2__86_EmbeddedIndustryA
|
|
||||||
c35a9336-fb02-48db-8f4d-245c17f03667_NXTJV-CRQYQ-W77JR-GG84R-HQ%f%VHX__89_EmbeddedIndustry
|
|
||||||
4daf1e3e-6be9-4848-8f5a-a18a0d2895e1_7MNJY-B88MV-WQKVP-BQ6DK-6C%f%M4G__91_EmbeddedIndustryE
|
|
||||||
c8cca3ca-bea8-4f6f-87e0-4d050ce8f0a9_RNPX3-4GPFM-2DHXB-8WD8P-4R%f%DQX__91_EmbeddedIndustryE
|
|
||||||
5ca3e488-dbae-4fae-8282-a98fbcd21126_HM9NW-WY98Q-XDF7H-3QV6B-X4%f%QFF__91_EmbeddedIndustryE
|
|
||||||
b554b49f-4d57-4f08-955e-87886f514d49_4QC36-NW3YH-D2Y9D-RJPC7-VV%f%BDF__97_CoreARM
|
|
||||||
3a9a9414-24bf-4836-866d-ba13a298efb0_4K89N-FMV8W-B3F9T-HKF64-DJ%f%X27__97_CoreARM
|
|
||||||
4dfd543d-caa6-4f69-a95f-5ddfe2b89567_KG3N2-VRJ6F-P36TD-6MMCF-PP%f%QX7__98_CoreN
|
|
||||||
c6e3410d-e48d-41eb-8ca9-848397f46d02_3TGHP-NHXHM-2PMXX-8KR9M-G2%f%782__98_CoreN
|
|
||||||
5fe40dd6-cf1f-4cf2-8729-92121ac2e997_XFNM6-P9FYP-MRF6P-MM6V2-27%f%KDP__99_CoreCountrySpecific
|
|
||||||
c7a8a09a-571c-4ea8-babc-0cbe4d48a89d_H76BG-QBNM2-QRWJY-67W73-BG%f%7CQ__99_CoreCountrySpecific
|
|
||||||
2cc171ef-db48-4adc-af09-7c574b37f139_N47PH-2Y8Q8-DGMMV-3PGD8-WB%f%6Q2_100_CoreSingleLanguage
|
|
||||||
b148c3f4-6248-4d2f-8c6d-31cce7ae95c3_N9722-BV9H6-WTJTT-FPB93-97%f%3PR_100_CoreSingleLanguage
|
|
||||||
903663f7-d2ab-49c9-8942-14aa9e0a9c72_VWCNX-7FKBD-FHJYG-XBR4B-88%f%GQH_101_Core
|
|
||||||
6496e59d-89dc-49eb-a353-09ceb9404845_HRNH7-WFBYW-BV7M2-XCT6H-X7%f%3PT_101_Core
|
|
||||||
cc17e18a-fa93-43d6-9179-72950a1e931a_FDF9N-KGHKC-R9G6Y-W2TGC-9Q%f%CCB_103_ProfessionalWMC
|
|
||||||
cf59a07b-1a2a-4be0-bfe0-423b5823e663_FDF9N-KGHKC-R9G6Y-W2TGC-9P%f%787_103_ProfessionalWMC
|
|
||||||
827a0032-dced-4609-ab6e-16b9d8a40280_CC92N-X2Y7W-H4H32-QHV2X-3R%f%TT9_111_CoreConnected
|
|
||||||
c436def1-0dcc-4849-9a59-8b6142eb70f3_2FNVD-CPYC6-WXD8M-T64BF-84%f%3GJ_111_CoreConnected
|
|
||||||
49066601-00dc-4d2c-83a8-4343a7b990d1_CF9DD-6CNW2-BJWJQ-CVCFX-Y7%f%WMR_112_ProfessionalStudent
|
|
||||||
fd5ae385-f5cf-4b53-b1fa-1af6fff7c0d8_HJN63-7Q4G4-VDW7X-TRMW8-GV%f%H3Q_112_ProfessionalStudent
|
|
||||||
f18bbe32-16dc-48d4-a27b-5f3966f82513_KJ3DB-VNXVJ-GJG94-RX4RF-K4%f%TVG_113_CoreConnectedN
|
|
||||||
86f72c8d-8363-4188-b574-1a53cb374711_JGRP6-TNJWX-KQWHJ-6D3FJ-RX%f%73B_113_CoreConnectedN
|
|
||||||
bd64ebf7-d5ec-44c5-ba00-6813441c8c87_4K89N-FMV8W-B3F9T-HKF64-DJ%f%34M_114_ProfessionalStudentN
|
|
||||||
687f6358-6a21-453a-a712-3b3b57123827_3K4DY-NVP2W-H8DGV-42K3B-2P%f%PK9_114_ProfessionalStudentN
|
|
||||||
964a60f6-1505-4ddb-af03-6a9ce6997d3b_NKX82-GPWWM-C2KPY-T4PKC-7C%f%FYJ_115_CoreConnectedSingleLanguage
|
|
||||||
5b120df4-ea3f-4e82-b0c0-6568f719730e_2N382-D6PKK-QTX4D-2JJYK-M9%f%73H_115_CoreConnectedSingleLanguage
|
|
||||||
b5fe5eaa-14cc-4075-84ae-57c0206d1133_BJMNR-F3WG7-H8W83-27XXK-P3%f%8MC_116_CoreConnectedCountrySpecific
|
|
||||||
a8651bfb-7fe0-40df-b156-87337ecd5acc_RPM6J-N62DM-DC6XH-2JXMG-23%f%66R_116_CoreConnectedCountrySpecific
|
|
||||||
5b2add49-b8f4-42e0-a77c-adad4efeeeb1_NT3V6-XMBK7-Q66MF-VMKR4-FC%f%26C_119_PPIPro
|
|
||||||
af43f7f0-3b1e-4266-a123-1fdb53f4323b_BNJR8-P8QHP-VQ4QY-MVPQP-8X%f%C37_121_Education
|
|
||||||
e8ced63e-420d-4ab6-8723-aaf165efb5eb_QBQ3Q-2NC74-MKH8F-DTQ34-QG%f%M3G_121_Education
|
|
||||||
075aca1f-05d7-42e5-a3ce-e349e7be7078_RFNBP-FDD7Q-6FHYQ-9M9Y7-MB%f%JH3_122_EducationN
|
|
||||||
3885bca5-11c1-4d4e-9395-df38f7f09a0e_7MFGN-34DMC-J8FCR-P4DKH-KH%f%J8F_122_EducationN
|
|
||||||
b995b62c-eae2-40aa-afb9-111889a84ef4_DW99Y-H7NT6-6B29D-8JQ8F-R3%f%K6T_124_ServerHI
|
|
||||||
2cf5af84-abab-4ff0-83f8-f040fb2576eb_NVYRQ-D2F32-6HGXW-DKGWM-R6%f%Y8H_125_EnterpriseS
|
|
||||||
75d003b0-dc66-42c0-b3a1-308a3f35741a_FQ32Q-MN6JD-FPVJ9-HJD4W-PK%f%CWY_125_EnterpriseS
|
|
||||||
11a37f09-fb7f-4002-bd84-f3ae71d11e90_NMBY8-V3CV7-BX6K6-2922Y-43%f%MCH_126_EnterpriseSN
|
|
||||||
4e4d5504-e7b1-419c-913d-3c80c15294fc_KGR4C-FWN4D-33RTK-XB6Q8-K2%f%FPT_126_EnterpriseSN
|
|
||||||
b15187db-11c6-4f13-91ca-8121cebf5b88_JBDKF-6NCD6-49K3G-2TV79-BK%f%PB4_127_ProfessionalS
|
|
||||||
aa234c15-ee34-4e5f-adb5-73afafb77143_DNJYG-CM8W6-4W3TX-VCK66-FV%f%WCC_127_ProfessionalS
|
|
||||||
6cdbc9fb-63f5-431b-a5c0-c6f19ae26a9b_2NWVW-QGF4T-9CPMB-WYDQ9-7X%f%PB8_128_ProfessionalSN
|
|
||||||
9f6a1bc9-5278-4991-88c9-7301c87a75ea_XB9DG-NPJ72-XRH69-7DF3Q-G8%f%3R4_128_ProfessionalSN
|
|
||||||
:: Missing keys for old preview editions
|
|
||||||
:: 38fbe2ac-465a-4ef7-b9d8-72044f2792b6 4 Enterprise
|
|
||||||
:: ea77973e-4930-4fa1-a899-02dfaeada1db 4 Enterprise
|
|
||||||
:: 92374131-ed4c-4d1b-846a-32f43c3eb90d 7 ServerStandard
|
|
||||||
:: cc64c548-1867-4777-a1cc-0022691bc2a0 8 ServerDatacenter
|
|
||||||
:: 9dce1f29-bb10-4be0-8027-35b953dd46d5 10 ServerEnterprise
|
|
||||||
:: bf9eda2f-74cc-4ba3-8967-cde30f18c230 15 ServerEnterpriseIA64
|
|
||||||
:: 4f4cfa6c-76d8-49f5-9c41-0a57f8af1bbc 17 ServerWeb
|
|
||||||
:: 8372b47d-5221-41d8-88d0-3f924e50623e 18 ServerHPC
|
|
||||||
:: e4ecef68-4372-4740-98e8-6c157cd301c2 27 EnterpriseN
|
|
||||||
:: 957ec1e8-97cd-42a8-a091-01a30cf779da 48 Professional
|
|
||||||
:: 0ff4e536-a746-4018-b107-e81dd0b6d33a 49 ProfessionalN
|
|
||||||
::========================================================================================================================================
|
::========================================================================================================================================
|
||||||
:: Office 2010
|
:: Office 2010
|
||||||
8ce7e872-188c-4b98-9d90-f8f90b7aad02_V7Y44-9T38C-R2VJK-666HK-T7%f%DDX__14_AccessVL
|
8ce7e872-188c-4b98-9d90-f8f90b7aad02_V7Y44-9T38C-R2VJK-666HK-T7%f%DDX__14_AccessVL
|
||||||
|
|||||||
1339
MAS/Separate-Files-Version/Change_Office_Edition.cmd
Normal file
1339
MAS/Separate-Files-Version/Change_Office_Edition.cmd
Normal file
File diff suppressed because it is too large
Load Diff
@@ -1,4 +1,4 @@
|
|||||||
@set masver=2.6
|
@set masver=2.7
|
||||||
@echo off
|
@echo off
|
||||||
|
|
||||||
|
|
||||||
@@ -19,7 +19,7 @@ set _stg=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 EnableExtensions
|
||||||
setlocal DisableDelayedExpansion
|
setlocal DisableDelayedExpansion
|
||||||
@@ -127,13 +127,13 @@ set "line=echo _________________________________________________________________
|
|||||||
if %winbuild% LSS 7600 (
|
if %winbuild% LSS 7600 (
|
||||||
%nceline%
|
%nceline%
|
||||||
echo Unsupported OS version detected [%winbuild%].
|
echo Unsupported OS version detected [%winbuild%].
|
||||||
echo Project is supported only for Windows 7/8/8.1/10/11 and their Server equivalent.
|
echo Project is supported only for Windows 7/8/8.1/10/11 and their Server equivalents.
|
||||||
goto dk_done
|
goto dk_done
|
||||||
)
|
)
|
||||||
|
|
||||||
::========================================================================================================================================
|
::========================================================================================================================================
|
||||||
|
|
||||||
:: Fix special characters limitation in path name
|
:: Fix special character limitations in path name
|
||||||
|
|
||||||
set "_work=%~dp0"
|
set "_work=%~dp0"
|
||||||
if "%_work:~-1%"=="\" set "_work=%_work:~0,-1%"
|
if "%_work:~-1%"=="\" set "_work=%_work:~0,-1%"
|
||||||
@@ -153,8 +153,8 @@ setlocal EnableDelayedExpansion
|
|||||||
echo "!_batf!" | find /i "!_ttemp!" %nul1% && (
|
echo "!_batf!" | find /i "!_ttemp!" %nul1% && (
|
||||||
if /i not "!_work!"=="!_ttemp!" (
|
if /i not "!_work!"=="!_ttemp!" (
|
||||||
%eline%
|
%eline%
|
||||||
echo Script is launched from the temp folder,
|
echo The script was launched from the temp folder.
|
||||||
echo Most likely you are running the script directly from the archive file.
|
echo You are most likely running the script directly from the archive file.
|
||||||
echo:
|
echo:
|
||||||
echo Extract the archive file and launch the script from the extracted folder.
|
echo Extract the archive file and launch the script from the extracted folder.
|
||||||
goto dk_done
|
goto dk_done
|
||||||
@@ -195,7 +195,7 @@ goto dk_done
|
|||||||
if not defined _elev %psc% "start cmd.exe -arg '/c \"!_PSarg!\"' -verb runas" && exit /b
|
if not defined _elev %psc% "start cmd.exe -arg '/c \"!_PSarg!\"' -verb runas" && exit /b
|
||||||
%eline%
|
%eline%
|
||||||
echo This script needs admin rights.
|
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
|
goto dk_done
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -248,20 +248,20 @@ set -=
|
|||||||
set old=
|
set old=
|
||||||
|
|
||||||
for /f "delims=[] tokens=2" %%# in ('ping -4 -n 1 updatecheck.mass%-%grave.dev') do (
|
for /f "delims=[] tokens=2" %%# in ('ping -4 -n 1 updatecheck.mass%-%grave.dev') do (
|
||||||
if not [%%#]==[] (echo "%%#" | find "127.69" %nul1% && (echo "%%#" | find "127.69.%masver%" %nul1% || set old=1))
|
if not "%%#"=="" (echo "%%#" | find "127.69" %nul1% && (echo "%%#" | find "127.69.%masver%" %nul1% || set old=1))
|
||||||
)
|
)
|
||||||
|
|
||||||
if defined old (
|
if defined old (
|
||||||
echo ________________________________________________
|
echo ________________________________________________
|
||||||
%eline%
|
%eline%
|
||||||
echo Version %masver% of MAS is outdated.
|
echo Your version of MAS [%masver%] is outdated.
|
||||||
echo ________________________________________________
|
echo ________________________________________________
|
||||||
echo:
|
echo:
|
||||||
if not %_unattended%==1 (
|
if not %_unattended%==1 (
|
||||||
echo [1] Get Latest MAS
|
echo [1] Get Latest MAS
|
||||||
echo [0] Continue Anyway
|
echo [0] Continue Anyway
|
||||||
echo:
|
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
|
choice /C:10 /N
|
||||||
if !errorlevel!==2 rem
|
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 ht%-%tps://github.com/mass%-%gravel/Microsoft-Acti%-%vation-Scripts & start %mas% & exit /b)
|
||||||
@@ -280,7 +280,7 @@ if not defined desktop for /f "delims=" %%a in ('%psc% "& {write-host $([Environ
|
|||||||
|
|
||||||
if not defined desktop (
|
if not defined desktop (
|
||||||
%eline%
|
%eline%
|
||||||
echo Desktop location was not detected, aborting...
|
echo Unable to detect Desktop location, aborting...
|
||||||
goto dk_done
|
goto dk_done
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -302,7 +302,7 @@ dism.exe
|
|||||||
) do (
|
) do (
|
||||||
if not exist %SysPath%\%%# (
|
if not exist %SysPath%\%%# (
|
||||||
%eline%
|
%eline%
|
||||||
echo [%SysPath%\%%#] file is missing. Aborting...
|
echo [%SysPath%\%%#] file is missing, aborting...
|
||||||
echo:
|
echo:
|
||||||
set fixes=%fixes% %mas%troubleshoot
|
set fixes=%fixes% %mas%troubleshoot
|
||||||
call :dk_color2 %Blue% "Help - " %_Yellow% " %mas%troubleshoot"
|
call :dk_color2 %Blue% "Help - " %_Yellow% " %mas%troubleshoot"
|
||||||
@@ -335,7 +335,7 @@ if defined UBR (set "fullbuild=%%G.!UBR!") else (set "fullbuild=%%G.%%H")
|
|||||||
call :dk_actid 55c92734-d682-4d71-983e-d6ec3f16059f
|
call :dk_actid 55c92734-d682-4d71-983e-d6ec3f16059f
|
||||||
if not defined apps (
|
if not defined apps (
|
||||||
%eline%
|
%eline%
|
||||||
echo Either key is not insalled or failed to get installed key activation ID. Aborting...
|
echo Either key is not insalled or script failed to get installed key's activation ID. Aborting...
|
||||||
echo:
|
echo:
|
||||||
set fixes=%fixes% %mas%troubleshoot
|
set fixes=%fixes% %mas%troubleshoot
|
||||||
call :dk_color2 %Blue% "Help - " %_Yellow% " %mas%troubleshoot"
|
call :dk_color2 %Blue% "Help - " %_Yellow% " %mas%troubleshoot"
|
||||||
@@ -356,7 +356,7 @@ if %_wmic% EQU 0 set "chkedi=for /f "tokens=2 delims==" %%a in ('%psc% "(([WMISE
|
|||||||
|
|
||||||
if %osedition%==0 (
|
if %osedition%==0 (
|
||||||
%eline%
|
%eline%
|
||||||
echo Failed to detect OS Edition. Aborting...
|
echo Failed to detect OS edition, aborting...
|
||||||
echo:
|
echo:
|
||||||
set fixes=%fixes% %mas%troubleshoot
|
set fixes=%fixes% %mas%troubleshoot
|
||||||
call :dk_color2 %Blue% "Help - " %_Yellow% " %mas%troubleshoot"
|
call :dk_color2 %Blue% "Help - " %_Yellow% " %mas%troubleshoot"
|
||||||
@@ -376,7 +376,7 @@ for /f "skip=2 tokens=2*" %%a in ('reg query "HKLM\SOFTWARE\Microsoft\Windows NT
|
|||||||
|
|
||||||
::========================================================================================================================================
|
::========================================================================================================================================
|
||||||
|
|
||||||
:: Get Target editions list
|
:: Get target editions list
|
||||||
|
|
||||||
set _target=
|
set _target=
|
||||||
set _dtarget=
|
set _dtarget=
|
||||||
@@ -403,9 +403,9 @@ call :dk_color %Red% "==== Note ===="
|
|||||||
echo:
|
echo:
|
||||||
echo [EditionID:%osedition% ^| %fullbuild%]
|
echo [EditionID:%osedition% ^| %fullbuild%]
|
||||||
echo:
|
echo:
|
||||||
echo Changing this edition to any other may not remove "%osedition%" specific features.
|
echo Changing this edition may not remove "%osedition%"-specific features.
|
||||||
echo:
|
echo:
|
||||||
call :dk_color %_Yellow% "Press 7 key to continue..."
|
call :dk_color %_Yellow% "Press [7] to continue anyway..."
|
||||||
choice /c 7 /n
|
choice /c 7 /n
|
||||||
cls
|
cls
|
||||||
)
|
)
|
||||||
@@ -424,7 +424,7 @@ if not defined _ntarget (
|
|||||||
%line%
|
%line%
|
||||||
echo:
|
echo:
|
||||||
if defined dismnotworking call :dk_color %Red% "DISM.exe is not working."
|
if defined dismnotworking call :dk_color %Red% "DISM.exe is not working."
|
||||||
call :dk_color %Gray% "Target Edition not found."
|
call :dk_color %Gray% "Target editions not found."
|
||||||
echo Current Edition [%osedition% ^| %winbuild%] can not be changed to any other Edition.
|
echo Current Edition [%osedition% ^| %winbuild%] can not be changed to any other Edition.
|
||||||
%line%
|
%line%
|
||||||
goto dk_done
|
goto dk_done
|
||||||
@@ -443,7 +443,7 @@ set targetedition=
|
|||||||
|
|
||||||
%line%
|
%line%
|
||||||
echo:
|
echo:
|
||||||
call :dk_color %Gray% "You can change the Edition [%osedition%] [%fullbuild%] to one of the following."
|
call :dk_color %Gray% "You can change the edition [%osedition%] [%fullbuild%] to one of the following."
|
||||||
%showeditionerror%
|
%showeditionerror%
|
||||||
if defined dismnotworking (
|
if defined dismnotworking (
|
||||||
call :dk_color %_Yellow% "Note - DISM.exe is not working."
|
call :dk_color %_Yellow% "Note - DISM.exe is not working."
|
||||||
@@ -462,7 +462,7 @@ set targetedition!counter!=%%A
|
|||||||
echo:
|
echo:
|
||||||
echo [0] %_exitmsg%
|
echo [0] %_exitmsg%
|
||||||
echo:
|
echo:
|
||||||
call :dk_color %_Green% "Enter option number in keyboard, and press "Enter":"
|
call :dk_color %_Green% "Enter an option number using your keyboard and press Enter to confirm:"
|
||||||
set /p inpt=
|
set /p inpt=
|
||||||
if "%inpt%"=="" goto cedmenu2
|
if "%inpt%"=="" goto cedmenu2
|
||||||
if "%inpt%"=="0" exit /b
|
if "%inpt%"=="0" exit /b
|
||||||
@@ -483,12 +483,12 @@ echo:
|
|||||||
call :dk_color %Red% "==== Note ===="
|
call :dk_color %Red% "==== Note ===="
|
||||||
echo:
|
echo:
|
||||||
echo Once the edition is changed to "%targetedition%",
|
echo Once the edition is changed to "%targetedition%",
|
||||||
echo system may not be able to properly change edition to any other later.
|
echo the system may not be able to properly change edition later.
|
||||||
echo:
|
echo:
|
||||||
echo [1] Continue
|
echo [1] Continue Anyway
|
||||||
echo [0] Go Back
|
echo [0] Go Back
|
||||||
echo:
|
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
|
choice /C:10 /N
|
||||||
if !errorlevel!==2 goto cedmenu2
|
if !errorlevel!==2 goto cedmenu2
|
||||||
if !errorlevel!==1 rem
|
if !errorlevel!==1 rem
|
||||||
@@ -499,7 +499,7 @@ set key=
|
|||||||
set _chan=
|
set _chan=
|
||||||
set _dismapi=0
|
set _dismapi=0
|
||||||
|
|
||||||
:: Check if DISM Api or slmgr.vbs is required for edition upgrade
|
:: Check if DISM API or slmgr.vbs is required for edition upgrade
|
||||||
|
|
||||||
if not exist "%SysPath%\spp\tokens\skus\%targetedition%\" (
|
if not exist "%SysPath%\spp\tokens\skus\%targetedition%\" (
|
||||||
echo %_wtarget% | find /i " %targetedition% " || (
|
echo %_wtarget% | find /i " %targetedition% " || (
|
||||||
@@ -521,7 +521,7 @@ set _chan=Retail
|
|||||||
if not defined key (
|
if not defined key (
|
||||||
%eline%
|
%eline%
|
||||||
echo [%targetedition% ^| %winbuild%]
|
echo [%targetedition% ^| %winbuild%]
|
||||||
echo Unable to get product key from pkeyhelper.dll
|
echo Failed to get product key from pkeyhelper.dll.
|
||||||
echo:
|
echo:
|
||||||
set fixes=%fixes% %mas%troubleshoot
|
set fixes=%fixes% %mas%troubleshoot
|
||||||
call :dk_color2 %Blue% "Help - " %_Yellow% " %mas%troubleshoot"
|
call :dk_color2 %Blue% "Help - " %_Yellow% " %mas%troubleshoot"
|
||||||
@@ -544,13 +544,13 @@ cls
|
|||||||
echo:
|
echo:
|
||||||
%showeditionerror%
|
%showeditionerror%
|
||||||
if defined dismnotworking call :dk_color %_Yellow% "DISM.exe is not working."
|
if defined dismnotworking call :dk_color %_Yellow% "DISM.exe is not working."
|
||||||
echo Changing the Current Edition [%osedition%] %fullbuild% to [%targetedition%]
|
echo Changing the current edition [%osedition%] %fullbuild% to [%targetedition%]...
|
||||||
echo:
|
echo:
|
||||||
|
|
||||||
if %_dismapi%==1 (
|
if %_dismapi%==1 (
|
||||||
call :dk_color %Green% "Notes-"
|
call :dk_color %Green% "Notes -"
|
||||||
echo:
|
echo:
|
||||||
echo - Save your work before continue, system will auto restart.
|
echo - Save your work before continuing, the system will auto-restart.
|
||||||
echo:
|
echo:
|
||||||
echo - You will need to activate with HWID option once the edition is changed.
|
echo - You will need to activate with HWID option once the edition is changed.
|
||||||
%line%
|
%line%
|
||||||
@@ -562,7 +562,7 @@ if !errorlevel!==1 exit /b
|
|||||||
::========================================================================================================================================
|
::========================================================================================================================================
|
||||||
|
|
||||||
if %_dismapi%==0 (
|
if %_dismapi%==0 (
|
||||||
echo Installing %_chan% Key [%key%]
|
echo Installing %_chan% key [%key%]
|
||||||
echo:
|
echo:
|
||||||
if %_wmic% EQU 1 wmic path %sps% where __CLASS='%sps%' call InstallProductKey ProductKey="%key%" %nul%
|
if %_wmic% EQU 1 wmic path %sps% where __CLASS='%sps%' call InstallProductKey ProductKey="%key%" %nul%
|
||||||
if %_wmic% EQU 0 %psc% "try { $null=(([WMISEARCHER]'SELECT Version FROM %sps%').Get()).InstallProductKey('%key%'); exit 0 } catch { exit $_.Exception.InnerException.HResult }" %nul%
|
if %_wmic% EQU 0 %psc% "try { $null=(([WMISEARCHER]'SELECT Version FROM %sps%').Get()).InstallProductKey('%key%'); exit 0 } catch { exit $_.Exception.InnerException.HResult }" %nul%
|
||||||
@@ -574,7 +574,7 @@ if !keyerror! EQU 0 (
|
|||||||
call :dk_refresh
|
call :dk_refresh
|
||||||
call :dk_color %Green% "[Successful]"
|
call :dk_color %Green% "[Successful]"
|
||||||
echo:
|
echo:
|
||||||
call :dk_color %Gray% "Reboot is required to properly change the Edition."
|
call :dk_color %Gray% "Reboot is required to fully change the edition."
|
||||||
) else (
|
) else (
|
||||||
call :dk_color %Red% "[Unsuccessful] [Error Code: !keyerror!]"
|
call :dk_color %Red% "[Unsuccessful] [Error Code: !keyerror!]"
|
||||||
echo:
|
echo:
|
||||||
@@ -585,7 +585,7 @@ call :dk_color2 %Blue% "Help - " %_Yellow% " %mas%troubleshoot"
|
|||||||
|
|
||||||
if %_dismapi%==1 (
|
if %_dismapi%==1 (
|
||||||
echo:
|
echo:
|
||||||
echo Applying the DISM API method with %_chan% Key %key%. Please wait...
|
echo Applying the DISM API method with %_chan% key %key%. Please wait...
|
||||||
echo:
|
echo:
|
||||||
|
|
||||||
call :ced_prep
|
call :ced_prep
|
||||||
@@ -614,9 +614,9 @@ if defined rebootreq goto dk_done
|
|||||||
echo:
|
echo:
|
||||||
%showeditionerror%
|
%showeditionerror%
|
||||||
if defined dismnotworking call :dk_color %_Yellow% "Note - DISM.exe is not working."
|
if defined dismnotworking call :dk_color %_Yellow% "Note - DISM.exe is not working."
|
||||||
echo Changing the Current Edition [%osedition%] %fullbuild% to [%targetedition%]
|
echo Changing the current edition [%osedition%] %fullbuild% to [%targetedition%]...
|
||||||
echo:
|
echo:
|
||||||
call :dk_color %Blue% "Important - Save your work before continue, system will auto reboot."
|
call :dk_color %Blue% "Important - Save your work before continuing, the system will auto-restart."
|
||||||
echo:
|
echo:
|
||||||
choice /C:01 /N /M "[1] Continue [0] %_exitmsg% : "
|
choice /C:01 /N /M "[1] Continue [0] %_exitmsg% : "
|
||||||
if %errorlevel%==1 exit /b
|
if %errorlevel%==1 exit /b
|
||||||
@@ -657,7 +657,7 @@ if not defined key call :changeeditiondata
|
|||||||
if not defined key (
|
if not defined key (
|
||||||
%eline%
|
%eline%
|
||||||
echo [%targetedition% ^| %winbuild%]
|
echo [%targetedition% ^| %winbuild%]
|
||||||
echo Unable to get product key from pkeyhelper.dll
|
echo Failed to get product key from pkeyhelper.dll.
|
||||||
echo:
|
echo:
|
||||||
set fixes=%fixes% %mas%troubleshoot
|
set fixes=%fixes% %mas%troubleshoot
|
||||||
call :dk_color2 %Blue% "Help - " %_Yellow% " %mas%troubleshoot"
|
call :dk_color2 %Blue% "Help - " %_Yellow% " %mas%troubleshoot"
|
||||||
@@ -671,13 +671,13 @@ cls
|
|||||||
echo:
|
echo:
|
||||||
%showeditionerror%
|
%showeditionerror%
|
||||||
if defined dismnotworking call :dk_color %_Yellow% "Note - DISM.exe is not working."
|
if defined dismnotworking call :dk_color %_Yellow% "Note - DISM.exe is not working."
|
||||||
echo Changing the Current Edition [%osedition%] %fullbuild% to [%targetedition%]
|
echo Changing the current edition [%osedition%] %fullbuild% to [%targetedition%]...
|
||||||
echo:
|
echo:
|
||||||
|
|
||||||
call :ced_prep
|
call :ced_prep
|
||||||
if defined preperror goto dk_done
|
if defined preperror goto dk_done
|
||||||
|
|
||||||
echo Applying the command with %_chan% Key
|
echo Applying the command with %_chan% key...
|
||||||
echo DISM /online /Set-Edition:%targetedition% /ProductKey:%key% /AcceptEula
|
echo DISM /online /Set-Edition:%targetedition% /ProductKey:%key% /AcceptEula
|
||||||
DISM /online /Set-Edition:%targetedition% /ProductKey:%key% /AcceptEula
|
DISM /online /Set-Edition:%targetedition% /ProductKey:%key% /AcceptEula
|
||||||
|
|
||||||
@@ -699,8 +699,8 @@ for /f %%a in ('%psc% "(Get-Date).ToString('yyyyMMdd-HHmmssfff')"') do set _time
|
|||||||
|
|
||||||
sc query TrustedInstaller | find /i "RUNNING" %nul% && (
|
sc query TrustedInstaller | find /i "RUNNING" %nul% && (
|
||||||
%eline%
|
%eline%
|
||||||
echo Failed to stop TrustedInstaller service.
|
echo Failed to stop the TrustedInstaller service.
|
||||||
echo Try again or Restart your system and then try again.
|
echo Reboot your machine using the restart option and try again.
|
||||||
set preperror=1
|
set preperror=1
|
||||||
exit /b
|
exit /b
|
||||||
)
|
)
|
||||||
@@ -731,9 +731,9 @@ call :compresslog DISM\dism_%_time%.log ChangeEdition_Logs\DISM %nul%
|
|||||||
|
|
||||||
echo:
|
echo:
|
||||||
if %winbuild% GEQ 9200 %psc% "if ((Get-WindowsOptionalFeature -Online -FeatureName NetFx3).State -eq 'Enabled') {Write-Host 'Checking .NET Framework 3.5 Status - Enabled'}"
|
if %winbuild% GEQ 9200 %psc% "if ((Get-WindowsOptionalFeature -Online -FeatureName NetFx3).State -eq 'Enabled') {Write-Host 'Checking .NET Framework 3.5 Status - Enabled'}"
|
||||||
echo Log files are copied to the ChangeEdition_Logs folder on the desktop.
|
echo Log files are copied to the ChangeEdition_Logs folder on your desktop.
|
||||||
echo:
|
echo:
|
||||||
call :dk_color %Blue% "In case of errors, restart system before trying again."
|
call :dk_color %Blue% "In case there are errors, you should restart the system before trying again."
|
||||||
echo:
|
echo:
|
||||||
set fixes=%fixes% %mas%change_edition_issues
|
set fixes=%fixes% %mas%change_edition_issues
|
||||||
call :dk_color2 %Blue% "Help - " %_Yellow% " %mas%change_edition_issues"
|
call :dk_color2 %Blue% "Help - " %_Yellow% " %mas%change_edition_issues"
|
||||||
@@ -850,7 +850,7 @@ exit /b
|
|||||||
|
|
||||||
set _wmic=0
|
set _wmic=0
|
||||||
for %%# in (wmic.exe) do @if not "%%~$PATH:#"=="" (
|
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
|
exit /b
|
||||||
|
|
||||||
@@ -891,7 +891,7 @@ reg query "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\WindowsUpdate\Auto Upd
|
|||||||
|
|
||||||
if defined rebootreq (
|
if defined rebootreq (
|
||||||
%eline%
|
%eline%
|
||||||
echo Pending Reboot flags found.
|
echo Pending reboot flags found.
|
||||||
echo:
|
echo:
|
||||||
echo Make sure Windows is fully updated, restart the system and try again.
|
echo Make sure Windows is fully updated, restart the system and try again.
|
||||||
)
|
)
|
||||||
@@ -935,7 +935,7 @@ for %%# in (pkeyhelper.dll) do @if "%%~$PATH:#"=="" exit /b
|
|||||||
for %%# in (%keyflow%) do (
|
for %%# in (%keyflow%) do (
|
||||||
call :k_pkey %targetSKU% '%%#'
|
call :k_pkey %targetSKU% '%%#'
|
||||||
if defined pkey call :k_pkeychannel !pkey!
|
if defined pkey call :k_pkeychannel !pkey!
|
||||||
if /i [!pkeychannel!]==[%%#] (
|
if /i "!pkeychannel!"=="%%#" (
|
||||||
set key=!pkey!
|
set key=!pkey!
|
||||||
exit /b
|
exit /b
|
||||||
)
|
)
|
||||||
@@ -987,13 +987,13 @@ echo:
|
|||||||
if %_unattended%==1 timeout /t 2 & exit /b
|
if %_unattended%==1 timeout /t 2 & exit /b
|
||||||
|
|
||||||
if defined fixes (
|
if defined fixes (
|
||||||
call :dk_color2 %Blue% "Press [1] To Open Troubleshoot Page " %Gray% " Press [0] To Ignore"
|
call :dk_color2 %Blue% "Press [1] to Open Troubleshoot Page " %Gray% " Press [0] to Ignore"
|
||||||
choice /C:10 /N
|
choice /C:10 /N
|
||||||
if !errorlevel!==1 (for %%# in (%fixes%) do (start %%#))
|
if !errorlevel!==1 (for %%# in (%fixes%) do (start %%#))
|
||||||
)
|
)
|
||||||
|
|
||||||
if defined terminal (
|
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
|
choice /c 0 /n
|
||||||
) else (
|
) else (
|
||||||
call :dk_color %_Yellow% "Press any key to %_exitmsg%..."
|
call :dk_color %_Yellow% "Press any key to %_exitmsg%..."
|
||||||
@@ -1004,7 +1004,7 @@ exit /b
|
|||||||
|
|
||||||
::========================================================================================================================================
|
::========================================================================================================================================
|
||||||
|
|
||||||
:: https://github.com/Gamers-Against-Weed/Set-WindowsCbsEdition
|
:: https://github.com/asdcorp/Set-WindowsCbsEdition
|
||||||
|
|
||||||
:cbsxml:[
|
:cbsxml:[
|
||||||
param (
|
param (
|
||||||
@@ -6,10 +6,23 @@
|
|||||||
:: https://gravesoft.dev/cas
|
:: 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\"
|
set "Path=%SystemRoot%\System32;%SystemRoot%;%SystemRoot%\System32\Wbem;%SystemRoot%\System32\WindowsPowerShell\v1.0\"
|
||||||
if exist "%SystemRoot%\Sysnative\reg.exe" (
|
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 "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 "_psc=powershell -nop -c"
|
||||||
set "_err===== ERROR ===="
|
set "_err===== ERROR ===="
|
||||||
set _pwsh=1
|
set _pwsh=1
|
||||||
@@ -29,8 +42,8 @@ setlocal EnableDelayedExpansion
|
|||||||
|
|
||||||
:E_Exit
|
:E_Exit
|
||||||
echo.
|
echo.
|
||||||
echo Press any key to exit.
|
echo Press 0 key to exit.
|
||||||
pause >nul
|
choice /c 0 /n
|
||||||
exit /b
|
exit /b
|
||||||
|
|
||||||
:sppmgr:
|
:sppmgr:
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
@set masver=2.6
|
@set masver=2.7
|
||||||
@echo off
|
@echo off
|
||||||
|
|
||||||
|
|
||||||
@@ -14,7 +14,7 @@
|
|||||||
|
|
||||||
::========================================================================================================================================
|
::========================================================================================================================================
|
||||||
|
|
||||||
:: 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 EnableExtensions
|
||||||
setlocal DisableDelayedExpansion
|
setlocal DisableDelayedExpansion
|
||||||
@@ -121,13 +121,13 @@ call :dk_setvar
|
|||||||
if %winbuild% LSS 7600 (
|
if %winbuild% LSS 7600 (
|
||||||
%nceline%
|
%nceline%
|
||||||
echo Unsupported OS version detected [%winbuild%].
|
echo Unsupported OS version detected [%winbuild%].
|
||||||
echo Project is supported only for Windows 7/8/8.1/10/11 and their Server equivalent.
|
echo Project is supported only for Windows 7/8/8.1/10/11 and their Server equivalents.
|
||||||
goto done2
|
goto done2
|
||||||
)
|
)
|
||||||
|
|
||||||
::========================================================================================================================================
|
::========================================================================================================================================
|
||||||
|
|
||||||
:: Fix special characters limitation in path name
|
:: Fix special character limitations in path name
|
||||||
|
|
||||||
set "_work=%~dp0"
|
set "_work=%~dp0"
|
||||||
if "%_work:~-1%"=="\" set "_work=%_work:~0,-1%"
|
if "%_work:~-1%"=="\" set "_work=%_work:~0,-1%"
|
||||||
@@ -147,8 +147,8 @@ setlocal EnableDelayedExpansion
|
|||||||
echo "!_batf!" | find /i "!_ttemp!" %nul1% && (
|
echo "!_batf!" | find /i "!_ttemp!" %nul1% && (
|
||||||
if /i not "!_work!"=="!_ttemp!" (
|
if /i not "!_work!"=="!_ttemp!" (
|
||||||
%eline%
|
%eline%
|
||||||
echo Script is launched from the temp folder,
|
echo The script was launched from the temp folder.
|
||||||
echo Most likely you are running the script directly from the archive file.
|
echo You are most likely running the script directly from the archive file.
|
||||||
echo:
|
echo:
|
||||||
echo Extract the archive file and launch the script from the extracted folder.
|
echo Extract the archive file and launch the script from the extracted folder.
|
||||||
goto done2
|
goto done2
|
||||||
@@ -189,7 +189,7 @@ goto done2
|
|||||||
if not defined _elev %psc% "start cmd.exe -arg '/c \"!_PSarg!\"' -verb runas" && exit /b
|
if not defined _elev %psc% "start cmd.exe -arg '/c \"!_PSarg!\"' -verb runas" && exit /b
|
||||||
%eline%
|
%eline%
|
||||||
echo This script needs admin rights.
|
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 done2
|
goto done2
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -242,20 +242,20 @@ set -=
|
|||||||
set old=
|
set old=
|
||||||
|
|
||||||
for /f "delims=[] tokens=2" %%# in ('ping -4 -n 1 updatecheck.mass%-%grave.dev') do (
|
for /f "delims=[] tokens=2" %%# in ('ping -4 -n 1 updatecheck.mass%-%grave.dev') do (
|
||||||
if not [%%#]==[] (echo "%%#" | find "127.69" %nul1% && (echo "%%#" | find "127.69.%masver%" %nul1% || set old=1))
|
if not "%%#"=="" (echo "%%#" | find "127.69" %nul1% && (echo "%%#" | find "127.69.%masver%" %nul1% || set old=1))
|
||||||
)
|
)
|
||||||
|
|
||||||
if defined old (
|
if defined old (
|
||||||
echo ________________________________________________
|
echo ________________________________________________
|
||||||
%eline%
|
%eline%
|
||||||
echo Version %masver% of MAS is outdated.
|
echo Your version of MAS [%masver%] is outdated.
|
||||||
echo ________________________________________________
|
echo ________________________________________________
|
||||||
echo:
|
echo:
|
||||||
if not %_unattended%==1 (
|
if not %_unattended%==1 (
|
||||||
echo [1] Get Latest MAS
|
echo [1] Get Latest MAS
|
||||||
echo [0] Continue Anyway
|
echo [0] Continue Anyway
|
||||||
echo:
|
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
|
choice /C:10 /N
|
||||||
if !errorlevel!==2 rem
|
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 ht%-%tps://github.com/mass%-%gravel/Microsoft-Acti%-%vation-Scripts & start %mas% & exit /b)
|
||||||
@@ -277,7 +277,7 @@ set "_dir=%desktop%\$OEM$\$$\Setup\Scripts"
|
|||||||
|
|
||||||
if exist "!desktop!\" (
|
if exist "!desktop!\" (
|
||||||
%eline%
|
%eline%
|
||||||
echo Desktop location was not detected, aborting...
|
echo Unable to detect Desktop location, aborting...
|
||||||
goto done2
|
goto done2
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -290,7 +290,7 @@ if not defined terminal mode 78, 30
|
|||||||
if exist "!desktop!\$OEM$\" (
|
if exist "!desktop!\$OEM$\" (
|
||||||
echo _____________________________________________________
|
echo _____________________________________________________
|
||||||
%eline%
|
%eline%
|
||||||
echo $OEM$ folder already exists on the Desktop.
|
echo The $OEM$ folder already exists on your Desktop.
|
||||||
echo _____________________________________________________
|
echo _____________________________________________________
|
||||||
goto done2
|
goto done2
|
||||||
)
|
)
|
||||||
@@ -349,7 +349,7 @@ call :dk_color2 %_White% " [R] " %_Green% "ReadMe"
|
|||||||
echo: [0] Exit
|
echo: [0] Exit
|
||||||
echo: ________________________________________________________
|
echo: ________________________________________________________
|
||||||
echo:
|
echo:
|
||||||
call :dk_color2 %_White% " " %_Green% "Enter a menu option in the Keyboard :"
|
call :dk_color2 %_White% " " %_Green% "Choose a menu option using your keyboard :"
|
||||||
choice /C:123456789R0 /N
|
choice /C:123456789R0 /N
|
||||||
set _erl=%errorlevel%
|
set _erl=%errorlevel%
|
||||||
|
|
||||||
@@ -681,7 +681,7 @@ cd \
|
|||||||
:errorfound
|
:errorfound
|
||||||
|
|
||||||
%eline%
|
%eline%
|
||||||
echo $OEM$ Folder was not created successfully...
|
echo The script failed to create the $OEM$ folder.
|
||||||
goto :done2
|
goto :done2
|
||||||
|
|
||||||
:done
|
:done
|
||||||
@@ -689,7 +689,7 @@ goto :done2
|
|||||||
echo ______________________________________________________________
|
echo ______________________________________________________________
|
||||||
echo:
|
echo:
|
||||||
call :dk_color %Blue% "%oem%"
|
call :dk_color %Blue% "%oem%"
|
||||||
call :dk_color %Green% "$OEM$ folder is successfully created on the Desktop."
|
call :dk_color %Green% "$OEM$ folder was successfully created on your Desktop."
|
||||||
echo "%oem%" | find /i "38" %nul% && (
|
echo "%oem%" | find /i "38" %nul% && (
|
||||||
echo:
|
echo:
|
||||||
echo To KMS38 activate Server Cor/Acor editions ^(No GUI Versions^),
|
echo To KMS38 activate Server Cor/Acor editions ^(No GUI Versions^),
|
||||||
@@ -701,13 +701,13 @@ echo ______________________________________________________________
|
|||||||
|
|
||||||
echo:
|
echo:
|
||||||
if defined fixes (
|
if defined fixes (
|
||||||
call :dk_color2 %Blue% "Press [1] To Open Troubleshoot Page " %Gray% " Press [0] To Ignore"
|
call :dk_color2 %Blue% "Press [1] to Open Troubleshoot Page " %Gray% " Press [0] to Ignore"
|
||||||
choice /C:10 /N
|
choice /C:10 /N
|
||||||
if !errorlevel!==1 (for %%# in (%fixes%) do (start %%#))
|
if !errorlevel!==1 (for %%# in (%fixes%) do (start %%#))
|
||||||
)
|
)
|
||||||
|
|
||||||
if defined terminal (
|
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
|
choice /c 0 /n
|
||||||
) else (
|
) else (
|
||||||
call :dk_color %_Yellow% "Press any key to %_exitmsg%..."
|
call :dk_color %_Yellow% "Press any key to %_exitmsg%..."
|
||||||
@@ -777,7 +777,7 @@ exit /b
|
|||||||
if %_NCS% EQU 1 (
|
if %_NCS% EQU 1 (
|
||||||
echo %esc%[%~1%~2%esc%[0m
|
echo %esc%[%~1%~2%esc%[0m
|
||||||
) else (
|
) 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
|
exit /b
|
||||||
|
|
||||||
@@ -786,7 +786,7 @@ exit /b
|
|||||||
if %_NCS% EQU 1 (
|
if %_NCS% EQU 1 (
|
||||||
echo %esc%[%~1%~2%esc%[%~3%~4%esc%[0m
|
echo %esc%[%~1%~2%esc%[%~3%~4%esc%[0m
|
||||||
) else (
|
) 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
|
exit /b
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
@set masver=2.6
|
@set masver=2.7
|
||||||
@echo off
|
@echo off
|
||||||
|
|
||||||
|
|
||||||
@@ -14,7 +14,7 @@
|
|||||||
|
|
||||||
::========================================================================================================================================
|
::========================================================================================================================================
|
||||||
|
|
||||||
:: 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 EnableExtensions
|
||||||
setlocal DisableDelayedExpansion
|
setlocal DisableDelayedExpansion
|
||||||
@@ -122,13 +122,13 @@ set "line=______________________________________________________________________
|
|||||||
if %winbuild% LSS 7600 (
|
if %winbuild% LSS 7600 (
|
||||||
%nceline%
|
%nceline%
|
||||||
echo Unsupported OS version detected [%winbuild%].
|
echo Unsupported OS version detected [%winbuild%].
|
||||||
echo Project is supported only for Windows 7/8/8.1/10/11 and their Server equivalent.
|
echo Project is supported only for Windows 7/8/8.1/10/11 and their Server equivalents.
|
||||||
goto dk_done
|
goto dk_done
|
||||||
)
|
)
|
||||||
|
|
||||||
::========================================================================================================================================
|
::========================================================================================================================================
|
||||||
|
|
||||||
:: Fix special characters limitation in path name
|
:: Fix special character limitations in path name
|
||||||
|
|
||||||
set "_work=%~dp0"
|
set "_work=%~dp0"
|
||||||
if "%_work:~-1%"=="\" set "_work=%_work:~0,-1%"
|
if "%_work:~-1%"=="\" set "_work=%_work:~0,-1%"
|
||||||
@@ -148,8 +148,8 @@ setlocal EnableDelayedExpansion
|
|||||||
echo "!_batf!" | find /i "!_ttemp!" %nul1% && (
|
echo "!_batf!" | find /i "!_ttemp!" %nul1% && (
|
||||||
if /i not "!_work!"=="!_ttemp!" (
|
if /i not "!_work!"=="!_ttemp!" (
|
||||||
%eline%
|
%eline%
|
||||||
echo Script is launched from the temp folder,
|
echo The script was launched from the temp folder.
|
||||||
echo Most likely you are running the script directly from the archive file.
|
echo You are most likely running the script directly from the archive file.
|
||||||
echo:
|
echo:
|
||||||
echo Extract the archive file and launch the script from the extracted folder.
|
echo Extract the archive file and launch the script from the extracted folder.
|
||||||
goto dk_done
|
goto dk_done
|
||||||
@@ -190,7 +190,7 @@ goto dk_done
|
|||||||
if not defined _elev %psc% "start cmd.exe -arg '/c \"!_PSarg!\"' -verb runas" && exit /b
|
if not defined _elev %psc% "start cmd.exe -arg '/c \"!_PSarg!\"' -verb runas" && exit /b
|
||||||
%eline%
|
%eline%
|
||||||
echo This script needs admin rights.
|
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
|
goto dk_done
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -243,20 +243,20 @@ set -=
|
|||||||
set old=
|
set old=
|
||||||
|
|
||||||
for /f "delims=[] tokens=2" %%# in ('ping -4 -n 1 updatecheck.mass%-%grave.dev') do (
|
for /f "delims=[] tokens=2" %%# in ('ping -4 -n 1 updatecheck.mass%-%grave.dev') do (
|
||||||
if not [%%#]==[] (echo "%%#" | find "127.69" %nul1% && (echo "%%#" | find "127.69.%masver%" %nul1% || set old=1))
|
if not "%%#"=="" (echo "%%#" | find "127.69" %nul1% && (echo "%%#" | find "127.69.%masver%" %nul1% || set old=1))
|
||||||
)
|
)
|
||||||
|
|
||||||
if defined old (
|
if defined old (
|
||||||
echo ________________________________________________
|
echo ________________________________________________
|
||||||
%eline%
|
%eline%
|
||||||
echo Version %masver% of MAS is outdated.
|
echo Your version of MAS [%masver%] is outdated.
|
||||||
echo ________________________________________________
|
echo ________________________________________________
|
||||||
echo:
|
echo:
|
||||||
if not %_unattended%==1 (
|
if not %_unattended%==1 (
|
||||||
echo [1] Get Latest MAS
|
echo [1] Get Latest MAS
|
||||||
echo [0] Continue Anyway
|
echo [0] Continue Anyway
|
||||||
echo:
|
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
|
choice /C:10 /N
|
||||||
if !errorlevel!==2 rem
|
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 ht%-%tps://github.com/mass%-%gravel/Microsoft-Acti%-%vation-Scripts & start %mas% & exit /b)
|
||||||
@@ -275,7 +275,7 @@ if not defined desktop for /f "delims=" %%a in ('%psc% "& {write-host $([Environ
|
|||||||
|
|
||||||
if not defined desktop (
|
if not defined desktop (
|
||||||
%eline%
|
%eline%
|
||||||
echo Desktop location was not detected, aborting...
|
echo Unable to detect Desktop location, aborting...
|
||||||
goto dk_done
|
goto dk_done
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -310,7 +310,7 @@ echo:
|
|||||||
echo: [0] %_exitmsg%
|
echo: [0] %_exitmsg%
|
||||||
echo: _______________________________________________________________
|
echo: _______________________________________________________________
|
||||||
echo:
|
echo:
|
||||||
call :dk_color2 %_White% " " %_Green% "Enter a menu option in the Keyboard :"
|
call :dk_color2 %_White% " " %_Green% "Choose a menu option using your keyboard :"
|
||||||
choice /C:1234560 /N
|
choice /C:1234560 /N
|
||||||
set _erl=%errorlevel%
|
set _erl=%errorlevel%
|
||||||
|
|
||||||
@@ -333,14 +333,14 @@ title Dism /English /Online /Cleanup-Image /RestoreHealth
|
|||||||
|
|
||||||
if %winbuild% LSS 9200 (
|
if %winbuild% LSS 9200 (
|
||||||
%eline%
|
%eline%
|
||||||
echo Unsupported OS version Detected.
|
echo Unsupported OS version detected.
|
||||||
echo This command is supported only for Windows 8/8.1/10/11 and their Server equivalent.
|
echo This command only works on Windows 8/8.1/10/11 and their Server equivalents.
|
||||||
goto :at_back
|
goto :at_back
|
||||||
)
|
)
|
||||||
|
|
||||||
set _int=
|
set _int=
|
||||||
for %%a in (l.root-servers.net resolver1.opendns.com download.windowsupdate.com google.com) do if not defined _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)
|
||||||
)
|
)
|
||||||
|
|
||||||
echo:
|
echo:
|
||||||
@@ -352,14 +352,14 @@ call :dk_color2 %_White% " " %Red% "Checking Internet Connection [Not conne
|
|||||||
|
|
||||||
echo %line%
|
echo %line%
|
||||||
echo:
|
echo:
|
||||||
echo Dism uses Windows Update to provide the files required to fix corruption.
|
echo DISM uses Windows Update to provide replacement files required to fix corruption.
|
||||||
echo This will take 5-15 minutes or more..
|
echo This will take 5-15 minutes or more..
|
||||||
echo %line%
|
echo %line%
|
||||||
echo:
|
echo:
|
||||||
echo Notes:
|
echo Notes:
|
||||||
echo:
|
echo:
|
||||||
call :dk_color2 %_White% " - " %Gray% "Make sure the Internet is connected."
|
call :dk_color2 %_White% " - " %Gray% "Make sure the internet is connected."
|
||||||
call :dk_color2 %_White% " - " %Gray% "Make sure the Windows update is properly working."
|
call :dk_color2 %_White% " - " %Gray% "Make sure that Windows update is properly working."
|
||||||
echo:
|
echo:
|
||||||
echo %line%
|
echo %line%
|
||||||
echo:
|
echo:
|
||||||
@@ -379,7 +379,7 @@ del /f /q "%SystemRoot%\logs\cbs\cbs.log" %nul%
|
|||||||
del /f /q "%SystemRoot%\logs\DISM\dism.log" %nul%
|
del /f /q "%SystemRoot%\logs\DISM\dism.log" %nul%
|
||||||
|
|
||||||
echo:
|
echo:
|
||||||
echo Applying the command,
|
echo Applying the command...
|
||||||
echo dism /english /online /cleanup-image /restorehealth
|
echo dism /english /online /cleanup-image /restorehealth
|
||||||
dism /english /online /cleanup-image /restorehealth
|
dism /english /online /cleanup-image /restorehealth
|
||||||
|
|
||||||
@@ -400,7 +400,7 @@ copy /y /b "%SystemRoot%\logs\DISM\dism.log" "!desktop!\AT_Logs\RHealth_DISM_%_t
|
|||||||
)
|
)
|
||||||
|
|
||||||
echo:
|
echo:
|
||||||
call :dk_color %Gray% "CBS and DISM logs are copied to the AT_Logs folder on the desktop."
|
call :dk_color %Gray% "CBS and DISM logs are copied to the AT_Logs folder on your desktop."
|
||||||
goto :at_back
|
goto :at_back
|
||||||
|
|
||||||
::========================================================================================================================================
|
::========================================================================================================================================
|
||||||
@@ -414,7 +414,8 @@ title sfc /scannow
|
|||||||
echo:
|
echo:
|
||||||
echo %line%
|
echo %line%
|
||||||
echo:
|
echo:
|
||||||
echo System File Checker will repair missing or corrupted system files.
|
echo SFC will repair missing or corrupted system files.
|
||||||
|
echo It is recommended you run the DISM option first before this one.
|
||||||
echo This will take 10-15 minutes or more..
|
echo This will take 10-15 minutes or more..
|
||||||
echo:
|
echo:
|
||||||
echo If SFC could not fix something, then run the command again to see if it may be able
|
echo If SFC could not fix something, then run the command again to see if it may be able
|
||||||
@@ -435,7 +436,7 @@ copy /y /b "%SystemRoot%\logs\cbs\cbs.log" "%SystemRoot%\logs\cbs\backup_cbs_%_t
|
|||||||
del /f /q "%SystemRoot%\logs\cbs\cbs.log" %nul%
|
del /f /q "%SystemRoot%\logs\cbs\cbs.log" %nul%
|
||||||
|
|
||||||
echo:
|
echo:
|
||||||
echo Applying the command,
|
echo Applying the command...
|
||||||
echo sfc /scannow
|
echo sfc /scannow
|
||||||
sfc /scannow
|
sfc /scannow
|
||||||
|
|
||||||
@@ -450,7 +451,7 @@ copy /y /b "%SystemRoot%\logs\cbs\cbs.log" "!desktop!\AT_Logs\SFC_CBS_%_time%.lo
|
|||||||
)
|
)
|
||||||
|
|
||||||
echo:
|
echo:
|
||||||
call :dk_color %Gray% "CBS log is copied to the AT_Logs folder on the desktop."
|
call :dk_color %Gray% "The CBS log was copied to the AT_Logs folder on your Desktop."
|
||||||
goto :at_back
|
goto :at_back
|
||||||
|
|
||||||
::========================================================================================================================================
|
::========================================================================================================================================
|
||||||
@@ -458,26 +459,29 @@ goto :at_back
|
|||||||
:retokens
|
:retokens
|
||||||
|
|
||||||
cls
|
cls
|
||||||
if not defined terminal mode 125, 32
|
if not defined terminal (
|
||||||
|
mode 125, 32
|
||||||
%psc% "&{$W=$Host.UI.RawUI.WindowSize;$B=$Host.UI.RawUI.BufferSize;$W.Height=31;$B.Height=200;$Host.UI.RawUI.WindowSize=$W;$Host.UI.RawUI.BufferSize=$B;}"
|
%psc% "&{$W=$Host.UI.RawUI.WindowSize;$B=$Host.UI.RawUI.BufferSize;$W.Height=31;$B.Height=200;$Host.UI.RawUI.WindowSize=$W;$Host.UI.RawUI.BufferSize=$B;}"
|
||||||
title Fix Licensing ^(ClipSVC ^+ Office vNext ^+ SPP ^+ OSPP^)
|
)
|
||||||
|
title Fix Licensing ^(ClipSVC ^+ SPP ^+ OSPP^)
|
||||||
|
|
||||||
echo:
|
echo:
|
||||||
echo %line%
|
echo %line%
|
||||||
echo:
|
echo:
|
||||||
echo Notes:
|
echo Notes:
|
||||||
echo:
|
echo:
|
||||||
echo - It helps in troubleshooting activation issues.
|
echo - This option helps in troubleshooting activation issues.
|
||||||
echo:
|
echo:
|
||||||
echo - This option will,
|
echo - This option will:
|
||||||
echo - Deactivate Windows and Office, you may need to reactivate
|
echo - Deactivate Windows and Office, you may need to reactivate.
|
||||||
echo If Windows is activated with motherboard / OEM / Digital license then don't worry
|
echo If Windows is activated with motherboard / OEM / Digital license
|
||||||
|
echo then Windows will activate itself again.
|
||||||
echo:
|
echo:
|
||||||
echo - Clear ClipSVC, Office vNext, SPP and OSPP licenses
|
echo - Clear ClipSVC, SPP and OSPP licenses.
|
||||||
echo - Fix SPP permissions of tokens folder and registries
|
echo - Fix permissions of SPP tokens folder and registries.
|
||||||
echo - Trigger the repair option for Office.
|
echo - Trigger the repair option for Office.
|
||||||
echo:
|
echo:
|
||||||
call :dk_color2 %_White% " - " %Red% "Apply it only when it is necessary."
|
call :dk_color2 %_White% " - " %Red% "Apply this option only when it is necessary."
|
||||||
echo:
|
echo:
|
||||||
echo %line%
|
echo %line%
|
||||||
echo:
|
echo:
|
||||||
@@ -494,19 +498,19 @@ cls
|
|||||||
echo:
|
echo:
|
||||||
echo %line%
|
echo %line%
|
||||||
echo:
|
echo:
|
||||||
call :dk_color %Blue% "Rebuilding ClipSVC Licences"
|
call :dk_color %Blue% "Rebuilding ClipSVC Licenses..."
|
||||||
echo:
|
echo:
|
||||||
|
|
||||||
if %winbuild% LSS 10240 (
|
if %winbuild% LSS 10240 (
|
||||||
echo ClipSVC Licence rebuilding is supported only on Win 10/11 and Server equivalent.
|
echo ClipSVC license rebuilding is supported only on Windows 10/11 and their Server equivalents.
|
||||||
echo Skipping...
|
echo Skipping...
|
||||||
goto :cleanvnext
|
goto :rebuildspptok
|
||||||
)
|
)
|
||||||
|
|
||||||
%psc% "(([WMISEARCHER]'SELECT Name FROM SoftwareLicensingProduct WHERE LicenseStatus=1 AND GracePeriodRemaining=0 AND PartialProductKey IS NOT NULL').Get()).Name" %nul2% | findstr /i "Windows" %nul1% && (
|
%psc% "(([WMISEARCHER]'SELECT Name FROM SoftwareLicensingProduct WHERE LicenseStatus=1 AND GracePeriodRemaining=0 AND PartialProductKey IS NOT NULL AND LicenseDependsOn is NULL').Get()).Name" %nul2% | findstr /i "Windows" %nul1% && (
|
||||||
echo Windows is permanently activated.
|
echo Windows is permanently activated.
|
||||||
echo Skipping rebuilding ClipSVC licences...
|
echo Skipping...
|
||||||
goto :cleanvnext
|
goto :rebuildspptok
|
||||||
)
|
)
|
||||||
|
|
||||||
echo Stopping ClipSVC service...
|
echo Stopping ClipSVC service...
|
||||||
@@ -514,7 +518,7 @@ echo Stopping ClipSVC service...
|
|||||||
timeout /t 2 %nul%
|
timeout /t 2 %nul%
|
||||||
|
|
||||||
echo:
|
echo:
|
||||||
echo Applying the command to Clean ClipSVC Licences...
|
echo Applying the command to clean ClipSVC Licenses...
|
||||||
echo rundll32 clipc.dll,ClipCleanUpState
|
echo rundll32 clipc.dll,ClipCleanUpState
|
||||||
|
|
||||||
rundll32 clipc.dll,ClipCleanUpState
|
rundll32 clipc.dll,ClipCleanUpState
|
||||||
@@ -543,15 +547,15 @@ echo Deleting a Volatile ^& Protected Registry Key...
|
|||||||
echo [%RegKey%]
|
echo [%RegKey%]
|
||||||
reg query "%RegKey%" %nul% && (
|
reg query "%RegKey%" %nul% && (
|
||||||
call :dk_color %Red% "[Failed]"
|
call :dk_color %Red% "[Failed]"
|
||||||
echo Restart the system, that will delete this registry key automatically.
|
echo Reboot your machine using the restart option, that will delete this registry key automatically.
|
||||||
) || (
|
) || (
|
||||||
echo [Successful]
|
echo [Successful]
|
||||||
)
|
)
|
||||||
|
|
||||||
:: Clear HWID token related registry to fix activation incase if there is any corruption
|
:: Clear HWID token related registry to fix activation incase there is any corruption
|
||||||
|
|
||||||
echo:
|
echo:
|
||||||
echo Deleting a IdentityCRL Registry Key...
|
echo Deleting IdentityCRL Registry Key...
|
||||||
echo [%_ident%]
|
echo [%_ident%]
|
||||||
reg delete "%_ident%" /f %nul%
|
reg delete "%_ident%" /f %nul%
|
||||||
reg query "%_ident%" %nul% && (
|
reg query "%_ident%" %nul% && (
|
||||||
@@ -566,7 +570,7 @@ echo [Successful]
|
|||||||
|
|
||||||
echo:
|
echo:
|
||||||
if %winbuild% GTR 10240 (
|
if %winbuild% GTR 10240 (
|
||||||
echo Deleting Folder %ProgramData%\Microsoft\Windows\ClipSVC\
|
echo Deleting folder %ProgramData%\Microsoft\Windows\ClipSVC\
|
||||||
rmdir /s /q "C:\ProgramData\Microsoft\Windows\ClipSvc" %nul%
|
rmdir /s /q "C:\ProgramData\Microsoft\Windows\ClipSvc" %nul%
|
||||||
|
|
||||||
if exist "%ProgramData%\Microsoft\Windows\ClipSVC\" (
|
if exist "%ProgramData%\Microsoft\Windows\ClipSVC\" (
|
||||||
@@ -576,7 +580,7 @@ echo [Successful]
|
|||||||
)
|
)
|
||||||
|
|
||||||
echo:
|
echo:
|
||||||
echo Rebuilding Folder %ProgramData%\Microsoft\Windows\ClipSVC\
|
echo Rebuilding the %ProgramData%\Microsoft\Windows\ClipSVC\ folder...
|
||||||
%psc% Start-Service ClipSVC %nul%
|
%psc% Start-Service ClipSVC %nul%
|
||||||
timeout /t 3 %nul%
|
timeout /t 3 %nul%
|
||||||
if not exist "%ProgramData%\Microsoft\Windows\ClipSVC\" timeout /t 5 %nul%
|
if not exist "%ProgramData%\Microsoft\Windows\ClipSVC\" timeout /t 5 %nul%
|
||||||
@@ -588,82 +592,19 @@ echo [Successful]
|
|||||||
)
|
)
|
||||||
|
|
||||||
echo:
|
echo:
|
||||||
echo Restarting [wlidsvc LicenseManager] services...
|
echo Restarting wlidsvc ^& LicenseManager services...
|
||||||
for %%# in (wlidsvc LicenseManager) do (%psc% Restart-Service %%# %nul%)
|
for %%# in (wlidsvc LicenseManager) do (%psc% "Start-Job { Restart-Service %%# } | Wait-Job -Timeout 10 | Out-Null")
|
||||||
|
|
||||||
::========================================================================================================================================
|
|
||||||
|
|
||||||
:: Find remnants of Office vNext license block and remove it because it stops non vNext licenses from appearing
|
|
||||||
:: https://learn.microsoft.com/en-us/office/troubleshoot/activation/reset-office-365-proplus-activation-state
|
|
||||||
|
|
||||||
:cleanvnext
|
|
||||||
|
|
||||||
echo:
|
|
||||||
echo %line%
|
|
||||||
echo:
|
|
||||||
call :dk_color %Blue% "Clearing Office vNext License"
|
|
||||||
echo:
|
|
||||||
|
|
||||||
setlocal DisableDelayedExpansion
|
|
||||||
set "_Local=%LocalAppData%"
|
|
||||||
setlocal EnableDelayedExpansion
|
|
||||||
|
|
||||||
attrib -R "!ProgramData!\Microsoft\Office\Licenses" %nul%
|
|
||||||
attrib -R "!_Local!\Microsoft\Office\Licenses" %nul%
|
|
||||||
|
|
||||||
if exist "!ProgramData!\Microsoft\Office\Licenses\" (
|
|
||||||
rd /s /q "!ProgramData!\Microsoft\Office\Licenses\" %nul%
|
|
||||||
if exist "!ProgramData!\Microsoft\Office\Licenses\" (
|
|
||||||
echo Failed To Delete - !ProgramData!\Microsoft\Office\Licenses\
|
|
||||||
) else (
|
|
||||||
echo Deleted Folder - !ProgramData!\Microsoft\Office\Licenses\
|
|
||||||
)
|
|
||||||
) else (
|
|
||||||
echo Not Found - !ProgramData!\Microsoft\Office\Licenses\
|
|
||||||
)
|
|
||||||
|
|
||||||
if exist "!_Local!\Microsoft\Office\Licenses\" (
|
|
||||||
rd /s /q "!_Local!\Microsoft\Office\Licenses\" %nul%
|
|
||||||
if exist "!_Local!\Microsoft\Office\Licenses\" (
|
|
||||||
echo Failed To Delete - !_Local!\Microsoft\Office\Licenses\
|
|
||||||
) else (
|
|
||||||
echo Deleted Folder - !_Local!\Microsoft\Office\Licenses\
|
|
||||||
)
|
|
||||||
) else (
|
|
||||||
echo Not Found - !_Local!\Microsoft\Office\Licenses\
|
|
||||||
)
|
|
||||||
|
|
||||||
|
|
||||||
echo:
|
|
||||||
for /f "tokens=* delims=" %%a in ('%psc% "Get-ChildItem -Path 'HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion\ProfileList' | ForEach-Object { Split-Path -Path $_.PSPath -Leaf }" %nul6%') do (if defined _sid (set "_sid=!_sid! HKU\%%a") else (set "_sid=HKU\%%a"))
|
|
||||||
|
|
||||||
set regfound=
|
|
||||||
for %%# in (HKCU !_sid!) do (
|
|
||||||
for %%A in (
|
|
||||||
%%#\Software\Microsoft\Office\16.0\Common\Licensing
|
|
||||||
%%#\Software\Microsoft\Office\16.0\Common\Identity
|
|
||||||
%%#\Software\Microsoft\Office\16.0\Registration
|
|
||||||
) do (
|
|
||||||
reg query %%A %nul% && (
|
|
||||||
set regfound=1
|
|
||||||
reg delete %%A /f %nul% && (
|
|
||||||
echo Deleted Registry - %%A
|
|
||||||
) || (
|
|
||||||
echo Failed to Delete - %%A
|
|
||||||
)
|
|
||||||
)
|
|
||||||
)
|
|
||||||
)
|
|
||||||
if not defined regfound echo Not Found - Office vNext Registry Keys
|
|
||||||
|
|
||||||
::========================================================================================================================================
|
::========================================================================================================================================
|
||||||
|
|
||||||
:: Rebuild SPP Tokens
|
:: Rebuild SPP Tokens
|
||||||
|
|
||||||
|
:rebuildspptok
|
||||||
|
|
||||||
echo:
|
echo:
|
||||||
echo %line%
|
echo %line%
|
||||||
echo:
|
echo:
|
||||||
call :dk_color %Blue% "Rebuilding SPP Licensing Tokens"
|
call :dk_color %Blue% "Rebuilding SPP licensing tokens..."
|
||||||
echo:
|
echo:
|
||||||
|
|
||||||
call :scandat check
|
call :scandat check
|
||||||
@@ -674,52 +615,29 @@ call :dk_color %Red% "tokens.dat file not found."
|
|||||||
echo tokens.dat file: [%token%]
|
echo tokens.dat file: [%token%]
|
||||||
)
|
)
|
||||||
|
|
||||||
echo:
|
|
||||||
set wpainfo=
|
|
||||||
for /f "delims=" %%a in ('%psc% "$f=[io.file]::ReadAllText('!_batp!') -split ':wpatest\:.*';iex ($f[1]);" %nul6%') do (set wpainfo=%%a)
|
|
||||||
echo "%wpainfo%" | find /i "Error Found" %nul% && (
|
|
||||||
call :dk_color %Red% "WPA Registry Error: %wpainfo%"
|
|
||||||
) || (
|
|
||||||
echo WPA Registry Count: %wpainfo%
|
|
||||||
)
|
|
||||||
|
|
||||||
set tokenstore=
|
set tokenstore=
|
||||||
|
set badregistry=
|
||||||
for /f "skip=2 tokens=2*" %%a in ('reg query "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\SoftwareProtectionPlatform" /v TokenStore %nul6%') do call set "tokenstore=%%b"
|
for /f "skip=2 tokens=2*" %%a in ('reg query "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\SoftwareProtectionPlatform" /v TokenStore %nul6%') do call set "tokenstore=%%b"
|
||||||
|
if %winbuild% GEQ 9200 if /i not "%tokenstore%"=="%SysPath%\spp\store" if /i not "%tokenstore%"=="%SysPath%\spp\store\2.0" if /i not "%tokenstore%"=="%SysPath%\spp\store_test\2.0" (
|
||||||
|
set badregistry=1
|
||||||
|
echo:
|
||||||
|
call :dk_color %Red% "Correct path not found in TokenStore Registry [%tokenstore%]"
|
||||||
|
)
|
||||||
|
|
||||||
:: Check sppsvc permissions and apply fixes
|
:: Check sppsvc permissions and apply fixes
|
||||||
|
|
||||||
if %winbuild% GEQ 10240 (
|
if %winbuild% GEQ 9200 if not defined badregistry (
|
||||||
|
|
||||||
echo:
|
echo:
|
||||||
echo Checking SPP permission related issues...
|
echo Checking SPP permission related issues...
|
||||||
call :checkperms
|
call :checkperms
|
||||||
|
|
||||||
if defined permerror (
|
if defined permerror (
|
||||||
|
call :dk_color %Red% "[!permerror!]"
|
||||||
mkdir "%tokenstore%" %nul%
|
%psc% "$f=[io.file]::ReadAllText('!_batp!') -split ':fixsppperms\:.*';iex ($f[1])" %nul%
|
||||||
set "d=$sddl = 'O:BAG:BAD:PAI(A;OICI;FA;;;SY)(A;OICI;FA;;;BA)(A;OICIIO;GR;;;BU)(A;;FR;;;BU)(A;OICI;FA;;;S-1-5-80-123231216-2592883651-3715271367-3753151631-4175906628)';"
|
|
||||||
set "d=!d! $AclObject = New-Object System.Security.AccessControl.DirectorySecurity;"
|
|
||||||
set "d=!d! $AclObject.SetSecurityDescriptorSddlForm($sddl);"
|
|
||||||
set "d=!d! Set-Acl -Path %tokenstore% -AclObject $AclObject;"
|
|
||||||
%psc% "!d!" %nul%
|
|
||||||
|
|
||||||
for %%# in (
|
|
||||||
"HKLM:\SYSTEM\WPA_QueryValues, EnumerateSubKeys, WriteKey"
|
|
||||||
"HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion\SoftwareProtectionPlatform_SetValue"
|
|
||||||
) do for /f "tokens=1,2 delims=_" %%A in (%%#) do (
|
|
||||||
set "d=$acl = Get-Acl '%%A';"
|
|
||||||
set "d=!d! $rule = New-Object System.Security.AccessControl.RegistryAccessRule ('NT Service\sppsvc', '%%B', 'ContainerInherit, ObjectInherit','None','Allow');"
|
|
||||||
set "d=!d! $acl.ResetAccessRule($rule);"
|
|
||||||
set "d=!d! $acl.SetAccessRule($rule);"
|
|
||||||
set "d=!d! Set-Acl -Path '%%A' -AclObject $acl"
|
|
||||||
%psc% "!d!" %nul%
|
|
||||||
)
|
|
||||||
|
|
||||||
call :checkperms
|
call :checkperms
|
||||||
if defined permerror (
|
if defined permerror (
|
||||||
call :dk_color %Red% "[Failed To Fix]"
|
call :dk_color %Red% "[!permerror!] [Failed To Fix]"
|
||||||
) else (
|
) else (
|
||||||
echo [Successfully Fixed]
|
call :dk_color %Green% "[Successfully Fixed]"
|
||||||
)
|
)
|
||||||
) else (
|
) else (
|
||||||
echo [No Error Found]
|
echo [No Error Found]
|
||||||
@@ -730,6 +648,42 @@ echo:
|
|||||||
echo Stopping sppsvc service...
|
echo Stopping sppsvc service...
|
||||||
%psc% Stop-Service sppsvc -force %nul%
|
%psc% Stop-Service sppsvc -force %nul%
|
||||||
|
|
||||||
|
set w=
|
||||||
|
set _sppint=
|
||||||
|
for %%# in (SppEx%w%tComObj.exe sppsvc.exe) do (reg query "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Ima%w%ge File Execu%w%tion Options\%%#" %nul% && (set _sppint=1))
|
||||||
|
if defined _sppint (
|
||||||
|
echo:
|
||||||
|
echo Removing SPP IFEO registry keys...
|
||||||
|
for %%# in (SppE%w%xtComObj.exe sppsvc.exe) do (reg delete "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Ima%w%ge File Execu%w%tion Options\%%#" /f %nul%)
|
||||||
|
)
|
||||||
|
|
||||||
|
if %winbuild% LSS 9200 (
|
||||||
|
REM Fix issues caused by Update KB971033 in Windows 7
|
||||||
|
REM https://support.microsoft.com/help/4487266
|
||||||
|
echo:
|
||||||
|
echo Checking Update KB971033...
|
||||||
|
%psc% "if (Get-Hotfix -Id KB971033 -ErrorAction SilentlyContinue) {Exit 3}" %nul%
|
||||||
|
if !errorlevel!==3 (
|
||||||
|
echo Found, uninstalling it...
|
||||||
|
wusa /uninstall /quiet /norestart /kb:971033
|
||||||
|
) else (
|
||||||
|
echo [Not Found]
|
||||||
|
)
|
||||||
|
%psc% Stop-Service sppuinotify -force %nul%
|
||||||
|
sc config sppuinotify start= disabled
|
||||||
|
del /f /q %SysPath%\7B296FB0-376B-497e-B012-9C450E1B7327-*.C7483456-A289-439d-8115-601632D005A0 /ah
|
||||||
|
)
|
||||||
|
|
||||||
|
:: Delete registry keys that are not deleted by activation scripts
|
||||||
|
|
||||||
|
echo:
|
||||||
|
echo Cleaning some licensing-related registry keys...
|
||||||
|
%nul% reg delete "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\SoftwareProtectionPlatform" /v "ServiceSessionId" /f
|
||||||
|
%nul% reg delete "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\SoftwareProtectionPlatform" /v "LicStatusArray" /f
|
||||||
|
%nul% reg delete "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\SoftwareProtectionPlatform" /v "PolicyValuesArray" /f
|
||||||
|
%nul% reg delete "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\SoftwareProtectionPlatform" /v "actionlist" /f
|
||||||
|
%nul% reg delete "HKLM\SOFTWARE\Microsoft\OfficeSoftwareProtectionPlatform\data" /f
|
||||||
|
|
||||||
echo:
|
echo:
|
||||||
call :scandat delete
|
call :scandat delete
|
||||||
call :scandat check
|
call :scandat check
|
||||||
@@ -741,9 +695,9 @@ echo:
|
|||||||
)
|
)
|
||||||
|
|
||||||
echo:
|
echo:
|
||||||
echo Reinstalling System Licenses [slmgr /rilc]...
|
echo Reinstalling system licenses...
|
||||||
cscript //nologo %windir%\system32\slmgr.vbs /rilc %nul%
|
%psc% "Stop-Service sppsvc -force; $sls = Get-WmiObject SoftwareLicensingService; $f=[io.file]::ReadAllText('!_batp!') -split ':xrm\:.*';iex ($f[1]); ReinstallLicenses" %nul%
|
||||||
if %errorlevel% NEQ 0 cscript //nologo %windir%\system32\slmgr.vbs /rilc %nul%
|
if %errorlevel% NEQ 0 %psc% "$sls = Get-WmiObject SoftwareLicensingService; $f=[io.file]::ReadAllText('!_batp!') -split ':xrm\:.*';iex ($f[1]); ReinstallLicenses" %nul%
|
||||||
if %errorlevel% EQU 0 (
|
if %errorlevel% EQU 0 (
|
||||||
echo [Successful]
|
echo [Successful]
|
||||||
) else (
|
) else (
|
||||||
@@ -754,11 +708,15 @@ call :scandat check
|
|||||||
|
|
||||||
echo:
|
echo:
|
||||||
if not defined token (
|
if not defined token (
|
||||||
call :dk_color %Red% "Failed to rebuilt tokens.dat file."
|
call :dk_color %Red% "Failed to rebuild tokens.dat file."
|
||||||
) else (
|
) else (
|
||||||
echo tokens.dat file was rebuilt successfully.
|
echo tokens.dat file was rebuilt successfully.
|
||||||
)
|
)
|
||||||
|
|
||||||
|
if %winbuild% LSS 9200 (
|
||||||
|
sc config sppuinotify start= demand
|
||||||
|
)
|
||||||
|
|
||||||
::========================================================================================================================================
|
::========================================================================================================================================
|
||||||
|
|
||||||
:: Rebuild OSPP Tokens
|
:: Rebuild OSPP Tokens
|
||||||
@@ -766,11 +724,11 @@ echo tokens.dat file was rebuilt successfully.
|
|||||||
echo:
|
echo:
|
||||||
echo %line%
|
echo %line%
|
||||||
echo:
|
echo:
|
||||||
call :dk_color %Blue% "Rebuilding OSPP Licensing Tokens"
|
call :dk_color %Blue% "Rebuilding OSPP licensing tokens..."
|
||||||
echo:
|
echo:
|
||||||
|
|
||||||
sc qc osppsvc %nul% || (
|
sc qc osppsvc %nul% || (
|
||||||
echo OSPP based Office is not installed
|
echo OSPP-based Office is not installed.
|
||||||
echo Skipping rebuilding OSPP tokens...
|
echo Skipping rebuilding OSPP tokens...
|
||||||
goto :repairoffice
|
goto :repairoffice
|
||||||
)
|
)
|
||||||
@@ -798,7 +756,7 @@ echo:
|
|||||||
)
|
)
|
||||||
|
|
||||||
echo:
|
echo:
|
||||||
echo Starting osppsvc service to generate tokens.dat
|
echo Starting osppsvc service to generate tokens.dat...
|
||||||
%psc% Start-Service osppsvc %nul%
|
%psc% Start-Service osppsvc %nul%
|
||||||
call :scandatospp check
|
call :scandatospp check
|
||||||
if not defined token (
|
if not defined token (
|
||||||
@@ -811,7 +769,7 @@ call :scandatospp check
|
|||||||
|
|
||||||
echo:
|
echo:
|
||||||
if not defined token (
|
if not defined token (
|
||||||
call :dk_color %Red% "Failed to rebuilt tokens.dat file."
|
call :dk_color %Red% "Failed to rebuild tokens.dat file."
|
||||||
) else (
|
) else (
|
||||||
echo tokens.dat file was rebuilt successfully.
|
echo tokens.dat file was rebuilt successfully.
|
||||||
)
|
)
|
||||||
@@ -823,20 +781,11 @@ echo tokens.dat file was rebuilt successfully.
|
|||||||
echo:
|
echo:
|
||||||
echo %line%
|
echo %line%
|
||||||
echo:
|
echo:
|
||||||
call :dk_color %Blue% "Repairing Office Licenses"
|
call :dk_color %Blue% "Repairing Office licenses..."
|
||||||
echo:
|
echo:
|
||||||
|
|
||||||
for /f "skip=2 tokens=2*" %%a in ('reg query "HKLM\SYSTEM\CurrentControlSet\Control\Session Manager\Environment" /v PROCESSOR_ARCHITECTURE') do set arch=%%b
|
for /f "skip=2 tokens=2*" %%a in ('reg query "HKLM\SYSTEM\CurrentControlSet\Control\Session Manager\Environment" /v PROCESSOR_ARCHITECTURE') do set arch=%%b
|
||||||
|
|
||||||
if /i "%arch%"=="ARM64" (
|
|
||||||
echo:
|
|
||||||
echo ARM64 Windows Found.
|
|
||||||
echo You need to use repair option in Windows settings for Office.
|
|
||||||
echo:
|
|
||||||
start ms-settings:appsfeatures
|
|
||||||
goto :repairend
|
|
||||||
)
|
|
||||||
|
|
||||||
if /i "%arch%"=="x86" (
|
if /i "%arch%"=="x86" (
|
||||||
set arch=X86
|
set arch=X86
|
||||||
) else (
|
) else (
|
||||||
@@ -853,12 +802,12 @@ set _86=HKLM\SOFTWARE\Wow6432Node\Microsoft\Office
|
|||||||
reg query %_68%\14.0\CVH /f Click2run /k %nul% && (set "c2r14_68=Office 14.0 C2R x86/x64" & set "c2r14repair68=")
|
reg query %_68%\14.0\CVH /f Click2run /k %nul% && (set "c2r14_68=Office 14.0 C2R x86/x64" & set "c2r14repair68=")
|
||||||
reg query %_86%\14.0\CVH /f Click2run /k %nul% && (set "c2r14_86=Office 14.0 C2R x86" & set "c2r14repair86=")
|
reg query %_86%\14.0\CVH /f Click2run /k %nul% && (set "c2r14_86=Office 14.0 C2R x86" & set "c2r14repair86=")
|
||||||
|
|
||||||
for /f "skip=2 tokens=2*" %%a in ('"reg query %_86%\14.0\Common\InstallRoot /v Path" %nul6%') do if exist "%%b\EntityPicker.dll" (set "msi14_86=Office 14.0 MSI x86" & set "msi14repair86=%systemdrive%\Program Files (x86)\Common Files\Microsoft Shared\OFFICE14\Office Setup Controller\Setup.exe")
|
for /f "skip=2 tokens=2*" %%a in ('"reg query %_86%\14.0\Common\InstallRoot /v Path" %nul6%') do if exist "%%b\EntityPicker.dll" (set "msi14_86=Office 14.0 MSI x86" & call :getrepairsetup msi14repair86 14)
|
||||||
for /f "skip=2 tokens=2*" %%a in ('"reg query %_68%\14.0\Common\InstallRoot /v Path" %nul6%') do if exist "%%b\EntityPicker.dll" (set "msi14_68=Office 14.0 MSI x86/x64" & set "msi14repair68=%systemdrive%\Program Files\Common Files\microsoft shared\OFFICE14\Office Setup Controller\Setup.exe")
|
for /f "skip=2 tokens=2*" %%a in ('"reg query %_68%\14.0\Common\InstallRoot /v Path" %nul6%') do if exist "%%b\EntityPicker.dll" (set "msi14_68=Office 14.0 MSI x86/x64" & call :getrepairsetup msi14repair68 14)
|
||||||
for /f "skip=2 tokens=2*" %%a in ('"reg query %_86%\15.0\Common\InstallRoot /v Path" %nul6%') do if exist "%%b\EntityPicker.dll" (set "msi15_86=Office 15.0 MSI x86" & set "msi15repair86=%systemdrive%\Program Files (x86)\Common Files\Microsoft Shared\OFFICE15\Office Setup Controller\Setup.exe")
|
for /f "skip=2 tokens=2*" %%a in ('"reg query %_86%\15.0\Common\InstallRoot /v Path" %nul6%') do if exist "%%b\EntityPicker.dll" (set "msi15_86=Office 15.0 MSI x86" & call :getrepairsetup msi15repair86 15)
|
||||||
for /f "skip=2 tokens=2*" %%a in ('"reg query %_68%\15.0\Common\InstallRoot /v Path" %nul6%') do if exist "%%b\EntityPicker.dll" (set "msi15_68=Office 15.0 MSI x86/x64" & set "msi15repair68=%systemdrive%\Program Files\Common Files\microsoft shared\OFFICE15\Office Setup Controller\Setup.exe")
|
for /f "skip=2 tokens=2*" %%a in ('"reg query %_68%\15.0\Common\InstallRoot /v Path" %nul6%') do if exist "%%b\EntityPicker.dll" (set "msi15_68=Office 15.0 MSI x86/x64" & call :getrepairsetup msi15repair68 15)
|
||||||
for /f "skip=2 tokens=2*" %%a in ('"reg query %_86%\16.0\Common\InstallRoot /v Path" %nul6%') do if exist "%%b\EntityPicker.dll" (set "msi16_86=Office 16.0 MSI x86" & set "msi16repair86=%systemdrive%\Program Files (x86)\Common Files\Microsoft Shared\OFFICE16\Office Setup Controller\Setup.exe")
|
for /f "skip=2 tokens=2*" %%a in ('"reg query %_86%\16.0\Common\InstallRoot /v Path" %nul6%') do if exist "%%b\EntityPicker.dll" (set "msi16_86=Office 16.0 MSI x86" & call :getrepairsetup msi16repair86 16)
|
||||||
for /f "skip=2 tokens=2*" %%a in ('"reg query %_68%\16.0\Common\InstallRoot /v Path" %nul6%') do if exist "%%b\EntityPicker.dll" (set "msi16_68=Office 16.0 MSI x86/x64" & set "msi16repair68=%systemdrive%\Program Files\Common Files\Microsoft Shared\OFFICE16\Office Setup Controller\Setup.exe")
|
for /f "skip=2 tokens=2*" %%a in ('"reg query %_68%\16.0\Common\InstallRoot /v Path" %nul6%') do if exist "%%b\EntityPicker.dll" (set "msi16_68=Office 16.0 MSI x86/x64" & call :getrepairsetup msi16repair68 16)
|
||||||
|
|
||||||
for /f "skip=2 tokens=2*" %%a in ('"reg query %_86%\15.0\ClickToRun /v InstallPath" %nul6%') do if exist "%%b\root\Licenses\ProPlus*.xrm-ms" (set "c2r15_86=Office 15.0 C2R x86" & set "c2r15repair86=%systemdrive%\Program Files\Microsoft Office 15\Client%arch%\integratedoffice.exe")
|
for /f "skip=2 tokens=2*" %%a in ('"reg query %_86%\15.0\ClickToRun /v InstallPath" %nul6%') do if exist "%%b\root\Licenses\ProPlus*.xrm-ms" (set "c2r15_86=Office 15.0 C2R x86" & set "c2r15repair86=%systemdrive%\Program Files\Microsoft Office 15\Client%arch%\integratedoffice.exe")
|
||||||
for /f "skip=2 tokens=2*" %%a in ('"reg query %_68%\15.0\ClickToRun /v InstallPath" %nul6%') do if exist "%%b\root\Licenses\ProPlus*.xrm-ms" (set "c2r15_68=Office 15.0 C2R x86/x64" & set "c2r15repair68=%systemdrive%\Program Files\Microsoft Office 15\Client%arch%\integratedoffice.exe")
|
for /f "skip=2 tokens=2*" %%a in ('"reg query %_68%\15.0\ClickToRun /v InstallPath" %nul6%') do if exist "%%b\root\Licenses\ProPlus*.xrm-ms" (set "c2r15_68=Office 15.0 C2R x86/x64" & set "c2r15repair68=%systemdrive%\Program Files\Microsoft Office 15\Client%arch%\integratedoffice.exe")
|
||||||
@@ -899,29 +848,33 @@ set /a counter+=1
|
|||||||
|
|
||||||
if %counter% GTR 1 (
|
if %counter% GTR 1 (
|
||||||
%eline%
|
%eline%
|
||||||
echo Multiple office versions found.
|
echo Multiple Office versions found.
|
||||||
echo It's recommended to install only one version of office.
|
echo It is recommended to only install one version of Office.
|
||||||
echo ________________________________________________________________
|
echo ________________________________________________________________
|
||||||
echo:
|
echo:
|
||||||
)
|
)
|
||||||
|
|
||||||
if %counter% EQU 0 (
|
if %counter% EQU 0 (
|
||||||
echo:
|
echo:
|
||||||
echo Installed Office is not found.
|
echo Office ^(2010 and later^) is not installed.
|
||||||
goto :repairend
|
goto :repairend
|
||||||
echo:
|
echo:
|
||||||
) else (
|
) else (
|
||||||
echo:
|
echo:
|
||||||
call :dk_color %_Yellow% "A Window will popup, in that Window you need to select [Quick] Repair Option..."
|
call :dk_color %_Yellow% "A new window will appear, in that window you need to select [Quick Repair] option."
|
||||||
|
if defined terminal (
|
||||||
|
call :dk_color %_Yellow% "Press [0] to continue..."
|
||||||
|
choice /c 0 /n
|
||||||
|
) else (
|
||||||
call :dk_color %_Yellow% "Press any key to continue..."
|
call :dk_color %_Yellow% "Press any key to continue..."
|
||||||
echo:
|
|
||||||
pause %nul1%
|
pause %nul1%
|
||||||
)
|
)
|
||||||
|
)
|
||||||
|
|
||||||
if defined uwp16 (
|
if defined uwp16 (
|
||||||
echo:
|
echo:
|
||||||
echo Note: Skipping repair for Office 16.0 UWP.
|
echo Note: Skipping repair for Office 16.0 UWP...
|
||||||
echo You need to use reset option in Windows settings for it.
|
echo You need to use the Reset option in Windows Settings instead.
|
||||||
echo ________________________________________________________________
|
echo ________________________________________________________________
|
||||||
echo:
|
echo:
|
||||||
start ms-settings:appsfeatures
|
start ms-settings:appsfeatures
|
||||||
@@ -933,8 +886,8 @@ if defined c2r14_86 set c2r14=1
|
|||||||
|
|
||||||
if defined c2r14 (
|
if defined c2r14 (
|
||||||
echo:
|
echo:
|
||||||
echo Note: Skipping repair for Office 14.0 C2R
|
echo Note: Skipping repair for Office 14.0 C2R...
|
||||||
echo You need to use Repair option in Windows settings for it.
|
echo You need to use the Repair option in Windows Settings for it.
|
||||||
echo ________________________________________________________________
|
echo ________________________________________________________________
|
||||||
echo:
|
echo:
|
||||||
start appwiz.cpl
|
start appwiz.cpl
|
||||||
@@ -960,6 +913,15 @@ echo:
|
|||||||
call :dk_color %Green% "Finished"
|
call :dk_color %Green% "Finished"
|
||||||
goto :at_back
|
goto :at_back
|
||||||
|
|
||||||
|
:getrepairsetup
|
||||||
|
|
||||||
|
set "_common86=%systemdrive%\Program Files (x86)\Common Files\Microsoft Shared\OFFICE%2\Office Setup Controller\setup.exe"
|
||||||
|
set "_common68=%systemdrive%\Program Files\Common Files\Microsoft Shared\OFFICE%2\Office Setup Controller\setup.exe"
|
||||||
|
|
||||||
|
if exist "%_common86%" set "%1=%_common86%"
|
||||||
|
if exist "%_common68%" set "%1=%_common68%"
|
||||||
|
exit /b
|
||||||
|
|
||||||
::========================================================================================================================================
|
::========================================================================================================================================
|
||||||
|
|
||||||
:fixwmi
|
:fixwmi
|
||||||
@@ -972,13 +934,7 @@ title Fix WMI
|
|||||||
|
|
||||||
if exist "%SystemRoot%\Servicing\Packages\Microsoft-Windows-Server*Edition~*.mum" (
|
if exist "%SystemRoot%\Servicing\Packages\Microsoft-Windows-Server*Edition~*.mum" (
|
||||||
%eline%
|
%eline%
|
||||||
echo WMI rebuild is not recommended on Windows Server. Aborting...
|
echo Rebuilding WMI is not recommended on Windows Server, aborting...
|
||||||
goto :at_back
|
|
||||||
)
|
|
||||||
|
|
||||||
for %%# in (wmic.exe) do @if "%%~$PATH:#"=="" (
|
|
||||||
%eline%
|
|
||||||
echo wmic.exe file is not found in the system. Aborting...
|
|
||||||
goto :at_back
|
goto :at_back
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -996,7 +952,7 @@ call :checkwmi
|
|||||||
|
|
||||||
if not defined error (
|
if not defined error (
|
||||||
echo [Working]
|
echo [Working]
|
||||||
echo No need to apply this option. Aborting...
|
echo No need to apply this option, aborting...
|
||||||
goto :at_back
|
goto :at_back
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -1011,7 +967,7 @@ for %%G in (DependOnService Description DisplayName ErrorControl ImagePath Objec
|
|||||||
echo:
|
echo:
|
||||||
if defined _corrupt (
|
if defined _corrupt (
|
||||||
%eline%
|
%eline%
|
||||||
echo Winmgmt service is corrupted. Aborting...
|
echo Winmgmt service is corrupted, aborting...
|
||||||
goto :at_back
|
goto :at_back
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -1048,8 +1004,8 @@ exit
|
|||||||
|
|
||||||
echo:
|
echo:
|
||||||
echo Deleting WMI repository
|
echo Deleting WMI repository
|
||||||
rmdir /s /q "%windir%\System32\wbem\repository\" %nul%
|
rmdir /s /q "%SysPath%\wbem\repository\" %nul%
|
||||||
if exist "%windir%\System32\wbem\repository\" (
|
if exist "%SysPath%\wbem\repository\" (
|
||||||
call :dk_color %Red% "[Failed]"
|
call :dk_color %Red% "[Failed]"
|
||||||
) else (
|
) else (
|
||||||
echo [Successful]
|
echo [Successful]
|
||||||
@@ -1094,9 +1050,9 @@ goto :at_back
|
|||||||
:: https://eskonr.com/2012/01/how-to-fix-wmi-issues-automatically/
|
:: https://eskonr.com/2012/01/how-to-fix-wmi-issues-automatically/
|
||||||
|
|
||||||
%psc% Stop-Service Winmgmt -force %nul%
|
%psc% Stop-Service Winmgmt -force %nul%
|
||||||
cd /d %systemroot%\system32\wbem\
|
cd /d %SysPath%\wbem\
|
||||||
regsvr32 /s %systemroot%\system32\scecli.dll
|
regsvr32 /s %SysPath%\scecli.dll
|
||||||
regsvr32 /s %systemroot%\system32\userenv.dll
|
regsvr32 /s %SysPath%\userenv.dll
|
||||||
mofcomp cimwin32.mof
|
mofcomp cimwin32.mof
|
||||||
mofcomp cimwin32.mfl
|
mofcomp cimwin32.mfl
|
||||||
mofcomp rsop.mof
|
mofcomp rsop.mof
|
||||||
@@ -1114,12 +1070,12 @@ exit /b
|
|||||||
:: https://learn.microsoft.com/en-us/windows/win32/wmisdk/wmi-error-constants
|
:: https://learn.microsoft.com/en-us/windows/win32/wmisdk/wmi-error-constants
|
||||||
|
|
||||||
set error=
|
set error=
|
||||||
wmic path Win32_ComputerSystem get CreationClassName /value %nul2% | find /i "computersystem" %nul1%
|
%psc% "Get-WmiObject -Class Win32_ComputerSystem | Select-Object -Property CreationClassName" %nul2% | find /i "computersystem" %nul1%
|
||||||
if %errorlevel% NEQ 0 (set error=1& exit /b)
|
if %errorlevel% NEQ 0 (set error=1& exit /b)
|
||||||
winmgmt /verifyrepository %nul%
|
winmgmt /verifyrepository %nul%
|
||||||
if %errorlevel% NEQ 0 (set error=1& exit /b)
|
if %errorlevel% NEQ 0 (set error=1& exit /b)
|
||||||
|
|
||||||
cscript //nologo %windir%\system32\slmgr.vbs /dlv %nul%
|
%psc% "try { $null=([WMISEARCHER]'SELECT * FROM SoftwareLicensingService').Get().Version; exit 0 } catch { exit $_.Exception.InnerException.HResult }" %nul%
|
||||||
cmd /c exit /b %errorlevel%
|
cmd /c exit /b %errorlevel%
|
||||||
echo "0x%=ExitCode%" | findstr /i "0x800410 0x800440" %nul1%
|
echo "0x%=ExitCode%" | findstr /i "0x800410 0x800440" %nul1%
|
||||||
if %errorlevel% EQU 0 set error=1
|
if %errorlevel% EQU 0 set error=1
|
||||||
@@ -1132,8 +1088,13 @@ exit /b
|
|||||||
echo:
|
echo:
|
||||||
echo %line%
|
echo %line%
|
||||||
echo:
|
echo:
|
||||||
call :dk_color %_Yellow% "Press any key to go back..."
|
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%
|
pause %nul1%
|
||||||
|
)
|
||||||
goto :at_menu
|
goto :at_menu
|
||||||
|
|
||||||
::========================================================================================================================================
|
::========================================================================================================================================
|
||||||
@@ -1170,58 +1131,166 @@ exit /b
|
|||||||
|
|
||||||
::========================================================================================================================================
|
::========================================================================================================================================
|
||||||
|
|
||||||
:: This code checks for invalid registry keys in HKLM\SYSTEM\WPA. This issue may appear even on healthy systems
|
:checkperms
|
||||||
|
|
||||||
:wpatest:
|
:: This code checks if SPP has permission access to tokens folder and required registry keys. Incorrect permissions are often set by gaming spoofers.
|
||||||
$wpaKey = [Microsoft.Win32.RegistryKey]::OpenBaseKey('LocalMachine', 'Registry64').OpenSubKey("SYSTEM\\WPA")
|
|
||||||
$count = $wpaKey.SubKeyCount
|
|
||||||
|
|
||||||
$osVersion = [System.Environment]::OSVersion.Version
|
set permerror=
|
||||||
$minBuildNumber = 14393
|
if not exist "%tokenstore%\" set "permerror=Error Found In Token Folder"
|
||||||
|
|
||||||
if ($osVersion.Build -ge $minBuildNumber) {
|
for %%# in (
|
||||||
$subkeyHashTable = @{}
|
"%tokenstore%+FullControl"
|
||||||
foreach ($subkeyName in $wpaKey.GetSubKeyNames()) {
|
"HKLM:\SYSTEM\WPA+QueryValues, EnumerateSubKeys, WriteKey"
|
||||||
$keyNumber = $subkeyName -replace '.*-', ''
|
"HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion\SoftwareProtectionPlatform+SetValue"
|
||||||
$subkeyHashTable[$keyNumber] = $true
|
) 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%
|
||||||
for ($i=1; $i -le $count; $i++) {
|
if !errorlevel!==2 (
|
||||||
if (-not $subkeyHashTable.ContainsKey("$i")) {
|
if "%%A"=="%tokenstore%" (
|
||||||
Write-Host "Total Keys $count. Error Found- $i key does not exist"
|
set "permerror=Error Found In Token Folder"
|
||||||
$wpaKey.Close()
|
) else (
|
||||||
exit
|
set "permerror=Error Found In SPP Registries"
|
||||||
}
|
)
|
||||||
}
|
)
|
||||||
}
|
)
|
||||||
$wpaKey.GetSubKeyNames() | ForEach-Object {
|
|
||||||
$subkey = $wpaKey.OpenSubKey($_)
|
REM https://learn.microsoft.com/office/troubleshoot/activation/license-issue-when-start-office-application
|
||||||
$p = $subkey.GetValueNames()
|
|
||||||
if (($p | Where-Object { $subkey.GetValueKind($_) -eq [Microsoft.Win32.RegistryValueKind]::Binary }).Count -eq 0) {
|
if not defined permerror (
|
||||||
Write-Host "Total Keys $count. Error Found- Binary Data is corrupt"
|
reg query "HKU\S-1-5-20\Software\Microsoft\Windows NT\CurrentVersion" %nul% && (
|
||||||
$wpaKey.Close()
|
set "pol=HKU\S-1-5-20\Software\Microsoft\Windows NT\CurrentVersion\SoftwareProtectionPlatform\Policies"
|
||||||
exit
|
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"
|
||||||
$count
|
)
|
||||||
$wpaKey.Close()
|
)
|
||||||
:wpatest:
|
exit /b
|
||||||
|
|
||||||
::========================================================================================================================================
|
::========================================================================================================================================
|
||||||
|
|
||||||
:checkperms
|
:: Fix SPP related registry and folder permissions
|
||||||
|
|
||||||
set permerror=
|
:fixsppperms:
|
||||||
if not exist "%tokenstore%\" set permerror=1
|
# Fix perms for Token Folder
|
||||||
|
|
||||||
for %%# in (
|
if ($env:permerror -eq 'Error Found In Token Folder') {
|
||||||
"%tokenstore%"
|
New-Item -Path $env:tokenstore -ItemType Directory -Force
|
||||||
"HKLM:\SYSTEM\WPA"
|
$sddl = 'O:BAG:BAD:PAI(A;OICI;FA;;;SY)(A;OICI;FA;;;BA)(A;OICIIO;GR;;;BU)(A;;FR;;;BU)(A;OICI;FA;;;S-1-5-80-123231216-2592883651-3715271367-3753151631-4175906628)'
|
||||||
"HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion\SoftwareProtectionPlatform"
|
$AclObject = New-Object System.Security.AccessControl.DirectorySecurity
|
||||||
) do if not defined permerror (
|
$AclObject.SetSecurityDescriptorSddlForm($sddl)
|
||||||
%psc% "$acl = Get-Acl '%%#'; if ($acl.Access.Where{ $_.IdentityReference -eq 'NT SERVICE\sppsvc' -and $_.AccessControlType -eq 'Deny' -or $acl.Access.IdentityReference -notcontains 'NT SERVICE\sppsvc'}) {Exit 2}" %nul%
|
Set-Acl -Path $env:tokenstore -AclObject $AclObject
|
||||||
if !errorlevel!==2 set permerror=1
|
exit
|
||||||
)
|
}
|
||||||
exit /b
|
|
||||||
|
# Fix perms for SPP registries
|
||||||
|
|
||||||
|
if ($env:permerror -eq 'Error Found In SPP Registries') {
|
||||||
|
$acl = Get-Acl 'HKLM:\SYSTEM\WPA'
|
||||||
|
$rule = New-Object System.Security.AccessControl.RegistryAccessRule ('NT Service\sppsvc', 'QueryValues, EnumerateSubKeys, WriteKey', 'ContainerInherit, ObjectInherit', 'None', 'Allow')
|
||||||
|
$acl.ResetAccessRule($rule)
|
||||||
|
$acl.SetAccessRule($rule)
|
||||||
|
Set-Acl -Path 'HKLM:\SYSTEM\WPA' -AclObject $acl
|
||||||
|
|
||||||
|
$acl = Get-Acl 'HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion\SoftwareProtectionPlatform'
|
||||||
|
$rule = New-Object System.Security.AccessControl.RegistryAccessRule ('NT Service\sppsvc', 'SetValue', 'ContainerInherit, ObjectInherit', 'None', 'Allow')
|
||||||
|
$acl.ResetAccessRule($rule)
|
||||||
|
$acl.SetAccessRule($rule)
|
||||||
|
Set-Acl -Path 'HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion\SoftwareProtectionPlatform' -AclObject $acl
|
||||||
|
exit
|
||||||
|
}
|
||||||
|
|
||||||
|
# Fix perms for SPP in HKU\S-1-5-20
|
||||||
|
# https://learn.microsoft.com/office/troubleshoot/activation/license-issue-when-start-office-application
|
||||||
|
|
||||||
|
if ($env:permerror -ne 'Error Found In S-1-5-20 SPP') {
|
||||||
|
exit
|
||||||
|
}
|
||||||
|
if (-not (Test-Path 'Registry::HKU\S-1-5-20\Software\Microsoft\Windows NT\CurrentVersion\SoftwareProtectionPlatform')) {
|
||||||
|
exit
|
||||||
|
}
|
||||||
|
|
||||||
|
# https://stackoverflow.com/a/35843420
|
||||||
|
|
||||||
|
function Take-Permissions {
|
||||||
|
param($rootKey, $key, [System.Security.Principal.SecurityIdentifier]$sid = 'S-1-5-32-545', $recurse = $true)
|
||||||
|
|
||||||
|
switch -regex ($rootKey) {
|
||||||
|
'HKCU|HKEY_CURRENT_USER' { $rootKey = 'CurrentUser' }
|
||||||
|
'HKLM|HKEY_LOCAL_MACHINE' { $rootKey = 'LocalMachine' }
|
||||||
|
'HKCR|HKEY_CLASSES_ROOT' { $rootKey = 'ClassesRoot' }
|
||||||
|
'HKCC|HKEY_CURRENT_CONFIG' { $rootKey = 'CurrentConfig' }
|
||||||
|
'HKU|HKEY_USERS' { $rootKey = 'Users' }
|
||||||
|
}
|
||||||
|
|
||||||
|
### Step 1 - escalate current process's privilege
|
||||||
|
# get SeTakeOwnership, SeBackup and SeRestore privileges before executes next lines, script needs Admin privilege
|
||||||
|
$AssemblyBuilder = [AppDomain]::CurrentDomain.DefineDynamicAssembly(4, 1)
|
||||||
|
$ModuleBuilder = $AssemblyBuilder.DefineDynamicModule(2, $False)
|
||||||
|
$TypeBuilder = $ModuleBuilder.DefineType(0)
|
||||||
|
$TypeBuilder.DefinePInvokeMethod('RtlAdjustPrivilege', 'ntdll.dll', 'Public, Static', 1, [int], @([int], [bool], [bool], [bool].MakeByRefType()), 1, 3) | Out-Null
|
||||||
|
9, 17, 18 | ForEach-Object { $TypeBuilder.CreateType()::RtlAdjustPrivilege($_, $true, $false, [ref]$false) | Out-Null }
|
||||||
|
|
||||||
|
function Take-KeyPermissions {
|
||||||
|
param($rootKey, $key, $sid, $recurse, $recurseLevel = 0)
|
||||||
|
|
||||||
|
### Step 2 - get ownerships of key - it works only for current key
|
||||||
|
$regKey = [Microsoft.Win32.Registry]::$rootKey.OpenSubKey($key, 'ReadWriteSubTree', 'TakeOwnership')
|
||||||
|
$acl = New-Object System.Security.AccessControl.RegistrySecurity
|
||||||
|
$acl.SetOwner($sid)
|
||||||
|
$regKey.SetAccessControl($acl)
|
||||||
|
|
||||||
|
### Step 3 - enable inheritance of permissions (not ownership) for current key from parent
|
||||||
|
$acl.SetAccessRuleProtection($false, $false)
|
||||||
|
$regKey.SetAccessControl($acl)
|
||||||
|
|
||||||
|
### Step 4 - only for top-level key, change permissions for current key and propagate it for subkeys
|
||||||
|
# to enable propagations for subkeys, it needs to execute Steps 2-3 for each subkey (Step 5)
|
||||||
|
if ($recurseLevel -eq 0) {
|
||||||
|
$regKey = $regKey.OpenSubKey('', 'ReadWriteSubTree', 'ChangePermissions')
|
||||||
|
$rule = New-Object System.Security.AccessControl.RegistryAccessRule($sid, 'FullControl', 'ContainerInherit', 'None', 'Allow')
|
||||||
|
$acl.ResetAccessRule($rule)
|
||||||
|
$regKey.SetAccessControl($acl)
|
||||||
|
}
|
||||||
|
|
||||||
|
### Step 5 - recursively repeat steps 2-5 for subkeys
|
||||||
|
if ($recurse) {
|
||||||
|
foreach ($subKey in $regKey.OpenSubKey('').GetSubKeyNames()) {
|
||||||
|
Take-KeyPermissions $rootKey ($key + '\' + $subKey) $sid $recurse ($recurseLevel + 1)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Take-KeyPermissions $rootKey $key $sid $recurse
|
||||||
|
}
|
||||||
|
|
||||||
|
Take-Permissions "Users" "S-1-5-20\Software\Microsoft\Windows NT\CurrentVersion\SoftwareProtectionPlatform" "S-1-5-20"
|
||||||
|
:fixsppperms:
|
||||||
|
|
||||||
|
::========================================================================================================================================
|
||||||
|
|
||||||
|
:: Install License files using Powershell/WMI instead of slmgr.vbs
|
||||||
|
|
||||||
|
:xrm:
|
||||||
|
function InstallLicenseFile($Lsc) {
|
||||||
|
try {
|
||||||
|
$null = $sls.InstallLicense([IO.File]::ReadAllText($Lsc))
|
||||||
|
} catch {
|
||||||
|
$host.SetShouldExit($_.Exception.HResult)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
function InstallLicenseArr($Str) {
|
||||||
|
$a = $Str -split ';'
|
||||||
|
ForEach ($x in $a) {InstallLicenseFile "$x"}
|
||||||
|
}
|
||||||
|
function InstallLicenseDir($Loc) {
|
||||||
|
dir $Loc *.xrm-ms -af -s | select -expand FullName | % {InstallLicenseFile "$_"}
|
||||||
|
}
|
||||||
|
function ReinstallLicenses() {
|
||||||
|
$Oem = "$env:SysPath\oem"
|
||||||
|
$Spp = "$env:SysPath\spp\tokens"
|
||||||
|
InstallLicenseDir "$Spp"
|
||||||
|
If (Test-Path $Oem) {InstallLicenseDir "$Oem"}
|
||||||
|
}
|
||||||
|
:xrm:
|
||||||
|
|
||||||
::========================================================================================================================================
|
::========================================================================================================================================
|
||||||
|
|
||||||
@@ -1229,9 +1298,9 @@ exit /b
|
|||||||
|
|
||||||
set token=
|
set token=
|
||||||
for %%# in (
|
for %%# in (
|
||||||
%Systemdrive%\Windows\System32\spp\store_test\2.0\
|
%SysPath%\spp\store_test\2.0\
|
||||||
%Systemdrive%\Windows\System32\spp\store\
|
%SysPath%\spp\store\
|
||||||
%Systemdrive%\Windows\System32\spp\store\2.0\
|
%SysPath%\spp\store\2.0\
|
||||||
%Systemdrive%\Windows\ServiceProfiles\NetworkService\AppData\Roaming\Microsoft\SoftwareProtectionPlatform\
|
%Systemdrive%\Windows\ServiceProfiles\NetworkService\AppData\Roaming\Microsoft\SoftwareProtectionPlatform\
|
||||||
) do (
|
) do (
|
||||||
|
|
||||||
@@ -1312,13 +1381,13 @@ $key.SetAccessControl($acl)
|
|||||||
|
|
||||||
echo:
|
echo:
|
||||||
if defined fixes (
|
if defined fixes (
|
||||||
call :dk_color2 %Blue% "Press [1] To Open Troubleshoot Page " %Gray% " Press [0] To Ignore"
|
call :dk_color2 %Blue% "Press [1] to open Troubleshoot page " %Gray% " Press [0] to ignore"
|
||||||
choice /C:10 /N
|
choice /C:10 /N
|
||||||
if !errorlevel!==1 (for %%# in (%fixes%) do (start %%#))
|
if !errorlevel!==1 (for %%# in (%fixes%) do (start %%#))
|
||||||
)
|
)
|
||||||
|
|
||||||
if defined terminal (
|
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
|
choice /c 0 /n
|
||||||
) else (
|
) else (
|
||||||
call :dk_color %_Yellow% "Press any key to %_exitmsg%..."
|
call :dk_color %_Yellow% "Press any key to %_exitmsg%..."
|
||||||
@@ -1333,7 +1402,7 @@ exit /b
|
|||||||
if %_NCS% EQU 1 (
|
if %_NCS% EQU 1 (
|
||||||
echo %esc%[%~1%~2%esc%[0m
|
echo %esc%[%~1%~2%esc%[0m
|
||||||
) else (
|
) 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
|
exit /b
|
||||||
|
|
||||||
@@ -1342,7 +1411,7 @@ exit /b
|
|||||||
if %_NCS% EQU 1 (
|
if %_NCS% EQU 1 (
|
||||||
echo %esc%[%~1%~2%esc%[%~3%~4%esc%[0m
|
echo %esc%[%~1%~2%esc%[%~3%~4%esc%[0m
|
||||||
) else (
|
) 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
|
exit /b
|
||||||
|
|
||||||
|
|||||||
30
README.md
30
README.md
@@ -14,19 +14,19 @@
|
|||||||
|
|
||||||
## Download / How to use it?
|
## 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).
|
1. Open PowerShell (Not CMD). To do that, right-click on the Windows start menu and select PowerShell or Terminal.
|
||||||
- Copy and paste the code below and press enter
|
2. Copy and paste the code below and press enter
|
||||||
```
|
```
|
||||||
irm https://get.activated.win | iex
|
irm https://get.activated.win | iex
|
||||||
```
|
```
|
||||||
or (deprecated, will be retired on Aug 31 2024, use above instead)
|
or (deprecated, will be retired on Dec 31 2024, use above instead)
|
||||||
```
|
```
|
||||||
irm https://massgrave.dev/get | iex
|
irm https://massgrave.dev/get | iex
|
||||||
```
|
```
|
||||||
- You will see the activation options. Follow the on-screen instructions.
|
3. You will see the activation options. Choose [1] HWID for Windows activation. Choose [2] Ohook for Office activation.
|
||||||
- That's all.
|
4. That's all.
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
@@ -35,22 +35,22 @@ irm https://massgrave.dev/get | iex
|
|||||||
- The Powershell method does not work on Windows 7. Use the Method 2 - Traditional instead.
|
- The 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.
|
- The URL get.activated.win may be blocked by some DNS services because it is a new domain.
|
||||||
|
|
||||||
### Method 2 - Traditional
|
### Method 2 - Traditional (Windows 7 and later)
|
||||||
|
|
||||||
- Download the file under the code button from [GitHub](https://github.com/massgravel/Microsoft-Activation-Scripts) or [Bitbucket](https://bitbucket.org/WindowsAddict/microsoft-activation-scripts)
|
1. Download the file under the code button from [GitHub](https://github.com/massgravel/Microsoft-Activation-Scripts) or [Bitbucket](https://bitbucket.org/WindowsAddict/microsoft-activation-scripts) or [Codeberg](https://codeberg.org/massgravel/Microsoft-Activation-Scripts)
|
||||||
- Right-click on the downloaded zip file and extract
|
2. Right-click on the downloaded zip file and extract
|
||||||
- In the extracted folder, find the folder named `All-In-One-Version`
|
3. In the extracted folder, find the folder named `All-In-One-Version`
|
||||||
- Run the file named `MAS_AIO-CRC32_XXXXXXXX.cmd`
|
4. Run the file named `MAS_AIO.cmd`
|
||||||
- You will see the activation options, follow the on-screen instructions.
|
5. You will see the activation options, follow the on-screen instructions.
|
||||||
- That's all.
|
6. That's all.
|
||||||
|
|
||||||
To run the scripts in unattended mode, check [here](https://massgrave.dev/command_line_switches)
|
To run the scripts in unattended mode, check [here](https://massgrave.dev/command_line_switches)
|
||||||
|
|
||||||
</br>
|
</br>
|
||||||
|
|
||||||
```
|
```
|
||||||
Latest Version: 2.6
|
Latest Version: 2.7
|
||||||
Release date: 20-Apr-2024
|
Release date: 6-Sep-2024
|
||||||
```
|
```
|
||||||
|
|
||||||
### [Troubleshooting / Help](https://massgrave.dev/troubleshoot)
|
### [Troubleshooting / Help](https://massgrave.dev/troubleshoot)
|
||||||
|
|||||||
Reference in New Issue
Block a user