|
-
August 3rd, 2006, 07:08 PM
#1
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.
-
August 3rd, 2006, 08:16 PM
#2
-
August 3rd, 2006, 08:18 PM
#3
-
August 4th, 2006, 01:01 AM
#4
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.
-
August 4th, 2006, 01:24 AM
#5
Re: Retrieve BIOS Serial
 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?
-
August 4th, 2006, 01:38 AM
#6
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.....
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|