DriveSerial
Serial = DriveSerial()
 
Parameters: NONE
Returns:

    Serial = The volume serial of the queried drive
 

      The DriveSerial function the volume serial number of selected drive letter.



FACTS:


      * Always check to see if a drive is ready before attempting to query information about it, such as it's volume name, serial, and even when dealing files or folders. The reason for this is user may be running this program or directing your program to read/write information to a drive that has no media stored within it. Like floppy, CD, or DVD drives





Mini Tutorial:


      This example reads the current drive list than displays the volume name, serial and ready status of each one.


  
; Read the Drive List in the string Drives$
  Drives$=DriveList$()
  
; display the drive list
  Print "Drive Letters In This Machine:"+Drives$
  
; loop through the drive list string
  For lp=1 To Len(drives$) Step 2
     
   ; Print a blant line to space the output out
     Print ""
     
   ; Grab the Drive Letter from the drive string
     DriveLetter$=Mid$(Drives$,lp,2)
     
   ; Display the stats about this drive.
     Print "Checking Drive:"+DriveLetter$
     Print "Drive Name:"+DriveName$(DriveLetter$)
     Print "Drive Ready:"+Str$(DriveReady(DriveLetter$))
     Print "Drive Serial:"+Str$(DriveSerial(DriveLetter$))
  Next lp
  
; Display the screen and wait for a key press
  Sync
  WaitKey
  



This example will return something like the following. It's output will differ on each computer, as each computer have a different collection of drives installed in it.

  
Drive Letters In This Machine:A:C:
  
Checking Drive:A:
Drive Name:
  Drive Ready:0
  Drive Serial:0
  
Checking Drive:C:
  Drive Name: Windows
  Drive Ready: 1
  Drive Serial: 131231234
  

 
Related Info: DriveExist | DriveList$ | DriveName$ :
 


(c) Copyright 2002 - 2024 - Kevin Picone - PlayBASIC.com