Pillejunior,

There are several posts on the forum dealing with this subject. I recently made a dll that will get any info I need of a computer.

The bottom line is, if you have a Win9x platform, you can not get the CPU speed unless you create a C++ dll and use some assembly code. I found a dll out there that will give you just the cpu speed. Here is the link

http://www.vbforums.com/showthread.p...light=cpuspeed

The WMI stuff seems to only work on the an NT platform and mainly 2000 and later.

You can get the speed by using the following code on a Win200/XP machine to retrieve the speed from the registry.

VB Code:
  1. Private Const KEY_CREATE_LINK = &H20
  2. Private Const KEY_CREATE_SUB_KEY = &H4
  3. Private Const KEY_ENUMERATE_SUB_KEYS = &H8
  4. Private Const KEY_EVENT = &H1     '  Event contains key event record
  5. Private Const KEY_NOTIFY = &H10
  6. Private Const KEY_QUERY_VALUE = &H1
  7. Private Const KEY_SET_VALUE = &H2
  8. Private Const READ_CONTROL = &H20000
  9. Private Const SYNCHRONIZE = &H100000
  10. Private Const STANDARD_RIGHTS_READ = (READ_CONTROL)
  11. Private Const STANDARD_RIGHTS_ALL = &H1F0000
  12. Private Const STANDARD_RIGHTS_WRITE = (READ_CONTROL)
  13. Private Const KEY_WRITE = ((STANDARD_RIGHTS_WRITE Or KEY_SET_VALUE Or KEY_CREATE_SUB_KEY) And (Not SYNCHRONIZE))
  14. Private Const KEY_ALL_ACCESS = ((STANDARD_RIGHTS_ALL Or KEY_QUERY_VALUE Or _
  15.                               KEY_SET_VALUE Or KEY_CREATE_SUB_KEY Or _
  16.                               KEY_ENUMERATE_SUB_KEYS Or KEY_NOTIFY Or _
  17.                               KEY_CREATE_LINK) And (Not SYNCHRONIZE))
  18. Private Const KEY_READ = ((STANDARD_RIGHTS_READ Or KEY_QUERY_VALUE Or KEY_ENUMERATE_SUB_KEYS Or KEY_NOTIFY) And (Not SYNCHRONIZE))
  19. Private Const KEY_EXECUTE = ((KEY_READ) And (Not SYNCHRONIZE))
  20.  
  21. Private Const HKEY_LOCAL_MACHINE = &H80000002
  22.  
  23. Private Declare Function RegQueryValueEx Lib "advapi32.dll" Alias "RegQueryValueExA" _
  24.   (ByVal hKey As Long, ByVal lpValueName As String, ByVal lpReserved As Long, _
  25.   lpType As Long, lpData As Any, lpcbData As Long) As Long
  26. Private Declare Function RegOpenKeyEx Lib "advapi32.dll" Alias "RegOpenKeyExA" _
  27.   (ByVal hKey As Long, ByVal lpSubKey As String, ByVal ulOptions As Long, _
  28.   ByVal samDesired As Long, phkResult As Long) As Long
  29. Private Declare Function RegCloseKey Lib "advapi32.dll" (ByVal hKey As Long) As Long
  30.  
  31. Public Function ProcessorSpeed() As String
  32.  
  33. ' If we are on a WinNT Platform, we can do this
  34.  
  35.     Dim lValue As Long
  36.     Dim GroupHandle As Long
  37.     Dim Section As String
  38.    
  39.     Section = "HARDWARE\DESCRIPTION\System\CentralProcessor\0"
  40.    
  41.     ' Open the Registry Key
  42.     RegOpenKeyEx HKEY_LOCAL_MACHINE, Section, 0&, KEY_READ, GroupHandle
  43.    
  44.     ' Get the value
  45.     RegQueryValueEx GroupHandle, "~Mhz", 0&, 0&, lValue, 4&
  46.  
  47.     ' Close the Registry
  48.     RegCloseKey GroupHandle
  49.    
  50.     'Give it to me
  51.     ProcessorSpeed = lValue & " Mhz"
  52.  
  53.  
  54. End Function

I hope this helps you out.

Jerel