getting CPU info fails on NT machine

P

Paul

(code taken from another thread, thank you, Ken Tucker)

Dim moReturn As Management.ManagementObjectCollection
Dim moSearch As Management.ManagementObjectSearcher
Dim mo As Management.ManagementObject
moSearch = New Management.ManagementObjectSearcher("Select * from
Win32_Processor")
moReturn = moSearch.Get
For Each mo In moReturn
Dim strout As String = String.Format("{0} - {1}", mo("Name"),
mo("CurrentClockSpeed"))
MsgBox(strout)
Next

On my Windows NT test machine I get this exception:

System.Runtime.InteropServices.COMException (0x80040154): COM object with
CLSID {4590F811-1D3A-11D0-891F-00AA004B2E24} is either not valid or not
registered.
at System.Management.ManagementScope.Initialize()
at System.Management.ManagementObjectSearcher.Initialize()
at System.Management.ManagementObjectSearcher.Get()
at CPUInfo.Main.main()

I'd really like to be able to move my CPU info-collecting code to DotNet...
right now I still use an old VB6 dll. Is there a way to get this work on any
machine with the Framework installed?

Paul
 
K

Ken Tucker [MVP]

Hi,

Need to install wmi core on nt 4.0.

http://www.microsoft.com/downloads/...46-e213-4cbf-9c5b-fbf236e0e875&displaylang=en

Ken
-----------------
(code taken from another thread, thank you, Ken Tucker)

Dim moReturn As Management.ManagementObjectCollection
Dim moSearch As Management.ManagementObjectSearcher
Dim mo As Management.ManagementObject
moSearch = New Management.ManagementObjectSearcher("Select * from
Win32_Processor")
moReturn = moSearch.Get
For Each mo In moReturn
Dim strout As String = String.Format("{0} - {1}", mo("Name"),
mo("CurrentClockSpeed"))
MsgBox(strout)
Next

On my Windows NT test machine I get this exception:

System.Runtime.InteropServices.COMException (0x80040154): COM object with
CLSID {4590F811-1D3A-11D0-891F-00AA004B2E24} is either not valid or not
registered.
at System.Management.ManagementScope.Initialize()
at System.Management.ManagementObjectSearcher.Initialize()
at System.Management.ManagementObjectSearcher.Get()
at CPUInfo.Main.main()

I'd really like to be able to move my CPU info-collecting code to DotNet...
right now I still use an old VB6 dll. Is there a way to get this work on any
machine with the Framework installed?

Paul
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top