Delphi-PRAXiS
Seite 2 von 2     12   

Delphi-PRAXiS (https://www.delphipraxis.net/forum.php)
-   Programmieren allgemein (https://www.delphipraxis.net/40-programmieren-allgemein/)
-   -   Delphi "WinSat.exe formal" mit Delphi (https://www.delphipraxis.net/197907-winsat-exe-formal-mit-delphi.html)

THY4243 18. Sep 2018 18:52

AW: "WinSat.exe formal" mit Delphi
 
Ergänzend zu Dalai als Hintergrund zur 32-/64-Bit Thematik (WOW64-Redirection):

https://www.delphipraxis.net/155861-...direction.html

https://docs.microsoft.com/de-de/win...tem-redirector


Winsat.exe hat so einige Parameter:

https://www.ghacks.net/2017/10/16/th...insat-command/

KodeZwerg 18. Sep 2018 19:08

AW: "WinSat.exe formal" mit Delphi
 
Danke Euch beiden dafür, da werden ich mal lesen und schauen wie ich den Konflikt bzw Knoten den ich gerade im Kopf habe löse :)

Offtopic
Hier noch eine WMI Batch Datei für Interessierte, die einem WinSAT Ergebnisse liefert, habs getestet und zeigt alles 0 an da ich das WinSAT Tool selbst noch nie Indexsen lies.
Delphi-Quellcode:
@ECHO OFF
IF NOT "%OS%"=="Windows_NT" GOTO Syntax
IF NOT "%~3"==""          GOTO Syntax
ECHO.%* | FIND "?" >NUL && GOTO Syntax

SETLOCAL ENABLEDELAYEDEXPANSION

SET Valid=0
FOR %%A IN ("" CPU D3D Disk Graphics Mem Memory Level Total Vid Video) DO (
   IF /I "%~1"=="%%~A" SET Valid=1
)
IF NOT "%Valid%"=="1" (
   ENDLOCAL
   GOTO Syntax
)

IF "%~2"=="" (
   SET Node=%ComputerName%
) ELSE (
   SET Node=%~2
)

SET RC=

SET WinSATAssessmentState.0=StateUnknown
SET WinSATAssessmentState.1=Valid
SET WinSATAssessmentState.2=IncoherentWithHardware
SET WinSATAssessmentState.3=NoAssessmentAvailable
SET WinSATAssessmentState.4=Invalid

FOR /F "tokens=1* delims==" %%A IN ('WMIC /Node:"%Node%" Path Win32_WinSAT Where TimeTaken^="MostRecentAssessment" Get WinSATAssessmentState /Format:LIST') DO (
   IF NOT "%%~B"=="" (
      FOR %%C IN (%%~B) DO (
         SET Win32_WinSAT.WinSATAssessmentState=!WinSATAssessmentState.%%C!
      )
   )
)
FOR /F "tokens=1* delims==" %%A IN ('WMIC /Node:"%Node%" Path Win32_WinSAT Where TimeTaken^="MostRecentAssessment" Get WinSPRLevel /Format:LIST') DO (
   IF NOT "%%~B"=="" (
      SET Result=%%~B
      FOR %%C IN ("!Result:,=.!") DO (
         SET Win32_WinSAT.WinSPRLevel=%%~C
      )
   )
)
FOR /F "tokens=1* delims==" %%A IN ('WMIC /Node:"%Node%" Path Win32_WinSAT Where TimeTaken^="MostRecentAssessment" Get * /Format:LIST ^| FINDSTR /R /B /I /C:"%~1[^=]*Score="') DO (
   IF NOT "%%~B"=="" (
      FOR %%C IN (%%~B) DO IF "!RC!"=="" SET /A RC = %%~C
      SET Result=%%~B
      FOR %%C IN ("!Result:,=.!") DO (
         SET Win32_WinSAT.%%A=%%~C
      )
   )
)
IF "%~1"=="" SET RC=%Win32_WinSAT.WinSPRLevel%
SET Win32_WinSAT.
ENDLOCAL & EXIT /B %RC%


:Syntax
ECHO.
ECHO WinSAT.bat, Version 1.00
ECHO Return Windows System Assessment Tools's scores for the specified computer
ECHO.
ECHO Usage: WINSAT [ component [ computer ] ]
ECHO.
ECHO Where: "component" can have one of the following values:
ECHO            "CPU" to return the WinSAT CPU Score
ECHO            "D3D" to return the WinSAT CPU Score
ECHO            "Disk" to return the WinSAT Disk Score
ECHO            "Graphics", "Vid" or "Video" to return the WinSAT Graphics Score
ECHO            "Mem" or "Memory" to return the WinSAT Disk Score
ECHO            "Level" or "Total" to return the WinSAT Total Score (WinSPRLevel)
ECHO        "computer" is an optional remote computer (default: local computer)
ECHO.
ECHO Notes: If a component is specified, only the score for that component will
ECHO        be displayed on screen.
ECHO        The integer value for the specified score will be returned as
ECHO        "errorlevel".
ECHO        If no component is specified, ALL scores will be displayed on screen,
ECHO        and the "errorlevel" will be the integer value of the total score.
ECHO.
ECHO Written by Rob van der Woude
ECHO http://www.robvanderwoude.com

IF "%OS%"=="Windows_NT" EXIT /B 1

devidespe 19. Sep 2018 09:34

AW: "WinSat.exe formal" mit Delphi
 
Hmm bzgl. der Ergebnisse habe ich die XML-Dateien ausgewertet - diese liegen an fest definierter Stelle und haben ein bestimmtes Format. Damit hast du auch Zugriff auf frühere Bewertungen.

Mag aber auch damit zusammenhängen, dass ich WMI nicht gerne verwende.


Alle Zeitangaben in WEZ +1. Es ist jetzt 19:02 Uhr.
Seite 2 von 2     12   

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024 by Thomas Breitkreuz