Compare commits
No commits in common. "a1244dcb3b14070c690aed8de3a2fd807466b077" and "52d4c52dba8e29a3c1fb295c8946dbe6cf2f0239" have entirely different histories.
a1244dcb3b
...
52d4c52dba
|
@ -2807,15 +2807,7 @@ set _sortIds=!_sortIds:PreInstallR_=Retail_!
|
||||||
:: https://learn.microsoft.com/office/troubleshoot/activation/reset-office-365-proplus-activation-state
|
:: https://learn.microsoft.com/office/troubleshoot/activation/reset-office-365-proplus-activation-state
|
||||||
|
|
||||||
set _sidlist=
|
set _sidlist=
|
||||||
set failedload=
|
for /f "tokens=* delims=" %%a in ('%psc% "$p = 'HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion\ProfileList'; Get-ChildItem $p | ForEach-Object { $pi = (Get-ItemProperty """"$p\$($_.PSChildName)"""").ProfileImagePath; if ($pi -like """"$Env:SystemDrive\Users\*"""" -and (Test-Path """"$pi\NTUSER.DAT"""") -and -not ($_ -match '\.bak$')) { Split-Path $_.PSPath -Leaf } }" %nul6%') do (if defined _sidlist (set _sidlist=!_sidlist! %%a) else (set _sidlist=%%a))
|
||||||
|
|
||||||
for /f "tokens=* delims=" %%a in ('%psc% "$p = 'HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion\ProfileList'; Get-ChildItem $p | ForEach-Object { $pi = (Get-ItemProperty """"$p\$($_.PSChildName)"""").ProfileImagePath; if ($_.PSChildName -match '^S-([^-\n]*-){5,}[^-\n]*$' -and (Test-Path """"$pi\NTUSER.DAT"""") -and -not ($_ -match '\.bak$')) { Split-Path $_.PSPath -Leaf } }" %nul6%') do (if defined _sidlist (set _sidlist=!_sidlist! %%a) else (set _sidlist=%%a))
|
|
||||||
|
|
||||||
:: Fallback method
|
|
||||||
if not defined _sidlist (
|
|
||||||
set failedload=1
|
|
||||||
for /f "delims=" %%a in ('%psc% "$explorerProc = Get-Process -Name explorer | Where-Object {$_.SessionId -eq (Get-Process -Id $pid).SessionId} | Select-Object -First 1; $sid = (gwmi -Query ('Select * From Win32_Process Where ProcessID=' + $explorerProc.Id)).GetOwnerSid().Sid; $sid" %nul6%') do (set _sidlist=%%a)
|
|
||||||
)
|
|
||||||
|
|
||||||
if not defined _sidlist (
|
if not defined _sidlist (
|
||||||
set error=1
|
set error=1
|
||||||
|
@ -2835,6 +2827,8 @@ call :dk_color %Gray% "Checking Total User Accounts [%counter%]"
|
||||||
:: Load the unloaded useraccounts registry
|
:: Load the unloaded useraccounts registry
|
||||||
|
|
||||||
set loadedsids=
|
set loadedsids=
|
||||||
|
set failedtoload=
|
||||||
|
set failedtounload=
|
||||||
for %%# in (%_sidlist%) do (
|
for %%# in (%_sidlist%) do (
|
||||||
reg query HKU\%%#\Software %nul% || (
|
reg query HKU\%%#\Software %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 (
|
||||||
|
@ -2842,7 +2836,7 @@ reg load HKU\%%# "%%b\NTUSER.DAT" %nul%
|
||||||
reg query HKU\%%#\Software %nul% && (
|
reg query HKU\%%#\Software %nul% && (
|
||||||
call set "loadedsids=%%loadedsids%% %%#"
|
call set "loadedsids=%%loadedsids%% %%#"
|
||||||
) || (
|
) || (
|
||||||
set failedload=1
|
set failedtoload=1
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
@ -2904,19 +2898,13 @@ echo Clearing Office License Blocks [Successfully cleared from all %cou
|
||||||
:: Some retail products attempt to validate the license and may show a banner "There was a problem checking this device's license status."
|
:: Some retail products attempt to validate the license and may show a banner "There was a problem checking this device's license status."
|
||||||
:: Resiliency registry entry can skip this check
|
:: Resiliency registry entry can skip this check
|
||||||
|
|
||||||
set faileddef=
|
|
||||||
for /f "skip=2 tokens=2*" %%a in ('"reg query "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\ProfileList" /v Default" %nul6%') do call set "defdat=%%b"
|
|
||||||
|
|
||||||
if defined o16c2r if defined officeact (
|
if defined o16c2r if defined officeact (
|
||||||
if exist "%defdat%\NTUSER.DAT" (
|
reg load HKU\DEF_TEMP %SystemDrive%\Users\Default\NTUSER.DAT %nul%
|
||||||
reg load HKU\DEF_TEMP "%defdat%\NTUSER.DAT" %nul%
|
reg query HKU\DEF_TEMP %nul% || set failedtoload=1
|
||||||
reg query HKU\DEF_TEMP %nul% || set faileddef=1
|
|
||||||
reg add HKU\DEF_TEMP\Software\Microsoft\Office\16.0\Common\Licensing\Resiliency /v "TimeOfLastHeartbeatFailure" /t REG_SZ /d "2040-01-01T00:00:00Z" /f %nul%
|
reg add HKU\DEF_TEMP\Software\Microsoft\Office\16.0\Common\Licensing\Resiliency /v "TimeOfLastHeartbeatFailure" /t REG_SZ /d "2040-01-01T00:00:00Z" /f %nul%
|
||||||
reg unload HKU\DEF_TEMP %nul%
|
reg unload HKU\DEF_TEMP %nul%
|
||||||
reg query HKU\DEF_TEMP %nul% && set faileddef=1
|
reg query HKU\DEF_TEMP %nul% && set failedtounload=1
|
||||||
) else (
|
|
||||||
set faileddef=1
|
|
||||||
)
|
|
||||||
for %%# in (%_sidlist%) do (
|
for %%# in (%_sidlist%) do (
|
||||||
reg delete HKU\%%#\Software\Microsoft\Office\16.0\Common\Licensing\Resiliency /f %nul%
|
reg delete HKU\%%#\Software\Microsoft\Office\16.0\Common\Licensing\Resiliency /f %nul%
|
||||||
reg add HKU\%%#\Software\Microsoft\Office\16.0\Common\Licensing\Resiliency /v "TimeOfLastHeartbeatFailure" /t REG_SZ /d "2040-01-01T00:00:00Z" /f %nul%
|
reg add HKU\%%#\Software\Microsoft\Office\16.0\Common\Licensing\Resiliency /v "TimeOfLastHeartbeatFailure" /t REG_SZ /d "2040-01-01T00:00:00Z" /f %nul%
|
||||||
|
@ -2930,15 +2918,19 @@ echo Adding Reg Keys to Skip License Check [Successfully added to all %counter
|
||||||
|
|
||||||
for %%# in (%loadedsids%) do (
|
for %%# in (%loadedsids%) do (
|
||||||
reg unload HKU\%%# %nul%
|
reg unload HKU\%%# %nul%
|
||||||
reg query HKU\%%# %nul% && set failedload=1
|
reg query HKU\%%# %nul% && set failedtounload=1
|
||||||
)
|
)
|
||||||
|
|
||||||
if defined failedload (
|
if defined failedtoload (
|
||||||
call :dk_color %Gray% "Loading Unloading Registries [Failed for some user accounts]"
|
set error=1
|
||||||
|
call :dk_color %Red% "Loading Unloaded Accounts Registry [Failed for some user accounts]"
|
||||||
|
call :dk_color %Blue% "Reboot your machine using the restart option and try again."
|
||||||
)
|
)
|
||||||
|
|
||||||
if defined faileddef (
|
if defined failedtounload (
|
||||||
call :dk_color %Gray% "Loading Unloading Registries [Failed for Default\NTUSER.DAT]"
|
set error=1
|
||||||
|
call :dk_color %Red% "Unloading Loaded Account Registries [Failed for some user accounts]"
|
||||||
|
call :dk_color %Blue% "Reboot your machine using the restart option and try again."
|
||||||
)
|
)
|
||||||
|
|
||||||
exit /b
|
exit /b
|
||||||
|
@ -6344,12 +6336,12 @@ aaea0dc8-78e1-4343-9f25-b69b83dd1bce_D9GTG-NP7DV-T6JP3-B6B62-JB%f%89R__16_Projec
|
||||||
cbbba2c3-0ff5-4558-846a-043ef9d78559_F4DYN-89BP2-WQTWJ-GR8YC-CK%f%GJG__16_Excel2024Volume_-Excel2024Retail-
|
cbbba2c3-0ff5-4558-846a-043ef9d78559_F4DYN-89BP2-WQTWJ-GR8YC-CK%f%GJG__16_Excel2024Volume_-Excel2024Retail-
|
||||||
bef3152a-8a04-40f2-a065-340c3f23516d_D2F8D-N3Q3B-J28PV-X27HD-RJ%f%WB9__16_Outlook2024Volume_-Outlook2024Retail-
|
bef3152a-8a04-40f2-a065-340c3f23516d_D2F8D-N3Q3B-J28PV-X27HD-RJ%f%WB9__16_Outlook2024Volume_-Outlook2024Retail-
|
||||||
b63626a4-5f05-4ced-9639-31ba730a127e_CW94N-K6GJH-9CTXY-MG2VC-FY%f%CWP__16_PowerPoint2024Volume_-PowerPoint2024Retail-
|
b63626a4-5f05-4ced-9639-31ba730a127e_CW94N-K6GJH-9CTXY-MG2VC-FY%f%CWP__16_PowerPoint2024Volume_-PowerPoint2024Retail-
|
||||||
f510af75-8ab7-4426-a236-1bfb95c34ff8_FQQ23-N4YCY-73HQ3-FM9WC-76%f%HF4__16_ProjectPro2024Volume_-ProjectPro2024Retail-
|
f510af75-8ab7-4426-a236-1bfb95c34ff8_NBBBB-BBBBB-BBBBB-BBBH4-GX%f%3R4__16_ProjectPro2024Volume_-ProjectPro2024Retail-
|
||||||
9f144f27-2ac5-40b9-899d-898c2b8b4f81_PD3TT-NTHQQ-VC7CY-MFXK3-G8%f%7F8__16_ProjectStd2024Volume_-ProjectStd2024Retail-
|
9f144f27-2ac5-40b9-899d-898c2b8b4f81_PD3TT-NTHQQ-VC7CY-MFXK3-G8%f%7F8__16_ProjectStd2024Volume_-ProjectStd2024Retail-
|
||||||
8d368fc1-9470-4be2-8d66-90e836cbb051_XJ2XN-FW8RK-P4HMP-DKDBV-GC%f%VGB__16_ProPlus2024Volume_-ProPlus2024Retail-
|
8d368fc1-9470-4be2-8d66-90e836cbb051_NBBBB-BBBBB-BBBBB-BBBJD-VX%f%RPM__16_ProPlus2024Volume_-ProPlus2024Retail-
|
||||||
0002290a-2091-4324-9e53-3cfe28884cde_4NKHF-9HBQF-Q3B6C-7YV34-F6%f%4P3__16_SkypeforBusiness2024Volume
|
0002290a-2091-4324-9e53-3cfe28884cde_4NKHF-9HBQF-Q3B6C-7YV34-F6%f%4P3__16_SkypeforBusiness2024Volume
|
||||||
bbac904f-6a7e-418a-bb4b-24c85da06187_V28N4-JG22K-W66P8-VTMGK-H6%f%HGR__16_Standard2024Volume_-Home2024Retail-HomeBusiness2024Retail-
|
bbac904f-6a7e-418a-bb4b-24c85da06187_V28N4-JG22K-W66P8-VTMGK-H6%f%HGR__16_Standard2024Volume_-Home2024Retail-HomeBusiness2024Retail-
|
||||||
fa187091-8246-47b1-964f-80a0b1e5d69a_B7TN8-FJ8V3-7QYCP-HQPMV-YY%f%89G__16_VisioPro2024Volume_-VisioPro2024Retail-
|
fa187091-8246-47b1-964f-80a0b1e5d69a_NBBBB-BBBBB-BBBBB-BBBCW-6M%f%X6T__16_VisioPro2024Volume_-VisioPro2024Retail-
|
||||||
923fa470-aa71-4b8b-b35c-36b79bf9f44b_JMMVY-XFNQC-KK4HK-9H7R3-WQ%f%QTV__16_VisioStd2024Volume_-VisioStd2024Retail-
|
923fa470-aa71-4b8b-b35c-36b79bf9f44b_JMMVY-XFNQC-KK4HK-9H7R3-WQ%f%QTV__16_VisioStd2024Volume_-VisioStd2024Retail-
|
||||||
d0eded01-0881-4b37-9738-190400095098_MQ84N-7VYDM-FXV7C-6K7CC-VF%f%W9J__16_Word2024Volume_-Word2024Retail-
|
d0eded01-0881-4b37-9738-190400095098_MQ84N-7VYDM-FXV7C-6K7CC-VF%f%W9J__16_Word2024Volume_-Word2024Retail-
|
||||||
) do (
|
) do (
|
||||||
|
@ -9934,12 +9926,10 @@ for %%# in (
|
||||||
for /f "tokens=1-2 delims=_" %%A in ("%%~#") do (
|
for /f "tokens=1-2 delims=_" %%A in ("%%~#") do (
|
||||||
set supported=
|
set supported=
|
||||||
if %winbuild% LSS 10240 (echo %%B | findstr /i "LTSC DevMain" %nul% || set supported=1) else (set supported=1)
|
if %winbuild% LSS 10240 (echo %%B | findstr /i "LTSC DevMain" %nul% || set supported=1) else (set supported=1)
|
||||||
if %winbuild% GEQ 10240 (
|
if %winbuild% GEQ 10240 (if defined ltsc19 echo %%B | findstr /i "LTSC\>" %nul% || set supported=)
|
||||||
if defined ltsc19 echo %%A | findstr /i "2019 VL" %nul% || set supported=
|
if %winbuild% GEQ 10240 (if defined ltsc21 echo %%B | findstr /i "LTSC2021\>" %nul% || set supported=)
|
||||||
if defined ltsc21 echo %%A | findstr /i "2021 VL" %nul% || set supported=
|
if %winbuild% GEQ 10240 (if defined ltsc24 echo %%B | findstr /i "LTSC2024\>" %nul% || set supported=)
|
||||||
if defined ltsc24 echo %%A | findstr /i "2024 VL" %nul% || set supported=
|
if %winbuild% GEQ 10240 (if not defined ltscfound echo %%B | findstr /i "LTSC" %nul% && set supported=)
|
||||||
if not defined ltscfound echo %%B | findstr /i "LTSC" %nul% && set supported=
|
|
||||||
)
|
|
||||||
if defined supported (
|
if defined supported (
|
||||||
set /a counter+=1
|
set /a counter+=1
|
||||||
if !counter! LSS 10 (
|
if !counter! LSS 10 (
|
||||||
|
@ -10109,15 +10099,13 @@ if exist "%_cfolder%\OfficeC2RClient.exe" (
|
||||||
set "_c2rCexe=%_cfolder%\OfficeC2RClient.exe"
|
set "_c2rCexe=%_cfolder%\OfficeC2RClient.exe"
|
||||||
)
|
)
|
||||||
|
|
||||||
set "audidata4=%_AudienceData:~-4%"
|
echo %_AudienceData% | findstr /i "LTSC\>" %nul% && set ltsc19=LTSC
|
||||||
|
|
||||||
if /i "%audidata4%"=="LTSC" set ltsc19=LTSC
|
|
||||||
echo %_clversion% %_version% | findstr "16.0.103 16.0.104 16.0.105" %nul% && set ltsc19=LTSC
|
echo %_clversion% %_version% | findstr "16.0.103 16.0.104 16.0.105" %nul% && set ltsc19=LTSC
|
||||||
|
|
||||||
if /i "%audidata4%"=="2021" set ltsc21=LTSC2021
|
echo %_AudienceData% | findstr /i "LTSC2021\>" %nul% && set ltsc21=LTSC2021
|
||||||
echo %_clversion% %_version% | findstr "16.0.14332" %nul% && set ltsc21=LTSC2021
|
echo %_clversion% %_version% | findstr "16.0.14332" %nul% && set ltsc21=LTSC2021
|
||||||
|
|
||||||
if /i "%audidata4%"=="2024" set ltsc24=LTSC2024
|
echo %_AudienceData% | findstr /i "LTSC2024\>" %nul% && set ltsc24=LTSC2024
|
||||||
:: LTSC 2024 build is not fixed yet
|
:: LTSC 2024 build is not fixed yet
|
||||||
|
|
||||||
if not "%ltsc19%%ltsc21%%ltsc24%"=="" set ltscfound=1
|
if not "%ltsc19%%ltsc21%%ltsc24%"=="" set ltscfound=1
|
||||||
|
@ -10264,5 +10252,4 @@ if ($appIdsList.Count -gt 0) {
|
||||||
:getappnames:
|
:getappnames:
|
||||||
|
|
||||||
::========================================================================================================================================
|
::========================================================================================================================================
|
||||||
::
|
|
||||||
:: Leave empty line below
|
:: Leave empty line below
|
||||||
|
|
|
@ -1106,15 +1106,7 @@ set _sortIds=!_sortIds:PreInstallR_=Retail_!
|
||||||
:: https://learn.microsoft.com/office/troubleshoot/activation/reset-office-365-proplus-activation-state
|
:: https://learn.microsoft.com/office/troubleshoot/activation/reset-office-365-proplus-activation-state
|
||||||
|
|
||||||
set _sidlist=
|
set _sidlist=
|
||||||
set failedload=
|
for /f "tokens=* delims=" %%a in ('%psc% "$p = 'HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion\ProfileList'; Get-ChildItem $p | ForEach-Object { $pi = (Get-ItemProperty """"$p\$($_.PSChildName)"""").ProfileImagePath; if ($pi -like """"$Env:SystemDrive\Users\*"""" -and (Test-Path """"$pi\NTUSER.DAT"""") -and -not ($_ -match '\.bak$')) { Split-Path $_.PSPath -Leaf } }" %nul6%') do (if defined _sidlist (set _sidlist=!_sidlist! %%a) else (set _sidlist=%%a))
|
||||||
|
|
||||||
for /f "tokens=* delims=" %%a in ('%psc% "$p = 'HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion\ProfileList'; Get-ChildItem $p | ForEach-Object { $pi = (Get-ItemProperty """"$p\$($_.PSChildName)"""").ProfileImagePath; if ($_.PSChildName -match '^S-([^-\n]*-){5,}[^-\n]*$' -and (Test-Path """"$pi\NTUSER.DAT"""") -and -not ($_ -match '\.bak$')) { Split-Path $_.PSPath -Leaf } }" %nul6%') do (if defined _sidlist (set _sidlist=!_sidlist! %%a) else (set _sidlist=%%a))
|
|
||||||
|
|
||||||
:: Fallback method
|
|
||||||
if not defined _sidlist (
|
|
||||||
set failedload=1
|
|
||||||
for /f "delims=" %%a in ('%psc% "$explorerProc = Get-Process -Name explorer | Where-Object {$_.SessionId -eq (Get-Process -Id $pid).SessionId} | Select-Object -First 1; $sid = (gwmi -Query ('Select * From Win32_Process Where ProcessID=' + $explorerProc.Id)).GetOwnerSid().Sid; $sid" %nul6%') do (set _sidlist=%%a)
|
|
||||||
)
|
|
||||||
|
|
||||||
if not defined _sidlist (
|
if not defined _sidlist (
|
||||||
set error=1
|
set error=1
|
||||||
|
@ -1134,6 +1126,8 @@ call :dk_color %Gray% "Checking Total User Accounts [%counter%]"
|
||||||
:: Load the unloaded useraccounts registry
|
:: Load the unloaded useraccounts registry
|
||||||
|
|
||||||
set loadedsids=
|
set loadedsids=
|
||||||
|
set failedtoload=
|
||||||
|
set failedtounload=
|
||||||
for %%# in (%_sidlist%) do (
|
for %%# in (%_sidlist%) do (
|
||||||
reg query HKU\%%#\Software %nul% || (
|
reg query HKU\%%#\Software %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 (
|
||||||
|
@ -1141,7 +1135,7 @@ reg load HKU\%%# "%%b\NTUSER.DAT" %nul%
|
||||||
reg query HKU\%%#\Software %nul% && (
|
reg query HKU\%%#\Software %nul% && (
|
||||||
call set "loadedsids=%%loadedsids%% %%#"
|
call set "loadedsids=%%loadedsids%% %%#"
|
||||||
) || (
|
) || (
|
||||||
set failedload=1
|
set failedtoload=1
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
@ -1203,19 +1197,13 @@ echo Clearing Office License Blocks [Successfully cleared from all %cou
|
||||||
:: Some retail products attempt to validate the license and may show a banner "There was a problem checking this device's license status."
|
:: Some retail products attempt to validate the license and may show a banner "There was a problem checking this device's license status."
|
||||||
:: Resiliency registry entry can skip this check
|
:: Resiliency registry entry can skip this check
|
||||||
|
|
||||||
set faileddef=
|
|
||||||
for /f "skip=2 tokens=2*" %%a in ('"reg query "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\ProfileList" /v Default" %nul6%') do call set "defdat=%%b"
|
|
||||||
|
|
||||||
if defined o16c2r if defined officeact (
|
if defined o16c2r if defined officeact (
|
||||||
if exist "%defdat%\NTUSER.DAT" (
|
reg load HKU\DEF_TEMP %SystemDrive%\Users\Default\NTUSER.DAT %nul%
|
||||||
reg load HKU\DEF_TEMP "%defdat%\NTUSER.DAT" %nul%
|
reg query HKU\DEF_TEMP %nul% || set failedtoload=1
|
||||||
reg query HKU\DEF_TEMP %nul% || set faileddef=1
|
|
||||||
reg add HKU\DEF_TEMP\Software\Microsoft\Office\16.0\Common\Licensing\Resiliency /v "TimeOfLastHeartbeatFailure" /t REG_SZ /d "2040-01-01T00:00:00Z" /f %nul%
|
reg add HKU\DEF_TEMP\Software\Microsoft\Office\16.0\Common\Licensing\Resiliency /v "TimeOfLastHeartbeatFailure" /t REG_SZ /d "2040-01-01T00:00:00Z" /f %nul%
|
||||||
reg unload HKU\DEF_TEMP %nul%
|
reg unload HKU\DEF_TEMP %nul%
|
||||||
reg query HKU\DEF_TEMP %nul% && set faileddef=1
|
reg query HKU\DEF_TEMP %nul% && set failedtounload=1
|
||||||
) else (
|
|
||||||
set faileddef=1
|
|
||||||
)
|
|
||||||
for %%# in (%_sidlist%) do (
|
for %%# in (%_sidlist%) do (
|
||||||
reg delete HKU\%%#\Software\Microsoft\Office\16.0\Common\Licensing\Resiliency /f %nul%
|
reg delete HKU\%%#\Software\Microsoft\Office\16.0\Common\Licensing\Resiliency /f %nul%
|
||||||
reg add HKU\%%#\Software\Microsoft\Office\16.0\Common\Licensing\Resiliency /v "TimeOfLastHeartbeatFailure" /t REG_SZ /d "2040-01-01T00:00:00Z" /f %nul%
|
reg add HKU\%%#\Software\Microsoft\Office\16.0\Common\Licensing\Resiliency /v "TimeOfLastHeartbeatFailure" /t REG_SZ /d "2040-01-01T00:00:00Z" /f %nul%
|
||||||
|
@ -1229,15 +1217,19 @@ echo Adding Reg Keys to Skip License Check [Successfully added to all %counter
|
||||||
|
|
||||||
for %%# in (%loadedsids%) do (
|
for %%# in (%loadedsids%) do (
|
||||||
reg unload HKU\%%# %nul%
|
reg unload HKU\%%# %nul%
|
||||||
reg query HKU\%%# %nul% && set failedload=1
|
reg query HKU\%%# %nul% && set failedtounload=1
|
||||||
)
|
)
|
||||||
|
|
||||||
if defined failedload (
|
if defined failedtoload (
|
||||||
call :dk_color %Gray% "Loading Unloading Registries [Failed for some user accounts]"
|
set error=1
|
||||||
|
call :dk_color %Red% "Loading Unloaded Accounts Registry [Failed for some user accounts]"
|
||||||
|
call :dk_color %Blue% "Reboot your machine using the restart option and try again."
|
||||||
)
|
)
|
||||||
|
|
||||||
if defined faileddef (
|
if defined failedtounload (
|
||||||
call :dk_color %Gray% "Loading Unloading Registries [Failed for Default\NTUSER.DAT]"
|
set error=1
|
||||||
|
call :dk_color %Red% "Unloading Loaded Account Registries [Failed for some user accounts]"
|
||||||
|
call :dk_color %Blue% "Reboot your machine using the restart option and try again."
|
||||||
)
|
)
|
||||||
|
|
||||||
exit /b
|
exit /b
|
||||||
|
|
|
@ -1207,15 +1207,7 @@ exit /b
|
||||||
:: https://learn.microsoft.com/office/troubleshoot/activation/reset-office-365-proplus-activation-state
|
:: https://learn.microsoft.com/office/troubleshoot/activation/reset-office-365-proplus-activation-state
|
||||||
|
|
||||||
set _sidlist=
|
set _sidlist=
|
||||||
set failedload=
|
for /f "tokens=* delims=" %%a in ('%psc% "$p = 'HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion\ProfileList'; Get-ChildItem $p | ForEach-Object { $pi = (Get-ItemProperty """"$p\$($_.PSChildName)"""").ProfileImagePath; if ($pi -like """"$Env:SystemDrive\Users\*"""" -and (Test-Path """"$pi\NTUSER.DAT"""") -and -not ($_ -match '\.bak$')) { Split-Path $_.PSPath -Leaf } }" %nul6%') do (if defined _sidlist (set _sidlist=!_sidlist! %%a) else (set _sidlist=%%a))
|
||||||
|
|
||||||
for /f "tokens=* delims=" %%a in ('%psc% "$p = 'HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion\ProfileList'; Get-ChildItem $p | ForEach-Object { $pi = (Get-ItemProperty """"$p\$($_.PSChildName)"""").ProfileImagePath; if ($_.PSChildName -match '^S-([^-\n]*-){5,}[^-\n]*$' -and (Test-Path """"$pi\NTUSER.DAT"""") -and -not ($_ -match '\.bak$')) { Split-Path $_.PSPath -Leaf } }" %nul6%') do (if defined _sidlist (set _sidlist=!_sidlist! %%a) else (set _sidlist=%%a))
|
|
||||||
|
|
||||||
:: Fallback method
|
|
||||||
if not defined _sidlist (
|
|
||||||
set failedload=1
|
|
||||||
for /f "delims=" %%a in ('%psc% "$explorerProc = Get-Process -Name explorer | Where-Object {$_.SessionId -eq (Get-Process -Id $pid).SessionId} | Select-Object -First 1; $sid = (gwmi -Query ('Select * From Win32_Process Where ProcessID=' + $explorerProc.Id)).GetOwnerSid().Sid; $sid" %nul6%') do (set _sidlist=%%a)
|
|
||||||
)
|
|
||||||
|
|
||||||
if not defined _sidlist (
|
if not defined _sidlist (
|
||||||
set error=1
|
set error=1
|
||||||
|
@ -1235,6 +1227,8 @@ call :dk_color %Gray% "Checking Total User Accounts [%counter%]"
|
||||||
:: Load the unloaded useraccounts registry
|
:: Load the unloaded useraccounts registry
|
||||||
|
|
||||||
set loadedsids=
|
set loadedsids=
|
||||||
|
set failedtoload=
|
||||||
|
set failedtounload=
|
||||||
for %%# in (%_sidlist%) do (
|
for %%# in (%_sidlist%) do (
|
||||||
reg query HKU\%%#\Software %nul% || (
|
reg query HKU\%%#\Software %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 (
|
||||||
|
@ -1242,7 +1236,7 @@ reg load HKU\%%# "%%b\NTUSER.DAT" %nul%
|
||||||
reg query HKU\%%#\Software %nul% && (
|
reg query HKU\%%#\Software %nul% && (
|
||||||
call set "loadedsids=%%loadedsids%% %%#"
|
call set "loadedsids=%%loadedsids%% %%#"
|
||||||
) || (
|
) || (
|
||||||
set failedload=1
|
set failedtoload=1
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
@ -1304,19 +1298,13 @@ echo Clearing Office License Blocks [Successfully cleared from all %cou
|
||||||
:: Some retail products attempt to validate the license and may show a banner "There was a problem checking this device's license status."
|
:: Some retail products attempt to validate the license and may show a banner "There was a problem checking this device's license status."
|
||||||
:: Resiliency registry entry can skip this check
|
:: Resiliency registry entry can skip this check
|
||||||
|
|
||||||
set faileddef=
|
|
||||||
for /f "skip=2 tokens=2*" %%a in ('"reg query "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\ProfileList" /v Default" %nul6%') do call set "defdat=%%b"
|
|
||||||
|
|
||||||
if defined o16c2r if defined officeact (
|
if defined o16c2r if defined officeact (
|
||||||
if exist "%defdat%\NTUSER.DAT" (
|
reg load HKU\DEF_TEMP %SystemDrive%\Users\Default\NTUSER.DAT %nul%
|
||||||
reg load HKU\DEF_TEMP "%defdat%\NTUSER.DAT" %nul%
|
reg query HKU\DEF_TEMP %nul% || set failedtoload=1
|
||||||
reg query HKU\DEF_TEMP %nul% || set faileddef=1
|
|
||||||
reg add HKU\DEF_TEMP\Software\Microsoft\Office\16.0\Common\Licensing\Resiliency /v "TimeOfLastHeartbeatFailure" /t REG_SZ /d "2040-01-01T00:00:00Z" /f %nul%
|
reg add HKU\DEF_TEMP\Software\Microsoft\Office\16.0\Common\Licensing\Resiliency /v "TimeOfLastHeartbeatFailure" /t REG_SZ /d "2040-01-01T00:00:00Z" /f %nul%
|
||||||
reg unload HKU\DEF_TEMP %nul%
|
reg unload HKU\DEF_TEMP %nul%
|
||||||
reg query HKU\DEF_TEMP %nul% && set faileddef=1
|
reg query HKU\DEF_TEMP %nul% && set failedtounload=1
|
||||||
) else (
|
|
||||||
set faileddef=1
|
|
||||||
)
|
|
||||||
for %%# in (%_sidlist%) do (
|
for %%# in (%_sidlist%) do (
|
||||||
reg delete HKU\%%#\Software\Microsoft\Office\16.0\Common\Licensing\Resiliency /f %nul%
|
reg delete HKU\%%#\Software\Microsoft\Office\16.0\Common\Licensing\Resiliency /f %nul%
|
||||||
reg add HKU\%%#\Software\Microsoft\Office\16.0\Common\Licensing\Resiliency /v "TimeOfLastHeartbeatFailure" /t REG_SZ /d "2040-01-01T00:00:00Z" /f %nul%
|
reg add HKU\%%#\Software\Microsoft\Office\16.0\Common\Licensing\Resiliency /v "TimeOfLastHeartbeatFailure" /t REG_SZ /d "2040-01-01T00:00:00Z" /f %nul%
|
||||||
|
@ -1330,15 +1318,19 @@ echo Adding Reg Keys to Skip License Check [Successfully added to all %counter
|
||||||
|
|
||||||
for %%# in (%loadedsids%) do (
|
for %%# in (%loadedsids%) do (
|
||||||
reg unload HKU\%%# %nul%
|
reg unload HKU\%%# %nul%
|
||||||
reg query HKU\%%# %nul% && set failedload=1
|
reg query HKU\%%# %nul% && set failedtounload=1
|
||||||
)
|
)
|
||||||
|
|
||||||
if defined failedload (
|
if defined failedtoload (
|
||||||
call :dk_color %Gray% "Loading Unloading Registries [Failed for some user accounts]"
|
set error=1
|
||||||
|
call :dk_color %Red% "Loading Unloaded Accounts Registry [Failed for some user accounts]"
|
||||||
|
call :dk_color %Blue% "Reboot your machine using the restart option and try again."
|
||||||
)
|
)
|
||||||
|
|
||||||
if defined faileddef (
|
if defined failedtounload (
|
||||||
call :dk_color %Gray% "Loading Unloading Registries [Failed for Default\NTUSER.DAT]"
|
set error=1
|
||||||
|
call :dk_color %Red% "Unloading Loaded Account Registries [Failed for some user accounts]"
|
||||||
|
call :dk_color %Blue% "Reboot your machine using the restart option and try again."
|
||||||
)
|
)
|
||||||
|
|
||||||
exit /b
|
exit /b
|
||||||
|
@ -3489,12 +3481,12 @@ aaea0dc8-78e1-4343-9f25-b69b83dd1bce_D9GTG-NP7DV-T6JP3-B6B62-JB%f%89R__16_Projec
|
||||||
cbbba2c3-0ff5-4558-846a-043ef9d78559_F4DYN-89BP2-WQTWJ-GR8YC-CK%f%GJG__16_Excel2024Volume_-Excel2024Retail-
|
cbbba2c3-0ff5-4558-846a-043ef9d78559_F4DYN-89BP2-WQTWJ-GR8YC-CK%f%GJG__16_Excel2024Volume_-Excel2024Retail-
|
||||||
bef3152a-8a04-40f2-a065-340c3f23516d_D2F8D-N3Q3B-J28PV-X27HD-RJ%f%WB9__16_Outlook2024Volume_-Outlook2024Retail-
|
bef3152a-8a04-40f2-a065-340c3f23516d_D2F8D-N3Q3B-J28PV-X27HD-RJ%f%WB9__16_Outlook2024Volume_-Outlook2024Retail-
|
||||||
b63626a4-5f05-4ced-9639-31ba730a127e_CW94N-K6GJH-9CTXY-MG2VC-FY%f%CWP__16_PowerPoint2024Volume_-PowerPoint2024Retail-
|
b63626a4-5f05-4ced-9639-31ba730a127e_CW94N-K6GJH-9CTXY-MG2VC-FY%f%CWP__16_PowerPoint2024Volume_-PowerPoint2024Retail-
|
||||||
f510af75-8ab7-4426-a236-1bfb95c34ff8_FQQ23-N4YCY-73HQ3-FM9WC-76%f%HF4__16_ProjectPro2024Volume_-ProjectPro2024Retail-
|
f510af75-8ab7-4426-a236-1bfb95c34ff8_NBBBB-BBBBB-BBBBB-BBBH4-GX%f%3R4__16_ProjectPro2024Volume_-ProjectPro2024Retail-
|
||||||
9f144f27-2ac5-40b9-899d-898c2b8b4f81_PD3TT-NTHQQ-VC7CY-MFXK3-G8%f%7F8__16_ProjectStd2024Volume_-ProjectStd2024Retail-
|
9f144f27-2ac5-40b9-899d-898c2b8b4f81_PD3TT-NTHQQ-VC7CY-MFXK3-G8%f%7F8__16_ProjectStd2024Volume_-ProjectStd2024Retail-
|
||||||
8d368fc1-9470-4be2-8d66-90e836cbb051_XJ2XN-FW8RK-P4HMP-DKDBV-GC%f%VGB__16_ProPlus2024Volume_-ProPlus2024Retail-
|
8d368fc1-9470-4be2-8d66-90e836cbb051_NBBBB-BBBBB-BBBBB-BBBJD-VX%f%RPM__16_ProPlus2024Volume_-ProPlus2024Retail-
|
||||||
0002290a-2091-4324-9e53-3cfe28884cde_4NKHF-9HBQF-Q3B6C-7YV34-F6%f%4P3__16_SkypeforBusiness2024Volume
|
0002290a-2091-4324-9e53-3cfe28884cde_4NKHF-9HBQF-Q3B6C-7YV34-F6%f%4P3__16_SkypeforBusiness2024Volume
|
||||||
bbac904f-6a7e-418a-bb4b-24c85da06187_V28N4-JG22K-W66P8-VTMGK-H6%f%HGR__16_Standard2024Volume_-Home2024Retail-HomeBusiness2024Retail-
|
bbac904f-6a7e-418a-bb4b-24c85da06187_V28N4-JG22K-W66P8-VTMGK-H6%f%HGR__16_Standard2024Volume_-Home2024Retail-HomeBusiness2024Retail-
|
||||||
fa187091-8246-47b1-964f-80a0b1e5d69a_B7TN8-FJ8V3-7QYCP-HQPMV-YY%f%89G__16_VisioPro2024Volume_-VisioPro2024Retail-
|
fa187091-8246-47b1-964f-80a0b1e5d69a_NBBBB-BBBBB-BBBBB-BBBCW-6M%f%X6T__16_VisioPro2024Volume_-VisioPro2024Retail-
|
||||||
923fa470-aa71-4b8b-b35c-36b79bf9f44b_JMMVY-XFNQC-KK4HK-9H7R3-WQ%f%QTV__16_VisioStd2024Volume_-VisioStd2024Retail-
|
923fa470-aa71-4b8b-b35c-36b79bf9f44b_JMMVY-XFNQC-KK4HK-9H7R3-WQ%f%QTV__16_VisioStd2024Volume_-VisioStd2024Retail-
|
||||||
d0eded01-0881-4b37-9738-190400095098_MQ84N-7VYDM-FXV7C-6K7CC-VF%f%W9J__16_Word2024Volume_-Word2024Retail-
|
d0eded01-0881-4b37-9738-190400095098_MQ84N-7VYDM-FXV7C-6K7CC-VF%f%W9J__16_Word2024Volume_-Word2024Retail-
|
||||||
) do (
|
) do (
|
||||||
|
|
|
@ -884,12 +884,10 @@ for %%# in (
|
||||||
for /f "tokens=1-2 delims=_" %%A in ("%%~#") do (
|
for /f "tokens=1-2 delims=_" %%A in ("%%~#") do (
|
||||||
set supported=
|
set supported=
|
||||||
if %winbuild% LSS 10240 (echo %%B | findstr /i "LTSC DevMain" %nul% || set supported=1) else (set supported=1)
|
if %winbuild% LSS 10240 (echo %%B | findstr /i "LTSC DevMain" %nul% || set supported=1) else (set supported=1)
|
||||||
if %winbuild% GEQ 10240 (
|
if %winbuild% GEQ 10240 (if defined ltsc19 echo %%B | findstr /i "LTSC\>" %nul% || set supported=)
|
||||||
if defined ltsc19 echo %%A | findstr /i "2019 VL" %nul% || set supported=
|
if %winbuild% GEQ 10240 (if defined ltsc21 echo %%B | findstr /i "LTSC2021\>" %nul% || set supported=)
|
||||||
if defined ltsc21 echo %%A | findstr /i "2021 VL" %nul% || set supported=
|
if %winbuild% GEQ 10240 (if defined ltsc24 echo %%B | findstr /i "LTSC2024\>" %nul% || set supported=)
|
||||||
if defined ltsc24 echo %%A | findstr /i "2024 VL" %nul% || set supported=
|
if %winbuild% GEQ 10240 (if not defined ltscfound echo %%B | findstr /i "LTSC" %nul% && set supported=)
|
||||||
if not defined ltscfound echo %%B | findstr /i "LTSC" %nul% && set supported=
|
|
||||||
)
|
|
||||||
if defined supported (
|
if defined supported (
|
||||||
set /a counter+=1
|
set /a counter+=1
|
||||||
if !counter! LSS 10 (
|
if !counter! LSS 10 (
|
||||||
|
@ -1059,15 +1057,13 @@ if exist "%_cfolder%\OfficeC2RClient.exe" (
|
||||||
set "_c2rCexe=%_cfolder%\OfficeC2RClient.exe"
|
set "_c2rCexe=%_cfolder%\OfficeC2RClient.exe"
|
||||||
)
|
)
|
||||||
|
|
||||||
set "audidata4=%_AudienceData:~-4%"
|
echo %_AudienceData% | findstr /i "LTSC\>" %nul% && set ltsc19=LTSC
|
||||||
|
|
||||||
if /i "%audidata4%"=="LTSC" set ltsc19=LTSC
|
|
||||||
echo %_clversion% %_version% | findstr "16.0.103 16.0.104 16.0.105" %nul% && set ltsc19=LTSC
|
echo %_clversion% %_version% | findstr "16.0.103 16.0.104 16.0.105" %nul% && set ltsc19=LTSC
|
||||||
|
|
||||||
if /i "%audidata4%"=="2021" set ltsc21=LTSC2021
|
echo %_AudienceData% | findstr /i "LTSC2021\>" %nul% && set ltsc21=LTSC2021
|
||||||
echo %_clversion% %_version% | findstr "16.0.14332" %nul% && set ltsc21=LTSC2021
|
echo %_clversion% %_version% | findstr "16.0.14332" %nul% && set ltsc21=LTSC2021
|
||||||
|
|
||||||
if /i "%audidata4%"=="2024" set ltsc24=LTSC2024
|
echo %_AudienceData% | findstr /i "LTSC2024\>" %nul% && set ltsc24=LTSC2024
|
||||||
:: LTSC 2024 build is not fixed yet
|
:: LTSC 2024 build is not fixed yet
|
||||||
|
|
||||||
if not "%ltsc19%%ltsc21%%ltsc24%"=="" set ltscfound=1
|
if not "%ltsc19%%ltsc21%%ltsc24%"=="" set ltscfound=1
|
||||||
|
|
Loading…
Reference in New Issue