From 1567903b090343fa5802918a742d59fe0f46bae9 Mon Sep 17 00:00:00 2001 From: WindowsAddict Date: Fri, 19 Jul 2024 20:21:27 +0530 Subject: [PATCH] Improve device-based-licensing cleaning --- .../Activators/Ohook_Activation_AIO.cmd | 6 ++++-- .../Activators/Online_KMS_Activation.cmd | 6 ++++-- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/MAS/Separate-Files-Version/Activators/Ohook_Activation_AIO.cmd b/MAS/Separate-Files-Version/Activators/Ohook_Activation_AIO.cmd index 18502c5..b2b5de6 100644 --- a/MAS/Separate-Files-Version/Activators/Ohook_Activation_AIO.cmd +++ b/MAS/Separate-Files-Version/Activators/Ohook_Activation_AIO.cmd @@ -1170,8 +1170,10 @@ reg delete HKLM\SOFTWARE\Microsoft\Office\15.0\ClickToRun\Configuration /v Share :: Clear device-based-licensing :: https://learn.microsoft.com/deployoffice/device-based-licensing -for %%# in (%_o16c2rIds%) do ( -reg delete %o16c2r_reg%\Configuration /v %%#.DeviceBasedLicensing /f %nul% +if defined _o16c2rIds ( +for /f "tokens=1 delims= " %%A in ('reg query "%o16c2r_reg%\Configuration" %nul6%') do ( +echo %%A | find /i ".DeviceBasedLicensing" %nul% && reg delete "%o16c2r_reg%\Configuration" /v "%%A" /f %nul% +) ) :: Remove OEM registry key diff --git a/MAS/Separate-Files-Version/Activators/Online_KMS_Activation.cmd b/MAS/Separate-Files-Version/Activators/Online_KMS_Activation.cmd index 3744710..c2fb55b 100644 --- a/MAS/Separate-Files-Version/Activators/Online_KMS_Activation.cmd +++ b/MAS/Separate-Files-Version/Activators/Online_KMS_Activation.cmd @@ -1226,8 +1226,10 @@ reg delete HKLM\SOFTWARE\Microsoft\Office\15.0\ClickToRun\Configuration /v Share :: Clear device-based-licensing :: https://learn.microsoft.com/deployoffice/device-based-licensing -for %%# in (%_o16c2rIds%) do ( -reg delete %o16c2r_reg%\Configuration /v %%#.DeviceBasedLicensing /f %nul% +if defined _o16c2rIds ( +for /f "tokens=1 delims= " %%A in ('reg query "%o16c2r_reg%\Configuration" %nul6%') do ( +echo %%A | find /i ".DeviceBasedLicensing" %nul% && reg delete "%o16c2r_reg%\Configuration" /v "%%A" /f %nul% +) ) :: Remove OEM registry key