Show Buttons
Share On Facebook
Share On Twitter
Share On Google Plus
Share On Linkdin
Share On Reddit
Contact us
Hide Buttons

FileSystemObject : DriveExists Method


Returns True if a spec­i­fied drive exists; False if it does not.

Format : 

objectOf­FileSys­te­mOb­ject. DriveExists(DriveName)

  • objectOf­FileSys­te­mOb­ject : As the names says, it’s a FileSystemObject.
  • file­Name
    • Manda­tory
    • Type:     String
    • Drive name , whose exis­tence to be determined.

Function FnIsDriveExist(strDriveName)
      Set fso = CreateObject("Scripting.FileSystemObject")
      If fso. DriveExists(strDriveName)Then
                    strStatus = strDriveName & “  drive exists”
                    strStatus = strDriveName & “  drive does not exist”
           End If
        FnIsDriveExist = strStatus
End Function

Msg­box FnIs­Drive­Ex­ist (“c”)


You may also like...

Leave a Reply

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

%d bloggers like this: