From 1e444671be3b0a53681737b00b09c454894f6999 Mon Sep 17 00:00:00 2001 From: WindowsAddict Date: Sun, 9 Nov 2025 06:03:18 +0530 Subject: [PATCH] Fix KMS4k activation info on 26100.7019 and later --- MAS/All-In-One-Version-KL/MAS_AIO.cmd | 8 ++++++-- .../Activators/TSforge_Activation.cmd | 8 ++++++-- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/MAS/All-In-One-Version-KL/MAS_AIO.cmd b/MAS/All-In-One-Version-KL/MAS_AIO.cmd index 4069d1d..6aaca53 100644 --- a/MAS/All-In-One-Version-KL/MAS_AIO.cmd +++ b/MAS/All-In-One-Version-KL/MAS_AIO.cmd @@ -5891,7 +5891,7 @@ if %_actman%==0 (if not defined showfix call :dk_color %Blue% "%_fixmsg%") set fixes=%fixes% %mas%troubleshoot call :dk_color2 %Blue% "Check this webpage for help - " %_Yellow% " %mas%troubleshoot" ) else ( -if /i %tsmethod%==KMS4k if %winbuild% GEQ 26200 ( +if /i %tsmethod%==KMS4k if %winbuild% GEQ 26100 ( echo: call :dk_color %Gray% "In Windows settings, you may see a renewal notification for activation that can be ignored." if /i %_actmethod%==Auto call :dk_color %Gray% "To avoid this notification, run the script with an internet connection to use the StaticCID method." @@ -11275,6 +11275,7 @@ namespace LibTSforge.PhysicalStore $ErrorActionPreference = 'Stop' $binPath = "$env:_work\BIN\LibTSforge.dll" $psMajorVer = (Get-Host).Version.Major +$build = [System.Environment]::OSVersion.Version.Build if (Test-Path -LiteralPath $binPath) { Write-Host "LibTSforge.dll found in BIN folder. Loading the DLL..." @@ -11373,7 +11374,7 @@ if (-not $env:resetstuff) { } if ($env:tsmethod -eq "KMS4k") { $GracePeriodStatus = Get-WmiInfo -tsactid $tsactid -property "GracePeriodRemaining" - if ($GracePeriodStatus -gt 259200) { $activated = 1 } + if ((($build -ge 26100 -and $GracePeriodStatus -ge 259200) -or ($build -lt 26100 -and $GracePeriodStatus -gt 259200))) { $activated = 1 } } else { $licenseStatus = Get-WmiInfo -tsactid $tsactid -property "LicenseStatus" @@ -11388,6 +11389,9 @@ if (-not $env:resetstuff) { else { if ($env:tsmethod -eq "KMS4k") { Write-Host "[$prodName] is activated till $([DateTime]::Now.AddMinutes($GracePeriodStatus).ToString('yyyy-MM-dd HH:mm:ss')) with $env:tsmethod." -ForegroundColor White -BackgroundColor DarkGreen + if ($build -ge 26100) { + Write-Host "From build 26100.7019, Windows shows 180-day max, but activation lasts over 4,000 years, so it always stays at 180." -ForegroundColor White -BackgroundColor Darkgray + } } else { Write-Host "[$prodName] is permanently activated with $env:tsmethod." -ForegroundColor White -BackgroundColor DarkGreen diff --git a/MAS/Separate-Files-Version/Activators/TSforge_Activation.cmd b/MAS/Separate-Files-Version/Activators/TSforge_Activation.cmd index 12cddfc..8e6d534 100644 --- a/MAS/Separate-Files-Version/Activators/TSforge_Activation.cmd +++ b/MAS/Separate-Files-Version/Activators/TSforge_Activation.cmd @@ -1953,7 +1953,7 @@ if %_actman%==0 (if not defined showfix call :dk_color %Blue% "%_fixmsg%") set fixes=%fixes% %mas%troubleshoot call :dk_color2 %Blue% "Check this webpage for help - " %_Yellow% " %mas%troubleshoot" ) else ( -if /i %tsmethod%==KMS4k if %winbuild% GEQ 26200 ( +if /i %tsmethod%==KMS4k if %winbuild% GEQ 26100 ( echo: call :dk_color %Gray% "In Windows settings, you may see a renewal notification for activation that can be ignored." if /i %_actmethod%==Auto call :dk_color %Gray% "To avoid this notification, run the script with an internet connection to use the StaticCID method." @@ -8848,6 +8848,7 @@ namespace LibTSforge.PhysicalStore $ErrorActionPreference = 'Stop' $binPath = "$env:_work\BIN\LibTSforge.dll" $psMajorVer = (Get-Host).Version.Major +$build = [System.Environment]::OSVersion.Version.Build if (Test-Path -LiteralPath $binPath) { Write-Host "LibTSforge.dll found in BIN folder. Loading the DLL..." @@ -8946,7 +8947,7 @@ if (-not $env:resetstuff) { } if ($env:tsmethod -eq "KMS4k") { $GracePeriodStatus = Get-WmiInfo -tsactid $tsactid -property "GracePeriodRemaining" - if ($GracePeriodStatus -gt 259200) { $activated = 1 } + if ((($build -ge 26100 -and $GracePeriodStatus -ge 259200) -or ($build -lt 26100 -and $GracePeriodStatus -gt 259200))) { $activated = 1 } } else { $licenseStatus = Get-WmiInfo -tsactid $tsactid -property "LicenseStatus" @@ -8961,6 +8962,9 @@ if (-not $env:resetstuff) { else { if ($env:tsmethod -eq "KMS4k") { Write-Host "[$prodName] is activated till $([DateTime]::Now.AddMinutes($GracePeriodStatus).ToString('yyyy-MM-dd HH:mm:ss')) with $env:tsmethod." -ForegroundColor White -BackgroundColor DarkGreen + if ($build -ge 26100) { + Write-Host "From build 26100.7019, Windows shows 180-day max, but activation lasts over 4,000 years, so it always stays at 180." -ForegroundColor White -BackgroundColor Darkgray + } } else { Write-Host "[$prodName] is permanently activated with $env:tsmethod." -ForegroundColor White -BackgroundColor DarkGreen