if we're just interested in the volume label, and nothing else, it's much
easier to use the Dir function instead.
?Dir("C:",vbVolume)
That's it!
For additional information, you will need to use GetVolumeInformation API.
And while we're on the subject of Volume Labels.... Yes, this value changes every time a
drive is formatted. No, there's no way in VBA (that I know of) to retrieve the
manufacturer's serial number or the BIOS number. And yes, using this technique for
copy-protection will cause endless headaches to your users.
|