Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 899339
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T15:12:05+00:00 2026-05-15T15:12:05+00:00

My question is really simple, but apparently nobody’s experienced a similar error. I’m writing

  • 0

My question is really simple, but apparently nobody’s experienced a similar error. I’m writing a program to check if a WMI Class’s property is writeable, that is, if the “Write” qualifier is true for that property. My code looks like this:

ManagementObjectSearcher mos = new ManagementObjectSearcher("root\\\CIMV2", "SELECT * FROM " + "Win32_Processor"); <br />
ManagementObjectCollection moc= mos.Get(); <br />
ManagementClass manClass = new ManagementClass("Win32_Processor"); <br />

bool isWriteable = false;

isWriteable (bool)manClass.GetPropertyQualifierValue("Description", "Write"); <br />
// I've also tried to call it on a ManagementObject instance of ManagementObjectCollection, doesn't work either way

Every time it’s called, however, it returns a “Not found” exception, regardless of which property or qualifier name I use (all of the one’s I’ve tried I’ve pulled from MSDN — they should be valid).

Similarly, GetQualifierValue does not work, either, when trying to get the qualifiers of the class.

Anyone have any ideas?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-15T15:12:05+00:00Added an answer on May 15, 2026 at 3:12 pm

    The proper way to check if a Class’ property is writeable is to check for the existence of the “write” qualifier. The following is some sample code:

    ManagementClass processClass =
                    new ManagementClass("Win32_Process");
    
    bool isWriteable = false;
    foreach (PropertyData property in processClass.Properties)
    {
        if (property.Name.Equals("Description"))
        {
            foreach (QualifierData q in property.Qualifiers)
            {
                if (q.Name.Equals("write"))
                {
                    isWriteable = true;
                    break;
                }
            }
        }
    }
    

    Using the code below, you will see that the Description property only has the CIMTYPE, Description, and read qualifiers.

    ManagementClass processClass =
             new ManagementClass("Win32_Process");
    processClass.Options.UseAmendedQualifiers = true;
    
    foreach (PropertyData property in processClass.Properties)
    {
        if (property.Name.Equals("Description"))
        {
            foreach (QualifierData q in property.Qualifiers)
            {
                Console.WriteLine(q.Name);
            }
        }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

This is probably a really simple question but one I've never quite worked out
I know this is a really simple question but my google-fu is failing me.
Really simple question here but bugging me for long enough to ask. Code looks
This sounds like a really simple question, but I am new to PHP. If
This is a really simple question, but I can't seem to find the answer.
I've got a really simple rails question here but I can't seem to find
This is probably a really simple jQuery question, but I couldn't answer it after
This is probably a really dumb question with a simple answer but... I am
There might be a really simple solution to this question, but i just don't
I know there must be a really simple answer to this question, but I

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.