• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 803
  • Last Modified:

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
0
chas805
Asked:
chas805
  • 2
  • 2
1 Solution
 
Bob LearnedCommented:
What operating system is this running from?

Bob
0
 
chas805Author Commented:
xp home

0
 
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
0
 
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
0
 
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
0

Featured Post

Prep for the ITIL® Foundation Certification Exam

December’s Course of the Month is now available! Enroll to learn ITIL® Foundation best practices for delivering IT services effectively and efficiently.

  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now