473,385 Members | 1,730 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

getting CPU info fails on NT machine

(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.Initial ize()
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
Nov 21 '05 #1
2 1599
Hi,

Need to install wmi core on nt 4.0.

http://www.microsoft.com/downloads/d...displaylang=en

Ken
-----------------
"Paul" <no***@executespammers.org> wrote in message
news:%2****************@TK2MSFTNGP09.phx.gbl...
(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.Initial ize()
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

Nov 21 '05 #2
Thanks, that did the trick!
"Ken Tucker [MVP]" <vb***@bellsouth.net> wrote in message
news:OT**************@TK2MSFTNGP09.phx.gbl...
Hi,

Need to install wmi core on nt 4.0.

http://www.microsoft.com/downloads/d...displaylang=en
Ken

Nov 21 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Eyal | last post by:
Hey, I would appriciate if anyone can help on this one: I have a java object/inteface having a method with a boolean parameter. As I'm trying to call this method from a javascript it fails on...
8
by: Owen Jenkins | last post by:
Hello. For years I've been using the DBEngine.CompactDatabase code to make backups of backend databases. But now I've struck a baffling problem where I get an Invalid Argument error. This...
3
by: Alexander Wehrli | last post by:
Hello, I'd like to write an application that finds out for every machine in my network that it is running and if yes, which user is logged on this machine. I'm asking myself if this is possible...
6
by: Frank | last post by:
Straightforward VB.NET 2002 code that works form both Windows and ASP.NET apps on a Windows 2000 machine, and works in the Windows app on a newly installed XP machine, but fails in the ASP.NET...
2
by: Ben Harper | last post by:
I'm trying to load an assembly of mine from a C# webforms page, but IIS fails to load the page because of failed dependencies. My problem is that I cannot for the life of me discover the dependency...
4
windows_mss
by: windows_mss | last post by:
When I Select Source & Destination Dynamically, Path Getting Scatter Across The Map... hi, i can able to get the Correct Route and Path for the corresponding Source and destination, like...
8
by: mainframetech | last post by:
We are having a problem with Access 2002 as opposed to Access 2000. A multi-file query was set up under 2000 and tested good. Access is connected through a link to an Oracle 9.1 database. The...
33
by: JamesB | last post by:
I am writing a service that monitors when a particular app is started. Works, but I need to get the user who is currently logged in, and of course Environment.UserName returns the service logon...
5
by: Just_a_fan | last post by:
I can get a dump. I can send it in to M$. I can inspect it but cannot get it in my hands so I can not post it here and get comments and/or answers. Can I get hold of that dump somewhere? Is it...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.