Page 1 of 1 1
Topic Options
#198999 - 2010-07-13 10:57 AM @CPU returns incorrect data
Mart Moderator Offline
KiX Supporter
*****

Registered: 2002-03-27
Posts: 4672
Loc: The Netherlands
See: http://www.kixtart.org/forums/ubbthreads.php?ubb=showflat&Number=198944

Below are two ways to get the CPU name. The kix macro returns incorrect data and the WMI query shows the correct name. Can @CPU be fixed to display the correct data?
The two MS patches for Celeron and Core 2 duo processors do not seem to fix this issue.

I tried it on a Windows 7 system. WMI returns the correct data and @CPU returns Intel Pentium III instead of the actual name of the CPU.
 Code:
Break on

? @CPU

$wmiColl = GetObject("WinMgmts:root/cimv2").ExecQuery("Select * FROM Win32_Processor ")
For Each $wmiObj in $wmiColl
	? $wmiObj.Name
Next

Sleep 5


 Quote:
Intel Pentium III
Intel(R) Core(TM)2 Duo CPU P8600 @ 2.40GHz
_________________________
Mart

- Chuck Norris once sold ebay to ebay on ebay.

Top
#199657 - 2010-08-25 09:34 PM Re: @CPU returns incorrect data [Re: Mart]
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
as a hater of wmi I would suggest everyone use registry instead.
even kixtart should use it, not sure why ruud decided not to.

 Code:
readvalue("HKLM\HARDWARE\DESCRIPTION\SYSTEM\CentralProcessor\0","ProcessorNameString")
_________________________
!

download KiXnet

Top
#199658 - 2010-08-26 09:32 AM Re: @CPU returns incorrect data [Re: Lonkero]
Arend_ Moderator Offline
MM club member
*****

Registered: 2005-01-17
Posts: 1894
Loc: Hilversum, The Netherlands
As a WMI lover, a bit faster code:
 Code:
Dim $objCol, $objItem
$objCol = GetObject("WinMgmts:\\.\root\cimv2").ExecQuery("Select Name FROM Win32_Processor",,48)
For Each $objItem in $objCol
  ? $objItem.Name
Next

Top
Page 1 of 1 1


Moderator:  ShaneEP, Arend_, Jochen, Radimus, Glenn Barnas, Allen, Ruud van Velsen, Mart 
Hop to:
Shout Box

Who's Online
1 registered (Allen) and 382 anonymous users online.
Newest Members
gespanntleuchten, DaveatAdvanced, Paulo_Alves, UsTaaa, xxJJxx
17864 Registered Users

Generated in 0.049 seconds in which 0.023 seconds were spent on a total of 13 queries. Zlib compression enabled.