VBScript » FileSystemObject » GetParentFolderName

Version: 2.0

Syntax:
object.GetParentFolderName(path)

Returns a string containing the name of the parent folder of the last file or folder in a specified path.

If no component matches the supplied path string the GetParentFolderName 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.GetParentFolderName("c:\DevGuru\website\VBScript.txt")
Response.Write (a)
%>
Output:
"c:\DevGuru\website\"