error using clsWMI

Experts

Am using the clsWMI class to geet some details about the current pc in a vb.net application that I am developing.  However when i hit the line of code :

 For Each objMgmt In objOS.Get                      

from the following sub it throws up an exception.

Public Sub New()

        objOS = New ManagementObjectSearcher("SELECT * FROM Win32_OperatingSystem")
        objCS = New ManagementObjectSearcher("SELECT * FROM Win32_ComputerSystem")
        For Each objMgmt In objOS.Get


            m_strOSName = objMgmt("name").ToString()
            m_strOSVersion = objMgmt("version").ToString()
            m_strComputerName = objMgmt("csname").ToString()
            m_strWindowsDir = objMgmt("windowsdirectory").ToString()
        Next

        For Each objMgmt In objCS.Get
            m_strManufacturer = objMgmt("manufacturer").ToString()
            m_StrModel = objMgmt("model").ToString()
            m_strSystemType = objMgmt("systemtype").ToString
            m_strTPM = objMgmt("totalphysicalmemory").ToString()
        Next
    End Sub

Exception:

The dependency service does not exist or has been marked for deletion. (Exception from HRESULT: 0x80070433)

Any ideas would be greatly appreciated.

Regards

Chas
chas805Asked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Bob LearnedCommented:
What operating system is this running from?

Bob
chas805Author Commented:
xp home

Bob LearnedCommented:
I don't know XP home very well, but there should be a Windows Management Instrumentation service, that is probably set as disabled for startup.

Bob

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
chas805Author Commented:
Yep your right Bob, and mine is knackered for some reason, will not start.  I can recalll now this has not worked for some time, so time to upgrade to xp/pro i think, should fix this problem.

Many thanks
AleksandraJMCommented:
All,

I receive the same error  trying to run a schedule in FactoryTalk AssetCentre.

The error message was : Could not load Verification agent. Error: Retrieving the COM class factory for component with CLSID {03DEF365-5620-4C34-ACD0-3830431E2757} failed due to the following error: 80070433 The dependency service does not exist or has been marked for deletion.

I'm running FactoryTalk AssetCentre on Windows Server 2003

Please advice

Regards
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Visual Basic.NET

From novice to tech pro — start learning today.