ufukkreis853 Posted February 11 Posted February 11 (edited) Hello everyone. When I run the code below on my x64 computer, the results are zero. #AutoIt3Wrapper_UseX64=y When I add this command, it works, but I want to compile the script as x86. Can you help me? Sorry for my bad English. #RequireAdmin ;#AutoIt3Wrapper_UseX64=y ;;;Is there a way to run it without this command? $wbemFlagReturnImmediately = 0x10 $wbemFlagForwardOnly = 0x20 $colItems = "" $strComputer = "localhost" $Output="" $Output = $Output & "Computer: " & $strComputer & @CRLF $Output = $Output & "==========================================" & @CRLF $objWMIService = ObjGet("winmgmts:\\" & $strComputer & "\root\CIMV2") $colItems = $objWMIService.ExecQuery("SELECT * FROM Win32_WinSAT", "WQL", _ $wbemFlagReturnImmediately + $wbemFlagForwardOnly) If IsObj($colItems) then For $objItem In $colItems $Output = $Output & "CPUScore: " & $objItem.CPUScore & @CRLF $Output = $Output & "D3DScore: " & $objItem.D3DScore & @CRLF $Output = $Output & "DiskScore: " & $objItem.DiskScore & @CRLF $Output = $Output & "GraphicsScore: " & $objItem.GraphicsScore & @CRLF $Output = $Output & "MemoryScore: " & $objItem.MemoryScore & @CRLF $Output = $Output & "TimeTaken: " & $objItem.TimeTaken & @CRLF $Output = $Output & "WinSATAssessmentState: " & $objItem.WinSATAssessmentState & @CRLF $Output = $Output & "WinSPRLevel: " & $objItem.WinSPRLevel & @CRLF if Msgbox(1,"WMI Output",$Output) = 2 then ExitLoop $Output="" Next Else Msgbox(0,"WMI Output","No WMI Objects Found for class: " & "Win32_WinSAT" ) Endif Edited February 11 by ufukkreis853
Nine Posted February 11 Posted February 11 Running my generic read on Win32_WinSAT using x86 gave me this result : I have no idea what this means, but it does produce some results. “They did not know it was impossible, so they did it” ― Mark Twain Spoiler Block all input without UAC Save/Retrieve Images to/from Text Monitor Management (VCP commands) Tool to search in text (au3) files Date Range Picker Virtual Desktop Manager Sudoku Game 2020 Overlapped Named Pipe IPC HotString 2.0 - Hot keys with string x64 Bitwise Operations Multi-keyboards HotKeySet Recursive Array Display Fast and simple WCD IPC Multiple Folders Selector Printer Manager GIF Animation (cached) Debug Messages Monitor UDF Screen Scraping Multi-Threading Made Easy
argumentum Posted February 12 Posted February 12 (edited) 4 hours ago, ufukkreis853 said: Can you help me? https://learn.microsoft.com/en-us/windows/win32/api/winsatcominterfacei/ne-winsatcominterfacei-winsat_assessment_state https://www.windowsdigitals.com/winsat-windows-experience-index-score-windows-11/ Microsoft Windows [Version 10.0.26100.2033] (c) Microsoft Corporation. All rights reserved. C:\Windows\System32>winsat formal Windows System Assessment Tool Error: Unable to run inside of a Virtual Machine. Please try again running directly on the native hardware. Edited February 12 by argumentum Follow the link to my code contribution ( and other things too ). FAQ - Please Read Before Posting.
ufukkreis853 Posted February 12 Author Posted February 12 9 hours ago, argumentum said: https://learn.microsoft.com/en-us/windows/win32/api/winsatcominterfacei/ne-winsatcominterfacei-winsat_assessment_state https://www.windowsdigitals.com/winsat-windows-experience-index-score-windows-11/ Microsoft Windows [Version 10.0.26100.2033] (c) Microsoft Corporation. All rights reserved. C:\Windows\System32>winsat formal Windows System Assessment Tool Error: Unable to run inside of a Virtual Machine. Please try again running directly on the native hardware. winsat /formal I get an error when using this command in powershell x86. It works when using it in x64, but there is no change in the script I created.
Nine Posted February 12 Posted February 12 MSDN : Quote [Win32_WinSAT may be altered or unavailable for releases after Windows 8.1.] “They did not know it was impossible, so they did it” ― Mark Twain Spoiler Block all input without UAC Save/Retrieve Images to/from Text Monitor Management (VCP commands) Tool to search in text (au3) files Date Range Picker Virtual Desktop Manager Sudoku Game 2020 Overlapped Named Pipe IPC HotString 2.0 - Hot keys with string x64 Bitwise Operations Multi-keyboards HotKeySet Recursive Array Display Fast and simple WCD IPC Multiple Folders Selector Printer Manager GIF Animation (cached) Debug Messages Monitor UDF Screen Scraping Multi-Threading Made Easy
ufukkreis853 Posted February 12 Author Posted February 12 6 minutes ago, Nine said: MSDN : I read this but I wanted to figure out why it works as x64 but not as x86
Nine Posted February 12 Posted February 12 https://stackoverflow.com/questions/19120578/cannot-access-win32-winsat-from-32-bits-process “They did not know it was impossible, so they did it” ― Mark Twain Spoiler Block all input without UAC Save/Retrieve Images to/from Text Monitor Management (VCP commands) Tool to search in text (au3) files Date Range Picker Virtual Desktop Manager Sudoku Game 2020 Overlapped Named Pipe IPC HotString 2.0 - Hot keys with string x64 Bitwise Operations Multi-keyboards HotKeySet Recursive Array Display Fast and simple WCD IPC Multiple Folders Selector Printer Manager GIF Animation (cached) Debug Messages Monitor UDF Screen Scraping Multi-Threading Made Easy
Solution Nine Posted February 12 Solution Posted February 12 Based on previous post, I came up with this : #include <Constants.au3> Local $oWbem = ObjCreate("WbemScripting.SWbemNamedValueSet") If Not IsObj($oWbem) Then Exit MsgBox($MB_OK, "Wbem", "Object not found") $oWbem.Add("__ProviderArchitecture", 64) $oWbem.Add("__RequiredArchitecture", True) Local $oLoc = ObjCreate("Wbemscripting.SWbemLocator") If Not IsObj($oLoc) Then Exit MsgBox($MB_OK, "Locator", "Object not found") Local $oServer = $oLoc.ConnectServer(".", "root\cimV2", "", "", "", "", 0, $oWbem) If Not IsObj($oServer) Then Exit MsgBox($MB_OK, "WMI server", "Object not found") Local $oItems = $oServer.ExecQuery("SELECT * FROM Win32_WinSAT") If Not IsObj($oItems) Then Exit MsgBox($MB_OK, "WMI Output", "No WMI Objects Found for class: Win32_WinSAT") Local $sOutput For $oItem In $oItems $sOutput = $sOutput & "CPUScore: " & $oItem.CPUScore & @CRLF $sOutput = $sOutput & "D3DScore: " & $oItem.D3DScore & @CRLF $sOutput = $sOutput & "DiskScore: " & $oItem.DiskScore & @CRLF $sOutput = $sOutput & "GraphicsScore: " & $oItem.GraphicsScore & @CRLF $sOutput = $sOutput & "MemoryScore: " & $oItem.MemoryScore & @CRLF $sOutput = $sOutput & "TimeTaken: " & $oItem.TimeTaken & @CRLF $sOutput = $sOutput & "WinSATAssessmentState: " & $oItem.WinSATAssessmentState & @CRLF $sOutput = $sOutput & "WinSPRLevel: " & $oItem.WinSPRLevel & @CRLF Next MsgBox($MB_OK, "WMI Output", $sOutput) Not sure if this will work for you, but it does for me. Any case, you got something to work with... “They did not know it was impossible, so they did it” ― Mark Twain Spoiler Block all input without UAC Save/Retrieve Images to/from Text Monitor Management (VCP commands) Tool to search in text (au3) files Date Range Picker Virtual Desktop Manager Sudoku Game 2020 Overlapped Named Pipe IPC HotString 2.0 - Hot keys with string x64 Bitwise Operations Multi-keyboards HotKeySet Recursive Array Display Fast and simple WCD IPC Multiple Folders Selector Printer Manager GIF Animation (cached) Debug Messages Monitor UDF Screen Scraping Multi-Threading Made Easy
ufukkreis853 Posted February 12 Author Posted February 12 12 minutes ago, Nine said: Önceki yazıyı temel alarak şunu düşündüm : #include <Constants.au3> Yerel $oWbem = ObjCreate ( "WbemScripting.SWbemNamedValueSet" ) IsObj Değilse ( $oWbem ) MsgBox'tan Çık ( $ MB_OK , " Wbem " , " Nesne bulunamadı " ) $ oWbem.Add ( " __ProviderArchitecture " , 64 ) $ oWbem.Add ( " __RequiredArchitecture" , True ) Yerel $ oLoc = ObjCreate ( "Wbemscripting.SWbemLocator" ) IsObj Değilse ( $ oLoc ) MsgBox'tan Çık ( $ MB_OK , "Konum Belirleyici" , "Nesne bulunamadı" ) Yerel $ oServer = $ oLoc . ConnectServer ( "." , "root\cimV2" , "" , "" , "" , "" , 0 , $oWbem ) Eğer Değilse IsObj ( $oServer ) Sonra Çık MsgBox ( $MB_OK , "WMI sunucusu" , "Nesne bulunamadı" ) Yerel $oItems = $oServer . ExecQuery ( "SELECT * FROM Win32_WinSAT" ) Eğer Değilse IsObj ( $oItems ) Then Exit MsgBox ( $MB_OK , "WMI Çıktısı" , "Sınıf için WMI Nesnesi Bulunamadı: Win32_WinSAT" ) Yerel $sÇıktı $oItem İçin $oItems İçinde $sÇıktı = $sÇıktı & "CPUSPuanı: " & $oItem . CPUPuanı & @CRLF $sÇıktı = $sÇıktı & "D3DSPuanı: " & $oItem . D3DSPuanı & @CRLF $sÇıktı = $sÇıktı & "DiskPuanı: " & $oItem . DiskScore & @CRLF $sÇıktı = $sÇıktı & "GrafikPuanı: " & $oItem . GraphicsScore & @CRLF $sOutput = $sOutput & "MemoryScore: " & $oItem . MemoryScore & @CRLF $sOutput = $sOutput & "TimeTaken: " & $oItem . TimeTaken & @CRLF $sOutput = $sOutput & "WinSATAssessmentState: " & $oItem . WinSATAssessmentState & @CRLF $sOutput = $sOutput & "WinSPRLevel: " & $oItem . WinSPRLevel & @CRLF Sonraki MsgBox ( $MB_OK , "WMI Çıktısı" , $sÇıktısı ) Bunun sizin için işe yarayıp yaramayacağından emin değilim ama benim için işe yarıyor. Her durumda, işe yarayacak bir şeyiniz var... thank you very much
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now