The GetDrive Method in ASP is used for returning the Drive Object that correspondence to a drive in a specified path. It is a predefined method of the FileSystem Object.
Syntax:
FileSystemObject.GetDrive(drivespec)
Parameter Values:
- drivespec: It is a required attribute. It can be a drive letter (c), a drive letter with a colon appended (c:), a drive letter with a colon and path separator appended (c:), or any network share specification (\computer2\share1).
Example Code: Below code demonstrates the ASP GetDrive Method.
ASP
<% dim fs,d set fs=Server.CreateObject( "Scripting.FileSystemObject" )
set d=fs.GetDrive( "d:\")
response.write(" Drive is:" + d)
set fs=nothing %> |
Output:
Drive is: d