Compare commits

...

3 Commits

Author SHA1 Message Date
WindowsAddict
ddccc4025f Optimize the code
Thanks to abbodi1406
2024-07-19 21:32:28 +05:30
WindowsAddict
1567903b09 Improve device-based-licensing cleaning 2024-07-19 20:21:27 +05:30
WindowsAddict
f6125eaa5b Add comment about S-1-5-20 SPP registry issue 2024-07-19 20:06:52 +05:30
4 changed files with 10 additions and 6 deletions

View File

@ -1437,6 +1437,8 @@ for %%# in (
if !errorlevel!==2 set permerror=Error_Found if !errorlevel!==2 set permerror=Error_Found
) )
REM https://learn.microsoft.com/office/troubleshoot/activation/license-issue-when-start-office-application
if not defined permerror ( if not defined permerror (
reg query "HKU\S-1-5-20\Software\Microsoft\Windows NT\CurrentVersion" %nul% && ( reg query "HKU\S-1-5-20\Software\Microsoft\Windows NT\CurrentVersion" %nul% && (
set "pol=HKU\S-1-5-20\Software\Microsoft\Windows NT\CurrentVersion\SoftwareProtectionPlatform\Policies" set "pol=HKU\S-1-5-20\Software\Microsoft\Windows NT\CurrentVersion\SoftwareProtectionPlatform\Policies"

View File

@ -1575,6 +1575,8 @@ for %%# in (
if !errorlevel!==2 set permerror=Error_Found if !errorlevel!==2 set permerror=Error_Found
) )
REM https://learn.microsoft.com/office/troubleshoot/activation/license-issue-when-start-office-application
if not defined permerror ( if not defined permerror (
reg query "HKU\S-1-5-20\Software\Microsoft\Windows NT\CurrentVersion" %nul% && ( reg query "HKU\S-1-5-20\Software\Microsoft\Windows NT\CurrentVersion" %nul% && (
set "pol=HKU\S-1-5-20\Software\Microsoft\Windows NT\CurrentVersion\SoftwareProtectionPlatform\Policies" set "pol=HKU\S-1-5-20\Software\Microsoft\Windows NT\CurrentVersion\SoftwareProtectionPlatform\Policies"

View File

@ -1170,9 +1170,7 @@ reg delete HKLM\SOFTWARE\Microsoft\Office\15.0\ClickToRun\Configuration /v Share
:: Clear device-based-licensing :: Clear device-based-licensing
:: https://learn.microsoft.com/deployoffice/device-based-licensing :: https://learn.microsoft.com/deployoffice/device-based-licensing
for %%# in (%_o16c2rIds%) do ( for /f %%# in ('reg query "%o16c2r_reg%\Configuration" /f *.DeviceBasedLicensing %nul6% ^| findstr REG_') do reg delete "%o16c2r_reg%\Configuration" /v %%# /f %nul%
reg delete %o16c2r_reg%\Configuration /v %%#.DeviceBasedLicensing /f %nul%
)
:: Remove OEM registry key :: Remove OEM registry key
:: https://support.microsoft.com/office/office-repeatedly-prompts-you-to-activate-on-a-new-pc-a9a6b05f-f6ce-4d1f-8d49-eb5007b64ba1 :: https://support.microsoft.com/office/office-repeatedly-prompts-you-to-activate-on-a-new-pc-a9a6b05f-f6ce-4d1f-8d49-eb5007b64ba1
@ -1887,6 +1885,8 @@ for %%# in (
if !errorlevel!==2 set permerror=Error_Found if !errorlevel!==2 set permerror=Error_Found
) )
REM https://learn.microsoft.com/office/troubleshoot/activation/license-issue-when-start-office-application
if not defined permerror ( if not defined permerror (
reg query "HKU\S-1-5-20\Software\Microsoft\Windows NT\CurrentVersion" %nul% && ( reg query "HKU\S-1-5-20\Software\Microsoft\Windows NT\CurrentVersion" %nul% && (
set "pol=HKU\S-1-5-20\Software\Microsoft\Windows NT\CurrentVersion\SoftwareProtectionPlatform\Policies" set "pol=HKU\S-1-5-20\Software\Microsoft\Windows NT\CurrentVersion\SoftwareProtectionPlatform\Policies"

View File

@ -1226,9 +1226,7 @@ reg delete HKLM\SOFTWARE\Microsoft\Office\15.0\ClickToRun\Configuration /v Share
:: Clear device-based-licensing :: Clear device-based-licensing
:: https://learn.microsoft.com/deployoffice/device-based-licensing :: https://learn.microsoft.com/deployoffice/device-based-licensing
for %%# in (%_o16c2rIds%) do ( for /f %%# in ('reg query "%o16c2r_reg%\Configuration" /f *.DeviceBasedLicensing %nul6% ^| findstr REG_') do reg delete "%o16c2r_reg%\Configuration" /v %%# /f %nul%
reg delete %o16c2r_reg%\Configuration /v %%#.DeviceBasedLicensing /f %nul%
)
:: Remove OEM registry key :: Remove OEM registry key
:: https://support.microsoft.com/office/office-repeatedly-prompts-you-to-activate-on-a-new-pc-a9a6b05f-f6ce-4d1f-8d49-eb5007b64ba1 :: https://support.microsoft.com/office/office-repeatedly-prompts-you-to-activate-on-a-new-pc-a9a6b05f-f6ce-4d1f-8d49-eb5007b64ba1
@ -2888,6 +2886,8 @@ for %%# in (
if !errorlevel!==2 set permerror=Error_Found if !errorlevel!==2 set permerror=Error_Found
) )
REM https://learn.microsoft.com/office/troubleshoot/activation/license-issue-when-start-office-application
if not defined permerror ( if not defined permerror (
reg query "HKU\S-1-5-20\Software\Microsoft\Windows NT\CurrentVersion" %nul% && ( reg query "HKU\S-1-5-20\Software\Microsoft\Windows NT\CurrentVersion" %nul% && (
set "pol=HKU\S-1-5-20\Software\Microsoft\Windows NT\CurrentVersion\SoftwareProtectionPlatform\Policies" set "pol=HKU\S-1-5-20\Software\Microsoft\Windows NT\CurrentVersion\SoftwareProtectionPlatform\Policies"