×
INTELLIGENT WORK FORUMS
FOR ENGINEERING PROFESSIONALS

Log In

Come Join Us!

Are you an
Engineering professional?
Join Eng-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Eng-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

How to get the Hard Drive Serial Number given by the Manufacturer with

How to get the Hard Drive Serial Number given by the Manufacturer with

How to get the Hard Drive Serial Number given by the Manufacturer with

(OP)
How to get the Hard Drive Serial Number given by the Manufacturer with VBA?

Please note that I need Number given by Manufacturer & not Hard drive serial number which is a random number that is generated by DOS or Windows every time you format your hard drive.

Thanks

    
 
Replies continue below

Recommended for you

RE: How to get the Hard Drive Serial Number given by the Manufacturer with

You might check at Tek-Tips.com - a sister site to this one and it is where the computer geeks live.

RE: How to get the Hard Drive Serial Number given by the Manufacturer with

Check with the hard drive manufacturer. Most of them have tools for that.

RE: How to get the Hard Drive Serial Number given by the Manufacturer with

Double posting is NOT a good idea and is confusing!!

RE: How to get the Hard Drive Serial Number given by the Manufacturer with

There is some code buried in the discussion here:
http://thedailyreviewer.com/office/view/programmatically-obtain-the-hard-disks-serial-number-from-vba-101853101

I have re-written it to work as an Excel UDF:

CODE

Function GetPhysicalSerial() As Variant

Dim obj As Object
Dim WMI As Object
Dim SNList() As String, i As Long, Count As Long

Set WMI = GetObject("WinMgmts:")

For Each obj In WMI.InstancesOf("Win32_PhysicalMedia")
If obj.SerialNumber <> "" Then Count = Count + 1
Next

ReDim SNList(1 To Count, 1 To 1)

i = 1
For Each obj In WMI.InstancesOf("Win32_PhysicalMedia")
 SNList(i, 1) = obj.SerialNumber
i = i + 1
If i > Count Then Exit For
Next

GetPhysicalSerial = SNList
End Function

Paste into a VB code module, then enter =GetPhysicalSerial() anywhere on a worksheet.  If you have more than one physical hard drive enter as an array function to return the serial number for each drive.

Doug Jenkins
Interactive Design Services
http://newtonexcelbach.wordpress.com/
 

RE: How to get the Hard Drive Serial Number given by the Manufacturer with

(OP)
What other information we can get from WinMgmts: ?

RE: How to get the Hard Drive Serial Number given by the Manufacturer with

Quote:

What other information we can get from WinMgmts: ?  

I can't help there at the moment.  I have never seen this object before, and I don't recall reading about it in any book I have.  I can only suggest following up the links in the discussion I linked to in my previous post.  If I have time to do some research myself I will post something on my blog, but I don't know when that will be.

Doug Jenkins
Interactive Design Services
http://newtonexcelbach.wordpress.com/
 

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Eng-Tips Forums free from inappropriate posts.
The Eng-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Eng-Tips forums is a member-only feature.

Click Here to join Eng-Tips and talk with other members! Already a Member? Login



News


Close Box

Join Eng-Tips® Today!

Join your peers on the Internet's largest technical engineering professional community.
It's easy to join and it's free.

Here's Why Members Love Eng-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close