ASP GetDriveName Method

Definition and Usage

The GetDriveName method returns a string that represents the drive name of the specified path.

Syntax:

FileSystemObject.GetDriveName(path)
Parameter Description
Path Required. Returns the path of the drive name.

Instance

<%
dim fs,dname
set fs=Server.CreateObject("Scripting.FileSystemObject")
dname=fs.GetDriveName("c:\test\test.htm")
Response.Write(dname)
set fs=nothing
%>

Output:

c: