From: John S on
Hello,

How can I read HID (hardware id) of PC component, like hard disk hid,
mainboard hid, processor etc. ?

Please help.

Thanks in advance
Johns




*** Sent via Developersdex http://www.developersdex.com ***
From: duke on
On Feb 14, 12:29 pm, John S <nospam> wrote:
> Hello,
>
> How can I read HID (hardware id) of PC component, like hard disk hid,
> mainboard hid, processor etc. ?
>
> Please help.
>
> Thanks in advance
> Johns
>
> *** Sent via Developersdexhttp://www.developersdex.com***

You need to get familiar with WMI to get that type of information.

Here is a good starting point from which you can wander around to get
what you want:

http://msdn.microsoft.com/en-us/library/aa394585%28VS.85%29.aspx

Duke

From: Jeff Johnson on
"John S" <nospam> wrote in message
news:%23n066varKHA.4752(a)TK2MSFTNGP04.phx.gbl...

> How can I read HID (hardware id) of PC component, like hard disk hid,
> mainboard hid, processor etc. ?

I recommend you stop using HID to mean hardware ID. I'm willing to bet a
good chunk of us looked at the subject and thought "Human Interface Device,"
i.e., some form of (probably USB-based) input, as that is the major use of
the abbreviation these days. (You'll get better responses if you don't
confuse the responders, y'know?)


From: Dee Earley on
On 14/02/2010 19:29, John S wrote:
> Hello,
>
> How can I read HID (hardware id) of PC component, like hard disk hid,
> mainboard hid, processor etc. ?

Different classes of hardware have different methods of accessing this info.
You will need to look into specific API calls, or research WMI.

And I seconds the comment about using the incorrect acronym, a HID is
something entirely different.

--
Dee Earley (dee.earley(a)icode.co.uk)
i-Catcher Development Team

iCode Systems
From: John S on

Hi Duke and others, thanks for the answer.

I have tried WMI for the first time. The following code comes from
http://msdn.microsoft.com/en-us/library/aa394585%28VS.85%29.aspx

Sub t1()
strComputer = "."
Set objWMIService = GetObject("winmgmts:" _
& "{impersonationLevel=impersonate}!\\" _
& strComputer & "\root\cimv2")
Set colSMBIOS = objWMIService.ExecQuery _
("Select * from Win32_SystemEnclosure")
For Each objSMBIOS In colSMBIOS
Debug.Print "Part Number: " & objSMBIOS.PartNumber
Debug.Print "Serial Number: " & objSMBIOS.SerialNumber
Debug.Print "Asset Tag: " & objSMBIOS.SMBIOSAssetTag
Next
End Sub

It seems that the code does not give the ouput accurately. Like this :

Part Number:
Serial Number: Chassis Serial Number
Asset Tag: Asset -1234567890

I only need to get hard disk,processor and mainboard unique id. Sorry
for incorrect use of the word HID.
Could anyone give me the best way ?

John S




*** Sent via Developersdex http://www.developersdex.com ***