mirror of
https://github.com/massgravel/Microsoft-Activation-Scripts.git
synced 2025-08-28 19:33:15 +08:00
Compare commits
No commits in common. "3a99ea4eeb657b2bc1b04b1326722d4d490d8b0b" and "e2c52b4ac812dc2adf17b3a037e4127562be3712" have entirely different histories.
3a99ea4eeb
...
e2c52b4ac8
@ -1178,7 +1178,7 @@ goto :dk_done
|
|||||||
set ps=%SysPath%\WindowsPowerShell\v1.0\powershell.exe
|
set ps=%SysPath%\WindowsPowerShell\v1.0\powershell.exe
|
||||||
set psc=%ps% -nop -c
|
set psc=%ps% -nop -c
|
||||||
set winbuild=1
|
set winbuild=1
|
||||||
for /f "tokens=2 delims=[]" %%G in ('ver') do for /f "tokens=2,3,4 delims=. " %%H in ("%%~G") do set "winbuild=%%J"
|
for /f "tokens=6 delims=[]. " %%G in ('ver') do set winbuild=%%G
|
||||||
|
|
||||||
set _slexe=sppsvc.exe& set _slser=sppsvc
|
set _slexe=sppsvc.exe& set _slser=sppsvc
|
||||||
if %winbuild% LEQ 6300 (set _slexe=SLsvc.exe& set _slser=SLsvc)
|
if %winbuild% LEQ 6300 (set _slexe=SLsvc.exe& set _slser=SLsvc)
|
||||||
@ -2003,7 +2003,6 @@ call :dk_actid 55c92734-d682-4d71-983e-d6ec3f16059f
|
|||||||
|
|
||||||
if not defined apps (
|
if not defined apps (
|
||||||
%psc% "if (-not $env:_vis) {Start-Job { Stop-Service %_slser% -force } | Wait-Job -Timeout 20 | Out-Null}; $sls = Get-WmiObject SoftwareLicensingService; $f=[System.IO.File]::ReadAllText('!_batp!') -split ':xrm\:.*';. ([scriptblock]::Create($f[1])); ReinstallLicenses" %nul%
|
%psc% "if (-not $env:_vis) {Start-Job { Stop-Service %_slser% -force } | Wait-Job -Timeout 20 | Out-Null}; $sls = Get-WmiObject SoftwareLicensingService; $f=[System.IO.File]::ReadAllText('!_batp!') -split ':xrm\:.*';. ([scriptblock]::Create($f[1])); ReinstallLicenses" %nul%
|
||||||
if not defined _vis if !errorlevel! NEQ 0 set rlicfailed=1
|
|
||||||
call :dk_actid 55c92734-d682-4d71-983e-d6ec3f16059f
|
call :dk_actid 55c92734-d682-4d71-983e-d6ec3f16059f
|
||||||
)
|
)
|
||||||
|
|
||||||
@ -2025,13 +2024,6 @@ set error=1
|
|||||||
set showfix=1
|
set showfix=1
|
||||||
)
|
)
|
||||||
|
|
||||||
if not defined showfix if defined rlicfailed (
|
|
||||||
echo:
|
|
||||||
call :dk_color %Blue% "%_fixmsg%"
|
|
||||||
call :dk_color %Blue% "If activation still fails then run Fix WPA Registry option."
|
|
||||||
echo:
|
|
||||||
)
|
|
||||||
|
|
||||||
if %winbuild% GEQ 7600 if exist "%tokenstore%\" if not exist "%tokenstore%\tokens.dat" (
|
if %winbuild% GEQ 7600 if exist "%tokenstore%\" if not exist "%tokenstore%\tokens.dat" (
|
||||||
call :dk_color %Red% "Checking SPP tokens.dat [Not Found] [%tokenstore%\]"
|
call :dk_color %Red% "Checking SPP tokens.dat [Not Found] [%tokenstore%\]"
|
||||||
)
|
)
|
||||||
@ -2804,7 +2796,7 @@ if defined ohub call :dk_color %Gray% "Office apps such as Word, Excel are activ
|
|||||||
echo Help: %mas%troubleshoot
|
echo Help: %mas%troubleshoot
|
||||||
) else (
|
) else (
|
||||||
call :dk_color %Red% "Some errors were detected."
|
call :dk_color %Red% "Some errors were detected."
|
||||||
if not defined ierror if not defined showfix call :dk_color %Blue% "%_fixmsg%"
|
if not defined ierror if not defined showfix if not defined serv_cor if not defined serv_cste call :dk_color %Blue% "%_fixmsg%"
|
||||||
echo:
|
echo:
|
||||||
set fixes=%fixes% %mas%troubleshoot
|
set fixes=%fixes% %mas%troubleshoot
|
||||||
call :dk_color2 %Blue% "Check this webpage for help - " %_Yellow% " %mas%troubleshoot"
|
call :dk_color2 %Blue% "Check this webpage for help - " %_Yellow% " %mas%troubleshoot"
|
||||||
@ -3509,12 +3501,10 @@ call :dk_color %Gray% "Checking Total User Accounts [%counter%]"
|
|||||||
|
|
||||||
:: Clear the vNext/shared/device license blocks which may prevent ohook activation
|
:: Clear the vNext/shared/device license blocks which may prevent ohook activation
|
||||||
|
|
||||||
set vnextexist=
|
|
||||||
rmdir /s /q "%ProgramData%\Microsoft\Office\Licenses\" %nul%
|
rmdir /s /q "%ProgramData%\Microsoft\Office\Licenses\" %nul%
|
||||||
|
|
||||||
for %%x in (15 16) do (
|
for %%x in (15 16) do (
|
||||||
for %%# in (%_sidlist%) do (
|
for %%# in (%_sidlist%) do (
|
||||||
reg query HKU\%%#\Software\Microsoft\Office\%%x.0\Common\Licensing /s %nul2% | findstr /i "CIDToLicenseIdsMapping LicenseIdToEmailMapping @" %nul% && set vnextexist=1
|
|
||||||
reg delete HKU\%%#\Software\Microsoft\Office\%%x.0\Common\Licensing /f %nul%
|
reg delete HKU\%%#\Software\Microsoft\Office\%%x.0\Common\Licensing /f %nul%
|
||||||
|
|
||||||
for /f "skip=2 tokens=2*" %%a in ('"reg query "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\ProfileList\%%#" /v ProfileImagePath" %nul6%') do (
|
for /f "skip=2 tokens=2*" %%a in ('"reg query "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\ProfileList\%%#" /v ProfileImagePath" %nul6%') do (
|
||||||
@ -3537,7 +3527,6 @@ rmdir /s /q "%%b\AppData\Local\Packages\Microsoft.Office.Desktop_8wekyb3d8bbwe\L
|
|||||||
if exist "%%b\AppData\Local\Packages\Microsoft.Office.Desktop_8wekyb3d8bbwe\SystemAppData\Helium\User.dat" (
|
if exist "%%b\AppData\Local\Packages\Microsoft.Office.Desktop_8wekyb3d8bbwe\SystemAppData\Helium\User.dat" (
|
||||||
set defname=DEFTEMP-%%#
|
set defname=DEFTEMP-%%#
|
||||||
reg load HKU\!defname! "%%b\AppData\Local\Packages\Microsoft.Office.Desktop_8wekyb3d8bbwe\SystemAppData\Helium\User.dat" %nul%
|
reg load HKU\!defname! "%%b\AppData\Local\Packages\Microsoft.Office.Desktop_8wekyb3d8bbwe\SystemAppData\Helium\User.dat" %nul%
|
||||||
reg query HKU\!defname!\Software\Microsoft\Office\16.0\Common\Licensing /s %nul2% | findstr /i "CIDToLicenseIdsMapping LicenseIdToEmailMapping @" %nul% && set vnextexist=1
|
|
||||||
reg delete HKU\!defname!\Software\Microsoft\Office\16.0\Common\Licensing /f %nul%
|
reg delete HKU\!defname!\Software\Microsoft\Office\16.0\Common\Licensing /f %nul%
|
||||||
reg unload HKU\!defname! %nul%
|
reg unload HKU\!defname! %nul%
|
||||||
)
|
)
|
||||||
@ -3545,15 +3534,6 @@ reg unload HKU\!defname! %nul%
|
|||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
|
||||||
if defined vnextexist (
|
|
||||||
echo:
|
|
||||||
call :dk_color %Gray% "Office vNext subscription detected:"
|
|
||||||
call :dk_color %Blue% "If active, this license overrides other activation methods."
|
|
||||||
call :dk_color %Blue% "If expiring soon, rerun the script after expiration."
|
|
||||||
call :dk_color2 %Blue% "If expired and script activation fails, get help - " %_Yellow% " %mas%troubleshoot"
|
|
||||||
echo:
|
|
||||||
)
|
|
||||||
|
|
||||||
:: Clear SharedComputerLicensing for office
|
:: Clear SharedComputerLicensing for office
|
||||||
:: https://learn.microsoft.com/en-us/deployoffice/overview-shared-computer-activation
|
:: https://learn.microsoft.com/en-us/deployoffice/overview-shared-computer-activation
|
||||||
|
|
||||||
@ -13754,7 +13734,7 @@ set "PSModulePath=%ProgramFiles%\WindowsPowerShell\Modules;%SysPath%\WindowsPowe
|
|||||||
set _tserror=
|
set _tserror=
|
||||||
set winbuild=1
|
set winbuild=1
|
||||||
set "nul=>nul 2>&1"
|
set "nul=>nul 2>&1"
|
||||||
for /f "tokens=2 delims=[]" %%G in ('ver') do for /f "tokens=2,3,4 delims=. " %%H in ("%%~G") do set "winbuild=%%J"
|
for /f "tokens=6 delims=[]. " %%G in ('ver') do set winbuild=%%G
|
||||||
set psc=powershell.exe -nop -c
|
set psc=powershell.exe -nop -c
|
||||||
|
|
||||||
set _slexe=sppsvc.exe& set _slser=sppsvc
|
set _slexe=sppsvc.exe& set _slser=sppsvc
|
||||||
|
@ -878,7 +878,7 @@ goto :dk_done
|
|||||||
set ps=%SysPath%\WindowsPowerShell\v1.0\powershell.exe
|
set ps=%SysPath%\WindowsPowerShell\v1.0\powershell.exe
|
||||||
set psc=%ps% -nop -c
|
set psc=%ps% -nop -c
|
||||||
set winbuild=1
|
set winbuild=1
|
||||||
for /f "tokens=2 delims=[]" %%G in ('ver') do for /f "tokens=2,3,4 delims=. " %%H in ("%%~G") do set "winbuild=%%J"
|
for /f "tokens=6 delims=[]. " %%G in ('ver') do set winbuild=%%G
|
||||||
|
|
||||||
set _slexe=sppsvc.exe& set _slser=sppsvc
|
set _slexe=sppsvc.exe& set _slser=sppsvc
|
||||||
if %winbuild% LEQ 6300 (set _slexe=SLsvc.exe& set _slser=SLsvc)
|
if %winbuild% LEQ 6300 (set _slexe=SLsvc.exe& set _slser=SLsvc)
|
||||||
@ -1687,7 +1687,6 @@ call :dk_actid 55c92734-d682-4d71-983e-d6ec3f16059f
|
|||||||
|
|
||||||
if not defined apps (
|
if not defined apps (
|
||||||
%psc% "if (-not $env:_vis) {Start-Job { Stop-Service %_slser% -force } | Wait-Job -Timeout 20 | Out-Null}; $sls = Get-WmiObject SoftwareLicensingService; $f=[System.IO.File]::ReadAllText('!_batp!') -split ':xrm\:.*';. ([scriptblock]::Create($f[1])); ReinstallLicenses" %nul%
|
%psc% "if (-not $env:_vis) {Start-Job { Stop-Service %_slser% -force } | Wait-Job -Timeout 20 | Out-Null}; $sls = Get-WmiObject SoftwareLicensingService; $f=[System.IO.File]::ReadAllText('!_batp!') -split ':xrm\:.*';. ([scriptblock]::Create($f[1])); ReinstallLicenses" %nul%
|
||||||
if not defined _vis if !errorlevel! NEQ 0 set rlicfailed=1
|
|
||||||
call :dk_actid 55c92734-d682-4d71-983e-d6ec3f16059f
|
call :dk_actid 55c92734-d682-4d71-983e-d6ec3f16059f
|
||||||
)
|
)
|
||||||
|
|
||||||
@ -1709,13 +1708,6 @@ set error=1
|
|||||||
set showfix=1
|
set showfix=1
|
||||||
)
|
)
|
||||||
|
|
||||||
if not defined showfix if defined rlicfailed (
|
|
||||||
echo:
|
|
||||||
call :dk_color %Blue% "%_fixmsg%"
|
|
||||||
call :dk_color %Blue% "If activation still fails then run Fix WPA Registry option."
|
|
||||||
echo:
|
|
||||||
)
|
|
||||||
|
|
||||||
if %winbuild% GEQ 7600 if exist "%tokenstore%\" if not exist "%tokenstore%\tokens.dat" (
|
if %winbuild% GEQ 7600 if exist "%tokenstore%\" if not exist "%tokenstore%\tokens.dat" (
|
||||||
call :dk_color %Red% "Checking SPP tokens.dat [Not Found] [%tokenstore%\]"
|
call :dk_color %Red% "Checking SPP tokens.dat [Not Found] [%tokenstore%\]"
|
||||||
)
|
)
|
||||||
|
@ -920,7 +920,7 @@ goto :dk_done
|
|||||||
set ps=%SysPath%\WindowsPowerShell\v1.0\powershell.exe
|
set ps=%SysPath%\WindowsPowerShell\v1.0\powershell.exe
|
||||||
set psc=%ps% -nop -c
|
set psc=%ps% -nop -c
|
||||||
set winbuild=1
|
set winbuild=1
|
||||||
for /f "tokens=2 delims=[]" %%G in ('ver') do for /f "tokens=2,3,4 delims=. " %%H in ("%%~G") do set "winbuild=%%J"
|
for /f "tokens=6 delims=[]. " %%G in ('ver') do set winbuild=%%G
|
||||||
|
|
||||||
set _slexe=sppsvc.exe& set _slser=sppsvc
|
set _slexe=sppsvc.exe& set _slser=sppsvc
|
||||||
if %winbuild% LEQ 6300 (set _slexe=SLsvc.exe& set _slser=SLsvc)
|
if %winbuild% LEQ 6300 (set _slexe=SLsvc.exe& set _slser=SLsvc)
|
||||||
@ -1772,7 +1772,6 @@ call :dk_actid 55c92734-d682-4d71-983e-d6ec3f16059f
|
|||||||
|
|
||||||
if not defined apps (
|
if not defined apps (
|
||||||
%psc% "if (-not $env:_vis) {Start-Job { Stop-Service %_slser% -force } | Wait-Job -Timeout 20 | Out-Null}; $sls = Get-WmiObject SoftwareLicensingService; $f=[System.IO.File]::ReadAllText('!_batp!') -split ':xrm\:.*';. ([scriptblock]::Create($f[1])); ReinstallLicenses" %nul%
|
%psc% "if (-not $env:_vis) {Start-Job { Stop-Service %_slser% -force } | Wait-Job -Timeout 20 | Out-Null}; $sls = Get-WmiObject SoftwareLicensingService; $f=[System.IO.File]::ReadAllText('!_batp!') -split ':xrm\:.*';. ([scriptblock]::Create($f[1])); ReinstallLicenses" %nul%
|
||||||
if not defined _vis if !errorlevel! NEQ 0 set rlicfailed=1
|
|
||||||
call :dk_actid 55c92734-d682-4d71-983e-d6ec3f16059f
|
call :dk_actid 55c92734-d682-4d71-983e-d6ec3f16059f
|
||||||
)
|
)
|
||||||
|
|
||||||
@ -1794,13 +1793,6 @@ set error=1
|
|||||||
set showfix=1
|
set showfix=1
|
||||||
)
|
)
|
||||||
|
|
||||||
if not defined showfix if defined rlicfailed (
|
|
||||||
echo:
|
|
||||||
call :dk_color %Blue% "%_fixmsg%"
|
|
||||||
call :dk_color %Blue% "If activation still fails then run Fix WPA Registry option."
|
|
||||||
echo:
|
|
||||||
)
|
|
||||||
|
|
||||||
if %winbuild% GEQ 7600 if exist "%tokenstore%\" if not exist "%tokenstore%\tokens.dat" (
|
if %winbuild% GEQ 7600 if exist "%tokenstore%\" if not exist "%tokenstore%\tokens.dat" (
|
||||||
call :dk_color %Red% "Checking SPP tokens.dat [Not Found] [%tokenstore%\]"
|
call :dk_color %Red% "Checking SPP tokens.dat [Not Found] [%tokenstore%\]"
|
||||||
)
|
)
|
||||||
|
@ -769,7 +769,7 @@ if defined ohub call :dk_color %Gray% "Office apps such as Word, Excel are activ
|
|||||||
echo Help: %mas%troubleshoot
|
echo Help: %mas%troubleshoot
|
||||||
) else (
|
) else (
|
||||||
call :dk_color %Red% "Some errors were detected."
|
call :dk_color %Red% "Some errors were detected."
|
||||||
if not defined ierror if not defined showfix call :dk_color %Blue% "%_fixmsg%"
|
if not defined ierror if not defined showfix if not defined serv_cor if not defined serv_cste call :dk_color %Blue% "%_fixmsg%"
|
||||||
echo:
|
echo:
|
||||||
set fixes=%fixes% %mas%troubleshoot
|
set fixes=%fixes% %mas%troubleshoot
|
||||||
call :dk_color2 %Blue% "Check this webpage for help - " %_Yellow% " %mas%troubleshoot"
|
call :dk_color2 %Blue% "Check this webpage for help - " %_Yellow% " %mas%troubleshoot"
|
||||||
@ -1474,12 +1474,10 @@ call :dk_color %Gray% "Checking Total User Accounts [%counter%]"
|
|||||||
|
|
||||||
:: Clear the vNext/shared/device license blocks which may prevent ohook activation
|
:: Clear the vNext/shared/device license blocks which may prevent ohook activation
|
||||||
|
|
||||||
set vnextexist=
|
|
||||||
rmdir /s /q "%ProgramData%\Microsoft\Office\Licenses\" %nul%
|
rmdir /s /q "%ProgramData%\Microsoft\Office\Licenses\" %nul%
|
||||||
|
|
||||||
for %%x in (15 16) do (
|
for %%x in (15 16) do (
|
||||||
for %%# in (%_sidlist%) do (
|
for %%# in (%_sidlist%) do (
|
||||||
reg query HKU\%%#\Software\Microsoft\Office\%%x.0\Common\Licensing /s %nul2% | findstr /i "CIDToLicenseIdsMapping LicenseIdToEmailMapping @" %nul% && set vnextexist=1
|
|
||||||
reg delete HKU\%%#\Software\Microsoft\Office\%%x.0\Common\Licensing /f %nul%
|
reg delete HKU\%%#\Software\Microsoft\Office\%%x.0\Common\Licensing /f %nul%
|
||||||
|
|
||||||
for /f "skip=2 tokens=2*" %%a in ('"reg query "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\ProfileList\%%#" /v ProfileImagePath" %nul6%') do (
|
for /f "skip=2 tokens=2*" %%a in ('"reg query "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\ProfileList\%%#" /v ProfileImagePath" %nul6%') do (
|
||||||
@ -1502,7 +1500,6 @@ rmdir /s /q "%%b\AppData\Local\Packages\Microsoft.Office.Desktop_8wekyb3d8bbwe\L
|
|||||||
if exist "%%b\AppData\Local\Packages\Microsoft.Office.Desktop_8wekyb3d8bbwe\SystemAppData\Helium\User.dat" (
|
if exist "%%b\AppData\Local\Packages\Microsoft.Office.Desktop_8wekyb3d8bbwe\SystemAppData\Helium\User.dat" (
|
||||||
set defname=DEFTEMP-%%#
|
set defname=DEFTEMP-%%#
|
||||||
reg load HKU\!defname! "%%b\AppData\Local\Packages\Microsoft.Office.Desktop_8wekyb3d8bbwe\SystemAppData\Helium\User.dat" %nul%
|
reg load HKU\!defname! "%%b\AppData\Local\Packages\Microsoft.Office.Desktop_8wekyb3d8bbwe\SystemAppData\Helium\User.dat" %nul%
|
||||||
reg query HKU\!defname!\Software\Microsoft\Office\16.0\Common\Licensing /s %nul2% | findstr /i "CIDToLicenseIdsMapping LicenseIdToEmailMapping @" %nul% && set vnextexist=1
|
|
||||||
reg delete HKU\!defname!\Software\Microsoft\Office\16.0\Common\Licensing /f %nul%
|
reg delete HKU\!defname!\Software\Microsoft\Office\16.0\Common\Licensing /f %nul%
|
||||||
reg unload HKU\!defname! %nul%
|
reg unload HKU\!defname! %nul%
|
||||||
)
|
)
|
||||||
@ -1510,15 +1507,6 @@ reg unload HKU\!defname! %nul%
|
|||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
|
||||||
if defined vnextexist (
|
|
||||||
echo:
|
|
||||||
call :dk_color %Gray% "Office vNext subscription detected:"
|
|
||||||
call :dk_color %Blue% "If active, this license overrides other activation methods."
|
|
||||||
call :dk_color %Blue% "If expiring soon, rerun the script after expiration."
|
|
||||||
call :dk_color2 %Blue% "If expired and script activation fails, get help - " %_Yellow% " %mas%troubleshoot"
|
|
||||||
echo:
|
|
||||||
)
|
|
||||||
|
|
||||||
:: Clear SharedComputerLicensing for office
|
:: Clear SharedComputerLicensing for office
|
||||||
:: https://learn.microsoft.com/en-us/deployoffice/overview-shared-computer-activation
|
:: https://learn.microsoft.com/en-us/deployoffice/overview-shared-computer-activation
|
||||||
|
|
||||||
@ -1674,7 +1662,7 @@ exit /b
|
|||||||
set ps=%SysPath%\WindowsPowerShell\v1.0\powershell.exe
|
set ps=%SysPath%\WindowsPowerShell\v1.0\powershell.exe
|
||||||
set psc=%ps% -nop -c
|
set psc=%ps% -nop -c
|
||||||
set winbuild=1
|
set winbuild=1
|
||||||
for /f "tokens=2 delims=[]" %%G in ('ver') do for /f "tokens=2,3,4 delims=. " %%H in ("%%~G") do set "winbuild=%%J"
|
for /f "tokens=6 delims=[]. " %%G in ('ver') do set winbuild=%%G
|
||||||
|
|
||||||
set _slexe=sppsvc.exe& set _slser=sppsvc
|
set _slexe=sppsvc.exe& set _slser=sppsvc
|
||||||
if %winbuild% LEQ 6300 (set _slexe=SLsvc.exe& set _slser=SLsvc)
|
if %winbuild% LEQ 6300 (set _slexe=SLsvc.exe& set _slser=SLsvc)
|
||||||
@ -2373,7 +2361,6 @@ call :dk_actid 55c92734-d682-4d71-983e-d6ec3f16059f
|
|||||||
|
|
||||||
if not defined apps (
|
if not defined apps (
|
||||||
%psc% "if (-not $env:_vis) {Start-Job { Stop-Service %_slser% -force } | Wait-Job -Timeout 20 | Out-Null}; $sls = Get-WmiObject SoftwareLicensingService; $f=[System.IO.File]::ReadAllText('!_batp!') -split ':xrm\:.*';. ([scriptblock]::Create($f[1])); ReinstallLicenses" %nul%
|
%psc% "if (-not $env:_vis) {Start-Job { Stop-Service %_slser% -force } | Wait-Job -Timeout 20 | Out-Null}; $sls = Get-WmiObject SoftwareLicensingService; $f=[System.IO.File]::ReadAllText('!_batp!') -split ':xrm\:.*';. ([scriptblock]::Create($f[1])); ReinstallLicenses" %nul%
|
||||||
if not defined _vis if !errorlevel! NEQ 0 set rlicfailed=1
|
|
||||||
call :dk_actid 55c92734-d682-4d71-983e-d6ec3f16059f
|
call :dk_actid 55c92734-d682-4d71-983e-d6ec3f16059f
|
||||||
)
|
)
|
||||||
|
|
||||||
@ -2395,13 +2382,6 @@ set error=1
|
|||||||
set showfix=1
|
set showfix=1
|
||||||
)
|
)
|
||||||
|
|
||||||
if not defined showfix if defined rlicfailed (
|
|
||||||
echo:
|
|
||||||
call :dk_color %Blue% "%_fixmsg%"
|
|
||||||
call :dk_color %Blue% "If activation still fails then run Fix WPA Registry option."
|
|
||||||
echo:
|
|
||||||
)
|
|
||||||
|
|
||||||
if %winbuild% GEQ 7600 if exist "%tokenstore%\" if not exist "%tokenstore%\tokens.dat" (
|
if %winbuild% GEQ 7600 if exist "%tokenstore%\" if not exist "%tokenstore%\tokens.dat" (
|
||||||
call :dk_color %Red% "Checking SPP tokens.dat [Not Found] [%tokenstore%\]"
|
call :dk_color %Red% "Checking SPP tokens.dat [Not Found] [%tokenstore%\]"
|
||||||
)
|
)
|
||||||
|
@ -1452,12 +1452,10 @@ call :dk_color %Gray% "Checking Total User Accounts [%counter%]"
|
|||||||
|
|
||||||
:: Clear the vNext/shared/device license blocks which may prevent ohook activation
|
:: Clear the vNext/shared/device license blocks which may prevent ohook activation
|
||||||
|
|
||||||
set vnextexist=
|
|
||||||
rmdir /s /q "%ProgramData%\Microsoft\Office\Licenses\" %nul%
|
rmdir /s /q "%ProgramData%\Microsoft\Office\Licenses\" %nul%
|
||||||
|
|
||||||
for %%x in (15 16) do (
|
for %%x in (15 16) do (
|
||||||
for %%# in (%_sidlist%) do (
|
for %%# in (%_sidlist%) do (
|
||||||
reg query HKU\%%#\Software\Microsoft\Office\%%x.0\Common\Licensing /s %nul2% | findstr /i "CIDToLicenseIdsMapping LicenseIdToEmailMapping @" %nul% && set vnextexist=1
|
|
||||||
reg delete HKU\%%#\Software\Microsoft\Office\%%x.0\Common\Licensing /f %nul%
|
reg delete HKU\%%#\Software\Microsoft\Office\%%x.0\Common\Licensing /f %nul%
|
||||||
|
|
||||||
for /f "skip=2 tokens=2*" %%a in ('"reg query "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\ProfileList\%%#" /v ProfileImagePath" %nul6%') do (
|
for /f "skip=2 tokens=2*" %%a in ('"reg query "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\ProfileList\%%#" /v ProfileImagePath" %nul6%') do (
|
||||||
@ -1480,7 +1478,6 @@ rmdir /s /q "%%b\AppData\Local\Packages\Microsoft.Office.Desktop_8wekyb3d8bbwe\L
|
|||||||
if exist "%%b\AppData\Local\Packages\Microsoft.Office.Desktop_8wekyb3d8bbwe\SystemAppData\Helium\User.dat" (
|
if exist "%%b\AppData\Local\Packages\Microsoft.Office.Desktop_8wekyb3d8bbwe\SystemAppData\Helium\User.dat" (
|
||||||
set defname=DEFTEMP-%%#
|
set defname=DEFTEMP-%%#
|
||||||
reg load HKU\!defname! "%%b\AppData\Local\Packages\Microsoft.Office.Desktop_8wekyb3d8bbwe\SystemAppData\Helium\User.dat" %nul%
|
reg load HKU\!defname! "%%b\AppData\Local\Packages\Microsoft.Office.Desktop_8wekyb3d8bbwe\SystemAppData\Helium\User.dat" %nul%
|
||||||
reg query HKU\!defname!\Software\Microsoft\Office\16.0\Common\Licensing /s %nul2% | findstr /i "CIDToLicenseIdsMapping LicenseIdToEmailMapping @" %nul% && set vnextexist=1
|
|
||||||
reg delete HKU\!defname!\Software\Microsoft\Office\16.0\Common\Licensing /f %nul%
|
reg delete HKU\!defname!\Software\Microsoft\Office\16.0\Common\Licensing /f %nul%
|
||||||
reg unload HKU\!defname! %nul%
|
reg unload HKU\!defname! %nul%
|
||||||
)
|
)
|
||||||
@ -1488,15 +1485,6 @@ reg unload HKU\!defname! %nul%
|
|||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
|
||||||
if defined vnextexist (
|
|
||||||
echo:
|
|
||||||
call :dk_color %Gray% "Office vNext subscription detected:"
|
|
||||||
call :dk_color %Blue% "If active, this license overrides other activation methods."
|
|
||||||
call :dk_color %Blue% "If expiring soon, rerun the script after expiration."
|
|
||||||
call :dk_color2 %Blue% "If expired and script activation fails, get help - " %_Yellow% " %mas%troubleshoot"
|
|
||||||
echo:
|
|
||||||
)
|
|
||||||
|
|
||||||
:: Clear SharedComputerLicensing for office
|
:: Clear SharedComputerLicensing for office
|
||||||
:: https://learn.microsoft.com/en-us/deployoffice/overview-shared-computer-activation
|
:: https://learn.microsoft.com/en-us/deployoffice/overview-shared-computer-activation
|
||||||
|
|
||||||
@ -1767,7 +1755,7 @@ set "PSModulePath=%ProgramFiles%\WindowsPowerShell\Modules;%SysPath%\WindowsPowe
|
|||||||
set _tserror=
|
set _tserror=
|
||||||
set winbuild=1
|
set winbuild=1
|
||||||
set "nul=>nul 2>&1"
|
set "nul=>nul 2>&1"
|
||||||
for /f "tokens=2 delims=[]" %%G in ('ver') do for /f "tokens=2,3,4 delims=. " %%H in ("%%~G") do set "winbuild=%%J"
|
for /f "tokens=6 delims=[]. " %%G in ('ver') do set winbuild=%%G
|
||||||
set psc=powershell.exe -nop -c
|
set psc=powershell.exe -nop -c
|
||||||
|
|
||||||
set _slexe=sppsvc.exe& set _slser=sppsvc
|
set _slexe=sppsvc.exe& set _slser=sppsvc
|
||||||
@ -2587,7 +2575,7 @@ exit /b
|
|||||||
set ps=%SysPath%\WindowsPowerShell\v1.0\powershell.exe
|
set ps=%SysPath%\WindowsPowerShell\v1.0\powershell.exe
|
||||||
set psc=%ps% -nop -c
|
set psc=%ps% -nop -c
|
||||||
set winbuild=1
|
set winbuild=1
|
||||||
for /f "tokens=2 delims=[]" %%G in ('ver') do for /f "tokens=2,3,4 delims=. " %%H in ("%%~G") do set "winbuild=%%J"
|
for /f "tokens=6 delims=[]. " %%G in ('ver') do set winbuild=%%G
|
||||||
|
|
||||||
set _slexe=sppsvc.exe& set _slser=sppsvc
|
set _slexe=sppsvc.exe& set _slser=sppsvc
|
||||||
if %winbuild% LEQ 6300 (set _slexe=SLsvc.exe& set _slser=SLsvc)
|
if %winbuild% LEQ 6300 (set _slexe=SLsvc.exe& set _slser=SLsvc)
|
||||||
@ -3436,7 +3424,6 @@ call :dk_actid 55c92734-d682-4d71-983e-d6ec3f16059f
|
|||||||
|
|
||||||
if not defined apps (
|
if not defined apps (
|
||||||
%psc% "if (-not $env:_vis) {Start-Job { Stop-Service %_slser% -force } | Wait-Job -Timeout 20 | Out-Null}; $sls = Get-WmiObject SoftwareLicensingService; $f=[System.IO.File]::ReadAllText('!_batp!') -split ':xrm\:.*';. ([scriptblock]::Create($f[1])); ReinstallLicenses" %nul%
|
%psc% "if (-not $env:_vis) {Start-Job { Stop-Service %_slser% -force } | Wait-Job -Timeout 20 | Out-Null}; $sls = Get-WmiObject SoftwareLicensingService; $f=[System.IO.File]::ReadAllText('!_batp!') -split ':xrm\:.*';. ([scriptblock]::Create($f[1])); ReinstallLicenses" %nul%
|
||||||
if not defined _vis if !errorlevel! NEQ 0 set rlicfailed=1
|
|
||||||
call :dk_actid 55c92734-d682-4d71-983e-d6ec3f16059f
|
call :dk_actid 55c92734-d682-4d71-983e-d6ec3f16059f
|
||||||
)
|
)
|
||||||
|
|
||||||
@ -3458,13 +3445,6 @@ set error=1
|
|||||||
set showfix=1
|
set showfix=1
|
||||||
)
|
)
|
||||||
|
|
||||||
if not defined showfix if defined rlicfailed (
|
|
||||||
echo:
|
|
||||||
call :dk_color %Blue% "%_fixmsg%"
|
|
||||||
call :dk_color %Blue% "If activation still fails then run Fix WPA Registry option."
|
|
||||||
echo:
|
|
||||||
)
|
|
||||||
|
|
||||||
if %winbuild% GEQ 7600 if exist "%tokenstore%\" if not exist "%tokenstore%\tokens.dat" (
|
if %winbuild% GEQ 7600 if exist "%tokenstore%\" if not exist "%tokenstore%\tokens.dat" (
|
||||||
call :dk_color %Red% "Checking SPP tokens.dat [Not Found] [%tokenstore%\]"
|
call :dk_color %Red% "Checking SPP tokens.dat [Not Found] [%tokenstore%\]"
|
||||||
)
|
)
|
||||||
|
@ -2411,12 +2411,10 @@ call :dk_color %Gray% "Checking Total User Accounts [%counter%]"
|
|||||||
|
|
||||||
:: Clear the vNext/shared/device license blocks which may prevent ohook activation
|
:: Clear the vNext/shared/device license blocks which may prevent ohook activation
|
||||||
|
|
||||||
set vnextexist=
|
|
||||||
rmdir /s /q "%ProgramData%\Microsoft\Office\Licenses\" %nul%
|
rmdir /s /q "%ProgramData%\Microsoft\Office\Licenses\" %nul%
|
||||||
|
|
||||||
for %%x in (15 16) do (
|
for %%x in (15 16) do (
|
||||||
for %%# in (%_sidlist%) do (
|
for %%# in (%_sidlist%) do (
|
||||||
reg query HKU\%%#\Software\Microsoft\Office\%%x.0\Common\Licensing /s %nul2% | findstr /i "CIDToLicenseIdsMapping LicenseIdToEmailMapping @" %nul% && set vnextexist=1
|
|
||||||
reg delete HKU\%%#\Software\Microsoft\Office\%%x.0\Common\Licensing /f %nul%
|
reg delete HKU\%%#\Software\Microsoft\Office\%%x.0\Common\Licensing /f %nul%
|
||||||
|
|
||||||
for /f "skip=2 tokens=2*" %%a in ('"reg query "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\ProfileList\%%#" /v ProfileImagePath" %nul6%') do (
|
for /f "skip=2 tokens=2*" %%a in ('"reg query "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\ProfileList\%%#" /v ProfileImagePath" %nul6%') do (
|
||||||
@ -2439,7 +2437,6 @@ rmdir /s /q "%%b\AppData\Local\Packages\Microsoft.Office.Desktop_8wekyb3d8bbwe\L
|
|||||||
if exist "%%b\AppData\Local\Packages\Microsoft.Office.Desktop_8wekyb3d8bbwe\SystemAppData\Helium\User.dat" (
|
if exist "%%b\AppData\Local\Packages\Microsoft.Office.Desktop_8wekyb3d8bbwe\SystemAppData\Helium\User.dat" (
|
||||||
set defname=DEFTEMP-%%#
|
set defname=DEFTEMP-%%#
|
||||||
reg load HKU\!defname! "%%b\AppData\Local\Packages\Microsoft.Office.Desktop_8wekyb3d8bbwe\SystemAppData\Helium\User.dat" %nul%
|
reg load HKU\!defname! "%%b\AppData\Local\Packages\Microsoft.Office.Desktop_8wekyb3d8bbwe\SystemAppData\Helium\User.dat" %nul%
|
||||||
reg query HKU\!defname!\Software\Microsoft\Office\16.0\Common\Licensing /s %nul2% | findstr /i "CIDToLicenseIdsMapping LicenseIdToEmailMapping @" %nul% && set vnextexist=1
|
|
||||||
reg delete HKU\!defname!\Software\Microsoft\Office\16.0\Common\Licensing /f %nul%
|
reg delete HKU\!defname!\Software\Microsoft\Office\16.0\Common\Licensing /f %nul%
|
||||||
reg unload HKU\!defname! %nul%
|
reg unload HKU\!defname! %nul%
|
||||||
)
|
)
|
||||||
@ -2447,15 +2444,6 @@ reg unload HKU\!defname! %nul%
|
|||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
|
||||||
if defined vnextexist (
|
|
||||||
echo:
|
|
||||||
call :dk_color %Gray% "Office vNext subscription detected:"
|
|
||||||
call :dk_color %Blue% "If active, this license overrides other activation methods."
|
|
||||||
call :dk_color %Blue% "If expiring soon, rerun the script after expiration."
|
|
||||||
call :dk_color2 %Blue% "If expired and script activation fails, get help - " %_Yellow% " %mas%troubleshoot"
|
|
||||||
echo:
|
|
||||||
)
|
|
||||||
|
|
||||||
:: Clear SharedComputerLicensing for office
|
:: Clear SharedComputerLicensing for office
|
||||||
:: https://learn.microsoft.com/en-us/deployoffice/overview-shared-computer-activation
|
:: https://learn.microsoft.com/en-us/deployoffice/overview-shared-computer-activation
|
||||||
|
|
||||||
@ -2636,7 +2624,7 @@ exit /b
|
|||||||
set ps=%SysPath%\WindowsPowerShell\v1.0\powershell.exe
|
set ps=%SysPath%\WindowsPowerShell\v1.0\powershell.exe
|
||||||
set psc=%ps% -nop -c
|
set psc=%ps% -nop -c
|
||||||
set winbuild=1
|
set winbuild=1
|
||||||
for /f "tokens=2 delims=[]" %%G in ('ver') do for /f "tokens=2,3,4 delims=. " %%H in ("%%~G") do set "winbuild=%%J"
|
for /f "tokens=6 delims=[]. " %%G in ('ver') do set winbuild=%%G
|
||||||
|
|
||||||
set _slexe=sppsvc.exe& set _slser=sppsvc
|
set _slexe=sppsvc.exe& set _slser=sppsvc
|
||||||
if %winbuild% LEQ 6300 (set _slexe=SLsvc.exe& set _slser=SLsvc)
|
if %winbuild% LEQ 6300 (set _slexe=SLsvc.exe& set _slser=SLsvc)
|
||||||
@ -3442,7 +3430,6 @@ call :dk_actid 55c92734-d682-4d71-983e-d6ec3f16059f
|
|||||||
|
|
||||||
if not defined apps (
|
if not defined apps (
|
||||||
%psc% "if (-not $env:_vis) {Start-Job { Stop-Service %_slser% -force } | Wait-Job -Timeout 20 | Out-Null}; $sls = Get-WmiObject SoftwareLicensingService; $f=[System.IO.File]::ReadAllText('!_batp!') -split ':xrm\:.*';. ([scriptblock]::Create($f[1])); ReinstallLicenses" %nul%
|
%psc% "if (-not $env:_vis) {Start-Job { Stop-Service %_slser% -force } | Wait-Job -Timeout 20 | Out-Null}; $sls = Get-WmiObject SoftwareLicensingService; $f=[System.IO.File]::ReadAllText('!_batp!') -split ':xrm\:.*';. ([scriptblock]::Create($f[1])); ReinstallLicenses" %nul%
|
||||||
if not defined _vis if !errorlevel! NEQ 0 set rlicfailed=1
|
|
||||||
call :dk_actid 55c92734-d682-4d71-983e-d6ec3f16059f
|
call :dk_actid 55c92734-d682-4d71-983e-d6ec3f16059f
|
||||||
)
|
)
|
||||||
|
|
||||||
@ -3464,13 +3451,6 @@ set error=1
|
|||||||
set showfix=1
|
set showfix=1
|
||||||
)
|
)
|
||||||
|
|
||||||
if not defined showfix if defined rlicfailed (
|
|
||||||
echo:
|
|
||||||
call :dk_color %Blue% "%_fixmsg%"
|
|
||||||
call :dk_color %Blue% "If activation still fails then run Fix WPA Registry option."
|
|
||||||
echo:
|
|
||||||
)
|
|
||||||
|
|
||||||
if %winbuild% GEQ 7600 if exist "%tokenstore%\" if not exist "%tokenstore%\tokens.dat" (
|
if %winbuild% GEQ 7600 if exist "%tokenstore%\" if not exist "%tokenstore%\tokens.dat" (
|
||||||
call :dk_color %Red% "Checking SPP tokens.dat [Not Found] [%tokenstore%\]"
|
call :dk_color %Red% "Checking SPP tokens.dat [Not Found] [%tokenstore%\]"
|
||||||
)
|
)
|
||||||
|
@ -1547,7 +1547,7 @@ if ($appIdsList.Count -gt 0) {
|
|||||||
set ps=%SysPath%\WindowsPowerShell\v1.0\powershell.exe
|
set ps=%SysPath%\WindowsPowerShell\v1.0\powershell.exe
|
||||||
set psc=%ps% -nop -c
|
set psc=%ps% -nop -c
|
||||||
set winbuild=1
|
set winbuild=1
|
||||||
for /f "tokens=2 delims=[]" %%G in ('ver') do for /f "tokens=2,3,4 delims=. " %%H in ("%%~G") do set "winbuild=%%J"
|
for /f "tokens=6 delims=[]. " %%G in ('ver') do set winbuild=%%G
|
||||||
|
|
||||||
set _slexe=sppsvc.exe& set _slser=sppsvc
|
set _slexe=sppsvc.exe& set _slser=sppsvc
|
||||||
if %winbuild% LEQ 6300 (set _slexe=SLsvc.exe& set _slser=SLsvc)
|
if %winbuild% LEQ 6300 (set _slexe=SLsvc.exe& set _slser=SLsvc)
|
||||||
|
@ -870,7 +870,7 @@ exit /b
|
|||||||
set ps=%SysPath%\WindowsPowerShell\v1.0\powershell.exe
|
set ps=%SysPath%\WindowsPowerShell\v1.0\powershell.exe
|
||||||
set psc=%ps% -nop -c
|
set psc=%ps% -nop -c
|
||||||
set winbuild=1
|
set winbuild=1
|
||||||
for /f "tokens=2 delims=[]" %%G in ('ver') do for /f "tokens=2,3,4 delims=. " %%H in ("%%~G") do set "winbuild=%%J"
|
for /f "tokens=6 delims=[]. " %%G in ('ver') do set winbuild=%%G
|
||||||
|
|
||||||
set _slexe=sppsvc.exe& set _slser=sppsvc
|
set _slexe=sppsvc.exe& set _slser=sppsvc
|
||||||
if %winbuild% LEQ 6300 (set _slexe=SLsvc.exe& set _slser=SLsvc)
|
if %winbuild% LEQ 6300 (set _slexe=SLsvc.exe& set _slser=SLsvc)
|
||||||
|
@ -795,7 +795,7 @@ exit /b
|
|||||||
set ps=%SysPath%\WindowsPowerShell\v1.0\powershell.exe
|
set ps=%SysPath%\WindowsPowerShell\v1.0\powershell.exe
|
||||||
set psc=%ps% -nop -c
|
set psc=%ps% -nop -c
|
||||||
set winbuild=1
|
set winbuild=1
|
||||||
for /f "tokens=2 delims=[]" %%G in ('ver') do for /f "tokens=2,3,4 delims=. " %%H in ("%%~G") do set "winbuild=%%J"
|
for /f "tokens=6 delims=[]. " %%G in ('ver') do set winbuild=%%G
|
||||||
|
|
||||||
set _slexe=sppsvc.exe& set _slser=sppsvc
|
set _slexe=sppsvc.exe& set _slser=sppsvc
|
||||||
if %winbuild% LEQ 6300 (set _slexe=SLsvc.exe& set _slser=SLsvc)
|
if %winbuild% LEQ 6300 (set _slexe=SLsvc.exe& set _slser=SLsvc)
|
||||||
|
@ -1655,7 +1655,7 @@ exit /b
|
|||||||
set ps=%SysPath%\WindowsPowerShell\v1.0\powershell.exe
|
set ps=%SysPath%\WindowsPowerShell\v1.0\powershell.exe
|
||||||
set psc=%ps% -nop -c
|
set psc=%ps% -nop -c
|
||||||
set winbuild=1
|
set winbuild=1
|
||||||
for /f "tokens=2 delims=[]" %%G in ('ver') do for /f "tokens=2,3,4 delims=. " %%H in ("%%~G") do set "winbuild=%%J"
|
for /f "tokens=6 delims=[]. " %%G in ('ver') do set winbuild=%%G
|
||||||
|
|
||||||
set _slexe=sppsvc.exe& set _slser=sppsvc
|
set _slexe=sppsvc.exe& set _slser=sppsvc
|
||||||
if %winbuild% LEQ 6300 (set _slexe=SLsvc.exe& set _slser=SLsvc)
|
if %winbuild% LEQ 6300 (set _slexe=SLsvc.exe& set _slser=SLsvc)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user