Return a list of all existing and ready drives on the server using the Drive
function.
<%
Call PrintDriveLists()
Private Sub PrintDriveLists()
Dim i, a, drv, readydrives
Dim availablebutnotready
readydrives = ""
availablebutnotready = ""
for i = 65 to 90 ' A - Z
drv = chr(i)
a = Drive(drv)
If IsNull(a) Then
availablebutnotready = _
availablebutnotready & _
drv & ", "
ElseIf IsEmpty(a) Then
Else
readydrives = _
readydrives & _
a & ", "
End If
next
Response.Write "Ready Drives:<BR>"
Response.Write readydrives & "<BR><BR>"
Response.Write "Available Drives That Are Not Ready:<BR>"
Response.Write availablebutnotready & "<BR><BR>"
End Sub
%>
<%
Private Function Drive(byVal driveSpec)
Dim objFSO, boolFound, objDrive
Set objFSO = Server.CreateObject("Scripting.FileSystemObject")
boolFound = objFSO.DriveExists(driveSpec)
if boolFound then
Set objDrive = objFSO.GetDrive(driveSpec)
if objDrive.IsReady Then
Drive = objDrive.DriveLetter
else
Drive = Null
end if
Set objDrive = Nothing
else
Drive = Empty
End If
Set objFSO = Nothing
End Function
%>