DriveList$
List$ = DriveList$()
 
Parameters: NONE
Returns:

    List$ = A list of drive letters found in this computer
 

      The DriveList$ function returns a list of drive letters that are available in this computer. The drives letters are returned string form.

      The returned string will be in the following form "A:C:". In this example, this computer would have an 'A:' drive (floppy device) and 'C:' drive installed




FACTS:


      * Each device is represented with a drive letter followed by a colon. Ie. "C:" If the machine has more than one device present (which should be all machines) the drive letters will be listed like so. "A:C:" etc You can use MID$() function to extract the various device letters.




Mini Tutorial:


      This example reads the current drive (device) list, then 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 storage deviced 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: CD | CurrentDrive$ | DriveExist | DriveName$ | DriveReady | DriveSerial :
 


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