Read an explicit Number of Harddisk

M

martin huber

Hello,

How can I read easily an explicit Number of the Harddisk?
I know how to read the number of a partition but I need
the number of the harddisk or another explicit number.
The Mac-Address would be another possibility but not
everyone has a network-card inside.

After a new Installation or changing the operating system,
the number must be the same.

I think it works with WMI but this is not on every
computer or operating system (win98).

If there is no easy way, is it possible to install WMI
with a vb.net setup? I install already the .Net framework
in the setup with the bootstrapper. is it possilbe to
install more than one programm with a setup and how it
works exactly?

Thank you very much for your help
 
C

Cor

Hi Martin,

On the form I see I did not make it myself but I do not know anymore who it
was, I suspect it was Ken.

I hope this helps?

Cor

\\
Dim disk As New ManagementObject( _
"Win32_LogicalDisk.DeviceID=""C:""" _
)
Dim diskProperty As PropertyData
For Each diskProperty In disk.Properties
Console.WriteLine( _
"{0} = {1}", _
diskProperty.Name, _
diskProperty.Value _
)
Next diskProperty
///
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top