programming-examples/asp/FilesMaths/Drive Function.asp

20 lines
524 B
Plaintext
Raw Permalink Normal View History

2019-11-18 14:25:58 +01:00
<%
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
%>