DriveExist
State = DriveExist(FolderName$)
 
Parameters:

    FolderName$ = The name of folder you wish to check
Returns:

    State = 1 - file exists, 0 = file does not exist
 

      The DriveExist function checks if a drive (or device) exists in this machine. You can use this command to check what storage devices this computer has installed.




FACTS:


      * DriveExist can be used with any media device contected to your PC. From Hard Drives and CD/DVD drives right through to digitial cameras and Mp3 players if you wanted. As such you should never assume that just because your test PC has a particular device letter other machines will also have it.





Mini Tutorial:


      This example, check if a C: drive exists in this computer.

  
; Check if the C: Drive  exists in this computer
  If DriveExist("C:")=true
   ; if the Drive exists, then display success message
     Print "Yes, this drive exists"
  Else
   ; If the drive does NOT exist, then display
     Print "Nope, this does not exist"
  EndIf
  
; Display the screen and wait for a key press
  Sync
  WaitKey
  
  



This example returns the following.

  
  yes, This drive exists
  

 
Related Info: CD | CurrentDir$ | CurrentDrive$ | FileExist | FolderExist :
 


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