%psc%"$job = Start-Job { (Get-WmiObject -Query 'SELECT * FROM %sps%').Version }; if (-not (Wait-Job $job -Timeout 30)) {write-host 'sppsvc is not working correctly. Check this webpage for help - %mas%troubleshoot'}"
%psc%"$job = Start-Job { (Get-WmiObject -Query 'SELECT * FROM %sps%').Version }; if (-not (Wait-Job $job -Timeout 30)) {write-host '%_slser% is not working correctly. Check this webpage for help - %mas%troubleshoot'}"
exit /b
:: Get Product name (WMI/REG methods are not reliable in all conditions, hence winbrand.dll method is used)
@ -1383,6 +1408,10 @@ if %winbuild% GEQ 22000 (
@@ -1383,6 +1408,10 @@ if %winbuild% GEQ 22000 (
setwinos=!winos:Windows 10=Windows 11!
)
)
if%winbuild%LSS 7600 (
set"winos=!winos:VistaT=Vista!"
set"winos=!winos:Serverr=Server!"
)
ifnotdefinedwinsubexit /b
@ -1429,11 +1458,11 @@ for %%# in (avira.com kaspersky.com virustotal.com mcafee.com) do (
@@ -1429,11 +1458,11 @@ for %%# in (avira.com kaspersky.com virustotal.com mcafee.com) do (
@ -1724,7 +1754,7 @@ call :dk_color2 %Blue% "In case of activation issues, do this - " %_Yellow% " %m
@@ -1724,7 +1754,7 @@ call :dk_color2 %Blue% "In case of activation issues, do this - " %_Yellow% " %m
%psc%"Get-WmiObject -Query 'SELECT Name, Description FROM SoftwareLicensingProduct WHERE LicenseStatus=''1'' AND GracePeriodRemaining=''0'' AND PartialProductKey IS NOT NULL AND LicenseDependsOn IS NULL' | Where-Object { $_.Description -notmatch 'KMS_' } | Select-Object -Property Name"%nul2%| findstr /i "Windows"%nul1%&&set_perm=1||set_perm=
%psc%"Get-WmiObject -Query 'SELECT Name, Description FROM SoftwareLicensingProduct WHERE LicenseStatus=''1'' AND GracePeriodRemaining=''0'' AND PartialProductKey IS NOT NULL AND LicenseDependsOn IS NULL' | Where-Object { $_.Description -notmatch 'KMS' } | Select-Object -Property Name"%nul2%| findstr /i "Windows"%nul1%&&set_perm=1||set_perm=
exit /b
:: Install Key
:ts_inskey
if%_wmic%EQU 1 wmic path %sps% where __CLASS='%sps%' call InstallProductKey ProductKey="%key%"%nul%
if%_wmic%EQU 0 %psc%"try { $null=(([WMISEARCHER]'SELECT Version FROM %sps%').Get()).InstallProductKey('%key%'); exit 0 } catch { exit $_.Exception.InnerException.HResult }"%nul%
if%_wmic%EQU 1 set"chkapp=for /f "tokens=2 delims=="%%a in ('"wmic path %slp% where (ApplicationID='%_wApp%') get ID /VALUE" 2^>nul')"
if%_wmic%EQU 0 set"chkapp=for /f "tokens=2 delims=="%%a in ('%psc%"(([WMISEARCHER]'SELECT ID FROM %slp% WHERE ApplicationID=''%_wApp%''').Get()).ID ^|%% {echo ('ID='+$_)}" 2^>nul')"
%chkapp% do (if defined applist (call set "applist=!applist! %%a") else (call set "applist=%%a"))
@ -12669,10 +12899,11 @@ for /f %%G in ('%psc% "[Guid]::NewGuid().Guid"') do set "randguid=%%G"
@@ -12669,10 +12899,11 @@ for /f %%G in ('%psc% "[Guid]::NewGuid().Guid"') do set "randguid=%%G"
%psc%"$job = Start-Job { (Get-WmiObject -Query 'SELECT * FROM %sps%').Version }; if (-not (Wait-Job $job -Timeout 30)) {write-host 'sppsvc is not working correctly. Check this webpage for help - %mas%troubleshoot'}"
%psc%"$job = Start-Job { (Get-WmiObject -Query 'SELECT * FROM %sps%').Version }; if (-not (Wait-Job $job -Timeout 30)) {write-host '%_slser% is not working correctly. Check this webpage for help - %mas%troubleshoot'}"
exit /b
:: Get Product name (WMI/REG methods are not reliable in all conditions, hence winbrand.dll method is used)
@ -1098,6 +1106,10 @@ if %winbuild% GEQ 22000 (
@@ -1098,6 +1106,10 @@ if %winbuild% GEQ 22000 (
setwinos=!winos:Windows 10=Windows 11!
)
)
if%winbuild%LSS 7600 (
set"winos=!winos:VistaT=Vista!"
set"winos=!winos:Serverr=Server!"
)
ifnotdefinedwinsubexit /b
@ -1144,11 +1156,11 @@ for %%# in (avira.com kaspersky.com virustotal.com mcafee.com) do (
@@ -1144,11 +1156,11 @@ for %%# in (avira.com kaspersky.com virustotal.com mcafee.com) do (
@ -1439,7 +1452,7 @@ call :dk_color2 %Blue% "In case of activation issues, do this - " %_Yellow% " %m
@@ -1439,7 +1452,7 @@ call :dk_color2 %Blue% "In case of activation issues, do this - " %_Yellow% " %m
%psc%"$job = Start-Job { (Get-WmiObject -Query 'SELECT * FROM %sps%').Version }; if (-not (Wait-Job $job -Timeout 30)) {write-host 'sppsvc is not working correctly. Check this webpage for help - %mas%troubleshoot'}"
%psc%"$job = Start-Job { (Get-WmiObject -Query 'SELECT * FROM %sps%').Version }; if (-not (Wait-Job $job -Timeout 30)) {write-host '%_slser% is not working correctly. Check this webpage for help - %mas%troubleshoot'}"
exit /b
:: Get Product name (WMI/REG methods are not reliable in all conditions, hence winbrand.dll method is used)
@ -1202,6 +1210,10 @@ if %winbuild% GEQ 22000 (
@@ -1202,6 +1210,10 @@ if %winbuild% GEQ 22000 (
setwinos=!winos:Windows 10=Windows 11!
)
)
if%winbuild%LSS 7600 (
set"winos=!winos:VistaT=Vista!"
set"winos=!winos:Serverr=Server!"
)
ifnotdefinedwinsubexit /b
@ -1293,11 +1305,11 @@ for %%# in (avira.com kaspersky.com virustotal.com mcafee.com) do (
@@ -1293,11 +1305,11 @@ for %%# in (avira.com kaspersky.com virustotal.com mcafee.com) do (
@ -1588,7 +1601,7 @@ call :dk_color2 %Blue% "In case of activation issues, do this - " %_Yellow% " %m
@@ -1588,7 +1601,7 @@ call :dk_color2 %Blue% "In case of activation issues, do this - " %_Yellow% " %m
%psc%"$job = Start-Job { (Get-WmiObject -Query 'SELECT * FROM %sps%').Version }; if (-not (Wait-Job $job -Timeout 30)) {write-host 'sppsvc is not working correctly. Check this webpage for help - %mas%troubleshoot'}"
%psc%"$job = Start-Job { (Get-WmiObject -Query 'SELECT * FROM %sps%').Version }; if (-not (Wait-Job $job -Timeout 30)) {write-host '%_slser% is not working correctly. Check this webpage for help - %mas%troubleshoot'}"
exit /b
:: Get Product name (WMI/REG methods are not reliable in all conditions, hence winbrand.dll method is used)
@ -1523,6 +1529,11 @@ if %winbuild% GEQ 22000 (
@@ -1523,6 +1529,11 @@ if %winbuild% GEQ 22000 (
setwinos=!winos:Windows 10=Windows 11!
)
)
if%winbuild%LSS 7600 (
set"winos=!winos:VistaT=Vista!"
set"winos=!winos:Serverr=Server!"
)
exit /b
:: Common lines used in PowerShell reflection code
@ -1553,11 +1564,11 @@ for %%# in (avira.com kaspersky.com virustotal.com mcafee.com) do (
@@ -1553,11 +1564,11 @@ for %%# in (avira.com kaspersky.com virustotal.com mcafee.com) do (
@ -1848,7 +1860,7 @@ call :dk_color2 %Blue% "In case of activation issues, do this - " %_Yellow% " %m
@@ -1848,7 +1860,7 @@ call :dk_color2 %Blue% "In case of activation issues, do this - " %_Yellow% " %m
if%_wmic%EQU 1 set"chkapp=for /f "tokens=2 delims=="%%a in ('"wmic path %slp% where (ApplicationID='%_wApp%') get ID /VALUE" 2^>nul')"
if%_wmic%EQU 0 set"chkapp=for /f "tokens=2 delims=="%%a in ('%psc%"(([WMISEARCHER]'SELECT ID FROM %slp% WHERE ApplicationID=''%_wApp%''').Get()).ID ^|%% {echo ('ID='+$_)}" 2^>nul')"
%chkapp% do (if defined applist (call set "applist=!applist! %%a") else (call set "applist=%%a"))
@ -2134,10 +2166,11 @@ for /f %%G in ('%psc% "[Guid]::NewGuid().Guid"') do set "randguid=%%G"
@@ -2134,10 +2166,11 @@ for /f %%G in ('%psc% "[Guid]::NewGuid().Guid"') do set "randguid=%%G"
%psc%"$job = Start-Job { (Get-WmiObject -Query 'SELECT * FROM %sps%').Version }; if (-not (Wait-Job $job -Timeout 30)) {write-host 'sppsvc is not working correctly. Check this webpage for help - %mas%troubleshoot'}"
%psc%"$job = Start-Job { (Get-WmiObject -Query 'SELECT * FROM %sps%').Version }; if (-not (Wait-Job $job -Timeout 30)) {write-host '%_slser% is not working correctly. Check this webpage for help - %mas%troubleshoot'}"
exit /b
:: Get Product name (WMI/REG methods are not reliable in all conditions, hence winbrand.dll method is used)
@ -2617,6 +2773,10 @@ if %winbuild% GEQ 22000 (
@@ -2617,6 +2773,10 @@ if %winbuild% GEQ 22000 (
setwinos=!winos:Windows 10=Windows 11!
)
)
if%winbuild%LSS 7600 (
set"winos=!winos:VistaT=Vista!"
set"winos=!winos:Serverr=Server!"
)
ifnotdefinedwinsubexit /b
@ -2708,11 +2868,11 @@ for %%# in (avira.com kaspersky.com virustotal.com mcafee.com) do (
@@ -2708,11 +2868,11 @@ for %%# in (avira.com kaspersky.com virustotal.com mcafee.com) do (
@ -3003,7 +3164,7 @@ call :dk_color2 %Blue% "In case of activation issues, do this - " %_Yellow% " %m
@@ -3003,7 +3164,7 @@ call :dk_color2 %Blue% "In case of activation issues, do this - " %_Yellow% " %m
@ -2090,7 +2270,7 @@ if ($r -eq 0) {
@@ -2090,7 +2270,7 @@ if ($r -eq 0) {
:ts_checkwinperm
%psc%"Get-WmiObject -Query 'SELECT Name, Description FROM SoftwareLicensingProduct WHERE LicenseStatus=''1'' AND GracePeriodRemaining=''0'' AND PartialProductKey IS NOT NULL AND LicenseDependsOn IS NULL' | Where-Object { $_.Description -notmatch 'KMS_' } | Select-Object -Property Name"%nul2%| findstr /i "Windows"%nul1%&&set_perm=1||set_perm=
%psc%"Get-WmiObject -Query 'SELECT Name, Description FROM SoftwareLicensingProduct WHERE LicenseStatus=''1'' AND GracePeriodRemaining=''0'' AND PartialProductKey IS NOT NULL AND LicenseDependsOn IS NULL' | Where-Object { $_.Description -notmatch 'KMS' } | Select-Object -Property Name"%nul2%| findstr /i "Windows"%nul1%&&set_perm=1||set_perm=
exit /b
:: Refresh license status
@ -2101,6 +2281,27 @@ if %_wmic% EQU 1 wmic path %sps% where __CLASS='%sps%' call RefreshLicenseStatus
@@ -2101,6 +2281,27 @@ if %_wmic% EQU 1 wmic path %sps% where __CLASS='%sps%' call RefreshLicenseStatus
%psc%"$job = Start-Job { (Get-WmiObject -Query 'SELECT * FROM %sps%').Version }; if (-not (Wait-Job $job -Timeout 30)) {write-host 'sppsvc is not working correctly. Check this webpage for help - %mas%troubleshoot'}"
%psc%"$job = Start-Job { (Get-WmiObject -Query 'SELECT * FROM %sps%').Version }; if (-not (Wait-Job $job -Timeout 30)) {write-host '%_slser% is not working correctly. Check this webpage for help - %mas%troubleshoot'}"
exit /b
:: Get Product name (WMI/REG methods are not reliable in all conditions, hence winbrand.dll method is used)
@ -2231,6 +2434,10 @@ if %winbuild% GEQ 22000 (
@@ -2231,6 +2434,10 @@ if %winbuild% GEQ 22000 (
setwinos=!winos:Windows 10=Windows 11!
)
)
if%winbuild%LSS 7600 (
set"winos=!winos:VistaT=Vista!"
set"winos=!winos:Serverr=Server!"
)
ifnotdefinedwinsubexit /b
@ -2277,11 +2484,11 @@ for %%# in (avira.com kaspersky.com virustotal.com mcafee.com) do (
@@ -2277,11 +2484,11 @@ for %%# in (avira.com kaspersky.com virustotal.com mcafee.com) do (
@ -2572,7 +2780,7 @@ call :dk_color2 %Blue% "In case of activation issues, do this - " %_Yellow% " %m
@@ -2572,7 +2780,7 @@ call :dk_color2 %Blue% "In case of activation issues, do this - " %_Yellow% " %m
%psc%"$job = Start-Job { (Get-WmiObject -Query 'SELECT * FROM %sps%').Version }; if (-not (Wait-Job $job -Timeout 30)) {write-host 'sppsvc is not working correctly. Check this webpage for help - %mas%troubleshoot'}"
%psc%"$job = Start-Job { (Get-WmiObject -Query 'SELECT * FROM %sps%').Version }; if (-not (Wait-Job $job -Timeout 30)) {write-host '%_slser% is not working correctly. Check this webpage for help - %mas%troubleshoot'}"
exit /b
:: Common lines used in PowerShell reflection code
%psc%"$job = Start-Job { (Get-WmiObject -Query 'SELECT * FROM %sps%').Version }; if (-not (Wait-Job $job -Timeout 30)) {write-host 'sppsvc is not working correctly. Check this webpage for help - %mas%troubleshoot'}"
%psc%"$job = Start-Job { (Get-WmiObject -Query 'SELECT * FROM %sps%').Version }; if (-not (Wait-Job $job -Timeout 30)) {write-host '%_slser% is not working correctly. Check this webpage for help - %mas%troubleshoot'}"
exit /b
:: Common lines used in PowerShell reflection code