mirror of
https://github.com/massgravel/Microsoft-Activation-Scripts.git
synced 2025-07-05 09:21:19 +01:00
Compare commits
30 Commits
f5a0a63165
...
3.2
Author | SHA1 | Date | |
---|---|---|---|
bf28e4fbdd | |||
2a2352428e | |||
be9215b728 | |||
93cf3864f5 | |||
d47a750bad | |||
817bfe84de | |||
2b40259b33 | |||
a514a99d0e | |||
2a806c2e0c | |||
b3aaff5110 | |||
bcc4214e8a | |||
9e80556df5 | |||
b24bb9bde1 | |||
dfebdefeba | |||
1bdee1ce6f | |||
4e702068be | |||
6945236590 | |||
5872b7df53 | |||
b8ad749bac | |||
5090cde0a0 | |||
af18bd773c | |||
52ba9f138f | |||
98ef9db3ce | |||
172fd7b1c5 | |||
372eb73a02 | |||
a1614e1283 | |||
e8bf344f74 | |||
70162c4130 | |||
294837dfe0 | |||
313f240448 |
6
.gitattributes
vendored
6
.gitattributes
vendored
@ -1,4 +1,4 @@
|
||||
# MAS export-ignore
|
||||
# LICENSE export-ignore
|
||||
# README.md export-ignore
|
||||
MAS export-ignore
|
||||
LICENSE export-ignore
|
||||
README.md export-ignore
|
||||
.gitattributes export-ignore
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -1,4 +1,4 @@
|
||||
@set masver=3.0
|
||||
@set masver=3.2
|
||||
@echo off
|
||||
|
||||
|
||||
@ -235,7 +235,7 @@ goto dk_done
|
||||
|
||||
::pstst $ExecutionContext.SessionState.LanguageMode :pstst
|
||||
|
||||
for /f "delims=" %%a in ('cmd /c "%psc% ""if ($PSVersionTable.PSEdition -ne 'Core') {$f=[io.file]::ReadAllText('!_batp!') -split ':pstst';iex ($f[1])}""" %nul6%') do (set tstresult=%%a)
|
||||
for /f "delims=" %%a in ('%psc% "if ($PSVersionTable.PSEdition -ne 'Core') {$f=[io.file]::ReadAllText('!_batp!') -split ':pstst';iex ($f[1])}" %nul6%') do (set tstresult=%%a)
|
||||
|
||||
if /i not "%tstresult%"=="FullLanguage" (
|
||||
%eline%
|
||||
@ -381,8 +381,13 @@ if not exist %SysPath%\%%# (
|
||||
%eline%
|
||||
echo [%SysPath%\%%#] file is missing, aborting...
|
||||
echo:
|
||||
if not defined results (
|
||||
call :dk_color %Blue% "Go back to Main Menu, select Troubleshoot and run DISM Restore and SFC Scan options."
|
||||
call :dk_color %Blue% "After that, restart system and try activation again."
|
||||
echo:
|
||||
set fixes=%fixes% %mas%troubleshoot
|
||||
call :dk_color2 %Blue% "Check this webpage for help - " %_Yellow% " %mas%troubleshoot"
|
||||
)
|
||||
goto dk_done
|
||||
)
|
||||
)
|
||||
@ -538,6 +543,7 @@ call :dk_color %Blue% "Windows Subscription [SKU ID-%slcSKU%] detected. Script w
|
||||
echo:
|
||||
)
|
||||
|
||||
set generickey=1
|
||||
call :dk_inskey "[%key%]"
|
||||
|
||||
::========================================================================================================================================
|
||||
@ -808,10 +814,16 @@ goto :dk_done
|
||||
|
||||
:dk_setvar
|
||||
|
||||
set psc=powershell.exe -nop -c
|
||||
set ps=%SysPath%\WindowsPowerShell\v1.0\powershell.exe
|
||||
set psc=%ps% -nop -c
|
||||
set winbuild=1
|
||||
for /f "tokens=6 delims=[]. " %%G in ('ver') do set winbuild=%%G
|
||||
|
||||
set _slexe=sppsvc.exe& set _slser=sppsvc
|
||||
if %winbuild% LEQ 6300 (set _slexe=SLsvc.exe& set _slser=SLsvc)
|
||||
if %winbuild% LSS 7600 if exist "%SysPath%\SLsvc.exe" (set _slexe=SLsvc.exe& set _slser=SLsvc)
|
||||
if %_slexe%==SLsvc.exe set _vis=1
|
||||
|
||||
set _NCS=1
|
||||
if %winbuild% LSS 10586 set _NCS=0
|
||||
if %winbuild% GEQ 10586 reg query "HKCU\Console" /v ForceV2 %nul2% | find /i "0x0" %nul1% && (set _NCS=0)
|
||||
@ -951,11 +963,12 @@ set keyerror=%errorlevel%
|
||||
cmd /c exit /b %keyerror%
|
||||
if %keyerror% NEQ 0 set "keyerror=[0x%=ExitCode%]"
|
||||
|
||||
if defined generickey (set "keyecho=Installing Generic Product Key ") else (set "keyecho=Installing Product Key ")
|
||||
if %keyerror% EQU 0 (
|
||||
if %sps%==SoftwareLicensingService call :dk_refresh
|
||||
echo Installing Generic Product Key %~1 [Successful]
|
||||
echo %keyecho% %~1 [Successful]
|
||||
) else (
|
||||
call :dk_color %Red% "Installing Generic Product Key %~1 [Failed] %keyerror%"
|
||||
call :dk_color %Red% "%keyecho% %~1 [Failed] %keyerror%"
|
||||
if not defined error (
|
||||
if defined altapplist call :dk_color %Red% "Activation ID not found for this key."
|
||||
call :dk_color %Blue% "%_fixmsg%"
|
||||
@ -964,6 +977,7 @@ set showfix=1
|
||||
set error=1
|
||||
)
|
||||
|
||||
set generickey=
|
||||
exit /b
|
||||
|
||||
:: Activation command
|
||||
@ -1002,6 +1016,8 @@ exit /b
|
||||
|
||||
:dk_reeval
|
||||
|
||||
if %winbuild% LSS 7600 exit /b
|
||||
|
||||
:: This key is left by the system in rearm process and sppsvc sometimes fails to delete it, it causes issues in working of the Scheduled Tasks of SPP
|
||||
|
||||
set "ruleskey=HKU\S-1-5-20\Software\Microsoft\Windows NT\CurrentVersion\SoftwareProtectionPlatform\PersistedSystemState"
|
||||
@ -1047,13 +1063,13 @@ function InstallLicenseArr($Str) {
|
||||
ForEach ($x in $a) {InstallLicenseFile "$x"}
|
||||
}
|
||||
function InstallLicenseDir($Loc) {
|
||||
dir $Loc *.xrm-ms -af -s | select -expand FullName | % {InstallLicenseFile "$_"}
|
||||
Get-ChildItem $Loc -Recurse -Filter *.xrm-ms | ForEach-Object {InstallLicenseFile $_.FullName}
|
||||
}
|
||||
function ReinstallLicenses() {
|
||||
$Oem = "$env:SysPath\oem"
|
||||
$Spp = "$env:SysPath\spp\tokens"
|
||||
InstallLicenseDir "$Spp"
|
||||
If (Test-Path $Oem) {InstallLicenseDir "$Oem"}
|
||||
$Paths = @("$env:SysPath\oem", "$env:SysPath\licensing", "$env:SysPath\spp\tokens")
|
||||
foreach ($Path in $Paths) {
|
||||
if (Test-Path $Path) { InstallLicenseDir "$Path" }
|
||||
}
|
||||
}
|
||||
:xrm:
|
||||
|
||||
@ -1061,6 +1077,7 @@ function ReinstallLicenses() {
|
||||
|
||||
:dk_ckeckwmic
|
||||
|
||||
if %winbuild% LSS 9200 (set _wmic=1&exit /b)
|
||||
set _wmic=0
|
||||
for %%# in (wmic.exe) do @if not "%%~$PATH:#"=="" (
|
||||
cmd /c "wmic path Win32_ComputerSystem get CreationClassName /value" %nul2% | find /i "computersystem" %nul1% && set _wmic=1
|
||||
@ -1071,16 +1088,16 @@ exit /b
|
||||
|
||||
:dk_sppissue
|
||||
|
||||
sc start sppsvc %nul%
|
||||
sc start %_slser% %nul%
|
||||
set spperror=%errorlevel%
|
||||
|
||||
if %spperror% NEQ 1056 if %spperror% NEQ 0 (
|
||||
%eline%
|
||||
echo sc start sppsvc [Error Code: %spperror%]
|
||||
echo sc start %_slser% [Error Code: %spperror%]
|
||||
)
|
||||
|
||||
echo:
|
||||
%psc% "$job = Start-Job { (Get-WmiObject -Query 'SELECT * FROM %sps%').Version }; if (-not (Wait-Job $job -Timeout 30)) {write-host 'sppsvc is not working correctly. Check this webpage for help - %mas%troubleshoot'}"
|
||||
%psc% "$job = Start-Job { (Get-WmiObject -Query 'SELECT * FROM %sps%').Version }; if (-not (Wait-Job $job -Timeout 30)) {write-host '%_slser% is not working correctly. Check this webpage for help - %mas%troubleshoot'}"
|
||||
exit /b
|
||||
|
||||
:: Get Product name (WMI/REG methods are not reliable in all conditions, hence winbrand.dll method is used)
|
||||
@ -1088,7 +1105,7 @@ exit /b
|
||||
:dk_product
|
||||
|
||||
set d1=%ref% $meth = $TypeBuilder.DefinePInvokeMethod('BrandingFormatString', 'winbrand.dll', 'Public, Static', 1, [String], @([String]), 1, 3);
|
||||
set d1=%d1% $meth.SetImplementationFlags(128); $TypeBuilder.CreateType()::BrandingFormatString('%%WINDOWS_LONG%%')
|
||||
set d1=%d1% $meth.SetImplementationFlags(128); $TypeBuilder.CreateType()::BrandingFormatString('%%WINDOWS_LONG%%') -replace [string][char]0xa9, '' -replace [string][char]0xae, '' -replace [string][char]0x2122, ''
|
||||
|
||||
set winos=
|
||||
for /f "delims=" %%s in ('"%psc% %d1%"') do if not errorlevel 1 (set winos=%%s)
|
||||
@ -1144,11 +1161,11 @@ for %%# in (avira.com kaspersky.com virustotal.com mcafee.com) do (
|
||||
find /i "%%#" %SysPath%\drivers\etc\hosts %nul% && set /a hcount+=1)
|
||||
if %hcount%==4 set "results=[Antivirus URLs are blocked in hosts]"
|
||||
|
||||
sc start sppsvc %nul%
|
||||
sc start %_slser% %nul%
|
||||
echo "%errorlevel%" | findstr "577 225" %nul% && (
|
||||
set "results=%results%[Likely File Infector]"
|
||||
) || (
|
||||
if not exist %SysPath%\sppsvc.exe if not exist %SysPath%\alg.exe (set "results=%results%[Likely File Infector]")
|
||||
if not exist %SysPath%\%_slexe% if not exist %SysPath%\alg.exe (set "results=%results%[Likely File Infector]")
|
||||
)
|
||||
|
||||
if not "%results%%pupfound%"=="" (
|
||||
@ -1228,6 +1245,7 @@ for %%# in (%serv_ste%) do (
|
||||
if /i %%#==ClipSVC (reg add "HKLM\SYSTEM\CurrentControlSet\Services\%%#" /v "Start" /t REG_DWORD /d "3" /f %nul% & sc config %%# start= demand %nul%)
|
||||
if /i %%#==wlidsvc sc config %%# start= demand %nul%
|
||||
if /i %%#==sppsvc (reg add "HKLM\SYSTEM\CurrentControlSet\Services\%%#" /v "Start" /t REG_DWORD /d "2" /f %nul% & sc config %%# start= delayed-auto %nul%)
|
||||
if /i %%#==SLsvc sc config %%# start= auto %nul%
|
||||
if /i %%#==KeyIso sc config %%# start= demand %nul%
|
||||
if /i %%#==LicenseManager sc config %%# start= demand %nul%
|
||||
if /i %%#==Winmgmt sc config %%# start= auto %nul%
|
||||
@ -1357,19 +1375,22 @@ if %osedition%==0 (
|
||||
call :dk_color %Red% "Checking Edition Name [Not Found In Registry]"
|
||||
) else (
|
||||
|
||||
if not exist "%SysPath%\spp\tokens\skus\%osedition%\%osedition%*.xrm-ms" if not exist "%SysPath%\spp\tokens\skus\Security-SPP-Component-SKU-%osedition%\*-%osedition%-*.xrm-ms" (
|
||||
if not exist "%SysPath%\spp\tokens\skus\%osedition%\%osedition%*.xrm-ms" if not exist "%SysPath%\spp\tokens\skus\Security-SPP-Component-SKU-%osedition%\*-%osedition%-*.xrm-ms" if not exist "%SysPath%\licensing\skus\Security-Licensing-SLC-Component-SKU-%osedition%\*-%osedition%-*.xrm-ms" (
|
||||
set skunotfound=1
|
||||
call :dk_color %Red% "Checking License Files [Not Found] [%osedition%]"
|
||||
)
|
||||
|
||||
if not exist "%SystemRoot%\Servicing\Packages\Microsoft-Windows-*-%osedition%-*.mum" (
|
||||
if not exist "%SystemRoot%\Servicing\Packages\Microsoft-Windows-%osedition%Edition*.mum" (
|
||||
call :dk_color %Red% "Checking Package Files [Not Found] [%osedition%]"
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
|
||||
|
||||
%psc% "try { $null=([WMISEARCHER]'SELECT * FROM %sps%').Get().Version; exit 0 } catch { exit $_.Exception.InnerException.HResult }" %nul%
|
||||
if %_wmic% EQU 1 wmic path %sps% get Version %nul%
|
||||
if %_wmic% EQU 0 %psc% "try { $null=([WMISEARCHER]'SELECT * FROM %sps%').Get().Version; exit 0 } catch { exit $_.Exception.InnerException.HResult }" %nul%
|
||||
set error_code=%errorlevel%
|
||||
cmd /c exit /b %error_code%
|
||||
if %error_code% NEQ 0 set "error_code=0x%=ExitCode%"
|
||||
@ -1439,7 +1460,7 @@ call :dk_color2 %Blue% "In case of activation issues, do this - " %_Yellow% " %m
|
||||
)
|
||||
|
||||
|
||||
for %%# in (SppEx%w%tComObj.exe sppsvc.exe sppsvc.exe\PerfOptions) do (
|
||||
for %%# in (SppEx%w%tComObj.exe SLsvc.exe sppsvc.exe sppsvc.exe\PerfOptions) do (
|
||||
reg query "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Ima%w%ge File Execu%w%tion Options\%%#" %nul% && (if defined _sppint (set "_sppint=!_sppint!, %%#") else (set "_sppint=%%#"))
|
||||
)
|
||||
if defined _sppint (
|
||||
@ -1453,14 +1474,14 @@ echo Checking SPP In IFEO [%_sppint%]
|
||||
)
|
||||
|
||||
|
||||
for /f "skip=2 tokens=2*" %%a in ('reg query "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\SoftwareProtectionPlatform" /v "SkipRearm" %nul6%') do if /i %%b NEQ 0x0 (
|
||||
if %winbuild% GEQ 7600 for /f "skip=2 tokens=2*" %%a in ('reg query "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\SoftwareProtectionPlatform" /v "SkipRearm" %nul6%') do if /i %%b NEQ 0x0 (
|
||||
reg add "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\SoftwareProtectionPlatform" /v "SkipRearm" /t REG_DWORD /d "0" /f %nul%
|
||||
call :dk_color %Red% "Checking SkipRearm [Default 0 Value Not Found. Changing To 0]"
|
||||
%psc% "Start-Job { Stop-Service sppsvc -force } | Wait-Job -Timeout 20 | Out-Null"
|
||||
)
|
||||
|
||||
|
||||
reg query "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\SoftwareProtectionPlatform\Plugins\Objects\msft:rm/algorithm/hwid/4.0" /f ba02fed39662 /d %nul% || (
|
||||
if %winbuild% GEQ 7600 reg query "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\SoftwareProtectionPlatform\Plugins\Objects\msft:rm/algorithm/hwid/4.0" /f ba02fed39662 /d %nul% || (
|
||||
call :dk_color %Red% "Checking SPP Registry Key [Incorrect ModuleId Found]"
|
||||
set fixes=%fixes% %mas%issues_due_to_gaming_spoofers
|
||||
call :dk_color2 %Blue% "Most likely caused by gaming spoofers. Check this webpage for help - " %_Yellow% " %mas%issues_due_to_gaming_spoofers"
|
||||
@ -1470,21 +1491,22 @@ set showfix=1
|
||||
|
||||
|
||||
set tokenstore=
|
||||
if %winbuild% GEQ 7600 (
|
||||
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% LSS 9200 set "tokenstore=%Systemdrive%\Windows\ServiceProfiles\NetworkService\AppData\Roaming\Microsoft\SoftwareProtectionPlatform"
|
||||
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" (
|
||||
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 toerr=1
|
||||
set error=1
|
||||
set showfix=1
|
||||
call :dk_color %Red% "Checking TokenStore Registry Key [Correct Path Not Found] [%tokenstore%]"
|
||||
call :dk_color %Red% "Checking TokenStore Registry Key [Correct Path Not Found] [!tokenstore!]"
|
||||
set fixes=%fixes% %mas%troubleshoot
|
||||
call :dk_color2 %Blue% "Check this webpage for help - " %_Yellow% " %mas%troubleshoot"
|
||||
)
|
||||
|
||||
)
|
||||
|
||||
:: This code creates token folder only if it's missing and sets default permission for it
|
||||
|
||||
if not defined toerr if not exist "%tokenstore%\" (
|
||||
if %winbuild% GEQ 7600 if not defined toerr if not exist "%tokenstore%\" (
|
||||
mkdir "%tokenstore%" %nul%
|
||||
if %winbuild% LSS 9200 set "d=$sddl = 'O:NSG:NSD:AI(A;OICIID;FA;;;SY)(A;OICIID;FA;;;BA)(A;OICIID;FA;;;NS)';"
|
||||
if %winbuild% GEQ 9200 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)';"
|
||||
@ -1505,7 +1527,7 @@ set showfix=1
|
||||
if not defined notwinact (
|
||||
call :dk_actid 55c92734-d682-4d71-983e-d6ec3f16059f
|
||||
if not defined apps (
|
||||
%psc% "Start-Job { Stop-Service sppsvc -force } | Wait-Job -Timeout 20 | Out-Null; $sls = Get-WmiObject SoftwareLicensingService; $f=[io.file]::ReadAllText('!_batp!') -split ':xrm\:.*';iex ($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=[io.file]::ReadAllText('!_batp!') -split ':xrm\:.*';iex ($f[1]); ReinstallLicenses" %nul%
|
||||
call :dk_actid 55c92734-d682-4d71-983e-d6ec3f16059f
|
||||
if not defined apps (
|
||||
set "_notfoundids=Key Not Installed / Act ID Not Found"
|
||||
@ -1520,7 +1542,7 @@ call :dk_color %Red% "Checking Activation IDs [!_notfoundids!]"
|
||||
)
|
||||
|
||||
|
||||
if exist "%tokenstore%\" if not exist "%tokenstore%\tokens.dat" (
|
||||
if %winbuild% GEQ 7600 if exist "%tokenstore%\" if not exist "%tokenstore%\tokens.dat" (
|
||||
set error=1
|
||||
call :dk_color %Red% "Checking SPP tokens.dat [Not Found] [%tokenstore%\]"
|
||||
)
|
||||
@ -1655,8 +1677,10 @@ $wpaKey.Close()
|
||||
|
||||
if %_NCS% EQU 1 (
|
||||
echo %esc%[%~1%~2%esc%[0m
|
||||
) else (
|
||||
) else if exist %ps% (
|
||||
%psc% write-host -back '%1' -fore '%2' '%3'
|
||||
) else if not exist %ps% (
|
||||
echo %~3
|
||||
)
|
||||
exit /b
|
||||
|
||||
@ -1664,8 +1688,10 @@ exit /b
|
||||
|
||||
if %_NCS% EQU 1 (
|
||||
echo %esc%[%~1%~2%esc%[%~3%~4%esc%[0m
|
||||
) else (
|
||||
) else if exist %ps% (
|
||||
%psc% write-host -back '%1' -fore '%2' '%3' -NoNewline; write-host -back '%4' -fore '%5' '%6'
|
||||
) else if not exist %ps% (
|
||||
echo %~3 %~6
|
||||
)
|
||||
exit /b
|
||||
|
||||
@ -1680,6 +1706,7 @@ if defined fixes (
|
||||
call :dk_color %White% "Follow ALL the ABOVE blue lines. "
|
||||
call :dk_color2 %Blue% "Press [1] to Open Support Webpage " %Gray% " Press [0] to Ignore"
|
||||
choice /C:10 /N
|
||||
if !errorlevel!==2 exit /b
|
||||
if !errorlevel!==1 (for %%# in (%fixes%) do (start %%#))
|
||||
)
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
@set masver=3.0
|
||||
@set masver=3.2
|
||||
@echo off
|
||||
|
||||
|
||||
@ -238,7 +238,7 @@ goto dk_done
|
||||
|
||||
::pstst $ExecutionContext.SessionState.LanguageMode :pstst
|
||||
|
||||
for /f "delims=" %%a in ('cmd /c "%psc% ""if ($PSVersionTable.PSEdition -ne 'Core') {$f=[io.file]::ReadAllText('!_batp!') -split ':pstst';iex ($f[1])}""" %nul6%') do (set tstresult=%%a)
|
||||
for /f "delims=" %%a in ('%psc% "if ($PSVersionTable.PSEdition -ne 'Core') {$f=[io.file]::ReadAllText('!_batp!') -split ':pstst';iex ($f[1])}" %nul6%') do (set tstresult=%%a)
|
||||
|
||||
if /i not "%tstresult%"=="FullLanguage" (
|
||||
%eline%
|
||||
@ -421,8 +421,13 @@ if defined _fmiss (
|
||||
%eline%
|
||||
echo [%_fmiss%] file is missing, aborting...
|
||||
echo:
|
||||
if not defined results (
|
||||
call :dk_color %Blue% "Go back to Main Menu, select Troubleshoot and run DISM Restore and SFC Scan options."
|
||||
call :dk_color %Blue% "After that, restart system and try activation again."
|
||||
echo:
|
||||
set fixes=%fixes% %mas%troubleshoot
|
||||
call :dk_color2 %Blue% "Check this webpage for help - " %_Yellow% " %mas%troubleshoot"
|
||||
)
|
||||
goto dk_done
|
||||
)
|
||||
|
||||
@ -617,6 +622,7 @@ call echo Checking Installed Product Key [Partial Key - %%_partial%%] [
|
||||
)
|
||||
|
||||
if defined key (
|
||||
set generickey=1
|
||||
call :dk_inskey "[%key%]"
|
||||
)
|
||||
|
||||
@ -715,12 +721,6 @@ set "_xmlexist=if exist "%tdir%\GenuineTicket.xml""
|
||||
|
||||
%psc% "Start-Job { Stop-Service sppsvc -force } | Wait-Job -Timeout 20 | Out-Null"
|
||||
|
||||
sc query sppsvc | find /i "STOPPED" %nul% && (
|
||||
echo Stopping sppsvc Service [Successful]
|
||||
) || (
|
||||
call :dk_color %Gray% "Stopping sppsvc Service [Failed]"
|
||||
)
|
||||
|
||||
%_xmlexist% (
|
||||
%psc% "Start-Job { Restart-Service ClipSVC } | Wait-Job -Timeout 20 | Out-Null"
|
||||
%_xmlexist% timeout /t 2 %nul%
|
||||
@ -914,10 +914,16 @@ $key.SetAccessControl($acl)
|
||||
|
||||
:dk_setvar
|
||||
|
||||
set psc=powershell.exe -nop -c
|
||||
set ps=%SysPath%\WindowsPowerShell\v1.0\powershell.exe
|
||||
set psc=%ps% -nop -c
|
||||
set winbuild=1
|
||||
for /f "tokens=6 delims=[]. " %%G in ('ver') do set winbuild=%%G
|
||||
|
||||
set _slexe=sppsvc.exe& set _slser=sppsvc
|
||||
if %winbuild% LEQ 6300 (set _slexe=SLsvc.exe& set _slser=SLsvc)
|
||||
if %winbuild% LSS 7600 if exist "%SysPath%\SLsvc.exe" (set _slexe=SLsvc.exe& set _slser=SLsvc)
|
||||
if %_slexe%==SLsvc.exe set _vis=1
|
||||
|
||||
set _NCS=1
|
||||
if %winbuild% LSS 10586 set _NCS=0
|
||||
if %winbuild% GEQ 10586 reg query "HKCU\Console" /v ForceV2 %nul2% | find /i "0x0" %nul1% && (set _NCS=0)
|
||||
@ -1076,11 +1082,12 @@ set keyerror=%errorlevel%
|
||||
cmd /c exit /b %keyerror%
|
||||
if %keyerror% NEQ 0 set "keyerror=[0x%=ExitCode%]"
|
||||
|
||||
if defined generickey (set "keyecho=Installing Generic Product Key ") else (set "keyecho=Installing Product Key ")
|
||||
if %keyerror% EQU 0 (
|
||||
if %sps%==SoftwareLicensingService call :dk_refresh
|
||||
echo Installing Generic Product Key %~1 [Successful]
|
||||
echo %keyecho% %~1 [Successful]
|
||||
) else (
|
||||
call :dk_color %Red% "Installing Generic Product Key %~1 [Failed] %keyerror%"
|
||||
call :dk_color %Red% "%keyecho% %~1 [Failed] %keyerror%"
|
||||
if not defined error (
|
||||
if defined altapplist call :dk_color %Red% "Activation ID not found for this key."
|
||||
call :dk_color %Blue% "%_fixmsg%"
|
||||
@ -1089,6 +1096,7 @@ set showfix=1
|
||||
set error=1
|
||||
)
|
||||
|
||||
set generickey=
|
||||
exit /b
|
||||
|
||||
:: Get Windows installed key channel
|
||||
@ -1124,6 +1132,8 @@ exit /b
|
||||
|
||||
:dk_reeval
|
||||
|
||||
if %winbuild% LSS 7600 exit /b
|
||||
|
||||
:: This key is left by the system in rearm process and sppsvc sometimes fails to delete it, it causes issues in working of the Scheduled Tasks of SPP
|
||||
|
||||
set "ruleskey=HKU\S-1-5-20\Software\Microsoft\Windows NT\CurrentVersion\SoftwareProtectionPlatform\PersistedSystemState"
|
||||
@ -1151,13 +1161,13 @@ function InstallLicenseArr($Str) {
|
||||
ForEach ($x in $a) {InstallLicenseFile "$x"}
|
||||
}
|
||||
function InstallLicenseDir($Loc) {
|
||||
dir $Loc *.xrm-ms -af -s | select -expand FullName | % {InstallLicenseFile "$_"}
|
||||
Get-ChildItem $Loc -Recurse -Filter *.xrm-ms | ForEach-Object {InstallLicenseFile $_.FullName}
|
||||
}
|
||||
function ReinstallLicenses() {
|
||||
$Oem = "$env:SysPath\oem"
|
||||
$Spp = "$env:SysPath\spp\tokens"
|
||||
InstallLicenseDir "$Spp"
|
||||
If (Test-Path $Oem) {InstallLicenseDir "$Oem"}
|
||||
$Paths = @("$env:SysPath\oem", "$env:SysPath\licensing", "$env:SysPath\spp\tokens")
|
||||
foreach ($Path in $Paths) {
|
||||
if (Test-Path $Path) { InstallLicenseDir "$Path" }
|
||||
}
|
||||
}
|
||||
:xrm:
|
||||
|
||||
@ -1165,6 +1175,7 @@ function ReinstallLicenses() {
|
||||
|
||||
:dk_ckeckwmic
|
||||
|
||||
if %winbuild% LSS 9200 (set _wmic=1&exit /b)
|
||||
set _wmic=0
|
||||
for %%# in (wmic.exe) do @if not "%%~$PATH:#"=="" (
|
||||
cmd /c "wmic path Win32_ComputerSystem get CreationClassName /value" %nul2% | find /i "computersystem" %nul1% && set _wmic=1
|
||||
@ -1175,16 +1186,16 @@ exit /b
|
||||
|
||||
:dk_sppissue
|
||||
|
||||
sc start sppsvc %nul%
|
||||
sc start %_slser% %nul%
|
||||
set spperror=%errorlevel%
|
||||
|
||||
if %spperror% NEQ 1056 if %spperror% NEQ 0 (
|
||||
%eline%
|
||||
echo sc start sppsvc [Error Code: %spperror%]
|
||||
echo sc start %_slser% [Error Code: %spperror%]
|
||||
)
|
||||
|
||||
echo:
|
||||
%psc% "$job = Start-Job { (Get-WmiObject -Query 'SELECT * FROM %sps%').Version }; if (-not (Wait-Job $job -Timeout 30)) {write-host 'sppsvc is not working correctly. Check this webpage for help - %mas%troubleshoot'}"
|
||||
%psc% "$job = Start-Job { (Get-WmiObject -Query 'SELECT * FROM %sps%').Version }; if (-not (Wait-Job $job -Timeout 30)) {write-host '%_slser% is not working correctly. Check this webpage for help - %mas%troubleshoot'}"
|
||||
exit /b
|
||||
|
||||
:: Get Product name (WMI/REG methods are not reliable in all conditions, hence winbrand.dll method is used)
|
||||
@ -1192,7 +1203,7 @@ exit /b
|
||||
:dk_product
|
||||
|
||||
set d1=%ref% $meth = $TypeBuilder.DefinePInvokeMethod('BrandingFormatString', 'winbrand.dll', 'Public, Static', 1, [String], @([String]), 1, 3);
|
||||
set d1=%d1% $meth.SetImplementationFlags(128); $TypeBuilder.CreateType()::BrandingFormatString('%%WINDOWS_LONG%%')
|
||||
set d1=%d1% $meth.SetImplementationFlags(128); $TypeBuilder.CreateType()::BrandingFormatString('%%WINDOWS_LONG%%') -replace [string][char]0xa9, '' -replace [string][char]0xae, '' -replace [string][char]0x2122, ''
|
||||
|
||||
set winos=
|
||||
for /f "delims=" %%s in ('"%psc% %d1%"') do if not errorlevel 1 (set winos=%%s)
|
||||
@ -1293,11 +1304,11 @@ for %%# in (avira.com kaspersky.com virustotal.com mcafee.com) do (
|
||||
find /i "%%#" %SysPath%\drivers\etc\hosts %nul% && set /a hcount+=1)
|
||||
if %hcount%==4 set "results=[Antivirus URLs are blocked in hosts]"
|
||||
|
||||
sc start sppsvc %nul%
|
||||
sc start %_slser% %nul%
|
||||
echo "%errorlevel%" | findstr "577 225" %nul% && (
|
||||
set "results=%results%[Likely File Infector]"
|
||||
) || (
|
||||
if not exist %SysPath%\sppsvc.exe if not exist %SysPath%\alg.exe (set "results=%results%[Likely File Infector]")
|
||||
if not exist %SysPath%\%_slexe% if not exist %SysPath%\alg.exe (set "results=%results%[Likely File Infector]")
|
||||
)
|
||||
|
||||
if not "%results%%pupfound%"=="" (
|
||||
@ -1377,6 +1388,7 @@ for %%# in (%serv_ste%) do (
|
||||
if /i %%#==ClipSVC (reg add "HKLM\SYSTEM\CurrentControlSet\Services\%%#" /v "Start" /t REG_DWORD /d "3" /f %nul% & sc config %%# start= demand %nul%)
|
||||
if /i %%#==wlidsvc sc config %%# start= demand %nul%
|
||||
if /i %%#==sppsvc (reg add "HKLM\SYSTEM\CurrentControlSet\Services\%%#" /v "Start" /t REG_DWORD /d "2" /f %nul% & sc config %%# start= delayed-auto %nul%)
|
||||
if /i %%#==SLsvc sc config %%# start= auto %nul%
|
||||
if /i %%#==KeyIso sc config %%# start= demand %nul%
|
||||
if /i %%#==LicenseManager sc config %%# start= demand %nul%
|
||||
if /i %%#==Winmgmt sc config %%# start= auto %nul%
|
||||
@ -1506,19 +1518,22 @@ if %osedition%==0 (
|
||||
call :dk_color %Red% "Checking Edition Name [Not Found In Registry]"
|
||||
) else (
|
||||
|
||||
if not exist "%SysPath%\spp\tokens\skus\%osedition%\%osedition%*.xrm-ms" if not exist "%SysPath%\spp\tokens\skus\Security-SPP-Component-SKU-%osedition%\*-%osedition%-*.xrm-ms" (
|
||||
if not exist "%SysPath%\spp\tokens\skus\%osedition%\%osedition%*.xrm-ms" if not exist "%SysPath%\spp\tokens\skus\Security-SPP-Component-SKU-%osedition%\*-%osedition%-*.xrm-ms" if not exist "%SysPath%\licensing\skus\Security-Licensing-SLC-Component-SKU-%osedition%\*-%osedition%-*.xrm-ms" (
|
||||
set skunotfound=1
|
||||
call :dk_color %Red% "Checking License Files [Not Found] [%osedition%]"
|
||||
)
|
||||
|
||||
if not exist "%SystemRoot%\Servicing\Packages\Microsoft-Windows-*-%osedition%-*.mum" (
|
||||
if not exist "%SystemRoot%\Servicing\Packages\Microsoft-Windows-%osedition%Edition*.mum" (
|
||||
call :dk_color %Red% "Checking Package Files [Not Found] [%osedition%]"
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
|
||||
|
||||
%psc% "try { $null=([WMISEARCHER]'SELECT * FROM %sps%').Get().Version; exit 0 } catch { exit $_.Exception.InnerException.HResult }" %nul%
|
||||
if %_wmic% EQU 1 wmic path %sps% get Version %nul%
|
||||
if %_wmic% EQU 0 %psc% "try { $null=([WMISEARCHER]'SELECT * FROM %sps%').Get().Version; exit 0 } catch { exit $_.Exception.InnerException.HResult }" %nul%
|
||||
set error_code=%errorlevel%
|
||||
cmd /c exit /b %error_code%
|
||||
if %error_code% NEQ 0 set "error_code=0x%=ExitCode%"
|
||||
@ -1588,7 +1603,7 @@ call :dk_color2 %Blue% "In case of activation issues, do this - " %_Yellow% " %m
|
||||
)
|
||||
|
||||
|
||||
for %%# in (SppEx%w%tComObj.exe sppsvc.exe sppsvc.exe\PerfOptions) do (
|
||||
for %%# in (SppEx%w%tComObj.exe SLsvc.exe sppsvc.exe sppsvc.exe\PerfOptions) do (
|
||||
reg query "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Ima%w%ge File Execu%w%tion Options\%%#" %nul% && (if defined _sppint (set "_sppint=!_sppint!, %%#") else (set "_sppint=%%#"))
|
||||
)
|
||||
if defined _sppint (
|
||||
@ -1602,14 +1617,14 @@ echo Checking SPP In IFEO [%_sppint%]
|
||||
)
|
||||
|
||||
|
||||
for /f "skip=2 tokens=2*" %%a in ('reg query "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\SoftwareProtectionPlatform" /v "SkipRearm" %nul6%') do if /i %%b NEQ 0x0 (
|
||||
if %winbuild% GEQ 7600 for /f "skip=2 tokens=2*" %%a in ('reg query "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\SoftwareProtectionPlatform" /v "SkipRearm" %nul6%') do if /i %%b NEQ 0x0 (
|
||||
reg add "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\SoftwareProtectionPlatform" /v "SkipRearm" /t REG_DWORD /d "0" /f %nul%
|
||||
call :dk_color %Red% "Checking SkipRearm [Default 0 Value Not Found. Changing To 0]"
|
||||
%psc% "Start-Job { Stop-Service sppsvc -force } | Wait-Job -Timeout 20 | Out-Null"
|
||||
)
|
||||
|
||||
|
||||
reg query "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\SoftwareProtectionPlatform\Plugins\Objects\msft:rm/algorithm/hwid/4.0" /f ba02fed39662 /d %nul% || (
|
||||
if %winbuild% GEQ 7600 reg query "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\SoftwareProtectionPlatform\Plugins\Objects\msft:rm/algorithm/hwid/4.0" /f ba02fed39662 /d %nul% || (
|
||||
call :dk_color %Red% "Checking SPP Registry Key [Incorrect ModuleId Found]"
|
||||
set fixes=%fixes% %mas%issues_due_to_gaming_spoofers
|
||||
call :dk_color2 %Blue% "Most likely caused by gaming spoofers. Check this webpage for help - " %_Yellow% " %mas%issues_due_to_gaming_spoofers"
|
||||
@ -1619,21 +1634,22 @@ set showfix=1
|
||||
|
||||
|
||||
set tokenstore=
|
||||
if %winbuild% GEQ 7600 (
|
||||
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% LSS 9200 set "tokenstore=%Systemdrive%\Windows\ServiceProfiles\NetworkService\AppData\Roaming\Microsoft\SoftwareProtectionPlatform"
|
||||
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" (
|
||||
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 toerr=1
|
||||
set error=1
|
||||
set showfix=1
|
||||
call :dk_color %Red% "Checking TokenStore Registry Key [Correct Path Not Found] [%tokenstore%]"
|
||||
call :dk_color %Red% "Checking TokenStore Registry Key [Correct Path Not Found] [!tokenstore!]"
|
||||
set fixes=%fixes% %mas%troubleshoot
|
||||
call :dk_color2 %Blue% "Check this webpage for help - " %_Yellow% " %mas%troubleshoot"
|
||||
)
|
||||
|
||||
)
|
||||
|
||||
:: This code creates token folder only if it's missing and sets default permission for it
|
||||
|
||||
if not defined toerr if not exist "%tokenstore%\" (
|
||||
if %winbuild% GEQ 7600 if not defined toerr if not exist "%tokenstore%\" (
|
||||
mkdir "%tokenstore%" %nul%
|
||||
if %winbuild% LSS 9200 set "d=$sddl = 'O:NSG:NSD:AI(A;OICIID;FA;;;SY)(A;OICIID;FA;;;BA)(A;OICIID;FA;;;NS)';"
|
||||
if %winbuild% GEQ 9200 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)';"
|
||||
@ -1654,7 +1670,7 @@ set showfix=1
|
||||
if not defined notwinact (
|
||||
call :dk_actid 55c92734-d682-4d71-983e-d6ec3f16059f
|
||||
if not defined apps (
|
||||
%psc% "Start-Job { Stop-Service sppsvc -force } | Wait-Job -Timeout 20 | Out-Null; $sls = Get-WmiObject SoftwareLicensingService; $f=[io.file]::ReadAllText('!_batp!') -split ':xrm\:.*';iex ($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=[io.file]::ReadAllText('!_batp!') -split ':xrm\:.*';iex ($f[1]); ReinstallLicenses" %nul%
|
||||
call :dk_actid 55c92734-d682-4d71-983e-d6ec3f16059f
|
||||
if not defined apps (
|
||||
set "_notfoundids=Key Not Installed / Act ID Not Found"
|
||||
@ -1669,7 +1685,7 @@ call :dk_color %Red% "Checking Activation IDs [!_notfoundids!]"
|
||||
)
|
||||
|
||||
|
||||
if exist "%tokenstore%\" if not exist "%tokenstore%\tokens.dat" (
|
||||
if %winbuild% GEQ 7600 if exist "%tokenstore%\" if not exist "%tokenstore%\tokens.dat" (
|
||||
set error=1
|
||||
call :dk_color %Red% "Checking SPP tokens.dat [Not Found] [%tokenstore%\]"
|
||||
)
|
||||
@ -1804,8 +1820,10 @@ $wpaKey.Close()
|
||||
|
||||
if %_NCS% EQU 1 (
|
||||
echo %esc%[%~1%~2%esc%[0m
|
||||
) else (
|
||||
) else if exist %ps% (
|
||||
%psc% write-host -back '%1' -fore '%2' '%3'
|
||||
) else if not exist %ps% (
|
||||
echo %~3
|
||||
)
|
||||
exit /b
|
||||
|
||||
@ -1813,8 +1831,10 @@ exit /b
|
||||
|
||||
if %_NCS% EQU 1 (
|
||||
echo %esc%[%~1%~2%esc%[%~3%~4%esc%[0m
|
||||
) else (
|
||||
) else if exist %ps% (
|
||||
%psc% write-host -back '%1' -fore '%2' '%3' -NoNewline; write-host -back '%4' -fore '%5' '%6'
|
||||
) else if not exist %ps% (
|
||||
echo %~3 %~6
|
||||
)
|
||||
exit /b
|
||||
|
||||
@ -1829,6 +1849,7 @@ if defined fixes (
|
||||
call :dk_color %White% "Follow ALL the ABOVE blue lines. "
|
||||
call :dk_color2 %Blue% "Press [1] to Open Support Webpage " %Gray% " Press [0] to Ignore"
|
||||
choice /C:10 /N
|
||||
if !errorlevel!==2 exit /b
|
||||
if !errorlevel!==1 (for %%# in (%fixes%) do (start %%#))
|
||||
)
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
@set masver=3.0
|
||||
@set masver=3.2
|
||||
@echo off
|
||||
|
||||
|
||||
@ -171,12 +171,27 @@ call :dk_color2 %Blue% "Check this webpage for help - " %_Yellow% " %mas%trouble
|
||||
goto dk_done
|
||||
)
|
||||
|
||||
if %winbuild% LSS 9200 (
|
||||
%eline%
|
||||
if %winbuild% LSS 6001 (
|
||||
%nceline%
|
||||
echo Unsupported OS version detected [%winbuild%].
|
||||
echo Ohook Activation is supported only on Windows 8/10/11 and their server equivalents.
|
||||
echo MAS only supports Windows Vista/7/8/8.1/10/11 and their Server equivalents.
|
||||
if %winbuild% EQU 6000 (
|
||||
echo:
|
||||
call :dk_color %Blue% "Use Online KMS activation option instead."
|
||||
echo Windows Vista RTM is not supported because Powershell cannot be installed.
|
||||
echo Upgrade to Windows Vista SP1 or SP2.
|
||||
)
|
||||
goto dk_done
|
||||
)
|
||||
|
||||
if %winbuild% LSS 7600 if not exist "%SysPath%\WindowsPowerShell\v1.0\Modules" (
|
||||
%nceline%
|
||||
if not exist %ps% (
|
||||
echo PowerShell is not installed in your system.
|
||||
)
|
||||
echo Install PowerShell 2.0 using the following URL.
|
||||
echo:
|
||||
echo https://www.catalog.update.microsoft.com/Search.aspx?q=KB968930
|
||||
if %_unattended%==0 start https://www.catalog.update.microsoft.com/Search.aspx?q=KB968930
|
||||
goto dk_done
|
||||
)
|
||||
|
||||
@ -228,7 +243,7 @@ goto dk_done
|
||||
|
||||
::pstst $ExecutionContext.SessionState.LanguageMode :pstst
|
||||
|
||||
for /f "delims=" %%a in ('cmd /c "%psc% ""if ($PSVersionTable.PSEdition -ne 'Core') {$f=[io.file]::ReadAllText('!_batp!') -split ':pstst';iex ($f[1])}""" %nul6%') do (set tstresult=%%a)
|
||||
for /f "delims=" %%a in ('%psc% "if ($PSVersionTable.PSEdition -ne 'Core') {$f=[io.file]::ReadAllText('!_batp!') -split ':pstst';iex ($f[1])}" %nul6%') do (set tstresult=%%a)
|
||||
|
||||
if /i not "%tstresult%"=="FullLanguage" (
|
||||
%eline%
|
||||
@ -398,8 +413,8 @@ goto :oh_menu
|
||||
|
||||
cls
|
||||
if not defined terminal (
|
||||
mode 130, 32
|
||||
if exist "%SysPath%\spp\store_test\" mode 134, 32
|
||||
mode 140, 32
|
||||
if exist "%SysPath%\spp\store_test\" mode 140, 32
|
||||
%psc% "&{$W=$Host.UI.RawUI.WindowSize;$B=$Host.UI.RawUI.BufferSize;$W.Height=32;$B.Height=300;$Host.UI.RawUI.WindowSize=$W;$Host.UI.RawUI.BufferSize=$B;}" %nul%
|
||||
)
|
||||
title Ohook Activation %masver%
|
||||
@ -408,12 +423,17 @@ echo:
|
||||
echo Initializing...
|
||||
call :dk_chkmal
|
||||
|
||||
if not exist %SysPath%\sppsvc.exe (
|
||||
if not exist %SysPath%\%_slexe% (
|
||||
%eline%
|
||||
echo [%SysPath%\sppsvc.exe] file is missing, aborting...
|
||||
echo [%SysPath%\%_slexe%] file is missing, aborting...
|
||||
echo:
|
||||
if not defined results (
|
||||
call :dk_color %Blue% "Go back to Main Menu, select Troubleshoot and run DISM Restore and SFC Scan options."
|
||||
call :dk_color %Blue% "After that, restart system and try activation again."
|
||||
echo:
|
||||
set fixes=%fixes% %mas%troubleshoot
|
||||
call :dk_color2 %Blue% "Check this webpage for help - " %_Yellow% " %mas%troubleshoot"
|
||||
)
|
||||
goto dk_done
|
||||
)
|
||||
|
||||
@ -439,7 +459,7 @@ call :dk_showosinfo
|
||||
|
||||
echo Initiating Diagnostic Tests...
|
||||
|
||||
set "_serv=sppsvc Winmgmt"
|
||||
set "_serv=%_slser% Winmgmt"
|
||||
|
||||
:: Software Protection
|
||||
:: Windows Management Instrumentation
|
||||
@ -448,16 +468,15 @@ set notwinact=1
|
||||
set ohookact=1
|
||||
call :dk_errorcheck
|
||||
|
||||
call :oh_setspp
|
||||
|
||||
:: Check unsupported office versions
|
||||
|
||||
set o14msi=
|
||||
set o14c2r=
|
||||
set o16uwp=
|
||||
|
||||
set _68=HKLM\SOFTWARE\Microsoft\Office
|
||||
set _86=HKLM\SOFTWARE\Wow6432Node\Microsoft\Office
|
||||
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 o14msi=Office 2010 MSI )
|
||||
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 o14msi=Office 2010 MSI )
|
||||
%nul% reg query %_68%\14.0\CVH /f Click2run /k && set o14c2r=Office 2010 C2R
|
||||
%nul% reg query %_86%\14.0\CVH /f Click2run /k && set o14c2r=Office 2010 C2R
|
||||
|
||||
@ -465,10 +484,10 @@ if %winbuild% GEQ 10240 (
|
||||
for /f "delims=" %%a in ('%psc% "(Get-AppxPackage -name 'Microsoft.Office.Desktop' | Select-Object -ExpandProperty InstallLocation)" %nul6%') do (if exist "%%a\Integration\Integrator.exe" set o16uwp=Office UWP )
|
||||
)
|
||||
|
||||
if not "%o14msi%%o14c2r%%o16uwp%"=="" (
|
||||
if not "%o14c2r%%o16uwp%"=="" (
|
||||
echo:
|
||||
call :dk_color %Red% "Checking Unsupported Office Install [ %o14msi%%o14c2r%%o16uwp%]"
|
||||
if not "%o14msi%%o16uwp%"=="" call :dk_color %Blue% "Use Online KMS option to activate it."
|
||||
call :dk_color %Red% "Checking Unsupported Office Install [ %o14c2r%%o16uwp%]"
|
||||
if not "%o16uwp%"=="" call :dk_color %Blue% "Use TSforge option to activate it."
|
||||
)
|
||||
|
||||
if %winbuild% GEQ 10240 %psc% "Get-AppxPackage -name "Microsoft.MicrosoftOfficeHub"" | find /i "Office" %nul1% && (
|
||||
@ -499,10 +518,10 @@ set o15c2r=
|
||||
set error=1
|
||||
)
|
||||
|
||||
if "%o16c2r%%o15c2r%%o16msi%%o15msi%"=="" (
|
||||
if "%o16c2r%%o15c2r%%o16msi%%o15msi%%o14msi%"=="" (
|
||||
set error=1
|
||||
echo:
|
||||
if not "%o14msi%%o14c2r%%o16uwp%"=="" (
|
||||
if not "%o14c2r%%o16uwp%"=="" (
|
||||
call :dk_color %Red% "Checking Supported Office Install [Not Found]"
|
||||
) else (
|
||||
call :dk_color %Red% "Checking Installed Office [Not Found]"
|
||||
@ -521,8 +540,8 @@ goto dk_done
|
||||
)
|
||||
|
||||
set multioffice=
|
||||
if not "%o16c2r%%o15c2r%%o16msi%%o15msi%"=="1" set multioffice=1
|
||||
if not "%o14msi%%o14c2r%%o16uwp%"=="" set multioffice=1
|
||||
if not "%o16c2r%%o15c2r%%o16msi%%o15msi%%o14msi%"=="1" set multioffice=1
|
||||
if not "%o14c2r%%o16uwp%"=="" set multioffice=1
|
||||
|
||||
if defined multioffice (
|
||||
call :dk_color %Gray% "Checking Multiple Office Install [Found, its recommended to install only one version]"
|
||||
@ -566,12 +585,8 @@ set "_oIntegrator=%_oRoot%\integration\integrator.exe"
|
||||
|
||||
if /i "%_oArch%"=="x64" (set "_hookPath=%_oRoot%\vfs\System" & set "_hook=sppc64.dll")
|
||||
if /i "%_oArch%"=="x86" (set "_hookPath=%_oRoot%\vfs\SystemX86" & set "_hook=sppc32.dll")
|
||||
if not "%osarch%"=="x86" (
|
||||
if /i "%_oArch%"=="x64" set "_sppcPath=%SystemRoot%\System32\sppc.dll"
|
||||
if /i "%_oArch%"=="x86" set "_sppcPath=%SystemRoot%\SysWOW64\sppc.dll"
|
||||
) else (
|
||||
set "_sppcPath=%SystemRoot%\System32\sppc.dll"
|
||||
)
|
||||
|
||||
call :oh_ppcpath
|
||||
|
||||
echo:
|
||||
echo Activating Office... [C2R ^| %_version% ^| %_oArch%]
|
||||
@ -582,9 +597,20 @@ set error=1
|
||||
goto :starto16c2r
|
||||
)
|
||||
|
||||
if defined noOsppc (
|
||||
call :dk_color %Red% "Checking OSPPC.DLL [Not found. Aborting activation...]"
|
||||
call :dk_color %Blue% "%_fixmsg%"
|
||||
set error=1
|
||||
goto :starto16c2r
|
||||
)
|
||||
|
||||
call :oh_fixprids
|
||||
call :oh_process
|
||||
if defined isOspp (
|
||||
call :oh_hookinstall_ospp
|
||||
) else (
|
||||
call :oh_hookinstall
|
||||
)
|
||||
|
||||
::========================================================================================================================================
|
||||
|
||||
@ -616,12 +642,8 @@ set "_oIntegrator=%_oRoot%\integration\integrator.exe"
|
||||
|
||||
if /i "%_oArch%"=="x64" (set "_hookPath=%_oRoot%\vfs\System" & set "_hook=sppc64.dll")
|
||||
if /i "%_oArch%"=="x86" (set "_hookPath=%_oRoot%\vfs\SystemX86" & set "_hook=sppc32.dll")
|
||||
if not "%osarch%"=="x86" (
|
||||
if /i "%_oArch%"=="x64" set "_sppcPath=%SystemRoot%\System32\sppc.dll"
|
||||
if /i "%_oArch%"=="x86" set "_sppcPath=%SystemRoot%\SysWOW64\sppc.dll"
|
||||
) else (
|
||||
set "_sppcPath=%SystemRoot%\System32\sppc.dll"
|
||||
)
|
||||
|
||||
call :oh_ppcpath
|
||||
|
||||
echo:
|
||||
echo Activating Office... [C2R ^| %_version% %_AudienceData%^| %_oArch%]
|
||||
@ -632,9 +654,20 @@ set error=1
|
||||
goto :startmsi
|
||||
)
|
||||
|
||||
if defined noOsppc (
|
||||
call :dk_color %Red% "Checking OSPPC.DLL [Not found. Aborting activation...]"
|
||||
call :dk_color %Blue% "%_fixmsg%"
|
||||
set error=1
|
||||
goto :startmsi
|
||||
)
|
||||
|
||||
call :oh_fixprids
|
||||
call :oh_process
|
||||
if defined isOspp (
|
||||
call :oh_hookinstall_ospp
|
||||
) else (
|
||||
call :oh_hookinstall
|
||||
)
|
||||
|
||||
::========================================================================================================================================
|
||||
|
||||
@ -671,6 +704,9 @@ echo Adding a Registry to Prevent Banner [Successful]
|
||||
|
||||
:startmsi
|
||||
|
||||
if defined o14msi call :oh_setspp 14
|
||||
if defined o14msi call :oh_processmsi 14 %o14msi_reg%
|
||||
call :oh_setspp
|
||||
if defined o15msi call :oh_processmsi 15 %o15msi_reg%
|
||||
if defined o16msi call :oh_processmsi 16 %o16msi_reg%
|
||||
|
||||
@ -702,7 +738,7 @@ goto :dk_done
|
||||
:oh_uninstall
|
||||
|
||||
cls
|
||||
if not defined terminal mode 99, 32
|
||||
if not defined terminal mode 145, 32
|
||||
title Uninstall Ohook Activation %masver%
|
||||
|
||||
set _present=
|
||||
@ -718,6 +754,7 @@ if defined o16c2r_reg (for /f "skip=2 tokens=2*" %%a in ('"reg query %o16c2r_reg
|
||||
if defined o15c2r_reg (for /f "skip=2 tokens=2*" %%a in ('"reg query %o15c2r_reg% /v InstallPath" %nul6%') do (set "_15CHook=%%b\root\vfs"))
|
||||
if defined o16msi_reg (for /f "skip=2 tokens=2*" %%a in ('"reg query %o16msi_reg%\Common\InstallRoot /v Path" %nul6%') do (set "_16MHook=%%b"))
|
||||
if defined o15msi_reg (for /f "skip=2 tokens=2*" %%a in ('"reg query %o15msi_reg%\Common\InstallRoot /v Path" %nul6%') do (set "_15MHook=%%b"))
|
||||
if defined o14msi_reg (for /f "skip=2 tokens=2*" %%a in ('"reg query %o14msi_reg%\Common\InstallRoot /v Path" %nul6%') do (set "_14MHook=%%b"))
|
||||
|
||||
if defined _16CHook (if exist "%_16CHook%\System\sppc*dll" (set _present=1& del /s /f /q "%_16CHook%\System\sppc*dll" & if exist "%_16CHook%\System\sppc*dll" set _unerror=1))
|
||||
if defined _16CHook (if exist "%_16CHook%\SystemX86\sppc*dll" (set _present=1& del /s /f /q "%_16CHook%\SystemX86\sppc*dll" & if exist "%_16CHook%\SystemX86\sppc*dll" set _unerror=1))
|
||||
@ -725,8 +762,9 @@ if defined _15CHook (if exist "%_15CHook%\System\sppc*dll" (set _present=1& d
|
||||
if defined _15CHook (if exist "%_15CHook%\SystemX86\sppc*dll" (set _present=1& del /s /f /q "%_15CHook%\SystemX86\sppc*dll" & if exist "%_15CHook%\SystemX86\sppc*dll" set _unerror=1))
|
||||
if defined _16MHook (if exist "%_16MHook%sppc*dll" (set _present=1& del /s /f /q "%_16MHook%sppc*dll" & if exist "%_16MHook%sppc*dll" set _unerror=1))
|
||||
if defined _15MHook (if exist "%_15MHook%sppc*dll" (set _present=1& del /s /f /q "%_15MHook%sppc*dll" & if exist "%_15MHook%sppc*dll" set _unerror=1))
|
||||
if defined _14MHook (if exist "%_14MHook%sppc*dll" (set _present=1& del /s /f /q "%_14MHook%sppc*dll" & if exist "%_14MHook%sppc*dll" set _unerror=1))
|
||||
|
||||
for %%# in (15 16) do (
|
||||
for %%# in (14 15 16) do (
|
||||
for %%A in ("%ProgramFiles%" "%ProgramW6432%" "%ProgramFiles(x86)%") do (
|
||||
if exist "%%~A\Microsoft Office\Office%%#\sppc*dll" (set _present=1& del /s /f /q "%%~A\Microsoft Office\Office%%#\sppc*dll" & if exist "%%~A\Microsoft Office\Office%%#\sppc*dll" set _unerror=1)
|
||||
)
|
||||
@ -740,6 +778,31 @@ if exist "%%~A\Microsoft %%~G\root\vfs\%%#\sppc*dll" (set _present=1& del /s /f
|
||||
)
|
||||
)
|
||||
|
||||
::==================================
|
||||
|
||||
for %%# in (OSPPC.DLL sppcs.dll) do (
|
||||
for %%A in ("%CommonProgramFiles%" "%CommonProgramW6432%" "%CommonProgramFiles(x86)%") do (
|
||||
for %%G in ("%%~A\Microsoft Shared\OfficeSoftwareProtectionPlatform\%%#") do (
|
||||
set size=0
|
||||
set size=%%~zG
|
||||
if !size! GEQ 1 if !size! LSS 100000 (
|
||||
set _present=1
|
||||
del /f /q "%%~G"
|
||||
if exist "%%~G" (move /y "%%~G" "!_ttemp!\needsToBeDeleted%random%" %nul%)
|
||||
if exist "%%~G" (set _unerror=1) else (echo Deleted file - %%~G)
|
||||
)
|
||||
if /i sppcs.dll==%%# if !size! GEQ 100000 (
|
||||
move /y "%%~G" "%%~A\Microsoft Shared\OfficeSoftwareProtectionPlatform\OSPPC.DLL" %nul%
|
||||
if exist "%%~G" (move /y "%%~A\Microsoft Shared\OfficeSoftwareProtectionPlatform\OSPPC.DLL" "!_ttemp!\needsToBeDeleted%random%" %nul%)
|
||||
move /y "%%~G" "%%~A\Microsoft Shared\OfficeSoftwareProtectionPlatform\OSPPC.DLL" %nul%
|
||||
if exist "%%~G" (set _unerror=1&echo Failed to rename sppcs.dll back to "%%~A\Microsoft Shared\OfficeSoftwareProtectionPlatform\OSPPC.DLL") else (echo Renamed sppcs.dll back to "%%~A\Microsoft Shared\OfficeSoftwareProtectionPlatform\OSPPC.DLL")
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
|
||||
::==================================
|
||||
|
||||
reg query HKCU\Software\Microsoft\Office\16.0\Common\Licensing\Resiliency %nul% && (
|
||||
echo:
|
||||
echo Deleting - Registry keys for skipping license check
|
||||
@ -769,6 +832,8 @@ reg unload HKU\%%# %nul%
|
||||
)
|
||||
)
|
||||
|
||||
::==================================
|
||||
|
||||
set "kmskey=HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\SoftwareProtectionPlatform\0ff1ce15-a989-479d-af46-f275c6370663"
|
||||
reg query "%kmskey%" %nul% && (
|
||||
echo:
|
||||
@ -815,6 +880,7 @@ set _oLPath=
|
||||
set _hookPath=
|
||||
set _hook=
|
||||
set _sppcPath=
|
||||
set _osppPath=
|
||||
set _actid=
|
||||
set _prod=
|
||||
set _lic=
|
||||
@ -833,6 +899,7 @@ set o16c2r=
|
||||
set o15c2r=
|
||||
set o16msi=
|
||||
set o15msi=
|
||||
set o14msi=
|
||||
|
||||
set _68=HKLM\SOFTWARE\Microsoft\Office
|
||||
set _86=HKLM\SOFTWARE\Wow6432Node\Microsoft\Office
|
||||
@ -842,10 +909,56 @@ for /f "skip=2 tokens=2*" %%a in ('"reg query %_68%\ClickToRun /v InstallPath" %
|
||||
for /f "skip=2 tokens=2*" %%a in ('"reg query %_86%\15.0\ClickToRun /v InstallPath" %nul6%') do if exist "%%b\root\Licenses\ProPlus*.xrm-ms" (set o15c2r=1&set o15c2r_reg=%_86%\15.0\ClickToRun)
|
||||
for /f "skip=2 tokens=2*" %%a in ('"reg query %_68%\15.0\ClickToRun /v InstallPath" %nul6%') do if exist "%%b\root\Licenses\ProPlus*.xrm-ms" (set o15c2r=1&set o15c2r_reg=%_68%\15.0\ClickToRun)
|
||||
|
||||
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 o16msi=1&set o16msi_reg=%_86%\16.0)
|
||||
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 o16msi=1&set o16msi_reg=%_68%\16.0)
|
||||
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 o15msi=1&set o15msi_reg=%_86%\15.0)
|
||||
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 o15msi=1&set o15msi_reg=%_68%\15.0)
|
||||
for /f "skip=2 tokens=2*" %%a in ('"reg query %_86%\16.0\Common\InstallRoot /v Path" %nul6%') do if exist "%%b\*Picker.dll" (set o16msi=1&set o16msi_reg=%_86%\16.0)
|
||||
for /f "skip=2 tokens=2*" %%a in ('"reg query %_68%\16.0\Common\InstallRoot /v Path" %nul6%') do if exist "%%b\*Picker.dll" (set o16msi=1&set o16msi_reg=%_68%\16.0)
|
||||
for /f "skip=2 tokens=2*" %%a in ('"reg query %_86%\15.0\Common\InstallRoot /v Path" %nul6%') do if exist "%%b\*Picker.dll" (set o15msi=1&set o15msi_reg=%_86%\15.0)
|
||||
for /f "skip=2 tokens=2*" %%a in ('"reg query %_68%\15.0\Common\InstallRoot /v Path" %nul6%') do if exist "%%b\*Picker.dll" (set o15msi=1&set o15msi_reg=%_68%\15.0)
|
||||
for /f "skip=2 tokens=2*" %%a in ('"reg query %_86%\14.0\Common\InstallRoot /v Path" %nul6%') do if exist "%%b\*Picker.dll" (set o14msi=1&set o14msi_reg=%_86%\14.0)
|
||||
for /f "skip=2 tokens=2*" %%a in ('"reg query %_68%\14.0\Common\InstallRoot /v Path" %nul6%') do if exist "%%b\*Picker.dll" (set o14msi=1&set o14msi_reg=%_68%\14.0)
|
||||
|
||||
exit /b
|
||||
|
||||
::========================================================================================================================================
|
||||
|
||||
:oh_ppcpath
|
||||
|
||||
if not defined isOspp (
|
||||
if not "%osarch%"=="x86" (
|
||||
if /i "%_oArch%"=="x64" set "_sppcPath=%SystemRoot%\System32\sppc.dll"
|
||||
if /i "%_oArch%"=="x86" set "_sppcPath=%SystemRoot%\SysWOW64\sppc.dll"
|
||||
) else (
|
||||
set "_sppcPath=%SystemRoot%\System32\sppc.dll"
|
||||
)
|
||||
)
|
||||
|
||||
set noOsppc=
|
||||
set _hook68=
|
||||
set _hook86=
|
||||
set _osppPath68=
|
||||
set _osppPath86=
|
||||
|
||||
if defined isOspp (
|
||||
if not "%osarch%"=="x86" (
|
||||
if /i "%_oArch%"=="x64" (
|
||||
for /f "skip=2 tokens=2*" %%a in ('"reg query HKLM\SOFTWARE\Microsoft\OfficeSoftwareProtectionPlatform /v Path" %nul6%') do (set "_osppPath68=%%b")
|
||||
if not exist "!_osppPath68!OSPPC.DLL" set noOsppc=1
|
||||
)
|
||||
if /i "%_oArch%"=="x86" (
|
||||
for /f "skip=2 tokens=2*" %%a in ('"reg query HKLM\SOFTWARE\Microsoft\OfficeSoftwareProtectionPlatform /v Path" %nul6%') do (set "_osppPath68=%%b")
|
||||
for /f "skip=2 tokens=2*" %%a in ('"reg query HKLM\SOFTWARE\Wow6432Node\Microsoft\OfficeSoftwareProtectionPlatform /v Path" %nul6%') do (set "_osppPath86=%%b")
|
||||
if not exist "!_osppPath68!OSPPC.DLL" set noOsppc=1
|
||||
if not exist "!_osppPath86!OSPPC.DLL" set noOsppc=1
|
||||
)
|
||||
) else (
|
||||
for /f "skip=2 tokens=2*" %%a in ('"reg query HKLM\SOFTWARE\Microsoft\OfficeSoftwareProtectionPlatform /v Path" %nul6%') do (set "_osppPath86=%%b")
|
||||
if not exist "!_osppPath86!OSPPC.DLL" set noOsppc=1
|
||||
)
|
||||
if "!_osppPath68:~-1!"=="\" set "_osppPath68=!_osppPath68:~0,-1!"
|
||||
if "!_osppPath86:~-1!"=="\" set "_osppPath86=!_osppPath86:~0,-1!"
|
||||
)
|
||||
|
||||
if defined _osppPath68 set _hook68=sppc64.dll
|
||||
if defined _osppPath86 set _hook86=sppc32.dll
|
||||
|
||||
exit /b
|
||||
|
||||
@ -941,15 +1054,24 @@ set hasherror=
|
||||
if %_hook%==sppc32.dll set offset=2564
|
||||
if %_hook%==sppc64.dll set offset=3076
|
||||
|
||||
del /s /q "%_hookPath%\sppcs.dll" %nul%
|
||||
del /s /q "%_hookPath%\sppc.dll" %nul%
|
||||
::======================================
|
||||
|
||||
if exist "%_hookPath%\sppcs.dll" set "ierror=Remove Previous Ohook Install"
|
||||
if exist "%_hookPath%\sppc.dll" set "ierror=Remove Previous Ohook Install"
|
||||
:: Remove previous Install
|
||||
|
||||
for %%# in (sppcs.dll sppc.dll) do (
|
||||
del /f /q "%_hookPath%\%%#" %nul%
|
||||
if exist "%_hookPath%\%%#" (move /y "%_hookPath%\%%#" "!_ttemp!\needsToBeDeleted%random%" %nul%)
|
||||
if exist "%_hookPath%\%%#" (set "ierror=Remove Previous Ohook Install [%%#]")
|
||||
)
|
||||
|
||||
if defined ierror goto :oh_hookinstall_error
|
||||
|
||||
::======================================
|
||||
|
||||
mklink "%_hookPath%\sppcs.dll" "%_sppcPath%" %nul%
|
||||
if not %errorlevel%==0 (
|
||||
if not defined ierror set ierror=mklink
|
||||
if not exist "%_hookPath%\sppcs.dll" (
|
||||
set ierror=mklink sppcs.dll
|
||||
goto :oh_hookinstall_error
|
||||
)
|
||||
|
||||
set exhook=
|
||||
@ -964,17 +1086,122 @@ popd
|
||||
call :oh_extractdll "%_hookPath%\sppc.dll" "%offset%"
|
||||
)
|
||||
)
|
||||
if not exist "%_hookPath%\sppc.dll" (if not defined ierror set ierror=Copy)
|
||||
if not exist "%_hookPath%\sppc.dll" (
|
||||
set ierror=Copy
|
||||
goto :oh_hookinstall_error
|
||||
)
|
||||
|
||||
echo:
|
||||
if not defined ierror (
|
||||
echo Symlinking System's sppc.dll to ["%_hookPath%\sppcs.dll"] [Successful]
|
||||
echo Symlinking System's sppc.dll ["%_hookPath%\sppcs.dll"] [Successful]
|
||||
if defined exhook (
|
||||
echo Copying Custom %_hook% to ["%_hookPath%\sppc.dll"] [Successful]
|
||||
) else (
|
||||
echo Extracting Custom %_hook% to ["%_hookPath%\sppc.dll"] [Successful]
|
||||
)
|
||||
|
||||
goto :oh_hookinstall_error
|
||||
|
||||
::========================================================================================================================================
|
||||
|
||||
:oh_hookinstall_ospp
|
||||
|
||||
set ierror=
|
||||
set hasherror=
|
||||
|
||||
if defined _hook86 set offset86=2564
|
||||
if defined _hook68 set offset68=3076
|
||||
|
||||
::======================================
|
||||
|
||||
:: Remove previous Install
|
||||
|
||||
for %%# in (OSPPC.DLL sppcs.dll) do (
|
||||
for %%A in ("%_osppPath68%\%%#" "%_osppPath86%\%%#") do (
|
||||
set size=0
|
||||
set size=%%~zA
|
||||
if !size! GEQ 1 if !size! LSS 100000 (
|
||||
del /f /q "%%~A" %nul%
|
||||
if exist "%%~A" (move /y "%%~A" "!_ttemp!\needsToBeDeleted%random%" %nul%)
|
||||
if exist "%%~A" (set "ierror=Remove Previous Ohook Install [%%#]")
|
||||
)
|
||||
)
|
||||
)
|
||||
|
||||
if defined ierror goto :oh_hookinstall_error
|
||||
|
||||
for %%A in ("%_osppPath68%" "%_osppPath86%") do (
|
||||
if exist "%%~A\sppcs.dll" (move /y "%%~A\sppcs.dll" "%%~A\OSPPC.DLL" %nul%)
|
||||
if exist "%%~A\sppcs.dll" (
|
||||
move /y "%%~A\OSPPC.DLL" "!_ttemp!\needsToBeDeleted%random%" %nul%
|
||||
move /y "%%~A\sppcs.dll" "%%~A\OSPPC.DLL" %nul%
|
||||
)
|
||||
if exist "%%~A\sppcs.dll" (set "ierror=Move sppcs.dll back to OSPPC.DLL")
|
||||
)
|
||||
|
||||
del /f /q "%_hookPath%\sppcs.dll" %nul%
|
||||
if exist "%_hookPath%\sppcs.dll" (move /y "%_hookPath%\sppcs.dll" "!_ttemp!\needsToBeDeleted%random%" %nul%)
|
||||
if exist "%_hookPath%\sppcs.dll" (set "ierror=Remove Previous Ohook mklink sppcs.dll")
|
||||
|
||||
if defined ierror goto :oh_hookinstall_error
|
||||
|
||||
::======================================
|
||||
|
||||
if defined _osppPath68 (move /y "%_osppPath68%\OSPPC.DLL" "%_osppPath68%\sppcs.dll" %nul% & if not exist "%_osppPath68%\sppcs.dll" set ierror=1)
|
||||
if defined _osppPath86 (move /y "%_osppPath86%\OSPPC.DLL" "%_osppPath86%\sppcs.dll" %nul% & if not exist "%_osppPath86%\sppcs.dll" set ierror=1)
|
||||
|
||||
if defined ierror (
|
||||
set "ierror=Rename OSPPC.DLL"
|
||||
goto :oh_hookinstall_error
|
||||
)
|
||||
|
||||
if defined _osppPath68 if defined _osppPath86 (mklink "%_hookPath%\sppcs.dll" "%_osppPath86%\sppcs.dll" %nul%)
|
||||
if defined _osppPath68 if not defined _osppPath86 (mklink "%_hookPath%\sppcs.dll" "%_osppPath68%\sppcs.dll" %nul%)
|
||||
if defined _osppPath86 if not defined _osppPath68 (mklink "%_hookPath%\sppcs.dll" "%_osppPath86%\sppcs.dll" %nul%)
|
||||
|
||||
if not exist "%_hookPath%\sppcs.dll" (
|
||||
set ierror=mklink sppcs.dll
|
||||
goto :oh_hookinstall_error
|
||||
)
|
||||
|
||||
set exhook=
|
||||
if exist "!_work!\BIN\%_hook68%" if exist "!_work!\BIN\%_hook86%" set exhook=1
|
||||
|
||||
if defined exhook (
|
||||
pushd "!_work!\BIN\"
|
||||
if defined _osppPath68 (copy /y /b "%_hook68%" "%_osppPath68%\OSPPC.DLL" %nul%)
|
||||
if defined _osppPath86 (copy /y /b "%_hook86%" "%_osppPath86%\OSPPC.DLL" %nul%)
|
||||
popd
|
||||
) else (
|
||||
if defined _osppPath68 (set _hook=%_hook68%&call :oh_extractdll "%_osppPath68%\OSPPC.DLL" "%offset68%")
|
||||
if defined _osppPath86 (set _hook=%_hook86%&call :oh_extractdll "%_osppPath86%\OSPPC.DLL" "%offset86%")
|
||||
)
|
||||
|
||||
if defined _osppPath68 (if not exist "%_osppPath68%\OSPPC.DLL" set ierror=1)
|
||||
if defined _osppPath86 (if not exist "%_osppPath86%\OSPPC.DLL" set ierror=1)
|
||||
|
||||
if defined ierror (
|
||||
set ierror=Copy
|
||||
goto :oh_hookinstall_error
|
||||
)
|
||||
|
||||
echo:
|
||||
if defined _osppPath68 (echo Renaming OSPPC.DLL to sppcs.dll ["%_osppPath68%\sppcs.dll"])
|
||||
if defined _osppPath86 (echo Renaming OSPPC.DLL to sppcs.dll ["%_osppPath86%\sppcs.dll"])
|
||||
if defined exhook (
|
||||
if defined _osppPath68 (echo Copying Custom %_hook68% to ["%_osppPath68%\OSPPC.DLL"])
|
||||
if defined _osppPath86 (echo Copying Custom %_hook86% to ["%_osppPath86%\OSPPC.DLL"])
|
||||
) else (
|
||||
if defined _osppPath68 (echo Extracting Custom %_hook68% to ["%_osppPath68%\OSPPC.DLL"])
|
||||
if defined _osppPath86 (echo Extracting Custom %_hook86% to ["%_osppPath86%\OSPPC.DLL"])
|
||||
)
|
||||
|
||||
echo Symlinking Renamed sppcs.dll ["%_hookPath%\sppcs.dll"]
|
||||
|
||||
::========================================================================================================================================
|
||||
|
||||
:oh_hookinstall_error
|
||||
|
||||
if defined ierror (
|
||||
set error=1
|
||||
call :dk_color %Red% "Installing Ohook [Failed to %ierror%]"
|
||||
echo:
|
||||
@ -993,9 +1220,9 @@ if not defined exhook if not defined ierror (
|
||||
if defined hasherror (
|
||||
set error=1
|
||||
set ierror=1
|
||||
call :dk_color %Red% "Modifying Hash of Custom %_hook% [Failed]"
|
||||
call :dk_color %Red% "Modifying Hash of Custom sppcs.dll [Failed]"
|
||||
) else (
|
||||
echo Modifying Hash of Custom %_hook% [Successful]
|
||||
echo Modifying Hash of Custom sppcs.dll [Successful]
|
||||
)
|
||||
)
|
||||
|
||||
@ -1003,6 +1230,26 @@ exit /b
|
||||
|
||||
::========================================================================================================================================
|
||||
|
||||
:oh_setspp
|
||||
|
||||
set isOspp=
|
||||
if %winbuild% GEQ 9200 (
|
||||
set spp=SoftwareLicensingProduct
|
||||
set sps=SoftwareLicensingService
|
||||
) else (
|
||||
set isOspp=1
|
||||
set spp=OfficeSoftwareProtectionProduct
|
||||
set sps=OfficeSoftwareProtectionService
|
||||
)
|
||||
if "%1"=="14" (
|
||||
set isOspp=1
|
||||
set spp=OfficeSoftwareProtectionProduct
|
||||
set sps=OfficeSoftwareProtectionService
|
||||
)
|
||||
exit /b
|
||||
|
||||
::========================================================================================================================================
|
||||
|
||||
:oh_process
|
||||
|
||||
for %%# in (%_oIds%) do (
|
||||
@ -1022,10 +1269,11 @@ call :ohookdata getinfo !_prod!
|
||||
|
||||
if not "!key!"=="" (
|
||||
echo "!allapps!" | find /i "!_actid!" %nul1% || call :oh_installlic
|
||||
if not %oVer%==14 set generickey=1
|
||||
call :dk_inskey "[!key!] [!_prod!] [!_lic!]"
|
||||
) else (
|
||||
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! key not found in script]"
|
||||
call :dk_color %Blue% "Make sure you are using the latest version of MAS."
|
||||
set fixes=%fixes% %mas%
|
||||
call :dk_color %_Yellow% "%mas%"
|
||||
@ -1052,7 +1300,11 @@ exit /b
|
||||
:: Process Office MSI Version
|
||||
|
||||
call :oh_reset
|
||||
if "%1"=="14" (
|
||||
call :dk_actids 59a52881-a989-479d-af46-f275c6370663
|
||||
) else (
|
||||
call :dk_actids 0ff1ce15-a989-479d-af46-f275c6370663
|
||||
)
|
||||
|
||||
set oVer=%1
|
||||
for /f "skip=2 tokens=2*" %%a in ('"reg query %2\Common\InstallRoot /v Path" %nul6%') do (set "_oRoot=%%b")
|
||||
@ -1065,16 +1317,8 @@ if "%osarch%"=="x86" set _oArch=x86
|
||||
|
||||
if /i "%_oArch%"=="x64" (set "_hookPath=%_oRoot%" & set "_hook=sppc64.dll")
|
||||
if /i "%_oArch%"=="x86" (set "_hookPath=%_oRoot%" & set "_hook=sppc32.dll")
|
||||
if not "%osarch%"=="x86" (
|
||||
if /i "%_oArch%"=="x64" set "_sppcPath=%SystemRoot%\System32\sppc.dll"
|
||||
if /i "%_oArch%"=="x86" set "_sppcPath=%SystemRoot%\SysWOW64\sppc.dll"
|
||||
) else (
|
||||
set "_sppcPath=%SystemRoot%\System32\sppc.dll"
|
||||
)
|
||||
|
||||
set "_common=%CommonProgramFiles%"
|
||||
if defined PROCESSOR_ARCHITEW6432 set "_common=%CommonProgramW6432%"
|
||||
set "_common2=%CommonProgramFiles(x86)%"
|
||||
call :oh_ppcpath
|
||||
|
||||
call :msiofficedata %2
|
||||
|
||||
@ -1087,8 +1331,23 @@ call :dk_color %Red% "Checking Installed Products [Product IDs not f
|
||||
exit /b
|
||||
)
|
||||
|
||||
if defined noOsppc (
|
||||
call :dk_color %Red% "Checking OSPPC.DLL [Not found. Aborting activation...]"
|
||||
call :dk_color %Blue% "%_fixmsg%"
|
||||
set error=1
|
||||
exit /b
|
||||
)
|
||||
|
||||
if %oVer%==14 if defined SingleImage (
|
||||
echo Checking Installed Products [SingleImage product found, Professional Retail key will be used for activation]
|
||||
)
|
||||
|
||||
call :oh_process
|
||||
if defined isOspp (
|
||||
call :oh_hookinstall_ospp
|
||||
) else (
|
||||
call :oh_hookinstall
|
||||
)
|
||||
|
||||
exit /b
|
||||
|
||||
@ -1326,10 +1585,16 @@ exit /b
|
||||
|
||||
:dk_setvar
|
||||
|
||||
set psc=powershell.exe -nop -c
|
||||
set ps=%SysPath%\WindowsPowerShell\v1.0\powershell.exe
|
||||
set psc=%ps% -nop -c
|
||||
set winbuild=1
|
||||
for /f "tokens=6 delims=[]. " %%G in ('ver') do set winbuild=%%G
|
||||
|
||||
set _slexe=sppsvc.exe& set _slser=sppsvc
|
||||
if %winbuild% LEQ 6300 (set _slexe=SLsvc.exe& set _slser=SLsvc)
|
||||
if %winbuild% LSS 7600 if exist "%SysPath%\SLsvc.exe" (set _slexe=SLsvc.exe& set _slser=SLsvc)
|
||||
if %_slexe%==SLsvc.exe set _vis=1
|
||||
|
||||
set _NCS=1
|
||||
if %winbuild% LSS 10586 set _NCS=0
|
||||
if %winbuild% GEQ 10586 reg query "HKCU\Console" /v ForceV2 %nul2% | find /i "0x0" %nul1% && (set _NCS=0)
|
||||
@ -1406,11 +1671,12 @@ set keyerror=%errorlevel%
|
||||
cmd /c exit /b %keyerror%
|
||||
if %keyerror% NEQ 0 set "keyerror=[0x%=ExitCode%]"
|
||||
|
||||
if defined generickey (set "keyecho=Installing Generic Product Key ") else (set "keyecho=Installing Product Key ")
|
||||
if %keyerror% EQU 0 (
|
||||
if %sps%==SoftwareLicensingService call :dk_refresh
|
||||
echo Installing Generic Product Key %~1 [Successful]
|
||||
echo %keyecho% %~1 [Successful]
|
||||
) else (
|
||||
call :dk_color %Red% "Installing Generic Product Key %~1 [Failed] %keyerror%"
|
||||
call :dk_color %Red% "%keyecho% %~1 [Failed] %keyerror%"
|
||||
if not defined error (
|
||||
if defined altapplist call :dk_color %Red% "Activation ID not found for this key."
|
||||
call :dk_color %Blue% "%_fixmsg%"
|
||||
@ -1419,6 +1685,7 @@ set showfix=1
|
||||
set error=1
|
||||
)
|
||||
|
||||
set generickey=
|
||||
exit /b
|
||||
|
||||
:: Get all products Activation IDs
|
||||
@ -1472,7 +1739,7 @@ function InstallLicenseArr($Str) {
|
||||
ForEach ($x in $a) {InstallLicenseFile "$x"}
|
||||
}
|
||||
function InstallLicenseDir($Loc) {
|
||||
dir $Loc *.xrm-ms -af -s | select -expand FullName | % {InstallLicenseFile "$_"}
|
||||
Get-ChildItem $Loc -Recurse -Filter *.xrm-ms | ForEach-Object {InstallLicenseFile $_.FullName}
|
||||
}
|
||||
function ReinstallLicenses() {
|
||||
$Oem = "$env:SysPath\oem"
|
||||
@ -1486,6 +1753,7 @@ function ReinstallLicenses() {
|
||||
|
||||
:dk_ckeckwmic
|
||||
|
||||
if %winbuild% LSS 9200 (set _wmic=1&exit /b)
|
||||
set _wmic=0
|
||||
for %%# in (wmic.exe) do @if not "%%~$PATH:#"=="" (
|
||||
cmd /c "wmic path Win32_ComputerSystem get CreationClassName /value" %nul2% | find /i "computersystem" %nul1% && set _wmic=1
|
||||
@ -1496,16 +1764,16 @@ exit /b
|
||||
|
||||
:dk_sppissue
|
||||
|
||||
sc start sppsvc %nul%
|
||||
sc start %_slser% %nul%
|
||||
set spperror=%errorlevel%
|
||||
|
||||
if %spperror% NEQ 1056 if %spperror% NEQ 0 (
|
||||
%eline%
|
||||
echo sc start sppsvc [Error Code: %spperror%]
|
||||
echo sc start %_slser% [Error Code: %spperror%]
|
||||
)
|
||||
|
||||
echo:
|
||||
%psc% "$job = Start-Job { (Get-WmiObject -Query 'SELECT * FROM %sps%').Version }; if (-not (Wait-Job $job -Timeout 30)) {write-host 'sppsvc is not working correctly. Check this webpage for help - %mas%troubleshoot'}"
|
||||
%psc% "$job = Start-Job { (Get-WmiObject -Query 'SELECT * FROM %sps%').Version }; if (-not (Wait-Job $job -Timeout 30)) {write-host '%_slser% is not working correctly. Check this webpage for help - %mas%troubleshoot'}"
|
||||
exit /b
|
||||
|
||||
:: Get Product name (WMI/REG methods are not reliable in all conditions, hence winbrand.dll method is used)
|
||||
@ -1513,7 +1781,7 @@ exit /b
|
||||
:dk_product
|
||||
|
||||
set d1=%ref% $meth = $TypeBuilder.DefinePInvokeMethod('BrandingFormatString', 'winbrand.dll', 'Public, Static', 1, [String], @([String]), 1, 3);
|
||||
set d1=%d1% $meth.SetImplementationFlags(128); $TypeBuilder.CreateType()::BrandingFormatString('%%WINDOWS_LONG%%')
|
||||
set d1=%d1% $meth.SetImplementationFlags(128); $TypeBuilder.CreateType()::BrandingFormatString('%%WINDOWS_LONG%%') -replace [string][char]0xa9, '' -replace [string][char]0xae, '' -replace [string][char]0x2122, ''
|
||||
|
||||
set winos=
|
||||
for /f "delims=" %%s in ('"%psc% %d1%"') do if not errorlevel 1 (set winos=%%s)
|
||||
@ -1523,6 +1791,7 @@ if %winbuild% GEQ 22000 (
|
||||
set winos=!winos:Windows 10=Windows 11!
|
||||
)
|
||||
)
|
||||
|
||||
exit /b
|
||||
|
||||
:: Common lines used in PowerShell reflection code
|
||||
@ -1553,11 +1822,11 @@ for %%# in (avira.com kaspersky.com virustotal.com mcafee.com) do (
|
||||
find /i "%%#" %SysPath%\drivers\etc\hosts %nul% && set /a hcount+=1)
|
||||
if %hcount%==4 set "results=[Antivirus URLs are blocked in hosts]"
|
||||
|
||||
sc start sppsvc %nul%
|
||||
sc start %_slser% %nul%
|
||||
echo "%errorlevel%" | findstr "577 225" %nul% && (
|
||||
set "results=%results%[Likely File Infector]"
|
||||
) || (
|
||||
if not exist %SysPath%\sppsvc.exe if not exist %SysPath%\alg.exe (set "results=%results%[Likely File Infector]")
|
||||
if not exist %SysPath%\%_slexe% if not exist %SysPath%\alg.exe (set "results=%results%[Likely File Infector]")
|
||||
)
|
||||
|
||||
if not "%results%%pupfound%"=="" (
|
||||
@ -1637,6 +1906,7 @@ for %%# in (%serv_ste%) do (
|
||||
if /i %%#==ClipSVC (reg add "HKLM\SYSTEM\CurrentControlSet\Services\%%#" /v "Start" /t REG_DWORD /d "3" /f %nul% & sc config %%# start= demand %nul%)
|
||||
if /i %%#==wlidsvc sc config %%# start= demand %nul%
|
||||
if /i %%#==sppsvc (reg add "HKLM\SYSTEM\CurrentControlSet\Services\%%#" /v "Start" /t REG_DWORD /d "2" /f %nul% & sc config %%# start= delayed-auto %nul%)
|
||||
if /i %%#==SLsvc sc config %%# start= auto %nul%
|
||||
if /i %%#==KeyIso sc config %%# start= demand %nul%
|
||||
if /i %%#==LicenseManager sc config %%# start= demand %nul%
|
||||
if /i %%#==Winmgmt sc config %%# start= auto %nul%
|
||||
@ -1766,19 +2036,22 @@ if %osedition%==0 (
|
||||
call :dk_color %Red% "Checking Edition Name [Not Found In Registry]"
|
||||
) else (
|
||||
|
||||
if not exist "%SysPath%\spp\tokens\skus\%osedition%\%osedition%*.xrm-ms" if not exist "%SysPath%\spp\tokens\skus\Security-SPP-Component-SKU-%osedition%\*-%osedition%-*.xrm-ms" (
|
||||
if not exist "%SysPath%\spp\tokens\skus\%osedition%\%osedition%*.xrm-ms" if not exist "%SysPath%\spp\tokens\skus\Security-SPP-Component-SKU-%osedition%\*-%osedition%-*.xrm-ms" if not exist "%SysPath%\licensing\skus\Security-Licensing-SLC-Component-SKU-%osedition%\*-%osedition%-*.xrm-ms" (
|
||||
set skunotfound=1
|
||||
call :dk_color %Red% "Checking License Files [Not Found] [%osedition%]"
|
||||
)
|
||||
|
||||
if not exist "%SystemRoot%\Servicing\Packages\Microsoft-Windows-*-%osedition%-*.mum" (
|
||||
if not exist "%SystemRoot%\Servicing\Packages\Microsoft-Windows-%osedition%Edition*.mum" (
|
||||
call :dk_color %Red% "Checking Package Files [Not Found] [%osedition%]"
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
|
||||
|
||||
%psc% "try { $null=([WMISEARCHER]'SELECT * FROM %sps%').Get().Version; exit 0 } catch { exit $_.Exception.InnerException.HResult }" %nul%
|
||||
if %_wmic% EQU 1 wmic path %sps% get Version %nul%
|
||||
if %_wmic% EQU 0 %psc% "try { $null=([WMISEARCHER]'SELECT * FROM %sps%').Get().Version; exit 0 } catch { exit $_.Exception.InnerException.HResult }" %nul%
|
||||
set error_code=%errorlevel%
|
||||
cmd /c exit /b %error_code%
|
||||
if %error_code% NEQ 0 set "error_code=0x%=ExitCode%"
|
||||
@ -1848,7 +2121,7 @@ call :dk_color2 %Blue% "In case of activation issues, do this - " %_Yellow% " %m
|
||||
)
|
||||
|
||||
|
||||
for %%# in (SppEx%w%tComObj.exe sppsvc.exe sppsvc.exe\PerfOptions) do (
|
||||
for %%# in (SppEx%w%tComObj.exe SLsvc.exe sppsvc.exe sppsvc.exe\PerfOptions) do (
|
||||
reg query "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Ima%w%ge File Execu%w%tion Options\%%#" %nul% && (if defined _sppint (set "_sppint=!_sppint!, %%#") else (set "_sppint=%%#"))
|
||||
)
|
||||
if defined _sppint (
|
||||
@ -1862,14 +2135,14 @@ echo Checking SPP In IFEO [%_sppint%]
|
||||
)
|
||||
|
||||
|
||||
for /f "skip=2 tokens=2*" %%a in ('reg query "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\SoftwareProtectionPlatform" /v "SkipRearm" %nul6%') do if /i %%b NEQ 0x0 (
|
||||
if %winbuild% GEQ 7600 for /f "skip=2 tokens=2*" %%a in ('reg query "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\SoftwareProtectionPlatform" /v "SkipRearm" %nul6%') do if /i %%b NEQ 0x0 (
|
||||
reg add "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\SoftwareProtectionPlatform" /v "SkipRearm" /t REG_DWORD /d "0" /f %nul%
|
||||
call :dk_color %Red% "Checking SkipRearm [Default 0 Value Not Found. Changing To 0]"
|
||||
%psc% "Start-Job { Stop-Service sppsvc -force } | Wait-Job -Timeout 20 | Out-Null"
|
||||
)
|
||||
|
||||
|
||||
reg query "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\SoftwareProtectionPlatform\Plugins\Objects\msft:rm/algorithm/hwid/4.0" /f ba02fed39662 /d %nul% || (
|
||||
if %winbuild% GEQ 7600 reg query "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\SoftwareProtectionPlatform\Plugins\Objects\msft:rm/algorithm/hwid/4.0" /f ba02fed39662 /d %nul% || (
|
||||
call :dk_color %Red% "Checking SPP Registry Key [Incorrect ModuleId Found]"
|
||||
set fixes=%fixes% %mas%issues_due_to_gaming_spoofers
|
||||
call :dk_color2 %Blue% "Most likely caused by gaming spoofers. Check this webpage for help - " %_Yellow% " %mas%issues_due_to_gaming_spoofers"
|
||||
@ -1879,21 +2152,22 @@ set showfix=1
|
||||
|
||||
|
||||
set tokenstore=
|
||||
if %winbuild% GEQ 7600 (
|
||||
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% LSS 9200 set "tokenstore=%Systemdrive%\Windows\ServiceProfiles\NetworkService\AppData\Roaming\Microsoft\SoftwareProtectionPlatform"
|
||||
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" (
|
||||
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 toerr=1
|
||||
set error=1
|
||||
set showfix=1
|
||||
call :dk_color %Red% "Checking TokenStore Registry Key [Correct Path Not Found] [%tokenstore%]"
|
||||
call :dk_color %Red% "Checking TokenStore Registry Key [Correct Path Not Found] [!tokenstore!]"
|
||||
set fixes=%fixes% %mas%troubleshoot
|
||||
call :dk_color2 %Blue% "Check this webpage for help - " %_Yellow% " %mas%troubleshoot"
|
||||
)
|
||||
|
||||
)
|
||||
|
||||
:: This code creates token folder only if it's missing and sets default permission for it
|
||||
|
||||
if not defined toerr if not exist "%tokenstore%\" (
|
||||
if %winbuild% GEQ 7600 if not defined toerr if not exist "%tokenstore%\" (
|
||||
mkdir "%tokenstore%" %nul%
|
||||
if %winbuild% LSS 9200 set "d=$sddl = 'O:NSG:NSD:AI(A;OICIID;FA;;;SY)(A;OICIID;FA;;;BA)(A;OICIID;FA;;;NS)';"
|
||||
if %winbuild% GEQ 9200 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)';"
|
||||
@ -1914,7 +2188,7 @@ set showfix=1
|
||||
if not defined notwinact (
|
||||
call :dk_actid 55c92734-d682-4d71-983e-d6ec3f16059f
|
||||
if not defined apps (
|
||||
%psc% "Start-Job { Stop-Service sppsvc -force } | Wait-Job -Timeout 20 | Out-Null; $sls = Get-WmiObject SoftwareLicensingService; $f=[io.file]::ReadAllText('!_batp!') -split ':xrm\:.*';iex ($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=[io.file]::ReadAllText('!_batp!') -split ':xrm\:.*';iex ($f[1]); ReinstallLicenses" %nul%
|
||||
call :dk_actid 55c92734-d682-4d71-983e-d6ec3f16059f
|
||||
if not defined apps (
|
||||
set "_notfoundids=Key Not Installed / Act ID Not Found"
|
||||
@ -1929,7 +2203,7 @@ call :dk_color %Red% "Checking Activation IDs [!_notfoundids!]"
|
||||
)
|
||||
|
||||
|
||||
if exist "%tokenstore%\" if not exist "%tokenstore%\tokens.dat" (
|
||||
if %winbuild% GEQ 7600 if exist "%tokenstore%\" if not exist "%tokenstore%\tokens.dat" (
|
||||
set error=1
|
||||
call :dk_color %Red% "Checking SPP tokens.dat [Not Found] [%tokenstore%\]"
|
||||
)
|
||||
@ -2064,8 +2338,10 @@ $wpaKey.Close()
|
||||
|
||||
if %_NCS% EQU 1 (
|
||||
echo %esc%[%~1%~2%esc%[0m
|
||||
) else (
|
||||
) else if exist %ps% (
|
||||
%psc% write-host -back '%1' -fore '%2' '%3'
|
||||
) else if not exist %ps% (
|
||||
echo %~3
|
||||
)
|
||||
exit /b
|
||||
|
||||
@ -2073,8 +2349,10 @@ exit /b
|
||||
|
||||
if %_NCS% EQU 1 (
|
||||
echo %esc%[%~1%~2%esc%[%~3%~4%esc%[0m
|
||||
) else (
|
||||
) else if exist %ps% (
|
||||
%psc% write-host -back '%1' -fore '%2' '%3' -NoNewline; write-host -back '%4' -fore '%5' '%6'
|
||||
) else if not exist %ps% (
|
||||
echo %~3 %~6
|
||||
)
|
||||
exit /b
|
||||
|
||||
@ -2089,6 +2367,7 @@ if defined fixes (
|
||||
call :dk_color %White% "Follow ALL the ABOVE blue lines. "
|
||||
call :dk_color2 %Blue% "Press [1] to Open Support Webpage " %Gray% " Press [0] to Ignore"
|
||||
choice /C:10 /N
|
||||
if !errorlevel!==2 exit /b
|
||||
if !errorlevel!==1 (for %%# in (%fixes%) do (start %%#))
|
||||
)
|
||||
|
||||
@ -2106,15 +2385,69 @@ exit /b
|
||||
|
||||
:: 1st column = Office version number
|
||||
:: 2nd column = Activation ID
|
||||
:: 3rd column = Generic key. Preference is given in this order, Retail:TB:Sub > Retail > OEM:NONSLP > Volume:MAK > Volume:GVLK
|
||||
:: 3rd column = For Office 2013 and later, the generated keys are listed. For Office 2010, the blocked keys sourced from the Internet are listed.
|
||||
:: For Office 2013 and later, key preference is given in this order, Retail:TB:Sub > Retail > OEM:NONSLP > Volume:MAK > Volume:GVLK
|
||||
:: For Office 2010, key preference is given in this order, Retail > Volume:MAK
|
||||
:: 4th column = Last part of license description
|
||||
:: 5th column = Edition
|
||||
:: 6th column = Other Edition IDs if they are part of the same primary product (For reference only)
|
||||
:: Separator = "_"
|
||||
|
||||
::===============
|
||||
|
||||
:: We couldn't find any keys (blocked/generic doesn't matter) for these Office 2010 products. If you have them, please share with us.
|
||||
|
||||
14_4eaff0d0-c6cb-4187-94f3-c7656d49a0aa_Retail________ExcelR_[HSExcelR]
|
||||
14_7004b7f0-6407-4f45-8eac-966e5f868bde_Retail________GrooveR
|
||||
14_fbf4ac36-31c8-4340-8666-79873129cf40_Retail________OutlookR
|
||||
14_133c8359-4e93-4241-8118-30bb18737ea0_Retail________PowerPointR_[HSPowerPointR]
|
||||
14_db3bbc9c-ce52-41d1-a46f-1a1d68059119_Retail________WordR_[HSWordR]
|
||||
14_dbe3aee0-5183-4ff7-8142-66050173cb01_Retail________SmallBusBasicsR_[SmallBusBasicsMSDNR]
|
||||
|
||||
:: These installers are not publicly available, so it doesn't matter if we don't have their keys.
|
||||
|
||||
14_19316117-30a8-4773-8fd9-7f7231f4e060_SubPrepid_____HomeBusinessSubR
|
||||
14_4d06f72e-fd50-4bc2-a24b-d448d7f17ef2_SubPrepid_____ProjectProSubR
|
||||
14_e98ef0c0-71c4-42ce-8305-287d8721e26c_SubPrepid_____ProPlusSubR
|
||||
14_14f5946a-debc-4716-babc-7e2c240fec08_Retail________MondoR
|
||||
14_533b656a-4425-480b-8e30-1a2358898350_MAK___________MondoVL
|
||||
|
||||
:ohookdata
|
||||
|
||||
set f=
|
||||
for %%# in (
|
||||
:: Office 2010
|
||||
14_4d463c2c-0505-4626-8cdb-a4da82e2d8ed_7KTYC-XR43P-C3MRW-BJKFD-XB%f%YPG_Retail________AccessR
|
||||
14_745fb377-0a59-4ca9-b9a9-c359557a2c4e_7XHPQ-BQMYG-YBP49-CY8B2-T8%f%CGQ_ByPass________AccessRuntimeR
|
||||
14_95ab3ec8-4106-4f9d-b632-03c019d1d23f_89RTQ-MT4GK-6CPTX-WWP7C-J9%f%KXR_MAK___________AccessVL
|
||||
14_71dc86ff-f056-40d0-8ffb-9592705c9b76_39TRR-C2F37-9WYJ2-MJQXH-B9%f%38K_MAK___________ExcelVL
|
||||
14_fdad0dfa-417d-4b4f-93e4-64ea8867b7fd_RCGT3-FPQDV-H49CD-PPDBF-TH%f%47G_MAK___________GrooveVL
|
||||
14_7b7d1f17-fdcb-4820-9789-9bec6e377821_3YR9B-D9W79-BY66R-R8XYP-QY%f%YYY_Retail________HomeBusinessR_[HomeBusinessDemoR]
|
||||
14_09e2d37e-474b-4121-8626-58ad9be5776f_3X43R-HHHXX-FRHRW-2M2WJ-8V%f%PHD_Retail________HomeStudentR_[HomeStudentDemoR]
|
||||
14_ef1da464-01c8-43a6-91af-e4e5713744f9_XDGJY-KFHW9-JWX9X-YM4GW-GC%f%8WR_Retail________InfoPathR
|
||||
14_85e22450-b741-430c-a172-a37962c938af_6GKT2-KMJPK-4RRBF-8VQKB-JB%f%6G6_MAK___________InfoPathVL
|
||||
14_3f7aa693-9a7e-44fc-9309-bb3d8e604925_2TG3P-9DB76-4YT99-8RXGD-CW%f%XBP_Retail________OneNoteR_[HSOneNoteR]
|
||||
14_6860b31f-6a67-48b8-84b9-e312b3485c4b_CV64P-F4VRH-BJ33D-PH6MR-X6%f%9RY_MAK___________OneNoteVL
|
||||
14_a9aeabd8-63b8-4079-a28e-f531807fd6b8_J8C9M-YXMH2-9CX44-2C3YG-V7%f%692_MAK___________OutlookVL
|
||||
14_acb51361-c0db-4895-9497-1831c41f31a6_GMBWM-WVX26-7WHV4-DB43D-WV%f%DY2_Retail________PersonalR_[PersonalDemoR,PersonalPrepaidR]
|
||||
14_38252940-718c-4aa6-81a4-135398e53851_HPBQP-RJHDR-Q3472-PT9Q6-PB%f%B72_MAK___________PowerPointVL
|
||||
14_8b559c37-0117-413e-921b-b853aeb6e210_367X9-9HP9R-TKHY6-DH4QH-K9%f%PY7_Retail________ProfessionalR_[ProfessionalAcadR,ProfessionalDemoR,OEM-SingleImage]
|
||||
14_725714d7-d58f-4d12-9fa8-35873c6f7215_6JD4G-KRW3J-48MGV-DM6FC-T9%f%WKR_Retail________ProjectProR_[ProjectProMSDNR]
|
||||
14_1cf57a59-c532-4e56-9a7d-ffa2fe94b474_3XDTH-MMGJ6-F9MKX-THP8D-G9%f%BP7_MAK___________ProjectProVL
|
||||
14_688f6589-2bd9-424e-a152-b13f36aa6de1_2W96V-RTQ9R-2BPVT-PT8H9-MV%f%68T_Retail________ProjectStdR
|
||||
14_11b39439-6b93-4642-9570-f2eb81be2238_4DTT4-D4MKX-23KFH-JKR6T-YK%f%G2J_MAK___________ProjectStdVL
|
||||
14_71af7e84-93e6-4363-9b69-699e04e74071_2J9H6-H4D3G-PCXD2-96XVM-TR%f%R73_Retail________ProPlusR_[ProPlusAcadR,ProPlusMSDNR,Sub4R]
|
||||
14_fdf3ecb9-b56f-43b2-a9b8-1b48b6bae1a7_6CD6C-9R8PB-T2D9Y-8RKKX-W7%f%DFK_MAK___________ProPlusVL_[ProPlusAcadVL]
|
||||
14_98677603-a668-4fa4-9980-3f1f05f78f69_CTRJP-P72VV-JBF8Y-4W6WW-HX%f%HVG_Retail________PublisherR
|
||||
14_3d014759-b128-4466-9018-e80f6320d9d0_32YG9-3VX77-YXJVV-PRVFW-TT%f%8BV_MAK___________PublisherVL
|
||||
14_8090771e-d41a-4482-929e-de87f1f47e46_7VKXH-9BWCG-RPTBB-JBRV3-GR%f%HYC_MAK___________SmallBusBasicsVL
|
||||
14_b78df69e-0966-40b1-ae85-30a5134dedd0_H48K6-FB4Y6-P83GH-9J7XG-HD%f%KKX_ByPass________SPDR
|
||||
14_b6d2565c-341d-4768-ad7d-addbe00bb5ce_W3BTX-H6BW7-Q6DFW-BXFFY-8R%f%VJP_Retail________StandardR_[StandardMSDNR][KeyisforMSDNR]
|
||||
14_1f76e346-e0be-49bc-9954-70ec53a4fcfe_2XTQP-GDR7C-GTXPC-6W6PV-4R%f%XGC_MAK___________StandardVL_[StandardAcadVL]
|
||||
14_2745e581-565a-4670-ae90-6bf7c57ffe43_VXHHB-W7HBD-7M342-RJ7P8-CH%f%BD6_ByPass________StarterR
|
||||
14_66cad568-c2dc-459d-93ec-2f3cb967ee34_2RDPT-WPYQM-C2WXF-BTPDW-2J%f%2HM_Retail________VisioSIR_Prem[Pro,Std]
|
||||
14_36756cb8-8e69-4d11-9522-68899507cd6a_7PKFT-X2MKQ-GT6X2-8CB2W-CH%f%C9K_MAK___________VisioSIVL_Prem[Pro,Std]
|
||||
14_98d4050e-9c98-49bf-9be1-85e12eb3ab13_6J3XK-DFKGK-X373V-QJHYM-V3%f%FC2_MAK___________WordVL
|
||||
:: Office 2013
|
||||
15_ab4d047b-97cf-4126-a69f-34df08e2f254_B7RFY-7NXPK-Q4342-Y9X2H-3J%f%X4X_Retail________AccessRetail
|
||||
15_259de5be-492b-44b3-9d78-9645f848f7b0_X3XNB-HJB7K-66THH-8DWQ3-XH%f%GJP_Bypass________AccessRuntimeRetail
|
||||
@ -2170,6 +2503,7 @@ for %%# in (
|
||||
15_e3dacc06-3bc2-4e13-8e59-8e05f3232325_H8DN8-Y2YP3-CR9JT-DHDR9-C7%f%GP3_Subscription2_O365ProPlusRetail
|
||||
15_0bc1dae4-6158-4a1c-a893-807665b934b2_2QCNB-RMDKJ-GC8PB-7QGQV-7Q%f%TQJ_Subscription2_O365SmallBusPremRetail
|
||||
:: Office 365 - 16.0 version
|
||||
16_dabaa1f2-109b-496d-bf49-1536cc862900_3HYJN-9KG99-F8VG9-V3DT8-JF%f%MHV_Subscription__O365AppsBasicRetail
|
||||
16_742178ed-6b28-42dd-b3d7-b7c0ea78741b_Y9NF9-M2QWD-FF6RJ-QJW36-RR%f%F2T_SubTest_______O365BusinessRetail
|
||||
16_2f5c71b4-5b7a-4005-bb68-f9fac26f2ea3_W62NQ-267QR-RTF74-PF2MH-JQ%f%MTH_Subscription__O365EduCloudRetail
|
||||
16_a96f8dae-da54-4fad-bdc6-108da592707a_3NMDC-G7C3W-68RGP-CB4MH-4C%f%XCH_SubTest1______O365HomePremRetail
|
||||
@ -2353,6 +2687,49 @@ exit /b
|
||||
:msiofficedata
|
||||
|
||||
for %%# in (
|
||||
14_4d463c2c-0505-4626-8cdb-a4da82e2d8ed_0015_AccessR
|
||||
14_745fb377-0a59-4ca9-b9a9-c359557a2c4e_001C_AccessRuntimeR
|
||||
14_95ab3ec8-4106-4f9d-b632-03c019d1d23f_0015_AccessVL
|
||||
14_4eaff0d0-c6cb-4187-94f3-c7656d49a0aa_0016_ExcelR_[HSExcelR]
|
||||
14_71dc86ff-f056-40d0-8ffb-9592705c9b76_0016_ExcelVL
|
||||
14_7004b7f0-6407-4f45-8eac-966e5f868bde_00BA_GrooveR
|
||||
14_fdad0dfa-417d-4b4f-93e4-64ea8867b7fd_00BA_GrooveVL
|
||||
14_7b7d1f17-fdcb-4820-9789-9bec6e377821_0013_HomeBusinessR_[HomeBusinessDemoR]
|
||||
14_19316117-30a8-4773-8fd9-7f7231f4e060_011E_HomeBusinessSubR
|
||||
14_09e2d37e-474b-4121-8626-58ad9be5776f_002F_HomeStudentR_[HomeStudentDemoR]
|
||||
14_ef1da464-01c8-43a6-91af-e4e5713744f9_0044_InfoPathR
|
||||
14_85e22450-b741-430c-a172-a37962c938af_0044_InfoPathVL
|
||||
14_14f5946a-debc-4716-babc-7e2c240fec08_000F_MondoR
|
||||
14_533b656a-4425-480b-8e30-1a2358898350_000F_MondoVL
|
||||
14_c1ceda8b-c578-4d5d-a4aa-23626be4e234_003D_ProfessionalR_[OEM-SingleImage]Exception
|
||||
14_3f7aa693-9a7e-44fc-9309-bb3d8e604925_00A1_OneNoteR_[HSOneNoteR]
|
||||
14_6860b31f-6a67-48b8-84b9-e312b3485c4b_00A1_OneNoteVL
|
||||
14_fbf4ac36-31c8-4340-8666-79873129cf40_001A_OutlookR
|
||||
14_a9aeabd8-63b8-4079-a28e-f531807fd6b8_001A_OutlookVL
|
||||
14_acb51361-c0db-4895-9497-1831c41f31a6_0033_PersonalR_[PersonalDemoR,PersonalPrepaidR]
|
||||
14_133c8359-4e93-4241-8118-30bb18737ea0_0018_PowerPointR_[HSPowerPointR]
|
||||
14_38252940-718c-4aa6-81a4-135398e53851_0018_PowerPointVL
|
||||
14_8b559c37-0117-413e-921b-b853aeb6e210_0014_ProfessionalR_[ProfessionalAcadR,ProfessionalDemoR]
|
||||
14_725714d7-d58f-4d12-9fa8-35873c6f7215_003B_ProjectProR_[ProjectProMSDNR]
|
||||
14_4d06f72e-fd50-4bc2-a24b-d448d7f17ef2_011F_ProjectProSubR
|
||||
14_1cf57a59-c532-4e56-9a7d-ffa2fe94b474_003B_ProjectProVL
|
||||
14_688f6589-2bd9-424e-a152-b13f36aa6de1_003A_ProjectStdR
|
||||
14_11b39439-6b93-4642-9570-f2eb81be2238_003A_ProjectStdVL
|
||||
14_71af7e84-93e6-4363-9b69-699e04e74071_0011_ProPlusR_[ProPlusAcadR,ProPlusMSDNR,Sub4R]
|
||||
14_e98ef0c0-71c4-42ce-8305-287d8721e26c_011D_ProPlusSubR
|
||||
14_fdf3ecb9-b56f-43b2-a9b8-1b48b6bae1a7_0011_ProPlusVL_[ProPlusAcadVL]
|
||||
14_98677603-a668-4fa4-9980-3f1f05f78f69_0019_PublisherR
|
||||
14_3d014759-b128-4466-9018-e80f6320d9d0_0019_PublisherVL
|
||||
14_dbe3aee0-5183-4ff7-8142-66050173cb01_008B_SmallBusBasicsR_[SmallBusBasicsMSDNR]
|
||||
14_8090771e-d41a-4482-929e-de87f1f47e46_008B_SmallBusBasicsVL
|
||||
14_b78df69e-0966-40b1-ae85-30a5134dedd0_0017_SPDR
|
||||
14_d3422cfb-8d8b-4ead-99f9-eab0ccd990d7_0012_StandardR
|
||||
14_1f76e346-e0be-49bc-9954-70ec53a4fcfe_0012_StandardVL_[StandardAcadVL]
|
||||
14_2745e581-565a-4670-ae90-6bf7c57ffe43_0066_StarterR
|
||||
14_66cad568-c2dc-459d-93ec-2f3cb967ee34_0057_VisioSIR_Prem[Pro,Std]Exception
|
||||
14_36756cb8-8e69-4d11-9522-68899507cd6a_0057_VisioSIVL_Prem[Pro,Std]Exception
|
||||
14_db3bbc9c-ce52-41d1-a46f-1a1d68059119_001B_WordR_[HSWordR]
|
||||
14_98d4050e-9c98-49bf-9be1-85e12eb3ab13_001B_WordVL
|
||||
:: Office 2013
|
||||
15_ab4d047b-97cf-4126-a69f-34df08e2f254_0015_AccessRetail
|
||||
15_259de5be-492b-44b3-9d78-9645f848f7b0_001C_AccessRuntimeRetail
|
||||
@ -2469,6 +2846,7 @@ if "%oVer%"=="%%A" (
|
||||
reg query "%1\Registration\{%%B}" /v ProductCode %nul2% | find /i "-%%C-" %nul% && (
|
||||
reg query "%1\Common\InstalledPackages" %nul2% | find /i "-%%C-" %nul% && (
|
||||
if defined _oIds (set _oIds=!_oIds! %%D) else (set _oIds=%%D)
|
||||
if /i 003D==%%C set SingleImage=1
|
||||
)
|
||||
)
|
||||
)
|
||||
@ -2485,7 +2863,7 @@ exit /b
|
||||
:oh_extractdll
|
||||
|
||||
set b=
|
||||
%psc% "$f=[io.file]::ReadAllText('!_batp!') -split ':%_hook%\:.*';$encoded = ($f[1]) -replace '-', 'A' -replace '_', 'a';$bytes = [Con%b%vert]::FromBas%b%e64String($encoded); $PePath='%1'; $offset='%2'; $m=[io.file]::ReadAllText('!_batp!') -split ':hexedit\:.*';iex ($m[1]);" %nul2% | find /i "Error found" %nul1% && set hasherror=1
|
||||
%psc% "$f=[io.file]::ReadAllText('!_batp!') -split ':%_hook%\:.*';$encoded = ($f[1]) -replace '-', 'A' -replace '_', 'a';$bytes = [Con%b%vert]::FromBas%b%e64String($encoded); $PePath='%1'; $offset='%2'; $m=[io.file]::ReadAllText('!_batp!') -split ':hexedit\:.*';iex ($m[1])" %nul2% | find /i "Error found" %nul1% && set hasherror=1
|
||||
exit /b
|
||||
|
||||
:hexedit:
|
||||
@ -2524,7 +2902,7 @@ $Writer.Write($unixTimestamp)
|
||||
$Writer.Flush()
|
||||
|
||||
# Write the current state of the MemoryStream to a temporary file
|
||||
$tempFilePath = [System.IO.Path]::Combine($env:windir, "Temp", [System.IO.Path]::GetRandomFileName())
|
||||
$tempFilePath = "$env:windir\Temp\$([System.IO.Path]::GetRandomFileName())"
|
||||
[System.IO.File]::WriteAllBytes($tempFilePath, $MemoryStream.ToArray())
|
||||
|
||||
# Update hash using the temporary file
|
||||
|
@ -1,4 +1,4 @@
|
||||
@set masver=3.0
|
||||
@set masver=3.2
|
||||
@echo off
|
||||
|
||||
|
||||
@ -202,10 +202,27 @@ call :dk_color2 %Blue% "Check this webpage for help - " %_Yellow% " %mas%trouble
|
||||
goto dk_done
|
||||
)
|
||||
|
||||
if %winbuild% LSS 7600 (
|
||||
if %winbuild% LSS 6001 (
|
||||
%nceline%
|
||||
echo Unsupported OS version detected [%winbuild%].
|
||||
echo MAS only supports Windows 7/8/8.1/10/11 and their Server equivalents.
|
||||
echo MAS only supports Windows Vista/7/8/8.1/10/11 and their Server equivalents.
|
||||
if %winbuild% EQU 6000 (
|
||||
echo:
|
||||
echo Windows Vista RTM is not supported because Powershell cannot be installed.
|
||||
echo Upgrade to Windows Vista SP1 or SP2.
|
||||
)
|
||||
goto dk_done
|
||||
)
|
||||
|
||||
if %winbuild% LSS 7600 if not exist "%SysPath%\WindowsPowerShell\v1.0\Modules" (
|
||||
%nceline%
|
||||
if not exist %ps% (
|
||||
echo PowerShell is not installed in your system.
|
||||
)
|
||||
echo Install PowerShell 2.0 using the following URL.
|
||||
echo:
|
||||
echo https://www.catalog.update.microsoft.com/Search.aspx?q=KB968930
|
||||
if %_unattended%==0 start https://www.catalog.update.microsoft.com/Search.aspx?q=KB968930
|
||||
goto dk_done
|
||||
)
|
||||
|
||||
@ -257,7 +274,7 @@ goto dk_done
|
||||
|
||||
::pstst $ExecutionContext.SessionState.LanguageMode :pstst
|
||||
|
||||
for /f "delims=" %%a in ('cmd /c "%psc% ""if ($PSVersionTable.PSEdition -ne 'Core') {$f=[io.file]::ReadAllText('!_batp!') -split ':pstst';iex ($f[1])}""" %nul6%') do (set tstresult=%%a)
|
||||
for /f "delims=" %%a in ('%psc% "if ($PSVersionTable.PSEdition -ne 'Core') {$f=[io.file]::ReadAllText('!_batp!') -split ':pstst';iex ($f[1])}" %nul6%') do (set tstresult=%%a)
|
||||
|
||||
if /i not "%tstresult%"=="FullLanguage" (
|
||||
%eline%
|
||||
@ -468,12 +485,17 @@ echo:
|
||||
echo Initializing...
|
||||
call :dk_chkmal
|
||||
|
||||
if not exist %SysPath%\sppsvc.exe (
|
||||
if not exist %SysPath%\%_slexe% (
|
||||
%eline%
|
||||
echo [%SysPath%\sppsvc.exe] file is missing, aborting...
|
||||
echo [%SysPath%\%_slexe%] file is missing, aborting...
|
||||
echo:
|
||||
if not defined results (
|
||||
call :dk_color %Blue% "Go back to Main Menu, select Troubleshoot and run DISM Restore and SFC Scan options."
|
||||
call :dk_color %Blue% "After that, restart system and try activation again."
|
||||
echo:
|
||||
set fixes=%fixes% %mas%troubleshoot
|
||||
call :dk_color2 %Blue% "Check this webpage for help - " %_Yellow% " %mas%troubleshoot"
|
||||
)
|
||||
goto dk_done
|
||||
)
|
||||
|
||||
@ -522,7 +544,7 @@ call :dk_color %Blue% "Internet is required for Online %KS% Activation."
|
||||
|
||||
echo Initiating Diagnostic Tests...
|
||||
|
||||
set "_serv=sppsvc Winmgmt"
|
||||
set "_serv=%_slser% Winmgmt"
|
||||
|
||||
:: Software Protection
|
||||
:: Windows Management Instrumentation
|
||||
@ -612,9 +634,11 @@ echo [%winos% ^| %winbuild% ^| SKU:%osSKU%]
|
||||
if %winbuild% GEQ 9200 if exist "%SysPath%\spp\tokens\skus\%osedition%\*GVLK*.xrm-ms" set sppks=1
|
||||
if %winbuild% LSS 9200 if exist "%SysPath%\spp\tokens\skus\Security-SPP-Component-SKU-%osedition%\*VLKMS*.xrm-ms" set sppks=1
|
||||
if %winbuild% LSS 9200 if exist "%SysPath%\spp\tokens\skus\Security-SPP-Component-SKU-%osedition%\*VL-BYPASS*.xrm-ms" set sppks=1
|
||||
if %winbuild% LSS 7600 if exist "%SysPath%\licensing\skus\Security-Licensing-SLC-Component-SKU-%osedition%\*KMS*.xrm-ms" set sppks=1
|
||||
if %winbuild% LSS 7600 if exist "%SysPath%\licensing\skus\Security-Licensing-SLC-Component-SKU-%osedition%\*VL-BYPASS*.xrm-ms" set sppks=1
|
||||
|
||||
if defined skunotfound (
|
||||
call :dk_color %Red% "Required license files not found in %SysPath%\spp\tokens\skus\"
|
||||
call :dk_color %Red% "Required license files not found."
|
||||
set fixes=%fixes% %mas%troubleshoot
|
||||
call :dk_color2 %Blue% "Check this webpage for help - " %_Yellow% " %mas%troubleshoot"
|
||||
)
|
||||
@ -655,6 +679,7 @@ call echo Checking Installed Product Key [Partial Key - %%_partial%%] [
|
||||
)
|
||||
|
||||
if defined key (
|
||||
set generickey=1
|
||||
call :dk_inskey "[%key%]"
|
||||
)
|
||||
|
||||
@ -664,7 +689,7 @@ call :dk_inskey "[%key%]"
|
||||
|
||||
if not %_actoff%==1 goto :ks_activate
|
||||
|
||||
call :ks_setspp
|
||||
call :oh_setspp
|
||||
|
||||
:: Check ohook install
|
||||
|
||||
@ -709,7 +734,7 @@ set ohub=1
|
||||
|
||||
:: Check supported office versions
|
||||
|
||||
call :ks_getpath
|
||||
call :oh_getpath
|
||||
|
||||
set o16uwp=
|
||||
set o16uwp_path=
|
||||
@ -888,9 +913,9 @@ call :ks_process
|
||||
|
||||
:ks_startmsi
|
||||
|
||||
if defined o14msi call :ks_setspp 14
|
||||
if defined o14msi call :oh_setspp 14
|
||||
if defined o14msi call :ks_processmsi 14 %o14msi_reg%
|
||||
call :ks_setspp
|
||||
call :oh_setspp
|
||||
if defined o15msi call :ks_processmsi 15 %o15msi_reg%
|
||||
if defined o16msi call :ks_processmsi 16 %o16msi_reg%
|
||||
|
||||
@ -1034,7 +1059,7 @@ exit /b
|
||||
|
||||
::========================================================================================================================================
|
||||
|
||||
:ks_getpath
|
||||
:oh_getpath
|
||||
|
||||
set o16c2r=
|
||||
set o15c2r=
|
||||
@ -1050,12 +1075,12 @@ for /f "skip=2 tokens=2*" %%a in ('"reg query %_68%\ClickToRun /v InstallPath" %
|
||||
for /f "skip=2 tokens=2*" %%a in ('"reg query %_86%\15.0\ClickToRun /v InstallPath" %nul6%') do if exist "%%b\root\Licenses\ProPlus*.xrm-ms" (set o15c2r=1&set o15c2r_reg=%_86%\15.0\ClickToRun)
|
||||
for /f "skip=2 tokens=2*" %%a in ('"reg query %_68%\15.0\ClickToRun /v InstallPath" %nul6%') do if exist "%%b\root\Licenses\ProPlus*.xrm-ms" (set o15c2r=1&set o15c2r_reg=%_68%\15.0\ClickToRun)
|
||||
|
||||
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 o16msi=1&set o16msi_reg=%_86%\16.0)
|
||||
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 o16msi=1&set o16msi_reg=%_68%\16.0)
|
||||
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 o15msi=1&set o15msi_reg=%_86%\15.0)
|
||||
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 o15msi=1&set o15msi_reg=%_68%\15.0)
|
||||
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 o14msi=1&set o14msi_reg=%_86%\14.0)
|
||||
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 o14msi=1&set o14msi_reg=%_68%\14.0)
|
||||
for /f "skip=2 tokens=2*" %%a in ('"reg query %_86%\16.0\Common\InstallRoot /v Path" %nul6%') do if exist "%%b\*Picker.dll" (set o16msi=1&set o16msi_reg=%_86%\16.0)
|
||||
for /f "skip=2 tokens=2*" %%a in ('"reg query %_68%\16.0\Common\InstallRoot /v Path" %nul6%') do if exist "%%b\*Picker.dll" (set o16msi=1&set o16msi_reg=%_68%\16.0)
|
||||
for /f "skip=2 tokens=2*" %%a in ('"reg query %_86%\15.0\Common\InstallRoot /v Path" %nul6%') do if exist "%%b\*Picker.dll" (set o15msi=1&set o15msi_reg=%_86%\15.0)
|
||||
for /f "skip=2 tokens=2*" %%a in ('"reg query %_68%\15.0\Common\InstallRoot /v Path" %nul6%') do if exist "%%b\*Picker.dll" (set o15msi=1&set o15msi_reg=%_68%\15.0)
|
||||
for /f "skip=2 tokens=2*" %%a in ('"reg query %_86%\14.0\Common\InstallRoot /v Path" %nul6%') do if exist "%%b\*Picker.dll" (set o14msi=1&set o14msi_reg=%_86%\14.0)
|
||||
for /f "skip=2 tokens=2*" %%a in ('"reg query %_68%\14.0\Common\InstallRoot /v Path" %nul6%') do if exist "%%b\*Picker.dll" (set o14msi=1&set o14msi_reg=%_68%\14.0)
|
||||
|
||||
exit /b
|
||||
|
||||
@ -1121,16 +1146,19 @@ exit /b
|
||||
|
||||
::========================================================================================================================================
|
||||
|
||||
:ks_setspp
|
||||
:oh_setspp
|
||||
|
||||
set isOspp=
|
||||
if %winbuild% GEQ 9200 (
|
||||
set spp=SoftwareLicensingProduct
|
||||
set sps=SoftwareLicensingService
|
||||
) else (
|
||||
set isOspp=1
|
||||
set spp=OfficeSoftwareProtectionProduct
|
||||
set sps=OfficeSoftwareProtectionService
|
||||
)
|
||||
if "%1"=="14" (
|
||||
set isOspp=1
|
||||
set spp=OfficeSoftwareProtectionProduct
|
||||
set sps=OfficeSoftwareProtectionService
|
||||
)
|
||||
@ -1190,6 +1218,7 @@ call :ks_osppready
|
||||
|
||||
if not "!key!"=="" (
|
||||
echo "!allapps!" | find /i "!_actid!" %nul1% || call :oh_installlic
|
||||
set generickey=1
|
||||
call :dk_inskey "[!key!] [!_prod!]"
|
||||
) else (
|
||||
if not defined _oMSI (
|
||||
@ -1198,7 +1227,7 @@ call :dk_color %Red% "Checking Product In Script [Office %oVer%.0 !
|
||||
call :dk_color %Blue% "Make sure you are using Latest MAS script."
|
||||
) else (
|
||||
call :dk_color %Red% "Checking Product In Script [!_prod! MSI Retail is not supported]"
|
||||
call :dk_color %Blue% "Uninstall this and Install C2R or MSI VL version of Office."
|
||||
call :dk_color %Blue% "Use Ohook option to activate it. To activate with %KS%, you need to install Volume version of Office."
|
||||
)
|
||||
set fixes=%fixes% %mas%genuine-installation-media
|
||||
call :dk_color %_Yellow% "%mas%genuine-installation-media"
|
||||
@ -1232,10 +1261,6 @@ echo "%2" | find /i "Wow6432Node" %nul1% && set _oArch=x86
|
||||
if not "%osarch%"=="x86" if not defined _oArch set _oArch=x64
|
||||
if "%osarch%"=="x86" set _oArch=x86
|
||||
|
||||
set "_common=%CommonProgramFiles%"
|
||||
if defined PROCESSOR_ARCHITEW6432 set "_common=%CommonProgramW6432%"
|
||||
set "_common2=%CommonProgramFiles(x86)%"
|
||||
|
||||
call :msiofficedata %2
|
||||
|
||||
echo:
|
||||
@ -1648,6 +1673,11 @@ set "nul=>nul 2>&1"
|
||||
for /f "tokens=6 delims=[]. " %%G in ('ver') do set winbuild=%%G
|
||||
set psc=powershell.exe -nop -c
|
||||
|
||||
set _slexe=sppsvc.exe& set _slser=sppsvc
|
||||
if %winbuild% LEQ 6300 (set _slexe=SLsvc.exe& set _slser=SLsvc)
|
||||
if %winbuild% LSS 7600 if exist "%SysPath%\SLsvc.exe" (set _slexe=SLsvc.exe& set _slser=SLsvc)
|
||||
if %_slexe%==SLsvc.exe set _vis=1
|
||||
|
||||
set run_once=
|
||||
set t_name=Renewal Task
|
||||
reg query "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Schedule\taskcache\tasks" /f Path /s | find /i "\Activation-Run_Once" >nul && (
|
||||
@ -1659,6 +1689,7 @@ set _wmic=0
|
||||
for %%# in (wmic.exe) do @if not "%%~$PATH:#"=="" (
|
||||
cmd /c "wmic path Win32_ComputerSystem get CreationClassName /value" 2>nul | find /i "computersystem" 1>nul && set _wmic=1
|
||||
)
|
||||
if %winbuild% LSS 9200 set _wmic=1
|
||||
|
||||
setlocal EnableDelayedExpansion
|
||||
if exist "%ProgramFiles%\Activation-Renewal\" call :_taskstart>>"%ProgramFiles%\Activation-Renewal\Logs.txt"
|
||||
@ -1711,7 +1742,7 @@ call :_taskclear-cache
|
||||
:: Check WMI and sppsvc Errors
|
||||
|
||||
set applist=
|
||||
net start sppsvc /y %nul%
|
||||
net start %_slser% /y %nul%
|
||||
if %_wmic% EQU 1 set "chkapp=for /f "tokens=2 delims==" %%a in ('"wmic path %slp% where (ApplicationID='%_wApp%') get ID /VALUE" 2^>nul')"
|
||||
if %_wmic% EQU 0 set "chkapp=for /f "tokens=2 delims==" %%a in ('%psc% "(([WMISEARCHER]'SELECT ID FROM %slp% WHERE ApplicationID=''%_wApp%''').Get()).ID ^| %% {echo ('ID='+$_)}" 2^>nul')"
|
||||
%chkapp% do (if defined applist (call set "applist=!applist! %%a") else (call set "applist=%%a"))
|
||||
@ -2013,12 +2044,20 @@ exit /b
|
||||
:_taskclear-cache
|
||||
|
||||
set w=
|
||||
for %%# in (SppE%w%xtComObj.exe sppsvc.exe) do (
|
||||
for %%# in (SppE%w%xtComObj.exe sppsvc.exe SLsvc.exe) do (
|
||||
reg delete "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Ima%w%ge File Execu%w%tion Options\%%#" /f %nul%
|
||||
)
|
||||
|
||||
set "OPPk=SOFTWARE\Microsoft\OfficeSoftwareProtectionPlatform"
|
||||
|
||||
if %winbuild% LSS 7600 (
|
||||
reg query "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\SL" %nul% && (
|
||||
set "SPPk=SOFTWARE\Microsoft\Windows NT\CurrentVersion\SL"
|
||||
)
|
||||
)
|
||||
if not defined SPPk (
|
||||
set "SPPk=SOFTWARE\Microsoft\Windows NT\CurrentVersion\SoftwareProtectionPlatform"
|
||||
)
|
||||
|
||||
set "slp=SoftwareLicensingProduct"
|
||||
set "ospp=OfficeSoftwareProtectionProduct"
|
||||
@ -2134,10 +2173,11 @@ for /f %%G in ('%psc% "[Guid]::NewGuid().Guid"') do set "randguid=%%G"
|
||||
set "_temp=%SystemRoot%\Temp\%Random%%randguid%"
|
||||
|
||||
set nil=
|
||||
if %winbuild% LSS 7600 (set _vista=_vista)
|
||||
if exist "%_temp%\.*" rmdir /s /q "%_temp%\" %nul%
|
||||
md "%_temp%\" %nul%
|
||||
call :ks_RenExport renewal "%_temp%\Renewal.xml" Unicode
|
||||
if not defined _int (call :ks_RenExport run_once "%_temp%\Run_Once.xml" Unicode)
|
||||
call :ks_RenExport renewal%_vista% "%_temp%\Renewal.xml" Unicode
|
||||
if not defined _int (call :ks_RenExport run_once%_vista% "%_temp%\Run_Once.xml" Unicode)
|
||||
s%nil%cht%nil%asks /cre%nil%ate /tn "Activation-Renewal" /ru "SYS%nil%TEM" /xml "%_temp%\Renewal.xml" %nul%
|
||||
if not defined _int (s%nil%cht%nil%asks /cre%nil%ate /tn "Activation-Run_Once" /ru "SYS%nil%TEM" /xml "%_temp%\Run_Once.xml" %nul%)
|
||||
if exist "%_temp%\.*" rmdir /s /q "%_temp%\" %nul%
|
||||
@ -2326,16 +2366,137 @@ exit /b
|
||||
</Task>
|
||||
:run_once:
|
||||
|
||||
:renewal_vista:
|
||||
<?xml version="1.0" encoding="UTF-16"?>
|
||||
<Task version="1.2" xmlns="http://schemas.microsoft.com/windows/2004/02/mit/task">
|
||||
<RegistrationInfo>
|
||||
<Date>1999-01-01T12:00:00.34375</Date>
|
||||
<Author>WindowsAddict</Author>
|
||||
<Description>Online K-M-S Activation-Renewal - Weekly Task</Description>
|
||||
</RegistrationInfo>
|
||||
<Triggers>
|
||||
<CalendarTrigger>
|
||||
<StartBoundary>1999-01-01T12:00:00.34375</StartBoundary>
|
||||
<Enabled>true</Enabled>
|
||||
<ScheduleByWeek>
|
||||
<DaysOfWeek>
|
||||
<Sunday />
|
||||
</DaysOfWeek>
|
||||
<WeeksInterval>1</WeeksInterval>
|
||||
</ScheduleByWeek>
|
||||
</CalendarTrigger>
|
||||
</Triggers>
|
||||
<Principals>
|
||||
<Principal id="Author">
|
||||
<UserId>S-1-5-18</UserId>
|
||||
<RunLevel>HighestAvailable</RunLevel>
|
||||
</Principal>
|
||||
</Principals>
|
||||
<Settings>
|
||||
<IdleSettings>
|
||||
<Duration>PT10M</Duration>
|
||||
<WaitTimeout>PT1H</WaitTimeout>
|
||||
<StopOnIdleEnd>true</StopOnIdleEnd>
|
||||
<RestartOnIdle>false</RestartOnIdle>
|
||||
</IdleSettings>
|
||||
<MultipleInstancesPolicy>IgnoreNew</MultipleInstancesPolicy>
|
||||
<DisallowStartIfOnBatteries>false</DisallowStartIfOnBatteries>
|
||||
<StopIfGoingOnBatteries>true</StopIfGoingOnBatteries>
|
||||
<AllowHardTerminate>true</AllowHardTerminate>
|
||||
<StartWhenAvailable>true</StartWhenAvailable>
|
||||
<RunOnlyIfNetworkAvailable>true</RunOnlyIfNetworkAvailable>
|
||||
<NetworkSettings />
|
||||
<AllowStartOnDemand>true</AllowStartOnDemand>
|
||||
<Enabled>true</Enabled>
|
||||
<Hidden>false</Hidden>
|
||||
<RunOnlyIfIdle>false</RunOnlyIfIdle>
|
||||
<WakeToRun>false</WakeToRun>
|
||||
<ExecutionTimeLimit>PT10M</ExecutionTimeLimit>
|
||||
<Priority>7</Priority>
|
||||
<RestartOnFailure>
|
||||
<Interval>PT5M</Interval>
|
||||
<Count>3</Count>
|
||||
</RestartOnFailure>
|
||||
</Settings>
|
||||
<Actions Context="Author">
|
||||
<Exec>
|
||||
<Command>%ProgramFiles%\Activation-Renewal\Activation_task.cmd</Command>
|
||||
<Arguments>Task</Arguments>
|
||||
</Exec>
|
||||
</Actions>
|
||||
</Task>
|
||||
:renewal_vista:
|
||||
|
||||
:run_once_vista:
|
||||
<?xml version="1.0" encoding="UTF-16"?>
|
||||
<Task version="1.2" xmlns="http://schemas.microsoft.com/windows/2004/02/mit/task">
|
||||
<RegistrationInfo>
|
||||
<Date>1999-01-01T12:00:00.34375</Date>
|
||||
<Author>WindowsAddict</Author>
|
||||
<Description>Online K-M-S Activation Run Once - Run and Delete itself on first Internet Contact</Description>
|
||||
</RegistrationInfo>
|
||||
<Triggers>
|
||||
<LogonTrigger>
|
||||
<Enabled>true</Enabled>
|
||||
</LogonTrigger>
|
||||
</Triggers>
|
||||
<Principals>
|
||||
<Principal id="Author">
|
||||
<UserId>S-1-5-18</UserId>
|
||||
<RunLevel>HighestAvailable</RunLevel>
|
||||
</Principal>
|
||||
</Principals>
|
||||
<Settings>
|
||||
<IdleSettings>
|
||||
<Duration>PT10M</Duration>
|
||||
<WaitTimeout>PT1H</WaitTimeout>
|
||||
<StopOnIdleEnd>true</StopOnIdleEnd>
|
||||
<RestartOnIdle>false</RestartOnIdle>
|
||||
</IdleSettings>
|
||||
<MultipleInstancesPolicy>IgnoreNew</MultipleInstancesPolicy>
|
||||
<DisallowStartIfOnBatteries>false</DisallowStartIfOnBatteries>
|
||||
<StopIfGoingOnBatteries>true</StopIfGoingOnBatteries>
|
||||
<AllowHardTerminate>true</AllowHardTerminate>
|
||||
<StartWhenAvailable>true</StartWhenAvailable>
|
||||
<RunOnlyIfNetworkAvailable>true</RunOnlyIfNetworkAvailable>
|
||||
<NetworkSettings />
|
||||
<AllowStartOnDemand>true</AllowStartOnDemand>
|
||||
<Enabled>true</Enabled>
|
||||
<Hidden>false</Hidden>
|
||||
<RunOnlyIfIdle>false</RunOnlyIfIdle>
|
||||
<WakeToRun>false</WakeToRun>
|
||||
<ExecutionTimeLimit>PT10M</ExecutionTimeLimit>
|
||||
<Priority>7</Priority>
|
||||
<RestartOnFailure>
|
||||
<Interval>PT5M</Interval>
|
||||
<Count>3</Count>
|
||||
</RestartOnFailure>
|
||||
</Settings>
|
||||
<Actions Context="Author">
|
||||
<Exec>
|
||||
<Command>%ProgramFiles%\Activation-Renewal\Activation_task.cmd</Command>
|
||||
<Arguments>Task</Arguments>
|
||||
</Exec>
|
||||
</Actions>
|
||||
</Task>
|
||||
:run_once_vista:
|
||||
|
||||
::========================================================================================================================================
|
||||
|
||||
:: Set variables
|
||||
|
||||
:dk_setvar
|
||||
|
||||
set psc=powershell.exe -nop -c
|
||||
set ps=%SysPath%\WindowsPowerShell\v1.0\powershell.exe
|
||||
set psc=%ps% -nop -c
|
||||
set winbuild=1
|
||||
for /f "tokens=6 delims=[]. " %%G in ('ver') do set winbuild=%%G
|
||||
|
||||
set _slexe=sppsvc.exe& set _slser=sppsvc
|
||||
if %winbuild% LEQ 6300 (set _slexe=SLsvc.exe& set _slser=SLsvc)
|
||||
if %winbuild% LSS 7600 if exist "%SysPath%\SLsvc.exe" (set _slexe=SLsvc.exe& set _slser=SLsvc)
|
||||
if %_slexe%==SLsvc.exe set _vis=1
|
||||
|
||||
set _NCS=1
|
||||
if %winbuild% LSS 10586 set _NCS=0
|
||||
if %winbuild% GEQ 10586 reg query "HKCU\Console" /v ForceV2 %nul2% | find /i "0x0" %nul1% && (set _NCS=0)
|
||||
@ -2475,11 +2636,12 @@ set keyerror=%errorlevel%
|
||||
cmd /c exit /b %keyerror%
|
||||
if %keyerror% NEQ 0 set "keyerror=[0x%=ExitCode%]"
|
||||
|
||||
if defined generickey (set "keyecho=Installing Generic Product Key ") else (set "keyecho=Installing Product Key ")
|
||||
if %keyerror% EQU 0 (
|
||||
if %sps%==SoftwareLicensingService call :dk_refresh
|
||||
echo Installing Generic Product Key %~1 [Successful]
|
||||
echo %keyecho% %~1 [Successful]
|
||||
) else (
|
||||
call :dk_color %Red% "Installing Generic Product Key %~1 [Failed] %keyerror%"
|
||||
call :dk_color %Red% "%keyecho% %~1 [Failed] %keyerror%"
|
||||
if not defined error (
|
||||
if defined altapplist call :dk_color %Red% "Activation ID not found for this key."
|
||||
call :dk_color %Blue% "%_fixmsg%"
|
||||
@ -2488,6 +2650,7 @@ set showfix=1
|
||||
set error=1
|
||||
)
|
||||
|
||||
set generickey=
|
||||
exit /b
|
||||
|
||||
:: Get Windows installed key channel
|
||||
@ -2539,6 +2702,8 @@ exit /b
|
||||
|
||||
:dk_reeval
|
||||
|
||||
if %winbuild% LSS 7600 exit /b
|
||||
|
||||
:: This key is left by the system in rearm process and sppsvc sometimes fails to delete it, it causes issues in working of the Scheduled Tasks of SPP
|
||||
|
||||
set "ruleskey=HKU\S-1-5-20\Software\Microsoft\Windows NT\CurrentVersion\SoftwareProtectionPlatform\PersistedSystemState"
|
||||
@ -2566,13 +2731,13 @@ function InstallLicenseArr($Str) {
|
||||
ForEach ($x in $a) {InstallLicenseFile "$x"}
|
||||
}
|
||||
function InstallLicenseDir($Loc) {
|
||||
dir $Loc *.xrm-ms -af -s | select -expand FullName | % {InstallLicenseFile "$_"}
|
||||
Get-ChildItem $Loc -Recurse -Filter *.xrm-ms | ForEach-Object {InstallLicenseFile $_.FullName}
|
||||
}
|
||||
function ReinstallLicenses() {
|
||||
$Oem = "$env:SysPath\oem"
|
||||
$Spp = "$env:SysPath\spp\tokens"
|
||||
InstallLicenseDir "$Spp"
|
||||
If (Test-Path $Oem) {InstallLicenseDir "$Oem"}
|
||||
$Paths = @("$env:SysPath\oem", "$env:SysPath\licensing", "$env:SysPath\spp\tokens")
|
||||
foreach ($Path in $Paths) {
|
||||
if (Test-Path $Path) { InstallLicenseDir "$Path" }
|
||||
}
|
||||
}
|
||||
:xrm:
|
||||
|
||||
@ -2580,6 +2745,7 @@ function ReinstallLicenses() {
|
||||
|
||||
:dk_ckeckwmic
|
||||
|
||||
if %winbuild% LSS 9200 (set _wmic=1&exit /b)
|
||||
set _wmic=0
|
||||
for %%# in (wmic.exe) do @if not "%%~$PATH:#"=="" (
|
||||
cmd /c "wmic path Win32_ComputerSystem get CreationClassName /value" %nul2% | find /i "computersystem" %nul1% && set _wmic=1
|
||||
@ -2590,16 +2756,16 @@ exit /b
|
||||
|
||||
:dk_sppissue
|
||||
|
||||
sc start sppsvc %nul%
|
||||
sc start %_slser% %nul%
|
||||
set spperror=%errorlevel%
|
||||
|
||||
if %spperror% NEQ 1056 if %spperror% NEQ 0 (
|
||||
%eline%
|
||||
echo sc start sppsvc [Error Code: %spperror%]
|
||||
echo sc start %_slser% [Error Code: %spperror%]
|
||||
)
|
||||
|
||||
echo:
|
||||
%psc% "$job = Start-Job { (Get-WmiObject -Query 'SELECT * FROM %sps%').Version }; if (-not (Wait-Job $job -Timeout 30)) {write-host 'sppsvc is not working correctly. Check this webpage for help - %mas%troubleshoot'}"
|
||||
%psc% "$job = Start-Job { (Get-WmiObject -Query 'SELECT * FROM %sps%').Version }; if (-not (Wait-Job $job -Timeout 30)) {write-host '%_slser% is not working correctly. Check this webpage for help - %mas%troubleshoot'}"
|
||||
exit /b
|
||||
|
||||
:: Get Product name (WMI/REG methods are not reliable in all conditions, hence winbrand.dll method is used)
|
||||
@ -2607,7 +2773,7 @@ exit /b
|
||||
:dk_product
|
||||
|
||||
set d1=%ref% $meth = $TypeBuilder.DefinePInvokeMethod('BrandingFormatString', 'winbrand.dll', 'Public, Static', 1, [String], @([String]), 1, 3);
|
||||
set d1=%d1% $meth.SetImplementationFlags(128); $TypeBuilder.CreateType()::BrandingFormatString('%%WINDOWS_LONG%%')
|
||||
set d1=%d1% $meth.SetImplementationFlags(128); $TypeBuilder.CreateType()::BrandingFormatString('%%WINDOWS_LONG%%') -replace [string][char]0xa9, '' -replace [string][char]0xae, '' -replace [string][char]0x2122, ''
|
||||
|
||||
set winos=
|
||||
for /f "delims=" %%s in ('"%psc% %d1%"') do if not errorlevel 1 (set winos=%%s)
|
||||
@ -2708,11 +2874,11 @@ for %%# in (avira.com kaspersky.com virustotal.com mcafee.com) do (
|
||||
find /i "%%#" %SysPath%\drivers\etc\hosts %nul% && set /a hcount+=1)
|
||||
if %hcount%==4 set "results=[Antivirus URLs are blocked in hosts]"
|
||||
|
||||
sc start sppsvc %nul%
|
||||
sc start %_slser% %nul%
|
||||
echo "%errorlevel%" | findstr "577 225" %nul% && (
|
||||
set "results=%results%[Likely File Infector]"
|
||||
) || (
|
||||
if not exist %SysPath%\sppsvc.exe if not exist %SysPath%\alg.exe (set "results=%results%[Likely File Infector]")
|
||||
if not exist %SysPath%\%_slexe% if not exist %SysPath%\alg.exe (set "results=%results%[Likely File Infector]")
|
||||
)
|
||||
|
||||
if not "%results%%pupfound%"=="" (
|
||||
@ -2792,6 +2958,7 @@ for %%# in (%serv_ste%) do (
|
||||
if /i %%#==ClipSVC (reg add "HKLM\SYSTEM\CurrentControlSet\Services\%%#" /v "Start" /t REG_DWORD /d "3" /f %nul% & sc config %%# start= demand %nul%)
|
||||
if /i %%#==wlidsvc sc config %%# start= demand %nul%
|
||||
if /i %%#==sppsvc (reg add "HKLM\SYSTEM\CurrentControlSet\Services\%%#" /v "Start" /t REG_DWORD /d "2" /f %nul% & sc config %%# start= delayed-auto %nul%)
|
||||
if /i %%#==SLsvc sc config %%# start= auto %nul%
|
||||
if /i %%#==KeyIso sc config %%# start= demand %nul%
|
||||
if /i %%#==LicenseManager sc config %%# start= demand %nul%
|
||||
if /i %%#==Winmgmt sc config %%# start= auto %nul%
|
||||
@ -2921,19 +3088,22 @@ if %osedition%==0 (
|
||||
call :dk_color %Red% "Checking Edition Name [Not Found In Registry]"
|
||||
) else (
|
||||
|
||||
if not exist "%SysPath%\spp\tokens\skus\%osedition%\%osedition%*.xrm-ms" if not exist "%SysPath%\spp\tokens\skus\Security-SPP-Component-SKU-%osedition%\*-%osedition%-*.xrm-ms" (
|
||||
if not exist "%SysPath%\spp\tokens\skus\%osedition%\%osedition%*.xrm-ms" if not exist "%SysPath%\spp\tokens\skus\Security-SPP-Component-SKU-%osedition%\*-%osedition%-*.xrm-ms" if not exist "%SysPath%\licensing\skus\Security-Licensing-SLC-Component-SKU-%osedition%\*-%osedition%-*.xrm-ms" (
|
||||
set skunotfound=1
|
||||
call :dk_color %Red% "Checking License Files [Not Found] [%osedition%]"
|
||||
)
|
||||
|
||||
if not exist "%SystemRoot%\Servicing\Packages\Microsoft-Windows-*-%osedition%-*.mum" (
|
||||
if not exist "%SystemRoot%\Servicing\Packages\Microsoft-Windows-%osedition%Edition*.mum" (
|
||||
call :dk_color %Red% "Checking Package Files [Not Found] [%osedition%]"
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
|
||||
|
||||
%psc% "try { $null=([WMISEARCHER]'SELECT * FROM %sps%').Get().Version; exit 0 } catch { exit $_.Exception.InnerException.HResult }" %nul%
|
||||
if %_wmic% EQU 1 wmic path %sps% get Version %nul%
|
||||
if %_wmic% EQU 0 %psc% "try { $null=([WMISEARCHER]'SELECT * FROM %sps%').Get().Version; exit 0 } catch { exit $_.Exception.InnerException.HResult }" %nul%
|
||||
set error_code=%errorlevel%
|
||||
cmd /c exit /b %error_code%
|
||||
if %error_code% NEQ 0 set "error_code=0x%=ExitCode%"
|
||||
@ -3003,7 +3173,7 @@ call :dk_color2 %Blue% "In case of activation issues, do this - " %_Yellow% " %m
|
||||
)
|
||||
|
||||
|
||||
for %%# in (SppEx%w%tComObj.exe sppsvc.exe sppsvc.exe\PerfOptions) do (
|
||||
for %%# in (SppEx%w%tComObj.exe SLsvc.exe sppsvc.exe sppsvc.exe\PerfOptions) do (
|
||||
reg query "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Ima%w%ge File Execu%w%tion Options\%%#" %nul% && (if defined _sppint (set "_sppint=!_sppint!, %%#") else (set "_sppint=%%#"))
|
||||
)
|
||||
if defined _sppint (
|
||||
@ -3017,14 +3187,14 @@ echo Checking SPP In IFEO [%_sppint%]
|
||||
)
|
||||
|
||||
|
||||
for /f "skip=2 tokens=2*" %%a in ('reg query "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\SoftwareProtectionPlatform" /v "SkipRearm" %nul6%') do if /i %%b NEQ 0x0 (
|
||||
if %winbuild% GEQ 7600 for /f "skip=2 tokens=2*" %%a in ('reg query "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\SoftwareProtectionPlatform" /v "SkipRearm" %nul6%') do if /i %%b NEQ 0x0 (
|
||||
reg add "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\SoftwareProtectionPlatform" /v "SkipRearm" /t REG_DWORD /d "0" /f %nul%
|
||||
call :dk_color %Red% "Checking SkipRearm [Default 0 Value Not Found. Changing To 0]"
|
||||
%psc% "Start-Job { Stop-Service sppsvc -force } | Wait-Job -Timeout 20 | Out-Null"
|
||||
)
|
||||
|
||||
|
||||
reg query "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\SoftwareProtectionPlatform\Plugins\Objects\msft:rm/algorithm/hwid/4.0" /f ba02fed39662 /d %nul% || (
|
||||
if %winbuild% GEQ 7600 reg query "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\SoftwareProtectionPlatform\Plugins\Objects\msft:rm/algorithm/hwid/4.0" /f ba02fed39662 /d %nul% || (
|
||||
call :dk_color %Red% "Checking SPP Registry Key [Incorrect ModuleId Found]"
|
||||
set fixes=%fixes% %mas%issues_due_to_gaming_spoofers
|
||||
call :dk_color2 %Blue% "Most likely caused by gaming spoofers. Check this webpage for help - " %_Yellow% " %mas%issues_due_to_gaming_spoofers"
|
||||
@ -3034,21 +3204,22 @@ set showfix=1
|
||||
|
||||
|
||||
set tokenstore=
|
||||
if %winbuild% GEQ 7600 (
|
||||
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% LSS 9200 set "tokenstore=%Systemdrive%\Windows\ServiceProfiles\NetworkService\AppData\Roaming\Microsoft\SoftwareProtectionPlatform"
|
||||
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" (
|
||||
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 toerr=1
|
||||
set error=1
|
||||
set showfix=1
|
||||
call :dk_color %Red% "Checking TokenStore Registry Key [Correct Path Not Found] [%tokenstore%]"
|
||||
call :dk_color %Red% "Checking TokenStore Registry Key [Correct Path Not Found] [!tokenstore!]"
|
||||
set fixes=%fixes% %mas%troubleshoot
|
||||
call :dk_color2 %Blue% "Check this webpage for help - " %_Yellow% " %mas%troubleshoot"
|
||||
)
|
||||
|
||||
)
|
||||
|
||||
:: This code creates token folder only if it's missing and sets default permission for it
|
||||
|
||||
if not defined toerr if not exist "%tokenstore%\" (
|
||||
if %winbuild% GEQ 7600 if not defined toerr if not exist "%tokenstore%\" (
|
||||
mkdir "%tokenstore%" %nul%
|
||||
if %winbuild% LSS 9200 set "d=$sddl = 'O:NSG:NSD:AI(A;OICIID;FA;;;SY)(A;OICIID;FA;;;BA)(A;OICIID;FA;;;NS)';"
|
||||
if %winbuild% GEQ 9200 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)';"
|
||||
@ -3069,7 +3240,7 @@ set showfix=1
|
||||
if not defined notwinact (
|
||||
call :dk_actid 55c92734-d682-4d71-983e-d6ec3f16059f
|
||||
if not defined apps (
|
||||
%psc% "Start-Job { Stop-Service sppsvc -force } | Wait-Job -Timeout 20 | Out-Null; $sls = Get-WmiObject SoftwareLicensingService; $f=[io.file]::ReadAllText('!_batp!') -split ':xrm\:.*';iex ($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=[io.file]::ReadAllText('!_batp!') -split ':xrm\:.*';iex ($f[1]); ReinstallLicenses" %nul%
|
||||
call :dk_actid 55c92734-d682-4d71-983e-d6ec3f16059f
|
||||
if not defined apps (
|
||||
set "_notfoundids=Key Not Installed / Act ID Not Found"
|
||||
@ -3084,7 +3255,7 @@ call :dk_color %Red% "Checking Activation IDs [!_notfoundids!]"
|
||||
)
|
||||
|
||||
|
||||
if exist "%tokenstore%\" if not exist "%tokenstore%\tokens.dat" (
|
||||
if %winbuild% GEQ 7600 if exist "%tokenstore%\" if not exist "%tokenstore%\tokens.dat" (
|
||||
set error=1
|
||||
call :dk_color %Red% "Checking SPP tokens.dat [Not Found] [%tokenstore%\]"
|
||||
)
|
||||
@ -3219,8 +3390,10 @@ $wpaKey.Close()
|
||||
|
||||
if %_NCS% EQU 1 (
|
||||
echo %esc%[%~1%~2%esc%[0m
|
||||
) else (
|
||||
) else if exist %ps% (
|
||||
%psc% write-host -back '%1' -fore '%2' '%3'
|
||||
) else if not exist %ps% (
|
||||
echo %~3
|
||||
)
|
||||
exit /b
|
||||
|
||||
@ -3228,8 +3401,10 @@ exit /b
|
||||
|
||||
if %_NCS% EQU 1 (
|
||||
echo %esc%[%~1%~2%esc%[%~3%~4%esc%[0m
|
||||
) else (
|
||||
) else if exist %ps% (
|
||||
%psc% write-host -back '%1' -fore '%2' '%3' -NoNewline; write-host -back '%4' -fore '%5' '%6'
|
||||
) else if not exist %ps% (
|
||||
echo %~3 %~6
|
||||
)
|
||||
exit /b
|
||||
|
||||
@ -3244,6 +3419,7 @@ if defined fixes (
|
||||
call :dk_color %White% "Follow ALL the ABOVE blue lines. "
|
||||
call :dk_color2 %Blue% "Press [1] to Open Support Webpage " %Gray% " Press [0] to Ignore"
|
||||
choice /C:10 /N
|
||||
if !errorlevel!==2 exit /b
|
||||
if !errorlevel!==1 (for %%# in (%fixes%) do (start %%#))
|
||||
)
|
||||
|
||||
@ -3266,47 +3442,30 @@ exit /b
|
||||
:: 5th column = Other Edition IDs if they are part of the same primary product (For reference only)
|
||||
:: Separator = "_"
|
||||
|
||||
:: EditionID Notes:
|
||||
:: For Office 2013 and later, all Edition IDs are clearly defined, and each ID corresponds to its specific licensing.
|
||||
|
||||
:: In Office 2010, the situation is a bit more complicated.
|
||||
:: Products typically fall into two separate categories: Volume License (VL) and Non-VL. This is because a single installation cannot include both Retail and VL licensing types.
|
||||
:: Some Edition IDs share the same primary product ID. For example, installing ProPlusVL also installs ProPlusAcadVL licenses, as both use 0011 as the primary product ID.
|
||||
:: Therefore, in the script, we grouped VL and Non-VL versions by primary product ID and selected the highest Edition ID when multiple Edition IDs existed for the same primary product ID.
|
||||
|
||||
:: There are a few exceptions to this 2010 rule: Visio (Premium, Pro, Standard) and OEM-SingleImage.
|
||||
|
||||
:: For Visio, the issue is that branding.xml lists incorrect primary product IDs. The correct primary product ID for all three Visio variants is 0057. Based on the criteria above, we chose Visio-Premium as the representative Edition ID among the three.
|
||||
:: For OEM-SingleImage, it installs multiple Edition IDs and uses 003D as the primary product ID. Following our method, we selected the highest available Edition ID—ProfessionalR in this case.
|
||||
|
||||
:msiofficedata
|
||||
|
||||
for %%# in (
|
||||
14_4d463c2c-0505-4626-8cdb-a4da82e2d8ed_0015_AccessR
|
||||
14_745fb377-0a59-4ca9-b9a9-c359557a2c4e_001C_AccessRuntimeR
|
||||
14_95ab3ec8-4106-4f9d-b632-03c019d1d23f_0015_AccessVL
|
||||
14_4eaff0d0-c6cb-4187-94f3-c7656d49a0aa_0016_ExcelR
|
||||
14_4eaff0d0-c6cb-4187-94f3-c7656d49a0aa_0016_ExcelR_[HSExcelR]
|
||||
14_71dc86ff-f056-40d0-8ffb-9592705c9b76_0016_ExcelVL
|
||||
14_7004b7f0-6407-4f45-8eac-966e5f868bde_00BA_GrooveR
|
||||
14_fdad0dfa-417d-4b4f-93e4-64ea8867b7fd_00BA_GrooveVL
|
||||
14_7b7d1f17-fdcb-4820-9789-9bec6e377821_0013_HomeBusinessR_[HomeBusinessDemoR]
|
||||
14_19316117-30a8-4773-8fd9-7f7231f4e060_011E_HomeBusinessSubR
|
||||
14_09e2d37e-474b-4121-8626-58ad9be5776f_002F_HomeStudentR_[HomeStudentDemoR]
|
||||
14_c3ae020c-5a71-4cc5-a27a-2a97c2d46860_0029_HSExcelR
|
||||
14_25fe4611-b44d-49cc-ae87-2143d299194e_00A3_HSOneNoteR
|
||||
14_d652ad8d-da5c-4358-b928-7fb1b4de7a7c_0037_HSPowerPointR
|
||||
14_a963d7ae-7a88-41a7-94da-8bb5635a8af9_002B_HSWordR
|
||||
14_ef1da464-01c8-43a6-91af-e4e5713744f9_0044_InfoPathR
|
||||
14_85e22450-b741-430c-a172-a37962c938af_0044_InfoPathVL
|
||||
14_14f5946a-debc-4716-babc-7e2c240fec08_000F_MondoR
|
||||
14_533b656a-4425-480b-8e30-1a2358898350_000F_MondoVL
|
||||
14_c1ceda8b-c578-4d5d-a4aa-23626be4e234_003D_ProfessionalR_[OEM-SingleImage]Exception
|
||||
14_3f7aa693-9a7e-44fc-9309-bb3d8e604925_00A1_OneNoteR
|
||||
14_3f7aa693-9a7e-44fc-9309-bb3d8e604925_00A1_OneNoteR_[HSOneNoteR]
|
||||
14_6860b31f-6a67-48b8-84b9-e312b3485c4b_00A1_OneNoteVL
|
||||
14_fbf4ac36-31c8-4340-8666-79873129cf40_001A_OutlookR
|
||||
14_a9aeabd8-63b8-4079-a28e-f531807fd6b8_001A_OutlookVL
|
||||
14_acb51361-c0db-4895-9497-1831c41f31a6_0033_PersonalR_[PersonalDemoR,PersonalPrepaidR]
|
||||
14_133c8359-4e93-4241-8118-30bb18737ea0_0018_PowerPointR
|
||||
14_133c8359-4e93-4241-8118-30bb18737ea0_0018_PowerPointR_[HSPowerPointR]
|
||||
14_38252940-718c-4aa6-81a4-135398e53851_0018_PowerPointVL
|
||||
14_8b559c37-0117-413e-921b-b853aeb6e210_0014_ProfessionalR_[ProfessionalAcadR,ProfessionalDemoR]
|
||||
14_725714d7-d58f-4d12-9fa8-35873c6f7215_003B_ProjectProR_[ProjectProMSDNR]
|
||||
@ -3327,7 +3486,7 @@ for %%# in (
|
||||
14_2745e581-565a-4670-ae90-6bf7c57ffe43_0066_StarterR
|
||||
14_66cad568-c2dc-459d-93ec-2f3cb967ee34_0057_VisioSIR_Prem[Pro,Std]Exception
|
||||
14_36756cb8-8e69-4d11-9522-68899507cd6a_0057_VisioSIVL_Prem[Pro,Std]Exception
|
||||
14_db3bbc9c-ce52-41d1-a46f-1a1d68059119_001B_WordR
|
||||
14_db3bbc9c-ce52-41d1-a46f-1a1d68059119_001B_WordR_[HSWordR]
|
||||
14_98d4050e-9c98-49bf-9be1-85e12eb3ab13_001B_WordVL
|
||||
:: Office 2013
|
||||
15_ab4d047b-97cf-4126-a69f-34df08e2f254_0015_AccessRetail
|
||||
@ -3445,6 +3604,7 @@ if "%oVer%"=="%%A" (
|
||||
reg query "%1\Registration\{%%B}" /v ProductCode %nul2% | find /i "-%%C-" %nul% && (
|
||||
reg query "%1\Common\InstalledPackages" %nul2% | find /i "-%%C-" %nul% && (
|
||||
if defined _oIds (set _oIds=!_oIds! %%D) else (set _oIds=%%D)
|
||||
if /i 003D==%%C set SingleImage=1
|
||||
)
|
||||
)
|
||||
)
|
||||
@ -3588,7 +3748,22 @@ 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
|
||||
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
|
||||
::========================================================================================================================================
|
||||
:: Windows Vista
|
||||
cfd8ff08-c0d7-452b-9f60-ef5c70c32094_VKK3X-68KWM-X2YGT-QR4M6-4B%f%WMV___4_Enterprise
|
||||
4f3d1606-3fea-4c01-be3c-8d671c401e3b_YFKBB-PQJJV-G996G-VWGXY-2V%f%3X8___6_Business
|
||||
2c682dc2-8b68-4f63-a165-ae291d4cf138_HMBQG-8H2RH-C77VX-27R82-VM%f%QBT__16_BusinessN
|
||||
d4f54950-26f2-4fb4-ba21-ffab16afcade_VTC42-BM838-43QHV-84HX6-XJ%f%XKV__27_EnterpriseN
|
||||
:: Windows Server 2008
|
||||
ad2542d4-9154-4c6d-8a44-30f11ee96989_TM24T-X9RMF-VWXK6-X8JC9-BF%f%GM2___7_ServerStandard
|
||||
68b6e220-cf09-466b-92d3-45cd964b9509_7M67G-PC374-GR742-YH8V4-TC%f%BY3___8_ServerDatacenter
|
||||
c1af4d90-d1bc-44ca-85d4-003ba33db3b9_YQGMW-MPWTJ-34KDK-48M3W-X4%f%Q6V__10_ServerEnterprise
|
||||
01ef176b-3e0d-422a-b4f8-4ea880035e8f_4DWFP-JF3DJ-B7DTH-78FJB-PD%f%RHK__15_ServerEnterpriseIA64
|
||||
ddfa9f7c-f09e-40b9-8c1a-be877a9a7f4b_WYR28-R7TFJ-3X2YQ-YCY4H-M2%f%49D__17_ServerWeb
|
||||
7afb1156-2c1d-40fc-b260-aab7442b62fe_RCTX3-KWVHP-BR6TB-RB6DM-6X%f%7HP__18_ServerComputeCluster
|
||||
2401e3d0-c50a-4b58-87b2-7e794b7d2607_W7VD6-7JFBR-RX26B-YKQ3Y-6F%f%FFJ__36_ServerStandardV
|
||||
fd09ef77-5647-4eff-809c-af2b64659a45_22XQ2-VRXRG-P8D42-K34TD-G3%f%QQC__37_ServerDatacenterV
|
||||
8198490a-add0-47b2-b3ba-316b12d647b4_39BXF-X8Q23-P2WWT-38T2F-G3%f%FPG__38_ServerEnterpriseV
|
||||
::=======================================================================================================================================
|
||||
:: Office 2010
|
||||
8ce7e872-188c-4b98-9d90-f8f90b7aad02_V7Y44-9T38C-R2VJK-666HK-T7%f%DDX__14_AccessVL
|
||||
cee5d470-6e3b-4fcc-8c2b-d17428568a9f_H62QG-HXVKF-PP4HP-66KMR-CW%f%9BM__14_ExcelVL
|
||||
@ -3635,7 +3810,7 @@ d9f5b1c6-5386-495a-88f9-9ad6b41ac9b3_6Q7VD-NX8JD-WJ2VH-88V73-4G%f%BJ7__15_WordVo
|
||||
67c0fc0c-deba-401b-bf8b-9c8ad8395804_GNH9Y-D2J4T-FJHGG-QRVH7-QP%f%FDW__16_AccessVolume_-AccessRetail-
|
||||
c3e65d36-141f-4d2f-a303-a842ee756a29_9C2PK-NWTVB-JMPW8-BFT28-7F%f%TBF__16_ExcelVolume_-ExcelRetail-
|
||||
e914ea6e-a5fa-4439-a394-a9bb3293ca09_DMTCJ-KNRKX-26982-JYCKT-P7%f%KB6__16_MondoRetail
|
||||
9caabccb-61b1-4b4b-8bec-d10a3c3ac2ce_HFTND-W9MK4-8B7MJ-B6C4G-XQ%f%BR2__16_MondoVolume_-O365BusinessRetail-O365EduCloudRetail-O365HomePremRetail-O365ProPlusRetail-O365SmallBusPremRetail-
|
||||
9caabccb-61b1-4b4b-8bec-d10a3c3ac2ce_HFTND-W9MK4-8B7MJ-B6C4G-XQ%f%BR2__16_MondoVolume_-O365AppsBasicRetail-O365BusinessRetail-O365EduCloudRetail-O365HomePremRetail-O365ProPlusRetail-O365SmallBusPremRetail-
|
||||
436366de-5579-4f24-96db-3893e4400030_XYNTG-R96FY-369HX-YFPHY-F9%f%CPM__16_OneNoteFreeRetail_[Bypass]
|
||||
d8cace59-33d2-4ac7-9b1b-9b72339c51c8_DR92N-9HTF2-97XKM-XW2WJ-XW%f%3J6__16_OneNoteVolume_-OneNoteRetail-OneNote2021Retail-
|
||||
ec9d9265-9d1e-4ed0-838a-cdc20f2551a1_R69KK-NTPKF-7M3Q4-QYBHW-6M%f%T9B__16_OutlookVolume_-OutlookRetail-
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -1,4 +1,4 @@
|
||||
@set masver=3.0
|
||||
@set masver=3.2
|
||||
@echo off
|
||||
|
||||
|
||||
@ -134,9 +134,9 @@ goto dk_done
|
||||
)
|
||||
|
||||
if %winbuild% LSS 7600 (
|
||||
%nceline%
|
||||
%eline%
|
||||
echo Unsupported OS version detected [%winbuild%].
|
||||
echo Project is supported only for Windows 7/8/8.1/10/11 and their Server equivalents.
|
||||
echo This option is supported only for Windows 7/8/8.1/10/11 and their Server equivalents.
|
||||
goto dk_done
|
||||
)
|
||||
|
||||
@ -188,7 +188,7 @@ goto dk_done
|
||||
|
||||
::pstst $ExecutionContext.SessionState.LanguageMode :pstst
|
||||
|
||||
for /f "delims=" %%a in ('cmd /c "%psc% ""if ($PSVersionTable.PSEdition -ne 'Core') {$f=[io.file]::ReadAllText('!_batp!') -split ':pstst';iex ($f[1])}""" %nul6%') do (set tstresult=%%a)
|
||||
for /f "delims=" %%a in ('%psc% "if ($PSVersionTable.PSEdition -ne 'Core') {$f=[io.file]::ReadAllText('!_batp!') -split ':pstst';iex ($f[1])}" %nul6%') do (set tstresult=%%a)
|
||||
|
||||
if /i not "%tstresult%"=="FullLanguage" (
|
||||
%eline%
|
||||
@ -1111,6 +1111,7 @@ if defined fixes (
|
||||
call :dk_color %White% "Follow ALL the ABOVE blue lines. "
|
||||
call :dk_color2 %Blue% "Press [1] to Open Support Webpage " %Gray% " Press [0] to Ignore"
|
||||
choice /C:10 /N
|
||||
if !errorlevel!==2 goto :oemenu
|
||||
if !errorlevel!==1 (for %%# in (%fixes%) do (start %%#))
|
||||
)
|
||||
|
||||
@ -1352,10 +1353,16 @@ if ($appIdsList.Count -gt 0) {
|
||||
|
||||
:dk_setvar
|
||||
|
||||
set psc=powershell.exe -nop -c
|
||||
set ps=%SysPath%\WindowsPowerShell\v1.0\powershell.exe
|
||||
set psc=%ps% -nop -c
|
||||
set winbuild=1
|
||||
for /f "tokens=6 delims=[]. " %%G in ('ver') do set winbuild=%%G
|
||||
|
||||
set _slexe=sppsvc.exe& set _slser=sppsvc
|
||||
if %winbuild% LEQ 6300 (set _slexe=SLsvc.exe& set _slser=SLsvc)
|
||||
if %winbuild% LSS 7600 if exist "%SysPath%\SLsvc.exe" (set _slexe=SLsvc.exe& set _slser=SLsvc)
|
||||
if %_slexe%==SLsvc.exe set _vis=1
|
||||
|
||||
set _NCS=1
|
||||
if %winbuild% LSS 10586 set _NCS=0
|
||||
if %winbuild% GEQ 10586 reg query "HKCU\Console" /v ForceV2 %nul2% | find /i "0x0" %nul1% && (set _NCS=0)
|
||||
@ -1402,6 +1409,7 @@ exit /b
|
||||
|
||||
:dk_ckeckwmic
|
||||
|
||||
if %winbuild% LSS 9200 (set _wmic=1&exit /b)
|
||||
set _wmic=0
|
||||
for %%# in (wmic.exe) do @if not "%%~$PATH:#"=="" (
|
||||
cmd /c "wmic path Win32_ComputerSystem get CreationClassName /value" %nul2% | find /i "computersystem" %nul1% && set _wmic=1
|
||||
@ -1412,16 +1420,16 @@ exit /b
|
||||
|
||||
:dk_sppissue
|
||||
|
||||
sc start sppsvc %nul%
|
||||
sc start %_slser% %nul%
|
||||
set spperror=%errorlevel%
|
||||
|
||||
if %spperror% NEQ 1056 if %spperror% NEQ 0 (
|
||||
%eline%
|
||||
echo sc start sppsvc [Error Code: %spperror%]
|
||||
echo sc start %_slser% [Error Code: %spperror%]
|
||||
)
|
||||
|
||||
echo:
|
||||
%psc% "$job = Start-Job { (Get-WmiObject -Query 'SELECT * FROM %sps%').Version }; if (-not (Wait-Job $job -Timeout 30)) {write-host 'sppsvc is not working correctly. Check this webpage for help - %mas%troubleshoot'}"
|
||||
%psc% "$job = Start-Job { (Get-WmiObject -Query 'SELECT * FROM %sps%').Version }; if (-not (Wait-Job $job -Timeout 30)) {write-host '%_slser% is not working correctly. Check this webpage for help - %mas%troubleshoot'}"
|
||||
exit /b
|
||||
|
||||
:: Common lines used in PowerShell reflection code
|
||||
@ -1439,8 +1447,10 @@ exit /b
|
||||
|
||||
if %_NCS% EQU 1 (
|
||||
echo %esc%[%~1%~2%esc%[0m
|
||||
) else (
|
||||
) else if exist %ps% (
|
||||
%psc% write-host -back '%1' -fore '%2' '%3'
|
||||
) else if not exist %ps% (
|
||||
echo %~3
|
||||
)
|
||||
exit /b
|
||||
|
||||
@ -1448,8 +1458,10 @@ exit /b
|
||||
|
||||
if %_NCS% EQU 1 (
|
||||
echo %esc%[%~1%~2%esc%[%~3%~4%esc%[0m
|
||||
) else (
|
||||
) else if exist %ps% (
|
||||
%psc% write-host -back '%1' -fore '%2' '%3' -NoNewline; write-host -back '%4' -fore '%5' '%6'
|
||||
) else if not exist %ps% (
|
||||
echo %~3 %~6
|
||||
)
|
||||
exit /b
|
||||
|
||||
@ -1464,6 +1476,7 @@ if defined fixes (
|
||||
call :dk_color %White% "Follow ALL the ABOVE blue lines. "
|
||||
call :dk_color2 %Blue% "Press [1] to Open Support Webpage " %Gray% " Press [0] to Ignore"
|
||||
choice /C:10 /N
|
||||
if !errorlevel!==2 exit /b
|
||||
if !errorlevel!==1 (for %%# in (%fixes%) do (start %%#))
|
||||
)
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
@set masver=3.0
|
||||
@set masver=3.2
|
||||
@echo off
|
||||
|
||||
|
||||
@ -139,9 +139,9 @@ goto dk_done
|
||||
)
|
||||
|
||||
if %winbuild% LSS 7600 (
|
||||
%nceline%
|
||||
%eline%
|
||||
echo Unsupported OS version detected [%winbuild%].
|
||||
echo Project is supported only for Windows 7/8/8.1/10/11 and their Server equivalents.
|
||||
echo This option is supported only for Windows 7/8/8.1/10/11 and their Server equivalents.
|
||||
goto dk_done
|
||||
)
|
||||
|
||||
@ -193,7 +193,7 @@ goto dk_done
|
||||
|
||||
::pstst $ExecutionContext.SessionState.LanguageMode :pstst
|
||||
|
||||
for /f "delims=" %%a in ('cmd /c "%psc% ""if ($PSVersionTable.PSEdition -ne 'Core') {$f=[io.file]::ReadAllText('!_batp!') -split ':pstst';iex ($f[1])}""" %nul6%') do (set tstresult=%%a)
|
||||
for /f "delims=" %%a in ('%psc% "if ($PSVersionTable.PSEdition -ne 'Core') {$f=[io.file]::ReadAllText('!_batp!') -split ':pstst';iex ($f[1])}" %nul6%') do (set tstresult=%%a)
|
||||
|
||||
if /i not "%tstresult%"=="FullLanguage" (
|
||||
%eline%
|
||||
@ -354,6 +354,9 @@ if not exist %SysPath%\%%# (
|
||||
%eline%
|
||||
echo [%SysPath%\%%#] file is missing, aborting...
|
||||
echo:
|
||||
call :dk_color %Blue% "Go back to Main Menu, select Troubleshoot and run DISM Restore and SFC Scan options."
|
||||
call :dk_color %Blue% "After that, restart system and try activation again."
|
||||
echo:
|
||||
set fixes=%fixes% %mas%troubleshoot
|
||||
call :dk_color2 %Blue% "Check this webpage for help - " %_Yellow% " %mas%troubleshoot"
|
||||
goto dk_done
|
||||
@ -824,10 +827,16 @@ exit /b
|
||||
|
||||
:dk_setvar
|
||||
|
||||
set psc=powershell.exe -nop -c
|
||||
set ps=%SysPath%\WindowsPowerShell\v1.0\powershell.exe
|
||||
set psc=%ps% -nop -c
|
||||
set winbuild=1
|
||||
for /f "tokens=6 delims=[]. " %%G in ('ver') do set winbuild=%%G
|
||||
|
||||
set _slexe=sppsvc.exe& set _slser=sppsvc
|
||||
if %winbuild% LEQ 6300 (set _slexe=SLsvc.exe& set _slser=SLsvc)
|
||||
if %winbuild% LSS 7600 if exist "%SysPath%\SLsvc.exe" (set _slexe=SLsvc.exe& set _slser=SLsvc)
|
||||
if %_slexe%==SLsvc.exe set _vis=1
|
||||
|
||||
set _NCS=1
|
||||
if %winbuild% LSS 10586 set _NCS=0
|
||||
if %winbuild% GEQ 10586 reg query "HKCU\Console" /v ForceV2 %nul2% | find /i "0x0" %nul1% && (set _NCS=0)
|
||||
@ -901,6 +910,7 @@ exit /b
|
||||
|
||||
:dk_ckeckwmic
|
||||
|
||||
if %winbuild% LSS 9200 (set _wmic=1&exit /b)
|
||||
set _wmic=0
|
||||
for %%# in (wmic.exe) do @if not "%%~$PATH:#"=="" (
|
||||
cmd /c "wmic path Win32_ComputerSystem get CreationClassName /value" %nul2% | find /i "computersystem" %nul1% && set _wmic=1
|
||||
@ -911,16 +921,16 @@ exit /b
|
||||
|
||||
:dk_sppissue
|
||||
|
||||
sc start sppsvc %nul%
|
||||
sc start %_slser% %nul%
|
||||
set spperror=%errorlevel%
|
||||
|
||||
if %spperror% NEQ 1056 if %spperror% NEQ 0 (
|
||||
%eline%
|
||||
echo sc start sppsvc [Error Code: %spperror%]
|
||||
echo sc start %_slser% [Error Code: %spperror%]
|
||||
)
|
||||
|
||||
echo:
|
||||
%psc% "$job = Start-Job { (Get-WmiObject -Query 'SELECT * FROM %sps%').Version }; if (-not (Wait-Job $job -Timeout 30)) {write-host 'sppsvc is not working correctly. Check this webpage for help - %mas%troubleshoot'}"
|
||||
%psc% "$job = Start-Job { (Get-WmiObject -Query 'SELECT * FROM %sps%').Version }; if (-not (Wait-Job $job -Timeout 30)) {write-host '%_slser% is not working correctly. Check this webpage for help - %mas%troubleshoot'}"
|
||||
exit /b
|
||||
|
||||
:: Common lines used in PowerShell reflection code
|
||||
@ -1018,8 +1028,10 @@ exit /b
|
||||
|
||||
if %_NCS% EQU 1 (
|
||||
echo %esc%[%~1%~2%esc%[0m
|
||||
) else (
|
||||
) else if exist %ps% (
|
||||
%psc% write-host -back '%1' -fore '%2' '%3'
|
||||
) else if not exist %ps% (
|
||||
echo %~3
|
||||
)
|
||||
exit /b
|
||||
|
||||
@ -1027,8 +1039,10 @@ exit /b
|
||||
|
||||
if %_NCS% EQU 1 (
|
||||
echo %esc%[%~1%~2%esc%[%~3%~4%esc%[0m
|
||||
) else (
|
||||
) else if exist %ps% (
|
||||
%psc% write-host -back '%1' -fore '%2' '%3' -NoNewline; write-host -back '%4' -fore '%5' '%6'
|
||||
) else if not exist %ps% (
|
||||
echo %~3 %~6
|
||||
)
|
||||
exit /b
|
||||
|
||||
@ -1043,6 +1057,7 @@ if defined fixes (
|
||||
call :dk_color %White% "Follow ALL the ABOVE blue lines. "
|
||||
call :dk_color2 %Blue% "Press [1] to Open Support Webpage " %Gray% " Press [0] to Ignore"
|
||||
choice /C:10 /N
|
||||
if !errorlevel!==2 exit /b
|
||||
if !errorlevel!==1 (for %%# in (%fixes%) do (start %%#))
|
||||
)
|
||||
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -1,4 +1,4 @@
|
||||
@set masver=3.0
|
||||
@set masver=3.2
|
||||
@echo off
|
||||
|
||||
|
||||
@ -129,13 +129,30 @@ echo:
|
||||
setlocal EnableDelayedExpansion
|
||||
set fixes=%fixes% %mas%troubleshoot
|
||||
call :dk_color2 %Blue% "Check this webpage for help - " %_Yellow% " %mas%troubleshoot"
|
||||
goto dk_done
|
||||
goto done2
|
||||
)
|
||||
|
||||
if %winbuild% LSS 7600 (
|
||||
if %winbuild% LSS 6001 (
|
||||
%nceline%
|
||||
echo Unsupported OS version detected [%winbuild%].
|
||||
echo Project is supported only for Windows 7/8/8.1/10/11 and their Server equivalents.
|
||||
echo MAS only supports Windows Vista/7/8/8.1/10/11 and their Server equivalents.
|
||||
if %winbuild% EQU 6000 (
|
||||
echo:
|
||||
echo Windows Vista RTM is not supported because Powershell cannot be installed.
|
||||
echo Upgrade to Windows Vista SP1 or SP2.
|
||||
)
|
||||
goto done2
|
||||
)
|
||||
|
||||
if %winbuild% LSS 7600 if not exist "%SysPath%\WindowsPowerShell\v1.0\Modules" (
|
||||
%nceline%
|
||||
if not exist %ps% (
|
||||
echo PowerShell is not installed in your system.
|
||||
)
|
||||
echo Install PowerShell 2.0 using the following URL.
|
||||
echo:
|
||||
echo https://www.catalog.update.microsoft.com/Search.aspx?q=KB968930
|
||||
if %_unattended%==0 start https://www.catalog.update.microsoft.com/Search.aspx?q=KB968930
|
||||
goto done2
|
||||
)
|
||||
|
||||
@ -187,7 +204,7 @@ goto done2
|
||||
|
||||
::pstst $ExecutionContext.SessionState.LanguageMode :pstst
|
||||
|
||||
for /f "delims=" %%a in ('cmd /c "%psc% ""if ($PSVersionTable.PSEdition -ne 'Core') {$f=[io.file]::ReadAllText('!_batp!') -split ':pstst';iex ($f[1])}""" %nul6%') do (set tstresult=%%a)
|
||||
for /f "delims=" %%a in ('%psc% "if ($PSVersionTable.PSEdition -ne 'Core') {$f=[io.file]::ReadAllText('!_batp!') -split ':pstst';iex ($f[1])}" %nul6%') do (set tstresult=%%a)
|
||||
|
||||
if /i not "%tstresult%"=="FullLanguage" (
|
||||
%eline%
|
||||
@ -714,6 +731,7 @@ if defined fixes (
|
||||
call :dk_color %White% "Follow ALL the ABOVE blue lines. "
|
||||
call :dk_color2 %Blue% "Press [1] to Open Support Webpage " %Gray% " Press [0] to Ignore"
|
||||
choice /C:10 /N
|
||||
if !errorlevel!==2 exit /b
|
||||
if !errorlevel!==1 (for %%# in (%fixes%) do (start %%#))
|
||||
)
|
||||
|
||||
@ -732,10 +750,16 @@ exit /b
|
||||
|
||||
:dk_setvar
|
||||
|
||||
set psc=powershell.exe -nop -c
|
||||
set ps=%SysPath%\WindowsPowerShell\v1.0\powershell.exe
|
||||
set psc=%ps% -nop -c
|
||||
set winbuild=1
|
||||
for /f "tokens=6 delims=[]. " %%G in ('ver') do set winbuild=%%G
|
||||
|
||||
set _slexe=sppsvc.exe& set _slser=sppsvc
|
||||
if %winbuild% LEQ 6300 (set _slexe=SLsvc.exe& set _slser=SLsvc)
|
||||
if %winbuild% LSS 7600 if exist "%SysPath%\SLsvc.exe" (set _slexe=SLsvc.exe& set _slser=SLsvc)
|
||||
if %_slexe%==SLsvc.exe set _vis=1
|
||||
|
||||
set _NCS=1
|
||||
if %winbuild% LSS 10586 set _NCS=0
|
||||
if %winbuild% GEQ 10586 reg query "HKCU\Console" /v ForceV2 %nul2% | find /i "0x0" %nul1% && (set _NCS=0)
|
||||
@ -791,8 +815,10 @@ exit /b
|
||||
|
||||
if %_NCS% EQU 1 (
|
||||
echo %esc%[%~1%~2%esc%[0m
|
||||
) else (
|
||||
) else if exist %ps% (
|
||||
%psc% write-host -back '%1' -fore '%2' '%3'
|
||||
) else if not exist %ps% (
|
||||
echo %~3
|
||||
)
|
||||
exit /b
|
||||
|
||||
@ -800,8 +826,10 @@ exit /b
|
||||
|
||||
if %_NCS% EQU 1 (
|
||||
echo %esc%[%~1%~2%esc%[%~3%~4%esc%[0m
|
||||
) else (
|
||||
) else if exist %ps% (
|
||||
%psc% write-host -back '%1' -fore '%2' '%3' -NoNewline; write-host -back '%4' -fore '%5' '%6'
|
||||
) else if not exist %ps% (
|
||||
echo %~3 %~6
|
||||
)
|
||||
exit /b
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
@set masver=3.0
|
||||
@set masver=3.2
|
||||
@echo off
|
||||
|
||||
|
||||
@ -133,10 +133,27 @@ call :dk_color2 %Blue% "Check this webpage for help - " %_Yellow% " %mas%trouble
|
||||
goto dk_done
|
||||
)
|
||||
|
||||
if %winbuild% LSS 7600 (
|
||||
if %winbuild% LSS 6001 (
|
||||
%nceline%
|
||||
echo Unsupported OS version detected [%winbuild%].
|
||||
echo Project is supported only for Windows 7/8/8.1/10/11 and their Server equivalents.
|
||||
echo MAS only supports Windows Vista/7/8/8.1/10/11 and their Server equivalents.
|
||||
if %winbuild% EQU 6000 (
|
||||
echo:
|
||||
echo Windows Vista RTM is not supported because Powershell cannot be installed.
|
||||
echo Upgrade to Windows Vista SP1 or SP2.
|
||||
)
|
||||
goto dk_done
|
||||
)
|
||||
|
||||
if %winbuild% LSS 7600 if not exist "%SysPath%\WindowsPowerShell\v1.0\Modules" (
|
||||
%nceline%
|
||||
if not exist %ps% (
|
||||
echo PowerShell is not installed in your system.
|
||||
)
|
||||
echo Install PowerShell 2.0 using the following URL.
|
||||
echo:
|
||||
echo https://www.catalog.update.microsoft.com/Search.aspx?q=KB968930
|
||||
if %_unattended%==0 start https://www.catalog.update.microsoft.com/Search.aspx?q=KB968930
|
||||
goto dk_done
|
||||
)
|
||||
|
||||
@ -188,7 +205,7 @@ goto dk_done
|
||||
|
||||
::pstst $ExecutionContext.SessionState.LanguageMode :pstst
|
||||
|
||||
for /f "delims=" %%a in ('cmd /c "%psc% ""if ($PSVersionTable.PSEdition -ne 'Core') {$f=[io.file]::ReadAllText('!_batp!') -split ':pstst';iex ($f[1])}""" %nul6%') do (set tstresult=%%a)
|
||||
for /f "delims=" %%a in ('%psc% "if ($PSVersionTable.PSEdition -ne 'Core') {$f=[io.file]::ReadAllText('!_batp!') -split ':pstst';iex ($f[1])}" %nul6%') do (set tstresult=%%a)
|
||||
|
||||
if /i not "%tstresult%"=="FullLanguage" (
|
||||
%eline%
|
||||
@ -515,6 +532,13 @@ mode 125, 32
|
||||
)
|
||||
title Fix Licensing ^(ClipSVC ^+ SPP ^+ OSPP^)
|
||||
|
||||
if %winbuild% EQU 6001 (
|
||||
%eline%
|
||||
echo This option is not supported on Windows Vista SP1.
|
||||
echo Upgrade to Windows Vista SP2.
|
||||
goto :at_back
|
||||
)
|
||||
|
||||
echo:
|
||||
echo %line%
|
||||
echo:
|
||||
@ -531,7 +555,7 @@ echo - Clear ClipSVC, SPP and OSPP licenses.
|
||||
echo - Fix permissions of SPP tokens folder and registries.
|
||||
echo - Trigger the repair option for Office.
|
||||
echo:
|
||||
call :dk_color2 %_White% " - " %Red% "Apply this option only when it is necessary."
|
||||
call :dk_color2 %_White% " - " %Blue% "Apply this option only when it is necessary."
|
||||
echo:
|
||||
echo %line%
|
||||
echo:
|
||||
@ -695,19 +719,19 @@ echo [No Error Found]
|
||||
)
|
||||
|
||||
echo:
|
||||
echo Stopping sppsvc service...
|
||||
%psc% Stop-Service sppsvc -force %nul%
|
||||
echo Stopping %_slser% service...
|
||||
%psc% Stop-Service %_slser% -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))
|
||||
for %%# in (SppEx%w%tComObj.exe %_slexe%) 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%)
|
||||
for %%# in (SppE%w%xtComObj.exe %_slexe%) do (reg delete "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Ima%w%ge File Execu%w%tion Options\%%#" /f %nul%)
|
||||
)
|
||||
|
||||
if %winbuild% LSS 9200 (
|
||||
if %winbuild% LSS 9200 if not defined _vis (
|
||||
REM Fix issues caused by Update KB971033 in Windows 7
|
||||
REM https://support.microsoft.com/help/4487266
|
||||
echo:
|
||||
@ -726,6 +750,7 @@ del /f /q %SysPath%\7B296FB0-376B-497e-B012-9C450E1B7327-*.C7483456-A289-439d-81
|
||||
|
||||
:: Delete registry keys that are not deleted by activation scripts
|
||||
|
||||
if not defined _vis (
|
||||
echo:
|
||||
echo Cleaning some licensing-related registry keys...
|
||||
%nul% reg delete "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\SoftwareProtectionPlatform" /v "ServiceSessionId" /f
|
||||
@ -733,6 +758,7 @@ echo Cleaning some licensing-related registry keys...
|
||||
%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:
|
||||
call :scandat delete
|
||||
@ -744,9 +770,13 @@ call :dk_color %Red% "Failed to delete .dat files."
|
||||
echo:
|
||||
)
|
||||
|
||||
if defined _vis (
|
||||
%psc% Start-Service %_slser% %nul%
|
||||
)
|
||||
|
||||
echo:
|
||||
echo Reinstalling system licenses...
|
||||
%psc% "Stop-Service sppsvc -force; $sls = Get-WmiObject SoftwareLicensingService; $f=[io.file]::ReadAllText('!_batp!') -split ':xrm\:.*';iex ($f[1]); ReinstallLicenses" %nul%
|
||||
%psc% "$sls = Get-WmiObject SoftwareLicensingService; $f=[io.file]::ReadAllText('!_batp!') -split ':xrm\:.*';iex ($f[1]); ReinstallLicenses" %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 (
|
||||
echo [Successful]
|
||||
@ -763,7 +793,7 @@ call :dk_color %Red% "Failed to rebuild tokens.dat file."
|
||||
echo tokens.dat file was rebuilt successfully.
|
||||
)
|
||||
|
||||
if %winbuild% LSS 9200 (
|
||||
if %winbuild% LSS 9200 if not defined _vis (
|
||||
sc config sppuinotify start= demand
|
||||
)
|
||||
|
||||
@ -844,12 +874,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 %_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" & 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" & 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" & 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" & 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" & 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" & call :getrepairsetup msi16repair68 16)
|
||||
for /f "skip=2 tokens=2*" %%a in ('"reg query %_86%\14.0\Common\InstallRoot /v Path" %nul6%') do if exist "%%b\*Picker.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\*Picker.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\*Picker.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\*Picker.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\*Picker.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\*Picker.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" & call :getc2rrepair c2r15repair86 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" & call :getc2rrepair c2r15repair68 integratedoffice.exe)
|
||||
@ -1329,13 +1359,13 @@ function InstallLicenseArr($Str) {
|
||||
ForEach ($x in $a) {InstallLicenseFile "$x"}
|
||||
}
|
||||
function InstallLicenseDir($Loc) {
|
||||
dir $Loc *.xrm-ms -af -s | select -expand FullName | % {InstallLicenseFile "$_"}
|
||||
Get-ChildItem $Loc -Recurse -Filter *.xrm-ms | ForEach-Object {InstallLicenseFile $_.FullName}
|
||||
}
|
||||
function ReinstallLicenses() {
|
||||
$Oem = "$env:SysPath\oem"
|
||||
$Spp = "$env:SysPath\spp\tokens"
|
||||
InstallLicenseDir "$Spp"
|
||||
If (Test-Path $Oem) {InstallLicenseDir "$Oem"}
|
||||
$Paths = @("$env:SysPath\oem", "$env:SysPath\licensing", "$env:SysPath\spp\tokens")
|
||||
foreach ($Path in $Paths) {
|
||||
if (Test-Path $Path) { InstallLicenseDir "$Path" }
|
||||
}
|
||||
}
|
||||
:xrm:
|
||||
|
||||
@ -1349,6 +1379,7 @@ for %%# in (
|
||||
%SysPath%\spp\store\
|
||||
%SysPath%\spp\store\2.0\
|
||||
%Systemdrive%\Windows\ServiceProfiles\NetworkService\AppData\Roaming\Microsoft\SoftwareProtectionPlatform\
|
||||
%Systemdrive%\Windows\ServiceProfiles\NetworkService\AppData\Roaming\Microsoft\SoftwareLicensing\
|
||||
) do (
|
||||
|
||||
if %1==check (
|
||||
@ -1424,13 +1455,40 @@ $key.SetAccessControl($acl)
|
||||
|
||||
::========================================================================================================================================
|
||||
|
||||
:dk_color
|
||||
|
||||
if %_NCS% EQU 1 (
|
||||
echo %esc%[%~1%~2%esc%[0m
|
||||
) else if exist %ps% (
|
||||
%psc% write-host -back '%1' -fore '%2' '%3'
|
||||
) else if not exist %ps% (
|
||||
echo %~3
|
||||
)
|
||||
exit /b
|
||||
|
||||
:dk_color2
|
||||
|
||||
if %_NCS% EQU 1 (
|
||||
echo %esc%[%~1%~2%esc%[%~3%~4%esc%[0m
|
||||
) else if exist %ps% (
|
||||
%psc% write-host -back '%1' -fore '%2' '%3' -NoNewline; write-host -back '%4' -fore '%5' '%6'
|
||||
) else if not exist %ps% (
|
||||
echo %~3 %~6
|
||||
)
|
||||
exit /b
|
||||
|
||||
::========================================================================================================================================
|
||||
|
||||
:dk_done
|
||||
|
||||
echo:
|
||||
if %_unattended%==1 timeout /t 2 & exit /b
|
||||
|
||||
if defined fixes (
|
||||
call :dk_color %White% "Follow ALL the ABOVE blue lines. "
|
||||
call :dk_color2 %Blue% "Press [1] to Open Support Webpage " %Gray% " Press [0] to Ignore"
|
||||
choice /C:10 /N
|
||||
if !errorlevel!==2 exit /b
|
||||
if !errorlevel!==1 (for %%# in (%fixes%) do (start %%#))
|
||||
)
|
||||
|
||||
@ -1441,26 +1499,7 @@ choice /c 0 /n
|
||||
call :dk_color %_Yellow% "Press any key to %_exitmsg%..."
|
||||
pause %nul1%
|
||||
)
|
||||
exit /b
|
||||
|
||||
::========================================================================================================================================
|
||||
|
||||
:dk_color
|
||||
|
||||
if %_NCS% EQU 1 (
|
||||
echo %esc%[%~1%~2%esc%[0m
|
||||
) else (
|
||||
%psc% write-host -back '%1' -fore '%2' '%3'
|
||||
)
|
||||
exit /b
|
||||
|
||||
:dk_color2
|
||||
|
||||
if %_NCS% EQU 1 (
|
||||
echo %esc%[%~1%~2%esc%[%~3%~4%esc%[0m
|
||||
) else (
|
||||
%psc% write-host -back '%1' -fore '%2' '%3' -NoNewline; write-host -back '%4' -fore '%5' '%6'
|
||||
)
|
||||
exit /b
|
||||
|
||||
::========================================================================================================================================
|
||||
@ -1469,10 +1508,16 @@ exit /b
|
||||
|
||||
:dk_setvar
|
||||
|
||||
set psc=powershell.exe -nop -c
|
||||
set ps=%SysPath%\WindowsPowerShell\v1.0\powershell.exe
|
||||
set psc=%ps% -nop -c
|
||||
set winbuild=1
|
||||
for /f "tokens=6 delims=[]. " %%G in ('ver') do set winbuild=%%G
|
||||
|
||||
set _slexe=sppsvc.exe& set _slser=sppsvc
|
||||
if %winbuild% LEQ 6300 (set _slexe=SLsvc.exe& set _slser=SLsvc)
|
||||
if %winbuild% LSS 7600 if exist "%SysPath%\SLsvc.exe" (set _slexe=SLsvc.exe& set _slser=SLsvc)
|
||||
if %_slexe%==SLsvc.exe set _vis=1
|
||||
|
||||
set _NCS=1
|
||||
if %winbuild% LSS 10586 set _NCS=0
|
||||
if %winbuild% GEQ 10586 reg query "HKCU\Console" /v ForceV2 %nul2% | find /i "0x0" %nul1% && (set _NCS=0)
|
||||
|
45
README.md
45
README.md
@ -6,43 +6,54 @@
|
||||
|
||||
<hr>
|
||||
|
||||
## Download / How to use it?
|
||||
## How to Activate Windows / Office?
|
||||
|
||||
### Method 1 - PowerShell (Windows 8 and later) ❤️
|
||||
|
||||
1. Open PowerShell (Not CMD). To do that, right-click on the Windows start menu and select PowerShell or Terminal.
|
||||
2. Copy and paste the code below and press enter
|
||||
1. **Open PowerShell**
|
||||
To do that, press the Windows key + X, then select PowerShell or Terminal.
|
||||
|
||||
2. **Copy and paste the code below, then press enter.**
|
||||
```
|
||||
irm https://get.activated.win | iex
|
||||
```
|
||||
Alternatively, you can use the following (It will be deprecated in the future.)
|
||||
Alternatively, you can use the following (this will be deprecated in the future):
|
||||
```
|
||||
irm https://massgrave.dev/get | iex
|
||||
```
|
||||
3. You will see the activation options. Choose (1) HWID for Windows activation. Choose (2) Ohook for Office activation.
|
||||
4. That's all.
|
||||
|
||||
3. You will see the activation options.
|
||||
Press 1 HWID for Windows activation.
|
||||
Press 2 Ohook for Office activation.
|
||||
|
||||
4. That's all
|
||||
|
||||
---
|
||||
|
||||
### Method 2 - Traditional (Windows 7 and later)
|
||||
### Method 2 - Traditional (Windows Vista and later)
|
||||
|
||||
<details>
|
||||
<summary>Click here for info</summary>
|
||||
|
||||
1. Download the file using the links provided below.
|
||||
<summary>Click here to view</summary>
|
||||
|
||||
1. Download the file using one of the links below:
|
||||
`https://github.com/massgravel/Microsoft-Activation-Scripts/archive/refs/heads/master.zip`
|
||||
or
|
||||
`https://git.activated.win/massgrave/Microsoft-Activation-Scripts/archive/master.zip`
|
||||
2. Right-click on the downloaded zip file and extract
|
||||
3. In the extracted folder, find the folder named `All-In-One-Version`
|
||||
4. Run the file named `MAS_AIO.cmd`
|
||||
5. You will see the activation options, follow the on-screen instructions.
|
||||
2. Right-click on the downloaded zip file and extract it.
|
||||
3. In the extracted folder, find the folder named `All-In-One-Version`.
|
||||
4. Run the file named `MAS_AIO.cmd`.
|
||||
5. You will see the activation options. Follow the on-screen instructions.
|
||||
6. That's all.
|
||||
|
||||
</details>
|
||||
|
||||
---
|
||||
|
||||
- **[Office for macOS](https://massgrave.dev/office_for_mac)**
|
||||
- To run the scripts in unattended mode, check [here](https://massgrave.dev/command_line_switches).
|
||||
|
||||
---
|
||||
|
||||
### Not working ❓
|
||||
|
||||
- If you are **unable to launch MAS** using the PowerShell method, please refer to **Method 2** listed above.
|
||||
@ -59,11 +70,9 @@ or
|
||||
|
||||
---
|
||||
|
||||
To run the scripts in unattended mode, check [here](https://massgrave.dev/command_line_switches).
|
||||
|
||||
```
|
||||
Latest Version: 3.0
|
||||
Release date: 14-Feb-2025
|
||||
Latest Version: 3.2
|
||||
Release date: 6-May-2025
|
||||
```
|
||||
|
||||
### [Troubleshooting / Help](https://massgrave.dev/troubleshoot)
|
||||
|
Reference in New Issue
Block a user