summaryrefslogtreecommitdiff
path: root/MAS/Separate-Files-Version/Activators/TSforge_Activation.cmd
diff options
context:
space:
mode:
authorWindowsAddict <[email protected]>2025-04-21 18:01:09 +0530
committerWindowsAddict <[email protected]>2025-04-21 18:01:09 +0530
commit5090cde0a04698521979d48f28f670827a69d74e (patch)
tree50887ff7a8f48b3570c267e968ee6089d721bcf6 /MAS/Separate-Files-Version/Activators/TSforge_Activation.cmd
parentaf18bd773c1b4bb4dd1c4e055ab154cccfa7782f (diff)
downloadMicrosoft-Activation-Scripts-5090cde0a04698521979d48f28f670827a69d74e.zip
Use wmic.exe on builds below 9200
Diffstat (limited to 'MAS/Separate-Files-Version/Activators/TSforge_Activation.cmd')
-rw-r--r--MAS/Separate-Files-Version/Activators/TSforge_Activation.cmd7
1 files changed, 4 insertions, 3 deletions
diff --git a/MAS/Separate-Files-Version/Activators/TSforge_Activation.cmd b/MAS/Separate-Files-Version/Activators/TSforge_Activation.cmd
index 9c64be6..b4effe7 100644
--- a/MAS/Separate-Files-Version/Activators/TSforge_Activation.cmd
+++ b/MAS/Separate-Files-Version/Activators/TSforge_Activation.cmd
@@ -2400,6 +2400,7 @@ function ReinstallLicenses() {
:dk_ckeckwmic
+if %winbuild% LSS 9200 (set _wmic=1&exit /b)
set _wmic=0
for %%# in (wmic.exe) do @if not "%%~$PATH:#"=="" (
cmd /c "wmic path Win32_ComputerSystem get CreationClassName /value" %nul2% | find /i "computersystem" %nul1% && set _wmic=1
@@ -2712,8 +2713,8 @@ call :dk_color %Red% "Checking Package Files [Not Found] [%osed
)
)
-
-%psc% "try { $null=([WMISEARCHER]'SELECT * FROM %sps%').Get().Version; exit 0 } catch { exit $_.Exception.InnerException.HResult }" %nul%
+if %_wmic% EQU 1 wmic path %sps% get Version %nul%
+if %_wmic% EQU 0 %psc% "try { $null=([WMISEARCHER]'SELECT * FROM %sps%').Get().Version; exit 0 } catch { exit $_.Exception.InnerException.HResult }" %nul%
set error_code=%errorlevel%
cmd /c exit /b %error_code%
if %error_code% NEQ 0 set "error_code=0x%=ExitCode%"
@@ -2850,7 +2851,7 @@ set showfix=1
if not defined notwinact (
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=[io.file]::ReadAllText('!_batp!') -split ':xrm\:.*';iex ($f[1]); ReinstallLicenses"
+%psc% "if (-not $env:_vis) {Start-Job { Stop-Service %_slser% -force } | Wait-Job -Timeout 20 | Out-Null}; $sls = Get-WmiObject SoftwareLicensingService; $f=[io.file]::ReadAllText('!_batp!') -split ':xrm\:.*';iex ($f[1]); ReinstallLicenses" %nul%
call :dk_actid 55c92734-d682-4d71-983e-d6ec3f16059f
if not defined apps (
set "_notfoundids=Key Not Installed / Act ID Not Found"