How to get serial number of main Hard drive in VBA

Searching EE, I've found many VB examples of how to read the serial number of the c: drive. However these do not work for VBA.  can anyone convert it to work for VBA or have the code ready?

Thank-you in advance.
detroitdrAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

KirrilianCommented:
It looks like you can use WMI in VBA to get this information.

Check out this link:
http://www.codeproject.com/KB/vbscript/VvvHardwareInfo.aspx
0
Jeffrey CoachmanMIS LiasonCommented:
detroitdr,

Also check out what SysInternals has to offer:
http://technet.microsoft.com/en-us/sysinternals/bb545046.aspx

JeffCoachman
0
detroitdrAuthor Commented:
Sysinternals doesn't do serial numbers of HD.
not does vvvhardwareInfo.

:<
0
10 Tips to Protect Your Business from Ransomware

Did you know that ransomware is the most widespread, destructive malware in the world today? It accounts for 39% of all security breaches, with ransomware gangsters projected to make $11.5B in profits from online extortion by 2019.

Jeffrey CoachmanMIS LiasonCommented:
detroitdr,

The SN does not change, so why not just copy it from the drive itself?

In other words, why do you need VBA to tell you what the SN is, if it will always be the same?
What is this being used for?

JeffCoachman
0
detroitdrAuthor Commented:
boag2000

I need to read the serial number of the main hard drive (c:) and store it in a table in Access 2003. I do not know how to read the serial number from within Access2003 VBA. That is what I'm trying to get.

I'm not wanting to take the computer apart to visually look at the serial number, nor can I use any other programs to do it. I have to do it within VBA (Access 2003)

Any ideas?

(Yes the serial number does not change.)
0
Jeffrey CoachmanMIS LiasonCommented:
detroitdr,

 "(Yes the serial number does not change.)"

How does this happen? I did not know that a Hard drive's serial number could changed on demand?

JeffCoachman
0
detroitdrAuthor Commented:
"Yes the serial number does NOT change"

I'm agreeing with you. you can not change the serial number on a HD. All I want to do is read the serial number of a HD using VBA

Thx
0
Jeffrey CoachmanMIS LiasonCommented:
Oh, OK,

Sorry for the misunderstanding.
;-)

There may be a third party app out there that can do this.

Did you try a google search?

Jeff
0
GRayLCommented:
0
GRayLCommented:
Simply from the Immediate Pane:

? CreateObject("Scripting.FileSystemObject").GetDrive("a:\").SerialNumber
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
GRayLCommented:
Change "a:\" to "C:\" for drive c.
0
detroitdrAuthor Commented:
GRayl:

This is the VOL serial number of the HD, not the HD serial number itself. The Vol serial number changes every formatting. The HD serial number can not change. It's on the HD firmware itself.
0
Jeffrey CoachmanMIS LiasonCommented:
detroitdr,

"This is the VOL serial number of the HD, not the HD serial number itself. "
Well, ...You did not make this distinction clear in your original post.
;-)

JeffCoachman
0
GRayLCommented:
There is a piece of freeware at http://www.codeproject.com/KB/cs/hard_disk_serialno.aspx but you have to sign up.
0
detroitdrAuthor Commented:
Grayl, this is in C, not VBA.. I'll take it that it's very hard to do and not worth persueing. so I'll award equal points... really there still is not an answer to this. Thx all for your efforts!


0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft Access

From novice to tech pro — start learning today.