error using clsWMI

Posted on 2006-03-21
Last Modified: 2013-02-28

Am using the clsWMI class to geet some details about the current pc in a 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()

        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()
    End Sub


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

Any ideas would be greatly appreciated.


Question by:chas805
    LVL 96

    Expert Comment

    by:Bob Learned
    What operating system is this running from?


    Author Comment

    xp home

    LVL 96

    Accepted Solution

    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.


    Author Comment

    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

    Expert Comment


    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


    Featured Post

    How to improve team productivity

    Quip adds documents, spreadsheets, and tasklists to your Slack experience
    - Elevate ideas to Quip docs
    - Share Quip docs in Slack
    - Get notified of changes to your docs
    - Available on iOS/Android/Desktop/Web
    - Online/Offline

    Join & Write a Comment

    Article by: Kraeven
    Introduction Remote Share is a simple remote sharing tool, enabling you to see, add and remove remote or local shares. The application is written in VB.NET targeting the .NET framework 2.0. The source code and the compiled programs have been in…
    A while ago, I was working on a Windows Forms application and I needed a special label control with reflection (glass) effect to show some titles in a stylish way. I've always enjoyed working with graphics, but it's never too clever to re-invent …
    To add imagery to an HTML email signature, you have two options available to you. You can either add a logo/image by embedding it directly into the signature or hosting it externally and linking to it. The vast majority of email clients display l…
    Here's a very brief overview of the methods PRTG Network Monitor ( offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…

    729 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    19 Experts available now in Live!

    Get 1:1 Help Now