Hard Drive Serial Number/Total Drive Size 
Author Message
 Hard Drive Serial Number/Total Drive Size

I need a method to obtain the hard drives serial number and total drive size
from
Visual Basic (5.0).  I tried using scrrun.dll but have problems with
registering it as
an activex component with the installation program.

Is there an API or some other method of getting this information without
being
dependant on the scripting dll?

Any thoughts appreciated, thanks...



Fri, 22 Jun 2001 03:00:00 GMT  
 Hard Drive Serial Number/Total Drive Size

Quote:

>I need a method to obtain the hard drives serial number and total drive
size
>from
>visual basic (5.0).

You can use the API calls
    GetVolumeInformation
        (serial number)
    and
    GetDiskFreeSpace
        (drive size)

__
Jan Ove Ofstad
System developer, Superior Systems AS



Sun, 24 Jun 2001 03:00:00 GMT  
 Hard Drive Serial Number/Total Drive Size
For getting drive serial number use 'GetVolumeInformation' API.

Miroslav ?ulc
----------------------------------------------------------------------------
---------

Quote:
>I need a method to obtain the hard drives serial number and total drive
size
>from
>visual basic (5.0).  I tried using scrrun.dll but have problems with
>registering it as
>an activex component with the installation program.

>Is there an API or some other method of getting this information without
>being
>dependant on the scripting dll?

>Any thoughts appreciated, thanks...



Sun, 24 Jun 2001 03:00:00 GMT  
 Hard Drive Serial Number/Total Drive Size
You might be interested in the examples :

Manipulating System Tray Icons using Shell_NotifyIcon, Advanced
Add and respond to an icon placed in the System Tray. Demos using the
systray to display drive statistics via GetDriveSpaceFreeEx.

http://www.mvps.org/vbnet/code/shell/shellnotifybasic.htm
http://www.mvps.org/vbnet/code/shell/shellnotifyadv.htm

.. or several other disk-info methods .....

http://www.mvps.org/vbnet/code/shell/diskspace.htm
http://www.mvps.org/vbnet/code/shell/diskspacefat32.htm
http://www.mvps.org/vbnet/code/shell/volumelabel.htm
http://www.mvps.org/vbnet/code/shell/drivetype.htm

--

Randy Birch, MVP Visual Basic

http://www.mvps.org/vbnet/
http://www.mvps.org/ccrp/

To assist in maintaining this thread for the benefit of
others, please post any response to this newsgroup.

Quote:

>I need a method to obtain the hard drives serial number and total drive
size
>from
>visual basic (5.0).  I tried using scrrun.dll but have problems with
>registering it as
>an activex component with the installation program.

>Is there an API or some other method of getting this information without
>being
>dependant on the scripting dll?

>Any thoughts appreciated, thanks...



Mon, 25 Jun 2001 03:00:00 GMT  
 Hard Drive Serial Number/Total Drive Size
I tried the example at:
http://www.mvps.org/vbnet/code/shell/volumelabel.htm
and found an oversight with the way 'format' function is being used. The
Online manual for VB5 is not real clear about how it works but this is
what I discovered.

If you have a HexStr that = "9D0" it comes back with "0009"... but so
does "9E0"
hmmm.  How about "9D1"?  result "0090"
"9D2"    result "0900"
"9D3"    result "9000"

It seems that the D acts like E with scientific notation.
I guess 'format' is not really designed to be used with HEX

VolumeLabel.htm has a problem with printing the Volume Serial Number.

   'determine the drive volume id
   HiWord = GetHiWord(VolumeSN) And &HFFFF&
   LoWord = GetLoWord(VolumeSN) And &HFFFF&
   HiHexStr = Format$(Hex(HiWord), "0000")
   LoHexStr = Format$(Hex(LoWord), "0000")



Sat, 07 Jul 2001 03:00:00 GMT  
 
 [ 5 post ] 

 Relevant Pages 

1. hard drive serial number

2. Reading the Hard Drives Serial Number

3. Hard Drive Serial Number

4. Hard Drive Volume Serial Number

5. Reading the hard drive's serial number

6. Hard drive serial number

7. Getting Hard Drive Serial number

8. How can I get the serial (or other) number of my hard drive through VB

9. How can I get the serial (or other) number of my hard drive through VB

10. API call for hard drive serial number

11. Hard Drive Serial Numbers

12. Hard Drive Serial Numbers

 

 
Powered by phpBB® Forum Software