From e6eaeaa682caa17d98f537638b2e3df96210bbfb Mon Sep 17 00:00:00 2001 From: WindowsAddict Date: Thu, 7 Aug 2025 01:50:09 +0530 Subject: [PATCH] Detect vnext license and show info --- MAS/All-In-One-Version-KL/MAS_AIO.cmd | 22 ++++++++++++++++++- .../Activators/HWID_Activation.cmd | 8 +++++++ .../Activators/KMS38_Activation.cmd | 8 +++++++ .../Activators/Ohook_Activation_AIO.cmd | 22 ++++++++++++++++++- .../Activators/Online_KMS_Activation.cmd | 20 +++++++++++++++++ .../Activators/TSforge_Activation.cmd | 20 +++++++++++++++++ 6 files changed, 98 insertions(+), 2 deletions(-) diff --git a/MAS/All-In-One-Version-KL/MAS_AIO.cmd b/MAS/All-In-One-Version-KL/MAS_AIO.cmd index 4d9766f..d6d8b5a 100644 --- a/MAS/All-In-One-Version-KL/MAS_AIO.cmd +++ b/MAS/All-In-One-Version-KL/MAS_AIO.cmd @@ -2003,6 +2003,7 @@ call :dk_actid 55c92734-d682-4d71-983e-d6ec3f16059f 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% +if not defined _vis if !errorlevel! NEQ 0 set rlicfailed=1 call :dk_actid 55c92734-d682-4d71-983e-d6ec3f16059f ) @@ -2024,6 +2025,13 @@ set error=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" ( call :dk_color %Red% "Checking SPP tokens.dat [Not Found] [%tokenstore%\]" ) @@ -2796,7 +2804,7 @@ if defined ohub call :dk_color %Gray% "Office apps such as Word, Excel are activ echo Help: %mas%troubleshoot ) else ( call :dk_color %Red% "Some errors were detected." -if not defined ierror if not defined showfix if not defined serv_cor if not defined serv_cste call :dk_color %Blue% "%_fixmsg%" +if not defined ierror if not defined showfix call :dk_color %Blue% "%_fixmsg%" echo: set fixes=%fixes% %mas%troubleshoot call :dk_color2 %Blue% "Check this webpage for help - " %_Yellow% " %mas%troubleshoot" @@ -3501,10 +3509,12 @@ call :dk_color %Gray% "Checking Total User Accounts [%counter%]" :: Clear the vNext/shared/device license blocks which may prevent ohook activation +set vnextexist= rmdir /s /q "%ProgramData%\Microsoft\Office\Licenses\" %nul% for %%x in (15 16) 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% for /f "skip=2 tokens=2*" %%a in ('"reg query "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\ProfileList\%%#" /v ProfileImagePath" %nul6%') do ( @@ -3527,6 +3537,7 @@ 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" ( set defname=DEFTEMP-%%# 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 unload HKU\!defname! %nul% ) @@ -3534,6 +3545,15 @@ 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 :: https://learn.microsoft.com/en-us/deployoffice/overview-shared-computer-activation diff --git a/MAS/Separate-Files-Version/Activators/HWID_Activation.cmd b/MAS/Separate-Files-Version/Activators/HWID_Activation.cmd index bfee7df..456b06f 100644 --- a/MAS/Separate-Files-Version/Activators/HWID_Activation.cmd +++ b/MAS/Separate-Files-Version/Activators/HWID_Activation.cmd @@ -1687,6 +1687,7 @@ call :dk_actid 55c92734-d682-4d71-983e-d6ec3f16059f 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% +if not defined _vis if !errorlevel! NEQ 0 set rlicfailed=1 call :dk_actid 55c92734-d682-4d71-983e-d6ec3f16059f ) @@ -1708,6 +1709,13 @@ set error=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" ( call :dk_color %Red% "Checking SPP tokens.dat [Not Found] [%tokenstore%\]" ) diff --git a/MAS/Separate-Files-Version/Activators/KMS38_Activation.cmd b/MAS/Separate-Files-Version/Activators/KMS38_Activation.cmd index 51c9913..816834d 100644 --- a/MAS/Separate-Files-Version/Activators/KMS38_Activation.cmd +++ b/MAS/Separate-Files-Version/Activators/KMS38_Activation.cmd @@ -1772,6 +1772,7 @@ call :dk_actid 55c92734-d682-4d71-983e-d6ec3f16059f 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% +if not defined _vis if !errorlevel! NEQ 0 set rlicfailed=1 call :dk_actid 55c92734-d682-4d71-983e-d6ec3f16059f ) @@ -1793,6 +1794,13 @@ set error=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" ( call :dk_color %Red% "Checking SPP tokens.dat [Not Found] [%tokenstore%\]" ) diff --git a/MAS/Separate-Files-Version/Activators/Ohook_Activation_AIO.cmd b/MAS/Separate-Files-Version/Activators/Ohook_Activation_AIO.cmd index e47fdf0..fda8cc7 100644 --- a/MAS/Separate-Files-Version/Activators/Ohook_Activation_AIO.cmd +++ b/MAS/Separate-Files-Version/Activators/Ohook_Activation_AIO.cmd @@ -769,7 +769,7 @@ if defined ohub call :dk_color %Gray% "Office apps such as Word, Excel are activ echo Help: %mas%troubleshoot ) else ( call :dk_color %Red% "Some errors were detected." -if not defined ierror if not defined showfix if not defined serv_cor if not defined serv_cste call :dk_color %Blue% "%_fixmsg%" +if not defined ierror if not defined showfix call :dk_color %Blue% "%_fixmsg%" echo: set fixes=%fixes% %mas%troubleshoot call :dk_color2 %Blue% "Check this webpage for help - " %_Yellow% " %mas%troubleshoot" @@ -1474,10 +1474,12 @@ call :dk_color %Gray% "Checking Total User Accounts [%counter%]" :: Clear the vNext/shared/device license blocks which may prevent ohook activation +set vnextexist= rmdir /s /q "%ProgramData%\Microsoft\Office\Licenses\" %nul% for %%x in (15 16) 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% for /f "skip=2 tokens=2*" %%a in ('"reg query "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\ProfileList\%%#" /v ProfileImagePath" %nul6%') do ( @@ -1500,6 +1502,7 @@ 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" ( set defname=DEFTEMP-%%# 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 unload HKU\!defname! %nul% ) @@ -1507,6 +1510,15 @@ 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 :: https://learn.microsoft.com/en-us/deployoffice/overview-shared-computer-activation @@ -2361,6 +2373,7 @@ call :dk_actid 55c92734-d682-4d71-983e-d6ec3f16059f 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% +if not defined _vis if !errorlevel! NEQ 0 set rlicfailed=1 call :dk_actid 55c92734-d682-4d71-983e-d6ec3f16059f ) @@ -2382,6 +2395,13 @@ set error=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" ( call :dk_color %Red% "Checking SPP tokens.dat [Not Found] [%tokenstore%\]" ) diff --git a/MAS/Separate-Files-Version/Activators/Online_KMS_Activation.cmd b/MAS/Separate-Files-Version/Activators/Online_KMS_Activation.cmd index 5023fe3..8f7845f 100644 --- a/MAS/Separate-Files-Version/Activators/Online_KMS_Activation.cmd +++ b/MAS/Separate-Files-Version/Activators/Online_KMS_Activation.cmd @@ -1452,10 +1452,12 @@ call :dk_color %Gray% "Checking Total User Accounts [%counter%]" :: Clear the vNext/shared/device license blocks which may prevent ohook activation +set vnextexist= rmdir /s /q "%ProgramData%\Microsoft\Office\Licenses\" %nul% for %%x in (15 16) 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% for /f "skip=2 tokens=2*" %%a in ('"reg query "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\ProfileList\%%#" /v ProfileImagePath" %nul6%') do ( @@ -1478,6 +1480,7 @@ 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" ( set defname=DEFTEMP-%%# 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 unload HKU\!defname! %nul% ) @@ -1485,6 +1488,15 @@ 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 :: https://learn.microsoft.com/en-us/deployoffice/overview-shared-computer-activation @@ -3424,6 +3436,7 @@ call :dk_actid 55c92734-d682-4d71-983e-d6ec3f16059f 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% +if not defined _vis if !errorlevel! NEQ 0 set rlicfailed=1 call :dk_actid 55c92734-d682-4d71-983e-d6ec3f16059f ) @@ -3445,6 +3458,13 @@ set error=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" ( call :dk_color %Red% "Checking SPP tokens.dat [Not Found] [%tokenstore%\]" ) diff --git a/MAS/Separate-Files-Version/Activators/TSforge_Activation.cmd b/MAS/Separate-Files-Version/Activators/TSforge_Activation.cmd index d061761..d64fc57 100644 --- a/MAS/Separate-Files-Version/Activators/TSforge_Activation.cmd +++ b/MAS/Separate-Files-Version/Activators/TSforge_Activation.cmd @@ -2411,10 +2411,12 @@ call :dk_color %Gray% "Checking Total User Accounts [%counter%]" :: Clear the vNext/shared/device license blocks which may prevent ohook activation +set vnextexist= rmdir /s /q "%ProgramData%\Microsoft\Office\Licenses\" %nul% for %%x in (15 16) 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% for /f "skip=2 tokens=2*" %%a in ('"reg query "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\ProfileList\%%#" /v ProfileImagePath" %nul6%') do ( @@ -2437,6 +2439,7 @@ 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" ( set defname=DEFTEMP-%%# 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 unload HKU\!defname! %nul% ) @@ -2444,6 +2447,15 @@ 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 :: https://learn.microsoft.com/en-us/deployoffice/overview-shared-computer-activation @@ -3430,6 +3442,7 @@ call :dk_actid 55c92734-d682-4d71-983e-d6ec3f16059f 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% +if not defined _vis if !errorlevel! NEQ 0 set rlicfailed=1 call :dk_actid 55c92734-d682-4d71-983e-d6ec3f16059f ) @@ -3451,6 +3464,13 @@ set error=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" ( call :dk_color %Red% "Checking SPP tokens.dat [Not Found] [%tokenstore%\]" )