10 Commits

12 changed files with 414 additions and 189 deletions

6
.gitattributes vendored
View File

@ -1,4 +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 .gitattributes export-ignore

View File

@ -1,5 +1,5 @@
@::yfh37fow-random @::hr47hf7-random
@set masver=3.4 @set masver=3.5
@setlocal DisableDelayedExpansion @setlocal DisableDelayedExpansion
@echo off @echo off
@ -44,6 +44,7 @@ set "_cmdf=%~f0"
for %%# in (%*) do ( for %%# in (%*) do (
if /i "%%#"=="re1" set re1=1 if /i "%%#"=="re1" set re1=1
if /i "%%#"=="re2" set re2=1 if /i "%%#"=="re2" set re2=1
if /i "%%#"=="-qedit" (set re1=1&set re2=1)
) )
:: Re-launch the script with x64 process if it was initiated by x86 process on x64 bit Windows :: Re-launch the script with x64 process if it was initiated by x86 process on x64 bit Windows
@ -255,6 +256,17 @@ call :dk_color2 %Blue% "Check this webpage for help - " %_Yellow% " %mas%in-plac
goto dk_done goto dk_done
) )
REM check for Mal-ware that may cause issues with Powershell
for /r "%ProgramFiles%\" %%f in (secureboot.exe) do if exist "%%f" (
echo "%%f"
echo Mal%blank%ware found, PowerShell is not working properly.
echo:
set fixes=%fixes% %mas%remove_mal%w%ware
call :dk_color2 %Blue% "Check this webpage for help - " %_Yellow% " %mas%remove_mal%w%ware"
goto dk_done
)
REM check if .NET is working properly REM check if .NET is working properly
if /i "!tstresult2!"=="FullLanguage" ( if /i "!tstresult2!"=="FullLanguage" (
@ -268,17 +280,6 @@ goto dk_done
) )
) )
REM check for Mal-ware that may cause issues with Powershell
for /r "%ProgramFiles%\" %%f in (secureboot.exe) do if exist "%%f" (
echo "%%f"
echo Mal%blank%ware found, PowerShell is not working properly.
echo:
set fixes=%fixes% %mas%remove_mal%w%ware
call :dk_color2 %Blue% "Check this webpage for help - " %_Yellow% " %mas%remove_mal%w%ware"
goto dk_done
)
REM check antivirus and other errors REM check antivirus and other errors
echo PowerShell is not working properly. Aborting... echo PowerShell is not working properly. Aborting...
@ -974,7 +975,9 @@ call :dk_color %Red% "Checking Ticket Migration [Failed]"
if not defined altapplist if not defined showfix if defined rebuildinfo ( if not defined altapplist if not defined showfix if defined rebuildinfo (
set showfix=1 set showfix=1
echo:
call :dk_color %Blue% "%_fixmsg%" call :dk_color %Blue% "%_fixmsg%"
echo:
) )
if exist "%tdir%\Genuine*" del /f /q "%tdir%\Genuine*" %nul% if exist "%tdir%\Genuine*" del /f /q "%tdir%\Genuine*" %nul%
@ -1044,8 +1047,10 @@ licensing.mp.microsoft.com
findstr /i "%%#" "%SysPath%\drivers\etc\hosts" %nul1% && set "hosfail= [%%# Blocked in Hosts]" findstr /i "%%#" "%SysPath%\drivers\etc\hosts" %nul1% && set "hosfail= [%%# Blocked in Hosts]"
) )
call :dk_color %Red% "Checking Licensing Servers [Failed to Connect]!hosfail!" call :dk_color %Red% "Checking Licensing Servers [Failed to Connect]!hosfail!"
echo:
set fixes=%fixes% %mas%licensing-servers-issue set fixes=%fixes% %mas%licensing-servers-issue
call :dk_color2 %Blue% "Check this webpage for help - " %_Yellow% " %mas%licensing-servers-issue" call :dk_color2 %Blue% "Check this webpage for help - " %_Yellow% " %mas%licensing-servers-issue"
echo:
) )
::========================================================================================================================================== ::==========================================================================================================================================
@ -1058,13 +1063,17 @@ reg query "HKLM\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate" /v DisableWin
reg query "HKLM\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate" /v DoNotConnectToWindowsUpdateInternetLocations %nul2% | find /i "0x1" %nul% && set wublock=1 reg query "HKLM\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate" /v DoNotConnectToWindowsUpdateInternetLocations %nul2% | find /i "0x1" %nul% && set wublock=1
if defined wublock ( if defined wublock (
call :dk_color %Red% "Checking Update Blocker In Registry [Found]" call :dk_color %Red% "Checking Update Blocker In Registry [Found]"
echo:
call :dk_color %Blue% "HWID activation needs working Windows updates, if you have used any tool to block updates, undo it." call :dk_color %Blue% "HWID activation needs working Windows updates, if you have used any tool to block updates, undo it."
echo:
) )
reg query "HKLM\SOFTWARE\Policies\Microsoft\WindowsStore" /v DisableStoreApps %nul2% | find /i "0x1" %nul% && ( reg query "HKLM\SOFTWARE\Policies\Microsoft\WindowsStore" /v DisableStoreApps %nul2% | find /i "0x1" %nul% && (
set storeblock=1 set storeblock=1
call :dk_color %Red% "Checking Store Blocker In Registry [Found]" call :dk_color %Red% "Checking Store Blocker In Registry [Found]"
echo:
call :dk_color %Blue% "If you have used any tool to block Store, undo it." call :dk_color %Blue% "If you have used any tool to block Store, undo it."
echo:
) )
set wcount=0 set wcount=0
@ -1081,10 +1090,14 @@ set error=1
call :dk_color %Red% "Checking Windows Update Registry [Corruption Found]" call :dk_color %Red% "Checking Windows Update Registry [Corruption Found]"
if !wcount! GTR 2 ( if !wcount! GTR 2 (
call :dk_color %Red% "Windows seems to be infected with Mal%w%ware." call :dk_color %Red% "Windows seems to be infected with Mal%w%ware."
echo:
set fixes=%fixes% %mas%remove_mal%w%ware set fixes=%fixes% %mas%remove_mal%w%ware
call :dk_color2 %Blue% "Check this webpage for help - " %_Yellow% " %mas%remove_mal%w%ware" call :dk_color2 %Blue% "Check this webpage for help - " %_Yellow% " %mas%remove_mal%w%ware"
echo:
) else ( ) else (
echo:
call :dk_color %Blue% "HWID activation needs working Windows updates, if you have used any tool to block updates, undo it." call :dk_color %Blue% "HWID activation needs working Windows updates, if you have used any tool to block updates, undo it."
echo:
) )
) else ( ) else (
%psc% "Start-Job { Start-Service wuauserv } | Wait-Job -Timeout 20 | Out-Null" %psc% "Start-Job { Start-Service wuauserv } | Wait-Job -Timeout 20 | Out-Null"
@ -1093,7 +1106,9 @@ set error=1
set wuerror=1 set wuerror=1
sc start wuauserv %nul% sc start wuauserv %nul%
call :dk_color %Red% "Starting Windows Update Service [Failed] [!errorlevel!]" call :dk_color %Red% "Starting Windows Update Service [Failed] [!errorlevel!]"
echo:
call :dk_color %Blue% "HWID activation needs working Windows updates, if you have used any tool to block updates, undo it." call :dk_color %Blue% "HWID activation needs working Windows updates, if you have used any tool to block updates, undo it."
echo:
) )
) )
) )
@ -1106,8 +1121,10 @@ if %keyerror% EQU 0 if not defined _perm if defined _int (
if not defined wucorrupt if not defined wublock if not defined wuerror if not defined storeblock if not defined resfail ( if not defined wucorrupt if not defined wublock if not defined wuerror if not defined storeblock if not defined resfail (
echo "%error_code%" | findstr /i "0x80072e 0x80072f 0x800704cf 0x87e10bcf 0x800705b4" %nul% && ( echo "%error_code%" | findstr /i "0x80072e 0x80072f 0x800704cf 0x87e10bcf 0x800705b4" %nul% && (
call :dk_color %Red% "Checking Internet Issues [Found] %error_code%" call :dk_color %Red% "Checking Internet Issues [Found] %error_code%"
echo:
set fixes=%fixes% %mas%licensing-servers-issue set fixes=%fixes% %mas%licensing-servers-issue
call :dk_color2 %Blue% "Check this webpage for help - " %_Yellow% " %mas%licensing-servers-issue" call :dk_color2 %Blue% "Check this webpage for help - " %_Yellow% " %mas%licensing-servers-issue"
echo:
) )
) )
) )
@ -1162,7 +1179,7 @@ goto :dk_done
set ps=%SysPath%\WindowsPowerShell\v1.0\powershell.exe set ps=%SysPath%\WindowsPowerShell\v1.0\powershell.exe
set psc=%ps% -nop -c set psc=%ps% -nop -c
set winbuild=1 set winbuild=1
for /f "tokens=6 delims=[]. " %%G in ('ver') do set winbuild=%%G for /f "tokens=2 delims=[]" %%G in ('ver') do for /f "tokens=2,3,4 delims=. " %%H in ("%%~G") do set "winbuild=%%J"
set _slexe=sppsvc.exe& set _slser=sppsvc set _slexe=sppsvc.exe& set _slser=sppsvc
if %winbuild% LEQ 6300 (set _slexe=SLsvc.exe& set _slser=SLsvc) if %winbuild% LEQ 6300 (set _slexe=SLsvc.exe& set _slser=SLsvc)
@ -1314,9 +1331,11 @@ if %sps%==SoftwareLicensingService call :dk_refresh
echo %keyecho% %~1 [Successful] echo %keyecho% %~1 [Successful]
) else ( ) else (
call :dk_color %Red% "%keyecho% %~1 [Failed] %keyerror%" call :dk_color %Red% "%keyecho% %~1 [Failed] %keyerror%"
if not defined error ( if not defined showfix (
if defined altapplist call :dk_color %Red% "Activation ID not found for this key." if defined altapplist call :dk_color %Red% "Activation ID not found for this key."
echo:
call :dk_color %Blue% "%_fixmsg%" call :dk_color %Blue% "%_fixmsg%"
echo:
set showfix=1 set showfix=1
) )
set error=1 set error=1
@ -1533,6 +1552,7 @@ 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..." if defined results call :dk_color %Red% "Checking Probable Mal%w%ware Infection..."
if defined results (call :dk_color %Red% "%results%"&set showfix=1) if defined results (call :dk_color %Red% "%results%"&set showfix=1)
echo:
set fixes=%fixes% %mas%remove_mal%w%ware set fixes=%fixes% %mas%remove_mal%w%ware
call :dk_color2 %Blue% "Check this webpage for help - " %_Yellow% " %mas%remove_mal%w%ware" call :dk_color2 %Blue% "Check this webpage for help - " %_Yellow% " %mas%remove_mal%w%ware"
echo: echo:
@ -1639,7 +1659,7 @@ sc start %%# %nul%
if !errorlevel! EQU 1060 set _corrupt=1 if !errorlevel! EQU 1060 set _corrupt=1
sc query %%# %nul% || set _corrupt=1 sc query %%# %nul% || set _corrupt=1
for %%G in (DependOnService Description DisplayName ErrorControl ImagePath ObjectName Start Type) do if not defined _regcorr ( for %%G in (DependOnService Description DisplayName ErrorControl ImagePath ObjectName Start Type) do if not defined _regcorr (
reg query HKLM\SYSTEM\CurrentControlSet\Services\%%# /v %%G %nul% || (set _corrupt=1&set _regcorr="-RegistryError" ) reg query HKLM\SYSTEM\CurrentControlSet\Services\%%# /v %%G %nul% || (set _corrupt=1&set _regcorr=-RegistryError)
) )
if defined _corrupt (if defined serv_cor (set "serv_cor=!serv_cor! %%#!_regcorr!") else (set "serv_cor=%%#!_regcorr!")) if defined _corrupt (if defined serv_cor (set "serv_cor=!serv_cor! %%#!_regcorr!") else (set "serv_cor=%%#!_regcorr!"))
@ -1965,7 +1985,7 @@ cmd /c exit /b %error_code%
if %error_code% NEQ 0 set "error_code=0x%=ExitCode%" if %error_code% NEQ 0 set "error_code=0x%=ExitCode%"
if %error_code% NEQ 0 ( if %error_code% NEQ 0 (
call :dk_color %Red% "Checking SoftwareLicensingService [Not Working] %error_code%" call :dk_color %Red% "Checking SoftwareLicensingService [Not Working] [%error_code%]"
if not defined showfix ( if not defined showfix (
echo: echo:
call :dk_color %Blue% "%_fixmsg%" call :dk_color %Blue% "%_fixmsg%"
@ -1984,6 +2004,7 @@ call :dk_actid 55c92734-d682-4d71-983e-d6ec3f16059f
if not defined apps ( if not defined apps (
%psc% "if (-not $env:_vis) {Start-Job { Stop-Service %_slser% -force } | Wait-Job -Timeout 20 | Out-Null}; $sls = Get-WmiObject SoftwareLicensingService; $f=[System.IO.File]::ReadAllText('!_batp!') -split ':xrm\:.*';. ([scriptblock]::Create($f[1])); ReinstallLicenses" %nul% %psc% "if (-not $env:_vis) {Start-Job { Stop-Service %_slser% -force } | Wait-Job -Timeout 20 | Out-Null}; $sls = Get-WmiObject SoftwareLicensingService; $f=[System.IO.File]::ReadAllText('!_batp!') -split ':xrm\:.*';. ([scriptblock]::Create($f[1])); ReinstallLicenses" %nul%
if not defined _vis if !errorlevel! NEQ 0 set rlicfailed=1
call :dk_actid 55c92734-d682-4d71-983e-d6ec3f16059f call :dk_actid 55c92734-d682-4d71-983e-d6ec3f16059f
) )
@ -2005,6 +2026,13 @@ set error=1
set showfix=1 set showfix=1
) )
if not defined showfix if defined rlicfailed (
echo:
call :dk_color %Blue% "%_fixmsg%"
call :dk_color %Blue% "If activation still fails then run Fix WPA Registry option."
echo:
)
if %winbuild% GEQ 7600 if exist "%tokenstore%\" if not exist "%tokenstore%\tokens.dat" ( if %winbuild% GEQ 7600 if exist "%tokenstore%\" if not exist "%tokenstore%\tokens.dat" (
call :dk_color %Red% "Checking SPP tokens.dat [Not Found] [%tokenstore%\]" call :dk_color %Red% "Checking SPP tokens.dat [Not Found] [%tokenstore%\]"
) )
@ -2777,7 +2805,7 @@ if defined ohub call :dk_color %Gray% "Office apps such as Word, Excel are activ
echo Help: %mas%troubleshoot echo Help: %mas%troubleshoot
) else ( ) else (
call :dk_color %Red% "Some errors were detected." call :dk_color %Red% "Some errors were detected."
if not defined ierror if not defined showfix if not defined serv_cor if not defined serv_cste call :dk_color %Blue% "%_fixmsg%" if not defined ierror if not defined showfix call :dk_color %Blue% "%_fixmsg%"
echo: echo:
set fixes=%fixes% %mas%troubleshoot set fixes=%fixes% %mas%troubleshoot
call :dk_color2 %Blue% "Check this webpage for help - " %_Yellow% " %mas%troubleshoot" call :dk_color2 %Blue% "Check this webpage for help - " %_Yellow% " %mas%troubleshoot"
@ -3482,10 +3510,12 @@ call :dk_color %Gray% "Checking Total User Accounts [%counter%]"
:: Clear the vNext/shared/device license blocks which may prevent ohook activation :: Clear the vNext/shared/device license blocks which may prevent ohook activation
set vnextexist=
rmdir /s /q "%ProgramData%\Microsoft\Office\Licenses\" %nul% rmdir /s /q "%ProgramData%\Microsoft\Office\Licenses\" %nul%
for %%x in (15 16) do ( for %%x in (15 16) do (
for %%# in (%_sidlist%) do ( for %%# in (%_sidlist%) do (
reg query HKU\%%#\Software\Microsoft\Office\%%x.0\Common\Licensing /s %nul2% | findstr /i "CIDToLicenseIdsMapping LicenseIdToEmailMapping @" %nul% && set vnextexist=1
reg delete HKU\%%#\Software\Microsoft\Office\%%x.0\Common\Licensing /f %nul% reg delete HKU\%%#\Software\Microsoft\Office\%%x.0\Common\Licensing /f %nul%
for /f "skip=2 tokens=2*" %%a in ('"reg query "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\ProfileList\%%#" /v ProfileImagePath" %nul6%') do ( for /f "skip=2 tokens=2*" %%a in ('"reg query "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\ProfileList\%%#" /v ProfileImagePath" %nul6%') do (
@ -3508,6 +3538,7 @@ rmdir /s /q "%%b\AppData\Local\Packages\Microsoft.Office.Desktop_8wekyb3d8bbwe\L
if exist "%%b\AppData\Local\Packages\Microsoft.Office.Desktop_8wekyb3d8bbwe\SystemAppData\Helium\User.dat" ( if exist "%%b\AppData\Local\Packages\Microsoft.Office.Desktop_8wekyb3d8bbwe\SystemAppData\Helium\User.dat" (
set defname=DEFTEMP-%%# set defname=DEFTEMP-%%#
reg load HKU\!defname! "%%b\AppData\Local\Packages\Microsoft.Office.Desktop_8wekyb3d8bbwe\SystemAppData\Helium\User.dat" %nul% reg load HKU\!defname! "%%b\AppData\Local\Packages\Microsoft.Office.Desktop_8wekyb3d8bbwe\SystemAppData\Helium\User.dat" %nul%
reg query HKU\!defname!\Software\Microsoft\Office\16.0\Common\Licensing /s %nul2% | findstr /i "CIDToLicenseIdsMapping LicenseIdToEmailMapping @" %nul% && set vnextexist=1
reg delete HKU\!defname!\Software\Microsoft\Office\16.0\Common\Licensing /f %nul% reg delete HKU\!defname!\Software\Microsoft\Office\16.0\Common\Licensing /f %nul%
reg unload HKU\!defname! %nul% reg unload HKU\!defname! %nul%
) )
@ -3515,6 +3546,15 @@ reg unload HKU\!defname! %nul%
) )
) )
if defined vnextexist (
echo:
call :dk_color %Gray% "Office vNext subscription detected:"
call :dk_color %Blue% "If active, this license overrides other activation methods."
call :dk_color %Blue% "If expiring soon, rerun the script after expiration."
call :dk_color2 %Blue% "If expired and script activation fails, get help - " %_Yellow% " %mas%troubleshoot"
echo:
)
:: Clear SharedComputerLicensing for office :: Clear SharedComputerLicensing for office
:: https://learn.microsoft.com/en-us/deployoffice/overview-shared-computer-activation :: https://learn.microsoft.com/en-us/deployoffice/overview-shared-computer-activation
@ -3609,7 +3649,15 @@ set upk_result=2
if defined ohookact if not %upk_result%==0 echo: if defined ohookact if not %upk_result%==0 echo:
if %upk_result%==1 echo Uninstalling Other/Grace Keys [Successful] if %upk_result%==1 echo Uninstalling Other/Grace Keys [Successful]
if %upk_result%==2 call :dk_color %Red% "Uninstalling Other/Grace Keys [Failed]" if %upk_result%==2 (
call :dk_color %Red% "Uninstalling Other/Grace Keys [Failed]"
if not defined showfix (
echo:
call :dk_color %Blue% "%_fixmsg%"
echo:
set showfix=1
)
)
exit /b exit /b
::======================================================================================================================================== ::========================================================================================================================================
@ -5750,6 +5798,7 @@ call :dk_color %Gray% "To activate, check your internet connection and ensure th
) else ( ) else (
call :dk_color %Blue% "This Windows version is known to not activate due to MS Windows/Server issues." call :dk_color %Blue% "This Windows version is known to not activate due to MS Windows/Server issues."
) )
if not defined showfix call :dk_color %Blue% "%_fixmsg%"
set fixes=%fixes% %mas%troubleshoot set fixes=%fixes% %mas%troubleshoot
call :dk_color2 %Blue% "Check this webpage for help - " %_Yellow% " %mas%troubleshoot" call :dk_color2 %Blue% "Check this webpage for help - " %_Yellow% " %mas%troubleshoot"
) )
@ -5766,7 +5815,7 @@ if /i %tsmethod%==StaticCID (echo Depositing Static Confirmation ID...) else (ec
echo: echo:
%psc% "$f=[System.IO.File]::ReadAllText('!_batp!') -split ':tsforge\:.*';. ([scriptblock]::Create($f[1])) %tsids%" %psc% "$f=[System.IO.File]::ReadAllText('!_batp!') -split ':tsforge\:.*';. ([scriptblock]::Create($f[1])) %tsids%"
if !errorlevel!==3 ( if !errorlevel!==3 (
if %_actman%==0 (if not defined error call :dk_color %Blue% "%_fixmsg%") if %_actman%==0 (if not defined showfix call :dk_color %Blue% "%_fixmsg%")
set fixes=%fixes% %mas%troubleshoot set fixes=%fixes% %mas%troubleshoot
call :dk_color2 %Blue% "Check this webpage for help - " %_Yellow% " %mas%troubleshoot" call :dk_color2 %Blue% "Check this webpage for help - " %_Yellow% " %mas%troubleshoot"
) else ( ) else (
@ -11167,6 +11216,7 @@ else {
if ($env:_debug -eq '0') { if ($env:_debug -eq '0') {
[LibTSforge.Logger]::HideOutput = $true [LibTSforge.Logger]::HideOutput = $true
} }
[void][LibTSforge.Utils]::Wow64EnableWow64FsRedirection($false)
$ver = [LibTSforge.Utils]::DetectVersion() $ver = [LibTSforge.Utils]::DetectVersion()
$prod = [LibTSforge.SPP.SPPUtils]::DetectCurrentKey() $prod = [LibTSforge.SPP.SPPUtils]::DetectCurrentKey()
$tsactids = @($args) $tsactids = @($args)
@ -12260,9 +12310,9 @@ set k_error=
%nul% reg add "HKLM\%specific_kms%\%app%" /f /v KeyManagementServicePort /t REG_SZ /d "1688" || set k_error=1 %nul% reg add "HKLM\%specific_kms%\%app%" /f /v KeyManagementServicePort /t REG_SZ /d "1688" || set k_error=1
if not defined k_error ( if not defined k_error (
echo Adding Specific KMS Host [LocalHost 127.0.0.2] [Successful] echo Adding Specific KMS Host [LocalHost] [Successful]
) else ( ) else (
call :dk_color %Red% "Adding Specific KMS Host [LocalHost 127.0.0.2] [Failed]" call :dk_color %Red% "Adding Specific KMS Host [LocalHost] [Failed]"
) )
::======================================================================================================================================== ::========================================================================================================================================
@ -12358,7 +12408,9 @@ call :dk_color %Red% "Checking Ticket Migration [Failed]"
if not defined showfix if defined rebuildinfo ( if not defined showfix if defined rebuildinfo (
set showfix=1 set showfix=1
echo:
call :dk_color %Blue% "%_fixmsg%" call :dk_color %Blue% "%_fixmsg%"
echo:
) )
if exist "%tdir%\Genuine*" del /f /q "%tdir%\Genuine*" %nul% if exist "%tdir%\Genuine*" del /f /q "%tdir%\Genuine*" %nul%
@ -13585,6 +13637,9 @@ call :ks_clearstuff
set error_=9 set error_=9
echo Failed to completely clear %KS% Cache. echo Failed to completely clear %KS% Cache.
reg query "HKLM\%SPPk%\%_wApp%" /s %nul2% | findstr /i "127.0.0.2" %nul1% && echo KMS38 activation is locked. reg query "HKLM\%SPPk%\%_wApp%" /s %nul2% | findstr /i "127.0.0.2" %nul1% && echo KMS38 activation is locked.
echo:
call :dk_color %Blue% "%_fixmsg%"
echo:
) || ( ) || (
echo Cleared %KS% Cache successfully. echo Cleared %KS% Cache successfully.
) )
@ -13600,6 +13655,10 @@ echo %uline%
echo %uline% echo %uline%
echo: echo:
call :dk_color %Green% "Online %KS% has been successfully uninstalled." call :dk_color %Green% "Online %KS% has been successfully uninstalled."
echo:
call :dk_color %Gray% "If you want to reset the activation status,"
call :dk_color %Blue% "%_fixmsg%"
echo:
echo %uline% echo %uline%
) )
@ -13697,7 +13756,7 @@ set "PSModulePath=%ProgramFiles%\WindowsPowerShell\Modules;%SysPath%\WindowsPowe
set _tserror= set _tserror=
set winbuild=1 set winbuild=1
set "nul=>nul 2>&1" set "nul=>nul 2>&1"
for /f "tokens=6 delims=[]. " %%G in ('ver') do set winbuild=%%G for /f "tokens=2 delims=[]" %%G in ('ver') do for /f "tokens=2,3,4 delims=. " %%H in ("%%~G") do set "winbuild=%%J"
set psc=powershell.exe -nop -c set psc=powershell.exe -nop -c
set _slexe=sppsvc.exe& set _slser=sppsvc set _slexe=sppsvc.exe& set _slser=sppsvc

View File

@ -1,4 +1,4 @@
@set masver=3.4 @set masver=3.5
@echo off @echo off
@ -50,6 +50,7 @@ set "_cmdf=%~f0"
for %%# in (%*) do ( for %%# in (%*) do (
if /i "%%#"=="re1" set re1=1 if /i "%%#"=="re1" set re1=1
if /i "%%#"=="re2" set re2=1 if /i "%%#"=="re2" set re2=1
if /i "%%#"=="-qedit" (set re1=1&set re2=1)
) )
:: Re-launch the script with x64 process if it was initiated by x86 process on x64 bit Windows :: Re-launch the script with x64 process if it was initiated by x86 process on x64 bit Windows
@ -277,6 +278,17 @@ call :dk_color2 %Blue% "Check this webpage for help - " %_Yellow% " %mas%in-plac
goto dk_done goto dk_done
) )
REM check for Mal-ware that may cause issues with Powershell
for /r "%ProgramFiles%\" %%f in (secureboot.exe) do if exist "%%f" (
echo "%%f"
echo Mal%blank%ware found, PowerShell is not working properly.
echo:
set fixes=%fixes% %mas%remove_mal%w%ware
call :dk_color2 %Blue% "Check this webpage for help - " %_Yellow% " %mas%remove_mal%w%ware"
goto dk_done
)
REM check if .NET is working properly REM check if .NET is working properly
if /i "!tstresult2!"=="FullLanguage" ( if /i "!tstresult2!"=="FullLanguage" (
@ -290,17 +302,6 @@ goto dk_done
) )
) )
REM check for Mal-ware that may cause issues with Powershell
for /r "%ProgramFiles%\" %%f in (secureboot.exe) do if exist "%%f" (
echo "%%f"
echo Mal%blank%ware found, PowerShell is not working properly.
echo:
set fixes=%fixes% %mas%remove_mal%w%ware
call :dk_color2 %Blue% "Check this webpage for help - " %_Yellow% " %mas%remove_mal%w%ware"
goto dk_done
)
REM check antivirus and other errors REM check antivirus and other errors
echo PowerShell is not working properly. Aborting... echo PowerShell is not working properly. Aborting...
@ -674,7 +675,9 @@ call :dk_color %Red% "Checking Ticket Migration [Failed]"
if not defined altapplist if not defined showfix if defined rebuildinfo ( if not defined altapplist if not defined showfix if defined rebuildinfo (
set showfix=1 set showfix=1
echo:
call :dk_color %Blue% "%_fixmsg%" call :dk_color %Blue% "%_fixmsg%"
echo:
) )
if exist "%tdir%\Genuine*" del /f /q "%tdir%\Genuine*" %nul% if exist "%tdir%\Genuine*" del /f /q "%tdir%\Genuine*" %nul%
@ -744,8 +747,10 @@ licensing.mp.microsoft.com
findstr /i "%%#" "%SysPath%\drivers\etc\hosts" %nul1% && set "hosfail= [%%# Blocked in Hosts]" findstr /i "%%#" "%SysPath%\drivers\etc\hosts" %nul1% && set "hosfail= [%%# Blocked in Hosts]"
) )
call :dk_color %Red% "Checking Licensing Servers [Failed to Connect]!hosfail!" call :dk_color %Red% "Checking Licensing Servers [Failed to Connect]!hosfail!"
echo:
set fixes=%fixes% %mas%licensing-servers-issue set fixes=%fixes% %mas%licensing-servers-issue
call :dk_color2 %Blue% "Check this webpage for help - " %_Yellow% " %mas%licensing-servers-issue" call :dk_color2 %Blue% "Check this webpage for help - " %_Yellow% " %mas%licensing-servers-issue"
echo:
) )
::========================================================================================================================================== ::==========================================================================================================================================
@ -758,13 +763,17 @@ reg query "HKLM\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate" /v DisableWin
reg query "HKLM\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate" /v DoNotConnectToWindowsUpdateInternetLocations %nul2% | find /i "0x1" %nul% && set wublock=1 reg query "HKLM\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate" /v DoNotConnectToWindowsUpdateInternetLocations %nul2% | find /i "0x1" %nul% && set wublock=1
if defined wublock ( if defined wublock (
call :dk_color %Red% "Checking Update Blocker In Registry [Found]" call :dk_color %Red% "Checking Update Blocker In Registry [Found]"
echo:
call :dk_color %Blue% "HWID activation needs working Windows updates, if you have used any tool to block updates, undo it." call :dk_color %Blue% "HWID activation needs working Windows updates, if you have used any tool to block updates, undo it."
echo:
) )
reg query "HKLM\SOFTWARE\Policies\Microsoft\WindowsStore" /v DisableStoreApps %nul2% | find /i "0x1" %nul% && ( reg query "HKLM\SOFTWARE\Policies\Microsoft\WindowsStore" /v DisableStoreApps %nul2% | find /i "0x1" %nul% && (
set storeblock=1 set storeblock=1
call :dk_color %Red% "Checking Store Blocker In Registry [Found]" call :dk_color %Red% "Checking Store Blocker In Registry [Found]"
echo:
call :dk_color %Blue% "If you have used any tool to block Store, undo it." call :dk_color %Blue% "If you have used any tool to block Store, undo it."
echo:
) )
set wcount=0 set wcount=0
@ -781,10 +790,14 @@ set error=1
call :dk_color %Red% "Checking Windows Update Registry [Corruption Found]" call :dk_color %Red% "Checking Windows Update Registry [Corruption Found]"
if !wcount! GTR 2 ( if !wcount! GTR 2 (
call :dk_color %Red% "Windows seems to be infected with Mal%w%ware." call :dk_color %Red% "Windows seems to be infected with Mal%w%ware."
echo:
set fixes=%fixes% %mas%remove_mal%w%ware set fixes=%fixes% %mas%remove_mal%w%ware
call :dk_color2 %Blue% "Check this webpage for help - " %_Yellow% " %mas%remove_mal%w%ware" call :dk_color2 %Blue% "Check this webpage for help - " %_Yellow% " %mas%remove_mal%w%ware"
echo:
) else ( ) else (
echo:
call :dk_color %Blue% "HWID activation needs working Windows updates, if you have used any tool to block updates, undo it." call :dk_color %Blue% "HWID activation needs working Windows updates, if you have used any tool to block updates, undo it."
echo:
) )
) else ( ) else (
%psc% "Start-Job { Start-Service wuauserv } | Wait-Job -Timeout 20 | Out-Null" %psc% "Start-Job { Start-Service wuauserv } | Wait-Job -Timeout 20 | Out-Null"
@ -793,7 +806,9 @@ set error=1
set wuerror=1 set wuerror=1
sc start wuauserv %nul% sc start wuauserv %nul%
call :dk_color %Red% "Starting Windows Update Service [Failed] [!errorlevel!]" call :dk_color %Red% "Starting Windows Update Service [Failed] [!errorlevel!]"
echo:
call :dk_color %Blue% "HWID activation needs working Windows updates, if you have used any tool to block updates, undo it." call :dk_color %Blue% "HWID activation needs working Windows updates, if you have used any tool to block updates, undo it."
echo:
) )
) )
) )
@ -806,8 +821,10 @@ if %keyerror% EQU 0 if not defined _perm if defined _int (
if not defined wucorrupt if not defined wublock if not defined wuerror if not defined storeblock if not defined resfail ( if not defined wucorrupt if not defined wublock if not defined wuerror if not defined storeblock if not defined resfail (
echo "%error_code%" | findstr /i "0x80072e 0x80072f 0x800704cf 0x87e10bcf 0x800705b4" %nul% && ( echo "%error_code%" | findstr /i "0x80072e 0x80072f 0x800704cf 0x87e10bcf 0x800705b4" %nul% && (
call :dk_color %Red% "Checking Internet Issues [Found] %error_code%" call :dk_color %Red% "Checking Internet Issues [Found] %error_code%"
echo:
set fixes=%fixes% %mas%licensing-servers-issue set fixes=%fixes% %mas%licensing-servers-issue
call :dk_color2 %Blue% "Check this webpage for help - " %_Yellow% " %mas%licensing-servers-issue" call :dk_color2 %Blue% "Check this webpage for help - " %_Yellow% " %mas%licensing-servers-issue"
echo:
) )
) )
) )
@ -862,7 +879,7 @@ goto :dk_done
set ps=%SysPath%\WindowsPowerShell\v1.0\powershell.exe set ps=%SysPath%\WindowsPowerShell\v1.0\powershell.exe
set psc=%ps% -nop -c set psc=%ps% -nop -c
set winbuild=1 set winbuild=1
for /f "tokens=6 delims=[]. " %%G in ('ver') do set winbuild=%%G for /f "tokens=2 delims=[]" %%G in ('ver') do for /f "tokens=2,3,4 delims=. " %%H in ("%%~G") do set "winbuild=%%J"
set _slexe=sppsvc.exe& set _slser=sppsvc set _slexe=sppsvc.exe& set _slser=sppsvc
if %winbuild% LEQ 6300 (set _slexe=SLsvc.exe& set _slser=SLsvc) if %winbuild% LEQ 6300 (set _slexe=SLsvc.exe& set _slser=SLsvc)
@ -1014,9 +1031,11 @@ if %sps%==SoftwareLicensingService call :dk_refresh
echo %keyecho% %~1 [Successful] echo %keyecho% %~1 [Successful]
) else ( ) else (
call :dk_color %Red% "%keyecho% %~1 [Failed] %keyerror%" call :dk_color %Red% "%keyecho% %~1 [Failed] %keyerror%"
if not defined error ( if not defined showfix (
if defined altapplist call :dk_color %Red% "Activation ID not found for this key." if defined altapplist call :dk_color %Red% "Activation ID not found for this key."
echo:
call :dk_color %Blue% "%_fixmsg%" call :dk_color %Blue% "%_fixmsg%"
echo:
set showfix=1 set showfix=1
) )
set error=1 set error=1
@ -1217,6 +1236,7 @@ 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..." if defined results call :dk_color %Red% "Checking Probable Mal%w%ware Infection..."
if defined results (call :dk_color %Red% "%results%"&set showfix=1) if defined results (call :dk_color %Red% "%results%"&set showfix=1)
echo:
set fixes=%fixes% %mas%remove_mal%w%ware set fixes=%fixes% %mas%remove_mal%w%ware
call :dk_color2 %Blue% "Check this webpage for help - " %_Yellow% " %mas%remove_mal%w%ware" call :dk_color2 %Blue% "Check this webpage for help - " %_Yellow% " %mas%remove_mal%w%ware"
echo: echo:
@ -1323,7 +1343,7 @@ sc start %%# %nul%
if !errorlevel! EQU 1060 set _corrupt=1 if !errorlevel! EQU 1060 set _corrupt=1
sc query %%# %nul% || set _corrupt=1 sc query %%# %nul% || set _corrupt=1
for %%G in (DependOnService Description DisplayName ErrorControl ImagePath ObjectName Start Type) do if not defined _regcorr ( for %%G in (DependOnService Description DisplayName ErrorControl ImagePath ObjectName Start Type) do if not defined _regcorr (
reg query HKLM\SYSTEM\CurrentControlSet\Services\%%# /v %%G %nul% || (set _corrupt=1&set _regcorr="-RegistryError" ) reg query HKLM\SYSTEM\CurrentControlSet\Services\%%# /v %%G %nul% || (set _corrupt=1&set _regcorr=-RegistryError)
) )
if defined _corrupt (if defined serv_cor (set "serv_cor=!serv_cor! %%#!_regcorr!") else (set "serv_cor=%%#!_regcorr!")) if defined _corrupt (if defined serv_cor (set "serv_cor=!serv_cor! %%#!_regcorr!") else (set "serv_cor=%%#!_regcorr!"))
@ -1649,7 +1669,7 @@ cmd /c exit /b %error_code%
if %error_code% NEQ 0 set "error_code=0x%=ExitCode%" if %error_code% NEQ 0 set "error_code=0x%=ExitCode%"
if %error_code% NEQ 0 ( if %error_code% NEQ 0 (
call :dk_color %Red% "Checking SoftwareLicensingService [Not Working] %error_code%" call :dk_color %Red% "Checking SoftwareLicensingService [Not Working] [%error_code%]"
if not defined showfix ( if not defined showfix (
echo: echo:
call :dk_color %Blue% "%_fixmsg%" call :dk_color %Blue% "%_fixmsg%"
@ -1668,6 +1688,7 @@ call :dk_actid 55c92734-d682-4d71-983e-d6ec3f16059f
if not defined apps ( if not defined apps (
%psc% "if (-not $env:_vis) {Start-Job { Stop-Service %_slser% -force } | Wait-Job -Timeout 20 | Out-Null}; $sls = Get-WmiObject SoftwareLicensingService; $f=[System.IO.File]::ReadAllText('!_batp!') -split ':xrm\:.*';. ([scriptblock]::Create($f[1])); ReinstallLicenses" %nul% %psc% "if (-not $env:_vis) {Start-Job { Stop-Service %_slser% -force } | Wait-Job -Timeout 20 | Out-Null}; $sls = Get-WmiObject SoftwareLicensingService; $f=[System.IO.File]::ReadAllText('!_batp!') -split ':xrm\:.*';. ([scriptblock]::Create($f[1])); ReinstallLicenses" %nul%
if not defined _vis if !errorlevel! NEQ 0 set rlicfailed=1
call :dk_actid 55c92734-d682-4d71-983e-d6ec3f16059f call :dk_actid 55c92734-d682-4d71-983e-d6ec3f16059f
) )
@ -1689,6 +1710,13 @@ set error=1
set showfix=1 set showfix=1
) )
if not defined showfix if defined rlicfailed (
echo:
call :dk_color %Blue% "%_fixmsg%"
call :dk_color %Blue% "If activation still fails then run Fix WPA Registry option."
echo:
)
if %winbuild% GEQ 7600 if exist "%tokenstore%\" if not exist "%tokenstore%\tokens.dat" ( if %winbuild% GEQ 7600 if exist "%tokenstore%\" if not exist "%tokenstore%\tokens.dat" (
call :dk_color %Red% "Checking SPP tokens.dat [Not Found] [%tokenstore%\]" call :dk_color %Red% "Checking SPP tokens.dat [Not Found] [%tokenstore%\]"
) )

View File

@ -1,4 +1,4 @@
@set masver=3.4 @set masver=3.5
@echo off @echo off
@ -50,6 +50,7 @@ set "_cmdf=%~f0"
for %%# in (%*) do ( for %%# in (%*) do (
if /i "%%#"=="re1" set re1=1 if /i "%%#"=="re1" set re1=1
if /i "%%#"=="re2" set re2=1 if /i "%%#"=="re2" set re2=1
if /i "%%#"=="-qedit" (set re1=1&set re2=1)
) )
:: Re-launch the script with x64 process if it was initiated by x86 process on x64 bit Windows :: Re-launch the script with x64 process if it was initiated by x86 process on x64 bit Windows
@ -276,6 +277,17 @@ call :dk_color2 %Blue% "Check this webpage for help - " %_Yellow% " %mas%in-plac
goto dk_done goto dk_done
) )
REM check for Mal-ware that may cause issues with Powershell
for /r "%ProgramFiles%\" %%f in (secureboot.exe) do if exist "%%f" (
echo "%%f"
echo Mal%blank%ware found, PowerShell is not working properly.
echo:
set fixes=%fixes% %mas%remove_mal%w%ware
call :dk_color2 %Blue% "Check this webpage for help - " %_Yellow% " %mas%remove_mal%w%ware"
goto dk_done
)
REM check if .NET is working properly REM check if .NET is working properly
if /i "!tstresult2!"=="FullLanguage" ( if /i "!tstresult2!"=="FullLanguage" (
@ -289,17 +301,6 @@ goto dk_done
) )
) )
REM check for Mal-ware that may cause issues with Powershell
for /r "%ProgramFiles%\" %%f in (secureboot.exe) do if exist "%%f" (
echo "%%f"
echo Mal%blank%ware found, PowerShell is not working properly.
echo:
set fixes=%fixes% %mas%remove_mal%w%ware
call :dk_color2 %Blue% "Check this webpage for help - " %_Yellow% " %mas%remove_mal%w%ware"
goto dk_done
)
REM check antivirus and other errors REM check antivirus and other errors
echo PowerShell is not working properly. Aborting... echo PowerShell is not working properly. Aborting...
@ -695,9 +696,9 @@ set k_error=
%nul% reg add "HKLM\%specific_kms%\%app%" /f /v KeyManagementServicePort /t REG_SZ /d "1688" || set k_error=1 %nul% reg add "HKLM\%specific_kms%\%app%" /f /v KeyManagementServicePort /t REG_SZ /d "1688" || set k_error=1
if not defined k_error ( if not defined k_error (
echo Adding Specific KMS Host [LocalHost 127.0.0.2] [Successful] echo Adding Specific KMS Host [LocalHost] [Successful]
) else ( ) else (
call :dk_color %Red% "Adding Specific KMS Host [LocalHost 127.0.0.2] [Failed]" call :dk_color %Red% "Adding Specific KMS Host [LocalHost] [Failed]"
) )
::======================================================================================================================================== ::========================================================================================================================================
@ -793,7 +794,9 @@ call :dk_color %Red% "Checking Ticket Migration [Failed]"
if not defined showfix if defined rebuildinfo ( if not defined showfix if defined rebuildinfo (
set showfix=1 set showfix=1
echo:
call :dk_color %Blue% "%_fixmsg%" call :dk_color %Blue% "%_fixmsg%"
echo:
) )
if exist "%tdir%\Genuine*" del /f /q "%tdir%\Genuine*" %nul% if exist "%tdir%\Genuine*" del /f /q "%tdir%\Genuine*" %nul%
@ -918,7 +921,7 @@ goto :dk_done
set ps=%SysPath%\WindowsPowerShell\v1.0\powershell.exe set ps=%SysPath%\WindowsPowerShell\v1.0\powershell.exe
set psc=%ps% -nop -c set psc=%ps% -nop -c
set winbuild=1 set winbuild=1
for /f "tokens=6 delims=[]. " %%G in ('ver') do set winbuild=%%G for /f "tokens=2 delims=[]" %%G in ('ver') do for /f "tokens=2,3,4 delims=. " %%H in ("%%~G") do set "winbuild=%%J"
set _slexe=sppsvc.exe& set _slser=sppsvc set _slexe=sppsvc.exe& set _slser=sppsvc
if %winbuild% LEQ 6300 (set _slexe=SLsvc.exe& set _slser=SLsvc) if %winbuild% LEQ 6300 (set _slexe=SLsvc.exe& set _slser=SLsvc)
@ -1089,9 +1092,11 @@ if %sps%==SoftwareLicensingService call :dk_refresh
echo %keyecho% %~1 [Successful] echo %keyecho% %~1 [Successful]
) else ( ) else (
call :dk_color %Red% "%keyecho% %~1 [Failed] %keyerror%" call :dk_color %Red% "%keyecho% %~1 [Failed] %keyerror%"
if not defined error ( if not defined showfix (
if defined altapplist call :dk_color %Red% "Activation ID not found for this key." if defined altapplist call :dk_color %Red% "Activation ID not found for this key."
echo:
call :dk_color %Blue% "%_fixmsg%" call :dk_color %Blue% "%_fixmsg%"
echo:
set showfix=1 set showfix=1
) )
set error=1 set error=1
@ -1316,6 +1321,7 @@ 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..." if defined results call :dk_color %Red% "Checking Probable Mal%w%ware Infection..."
if defined results (call :dk_color %Red% "%results%"&set showfix=1) if defined results (call :dk_color %Red% "%results%"&set showfix=1)
echo:
set fixes=%fixes% %mas%remove_mal%w%ware set fixes=%fixes% %mas%remove_mal%w%ware
call :dk_color2 %Blue% "Check this webpage for help - " %_Yellow% " %mas%remove_mal%w%ware" call :dk_color2 %Blue% "Check this webpage for help - " %_Yellow% " %mas%remove_mal%w%ware"
echo: echo:
@ -1422,7 +1428,7 @@ sc start %%# %nul%
if !errorlevel! EQU 1060 set _corrupt=1 if !errorlevel! EQU 1060 set _corrupt=1
sc query %%# %nul% || set _corrupt=1 sc query %%# %nul% || set _corrupt=1
for %%G in (DependOnService Description DisplayName ErrorControl ImagePath ObjectName Start Type) do if not defined _regcorr ( for %%G in (DependOnService Description DisplayName ErrorControl ImagePath ObjectName Start Type) do if not defined _regcorr (
reg query HKLM\SYSTEM\CurrentControlSet\Services\%%# /v %%G %nul% || (set _corrupt=1&set _regcorr="-RegistryError" ) reg query HKLM\SYSTEM\CurrentControlSet\Services\%%# /v %%G %nul% || (set _corrupt=1&set _regcorr=-RegistryError)
) )
if defined _corrupt (if defined serv_cor (set "serv_cor=!serv_cor! %%#!_regcorr!") else (set "serv_cor=%%#!_regcorr!")) if defined _corrupt (if defined serv_cor (set "serv_cor=!serv_cor! %%#!_regcorr!") else (set "serv_cor=%%#!_regcorr!"))
@ -1748,7 +1754,7 @@ cmd /c exit /b %error_code%
if %error_code% NEQ 0 set "error_code=0x%=ExitCode%" if %error_code% NEQ 0 set "error_code=0x%=ExitCode%"
if %error_code% NEQ 0 ( if %error_code% NEQ 0 (
call :dk_color %Red% "Checking SoftwareLicensingService [Not Working] %error_code%" call :dk_color %Red% "Checking SoftwareLicensingService [Not Working] [%error_code%]"
if not defined showfix ( if not defined showfix (
echo: echo:
call :dk_color %Blue% "%_fixmsg%" call :dk_color %Blue% "%_fixmsg%"
@ -1767,6 +1773,7 @@ call :dk_actid 55c92734-d682-4d71-983e-d6ec3f16059f
if not defined apps ( if not defined apps (
%psc% "if (-not $env:_vis) {Start-Job { Stop-Service %_slser% -force } | Wait-Job -Timeout 20 | Out-Null}; $sls = Get-WmiObject SoftwareLicensingService; $f=[System.IO.File]::ReadAllText('!_batp!') -split ':xrm\:.*';. ([scriptblock]::Create($f[1])); ReinstallLicenses" %nul% %psc% "if (-not $env:_vis) {Start-Job { Stop-Service %_slser% -force } | Wait-Job -Timeout 20 | Out-Null}; $sls = Get-WmiObject SoftwareLicensingService; $f=[System.IO.File]::ReadAllText('!_batp!') -split ':xrm\:.*';. ([scriptblock]::Create($f[1])); ReinstallLicenses" %nul%
if not defined _vis if !errorlevel! NEQ 0 set rlicfailed=1
call :dk_actid 55c92734-d682-4d71-983e-d6ec3f16059f call :dk_actid 55c92734-d682-4d71-983e-d6ec3f16059f
) )
@ -1788,6 +1795,13 @@ set error=1
set showfix=1 set showfix=1
) )
if not defined showfix if defined rlicfailed (
echo:
call :dk_color %Blue% "%_fixmsg%"
call :dk_color %Blue% "If activation still fails then run Fix WPA Registry option."
echo:
)
if %winbuild% GEQ 7600 if exist "%tokenstore%\" if not exist "%tokenstore%\tokens.dat" ( if %winbuild% GEQ 7600 if exist "%tokenstore%\" if not exist "%tokenstore%\tokens.dat" (
call :dk_color %Red% "Checking SPP tokens.dat [Not Found] [%tokenstore%\]" call :dk_color %Red% "Checking SPP tokens.dat [Not Found] [%tokenstore%\]"
) )

View File

@ -1,4 +1,4 @@
@set masver=3.4 @set masver=3.5
@echo off @echo off
@ -50,6 +50,7 @@ set "_cmdf=%~f0"
for %%# in (%*) do ( for %%# in (%*) do (
if /i "%%#"=="re1" set re1=1 if /i "%%#"=="re1" set re1=1
if /i "%%#"=="re2" set re2=1 if /i "%%#"=="re2" set re2=1
if /i "%%#"=="-qedit" (set re1=1&set re2=1)
) )
:: Re-launch the script with x64 process if it was initiated by x86 process on x64 bit Windows :: Re-launch the script with x64 process if it was initiated by x86 process on x64 bit Windows
@ -285,6 +286,17 @@ call :dk_color2 %Blue% "Check this webpage for help - " %_Yellow% " %mas%in-plac
goto dk_done goto dk_done
) )
REM check for Mal-ware that may cause issues with Powershell
for /r "%ProgramFiles%\" %%f in (secureboot.exe) do if exist "%%f" (
echo "%%f"
echo Mal%blank%ware found, PowerShell is not working properly.
echo:
set fixes=%fixes% %mas%remove_mal%w%ware
call :dk_color2 %Blue% "Check this webpage for help - " %_Yellow% " %mas%remove_mal%w%ware"
goto dk_done
)
REM check if .NET is working properly REM check if .NET is working properly
if /i "!tstresult2!"=="FullLanguage" ( if /i "!tstresult2!"=="FullLanguage" (
@ -298,17 +310,6 @@ goto dk_done
) )
) )
REM check for Mal-ware that may cause issues with Powershell
for /r "%ProgramFiles%\" %%f in (secureboot.exe) do if exist "%%f" (
echo "%%f"
echo Mal%blank%ware found, PowerShell is not working properly.
echo:
set fixes=%fixes% %mas%remove_mal%w%ware
call :dk_color2 %Blue% "Check this webpage for help - " %_Yellow% " %mas%remove_mal%w%ware"
goto dk_done
)
REM check antivirus and other errors REM check antivirus and other errors
echo PowerShell is not working properly. Aborting... echo PowerShell is not working properly. Aborting...
@ -769,7 +770,7 @@ if defined ohub call :dk_color %Gray% "Office apps such as Word, Excel are activ
echo Help: %mas%troubleshoot echo Help: %mas%troubleshoot
) else ( ) else (
call :dk_color %Red% "Some errors were detected." call :dk_color %Red% "Some errors were detected."
if not defined ierror if not defined showfix if not defined serv_cor if not defined serv_cste call :dk_color %Blue% "%_fixmsg%" if not defined ierror if not defined showfix call :dk_color %Blue% "%_fixmsg%"
echo: echo:
set fixes=%fixes% %mas%troubleshoot set fixes=%fixes% %mas%troubleshoot
call :dk_color2 %Blue% "Check this webpage for help - " %_Yellow% " %mas%troubleshoot" call :dk_color2 %Blue% "Check this webpage for help - " %_Yellow% " %mas%troubleshoot"
@ -1474,10 +1475,12 @@ call :dk_color %Gray% "Checking Total User Accounts [%counter%]"
:: Clear the vNext/shared/device license blocks which may prevent ohook activation :: Clear the vNext/shared/device license blocks which may prevent ohook activation
set vnextexist=
rmdir /s /q "%ProgramData%\Microsoft\Office\Licenses\" %nul% rmdir /s /q "%ProgramData%\Microsoft\Office\Licenses\" %nul%
for %%x in (15 16) do ( for %%x in (15 16) do (
for %%# in (%_sidlist%) do ( for %%# in (%_sidlist%) do (
reg query HKU\%%#\Software\Microsoft\Office\%%x.0\Common\Licensing /s %nul2% | findstr /i "CIDToLicenseIdsMapping LicenseIdToEmailMapping @" %nul% && set vnextexist=1
reg delete HKU\%%#\Software\Microsoft\Office\%%x.0\Common\Licensing /f %nul% reg delete HKU\%%#\Software\Microsoft\Office\%%x.0\Common\Licensing /f %nul%
for /f "skip=2 tokens=2*" %%a in ('"reg query "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\ProfileList\%%#" /v ProfileImagePath" %nul6%') do ( for /f "skip=2 tokens=2*" %%a in ('"reg query "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\ProfileList\%%#" /v ProfileImagePath" %nul6%') do (
@ -1500,6 +1503,7 @@ rmdir /s /q "%%b\AppData\Local\Packages\Microsoft.Office.Desktop_8wekyb3d8bbwe\L
if exist "%%b\AppData\Local\Packages\Microsoft.Office.Desktop_8wekyb3d8bbwe\SystemAppData\Helium\User.dat" ( if exist "%%b\AppData\Local\Packages\Microsoft.Office.Desktop_8wekyb3d8bbwe\SystemAppData\Helium\User.dat" (
set defname=DEFTEMP-%%# set defname=DEFTEMP-%%#
reg load HKU\!defname! "%%b\AppData\Local\Packages\Microsoft.Office.Desktop_8wekyb3d8bbwe\SystemAppData\Helium\User.dat" %nul% reg load HKU\!defname! "%%b\AppData\Local\Packages\Microsoft.Office.Desktop_8wekyb3d8bbwe\SystemAppData\Helium\User.dat" %nul%
reg query HKU\!defname!\Software\Microsoft\Office\16.0\Common\Licensing /s %nul2% | findstr /i "CIDToLicenseIdsMapping LicenseIdToEmailMapping @" %nul% && set vnextexist=1
reg delete HKU\!defname!\Software\Microsoft\Office\16.0\Common\Licensing /f %nul% reg delete HKU\!defname!\Software\Microsoft\Office\16.0\Common\Licensing /f %nul%
reg unload HKU\!defname! %nul% reg unload HKU\!defname! %nul%
) )
@ -1507,6 +1511,15 @@ reg unload HKU\!defname! %nul%
) )
) )
if defined vnextexist (
echo:
call :dk_color %Gray% "Office vNext subscription detected:"
call :dk_color %Blue% "If active, this license overrides other activation methods."
call :dk_color %Blue% "If expiring soon, rerun the script after expiration."
call :dk_color2 %Blue% "If expired and script activation fails, get help - " %_Yellow% " %mas%troubleshoot"
echo:
)
:: Clear SharedComputerLicensing for office :: Clear SharedComputerLicensing for office
:: https://learn.microsoft.com/en-us/deployoffice/overview-shared-computer-activation :: https://learn.microsoft.com/en-us/deployoffice/overview-shared-computer-activation
@ -1601,7 +1614,15 @@ set upk_result=2
if defined ohookact if not %upk_result%==0 echo: if defined ohookact if not %upk_result%==0 echo:
if %upk_result%==1 echo Uninstalling Other/Grace Keys [Successful] if %upk_result%==1 echo Uninstalling Other/Grace Keys [Successful]
if %upk_result%==2 call :dk_color %Red% "Uninstalling Other/Grace Keys [Failed]" if %upk_result%==2 (
call :dk_color %Red% "Uninstalling Other/Grace Keys [Failed]"
if not defined showfix (
echo:
call :dk_color %Blue% "%_fixmsg%"
echo:
set showfix=1
)
)
exit /b exit /b
::======================================================================================================================================== ::========================================================================================================================================
@ -1654,7 +1675,7 @@ exit /b
set ps=%SysPath%\WindowsPowerShell\v1.0\powershell.exe set ps=%SysPath%\WindowsPowerShell\v1.0\powershell.exe
set psc=%ps% -nop -c set psc=%ps% -nop -c
set winbuild=1 set winbuild=1
for /f "tokens=6 delims=[]. " %%G in ('ver') do set winbuild=%%G for /f "tokens=2 delims=[]" %%G in ('ver') do for /f "tokens=2,3,4 delims=. " %%H in ("%%~G") do set "winbuild=%%J"
set _slexe=sppsvc.exe& set _slser=sppsvc set _slexe=sppsvc.exe& set _slser=sppsvc
if %winbuild% LEQ 6300 (set _slexe=SLsvc.exe& set _slser=SLsvc) if %winbuild% LEQ 6300 (set _slexe=SLsvc.exe& set _slser=SLsvc)
@ -1743,9 +1764,11 @@ if %sps%==SoftwareLicensingService call :dk_refresh
echo %keyecho% %~1 [Successful] echo %keyecho% %~1 [Successful]
) else ( ) else (
call :dk_color %Red% "%keyecho% %~1 [Failed] %keyerror%" call :dk_color %Red% "%keyecho% %~1 [Failed] %keyerror%"
if not defined error ( if not defined showfix (
if defined altapplist call :dk_color %Red% "Activation ID not found for this key." if defined altapplist call :dk_color %Red% "Activation ID not found for this key."
echo:
call :dk_color %Blue% "%_fixmsg%" call :dk_color %Blue% "%_fixmsg%"
echo:
set showfix=1 set showfix=1
) )
set error=1 set error=1
@ -1899,6 +1922,7 @@ 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..." if defined results call :dk_color %Red% "Checking Probable Mal%w%ware Infection..."
if defined results (call :dk_color %Red% "%results%"&set showfix=1) if defined results (call :dk_color %Red% "%results%"&set showfix=1)
echo:
set fixes=%fixes% %mas%remove_mal%w%ware set fixes=%fixes% %mas%remove_mal%w%ware
call :dk_color2 %Blue% "Check this webpage for help - " %_Yellow% " %mas%remove_mal%w%ware" call :dk_color2 %Blue% "Check this webpage for help - " %_Yellow% " %mas%remove_mal%w%ware"
echo: echo:
@ -2005,7 +2029,7 @@ sc start %%# %nul%
if !errorlevel! EQU 1060 set _corrupt=1 if !errorlevel! EQU 1060 set _corrupt=1
sc query %%# %nul% || set _corrupt=1 sc query %%# %nul% || set _corrupt=1
for %%G in (DependOnService Description DisplayName ErrorControl ImagePath ObjectName Start Type) do if not defined _regcorr ( for %%G in (DependOnService Description DisplayName ErrorControl ImagePath ObjectName Start Type) do if not defined _regcorr (
reg query HKLM\SYSTEM\CurrentControlSet\Services\%%# /v %%G %nul% || (set _corrupt=1&set _regcorr="-RegistryError" ) reg query HKLM\SYSTEM\CurrentControlSet\Services\%%# /v %%G %nul% || (set _corrupt=1&set _regcorr=-RegistryError)
) )
if defined _corrupt (if defined serv_cor (set "serv_cor=!serv_cor! %%#!_regcorr!") else (set "serv_cor=%%#!_regcorr!")) if defined _corrupt (if defined serv_cor (set "serv_cor=!serv_cor! %%#!_regcorr!") else (set "serv_cor=%%#!_regcorr!"))
@ -2331,7 +2355,7 @@ cmd /c exit /b %error_code%
if %error_code% NEQ 0 set "error_code=0x%=ExitCode%" if %error_code% NEQ 0 set "error_code=0x%=ExitCode%"
if %error_code% NEQ 0 ( if %error_code% NEQ 0 (
call :dk_color %Red% "Checking SoftwareLicensingService [Not Working] %error_code%" call :dk_color %Red% "Checking SoftwareLicensingService [Not Working] [%error_code%]"
if not defined showfix ( if not defined showfix (
echo: echo:
call :dk_color %Blue% "%_fixmsg%" call :dk_color %Blue% "%_fixmsg%"
@ -2350,6 +2374,7 @@ call :dk_actid 55c92734-d682-4d71-983e-d6ec3f16059f
if not defined apps ( if not defined apps (
%psc% "if (-not $env:_vis) {Start-Job { Stop-Service %_slser% -force } | Wait-Job -Timeout 20 | Out-Null}; $sls = Get-WmiObject SoftwareLicensingService; $f=[System.IO.File]::ReadAllText('!_batp!') -split ':xrm\:.*';. ([scriptblock]::Create($f[1])); ReinstallLicenses" %nul% %psc% "if (-not $env:_vis) {Start-Job { Stop-Service %_slser% -force } | Wait-Job -Timeout 20 | Out-Null}; $sls = Get-WmiObject SoftwareLicensingService; $f=[System.IO.File]::ReadAllText('!_batp!') -split ':xrm\:.*';. ([scriptblock]::Create($f[1])); ReinstallLicenses" %nul%
if not defined _vis if !errorlevel! NEQ 0 set rlicfailed=1
call :dk_actid 55c92734-d682-4d71-983e-d6ec3f16059f call :dk_actid 55c92734-d682-4d71-983e-d6ec3f16059f
) )
@ -2371,6 +2396,13 @@ set error=1
set showfix=1 set showfix=1
) )
if not defined showfix if defined rlicfailed (
echo:
call :dk_color %Blue% "%_fixmsg%"
call :dk_color %Blue% "If activation still fails then run Fix WPA Registry option."
echo:
)
if %winbuild% GEQ 7600 if exist "%tokenstore%\" if not exist "%tokenstore%\tokens.dat" ( if %winbuild% GEQ 7600 if exist "%tokenstore%\" if not exist "%tokenstore%\tokens.dat" (
call :dk_color %Red% "Checking SPP tokens.dat [Not Found] [%tokenstore%\]" call :dk_color %Red% "Checking SPP tokens.dat [Not Found] [%tokenstore%\]"
) )

View File

@ -1,4 +1,4 @@
@set masver=3.4 @set masver=3.5
@echo off @echo off
@ -75,6 +75,7 @@ set "_cmdf=%~f0"
for %%# in (%*) do ( for %%# in (%*) do (
if /i "%%#"=="re1" set re1=1 if /i "%%#"=="re1" set re1=1
if /i "%%#"=="re2" set re2=1 if /i "%%#"=="re2" set re2=1
if /i "%%#"=="-qedit" (set re1=1&set re2=1)
) )
:: Re-launch the script with x64 process if it was initiated by x86 process on x64 bit Windows :: Re-launch the script with x64 process if it was initiated by x86 process on x64 bit Windows
@ -316,6 +317,17 @@ call :dk_color2 %Blue% "Check this webpage for help - " %_Yellow% " %mas%in-plac
goto dk_done goto dk_done
) )
REM check for Mal-ware that may cause issues with Powershell
for /r "%ProgramFiles%\" %%f in (secureboot.exe) do if exist "%%f" (
echo "%%f"
echo Mal%blank%ware found, PowerShell is not working properly.
echo:
set fixes=%fixes% %mas%remove_mal%w%ware
call :dk_color2 %Blue% "Check this webpage for help - " %_Yellow% " %mas%remove_mal%w%ware"
goto dk_done
)
REM check if .NET is working properly REM check if .NET is working properly
if /i "!tstresult2!"=="FullLanguage" ( if /i "!tstresult2!"=="FullLanguage" (
@ -329,17 +341,6 @@ goto dk_done
) )
) )
REM check for Mal-ware that may cause issues with Powershell
for /r "%ProgramFiles%\" %%f in (secureboot.exe) do if exist "%%f" (
echo "%%f"
echo Mal%blank%ware found, PowerShell is not working properly.
echo:
set fixes=%fixes% %mas%remove_mal%w%ware
call :dk_color2 %Blue% "Check this webpage for help - " %_Yellow% " %mas%remove_mal%w%ware"
goto dk_done
)
REM check antivirus and other errors REM check antivirus and other errors
echo PowerShell is not working properly. Aborting... echo PowerShell is not working properly. Aborting...
@ -1452,10 +1453,12 @@ call :dk_color %Gray% "Checking Total User Accounts [%counter%]"
:: Clear the vNext/shared/device license blocks which may prevent ohook activation :: Clear the vNext/shared/device license blocks which may prevent ohook activation
set vnextexist=
rmdir /s /q "%ProgramData%\Microsoft\Office\Licenses\" %nul% rmdir /s /q "%ProgramData%\Microsoft\Office\Licenses\" %nul%
for %%x in (15 16) do ( for %%x in (15 16) do (
for %%# in (%_sidlist%) do ( for %%# in (%_sidlist%) do (
reg query HKU\%%#\Software\Microsoft\Office\%%x.0\Common\Licensing /s %nul2% | findstr /i "CIDToLicenseIdsMapping LicenseIdToEmailMapping @" %nul% && set vnextexist=1
reg delete HKU\%%#\Software\Microsoft\Office\%%x.0\Common\Licensing /f %nul% reg delete HKU\%%#\Software\Microsoft\Office\%%x.0\Common\Licensing /f %nul%
for /f "skip=2 tokens=2*" %%a in ('"reg query "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\ProfileList\%%#" /v ProfileImagePath" %nul6%') do ( for /f "skip=2 tokens=2*" %%a in ('"reg query "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\ProfileList\%%#" /v ProfileImagePath" %nul6%') do (
@ -1478,6 +1481,7 @@ rmdir /s /q "%%b\AppData\Local\Packages\Microsoft.Office.Desktop_8wekyb3d8bbwe\L
if exist "%%b\AppData\Local\Packages\Microsoft.Office.Desktop_8wekyb3d8bbwe\SystemAppData\Helium\User.dat" ( if exist "%%b\AppData\Local\Packages\Microsoft.Office.Desktop_8wekyb3d8bbwe\SystemAppData\Helium\User.dat" (
set defname=DEFTEMP-%%# set defname=DEFTEMP-%%#
reg load HKU\!defname! "%%b\AppData\Local\Packages\Microsoft.Office.Desktop_8wekyb3d8bbwe\SystemAppData\Helium\User.dat" %nul% reg load HKU\!defname! "%%b\AppData\Local\Packages\Microsoft.Office.Desktop_8wekyb3d8bbwe\SystemAppData\Helium\User.dat" %nul%
reg query HKU\!defname!\Software\Microsoft\Office\16.0\Common\Licensing /s %nul2% | findstr /i "CIDToLicenseIdsMapping LicenseIdToEmailMapping @" %nul% && set vnextexist=1
reg delete HKU\!defname!\Software\Microsoft\Office\16.0\Common\Licensing /f %nul% reg delete HKU\!defname!\Software\Microsoft\Office\16.0\Common\Licensing /f %nul%
reg unload HKU\!defname! %nul% reg unload HKU\!defname! %nul%
) )
@ -1485,6 +1489,15 @@ reg unload HKU\!defname! %nul%
) )
) )
if defined vnextexist (
echo:
call :dk_color %Gray% "Office vNext subscription detected:"
call :dk_color %Blue% "If active, this license overrides other activation methods."
call :dk_color %Blue% "If expiring soon, rerun the script after expiration."
call :dk_color2 %Blue% "If expired and script activation fails, get help - " %_Yellow% " %mas%troubleshoot"
echo:
)
:: Clear SharedComputerLicensing for office :: Clear SharedComputerLicensing for office
:: https://learn.microsoft.com/en-us/deployoffice/overview-shared-computer-activation :: https://learn.microsoft.com/en-us/deployoffice/overview-shared-computer-activation
@ -1579,7 +1592,15 @@ set upk_result=2
if defined ohookact if not %upk_result%==0 echo: if defined ohookact if not %upk_result%==0 echo:
if %upk_result%==1 echo Uninstalling Other/Grace Keys [Successful] if %upk_result%==1 echo Uninstalling Other/Grace Keys [Successful]
if %upk_result%==2 call :dk_color %Red% "Uninstalling Other/Grace Keys [Failed]" if %upk_result%==2 (
call :dk_color %Red% "Uninstalling Other/Grace Keys [Failed]"
if not defined showfix (
echo:
call :dk_color %Blue% "%_fixmsg%"
echo:
set showfix=1
)
)
exit /b exit /b
::======================================================================================================================================== ::========================================================================================================================================
@ -1628,6 +1649,9 @@ call :ks_clearstuff
set error_=9 set error_=9
echo Failed to completely clear %KS% Cache. echo Failed to completely clear %KS% Cache.
reg query "HKLM\%SPPk%\%_wApp%" /s %nul2% | findstr /i "127.0.0.2" %nul1% && echo KMS38 activation is locked. reg query "HKLM\%SPPk%\%_wApp%" /s %nul2% | findstr /i "127.0.0.2" %nul1% && echo KMS38 activation is locked.
echo:
call :dk_color %Blue% "%_fixmsg%"
echo:
) || ( ) || (
echo Cleared %KS% Cache successfully. echo Cleared %KS% Cache successfully.
) )
@ -1643,6 +1667,10 @@ echo %uline%
echo %uline% echo %uline%
echo: echo:
call :dk_color %Green% "Online %KS% has been successfully uninstalled." call :dk_color %Green% "Online %KS% has been successfully uninstalled."
echo:
call :dk_color %Gray% "If you want to reset the activation status,"
call :dk_color %Blue% "%_fixmsg%"
echo:
echo %uline% echo %uline%
) )
@ -1740,7 +1768,7 @@ set "PSModulePath=%ProgramFiles%\WindowsPowerShell\Modules;%SysPath%\WindowsPowe
set _tserror= set _tserror=
set winbuild=1 set winbuild=1
set "nul=>nul 2>&1" set "nul=>nul 2>&1"
for /f "tokens=6 delims=[]. " %%G in ('ver') do set winbuild=%%G for /f "tokens=2 delims=[]" %%G in ('ver') do for /f "tokens=2,3,4 delims=. " %%H in ("%%~G") do set "winbuild=%%J"
set psc=powershell.exe -nop -c set psc=powershell.exe -nop -c
set _slexe=sppsvc.exe& set _slser=sppsvc set _slexe=sppsvc.exe& set _slser=sppsvc
@ -2560,7 +2588,7 @@ exit /b
set ps=%SysPath%\WindowsPowerShell\v1.0\powershell.exe set ps=%SysPath%\WindowsPowerShell\v1.0\powershell.exe
set psc=%ps% -nop -c set psc=%ps% -nop -c
set winbuild=1 set winbuild=1
for /f "tokens=6 delims=[]. " %%G in ('ver') do set winbuild=%%G for /f "tokens=2 delims=[]" %%G in ('ver') do for /f "tokens=2,3,4 delims=. " %%H in ("%%~G") do set "winbuild=%%J"
set _slexe=sppsvc.exe& set _slser=sppsvc set _slexe=sppsvc.exe& set _slser=sppsvc
if %winbuild% LEQ 6300 (set _slexe=SLsvc.exe& set _slser=SLsvc) if %winbuild% LEQ 6300 (set _slexe=SLsvc.exe& set _slser=SLsvc)
@ -2712,9 +2740,11 @@ if %sps%==SoftwareLicensingService call :dk_refresh
echo %keyecho% %~1 [Successful] echo %keyecho% %~1 [Successful]
) else ( ) else (
call :dk_color %Red% "%keyecho% %~1 [Failed] %keyerror%" call :dk_color %Red% "%keyecho% %~1 [Failed] %keyerror%"
if not defined error ( if not defined showfix (
if defined altapplist call :dk_color %Red% "Activation ID not found for this key." if defined altapplist call :dk_color %Red% "Activation ID not found for this key."
echo:
call :dk_color %Blue% "%_fixmsg%" call :dk_color %Blue% "%_fixmsg%"
echo:
set showfix=1 set showfix=1
) )
set error=1 set error=1
@ -2955,6 +2985,7 @@ 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..." if defined results call :dk_color %Red% "Checking Probable Mal%w%ware Infection..."
if defined results (call :dk_color %Red% "%results%"&set showfix=1) if defined results (call :dk_color %Red% "%results%"&set showfix=1)
echo:
set fixes=%fixes% %mas%remove_mal%w%ware set fixes=%fixes% %mas%remove_mal%w%ware
call :dk_color2 %Blue% "Check this webpage for help - " %_Yellow% " %mas%remove_mal%w%ware" call :dk_color2 %Blue% "Check this webpage for help - " %_Yellow% " %mas%remove_mal%w%ware"
echo: echo:
@ -3061,7 +3092,7 @@ sc start %%# %nul%
if !errorlevel! EQU 1060 set _corrupt=1 if !errorlevel! EQU 1060 set _corrupt=1
sc query %%# %nul% || set _corrupt=1 sc query %%# %nul% || set _corrupt=1
for %%G in (DependOnService Description DisplayName ErrorControl ImagePath ObjectName Start Type) do if not defined _regcorr ( for %%G in (DependOnService Description DisplayName ErrorControl ImagePath ObjectName Start Type) do if not defined _regcorr (
reg query HKLM\SYSTEM\CurrentControlSet\Services\%%# /v %%G %nul% || (set _corrupt=1&set _regcorr="-RegistryError" ) reg query HKLM\SYSTEM\CurrentControlSet\Services\%%# /v %%G %nul% || (set _corrupt=1&set _regcorr=-RegistryError)
) )
if defined _corrupt (if defined serv_cor (set "serv_cor=!serv_cor! %%#!_regcorr!") else (set "serv_cor=%%#!_regcorr!")) if defined _corrupt (if defined serv_cor (set "serv_cor=!serv_cor! %%#!_regcorr!") else (set "serv_cor=%%#!_regcorr!"))
@ -3387,7 +3418,7 @@ cmd /c exit /b %error_code%
if %error_code% NEQ 0 set "error_code=0x%=ExitCode%" if %error_code% NEQ 0 set "error_code=0x%=ExitCode%"
if %error_code% NEQ 0 ( if %error_code% NEQ 0 (
call :dk_color %Red% "Checking SoftwareLicensingService [Not Working] %error_code%" call :dk_color %Red% "Checking SoftwareLicensingService [Not Working] [%error_code%]"
if not defined showfix ( if not defined showfix (
echo: echo:
call :dk_color %Blue% "%_fixmsg%" call :dk_color %Blue% "%_fixmsg%"
@ -3406,6 +3437,7 @@ call :dk_actid 55c92734-d682-4d71-983e-d6ec3f16059f
if not defined apps ( if not defined apps (
%psc% "if (-not $env:_vis) {Start-Job { Stop-Service %_slser% -force } | Wait-Job -Timeout 20 | Out-Null}; $sls = Get-WmiObject SoftwareLicensingService; $f=[System.IO.File]::ReadAllText('!_batp!') -split ':xrm\:.*';. ([scriptblock]::Create($f[1])); ReinstallLicenses" %nul% %psc% "if (-not $env:_vis) {Start-Job { Stop-Service %_slser% -force } | Wait-Job -Timeout 20 | Out-Null}; $sls = Get-WmiObject SoftwareLicensingService; $f=[System.IO.File]::ReadAllText('!_batp!') -split ':xrm\:.*';. ([scriptblock]::Create($f[1])); ReinstallLicenses" %nul%
if not defined _vis if !errorlevel! NEQ 0 set rlicfailed=1
call :dk_actid 55c92734-d682-4d71-983e-d6ec3f16059f call :dk_actid 55c92734-d682-4d71-983e-d6ec3f16059f
) )
@ -3427,6 +3459,13 @@ set error=1
set showfix=1 set showfix=1
) )
if not defined showfix if defined rlicfailed (
echo:
call :dk_color %Blue% "%_fixmsg%"
call :dk_color %Blue% "If activation still fails then run Fix WPA Registry option."
echo:
)
if %winbuild% GEQ 7600 if exist "%tokenstore%\" if not exist "%tokenstore%\tokens.dat" ( if %winbuild% GEQ 7600 if exist "%tokenstore%\" if not exist "%tokenstore%\tokens.dat" (
call :dk_color %Red% "Checking SPP tokens.dat [Not Found] [%tokenstore%\]" call :dk_color %Red% "Checking SPP tokens.dat [Not Found] [%tokenstore%\]"
) )

View File

@ -1,4 +1,4 @@
@set masver=3.4 @set masver=3.5
@echo off @echo off
@ -84,6 +84,7 @@ set "_cmdf=%~f0"
for %%# in (%*) do ( for %%# in (%*) do (
if /i "%%#"=="re1" set re1=1 if /i "%%#"=="re1" set re1=1
if /i "%%#"=="re2" set re2=1 if /i "%%#"=="re2" set re2=1
if /i "%%#"=="-qedit" (set re1=1&set re2=1)
) )
:: Re-launch the script with x64 process if it was initiated by x86 process on x64 bit Windows :: Re-launch the script with x64 process if it was initiated by x86 process on x64 bit Windows
@ -343,6 +344,17 @@ call :dk_color2 %Blue% "Check this webpage for help - " %_Yellow% " %mas%in-plac
goto dk_done goto dk_done
) )
REM check for Mal-ware that may cause issues with Powershell
for /r "%ProgramFiles%\" %%f in (secureboot.exe) do if exist "%%f" (
echo "%%f"
echo Mal%blank%ware found, PowerShell is not working properly.
echo:
set fixes=%fixes% %mas%remove_mal%w%ware
call :dk_color2 %Blue% "Check this webpage for help - " %_Yellow% " %mas%remove_mal%w%ware"
goto dk_done
)
REM check if .NET is working properly REM check if .NET is working properly
if /i "!tstresult2!"=="FullLanguage" ( if /i "!tstresult2!"=="FullLanguage" (
@ -356,17 +368,6 @@ goto dk_done
) )
) )
REM check for Mal-ware that may cause issues with Powershell
for /r "%ProgramFiles%\" %%f in (secureboot.exe) do if exist "%%f" (
echo "%%f"
echo Mal%blank%ware found, PowerShell is not working properly.
echo:
set fixes=%fixes% %mas%remove_mal%w%ware
call :dk_color2 %Blue% "Check this webpage for help - " %_Yellow% " %mas%remove_mal%w%ware"
goto dk_done
)
REM check antivirus and other errors REM check antivirus and other errors
echo PowerShell is not working properly. Aborting... echo PowerShell is not working properly. Aborting...
@ -1927,6 +1928,7 @@ call :dk_color %Gray% "To activate, check your internet connection and ensure th
) else ( ) else (
call :dk_color %Blue% "This Windows version is known to not activate due to MS Windows/Server issues." call :dk_color %Blue% "This Windows version is known to not activate due to MS Windows/Server issues."
) )
if not defined showfix call :dk_color %Blue% "%_fixmsg%"
set fixes=%fixes% %mas%troubleshoot set fixes=%fixes% %mas%troubleshoot
call :dk_color2 %Blue% "Check this webpage for help - " %_Yellow% " %mas%troubleshoot" call :dk_color2 %Blue% "Check this webpage for help - " %_Yellow% " %mas%troubleshoot"
) )
@ -1943,7 +1945,7 @@ if /i %tsmethod%==StaticCID (echo Depositing Static Confirmation ID...) else (ec
echo: echo:
%psc% "$f=[System.IO.File]::ReadAllText('!_batp!') -split ':tsforge\:.*';. ([scriptblock]::Create($f[1])) %tsids%" %psc% "$f=[System.IO.File]::ReadAllText('!_batp!') -split ':tsforge\:.*';. ([scriptblock]::Create($f[1])) %tsids%"
if !errorlevel!==3 ( if !errorlevel!==3 (
if %_actman%==0 (if not defined error call :dk_color %Blue% "%_fixmsg%") if %_actman%==0 (if not defined showfix call :dk_color %Blue% "%_fixmsg%")
set fixes=%fixes% %mas%troubleshoot set fixes=%fixes% %mas%troubleshoot
call :dk_color2 %Blue% "Check this webpage for help - " %_Yellow% " %mas%troubleshoot" call :dk_color2 %Blue% "Check this webpage for help - " %_Yellow% " %mas%troubleshoot"
) else ( ) else (
@ -2410,10 +2412,12 @@ call :dk_color %Gray% "Checking Total User Accounts [%counter%]"
:: Clear the vNext/shared/device license blocks which may prevent ohook activation :: Clear the vNext/shared/device license blocks which may prevent ohook activation
set vnextexist=
rmdir /s /q "%ProgramData%\Microsoft\Office\Licenses\" %nul% rmdir /s /q "%ProgramData%\Microsoft\Office\Licenses\" %nul%
for %%x in (15 16) do ( for %%x in (15 16) do (
for %%# in (%_sidlist%) do ( for %%# in (%_sidlist%) do (
reg query HKU\%%#\Software\Microsoft\Office\%%x.0\Common\Licensing /s %nul2% | findstr /i "CIDToLicenseIdsMapping LicenseIdToEmailMapping @" %nul% && set vnextexist=1
reg delete HKU\%%#\Software\Microsoft\Office\%%x.0\Common\Licensing /f %nul% reg delete HKU\%%#\Software\Microsoft\Office\%%x.0\Common\Licensing /f %nul%
for /f "skip=2 tokens=2*" %%a in ('"reg query "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\ProfileList\%%#" /v ProfileImagePath" %nul6%') do ( for /f "skip=2 tokens=2*" %%a in ('"reg query "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\ProfileList\%%#" /v ProfileImagePath" %nul6%') do (
@ -2436,6 +2440,7 @@ rmdir /s /q "%%b\AppData\Local\Packages\Microsoft.Office.Desktop_8wekyb3d8bbwe\L
if exist "%%b\AppData\Local\Packages\Microsoft.Office.Desktop_8wekyb3d8bbwe\SystemAppData\Helium\User.dat" ( if exist "%%b\AppData\Local\Packages\Microsoft.Office.Desktop_8wekyb3d8bbwe\SystemAppData\Helium\User.dat" (
set defname=DEFTEMP-%%# set defname=DEFTEMP-%%#
reg load HKU\!defname! "%%b\AppData\Local\Packages\Microsoft.Office.Desktop_8wekyb3d8bbwe\SystemAppData\Helium\User.dat" %nul% reg load HKU\!defname! "%%b\AppData\Local\Packages\Microsoft.Office.Desktop_8wekyb3d8bbwe\SystemAppData\Helium\User.dat" %nul%
reg query HKU\!defname!\Software\Microsoft\Office\16.0\Common\Licensing /s %nul2% | findstr /i "CIDToLicenseIdsMapping LicenseIdToEmailMapping @" %nul% && set vnextexist=1
reg delete HKU\!defname!\Software\Microsoft\Office\16.0\Common\Licensing /f %nul% reg delete HKU\!defname!\Software\Microsoft\Office\16.0\Common\Licensing /f %nul%
reg unload HKU\!defname! %nul% reg unload HKU\!defname! %nul%
) )
@ -2443,6 +2448,15 @@ reg unload HKU\!defname! %nul%
) )
) )
if defined vnextexist (
echo:
call :dk_color %Gray% "Office vNext subscription detected:"
call :dk_color %Blue% "If active, this license overrides other activation methods."
call :dk_color %Blue% "If expiring soon, rerun the script after expiration."
call :dk_color2 %Blue% "If expired and script activation fails, get help - " %_Yellow% " %mas%troubleshoot"
echo:
)
:: Clear SharedComputerLicensing for office :: Clear SharedComputerLicensing for office
:: https://learn.microsoft.com/en-us/deployoffice/overview-shared-computer-activation :: https://learn.microsoft.com/en-us/deployoffice/overview-shared-computer-activation
@ -2537,7 +2551,15 @@ set upk_result=2
if defined ohookact if not %upk_result%==0 echo: if defined ohookact if not %upk_result%==0 echo:
if %upk_result%==1 echo Uninstalling Other/Grace Keys [Successful] if %upk_result%==1 echo Uninstalling Other/Grace Keys [Successful]
if %upk_result%==2 call :dk_color %Red% "Uninstalling Other/Grace Keys [Failed]" if %upk_result%==2 (
call :dk_color %Red% "Uninstalling Other/Grace Keys [Failed]"
if not defined showfix (
echo:
call :dk_color %Blue% "%_fixmsg%"
echo:
set showfix=1
)
)
exit /b exit /b
::======================================================================================================================================== ::========================================================================================================================================
@ -2615,7 +2637,7 @@ exit /b
set ps=%SysPath%\WindowsPowerShell\v1.0\powershell.exe set ps=%SysPath%\WindowsPowerShell\v1.0\powershell.exe
set psc=%ps% -nop -c set psc=%ps% -nop -c
set winbuild=1 set winbuild=1
for /f "tokens=6 delims=[]. " %%G in ('ver') do set winbuild=%%G for /f "tokens=2 delims=[]" %%G in ('ver') do for /f "tokens=2,3,4 delims=. " %%H in ("%%~G") do set "winbuild=%%J"
set _slexe=sppsvc.exe& set _slser=sppsvc set _slexe=sppsvc.exe& set _slser=sppsvc
if %winbuild% LEQ 6300 (set _slexe=SLsvc.exe& set _slser=SLsvc) if %winbuild% LEQ 6300 (set _slexe=SLsvc.exe& set _slser=SLsvc)
@ -2766,9 +2788,11 @@ if %sps%==SoftwareLicensingService call :dk_refresh
echo %keyecho% %~1 [Successful] echo %keyecho% %~1 [Successful]
) else ( ) else (
call :dk_color %Red% "%keyecho% %~1 [Failed] %keyerror%" call :dk_color %Red% "%keyecho% %~1 [Failed] %keyerror%"
if not defined error ( if not defined showfix (
if defined altapplist call :dk_color %Red% "Activation ID not found for this key." if defined altapplist call :dk_color %Red% "Activation ID not found for this key."
echo:
call :dk_color %Blue% "%_fixmsg%" call :dk_color %Blue% "%_fixmsg%"
echo:
set showfix=1 set showfix=1
) )
set error=1 set error=1
@ -2967,6 +2991,7 @@ 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..." if defined results call :dk_color %Red% "Checking Probable Mal%w%ware Infection..."
if defined results (call :dk_color %Red% "%results%"&set showfix=1) if defined results (call :dk_color %Red% "%results%"&set showfix=1)
echo:
set fixes=%fixes% %mas%remove_mal%w%ware set fixes=%fixes% %mas%remove_mal%w%ware
call :dk_color2 %Blue% "Check this webpage for help - " %_Yellow% " %mas%remove_mal%w%ware" call :dk_color2 %Blue% "Check this webpage for help - " %_Yellow% " %mas%remove_mal%w%ware"
echo: echo:
@ -3073,7 +3098,7 @@ sc start %%# %nul%
if !errorlevel! EQU 1060 set _corrupt=1 if !errorlevel! EQU 1060 set _corrupt=1
sc query %%# %nul% || set _corrupt=1 sc query %%# %nul% || set _corrupt=1
for %%G in (DependOnService Description DisplayName ErrorControl ImagePath ObjectName Start Type) do if not defined _regcorr ( for %%G in (DependOnService Description DisplayName ErrorControl ImagePath ObjectName Start Type) do if not defined _regcorr (
reg query HKLM\SYSTEM\CurrentControlSet\Services\%%# /v %%G %nul% || (set _corrupt=1&set _regcorr="-RegistryError" ) reg query HKLM\SYSTEM\CurrentControlSet\Services\%%# /v %%G %nul% || (set _corrupt=1&set _regcorr=-RegistryError)
) )
if defined _corrupt (if defined serv_cor (set "serv_cor=!serv_cor! %%#!_regcorr!") else (set "serv_cor=%%#!_regcorr!")) if defined _corrupt (if defined serv_cor (set "serv_cor=!serv_cor! %%#!_regcorr!") else (set "serv_cor=%%#!_regcorr!"))
@ -3399,7 +3424,7 @@ cmd /c exit /b %error_code%
if %error_code% NEQ 0 set "error_code=0x%=ExitCode%" if %error_code% NEQ 0 set "error_code=0x%=ExitCode%"
if %error_code% NEQ 0 ( if %error_code% NEQ 0 (
call :dk_color %Red% "Checking SoftwareLicensingService [Not Working] %error_code%" call :dk_color %Red% "Checking SoftwareLicensingService [Not Working] [%error_code%]"
if not defined showfix ( if not defined showfix (
echo: echo:
call :dk_color %Blue% "%_fixmsg%" call :dk_color %Blue% "%_fixmsg%"
@ -3418,6 +3443,7 @@ call :dk_actid 55c92734-d682-4d71-983e-d6ec3f16059f
if not defined apps ( if not defined apps (
%psc% "if (-not $env:_vis) {Start-Job { Stop-Service %_slser% -force } | Wait-Job -Timeout 20 | Out-Null}; $sls = Get-WmiObject SoftwareLicensingService; $f=[System.IO.File]::ReadAllText('!_batp!') -split ':xrm\:.*';. ([scriptblock]::Create($f[1])); ReinstallLicenses" %nul% %psc% "if (-not $env:_vis) {Start-Job { Stop-Service %_slser% -force } | Wait-Job -Timeout 20 | Out-Null}; $sls = Get-WmiObject SoftwareLicensingService; $f=[System.IO.File]::ReadAllText('!_batp!') -split ':xrm\:.*';. ([scriptblock]::Create($f[1])); ReinstallLicenses" %nul%
if not defined _vis if !errorlevel! NEQ 0 set rlicfailed=1
call :dk_actid 55c92734-d682-4d71-983e-d6ec3f16059f call :dk_actid 55c92734-d682-4d71-983e-d6ec3f16059f
) )
@ -3439,6 +3465,13 @@ set error=1
set showfix=1 set showfix=1
) )
if not defined showfix if defined rlicfailed (
echo:
call :dk_color %Blue% "%_fixmsg%"
call :dk_color %Blue% "If activation still fails then run Fix WPA Registry option."
echo:
)
if %winbuild% GEQ 7600 if exist "%tokenstore%\" if not exist "%tokenstore%\tokens.dat" ( if %winbuild% GEQ 7600 if exist "%tokenstore%\" if not exist "%tokenstore%\tokens.dat" (
call :dk_color %Red% "Checking SPP tokens.dat [Not Found] [%tokenstore%\]" call :dk_color %Red% "Checking SPP tokens.dat [Not Found] [%tokenstore%\]"
) )
@ -8815,6 +8848,7 @@ else {
if ($env:_debug -eq '0') { if ($env:_debug -eq '0') {
[LibTSforge.Logger]::HideOutput = $true [LibTSforge.Logger]::HideOutput = $true
} }
[void][LibTSforge.Utils]::Wow64EnableWow64FsRedirection($false)
$ver = [LibTSforge.Utils]::DetectVersion() $ver = [LibTSforge.Utils]::DetectVersion()
$prod = [LibTSforge.SPP.SPPUtils]::DetectCurrentKey() $prod = [LibTSforge.SPP.SPPUtils]::DetectCurrentKey()
$tsactids = @($args) $tsactids = @($args)

View File

@ -1,4 +1,4 @@
@set masver=3.4 @set masver=3.5
@echo off @echo off
@ -37,6 +37,7 @@ set "_cmdf=%~f0"
for %%# in (%*) do ( for %%# in (%*) do (
if /i "%%#"=="re1" set re1=1 if /i "%%#"=="re1" set re1=1
if /i "%%#"=="re2" set re2=1 if /i "%%#"=="re2" set re2=1
if /i "%%#"=="-qedit" (set re1=1&set re2=1)
) )
:: Re-launch the script with x64 process if it was initiated by x86 process on x64 bit Windows :: Re-launch the script with x64 process if it was initiated by x86 process on x64 bit Windows
@ -230,6 +231,17 @@ call :dk_color2 %Blue% "Check this webpage for help - " %_Yellow% " %mas%in-plac
goto dk_done goto dk_done
) )
REM check for Mal-ware that may cause issues with Powershell
for /r "%ProgramFiles%\" %%f in (secureboot.exe) do if exist "%%f" (
echo "%%f"
echo Mal%blank%ware found, PowerShell is not working properly.
echo:
set fixes=%fixes% %mas%remove_mal%w%ware
call :dk_color2 %Blue% "Check this webpage for help - " %_Yellow% " %mas%remove_mal%w%ware"
goto dk_done
)
REM check if .NET is working properly REM check if .NET is working properly
if /i "!tstresult2!"=="FullLanguage" ( if /i "!tstresult2!"=="FullLanguage" (
@ -243,17 +255,6 @@ goto dk_done
) )
) )
REM check for Mal-ware that may cause issues with Powershell
for /r "%ProgramFiles%\" %%f in (secureboot.exe) do if exist "%%f" (
echo "%%f"
echo Mal%blank%ware found, PowerShell is not working properly.
echo:
set fixes=%fixes% %mas%remove_mal%w%ware
call :dk_color2 %Blue% "Check this webpage for help - " %_Yellow% " %mas%remove_mal%w%ware"
goto dk_done
)
REM check antivirus and other errors REM check antivirus and other errors
echo PowerShell is not working properly. Aborting... echo PowerShell is not working properly. Aborting...
@ -1547,7 +1548,7 @@ if ($appIdsList.Count -gt 0) {
set ps=%SysPath%\WindowsPowerShell\v1.0\powershell.exe set ps=%SysPath%\WindowsPowerShell\v1.0\powershell.exe
set psc=%ps% -nop -c set psc=%ps% -nop -c
set winbuild=1 set winbuild=1
for /f "tokens=6 delims=[]. " %%G in ('ver') do set winbuild=%%G for /f "tokens=2 delims=[]" %%G in ('ver') do for /f "tokens=2,3,4 delims=. " %%H in ("%%~G") do set "winbuild=%%J"
set _slexe=sppsvc.exe& set _slser=sppsvc set _slexe=sppsvc.exe& set _slser=sppsvc
if %winbuild% LEQ 6300 (set _slexe=SLsvc.exe& set _slser=SLsvc) if %winbuild% LEQ 6300 (set _slexe=SLsvc.exe& set _slser=SLsvc)

View File

@ -1,4 +1,4 @@
@set masver=3.4 @set masver=3.5
@echo off @echo off
@ -42,6 +42,7 @@ set "_cmdf=%~f0"
for %%# in (%*) do ( for %%# in (%*) do (
if /i "%%#"=="re1" set re1=1 if /i "%%#"=="re1" set re1=1
if /i "%%#"=="re2" set re2=1 if /i "%%#"=="re2" set re2=1
if /i "%%#"=="-qedit" (set re1=1&set re2=1)
) )
:: Re-launch the script with x64 process if it was initiated by x86 process on x64 bit Windows :: Re-launch the script with x64 process if it was initiated by x86 process on x64 bit Windows
@ -235,6 +236,17 @@ call :dk_color2 %Blue% "Check this webpage for help - " %_Yellow% " %mas%in-plac
goto dk_done goto dk_done
) )
REM check for Mal-ware that may cause issues with Powershell
for /r "%ProgramFiles%\" %%f in (secureboot.exe) do if exist "%%f" (
echo "%%f"
echo Mal%blank%ware found, PowerShell is not working properly.
echo:
set fixes=%fixes% %mas%remove_mal%w%ware
call :dk_color2 %Blue% "Check this webpage for help - " %_Yellow% " %mas%remove_mal%w%ware"
goto dk_done
)
REM check if .NET is working properly REM check if .NET is working properly
if /i "!tstresult2!"=="FullLanguage" ( if /i "!tstresult2!"=="FullLanguage" (
@ -248,17 +260,6 @@ goto dk_done
) )
) )
REM check for Mal-ware that may cause issues with Powershell
for /r "%ProgramFiles%\" %%f in (secureboot.exe) do if exist "%%f" (
echo "%%f"
echo Mal%blank%ware found, PowerShell is not working properly.
echo:
set fixes=%fixes% %mas%remove_mal%w%ware
call :dk_color2 %Blue% "Check this webpage for help - " %_Yellow% " %mas%remove_mal%w%ware"
goto dk_done
)
REM check antivirus and other errors REM check antivirus and other errors
echo PowerShell is not working properly. Aborting... echo PowerShell is not working properly. Aborting...
@ -870,7 +871,7 @@ exit /b
set ps=%SysPath%\WindowsPowerShell\v1.0\powershell.exe set ps=%SysPath%\WindowsPowerShell\v1.0\powershell.exe
set psc=%ps% -nop -c set psc=%ps% -nop -c
set winbuild=1 set winbuild=1
for /f "tokens=6 delims=[]. " %%G in ('ver') do set winbuild=%%G for /f "tokens=2 delims=[]" %%G in ('ver') do for /f "tokens=2,3,4 delims=. " %%H in ("%%~G") do set "winbuild=%%J"
set _slexe=sppsvc.exe& set _slser=sppsvc set _slexe=sppsvc.exe& set _slser=sppsvc
if %winbuild% LEQ 6300 (set _slexe=SLsvc.exe& set _slser=SLsvc) if %winbuild% LEQ 6300 (set _slexe=SLsvc.exe& set _slser=SLsvc)

View File

@ -1,4 +1,4 @@
@set masver=3.4 @set masver=3.5
@echo off @echo off
@ -37,6 +37,7 @@ set "_cmdf=%~f0"
for %%# in (%*) do ( for %%# in (%*) do (
if /i "%%#"=="re1" set re1=1 if /i "%%#"=="re1" set re1=1
if /i "%%#"=="re2" set re2=1 if /i "%%#"=="re2" set re2=1
if /i "%%#"=="-qedit" (set re1=1&set re2=1)
) )
:: Re-launch the script with x64 process if it was initiated by x86 process on x64 bit Windows :: Re-launch the script with x64 process if it was initiated by x86 process on x64 bit Windows
@ -246,6 +247,17 @@ call :dk_color2 %Blue% "Check this webpage for help - " %_Yellow% " %mas%in-plac
goto done2 goto done2
) )
REM check for Mal-ware that may cause issues with Powershell
for /r "%ProgramFiles%\" %%f in (secureboot.exe) do if exist "%%f" (
echo "%%f"
echo Mal%blank%ware found, PowerShell is not working properly.
echo:
set fixes=%fixes% %mas%remove_mal%w%ware
call :dk_color2 %Blue% "Check this webpage for help - " %_Yellow% " %mas%remove_mal%w%ware"
goto done2
)
REM check if .NET is working properly REM check if .NET is working properly
if /i "!tstresult2!"=="FullLanguage" ( if /i "!tstresult2!"=="FullLanguage" (
@ -259,17 +271,6 @@ goto done2
) )
) )
REM check for Mal-ware that may cause issues with Powershell
for /r "%ProgramFiles%\" %%f in (secureboot.exe) do if exist "%%f" (
echo "%%f"
echo Mal%blank%ware found, PowerShell is not working properly.
echo:
set fixes=%fixes% %mas%remove_mal%w%ware
call :dk_color2 %Blue% "Check this webpage for help - " %_Yellow% " %mas%remove_mal%w%ware"
goto done2
)
REM check antivirus and other errors REM check antivirus and other errors
echo PowerShell is not working properly. Aborting... echo PowerShell is not working properly. Aborting...
@ -795,7 +796,7 @@ exit /b
set ps=%SysPath%\WindowsPowerShell\v1.0\powershell.exe set ps=%SysPath%\WindowsPowerShell\v1.0\powershell.exe
set psc=%ps% -nop -c set psc=%ps% -nop -c
set winbuild=1 set winbuild=1
for /f "tokens=6 delims=[]. " %%G in ('ver') do set winbuild=%%G for /f "tokens=2 delims=[]" %%G in ('ver') do for /f "tokens=2,3,4 delims=. " %%H in ("%%~G") do set "winbuild=%%J"
set _slexe=sppsvc.exe& set _slser=sppsvc set _slexe=sppsvc.exe& set _slser=sppsvc
if %winbuild% LEQ 6300 (set _slexe=SLsvc.exe& set _slser=SLsvc) if %winbuild% LEQ 6300 (set _slexe=SLsvc.exe& set _slser=SLsvc)

View File

@ -1,4 +1,4 @@
@set masver=3.4 @set masver=3.5
@echo off @echo off
@ -37,6 +37,7 @@ set "_cmdf=%~f0"
for %%# in (%*) do ( for %%# in (%*) do (
if /i "%%#"=="re1" set re1=1 if /i "%%#"=="re1" set re1=1
if /i "%%#"=="re2" set re2=1 if /i "%%#"=="re2" set re2=1
if /i "%%#"=="-qedit" (set re1=1&set re2=1)
) )
:: Re-launch the script with x64 process if it was initiated by x86 process on x64 bit Windows :: Re-launch the script with x64 process if it was initiated by x86 process on x64 bit Windows
@ -247,6 +248,17 @@ call :dk_color2 %Blue% "Check this webpage for help - " %_Yellow% " %mas%in-plac
goto dk_done goto dk_done
) )
REM check for Mal-ware that may cause issues with Powershell
for /r "%ProgramFiles%\" %%f in (secureboot.exe) do if exist "%%f" (
echo "%%f"
echo Mal%blank%ware found, PowerShell is not working properly.
echo:
set fixes=%fixes% %mas%remove_mal%w%ware
call :dk_color2 %Blue% "Check this webpage for help - " %_Yellow% " %mas%remove_mal%w%ware"
goto dk_done
)
REM check if .NET is working properly REM check if .NET is working properly
if /i "!tstresult2!"=="FullLanguage" ( if /i "!tstresult2!"=="FullLanguage" (
@ -260,17 +272,6 @@ goto dk_done
) )
) )
REM check for Mal-ware that may cause issues with Powershell
for /r "%ProgramFiles%\" %%f in (secureboot.exe) do if exist "%%f" (
echo "%%f"
echo Mal%blank%ware found, PowerShell is not working properly.
echo:
set fixes=%fixes% %mas%remove_mal%w%ware
call :dk_color2 %Blue% "Check this webpage for help - " %_Yellow% " %mas%remove_mal%w%ware"
goto dk_done
)
REM check antivirus and other errors REM check antivirus and other errors
echo PowerShell is not working properly. Aborting... echo PowerShell is not working properly. Aborting...
@ -1655,7 +1656,7 @@ exit /b
set ps=%SysPath%\WindowsPowerShell\v1.0\powershell.exe set ps=%SysPath%\WindowsPowerShell\v1.0\powershell.exe
set psc=%ps% -nop -c set psc=%ps% -nop -c
set winbuild=1 set winbuild=1
for /f "tokens=6 delims=[]. " %%G in ('ver') do set winbuild=%%G for /f "tokens=2 delims=[]" %%G in ('ver') do for /f "tokens=2,3,4 delims=. " %%H in ("%%~G") do set "winbuild=%%J"
set _slexe=sppsvc.exe& set _slser=sppsvc set _slexe=sppsvc.exe& set _slser=sppsvc
if %winbuild% LEQ 6300 (set _slexe=SLsvc.exe& set _slser=SLsvc) if %winbuild% LEQ 6300 (set _slexe=SLsvc.exe& set _slser=SLsvc)

View File

@ -6,25 +6,42 @@
<hr> <hr>
## How to Activate Windows / Office? ## How to Activate Windows / Office / Extended Updates (ESU)?
### Method 1 - PowerShell (Windows 8 and later) ❤️ ### Method 1 - PowerShell ❤️
1. **Open PowerShell** 1. **Open PowerShell**
To do that, press the Windows key + X, then select PowerShell or Terminal. Click the **Start Menu**, type `PowerShell`, then open it.
2. **Copy and paste the code below, then press enter.** 2. **Copy and paste the code below, then press enter.**
``` - For **Windows 8, 10, 11**: 📌
irm https://get.activated.win | iex ```
``` irm https://get.activated.win | iex
Alternatively, you can use the following (this will be deprecated in the future): ```
``` - For **Windows 7** and later:
irm https://massgrave.dev/get | iex ```
``` iex ((New-Object Net.WebClient).DownloadString('https://get.activated.win'))
```
3. You will see the activation options. Choose the activation options highlighted in green. <details>
4. That's all <summary>Script not launching❓Click here for info.</summary>
---
- If the above is blocked (by ISP/DNS), try this (needs **updated Windows 10 or 11**):
```
iex (curl.exe -s --doh-url https://1.1.1.1/dns-query https://get.activated.win | Out-String)
```
- If that fails or you have an older Windows, use the below-listed Method 2.
---
</details>
3. The activation menu will appear. **Choose the green-highlighted options** to activate Windows or Office.
4. **Done!**
--- ---
@ -47,16 +64,14 @@ or
--- ---
- To activate additional products such as **Office for macOS, Visual Studio, RDS CALs, and Windows XP**, check [here](https://massgrave.dev/unsupported_products_activation). > [!TIP]
- To run the scripts in unattended mode, check [here](https://massgrave.dev/command_line_switches). > - Some ISPs/DNS block access to our domains. You can bypass this by enabling [DNS-over-HTTPS (DoH)](https://developers.cloudflare.com/1.1.1.1/encryption/dns-over-https/encrypted-dns-browsers/) in your browser.
> - **Having trouble**❓Visit our [troubleshooting page](https://massgrave.dev/troubleshoot) or raise an issue on [GitHub](https://github.com/massgravel/Microsoft-Activation-Scripts/issues).
--- ---
### Not working ❓ - To activate additional products such as **Office for macOS, Visual Studio, RDS CALs, and Windows XP**, check [here](https://massgrave.dev/unsupported_products_activation).
- To run the scripts in unattended mode, check [here](https://massgrave.dev/command_line_switches).
- If you are **unable to launch MAS** using the PowerShell method, please refer to **Method 2** listed above.
- If MAS is launched and the script shows any errors, check for any troubleshooting steps mentioned in blue color and try to follow those.
- If you have any issues, please feel free to reach out to us [here](https://massgrave.dev/troubleshoot).
--- ---
@ -69,8 +84,8 @@ or
--- ---
``` ```
Latest Version: 3.4 Latest Version: 3.5
Release date: 3-June-2025 Release date: 10-Aug-2025
``` ```
### [Troubleshooting / Help](https://massgrave.dev/troubleshoot) ### [Troubleshooting / Help](https://massgrave.dev/troubleshoot)