CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 6 of 6
  1. #1
    Join Date
    Apr 2004
    Posts
    95

    Retrieve BIOS Serial

    How would you retrieve the BIOS Serial Number without having to use any on-form controls?

    I've searched + Googled but I cannot find an example in C++.. just VB.

    Thanks in advance.
    Last edited by DarkLotus; August 3rd, 2006 at 07:11 PM.

  2. #2
    Join Date
    Feb 2002
    Posts
    5,757

    Re: Retrieve BIOS Serial


  3. #3
    Join Date
    Feb 2000
    Location
    San Diego, CA
    Posts
    10,354

    Re: Retrieve BIOS Serial


  4. #4
    Join Date
    Oct 2000
    Location
    India
    Posts
    4,620

    Thumbs up Re: Retrieve BIOS Serial

    Hi,

    Take a look at WMI. It contains features to enumerate most of the resources
    used by the system. Just changing the parameters would enable you to
    even get the bios serial number of any other machine on your network.

    If u need a sample, give me a shout (or) search in google for WMI.
    All luck and have a great day.

    Regards,
    V.Girish

    Visit www.geocities.com/contactgirish for Source code, Tutorials, FAQs and Downloads.

  5. #5
    Join Date
    Apr 2004
    Posts
    95

    Re: Retrieve BIOS Serial

    Quote Originally Posted by VGirish
    Hi,

    Take a look at WMI. It contains features to enumerate most of the resources
    used by the system. Just changing the parameters would enable you to
    even get the bios serial number of any other machine on your network.

    If u need a sample, give me a shout (or) search in google for WMI.
    Would you mind posting an example, please?

  6. #6
    Join Date
    Oct 2000
    Location
    India
    Posts
    4,620

    Thumbs up Re: Retrieve BIOS Serial

    Hi,

    Guessed that u would ask for a sample. Anyway, take a look at
    this link

    WMI works as follows:

    1. It uses a subset of SQL called WQL for querying the system.
    For example, SELECT * FROM Win32_Processor would return all
    processor related data from the system. In your case, u would be
    needing "Select SerialNumber from Win32_BIOS".

    Do u believe it is as simple as that ? It is.

    2. Secondly, u need to use IWbemLocator to access the WMI service

    3. You need to connect to the WMI service on your machine.
    You can use ConnectServer in IWbemLocator to do that.
    The ConnectServer statement allows you to query either your machine
    or if you have the credentials, u can even execute the same query on
    a different machine on your network.

    4. You then call IWbemServices::ExecQuery to execute your WQL query.

    5. Finally, you can call IWbemClassObject::Get to get the output.

    Note: If u are not sure of what WQL statements to use, download the
    WMICodeCreator from this MS link

    Though it generates code in C#, VB and VB Script alone, you can just
    use it to execute your WQL statements and see if the results u get are
    what u want. Moreover, u can also see the various available namespaces
    that u can use and query.


    Phewwwwwwwww. Typed this reply in a hurry as i've got official work
    pending. Hope this helps. Cheerio.....
    All luck and have a great day.

    Regards,
    V.Girish

    Visit www.geocities.com/contactgirish for Source code, Tutorials, FAQs and Downloads.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured