mirror of
https://github.com/massgravel/Microsoft-Activation-Scripts.git
synced 2025-06-20 03:07:01 -04:00
Use wmic.exe on builds below 9200
This commit is contained in:
parent
af18bd773c
commit
5090cde0a0
8 changed files with 23 additions and 20 deletions
|
@ -718,12 +718,6 @@ set "_xmlexist=if exist "%tdir%\GenuineTicket.xml""
|
|||
|
||||
%psc% "Start-Job { Stop-Service sppsvc -force } | Wait-Job -Timeout 20 | Out-Null"
|
||||
|
||||
sc query sppsvc | find /i "STOPPED" %nul% && (
|
||||
echo Stopping sppsvc Service [Successful]
|
||||
) || (
|
||||
call :dk_color %Gray% "Stopping sppsvc Service [Failed]"
|
||||
)
|
||||
|
||||
%_xmlexist% (
|
||||
%psc% "Start-Job { Restart-Service ClipSVC } | Wait-Job -Timeout 20 | Out-Null"
|
||||
%_xmlexist% timeout /t 2 %nul%
|
||||
|
@ -1176,6 +1170,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
|
||||
|
@ -1534,7 +1529,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%"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue