|
-
Jan 21st, 2002, 04:35 PM
#1
Thread Starter
New Member
Identifying Processors
Need help identifying a systems processor type (example AMD Duron, Pentium 4, Pentium III, Celeron...) .Already have established code using SYSTEM_INFO with no success other than type "Pentium" being returned on a "Celeron" or "AMD" system. From what I can gather, AMD processors can only be detected as Pentium. Is this correct? If not, how can I obtain this information?
-
Jan 21st, 2002, 05:27 PM
#2
Member
you can do this using wmi which was posted on another question by Serge
http://www.vbforums.com/showthread.p...&highlight=WMI
or you can always just check the registry to find this out
HKEY_LOCAL_MACHINE\HARDWARE\DESCRIPTION\System\CentralProcessor\0\VendorIdentifier
will tell you the processor vendor such as AuthenticAMD
HKEY_LOCAL_MACHINE\HARDWARE\DESCRIPTION\System\CentralProcessor\0\Identifier
will tell you the type of processor such as AMD Athlon(tm) processor
HKEY_LOCAL_MACHINE\HARDWARE\DESCRIPTION\System\CentralProcessor\0\~MHz
will tell you the speed of the processor such as 1400 MHZ
this will only work on nt/2000/xp machines wont work on 9.x
-
Jan 21st, 2002, 05:29 PM
#3
Member
the mhz is the only one that doesn't work on 9.x
-
Jan 22nd, 2002, 07:33 AM
#4
Thread Starter
New Member
Saw that... however
After successful implimentation, I found that it didn't successfully recognize the specific processor. Would not recognize AMD Duron or Thunderbird processors, but would return the results as an AMD processor (too general of a response). Also noted that the system itself did recognize the specific processor.
I'll continue my testing with the WMI in the meantime. Appreciate any thoughts or solutions you may have for this problem.
-
Jan 22nd, 2002, 03:44 PM
#5
New Member
Code:
' Declare a global reference to an SWbemServices object. This represents the connection
' to the namespace root\cimv2
Dim Namespace As SWbemServices
' This Sub is called when the form loads, it logs the client into the root\cimv2 namespace
Private Sub Form_Load()
' If an error occurs we want to be notified
On Error GoTo ErrorHandler
' Login to the root\cimv2 namespace where all the WIN32 information is stored.
' We use the moniker display name for the namespace, passing it to the
' standard VB function GetObject. The actual namespace in this case is omitted
' from the display name as it is taken directly from the default namespace
' defined in the registry.
Set Namespace = GetObject("winmgmts:")
GetProcessorInfo
Exit Sub
ErrorHandler:
MsgBox "An error has occurred loading the form: " & Err.Description
End Sub
Private Sub GetProcessorInfo()
' Create a reference to an SWbemObject object.
Dim Processor As SWbemObject
' If an error occurs we want to be notified
On Error GoTo ErrorHandler
savePointer = Form1.MousePointer
Form1.MousePointer = vbHourglass
Form1.Enabled = False
List1.Clear
' Enumerate the instances of Win32_Processor using our namespace connection.
' Note that the enumeration is treated as a collection.
Dim ProcessorSet As SWbemObjectSet
Set ProcessorSet = Namespace.InstancesOf("Win32_Processor")
For Each Processor In ProcessorSet
' Use the RelPath property of the instance path to display the disk
List1.AddItem "Manufacturer: " & Processor.Manufacturer
List1.AddItem "Description: " & Processor.Description
List1.AddItem "Family: " & Processor.Family
List1.AddItem "Name: " & Processor.Name
List1.AddItem "SystemName: " & Processor.SystemName
List1.AddItem "CurrentClockSpeed: " & Processor.CurrentClockSpeed
List1.AddItem "ProcessorType: " & Processor.ProcessorType
List1.AddItem "Version: " & Processor.Version
List1.AddItem "Device ID: " & Processor.DeviceID
Next
Form1.MousePointer = savePointer
Form1.Enabled = True
Exit Sub
ErrorHandler:
MsgBox "An error has occurred: " & Err.Description
End Sub
this lists some of the available processor info from the WMI Win32_Processor class.
Make sure you have a reference to Microsoft WMI Scripting...
in your project.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|