Displaying  Source Code(s)  
 

 
Drive Function

--------------------------------------------------------------------------------

Description : The Drive Function checks a drive for existence and then checks it's readiness. There is one required argument, drivespec which must be a letter representing a drive (A-Z) on the server. The Drive function returns the letter of the drive if it exists and is ready. If the drive exists but is not ready, Drive returns Null. If the drive does not exist, Drive returns Empty.

<%
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
%>

 

Contribute content or training reports / feedback / Comments
job placement papers
All rights reserved © copyright 123ENG