VBScript » FileSystemObject » GetDriveName

Version: 2.0

Syntax:
object.GetDriveName(path)

This method gets a string containing the name of the drive in a supplied path.

If the drive cannot be determined the GetDriveName method will return an empty string.

Note that this method doesn't check the existance or the validity of the supplied path.

Examples

Code:
<%
dim filesys, a
Set filesys = CreateObject("Scripting.FileSystemObject")
a = filesys.GetDriveName("c:\DevGuru\website\VBScript.txt")
Response.Write (a)
%>
Output:
"c:"