The ASP DriveExists Method is used for returning the Boolean Value which indicates that whether the particular drive will be exits or not. It returns true means the particular drive exits or returns false if the particular drive not exits.
Syntax
FileSystemObject.DriveExists(drive)
Parameter Values
- drive: It is a required attribute. It specifies a drive letter or a complete path specification.
Example: Below example demonstrates the DriveExists Method.
<%
dim gfg
set gfg=Server.CreateObject("Scripting.FileSystemObject")
if gfg.DriveExists("d:")=true then
response.write("Drive d: exists!")
else
response.write("Drive d: does not exist.")
end If
set gfg=nothing
%>
Output:
Drive d: exists