Getting flag values from BIOS

Agha Khan 166 Reputation points
2022-09-02T23:43:36.28+00:00

I have a HP Laptop and like to know some flags from BOIS for example Trusted Execution Technology(TXT)
I have seen this query and it works and checked in C++ application. I am moving to .NET, so I would like use .NET version

For some unknown reason I am getting queryCollection wrong. In C++ I am using Properties and getting value.
If someone going to test it then HP_BIOSSetting should be changed depending on the make of the computer.

ManagementScope scope = new ManagementScope("\\.\ROOT\cimv2");
ObjectQuery query = new ObjectQuery("SELECT * FROM HP_BIOSSetting where Name=\"Trusted Execution Technology(TXT)\"");

        ManagementObjectSearcher searcher = new ManagementObjectSearcher(scope, query);  

        //get a collection of WMI objects  
        ManagementObjectCollection queryCollection = searcher.Get();  

        //enumerate the collection.  
        foreach (ManagementObject m in queryCollection)  
        {  
            // access properties of the WMI object  
           // Console.WriteLine("AcceptPause : {0}", m["AcceptPause"]);  

        }   

Any help will be very much appreciated.

Windows development | Windows API - Win32
{count} votes

4 answers

Sort by: Most helpful
  1. Sam of Simple Samples 5,546 Reputation points
    2022-09-03T20:12:55.697+00:00

    Go to Downloading WMI Explorer. Download it, you will get a zip file. There is no installation required; just copy WMIExplorer.exe to someplace. It can be executed from inside the zip file but it is better to copy it to someplace.

    When you execute it, first click the Connect button near the top left. You will get a nice list of available namespaces. It has been a couple of years since I used the program and as I remember it works a bit strange but it does work, it just takes time to learn. Using it you can find the classes and/or objects you need and then you know what to use in your query. If you get access denied for anything you need to look at then execute the program as Administrator.

    If you cannot use that utility then look for wbemtest.exe in your system. It is part of Windows. It also allows us to look at WMI classes and objects.

    1 person found this answer helpful.

  2. Castorix31 90,681 Reputation points
    2022-09-03T06:04:35.887+00:00

    From the doc, the namespace is not "ROOT\cimv2" but "root\HP\InstrumentedBIOS"


  3. Agha Khan 166 Reputation points
    2022-09-03T06:06:23.293+00:00

    We have to change ManagementScope= new ManagementObjectSearcher("\\.\root\HP\InstrumentedBIOS")
    I was missing HP\InstrumentedBIOS.
    We might have to bring class name as well.
    ManagementObjectSearcher searcher = new ManagementObjectSearcher("\\.\root\HP\InstrumentedBIOS:hp_biosEnumeration", "SELECT * FROM HP_BIOSSetting where Name=\"Trusted Execution Technology(TXT)\"");
    Still did not work out.

    0 comments No comments

  4. Agha Khan 166 Reputation points
    2022-09-03T09:24:55.837+00:00

    It is a C++ program in binary format. I do not have the source file but the header file. It returns not checked. I looked in PowerShell it that flag not found. Then I checked Virtualization Technology (VTx/VTd) and it found. It looks to this flag is not avalible. Because I do not have C++ source I am not sure it is checking.


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.