Validate_Drive

By | 2002-06-01

Validates whether a given hard/floppy/network drive is valid

Original Author: Ian Ippolito (psc)

Inputs

strDrive–drive to validate

Returns

i the dirve exists returns TRUE, otherwise FALSE

Code

Function Validate_Drive (ByVal strDrive As String)

  On Error GoTo BAD2
    'Dim strOldDrive As String
    'strOldDrive = Get_Drive_Name(CurDir$)
    ChDrive (strDrive)
    'ChDrive (strOldDrive)
  On Error GoTo 0
  Validate_Drive = True
Exit Function
BAD2:
  Validate_Drive = False
  Resume Exit2
Exit2:
  Exit Function

End Function

Author: dwirch

Derek Wirch is a seasoned IT professional with an impressive career dating back to 1986. He brings a wealth of knowledge and hands-on experience that is invaluable to those embarking on their journey in the tech industry.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.